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

Distance Vector

Distance vector routing protocols use the Bellman-Ford algorithm to calculate the best path between nodes. Nodes periodically share their distance vectors, which contain the distance and next hop for all known destinations. This allows nodes to update their routing tables and detect routing loops or link failures. Common distance vector protocols include RIP and RIP-2, which are discussed in this chapter of the textbook on routing principles.

Uploaded by

Mankush Jain
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Distance Vector

Distance vector routing protocols use the Bellman-Ford algorithm to calculate the best path between nodes. Nodes periodically share their distance vectors, which contain the distance and next hop for all known destinations. This allows nodes to update their routing tables and detect routing loops or link failures. Common distance vector protocols include RIP and RIP-2, which are discussed in this chapter of the textbook on routing principles.

Uploaded by

Mankush Jain
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

Distance Vector Routing

Distance vector routing principles


Routing loops and countermeasures to loops
The Bellman-Ford algorithm
The RIP and RIP-2 protocols

(Chapter 5 in Huitema)

E7310/comnet 1
Distance Vector Routing Principles

E7310/comnet 2
An Example

Example network with nodes A, B, C, D, E 1 2


and links 1, 2, 3, 4, 5, 6. A B C

The cost of each link is 1. 3 4 5

Initial state: Nodes know their own addresses D E


and interfaces, nothing more. 6

Initiation: Node A creates its routing table:


From node A to … Link Distance
A - (local) 0
The corresponding distance vector (DV) is: A=0

E7310/comnet 3
Distance vector routing idea

•  Distance vector (DV) protocols are based on


Routing table (simplified):
the Bellman-Ford algorithm
E to Link Distance
•  The routing table contains information
E - 0
about other known nodes B 4 1
–  link (interface) identifier A 4 2
–  distance (cost) in hops D 6 1
•  The nodes periodically send distance vectors C 5 1
based on the routing tables on all their links Distance vector:
•  The nodes update their routing table with E=0, B=1, A=2, D=1, C=1
received distance vectors
•  Routing Information Protocol (RIP) is a basic
distance vector protocol

E7310/comnet 4
Generation of routing tables starts when all
routers send their DVs on all interfaces
Let’s look at reception in Node B.
First the table of B is:
1 2 From node B to … Link Distance
A B C
A=0 B - 0
A=0

3 4 5 1.  B receives the distance vector A=0


2.  B increments the DV with +1 ⇒ A=1
D E 3.  B looks for the result in its routing table, no match
6
4.  B adds the result to its RT, the result is
From node B to … Link Distance
B - 0
A 1 1
5.  B generates its distance vector B=0, A=1

E7310/comnet 5
B creates its own DV and
sends it to all neighbors
C to Link Distance
B=0, A=1 C - 0
A to Link Distance
1 2 B 2 1
A - 0 A B C
A 2 2
B 1 1 3 4 5
E to Link Distance
D E
A=2 > A=0 6 E - 0
B 4 1
A 4 2

E7310/comnet 6
D sends its distance vector to all neighbors

A to Link Distance
1 2
A - 0 A B C
B 1 1 3 4 5
D 3 1 E to Link Distance
D E
A=2 > A=0
6 E - 0
D=0, A=1 B 4 1
A 4 2
D 6 1

A=2 == A=2 ⇒ no change


E7310/comnet 7
The nodes whose RT changed create DVs
and send them to neighbors
A=0, B=1, D=1 1 2
A B C E to Link Distance
B to Link Distance 3 4 5 E - 0
B - 0 B 4 1
D E
A 1 1 6 C=0, B=1, A=2 A 4 2
D 1 2 A B C D 6 1
1 2
C 2 1 C 5 1
3 4 5
E 4 1
D E
6 D to Link Distance
1 2 D - 0
A B C
A 3 1
3 4 5 B 3 2
D E E 6 1
6
E=0, B=1, A=2, D=1
E7310/comnet 8
Again the changes are sent ...
B=0, A=1, D=2, C=1, E=1
1 2 C to Link Distance
A B C
A to Link Distance
C - 0
A - 0 3 4 5
B 2 1
B 1 1 D E
6 A 2 2
D 3 1 1 2
A B C E 5 1
C 1 2
3 4 5 D 5 2
E 1 2
D E
D=0,A=1,B=2,E=1 6
D to Link Distance
A
1
B
2
C
A, D, and C create new
D - 0 DVs, send them, but
A 3 1 3 4 5
they have no impact.
B 3 2 D
6
E
E 6 1 E=0,B=1,A=2, D=1,C=1
C 6 2
E7310/comnet 9
Processing of received distance vectors

