0% found this document useful (0 votes)
5 views

Chapter 4 Modified

Module 5 covers key concepts in computer communication and networks, including packet switching, IP addressing, and routing protocols. It discusses both datagram and virtual circuit switching, highlighting their differences in connection management and data transfer. The module also addresses fragmentation and reassembly of packets to accommodate varying maximum transmission units across different networks.

Uploaded by

hgull8490
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Chapter 4 Modified

Module 5 covers key concepts in computer communication and networks, including packet switching, IP addressing, and routing protocols. It discusses both datagram and virtual circuit switching, highlighting their differences in connection management and data transfer. The module also addresses fragmentation and reassembly of packets to accommodate varying maximum transmission units across different networks.

Uploaded by

hgull8490
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 88

Module 5

Computer Communication & Networks


•Packet switching
•Fragmentation & Reassembly
• IP Addressing Scheme
•Datagram Forwarding
•Address Resolution Protocol
•Dynamic Host Configuration Protocol
•Routing Vs Forwarding
•Distance Vector (Bellman-Ford Algorithm)
•Routing Information Protocol (RIP)
•Link State Routing (Dijkstra`s Algorithm)
•Open Shortest Path First (OSPF)
1
Module 5: Internetworking
Reading: Book Chapter 4
Web References:
1. http://www.tcpipguide.com/free/t_IPDatagramGeneralFormat.htm
a. Pages 1-3
2. http://www.tcpipguide.com/free/t_IPMessageFragmentationProcess.htm
a. Pages 1-4

2
Internet Protocol (IP)
• Network protocol for the Internet
• Operates on all hosts and routers (routers connect
distinct networks into the Internet)
FTP HTTP NV TFTP

TCP UDP

IP

FDDI Ethernet … ATM


3
Packet Switching / Forwarding
• Three approaches
– Datagram or connectionless approach
– Virtual circuit or connection-oriented
approach
– Source routing
• Important notion: unique global
address per host
4
Datagram Switching / Forwarding
• Every packet contains enough information
– Enables switch to decide how to forward it
• Switch translates global address to output
port
– Maintains forwarding table for translations
• Each packet forwarded and travels
independently

5
Datagram Switching / Forwarding
• No connection setup phase
(connectionless model)
• Analogy:
– Postal system: each packet contains
complete address for its destination
– Following signs (provided by
switches) to reach destination
6
Datagram Switching
• Managing tables in large, complex networks with
dynamically changing topologies is a real
challenge for the routing protocol
Host E

At switch 1: Host D

Dest Port#/Interface 2 Switch 2


Host F

A 2 3
Switch 1
B 1 0
1
0
C 3 3
1
D 0 Host C 2

E 1
… … 0
Switch 3
Host A Host G Host B
1
3
2

7
Host H
Datagram Switching
• What happens if the destination is unknown ?
• Network discards packet
– Possibly notifying the sender (“no route to host”)
Host E
EC C data
Host D
Host F
2 Switch 2
BA A data
Switch 1 3
0
1
CF F data 3 0
1
Host C 2

DB B data
Switch 3
Host A 0
Host G Host B
AK?? K data 1
3
2

8
Host H
Datagram Model
• No round trip time delay waiting for connection setup
– Host can send data anywhere, anytime as soon as it is ready
– Source has no way of knowing if the network is capable of
delivering a packet or if the destination host is even up
• Packets are treated independently
– Possible to route around link and node failures dynamically

9
Datagram Model
• Every packet carries full address of
the destination
– Overhead per packet is higher than for
the connection-oriented model
– Global address to path translation
requires storage
– Might not be possible to deliver packet
(dest unknown)
10
Virtual Circuit Switching

• Explicit connection setup (& tear-down)


phase from source to destination:
connection-oriented model
– Subsequence packets follow established
circuit

11
Virtual Circuit Switching
• Each switch maintains a VC table
(connection state) per-link or per-switch
• Analogy
– Phone call: each packet follows an
established path
– Following a known route to reach the
destination
12
VC Tables in VC Switching
• VC table contains information for
each connection
– incoming / outgoing interface (port)
– incoming / outgoing VCI (virtual
circuit identifier)
• Permanent (PVC) or switched
(signaled) virtual circuit (SVC)
13
VC Tables in VC Switching
• Setup message in signaling process (to
create VC table) is forwarded like a
datagram
• Acknowledgment of connection setup
to downstream neighbors to complete
signaling
– Data transfer phase can start after ACK
is received
14
Signaling in VC Switching
I/F VCI I/F VCI
• Setup message is I/F VCI I/F VCI
in in out out
3 9 0
forwarded from in in out out
2 5 1
Host A to Host B 2
Switch 2

0 Switch 1 3 1

• On connection
0
3 1
setup B

request, each 2
setup B

switch creates an setup B

entry in VC table 2
Switch 3

with a VCI for the Host A Host B


1

connection I/F VCI I/F VCI 0


3

setup B
in in out out
2 7 3
15
Signaling in VC Switching
I/F VCI I/F VCI
• Host B accepts I/F VCI I/F VCI
in in out out
3 9 0 7
connection from in in out out
2 5 1 9
Host A, and sends 2
Switch 2

back an ACK 0 Switch 1


ACK 9
3 1
0
3 1

• In ACK, everyone 2
ACK 5
communicates its ACK 7
choice of VCI to 2
Switch 3

its upstream Host A Host B


1

neighbor I/F VCI I/F VCI 0


3

ACK 4
in in out out
2 7 3 4
16
Data Transfer in VC Switching
I/F VCI I/F VCI
• Host A knows that I/F VCI I/F VCI
in in out out
3 9 0 7
everything is in in in out out
2 5 1 9
place all the way 2
Switch 2

to Host B 0 Switch 1 3 1
0
3 1
data 7

• In data packets, 2
data 9

each node then data 5

puts the VCI of 2


Switch 3

its downstream Host A Host B


1

neighbor I/F VCI I/F VCI 0


3

data 4
in in out out
2 7 3 4
17
Virtual Circuit Model

• Typically wait full RTT for


connection setup before sending
first data packet
– Can not avoid failures dynamically;
must re-establish connection (old
one is torn down to free storage
space)
18
Virtual Circuit Model
• Each data packet contains only a small
identifier, making the per-packet header
overhead small
– Global address to path information still
necessary
• Connection setup provides an opportunity
to know network conditions and/or
reserve resources.
– Avoiding congestion but under-utilizing
switch
19
Source Routing

• Packet header contains sequence of


address/ports on path from source to
destination
– One direction per switch: port, next
switch; (absolute)
– Switches read, use, and then discard
directions
20
Source Routing
• All forwarding/topology
information required to switch a
packet is provided by source host
• Used in some system area
networks (SANs), Ad-hoc
networks
• Directions may be rotated instead
21

of discarding
Data Transfer in Source Routing
• Analogous to
2 Switch 2
following
directions 0 Switch 1 3 1
0
3 1

data 1 3 0
2 data 0 1 3

data 3 0 1

Switch 3
2
Host A Host B
data 1 0 3
1
3
data 2 3 0 1
0
data 3 0 1

22
Source Routing Model
• Source host needs to know the
correct and complete topology of
the network
– Changes must propagate to all hosts
• Packet headers may be large and
variable in size: the length is
unpredictable
23
Source Routing Model

• Each switch needs to correctly and


efficiently manipulate the header
information
– Rotation or stripping of address
– Pointer to current address

24
Internetwork
• Concatenation of networks
H6 H7
H1 R3
Network R1 Network 2
Network11 Network
Network33 Network
Network44
Ethernet
Ethernet FDDI
FDDI Ethernet
Ethernet
Point
-to- R2
H5
point H8
H2 H3 H4

• Protocol stack
H1 H8
TCP R1 R2 R3 TCP

IP IP IP IP IP

ETH ETH PPP PPP FDDI FDDI ETH ETH

25
Service Model
• Host to host delivery of packets (datagrams)
• Addressing- Globally unique IP address per `host`
• Un-reliable but simple
• Connection-less forwarding and hence datagram
Design choices
1. Simple and un-reliable (best effort): leads to simple
routers implementation
2. Complex but reliable: leads to complex routers
implementations
 Keeping the routers as simple as possible was one of the
original design goals of IP
26
Datagram Format
0 4 8 16 19 31
Version HLen TOS Length

Ident Flags Offset


TTL Protocol Checksum
SourceAddr

DestinationAddr

Options (variable) Pad


(variable)
Data

• 4-bits version (4 for IPv4, 6 for IPv6)


• 4-bits header length (in words(32 bits), minimum of 5)
• 8-bits type of service (TOS); more or less unused- read section 6.5.3 of the
book for detailed treatment
• 16-bits datagram length including the header(in bytes)
– Maximum datagram length: 216 =65,535 bytes
• 8-bits protocol (e.g., TCP=6 or UDP=17)
– Protocol: 8 bit demux key, why do we need it? 27
Datagram Format
0 4 8 16 19 31
Version HLen TOS Length

Ident Flags Offset


TTL Protocol Checksum
SourceAddr

DestinationAddr

Options (variable) Pad


(variable)
Data

• Fragmentation support
– 16-bit packet ID (identifies packet fragments)
– 3-bit flags; one bit marks last fragment
– 13-bit fragment offset into packet (in 8-byte words)
• 8-bit “time-to-live” (TTL); a hop count until
forced destruction of packet
28
Datagram Format
• 16-bit IP checksum on header
• 32-bit source IP address
• 32-bit destination IP address
• Options and padding (variable length)
– Source-based routing (typically disabled)
– Record route 0 4 8 16 19 31
Version HLen TOS Length
– Several others Ident Flags Offset
TTL Protocol Checksum
SourceAddr

DestinationAddr

Options (variable) Pad


(variable)
Data

29
Datagram Format

30
Fragmentation and Reassembly
• Goal of IP: Providing a uniform host-to-host service model
over a heterogeneous collection of networks
• Problem with heterogeneity: Each network technology tends
to have its own idea of how large a packet/frame can be!!
• Every underlying network technology has got its own upper
limit on the packet size
– Ethernet frame size up to 1500 bytes long
– FDDI frames may be 4500 bytes long.
• What are the choices for the IP service model
– Send small enough packets
– Send datagram equal to the smallest frame size in the path
– Fragmentation and reassembly
31
Fragmentation and Reassembly
• Every network type has a maximum transmission unit
(MTU)
– the largest IP datagram that it can carry in a frame
• A reasonable choice for the IP datagram size is the MTU of
the network to which the host is directly attached.
• Fragmentation will only be necessary, if the path to the
destination includes a network with a smaller MTU
• Fragmentation typically occurs in a router when it receives
a datagram that it wants to forward over a network that has
an MTU that is smaller than the received datagram.

32
Fragmentation and Reassembly
For reassembly at the receiving host, all fragments carry the
same identifier in the Ident field.
Ident is chosen by the “sending host” and is intended to be
unique among all the datagrams that might arrive at the
destination from this source over some reasonable time
period.
Reassembly is performed at the receiving host
Fragmentation is performed at the intermediate routers
0 4 8 16 19 31
V ersion HLen TOS Length
Ident Flags Offset
TTL Protocol Checksum
SourceAddr
DestinationAddr
Options (variable) Pad
(variable)
Data

33
Fragmentation and Reassembly Example
•1420-byte datagram (20-byte IP header plus 1400 bytes of data) sent from H1
•H1 set Ident to X. Will it perform the fragmentation?
•NO, why ?
•Note the connection between R2 and R3
•MTU of ppp is 532 bytes. What will be the max payload size ?
•Look at the M bit in all the three fragments, 1, 1 and zero.
•Offset in the first fragment = 0, meaning that it is the first fragment
•Offset of the second fragment=64= data in the first fragment/8
•Offset in the second fragment=128=data in the first+second/8
Start of header

Ident= x 1 Offset= 0
Rest of header

512 data bytes

H1 R1 R2 R3 H8
Start of header

Ident= x 1 Offset= 64
Rest of header

512 data bytes


ETH IP (1400) FDDI IP (1400) PPP IP (512) ETH IP (512)

PPP IP (512) ETH IP (512) Start of header

Ident= x 0 Offset= 128


PPP IP (376) ETH IP (376)
Rest of header

Start of header 376 data bytes


Ident= x 0 Offset= 0
Rest of header
34
1400 data bytes
Fragmentation and Reassembly Questions

• Is each fragment a self contained IP datagram and


travels independently over the internetwork?
• What if a fragmented datagram reaches at a router
and the MTU size is smaller than its size? Will
there be a fragmentation again ?
– What will be the Ident field in this case ?
• How the fragmentation and reassembly tackles the
heterogeneity of the internetwork?

35
IP Addresses
7 bits (126 nets) 24 bits (16 million hosts)
Class A: 0 Network Host

14 bits (16k nets) 16 bits (64K hosts)


Class B: 1 0 Network Host

21 bits (2 million nets) 8 bits (256)


Class C: 1 1 0 Network Host

– 18.10.5.22 host in class A network (MIT)


– 130.126.143.254 host in class B network (UIUC)
– 192.12.70.111 host in class C network
• More recent classes
– Multicast (class D): starts with 1110
– Future expansions (class E): starts with 1111
36
IP Addressing Scheme
• IP service model provides
– UNIQUE global addressing scheme, called IP address, for
the Host-to- Host connectivity.
– Segmentation and Reassembly.
• Comment about global unique addresses- What are
the alternatives ??
– Why not use the Ethernet/MAC global unique addresses at
the network layer ?-
• Globally unique but…
• No Hierarchy !!!! – and we need one with it.
• Routing issues with link layer addresses, they don’t
scale.
• Solution: IP addresses

37
Are You the Host or the Network?

• Each Network is assigned a network address &


every device or interface (such as a router port or a
computer) on the network is assigned a host
address.
• There are only 2 specific rules that govern the value
of the address.
– A host address cannot be designated by all zeros or all
ones.
– There are special addresses that are reserved for special
purposes.
38
IP Address Classes

• Called IP classfull addresses, there are some


classless….
• IP addresses are divided into 5 classes, each of
which is designated with the alphabetic letters A,
B, C, D and E.
• Class D addresses are used for multicasting.
• Class E addresses are reserved for testing & some
future use.
• A, B and C are the focus of our discussion.
39
IP Address Classes (Cont.)

• The 5 IP classes are split up based on the


value in the 1st octet (8 bits):

40
IP Address Classes (Cont.)
• The 32 bits of the IP address are divided into
Network & Host portions, with the octets assigned
as a part of one or the other.
Network & Host Representation
By IP Address Class

Class Octet1 Octet2 Octet3 Octet4

Class A Network Host Host Host

Class B Network Network Host Host

Class C Network Network Network Host

41
Class A Addresses
• Class A IP addresses use the 1st 8 bits (1st Octet) to
designate the Network address.
• The 1st bit which is always a 0, is used to indicate
the address as a Class A address & the remaining
7 bits are used to designate the Network.
• The other 3 octets contain the Host address.

42
Class A Addresses (Cont.)
• Class A Network combinations
– 27 = 128.
– 00000000 to 01111111
• Since addresses with all zeros aren’t used &
address 127 is a special purpose address
– 27 -2=126 Class A Networks are available.

43
Class A Addresses (Cont.)
• There are 16,777,214 Host addresses available in a
Class A address.
• Rather than remembering this number exactly, you
can use the following formula to compute the
number of hosts available in any of the class
addresses, where “n” represents the number of bits
in the host portion:
(2n – 2) = Number of available hosts

44
Class A Addresses (Cont.)
• For a Class A network, there are:
224 – 2 or 16,777,214 hosts.
• Half of all IP addresses are Class A addresses.
• You can use the same formula to determine the
number of Networks in an address class.
• Eg., a Class A address uses 7 bits to designate
the network, so (27 – 2) = 126 or there can be
126 Class A Networks.

45
Class B IP Addresses
• Class B addresses use the 1st 16 bits (two octets)
for the Network address.
• The last 2 octets are used for the Host address.
• The 1st 2 bit, which are always 10, designate the
address as a Class B address & 14 bits are used to
designate the Network. This leaves 16 bits (two
octets) to designate the Hosts.

46
Class B IP Addresses (Cont.)
• So how many Class B Networks can be there?
• Using the formula, (214 – 2), there can be 16,382
Class B Networks & each Network can have (216 –
2) Hosts, or 65,534 Hosts.

47
Class C IP Addresses
• Class C addresses use the 1st 24 bits (three octets)
for the Network address & only the last octet for
Host addresses. The 1st 3 bits of all class C
addresses are set to 110, leaving 21 bits for the
Network address, which means there can be
2,097,150 (221 – 2) Class C Networks, but only
254 (28 – 2) Hosts per Network.

48
Classes of IP Addresses

49
Special Addresses
• A few addresses are set aside for specific
purposes.
• Network addresses that are all binary zeros, all
binary ones & Network addresses beginning with
127 are special Network addresses.

50
Special Addresses (Cont.)

51
Special Addresses (Cont.)
• Within each address class is a set of addresses that
are set aside for use in local networks sitting
behind a firewall or NAT (Network Address
Translation) device or Networks not connected to
the Internet.

52
Special Addresses (Cont.)

• A list of these addresses for each IP address


class:

53
Datagram Forwarding
■ Every IP datagram contains the IP address of the destination host.

■ The “network part” of an IP address uniquely identifies a single


physical network that is part of the larger Internet.

■ All hosts and routers that share the same network part of their
address are connected to the same physical network and can thus
communicate with each other by sending frames over that network.

■ Every physical network that is part of the Internet has at least one
router that, by definition, is also connected to at least one other
physical network; this router can exchange packets with hosts or
routers on either network.

54
Datagram Forwarding
• A datagram is sent from a source host to a destination
host
– What are the possibilities for the destination host location?
• Any node, first tries to find out whether it is connected
to the same physical network as the destination node.
– How a node/host knows this ?
• If source and destination are on the same physical
network then,
– Send the datagram directly to the destination
• Otherwise,
– Send it to the router.
55
Datagram Forwarding Algorithm
For Router or Host with more
For Host with one interface
than one interface
if (NetworkNum of destination =
if (NetworkNum of destination =
my NetworkNum)
NetworkNum of one of my
then interfaces)
then
deliver packet to destination
deliver packet to destination over that
directly
interface
else elseif (NetworkNum of destination is
deliver packet to default router in my forwarding table)
then
deliver packet to NextHop router
else
deliver packet to default router

56
Datagram Forwarding- Example
• H1 wants to send a datagram to H2
•H1 and H2 have the same network number in
their IP addresses
•H1deduces that it can deliver the datagram
directly to H2 over the Ethernet.
•Issue -How H1 finds out the correct Ethernet
address for H2?
•H1 wants to send a datagram to H8
•H1 and H8 have different network number in
their IP addresses
•What action will H1 take ?
•Send it to R1
Forwarding
•What action R1 will take ?
table at R2
•Send it to R2
•And so on.....

57
Datagram Forwarding
Network # Netmask Next
Hop/Port

18.0.0.0 255.0.0.0 1
128.32.0.0 255.255.0.0 2
0.0.0.0 0.0.0.0 3

dest: 18.26.10.0 mask with 255.0.0.0 matched! send to port 1


dest: 128.16.14.0 mask with 255.0.0.0 not matched
mask with 255.255.0.0 not matched
mask with 0.0.0.0 matched! send to port 3
58
Reading Assignment
Page 258 to 260
Page 263 to 267

59
ARP Packet Format
0 8 16 31

Hardware type = 1 Protocol Type = 0x0800

HLen = 48 PLen = 32 Operation

SourceHardwareAddr (bytes 0 – 3)

SourceHardwareAddr (bytes 4 – 5) SourceProtocolAddr (bytes 0 – 1)

SourceProtocolAddr (bytes 2 – 3) TargetHardwareAddr (bytes 0 – 1)

TargetHardwareAddr (bytes 2 – 5)

TargetProtocolAddr (bytes 0 – 3)

60
Dynamic Host Configuration
Protocol- DHCP
• DHCP server is required to provide configuration
information to each host
– Each host retrieve this information on bootup
• DHCP server can be configured manually, or it may
allocate addresses on-demand
– Addresses are “leased” for some period of time
• Each host is not configured for DHCP server, it
performs a DHCP server discovery
– A broadcast discovery message is sent by the host and a
unicast reply is sent by the server
61
DHCP Server

Unicast to server

DHCP DHCP
Other networks
Broadcast relay server

Host

62
ICMP Message
• Sent to the source when a node is unable to process
IP datagram successfully
• Error messages
– Destination unreachable (protocol, port, or host)
– Reassembly failed
– IP Checksum failed; or invalid header
– TTL exceeded (so datagrams don’t cycle forever)
– Cannot fragment
• Control messages
– Echo (ping) request and reply
– Redirect (from router to source host, to change route)
63
Forwarding vs Routing
• Routers and switches have enough knowledge to
decide the output port for a packet packet
forwarding
– In case of Virtual Circuits, each packet follows the same
pre-determined path.
– In case of IP datagram forwarding, each packet
destination address is matched with the FORWARDING
TABLE entries to decide the appropriate output.
– In case of source routing, each packet carries the full
path in its header.
• The Question is, how do the routers build their
forwarding tables ?
64
Routing
• Routing is the process by which forwarding tables are
built.
• While forwarding is performed locally within a node,
routing is gathering the information at a larger scale for
forwarding decisions
– Simple vs Complex
– FT optimized for local forwarding, RT optimized for topology
changes
Forwarding Table Routing Table

65
Routing
Malakand Chowk
Charsada Chowk

Pakistan
Dosehra Chowk Chowk

Meezan Chowk

College Chowk

• A stranger appears and asks “Pakistan


Chowk ?”
• Which way do you point ?
66
Routing- A problem of Graph Theory
A 6
1
3
2 F
1 E
B
4
1
9
C D

Static Routing vs Dynamic Routing ?


•It does not deal with node or link failures.
•It does not consider the addition of new nodes or links.
• It implies that edge costs cannot change

What about Centralized vs Distributed routing...?


• Can you see any problem with the centralized one ?
And hence Reactive Vs Proactive ? 67
Introduction to routing protocols
• A routing protocol is the communication used between routers to
exchange their reachabilities to networks and calculate their
capabilities to reach individual networks.
• HOW this communication takes place and at WHICH level
determines the type of routing protocol.
– Reactive vs Proactive
– Distance Vector vs Link State
– Static vs Dynamic
– Centralized vs Distributed
– Exterior vs Interior
• Examples of routing protocols used in the internetworks are:
– Routing Information Protocol (RIP)
– Interior Gateway Routing Protocol (IGRP)
– Enhanced Interior Gateway Routing Protocol (EIGRP)
– Open Shortest Path First (OSPF)
68
– Boarder Gateway Protocol (BGP)
Distance Vector (Using Bellman-Ford Algorithm)
(RIP)
• Starting Point: Each node knows the “distance”
(cost) of the link to each of its directly
connected(immediate) neighbours
• Each node constructs a one-dimensional
array(Vector) containing the “distances” (costs) to
all other nodes in the network.
• Each node distributes its Distance Vector to its
immediate neighbours.

69
Distance Vector Routing Example

Information in routing table of each node:


Iteration 1: Each node updates itself regarding its neighbours.

At Distance to reach node B

node A B C D E F G A
C

A 0 1 1 x 1 1 x D

B 1 0 1 x x x x E
C 1 1 0 1 x x x
D x x 1 0 x x 1 F G
E 1 x x x 0 x x
F 1 x x x x 0 1
G x x x 1 x 1 0
Distance Vector Routing Example

Information in routing table of each node:


Iteration 2: Each node exchanges this Vector of known and unknown
paths with the immediate neighbors

At Distance to reach node


B
node A B C D E F G
C
A 0 1 1 2 1 1 2 A
D
B 1 0 1 2 2 2 x
C 1 1 0 1 2 2 2 E

D 2 2 1 0 x 2 1
E 1 2 2 x 0 2 x F G

F 1 2 2 2 2 0 1
G 2 x 2 1 x 1 0
Distance Vector Routing Example
Information in routing table of each node:
Iteration 3: This continues, till the routing converges….

At Distance to reach node


B
node A B C D E F G
C
A 0 1 1 2 1 1 2 A
D
B 1 0 1 2 2 2 3
C 1 1 0 1 2 2 2 E

D 2 2 1 0 3 2 1
E 1 2 2 3 0 2 3 F G

F 1 2 2 2 2 0 1
G 2 3 2 1 3 1 0
Distance Vector Routing Table

Routing Table at Node B


B Destination Cost NextHop
C A 1 A
A
D C 1 C
E D 2 C
E 2 A
F G
F 2 A
G 3 A
A word about Convergence...
• When all the nodes in the network get consistent
information, we say, the system has been
converged.
• Should the nodes, at convergence, stop sending
the update messages to each others ????
– Yes, why...No, why not ?

74
Routing Updates
• Scheduled and periodic
– If nothing has changed, why do we need it ?
– Serves two purposes
• To let neighbours know that “I am alive”.
• To help neighbours if some of their routes have failed.
• Triggered
– Side by side with periodic updates
– Triggered when there is “any changes” in the routing table of
any node.
– Node failures, link failures etc.
• How do I know that a link/node in my neighbourhood has
failed ?
75
Count to Infinity Problem
• Link from A to E fails
• Consider the scenario that in an iteration:
– A advertises, to its neighbors, a distance of
infinity to reach E.
– At the same time C advertises a distance of 2
to its neighbors(A, B, D) to reach E.
– B updated its routing table showing that it B

can reach E in 3 hops; advertises this to all. A


C

D
– Let say A recieves B’s update prior to C E
update regarding reaching to E and update its
table. Now decides it can reach E in 4 hops; F G

advertises this to all


– C decides that it can reach E in 5 hops…
– We are counting to infinity …
Routing Information Protocol (RIP)
• A straightforward and simple implementation of
Distance Vector (Bellman-Ford Algorithm ).
• One of the most widely used routing protocols in IP
networks- was part of BSD.....
• Differs very slightly from the idealized graph model,
described earlier.
• In internetwork, the goal of each router is to learn as
HOW to reach to various networks.
• Rather than advertising the cost of reaching other
routers, the routers advertise the cost of reaching
networks.
77
Routing Information Protocol (RIP)-Packet Format

78
Routing Information Protocol (RIP)
Iteration 1:
•Router C would advertise to routers A and D
that:
• It can reach networks 2 and 3 (to which it is
directly connected) at a cost of 0
•It can reach networks 5 and 6 at cost of
INF(16).
•It can reach network 4 at cost INF(16).

79
Distance Vector vs. Link State
Routing-The Difference
• In distance vector, each node talks only to its
directly connected neighbors, but it tells them
everything it has learned (i.e., distance to all nodes
in the network).
• In link state, each node talks to all other nodes,
but it tells them only what it knows for sure (i.e.,
only the state of its directly connected links).
Operation of a Link State Routing
protocol

Received Link State Dijkstra’s IP Routing


LSAs Database Algorithm Table

LSAs are flooded


to other interfaces

*LSA=
81 Link State
Reliable Flooding
• The process of making sure that all the nodes
participating in the routing protocol get a copy of the
link-state information from all the other nodes.
• The basic idea is for a node to send its link-state
information out on all of its directly connected links,
with each node that receives this information
forwarding it out on all of its links.
• This process continues until the information has
reached all the nodes in the network.
Link State Packet
• Each router creates a link state packet (LSP) which
contains the following information:
– The ID of the node that created the LSP
– A list of directly connected neighbors of that node, with the enable route
calculation
cost of the link to each one
– A sequence number Flooding
reliability
– A time to live for this packet
• The LSP is transmitted to all other routers, who each update
their own records
• When a routers receives LSPs from all routers, it can use
(collectively) that information to make topology-level
decisions
Link State Triggers
• LSPs are generated and distributed when:
– A time period passes
– New neighbours connect to the router
– The link cost of a neighbour has changed
– A link to a neighbour has failed (link failure)
– A neighbour has failed (node failure)
Reliable flooding
Link State Packets Dissemination

• When an LSP is received, it is compared with the


stored copy
– If it is identical to the stored copy, it is dropped
– If it is different, the stored LSP is overwritten with the new
LSP and the LSP is transmitted to every direct neighbour
(except the source of the LSP)
Link State Algorithm
1. Initialize confirmed with entry for self (cost = 0)
2. For newly added node to the confirmed list (next), select
its LSP
3. For each neighbor of next, calculate cost to reach
neighbor as the sum of cost from self to next and from
next to neighbor
1. If neighbor is currently in neither confirmed nor tentative, add
<neighbor, cost, nexthop> to tentative, where nexthop is the
direction to reach next
2. If neighbor is currently in tentative and cost is less than current
cost for neighbor , then replace current entry with <neighbor,
cost, nexthop>, where nexthop is the direction to reach next
4. If tentative is empty, stop. Otherwise pick entry from
tentative with the lowest cost, move it to confirmed and
return to step 2.

87
At node D

B
5 3
A 10 C
11 2
D

You might also like