lecture 15: link state routingcseweb.ucsd.edu/.../sp20/cse123-a/lectures/123-sp20-l15.pdfcse 123...
TRANSCRIPT
CSE 123: Computer NetworksAaron Schulman
Lecture 15:Link state routing
• Destination-based routing
• Intra-domain routing• Link-state routing
2
Lecture 15 Overview
CSE 123 – Lecture 15: Link-state Routing
! Routingu All addresses are globally known
» No connection setupu Host sends packet with destination address in header
» No path state; only routers need to worry about failureu Distributed routing protocol used to routing tables
! Forwardingu Router looks up destination in table
» Must keep state proportional to destinations rather than connections
u Lookup address, send packet to next-hop link» All packets follow same path to destination
! In Practice this is what we use for IP routing
3
Destination-based Forwarding
CSE 123 – Lecture 15: Link-state Routing
! The routing table at A, lists – at a minimum – the next hops for the different destinations
D
G
A
F
E
B
C
Dest Next Hop
B BC CD CE EF FG F
4
Routing Tables
CSE 123 – Lecture 15: Link-state Routing
! Essentially a graph theory problemu Network is a directed graph; routers are vertices
! Find “best” path between every pair of verticesu In the simplest case, best path is the shortest path
D
G
A
F
E
B
C =router
=link
X
11
1
11
1
1
11 =cost
5
Routing on a Graph
CSE 123 – Lecture 15: Link-state Routing
! How to choose best path?u Defining “best” can be slippery
! How to scale to millions of destinations (addresses)?u Minimize control messages and routing table size
! How to adapt to failures or changes?u Node and link failures, plus message loss
6
Routing Challenges
CSE 123 – Lecture 15: Link-state Routing
! Routing within a network/organizationu A single administrative domainu The administrator can set edge costs
! Overall goalsu Provide intra-network connectivityu Adapt quickly to failures or topology changesu Optimize use of network resources
! Non-goalsu Extreme scalabilityu Lying, and/or disagreements about edge costs
7
Intra-domain Routing
CSE 123 – Lecture 13: Link-state Routing
! Staticu Type in the right answers and hope they are always trueu …So far
! Link stateu Tell everyone what you know about your neighborsu Today’s lecture!
! Distance vectoru Tell your neighbors what you know about everyoneu Next time…
8
Basic Approaches
CSE 123 – Lecture 15: Link-state Routing
! Two phasesu Reliable flooding
» Tell all routers what you know about your local topologyu Path calculation (Dijkstra’s algorithm)
» Each router computes best path over complete network
! Motivationu Global information allows optimal route computationu Straightforward to implement and verify
9
Link-state Routing
CSE 123 – Lecture 15: Link-state Routing
! Reliable floodingu Each router transmits a Link State Packet (LSP) on all linksu A neighboring router forwards out all links except incoming
» Keep a copy locally; don’t forward previously-seen LSPs
! Challengesu Packet lossu Out-of-order arrival
! Solutionsu Acknowledgments and retransmissionsu Sequence numbersu Time-to-live for each packet
Broadcasting Link State
10CSE 123 – Lecture 15: Link-state Routing
! LSP generated by X at T=0! Nodes become orange as they receive it
! Entire process repeats with LSPs for A, B, C, …u Actually in runs in parallel
X A
C B D
X A
C B D
X A
C B D
X A
C B D
T=0 T=1
T=2 T=3
11
Flooding Example
CSE 123 – Lecture 15: Link-state Routing
Dijkstra’s Shortest Path Tree! So you have all of these LSPs. Now what?! Graph algorithm for single-source shortest path tree
(find best route to all nodes)
S ß {}Q ß <remaining nodes keyed by distance>While Q != {}
u ß extract-min(Q) u = node with lowest costS ß S plus {u}Within Q:
for each node v adjacent to u“relax” the cost of v is it cheaper to go
through u?
ß u is done
12CSE 123 – Lecture 15: Link-state Routing
Dijkstra Example – Step 1
10
2 3
5
2
1
4 67
90
! Green nodes are “confirmed”
! Yellow nodes are “tentative”
! We can add ourselves to “confirmed”
13CSE 123 – Lecture 15: Link-state Routing
Example – Step 2
10
2 3
5
2
1
4 67
90
10
5
! Green nodes are “confirmed”
! Yellow nodes are “tentative”
! First look at neighbors! “5” is cheaper than
“10”! We can confirm path
with cost “5”
14CSE 123 – Lecture 15: Link-state Routing
Example – Step 3
10
2 3
5
2
1
4 67
90
8
5 7
14
! Green nodes are “confirmed”
! Yellow nodes are “tentative”
! Update costs! Look at 5’s neighbors! 7 is cheapest! We can confirm path
with cost 7
15CSE 123 – Lecture 15: Link-state Routing
Example – Step 4
10
2 3
5
2
1
4 67
90
8
5 7
13
! Green nodes are “confirmed”
! Yellow nodes are “tentative”
! Update costs! 7 has no new
neighbors! 8 is cheapest! We can confirm 8
16CSE 123 – Lecture 15: Link-state Routing
Example – Step 5
10
2 3
5
2
1
4 67
90
8
5 7
9
! Green nodes are “confirmed”
! Yellow nodes are “tentative”
! Update costs! No new neighbors! 9 is cheapest! We can confirm path
with cost 9
17CSE 123 – Lecture 15: Link-state Routing
Example – Done
10
2 3
5
2
1
4 67
90
8
5 7
9
18CSE 123 – Lecture 15: Link-state Routing
! Need to remove failed/old links from topologyu LSPs carry sequence numbers to distinguish new from oldu Routers only accept (and forward) the “newest” LSPu Send a new LSP with cost infinity to signal a link down
! But also need to remove entire routersu Put a Time To Live (TTL) timer on each LSP u TTL in every LSP, decremented periodically by each routeru When TTL = 0, purge the LSP and flood the network with an
LSP with TTL 0 to tell everyone else to do the same
19
Making Something Disappear
CSE 123 – Lecture 15: Link-state Routing
! Triggered by a topology changeu Link or node failure/recovery oru Configuration change like updated link metricu Converges quickly, but can cause flood of updates
! Periodicallyu Typically (say) every 30 minutesu Corrects for possible corruption of the datau Limits the rate of updates, but also failure recovery
When to Flood?
20CSE 123 – Lecture 15: Link-state Routing
! Getting consistent routing information to all nodesu E.g., all nodes having the same link-state databaseu Until routing protocol converges, strange things happen…
! Consistent forwarding after convergenceu All nodes have the same link-state databaseu All nodes forward packets on shortest pathsu The next router on the path forwards to the next hop
Convergence
21CSE 123 – Lecture 15: Link-state Routing
! Detection delayu A node does not detect a failed link immediatelyu … and forwards data packets into a black holeu Depends on timeout for detecting lost LSPs
32
2
1
14
1
4
5
3
Transient Disruptions
22CSE 123 – Lecture 15: Link-state Routing
! Inconsistent link-state databaseu Some routers know about failure before othersu The shortest paths are no longer consistentu Can cause transient forwarding loops
32
2
1
14
1
4
5
3
32
2
11
41
4 3
Transient Disruptions
23CSE 123 – Lecture 15: Link-state Routing
! Sources of convergence delayu Detection latencyu Flooding of link-state informationu Shortest-path computationu Creating the forwarding table
! Poor performance during convergence periodu Lost packets due to black holes and TTL expiryu Looping packets consuming resourcesu Out-of-order packets reaching the destination
! Very bad for VoIP, online gaming, and video
Convergence Delay
24CSE 123 – Lecture 15: Link-state Routing
! Faster detectionu Smaller LSP timersu Link-layer technologies that can detect failures
! Faster floodingu Flooding immediatelyu Sending link-state packets with high-priority
! Faster computationu Faster processors on the routersu Incremental Dijkstra’s algorithm
! Faster forwarding-table updateu Data structures supporting incremental updates
Reducing Delay
25CSE 123 – Lecture 15: Link-state Routing
! OSPF (Open Shortest Path First) and IS-ISu Most widely used intra-domain routing protocolsu Run by almost all ISPs and many large organizations
! Basic link state algorithm plus many features:u Authentication of routing messagesu Extra hierarchy: Partition into routing areas
» “Border” router pretends to be directly connected to all routers in an area (answers for them)
u Load balancing: Multiple equal cost routes
26
Real Link-state Protocols
CSE 123 – Lecture 15: Link-state Routing
Link State evaluation ! Strengths
u Loop free as long as LS database’s are consistent» Can have transient routing loops – shouldn’t last long
u Messages are smallu Converges quicklyu Guaranteed to converge
! Weaknessesu Must flood data across entire network (scalability?)u Must maintain state for entire topology (database)
CSE 123 – Lecture 15: Link-state Routing
For next time…
• Study for the Midterm• Midterm will by async on Canvas: 1 hour to complete after
you start, and available online for 24 hours• Exam covers everything up to Monday’s lecture• Homework 1 and 2 solutions posted on Piazza and website
• Read Chapter 3.4 in P&D (Distance vector)
28CSE 123 – Lecture 15: Link-state Routing