D = destination Legend:
R Routing table with entries (D,L,d)
d = distance + link cost R(D) Routing table entry for destination D
L = link of reception Rx(D) Field x of the entry for destination D

Yes
D⊂R
No
No L==Rl(D)
No
Yes d < Rd(D)
Yes
Add (D,L,d) to R Update R(D) = (D,L,d) Ignore
Note: this is simplified, shows only the principle!
E7310/comnet 10
A link breaks...

E7310/comnet 11
A round of updates starts on link failure

Broken link detected A to Link Distance B to Link Distance


•  Link layer detects A - 0 B - 0
•  No routing updates B 1 Inf. A 1 Inf.
via that link in a
given time D 3 1 D 1 Inf.
C 1 Inf. C 2 1
Node A gives an E 1 Inf. E 4 1
infinite distance to the
nodes reached
through link 1
B=0,A=inf,D=inf,C=1,E=1
1 2
A B C

A=0,B=inf,D=1,C=inf,E=inf 3 4 5

D E
6
E7310/comnet 12
D, E and C update their routing tables
B=0, A=inf, D=inf, C=1, E=1
+1=
B=1, A=inf, D=inf, C=2, E=2
A=0, B=inf, D=1,C=inf, E=inf 1 2 C to Link Distance
+1 = A B C C - 0
A=1, B=inf, D=2,C=inf, E=inf
3 4 5 B 2 1
A 2 Inf.
D E
6 E 5 1
D 5 2

D to Link Distance E to Link Distance


D - 0 E - 0 If L=Rl(D) the routing
A 3 1 B 4 1 table is updated even if
the new distance is
B 3 Inf. A 4 Inf.
longer!
E 6 1 D 6 1 (see ”processing of
C 6 2 C 5 1 received distance vectors”)

E7310/comnet 13
D, C, E generate their distance vectors...
B to Link Distance
B - 0
A to Link Distance A 1 Inf.
A - 0 D 4 2
B 1 Inf. C 2 1
D 3 1 E 4 1
C 3 3 1 2
A B C C=0,B=1,A=inf,E=1,D=2
E 3 2
3 4 5

D=0,A=1,B=inf,E=1,C=2 D 6
E E=0,B=1,A=inf,D=1,C=1

D to Link Distance E to Link Distance


D - 0 E - 0
A 3 1 B 4 1
B 6 2 A 6 2
E 6 1 D 6 1
C 6 2 E7310/comnet C 5 1 14
A, B, D, E generate their distance vectors

A to Link Distance B to Link Distance C to Link Distance


A - 0 B - 0 C - 0
B 3 3 A 4 3 B 2 1
D 3 1 D 4 2 A 5 3
C 3 3 C 2 1 E 5 1
E 3 2 E 4 1 D 5 2

B=0,A=inf,D=2,C=1,E=1
A=0,B=inf,D=1,C=3,E=2 A B C
1 2
3 4 5

D=0,A=1,B=2,E=1,C=2 D E E=0,B=1,A=2,D=1,C=1
6
The result is that all nodes are able to communicate with all other nodes again.

E7310/comnet 15
Routing loops

B C

E7310/comnet 16
The DV-protocol may create a transient
routing loop
1 2 Let’s assume that cost of link 5 is 8.
A B C

3 4 5
8 A stable initial state for routes to C
would be:
D E
6 x to C
Link Distance
from x
A→C 1 2
B→C 2 1
Let’s just look at the first C→C - 0
link of each route. D→C 3 3
E→C 4 2

transient =E7310/comnet
hetkellinen, ohimenevä 17
Link 2 fails
x to C
Link Distance
from x
first Intermediate
arr iv e A→C 1 2
ens to state
happ
to B B→C 2 Inf.
o mA
DV fr B=0,A=1,D=2,C=3,E=1 C→C - 0
1 2 D→C 3 3
A=0,B=1,D=1,C=2,E=2 A B C
E→C 4 2
3 4 5

D E x to C
Link Distance
6 from x
A→C 1 42
All packets to C are sent to B.
B→C 1 3
B sends them to A. A sends
them back to B… until TTL=0. C→C - 0
(Bouncing effect) D→C 3 3
E→C 4 24
E7310/comnet 18
A and E send their distance vectors

