Title: Chapter 4 LinkState Routing
1Chapter 4Link-State Routing
- Professor Rick Han
- University of Colorado at Boulder
- rhan_at_cs.colorado.edu
2Announcements
- Should use sendto_(), not sendto()
- This weeks lectures online by Saturday
- HW4 online by Saturday
- Updated PA 2 (small mods)
- Server should exit cleanly
- New library void()
- recvfrom() at server instead of select()
- Next, link-state routing,
3Recap of Previous Lecture
- Distance vector problems
- Bouncing effect
- Bad news travels slowly
- Counting to infinity
- Solutions
- Holddown
- Split horizon with poisoned reverse
- Bellman-Ford Equation
- D(i,j) min d(i,k) D(k,j) for all iltgtj
- k neighbors
4Recap of Previous Lecture (2)
- Bellman-Ford Algorithm Ford Fulkerson
- D(i,j)h1 min d(i,k) D(k,j)h for all
iltgtj, h0,1, - k neighbors
- Distributed Bellman-Ford Algorithm Distance
Vector - 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
5Routing Information Protocol (RIP)
- RIP is a specific realization of the distance
vector or distributed Bellman-Ford routing
algorithm - Distance vectors are carried over UDP over IP
- RIP uses hop count as its shortest path metric,
so d(i,j)1 - Distance vectors are sent every 30 seconds
- When a routing table changes, a router can send
triggered updates to neighbors before 30 sec - Can lead to network storms, so limit rate wait 5
seconds between sending new routing update and
the update that caused routing table to change
6RIP is simple
- At each step, exchange distance vectors with each
neighbor - Update distance table with new distance vector,
adding one (all link costs are one) - Calculate minimum hop path to each destination by
looking at minimum in the row
Distance table at B
A
B
Via Port/Link
C
7RIP problems
- N-hop loops
- Metric of hop count doesnt capture Internet
loading - Doesnt scale well
- The neighbor information carried by distance
vectors takes awhile to propagate to across of
network - If your network diameter is 20 hops, then it can
take 20(30 seconds) 10 minutes to propagate
all neighbor info and converge to stable
routing tables - How could we improve speed of convergence?
- Flood distance vectors, except theyre large!
8Alternative Routing Strategy
- Instead, flood just your neighbor link costs and
compute a shortest path tree - First flood your neighbor link costs to entire
network - These are small packets
- Each node receives entire topology
- Second, each node computes the shortest path
tree with itself at as the root
- This is called Link-State Routing
9Alternative Routing Strategy (2)
- How is this shortest path tree calculated?
- Dijkstras Observation shortest path to nodes
further from the root must go through a branch of
the shortest path tree closer to the root
- Strategy calculating the shortest path tree from
the root (B), add nodes to the tree - Add node closest to root
- at each iteration
10Dijkstras 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 n
11Dijkstras Shortest Path Algorithm (2)
- Initialize shortest path tree SPT S
- For each n not in SPT, C(n) l(s,n)
- While (SPTltgtN)
- 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))
12Dijkstras 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 root 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.
- Shortest path tree SPT B, E
13Dijkstras 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
- Each new node in tree, could create a lower cost
path, so redo costs
14Dijkstras 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
- Recalc C(n) MIN (C(n), C(A) l(A,n)) for all
n not yet in SPT - C(D) MIN(2, 2inf) 2
- C(F) 3, C(C) 4
15Dijkstras 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 nodes predecessor is stored) - Each node has to store the entire topology, or
database of link costs
16Link-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 - Dijkstras shortest path tree (SPT) algorithm
17Link 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
18Reliable 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
- Propagates most recent info avoids loops
- Not truly reliable in that LSPs can be lost
- Reliable due to periodic flooding
retransmission - Transient loops can still occur
19OSPF 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
20Link State vs. Distance Vector
- Routing update size
- LS small, contain only neighbors link costs
- DV potentially long distance vectors (length N
for N nodes in network) - Routing update communication overhead
- LS flood to all nodes, overhead is O(NE), where
N is nodes, and E is edges or links - In DV, send distance vector only to neighbors
21Link State vs. Distance Vector(2)
- Convergence speed
- DV at each iteration, send to neighbor and
recalculate - takes awhile to propagate changes to rest of
network - Iterations are periodic, hence slow faster when
triggered - LS faster dont need to recalculate LSPs
before forwarding - may be key reason that LS beat out DV in
intra-domain routing
22Link State vs. Distance Vector (3)
- Space requirements
- LS maintains entire topology in a link database
- DV maintains only neighbor state
- If each of N routers has K neighbors,
- LS O(NK) memory requirement
- DV O(NK) also
23Link State vs. Distance Vector (4)
- Complexity (initializing from scratch)
- DV O(NKDiameter)
- for each of N rows in distance table, find min of
(dikDkj) over K neighbors, iterate until get
info via DVs of furthest nodes (a diameter away) - If sorted list kept, reduce complexity to
O(Nlog(K)Diam.) - LS O(N(N-1)/2)) O(N2)
- First iteration, find min cost node from N-1
nodes not in SPT for 2nd iteration, find min
cost node from N-2 nodes not in SPT, - If a sorted list kept, reduce complexity to
O(Nlog(N)) - After convergence, new routing updates may only
spur partial recalculations for both DV LS
24Link State vs. Distance Vector (5)
- Robustness
- Both LS and DV can be completely disabled by a
single router advertising false/corrupt LSP or DV - LS can flood false/corrupt LSPs to all routers
- DV can advertise false paths/costs to all
neighbors - In ARPANET, malfunctioning routers have
advertised zero cost, creating a black hole - In 1997, a bad router in a small ISP advertised a
false cost, became flooded with traffic,
disconnecting ISPs from most U.S. backbone
providers for 3 hours
25Link State vs. Distance Vector (5)
- Bottom line
- no clear winner in terms of complexity, space,
robustness, - but LS is favored in the intra-domain Internet
due to faster convergence
26Link-State Cost Metric
- Choice of link cost defines traffic load
- Low cost high probability link belongs to SPT
and will attract traffic, which increases cost - Choices for metric
- hop count
- queueing delay
- Transmission delay
- Propagation delay
27Link-State Cost Metric (2)
- Static metrics (e.g. hop count or another fixed
cost) - Less overhead than dynamic metrics
- flood LSPs once initially,
- Thereafter, flood LSPs only if link fails
- Dont have to deal with staleness
- Dynamic metrics can be out of date by the time
they arrive at a distant router
28Link-State Cost Metric (3)
- Dynamic metrics take into account
- Changes in link delay (due to congestion)
- Variations in link capacity (wireless BW)
- Dynamic metrics should
- Avoid oscillations
- low cost attracts traffic gt increase cost gt
less traffic gt low cost gt increase traffic gt
increase cost - Achieve good network utilization
- Use link BW efficiently
- Limit overhead from flooding LSPs
- Respond quickly, to avoid performing Dijkstra on
stale info
29Original LS ARPANET Metric
- Cost proportional to queue size
- Instantaneous queue length as delay estimator
- Problems
- Did not take into account link speed
- Did not take into account propagation delay of a
link - Poor indicator of expected delay due to rapid
fluctuations - Moves packets toward smallest queue, rather than
to destination - Does not achieve good network utilization
30New LS ARPANET Metric
- Delay (depart time - arrival time)
transmission time link propagation delay - (Depart time - arrival time) captures queuing
- Transmission time captures link capacity
- Link propagation delay captures the physical
length of the link - Measurements averaged over 10 seconds
- Update sent if difference gt threshold, or every
50 seconds - Achieves better network utilization
31Problems With New Metric
- Works well for light to moderate load
- Static values dominate
- Oscillates under heavy load
- Queuing dominates
- Congested link advertising high cost pushes
traffic away gt some links temporarily
underutilized during heavy load 50 given 2
links between 2 nodes - Range is too wide
- 9.6 Kbps highly loaded link can appear 127 times
costlier than 56 Kbps lightly loaded link - Can make a 127-hop path look better than 1-hop
- Satellite links penalized, though theyd better
suit playback video (high BW, non-delay
sensitive)