Professional Documents
Culture Documents
N4 N5
Destination Distance Port
N1 0 1*
N1 R3 N2 1 2
N2 2 3
3
1 R1 N3 1 2
N3 2 3
2
N4 1 3
N4 2 2
N2 R2 N3
N5 1 3
N5 2 2
Distance Vector Tables
DV routing tables are created dynamically
DV routers initialize their routing tables with entries for
networks in which they are directly connected (i.e. zero
distance links)
Distance is 0, port is the port which connects the router directly
to that network
Periodically, DV routers announce their routing table entries
If a neighbouring router R2 is advertising a route for network N
with distance D, we can route to N with distance (D+1)
Our routing table will get a new entry for each of these remote
entries
Distance is D+1, port is the port which connects the router to
R2
Distance Vector Tables
1 1
4 3
N2 R1 T1 T1 T1 T1 R2 2
2
3
Dest Distance Route N5
N4 0 1
N5 0 2
N3
Distance Vector Tables
Dest Distance Route
N1
N1 0 1
N2 0 2
N3 0 3 N4
1 1
4 3
N2 R1 T2 T2 T2 T2 R2 2
2
3
N4 0 1
N5
N5 0 2
N1 1 3
N3 N2 1 3
N3 1 3
Distance Vector Tables
N1 N1 0 1
N2 0 2
N3 0 3
N4 1 4 N4
N5 1 4
1 1
4 3
N2 R1 R2 2
2
3 N4 0 1
N5 0 2
N5
N1 1 3
N2 1 3
N3 1 3
N3
Distance Vector Tables
Welcome to Bobton
Population: 1 Leamington 86 →
Essex 21 ↑
Windsor 46 ←
Whoohoo!
A friend!
DV Routing: Conceptual
Continuing this analogy, routers establish
information the same way you would create
these signposts:
Travel down each of your paths, and look for
either:
Other signposts: Create a signpost with the same
elements as the other signpost
Measure the distance to the signpost
Add that distance to each distance
Towns: Measure the distance, and post it verbatim onto
your signpost
DV Routing: Conceptual
octets
Version has the
value of 1 (for
1 command
RIPv1)
1 version
Reserved is not
2 reserved
presently utilized
2 address family ID
14 address
4 metric
May be repeated
RIP Packets: Command
Denotes whether the packet is a request
message (1) or a response message (2)
These are the only 2 kinds of packets in RIP
Requests might be transmitted by routers that
have ‘timed out’ or outdated information
Requests essentially ask for information (i.e. DVs) from
specific (or all) nodes
Responses might be transmitted in response to
a request
Thus the response messages usually contain a list of
distance vectors
RIP Responses
Are sent:
In response to a request
Usually issued by nodes with outdated information or new
nodes
Periodically
The RIP specification defines that distance vectors should
be publicized every 30 seconds
In response to a change
If a neighbour (or link to a neighbour) changes (e.g. fails),
a response message is automatically transmitted to
neighbour nodes
RIP Packets: DV Lists
Can be up to 25 in each packet
Contain 3 parts:
Address family ID: Identifier describing that kind of address is
specified
Address: The address of the node to which this DV refers
Metric: The distance in some metric (e.g. hop count)
The large space allocated for addresses (14 octets) can
be used in different ways in networks that have smaller
addresses
E.g. In IP networks, 2 octets is left unused before the 4 octet
address, and 8 octets is left unused after the address (see page
301 for a more complete picture)
DV Routing Problems: Example
1 1 2 1
A B C
Dest Dist Port Dest Dist Port Dest Dist Port
B 1 1 A 1 1 A 2 1
C 2 1 C 1 2 B 1 1
DV Routing Problems: Example
What happens if we have link failure between B & C?
B will realize there is a problem (ignored messages, etc.), and tries to determine another route
to C
1 1 2 1
A B X C
Dest Dist Port Dest Dist Port Dest Dist Port
B 1 1 A 1 1 A 2 1
C 2 1 C 1 2 B 1 1
DV Routing Problems: Example
B will ask its neighbours (i.e. A), if they can reach C
How will A respond?
Look at A’s routing table to find the answer
1 1 2 1
A B X C
Dest Dist Port Dest Dist Port
B 1 1 A 1 1
C 2 1 C ? ?
DV Routing Problems: Example
A thinks that it can reach C in 2 hops
This path is through B, but that is not known to A
B will get this information and (falsely) think it can access C through A
B believes that the path is 3 hops
1 1 2 1
A B X C
Dest Dist Port Dest Dist Port
B 1 1 A 1 1
C 2 1 C 3 1
DV Routing Problems: Example
Now suppose B has a message for C:
It will send the message to A
Just as its routing table suggests
A will send the message back to B
This will put the packet into a continuous loop
1 1 2 1
A B X C
Dest Dist Port Dest Dist Port
B 1 1 A 1 1
C 2 1 C 3 1
DV Routing Problems: Example
This loop could eventually be resolved by network management protocols, but:
It takes a while for A and B to realize there is a routing loop
A will eventually invalidate its route, and use B’s distance vector (3+1=4) for its new route (it now seems possible to get to C via B)
A will soon after send out its distance vector
This will cause B to invalidate its route, and use A’s distance vector (4+1=5), etc. (to ‘infinity’)
Once A and B determine that no route is possible the process may continue backward (if A had other neighbours)
1 1 2 1
A B X C
Dest Dist Port Dest Dist Port
B 1 1 A 1 1
C 2 1 C 3 1
Count to Infinity
D R1 R2 R3 Network
Count to Infinity
What happens if there is link failure
between R1 and D?
R1 will detect the change and look for
alternative routes
D X R1 R2 R3 Network
Count to Infinity
R2 will advertise that it has a route to D (with distance 2)
R1 is unaware that this route passes through itself to D (and as
such is invalid)
Because only the distance is advertised (not the link state), there
is no way for R1 to know that R2 does not have a viable route
?
D R1 R2 R3 Network
Count to Infinity
R1 will replace its routing table entry for D with
one pointing to R2 for packets addressed to D
The distance will be 3 (2+1)
The new distance vector is sent to R2
D 3
…
?
D R1 R2 R3 Network
Count to Infinity
R2 will replace its routing table entry for D with
one pointing to R1 for packets addressed to D
The distance will be 4 (3+1)
The new distance vector is sent to R1
D 4
…
?
D R1 R2 R3 Network
Count to Infinity
R1 will replace its routing table entry for D with
one pointing to R2 for packets addressed to D
The distance will be 5 (4+1)
The new distance vector is sent to R2
…etc… (to ‘infinity’)
D 5
…
?
D R1 R2 R3 Network
Count to Infinity
Once infinity is reached, R2 concludes (correctly) that R1
cannot deliver packets to D
R2 will use the distance vector from R3 to find an
alternative path to D
If none exists (as in the example below), this process will
propagate backwards to the very source of the message
?
D R1 R2 R3 Network
Slow Convergence
Slow convergence describes when this situation occurs
The routers in the network spend a large amount of time in an inconsistent state
Some routers know of the failure, while others do not
During this time, messages addressed to D are being lost and/or looping between
routers
The routers of the network (as a whole) slowly converge on the correct
configuration to route (or determine routing impossible) to D
Split Horizon Updates
One preventative measure for counting to infinity:
Distance vectors are not transmitted to the same port
where the original distance vector came from, on which this
distance vector is based
For example
R1 may advertise a distance vector to D (D,1)
R2 will receive this distance vector and create its own (D,2)
R2 will not propagate this distance vector to R1 at any time
It will, however, propagate it to through all other links
Split Horizon Updates
Problems:
Information about where distance vectors came from
must be stored in the routing table
It is possible to create the count to infinity problem
using three or more routers in a cycle
Thus, split horizon is not a complete solution to the
count to infinity problem
Hold Down
Routers wait before distributing their information about a
disconnected network for a period of time
For RIP, the distance vectors expire in 180 seconds
Before this time, routers will continue to forward this data
incorrectly
After this time, all routers will remove all paths containing the
disconnected link from their routing tables
Distance vectors are considered out-of-date if the vector is
not retransmitted
After this time, the new routing information (minus the failed
link) is distributed and new routes are created
If a route to the new destination is not found at this time, the
routers will not have entries (thus it is unreachable)
Hold Down
Problem:
The routers are expected to wait a long time
(180s)
During this time, routers are in an inconsistent
state
An ideal solution would result in routers
remaining consistent throughout the process
Poison Reverse
Routers detecting a disconnected host or network keep
its entry, but increase its cost to infinity
The new distance vector(s) are immediately transmitted
This prompts all other routers to find an alternative route if
possible
If no alternative routes are found, the routers will determine the
host to be unreachable
RIP: Count to Infinity Solutions
Infinity in RIP is 16
This way, the number of messages during count to
infinity is limited
However, it also means that the width of the network
(host to host) must be less than 16
If costs > 1 are to be used, the width must be even less
This imposes a serious restriction on the network size
Most RIP implementations use split horizon
However, some RIP implementations use poison
reverse
For More materials,previous papers,text
books & many more visit
www.jntuworld.com