x to C
Link Distance
from x
1 A→C 1 4
B→C 1 5
A=0,B=1,D=1,C=4,E=2 A 1 B 2 C C→C - 0
D→C 3 5
3 4 5 2
E→C 4 4
D E
6 B generates a new DV:
B=0,A=1,D=2,C=5,E=1

⇒  Distance seen by A to C grows to 6

Distance vectors sent by C do not


change anything because of high link cost

E7310/comnet 19
A sends a new distance vector

x to C
Link Distance
from x
1 A→C 1 6
B→C 1 7
A=0,B=1,D=1,C=6,E=2 A 1 B 2 C C→C - 0
D→C 3 7
3 4 5 E→C 4 6
2
D E
6
B generates a new DV
B=0,A=1,D=2,C=7,E=1

⇒ Distance seen by A to C grows to 8

E7310/comnet 20
A sends a new distance vector

x to C
Link Distance
from x
1 A→C 1 8
B→C 1 9
A=0,B=1,D=1,C=8,E=2 A 1 B 2 C C→C - 0
D→C 3 9
3 4 5 E→C 4 8
2
D E
6
B generates a new DV
B=0,A=1,D=2,C=9,E=1

⇒ Distance seen by A to C grows to 10

E7310/comnet 21
Finally the distance (0+8) sent by C is
accepted as a shorter distance by E
x to C
Link Distance
from x
1 A→C 1 10
B→C 1 11
A=0,B=1,D=1,C=10,E=2 A 1 B 2 C C→C - 0
D→C 3 11
3 4 5 E→C 5 8
2
D E
6
B generates a new DV
B=0,A=1,D=2,C=11,E=1

E generates a new DV
E=0,B=1,A=2,D=1,C=8

E7310/comnet 22
When E sends a new distance vector,
B and D learn a route to C
x to C
Link Distance
A 1 B
2
C
from x
A→C 1 10
3 4 5 B→C 4 9
C→C - 0
D E
6 D→C 6 9
E=0,B=1,A=2,D=1,C=8 E→C 5 8

E7310/comnet 23
B send its DV but the tables are already OK

x to C Link Distance
1 2 B=0,A=1,D=2,C=9,E=1
from x
A B C
A→C 1 10
3 4 5 B→C 4 9
C→C - 0
D E
6 D→C 6 9
E→C 5 8
•  Each update round increased the costs by 2
•  The process progresses in a random order, because it is
genuinely parallel in nature.
•  During the process, the state of the network is bad. DV-
packets may be lost due to the overload created by bouncing
user messages

E7310/comnet 24
Questions
•  What would be a reasonable goal for setting a link metric of
link 5 to a higher value than the rest of the links?
•  What would be a good reason to set the link metric of link 5
to the value of 8, provided all other links are set to 1?
•  If there is no good reason for the value of 8, what would be
the max reasonable value for some purpose?

The Bellman–Ford algorithm is an algorithm that computes shortest paths from a single source
vertex to all of the other vertices in a weighted digraph.[1]
It is slower than Dijkstra's algorithm for the same problem, but more versatile, as it is capable of
handling graphs in which some of the edge weights are negative numbers. The algorithm is usually named
after two of its developers, Richard Bellman and Lester Ford, Jr., who published it in 1958 and 1956,
respectively; however, Edward F. Moore also published the same algorithm in 1957, and for this
reason it is also sometimes called the Bellman–Ford–Moore algorithm.[1]

E7310/comnet 25
Counting to infinity

B C

E7310/comnet 26
Counting to infinity occurs when failures
break the network into isolated islands (1)

•  Link 1 is broken, A to Link Distance 1 2


A B C
(or nonexistent) D 3 1
and the network A - 0 3 4 5
has recovered. B 3 3
E 3 2 D E
6
C 3 3
•  All link costs = 1
D to Link Distance
D - 0
A 3 1
B 6 2
E 6 1
C 6 2
E7310/comnet 27
Counting to infinity occurs when failures
break the network into isolated islands (2)

•  Also link 6 breaks. A to Link Distance 1 2


A B C
D 3 1
A - 0 3 4 5
•  D updates its
B 3 3
routing table with D E
E 3 2 6
infinite distances C 3 3
to B, C and E but
D to Link Distance
has not yet sent D - 0
its distance vector. A 3 1
B 6 Inf.
E 6 Inf.
C 6 Inf.
E7310/comnet 28
Counting to infinity occurs when failures
break the network into isolated islands (3)

