chapter 4 distance vector problems, and link-state routing
DESCRIPTION
Chapter 4 Distance Vector Problems, and Link-State Routing. Professor Rick Han University of Colorado at Boulder [email protected]. Announcements. Handing back HW #1, TA OH, solutions online later today Homework #2 available on Web site, due Feb. 26 - PowerPoint PPT PresentationTRANSCRIPT
Chapter 4Distance Vector Problems, and
Link-State Routing
Professor Rick HanUniversity of Colorado at Boulder
Prof. Rick Han, University of Colorado at Boulder
Announcements• Handing back HW #1, TA OH, solutions
online later today• Homework #2 available on Web site, due
Feb. 26• Last week’s lectures are now on Web site• Midterm for the week of March 12• Next, Distance vector problems, and link-
state routing, …
Prof. Rick Han, University of Colorado at Boulder
Recap of Previous Lecture• Distributed Bellman-Ford = Distance Vector• Bellman-Ford Equation
• D(i,j) = min {d(i,k) + D(k,j)} for all i<>j k neighbors
• Bellman-Ford Algorithm [Ford & Fulkerson]• D(i,j)[h+1] = min {d(i,k) + D(k,j)[h]} for all i<>j,
h=0,1, … k neighbors
• Distributed Bellman-Ford Algorithm• Physically distribute the calculation of D(i,j)[h] to
router i only, and • Exchange the results of your D(i,j)[h] with
neighboring routers at each iteration h
Prof. Rick Han, University of Colorado at Boulder
RIP is simple1. At each step, exchange distance vectors with
each neighbor2. Update distance table with new distance
vector, adding one (all link costs are one)3. Calculate minimum hop path to each
destination by looking at minimum in the row
A
C
BA aB bC c A a
B bC c
Dest A B CA a++ --- a++B b++ --- b++C c++ --- c++
Distance table at BVia Port/Link
Prof. Rick Han, University of Colorado at Boulder
Link Failure Causes “Bouncing” Effect
A
25
1
1
B
C
BC 2
1
dest cost
XBB
via
AC 1
1
dest cost
CA
via
AB 1
2
dest cost
BB
via
Prof. Rick Han, University of Colorado at Boulder
B Notices A-B Link Failure
A
25 1
B
C
B notices failure, resets cost via A toinfinity in distance table (not shown), &knows cost via C is 26
BC 2
1
dest cost
BB
via
AC 1
26
dest cost
CC
via
AB 1
2
dest cost
BB
via
Prof. Rick Han, University of Colorado at Boulder
C Sends Dist. Vector to B
A
25 1
B
C
BC 2
1
dest cost
BB
via
AC 1
3
dest cost
CC
via
AB 1
2
dest cost
BB
via
C sends routing update to B
Prof. Rick Han, University of Colorado at Boulder
B Updates Distance to A
A
25 1
B
C
Packet sent from Cto A bounces between C and B
until TTL=0!
BC 2
1
dest cost
BB
via
AC 1
3
dest cost
CC
via
AB 1
2
dest cost
BB
via
Prof. Rick Han, University of Colorado at Boulder
B Sends Dist. Vector to C
A
25 1
B
C
C adds one to B’sadvertised distanceto A. (Why does C
overrideits storeddistance of 2to A with 4,larger value?)
BC 2
1
dest cost
BB
via
AC 1
3
dest cost
CC
via
AB 1
4
dest cost
BB
via
Prof. Rick Han, University of Colorado at Boulder
C Sends Dist. Vector to B
A
25 1
B
C
B adds one to C’sadvertised distanceto A. (overrides
its storeddistance of 3to A with 5,larger value)
BC 2
1
dest cost
BB
via
AC 1
5
dest cost
CC
via
AB 1
4
dest cost
BB
via
Prof. Rick Han, University of Colorado at Boulder
Link Failure: Bad News Travels Slowly
A
25 1
B
C
After 20+ exchanges,routing tables looklike this:
BC 25
26
dest cost
CC
via
AC 1
25
dest cost
CC
via
AB 1
24
dest cost
BB
viaAssume A has advertisedits link cost of 25 to C during B<->C exchanges.C stores this cost in its distancetable (not shown)
Prof. Rick Han, University of Colorado at Boulder
Bad News Travels Slowly (2)
A
25 1
B
C
C increments B’supdate by 1, andchooses 25 via Ato A, instead of 26
Via B to A
BC 25
26
dest cost
CC
via
AC 1
25
dest cost
CC
via
AB 1
25
dest cost
BA
via
Prof. Rick Han, University of Colorado at Boulder
Bad News Travels Slowly (3)
A
25 1
B
C
After 25 B-Cexchanges, finallyconverge tostable routing
BC 25
26
dest cost
CC
via
AC 1
26
dest cost
CC
via
AB 1
25
dest cost
BA
via
Prof. Rick Han, University of Colorado at Boulder
Link Failure Causes “Counting to Infinity” Effect
A
25
1
1
B
C
BC 2
1
dest cost
XBB
via
AC 1
1
dest cost
CA
via
AB 1
2
dest cost
BB
via
Prof. Rick Han, University of Colorado at Boulder
B Notices A-B Link Failure
A
25 1
B
C
B notices failure,resets cost to 26
BC 2
1
dest cost
BB
via
AC 1
26
dest cost
CC
via
AB 1
2
dest cost
BB
via
Prof. Rick Han, University of Colorado at Boulder
C Sends Dist. Vector to B
A
25 1
B
C
BC 2
1
dest cost
BB
via
AC 1
3
dest cost
CC
via
AB 1
2
dest cost
BB
via
C sendsrouting update to B
Prof. Rick Han, University of Colorado at Boulder
A-C Link Fails
A
1
B
C
C detects link to A has failed,but no change in C’srouting table (why?)
AC 1
3
dest cost
CC
via
AB 1
2
dest cost
BB
via
Prof. Rick Han, University of Colorado at Boulder
Now, B and C Count to Infinity
A
1
B
C
AC 1
3
dest cost
CC
via
AB 1
4
dest cost
BB
via
Prof. Rick Han, University of Colorado at Boulder
B and C Count to Infinity (2)
A
1
B
C
AC 1
5
dest cost
CC
via
AB 1
4
dest cost
BB
via
Prof. Rick Han, University of Colorado at Boulder
Some “Solutions”• Split horizon
– C does not advertise route to B when it sends its distance vector
• Poisoned reverse– C advertises route to B with infinite
distance in its distance vector• Works for two node loops
– Does not work for loops with more nodes
Prof. Rick Han, University of Colorado at Boulder
B Notices A-B Link Failure
A
25 1
B
C
B notices failure,resets cost to 26
BC 2
1
dest cost
BB
via
AC 1
26
dest cost
CC
via
AB 1
2
dest cost
BB
via
Prof. Rick Han, University of Colorado at Boulder
Split Horizon
A
25 1
B
C
BC 2
1
dest cost
BB
via
AC 1
26
dest cost
CC
via
AB 1
2
dest cost
BB
via
C sends routing updateto B
B 1
dest cost
No need to send destA via B, since B shouldalready know this
Prof. Rick Han, University of Colorado at Boulder
Split Horizon With Poisoned Reverse
A
25 1
B
C
BC 2
1
dest cost
BB
via
AC 1
~
dest cost
C--
via
AB 1
2
dest cost
BB
via
C sends routingupdate to B
AB 1
~
dest cost
If lowest cost path is viaB, then when updating Bsend infinite cost
Prof. Rick Han, University of Colorado at Boulder
Example Where Split Horizon Fails
1
11
1
A
• When link breaks, C marks D as unreachable and reports that to A and B
• Suppose A learns it first– A now thinks best path to D
is through B– A reports D unreachable to
B and a route of cost=3 to C• C thinks D is reachable
through A at cost 4 and reports that to B
• B reports a cost 5 to A who reports new cost to C
• etc...
X
B
C
D
Prof. Rick Han, University of Colorado at Boulder
Alternative Shortest Path Calc.• Compute a shortest path tree
• Observation: • shortest path to nodes further from the root must
go through a branch of the shortest path tree closer to the root
• Strategy: expand outwards, calculating the shortest path tree from the root (B)
4
36
21
9
1
1D
A
FE
B
C
Prof. Rick Han, University of Colorado at Boulder
Dijkstra’s Shortest Path Algorithm
• Let N = set of nodes in graph• l(i,j) = link cost between i,j (= infinity if not
neighbors)• SPT = set of nodes in shortest path tree thus
far• S = source node• C(n) = cost of path from
S to node n4
36
21
9
1
1D
A
FE
B
C
Prof. Rick Han, University of Colorado at Boulder
Dijkstra’s Shortest Path Algorithm (2)
• Initialize shortest path tree SPT = {S}• For each n not in SPT, C(n) = l(s,n)• While (SPT<>N)
• SPT = SPT U {w} such that C(w) is minimum for all w in (N-SPT)
• For each n in (N-SPT)• C(n) = MIN (C(n), C(w) + l(w,n))
4
36
21
9
1
1D
A
FE
B
C
Prof. Rick Han, University of Colorado at Boulder
Dijkstra’s Shortest Path Algorithm (3)
• Initialize shortest path tree SPT = {B}• For each n not in SPT, C(n) = l(s,n)
• C(E) = 1, C(A) = 3, C(C) = 4, C(others) = infinity• Add closest node to the tree: SPT = SPT U
{E} since C(E) is minimum for all w not in SPT.• No shorter path to E can ever be found via some
other roundabout path.
4
36
21
9
1
1D
A
FE
B
C
• Shortest path tree SPT = {B, E}
Prof. Rick Han, University of Colorado at Boulder
Dijkstra’s Shortest Path Algorithm (4)
• Recalculate C(n) = MIN (C(n), C(E) + l(E,n)) for all nodes n not yet in SPT• C(A) = MIN( C(A)=3, 1 + 1) = MIN(3,2) = 2• C(D) = MIN( infinity, 1 + 1) = 2• C(F) = MIN( infinity, 1 + 2) = 3• C(C ) = MIN( 4, 1 + infinity) = 4
4
36
21
9
1
1D
A
FE
B
C
• Each new node in tree, could create a lower cost path, so redo costs
Prof. Rick Han, University of Colorado at Boulder
Dijkstra’s Shortest Path Algorithm (5)
• Loop again, select node with the lowest cost path:• C(A) = 2, C(D) = 2, C(F) = 3, C(C ) = 4• SPT = SPT U {A} = {B, E, A}• No shorter path can be found from B to A,
regardless of any new nodes added to tree
4
36
21
9
1
1D
A
FE
B
C
• Recalc: C(n) = MIN (C(n), C(A) + l(A,n)) for all n not yet in SPT• C(D) = MIN(2, 2+inf) =
2• C(F) = 3, C(C) = 4
Prof. Rick Han, University of Colorado at Boulder
Dijkstra’s Shortest Path Algorithm (6)
• Continue to loop, adding lowest cost node at each step and updating costs
• SPT crawls outward• Remember to store the links in SPT as they
are added (each node’s predecessor is stored)
• Each node has to store the entire topology, or database of link costs
4
36
21
9
1
1D
A
FE
B
C
Prof. Rick Han, University of Colorado at Boulder
Link-State Routing = Reliable Flooding + Dijkstra SPT
• Start condition– Each node assumed to know state of links to its
neighbors• Step 1
– Each node broadcasts its state to all other nodes– Reliable flooding mechanism
• Step 2– Each node locally computes shortest paths to all
other nodes from global state– Dijkstra’s shortest path tree (SPT) algorithm
Prof. Rick Han, University of Colorado at Boulder
Link State Packets (LSPs)• Periodically, each node creates a
link state packet containing:– Node ID– List of neighbors and link cost– Sequence number
• Needed to avoid stale information from flood
– Time to live (TTL)– Node outputs LSP on all its links
Prof. Rick Han, University of Colorado at Boulder
Reliable Flooding of LSPs• When node J receives LSP from node K
– If LSP is the most recent LSP from K that J has seen so far, J saves it in database and forwards a copy on all links except link LSP was received on
– Otherwise, discard LSP• How to tell more recent
– Use sequence numbers– Same method as sliding window protocols
Prof. Rick Han, University of Colorado at Boulder
OSPF – Open Shortest Path First
• A particular realization of link-state routing, used for intra-domain routing in the Internet
• Additional support for:– Authentication of routing updates– Support for broadcast networks– Different cost metrics
• Periodic and event-triggered flooding of LSP routing updates, like RIP