•  A happens to A to Link Distance 1 2


A B C
send its distance D 3 1
vector first: A - 0 3 4 5
A=0,B=3,D=1,C=3,E=2 B 3 3
E 3 2 D E
6
C 3 3
•  D adds the D to Link Distance
information sent D - 0
by A into its A 3 1
routing table. B 3 4
E 3 3
C 3 4
E7310/comnet 29
Counting to infinity occurs when failures
break the network into isolated islands (4)

•  The result is a A to Link Distance 1 2


A B C
loop. D 3 1
•  Costs are A - 0 3 4 5
incremented by 2 B 3 53
E 3 42 D E
on each round. 6
C 3 53
•  Update rounds
continue forever D to Link Distance
D - 0
•  We need to define
A 3 1
infinity as a cost
B 3 46
greater than any
E 3 35
normal route cost.
C 3 46
E7310/comnet 30
Avoiding routing loops

B C

E7310/comnet 31
The first method to avoid loops is to
send less information
The split horizon rule:
If node A sends to node X through node B, it does not A
make sense to advertise that B should reach X through A
⇒  A should not advertise to B its short distance to X
B
Implementation choices:
1.  Split horizon
•  A does not advertise its distance to X towards B at all
⇒  the loop of previous example can not occur

2.  Split horizon with poisonous reverse


•  A advertises to B: X=inf.
⇒  two node loops are killed immediately

E7310/comnet 32
Split horizon example
A to Link Distance
A C
B 3 1 1
A - 0 3
D 3 2
C 1 1 B D
2
•  Normally:
–  A sends: A=0,B=1,C=1,D=2 Note that the DV sent on
•  Split horizon: link 1 is different from the
one sent on link 3.
–  A sends: A=0,C=1
•  Split horizon with poisonous reverse:
–  A sends: A=0,B=inf,C=1,D=inf

à 2-node loops are impossible!


E7310/comnet 33
Three-node loops are still possible (1)

•  Link 1 is broken,
and the network
1 2
has recovered. A B C

3 4 5
•  All link costs = 1
D E
6

x to D
Link Distance
from x
B→D 4 2
C→D 5 2
E→D 6 1

E7310/comnet 34
Three-node loops are still possible (2)

•  Also link 6 fails.


1 2
A B C
•  E sends its distance
vector to B and C 3 4 5
E=0, B=1, A=inf, D=inf, C=1
D E
6 E=0,B=1,A=inf,D=inf,C=1

x to D
Link Distance
from x
B→D 4 2
C→D 5 2
E→D 6 Inf.

E7310/comnet 35
Three-node loops are still possible (3)

•  Also link 6 fails.


1 2
A B C
•  E sends its distance
vector to B and C 3 4 5
E=0,B=1,A=inf,D=inf,C=1
D E
6 E=0,B=1,A=inf,D=inf,C=1

•  ... But the DV sent to C


is lost x to D
Link Distance
from x
B→D 4 Inf.
C→D 5 2
E→D 6 Inf.

E7310/comnet 36
Three-node loops are still possible (4)

•  Now C sends its C=0,B=inf,A=3,E=1,D=2


poisoned DV
1 2
A B C

3 4 5
C=0,B=1,A=inf,E=inf,D=inf
D E
6

B to Link Distance E to Link Distance


B - 0 B 4 1
A 2 4 A 6 Inf.
D 2 3 D 6 Inf.
C 2 1 C 5 1
E 4 1 E - 0
E7310/comnet 37
Three-node loops are still possible (5)

•  B generates its
poisoned distance B=0,A=inf,D=inf,C=inf,E=1
vectors 1 2
•  The three node loop is A B C
ready
3 4 5
•  On link 5 cost=4 is B=0,A=4,D=3,C=1,E=inf
advertised. C’s
knowledge about the D
6
E
distance to D
grows ...
•  Routes to D do not x to D Link Distance
change except that the from x
costs keep growing,
nodes count to infinity. B→D 2 3
This finally breaks the C→D 5 2
loop. E→D 4 4

E7310/comnet 38
How often should a DV-protocol advertise?

The duration of the update period is a compromise:


• + quick delivery of changed info + = Need to send faster
+ recovery from packet loss
- = Need to send slower
+ need to monitor the neighbors
- sending all changes at the same time
- traffic load created by the protocol

•  Entries in the routing tables have refresh and obsolescence


timeouts
•  In RIP, the refresh timeout is 30 seconds and the
obsolescence timeout is 180 seconds

E7310/comnet 39
The second method to avoid loops is
to use triggered updates
•  A triggered update happens when an entry in the routing
table is modified (e.g. when a link breaks)
•  Triggered updates reduce the probability of loops
•  Triggered updates also speed up counting to infinity
•  RIP advertises both
–  when the refresh timer expires (periodical updates), and
–  when a change occurs in an entry (triggered updates)
•  Loops are still possible, e.g. because of packet loss

Generically, the examples show how hard it is to maintain


the same information in many nodes and how easily the values
diverge.

E7310/comnet 40
The Bellman-Ford algorithm

Distance vector protocols are based on


the Bellman-Ford algorithm

E7310/comnet 41
The Bellman-Ford algorithm
Definitions
•  Definitions:
–  Let N be the number of nodes and M the number of links.
–  L is the link table with M rows, L[l].m - link metric
L[l].s - link source
L[l].d - link destination
–  D is an N × N matrix, such that D[i,j] is the distance from i to j
–  H is an N × N matrix, such that H[i,j] is the link that i uses to send
to j
D 1 .. i .. N
1 Both directions are presented
:
distance separately in the link matrix and
j from i distance matrix
to j
:
N Column i ≡ Distance vector of node i

E7310/comnet 42
The Bellman-Ford algorithm
Initialized distance and link matrices
From node i to node j
1 .. i .. N i
1 .. .. N
1 0 ∞ ∞ ∞ ∞ 1 -1 -1 -1 -1 -1
: ∞ 0 ∞ ∞ ∞ : -1 -1 -1 -1 -1
j ∞ ∞ 0 ∞ ∞ j -1 -1 -1 -1 -1
: ∞ ∞ ∞ 0 ∞ : -1 -1 -1 -1 -1
N ∞ ∞ ∞ ∞ 0 N -1 -1 -1 -1 -1
Distance matrix D Link matrix H
Column=Known distances at i Column=Routing table at i

E7310/comnet 43
The Bellman-Ford algorithm
Centralized algorithm
1.  Initialization: (previous slide)

If i=j, then D[i,j] = 0, else D[i,j] = ∞.


Initialize ∀ H[i,j] = -1.
2. ∀ links l and ∀ destinations k: (a rough description)
i.  set i = L[l].s, j = L[l].d
ii.  calculate d = L[l].m + D[j,k]
iii.  if d < D[i,k], set D[i,k] = d; H[i,k] = l.
3. If at least one D[i,k] changed, go to step 2, else stop.
E7310/comnet 44
Example
B C

A D X
link l
i=A j=D k=X

Column H(i, …) is the routing table at i, destination (j) is the index to the column entry. D – distances matrix.
L is what we receive in the nodes: l marks the link on which we receive, .d marks the destination and
.m the distance we got for the destination.

This does not show link breaks etc other continuous changes. Only initial forming of the routing table based
on the idea that all elements work without faults. Algortihm on slide 55 has a bit more detail.

In a network, each i runs this for itself. In a centralized setting, a server must run this for nodes at the same time.

E7310/comnet 45
The Bellman-Ford algorithm
Properties
•  First in D-matrix appear one hop link distances, then
two hop link distances, etc.
•  Number of steps ≤ N
(because there cannot be a path longer than N)
•  Each step requires N·M operations
⇒  Complexity: O(M·N2)
•  In the distributed version the columns are processed
in parallel
⇒  Complexity of the distributed version: O(M·N)

E7310/comnet 46
RIP version 1

E7310/comnet 47
Routing Information Protocol (RIP)

•  Simple distance vector protocol


•  Several versions before standardization in 1988
–  The standardized RIP collected features from various implementations
•  RIP is an interior routing protocol
–  Used only inside an autonomous system
•  Popular in small networks (e.g. often integrated in DSL/cable
modems)

RFC
1058

E7310/comnet 48
RIP metrics

•  The distance (= hop count = number of links on the route) is


the only supported metric
•  Infinity = 16
•  Maximum network diameter (maximum number of hops
between any node in the networ) is therefore 16
•  Detailed metrics, like delay and monetary cost, cannot be
used since the total path cost must be less than 16 hops
•  The administrator may however specify a higher cost for
some links (<16)

E7310/comnet 49
RIP-protocol properties

•  Only one route per destination is stored


•  Loop prevention
–  Triggered updates
–  Split horizon. ⇒ Different entries on different interfaces
•  Works both on shared media (Ethernet) and in point-to-point
networks
•  Packets sent with broadcast
•  Runs on top of UDP (port 520)
–  In a software implementation, RIP messages are normal IP packets
which may be lost due to congestion
–  Lost messages are not resent

E7310/comnet 50
RIP timers

•  Refresh timer = 30 s
–  The update for the entry is sent every 30 s
•  Obsolescence timer = 180 s
–  The distance is set to infinite if no update has been received within
180s
•  A entry whose distance has been infinite for 60 s is deleted
•  Advertisements are randomized to avoid bursts of updates
•  A triggered update is delayed a random time 1-5 s
•  Note: Defining fixed timers as part of a protocol is not
recommended today!

E7310/comnet 51
RIP message format
Command Version = 1
1 = Request
2 = Response
32 bits

header 1…25 route entries


8 bits 8 bits 16 bits

Command Version Must be zero


Address family identifier Must be zero
IP address
Must be zero
Must be zero
Metric

Address family Metric Distance


IP=2 0 … 16 vector!

E7310/comnet 52
RIP routing table entries

•  An entry in the routing table represents a network, a sub-network or a


host:
–  <netid,0,0> represents a network
–  <netid,subnetid,0> represents a sub-network
–  <netid,subnetid,host> represents a host (used only in exceptional
cases)
–  <0.0.0.0> represents a route out from the autonomous
system
•  The mask must be manually configured.
•  Same mask in the entire network.
•  Sub-network entries are aggregated into a network entry on interfaces
belonging to another network.

E7310/comnet 53
RIP routing table
A routing table entry contains (at least):
•  Destination IP address (network)
•  Distance (metric) to destination
•  Next hop IP address
•  “Recently updated” flag
•  Several timers (refresh, obsolescence...)

Destination Gateway Genmask Flags Metric Ref Use Iface


127.0.0.1 * 255.255.255.255 UH 1 0 2130 lo0
191.72.1.0 * 255.255.255.0 U 1 0 3070 eth0
191.72.2.0 191.72.1.1 255.255.255.0 UG 2 0 1236 eth0
191.72.3.0 191.72.1.2 255.255.255.0 UG 2 0 3212 eth0

E7310/comnet 54
Processing of Received Distance Vectors

D = destination network Legend:


R Routing table with entries (D,L,d)
d = min(16, distance+1ink cost)
R(D) Routing table entry for destination D
L = sending router Rx(D) Field x of the entry for destination D

Yes
D⊂R
No
No L==Rl(D)
No
Yes d < Rd(D)
Yes
Add (D,L,d) to R Update R(D) = (D,L,d)

Restart timer for entry Ignore


E7310/comnet 55
RIP response messages

•  Distance vectors are sent in response messages


•  Periodic updates (30 seconds period)
–  All routing table entries
–  Different DV on different links because of split horizon
–  More than 25 entries ⇒ several messages
•  Triggered updates after changes
–  Contains changed entries
–  1-5 seconds delay, so that the message contains all updates that are
related to the same change
•  Destinations with infinite distance can be omitted if the next
hop is same as before.

E7310/comnet 56
RIP request messages

•  The router can request routing tables from its neighbors at


startup (requested address = 0.0.0.0)
–  Complete list
–  Response similar to normal update (with split horizon)
–  Sent with broadcast
•  Partial routing table when an address is specified
–  Includes only specified entries
–  Sent point-to-point
–  For debugging
–  Without split horizon

E7310/comnet 57
Silent nodes

•  When only RIP was used, hosts could listen to routing traffic
and maintain their own routing tables
–  Which router is closest to the destination?
–  Which link, if several available?
•  These where ”silent nodes”, that only listened to routing traffic
without sending
•  Nowadays there are too many routing protocols
–  RIP-2, OSPF, IGRP, ...

r ica l
Interior Gateway Routing Protocol (IGRP) Histo
E7310/comnet 58
RIP version 2

E7310/comnet 59
RIP version 2

•  Why?
–  Simple and lightweight alternative to OSPF and IS-IS
•  RIP-2 is an update that is partially interoperable with RIP-1
–  A RIP-1 router understands most of what a RIP-2 router is saying.
•  Improvements
–  Authentication
–  Support for CIDR (Classless Inter-Domain Routing)
–  Next hop – field
–  Subnet mask
–  Support for external routes
–  Updates with multicast RFC RFC RFC
Intermediate System to Intermediate System (IS-IS) 1387 1388 1389

E7310/comnet 60
RIP version 2 message format
Version = 2 External routes are tagged Removed from standard

32 bits

header 1…25 route entries


8 bits 8 bits 16 bits

Command Version Routing domain


Address family identifier Route tag
IP address
Subnet mask
Next hop
Metric

New “address family” 0xFFFF Many ASs on a Support for


for authentication data single “wire”, CIDR
(password or MD5) eliminate “double
hop” over the
same subnet
E7310/comnet 61
Routing from one sub-net to another (1)

•  In RIP-1 the subnet mask is not known outside the subnet,


only network-id is sent in an advertisement out from a subnet
⇒  A host and a subnet can not be distinguished
⇒  All subnets must be interconnected with all other subnets
⇒  Exterior traffic is received in the nearest router independent of the final
destination inside of the network
•  RIP-2 corrects the situation by advertising both the subnet
and the subnet mask
–  Masks of different length within a network
–  Support for CIDR
–  RIP-1 does not understand

E7310/comnet 62
Routing from one sub-net to another (2)

10.1.0.0 / 255.255.0.0 A B RIP1: 10.0.0.0 (/ 255.0.0.0)


RIP2: 10.1.0.0 / 255.255.0.0

C
D

10.2.0.0 / 255.255.0.0 E F RIP1: 10.0.0.0 (/ 255.0.0.0)


RIP2: 10.2.0.0 / 255.255.0.0
10.2.0.1

E7310/comnet 63
Route redistribution

•  Routes from another routing protocol (e.g. BGP) can be


redistributed in the RIP domain
•  The border router needs to run both routing protocols
•  Metrics used in the protocols are not always compatible
–  E.g. hop count in RIP, composite metrics in IGRP, policy-based
metrics in BGP
–  Administratively set metrics can be used for redistributed routes
•  To avoid routing loops, routes learned from another protocol
should not be announced back to that protocol
–  To indentify these routes, we need the route tag

E7310/comnet 64
Routing domain and next hop
AS X AS Y

A B C

D E F
Router with 2
routing Tables X and Y.
RIP1:
D advertises in AS X that the distance to F is f (the next hop is the advertising
router D).
RIP2 with next hop field:
D advertises in AS X that the distance to F is f and the next hop is E.

E7310/comnet 65
Support for local multicast

•  RIP-1 broadcasts advertisements to all addresses


on the wire
–  Hosts must examine all broadcast packets
•  RIP-2 uses a multicast address for advertisements
–  224.0.0.9 (all RIP-2 routers)
–  No real multicast support needed, since packets are only sent on the
local network
•  Leads to compatibility problems between RIP-1 and
RIP-2

E7310/comnet 66
The synchronization problem
– why timers must be randomized
•  Routers have a spontaneous tendency to synchronize their
send times.
–  Traffic bursts increase the probability of packet loss
•  Reason: send interval = constant + time of message packing
+ processing time of messages that are in the queue.
•  Routers send at the same time ⇒ Longer processing time ⇒
Longer delay than of other routers ⇒ Sending instance
occurs at the same time as of other routers
•  Solution: send instants are randomized between 15s ... 45s.
•  Common problem in several distributed protocols

E7310/comnet 67
Acknowledged updates (extension)

•  When RIP is used on ISDN/X.25 links a new call is


established per 30s ⇒ Expensive
•  Pay per traffic (e.g. X.25/GPRS) ⇒ Expensive
•  Slow network ⇒ queue length are restricted.
–  RIP sends its DVs 25 entries/message in a row
⇒ RIP messages may be lost.
•  Correction proposal: No periodic RIP updates I P- 2
pa r t of R
⇒  Assume that neighbor is alive and reachable
No t
⇒  Acknowledge updates and resend lost updates
⇒  Information about all alternative routes is stored.
RFC RFC
1582 2091

E7310/comnet 68
Summary

•  RIP is a simple (minimum configuration info) routing protocol


for small networks
•  Does not exclude the possibility of transient loops – recovery
based on counting to infinity (to 16)
–  Routers do not have a topology database – instead only distances to
destinations are disseminated and stored
•  RIP-2 supports address masks/CIDR

E7310/comnet 69

You might also like