CSE 123A Computer Networks - cseweb.ucsd.educseweb.ucsd.edu/classes/wi05/cse123a/Lec9.pdfFebruary 2,...
Transcript of CSE 123A Computer Networks - cseweb.ucsd.educseweb.ucsd.edu/classes/wi05/cse123a/Lec9.pdfFebruary 2,...
CSE 123ACSE 123AComputer NetworksComputer Networks
Winter 2005Winter 2005
Lecture 9Lecture 9Internet Routing: Internet Routing:
Overview and Distance Vector AlgorithmsOverview and Distance Vector Algorithms
Some portions courtesy David Wetherall
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 2
Last classLast classHow to build Big/Huge Fast Routers
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 3
This classThis classNew topic: routing
How do I get there from here?
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 4
OverviewOverviewIntro & Design choices
Intra-domain routingDistance vectorLink state
Inter-domain routingPolicy
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 5
IntraIntra--domain routingdomain routingRouting within a network/organizationA single administrative domain
Overall goalsProvide intra-network connectivityAdapt quickly to failures or topology changesOptimize use of network resources
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 6
IntraIntra--domain routing:domain routing:Problem statementProblem statement
Routing is essentially a problem in graph theory
Network is a directed graph G=(V,E)Routers are vertices, links are edges labeled with some metric
For simplicity ignore hosts, they are part of each VFor each V, find the shortest path to every other V
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 7
Find “best” path between every pair of vertices
D
G
A
F
E
B
C=router
=link
Network as a GraphNetwork as a Graph
X
11
1
11
1
1
11 =cost
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 8
Routing QuestionsRouting QuestionsHow to choose best path?
Defining “best” can be slippery
How to scale to millions of users?Minimize control messages and routing table size
How to adapt to failures or changes?Node and link failures, plus message loss
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 9
Recap: What does a router do?Recap: What does a router do?
ForwardingMove packet from input link to the appropriate output linkPurely local computation Must go be very fast (executed for ever packet)
RoutingDoing work so you’re sure that the “next hop” actually leads to the destinationGlobal decisions; distributed computation and communicationCan go slower (only important when topology changes)
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 10
WhatWhat’’s in a Routing Table?s in a Routing Table?The routing table at A, lists – at a minimum –the next hops for the different destinations
D
G
A
F
E
B
C
FFFG
EECDCCBB
Next HopDest
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 11
Kinds of routing/forwardingKinds of routing/forwardingSource routing
Complete path in packetVirtual circuits
Set up path out-of-band and store path identifier in routersLocal path identifier in packet
Destination-based forwardingRouter looks up address in forwarding tableForwarding table contains (address, next-hop) tuples
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 12
Source routingSource routingRouting
Host computes path Must know global topology and detect failuresPacket contains complete ordered path information
» I.e. node A then D then X then J…Requires variable length path header
ForwardingRouter looks up next hop in packet header, strips it off and forwards remaining packetVery quick forwarding, no lookup requiredVery flexible
In practice ad hoc networks (DSR), SANs (Myrinet), and for debugging on the Internet (LSR,SSR)
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 13
Virtual circuitsVirtual circuitsRouting
Hosts sets up path out-of-band, requires connection setupWrite (input id, output id, next hop) into each router on pathFlexible (one path per flow)
ForwardingSend packet with path idRouter looks up input, swaps for output, forwards on next hopRepeat until reach destinationTable lookup for forwarding (why faster than IP lookup?)
In practiceATM: fixed VC identifiers and separate signaling codeMPLS: ATM meets the IP world (why? traffic engineering)
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 14
DestinationDestination--based routingbased routingRouting
All addresses are globally known» No connection setup
Host sends packet with destination address in header» No path state; only routers need to worry about failure
Distributed routing protocol used to routing tablesForwarding
Router looks up destination in table» Must keep state proportional to destinations rather than
connections(Address, next-hop) tupleLookup address, send packet to next-hop link
» All packets follow same path to destinationIn Practice: IP routing
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 15
Three approaches to IP routingThree approaches to IP routing
StaticType in the right answers and hope they are always true
Distance vectorTell your neighbors when you know about everyone
Link stateTell everyone what you know about your neighbors
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 16
Distance Vector routingDistance Vector routingAssume
Each router knows own address & cost to reach neighbors
GoalCalculate routing table containing next-hop information for every destination at each router
Distributed Bellman-Ford algorithmEach router maintains a vector of costs to all destinations
» Initialize neighbors with known cost, others with infinityPeriodically send copy of distance vector to neighborsOn reception of a vector
» If neighbor’s path to a destination is shorter, switch to it
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 17
Initial conditionsInitial conditions
1
7
8
2
2
1
A
E
B C
D
02∞81E202∞∞D∞201∞C8∞107B1∞∞70AEDCBA
Distance to NodeInfo at node
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 18
E receives DE receives D’’s vectors vector
1
7
8
2
2
1
A
E
B C
D
02481E202∞∞D∞201∞C8∞107B1∞∞70AEDCBA
Distance to NodeInfo at node
I’m 2 from C, 0 from D and 2 from E
D is 2 away, 2+2< ∞, so best path to C is 4
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 19
A receives BA receives B’’s vectors vector
1
7
8
2
2
1
A
E
B C
D
02481E202∞∞D∞201∞C8∞107B1∞870AEDCBA
Distance to NodeInfo at node
I’m 7 from A, 0 from B, 1 from X &
8 from D
B is 7 away, 1+7< ∞so best path to C is 8
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 20
A receives EA receives E’’s vectors vector
1
7
8
2
2
1
A
E
B C
D
02481E202∞∞D∞201∞C8∞107B13570AEDCBA
Distance to NodeInfo at node
I’m 1 from A, 8 from B, 4 from C, 2 from D & 0 from E
E is 1 away, 4+1<8 so C is 5 away, 1+2< ∞
so D is 3 away
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 21
Final stateFinal state
1
7
8
2
2
1
A
E
B C
D
02451E20233D42015C53106B13560AEDCBA
Distance to NodeInfo at node
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 22
View from a node (B)View from a node (B)
1
7
8
2
2
1
A
E
B C
D
588E31010D11212C697ACEA
Next hopDest
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 23
Link failureLink failure
1
7
8
2
2
1
A
E
B C
D
0104512E20233D42018C53107B
1210870AEDCBA
Distance to NodeInfo at
node
• A marks distance to E as ∞ , and tells B• E marks distance to A as ∞ , and tells B and D• B and D recompute routes and tell C, E and E• etc… until converge
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 24
Problems: Problems: Count to InfinityCount to Infinity
1A CB
23 2
1A CB3 4
Update 3
1A CB
Update4
5 4
Etc…
Distance to C
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 25
Why?Why?Updates don’t contain enough information
Can’t totally order bad news above good news
B’s accepts A’s path to C that is implicitlythrough B!
Aside: this also causes delays in convergence
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 26
SolutionsSolutionsHold downs
As metric increases, delay propagating informationLimitation: Delays convergence
Split horizonNever advertise a destination through its next hop
» A doesn’t advertise C to BPoison reverse: Send negative information when advertising a destination through its next hop
» A advertises C to B with a metric of ∞Limitation: Only works for “loop”s of size 2
Loop avoidanceFull path information in route advertisementExplicit queries for loops (e.g. DUAL)
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 27
How split horizon/How split horizon/pvpv failsfails
1
A C
B
D
1
1
• A tells B & C that D is unreachable
• B tells C that D is unreachable
• B tells A that D is reachable with cost=3 (since route is through C, split horizon doesn’t apply)
• A tells C that D is reachable through A (cost=4)
• Etc…
1
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 28
Other issuesOther issuesWhen to send route updates?Periodically
Limits granularity of failure recoveryGlobal synchronization can cause packet loss
JitteredRandom offset from periodic deals with synchronization problem
TriggeredSend updates immediately when metric changesConverges more quickly, but causes flood of packets
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 29
Routing Information Protocol Routing Information Protocol (RIP)(RIP)
DV protocol with hop count as metricInfinity value is 16 hops; limits network sizeIncludes split horizon with poison reverse
Routers send vectors every 30 secondsWith triggered updates for link failuresTime-out in 180 seconds to detect failures
RIPv1 specified in RFC1058www.ietf.org/rfc/rfc1058.txt
RIPv2 (adds authentication etc.) in RFC1388www.ietf.org/rfc/rfc1388.txt
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 30
Key ConceptsKey ConceptsRouting is a global process, forwarding is local oneThe Distance Vector algorithm and RIP
Simple and distributed exchange of shortest paths.Weak at adapting to changes (loops, count to infinity)
February 2, 2005 CSE 123A -- Lecture 8 – Internet Routing: Overview and Distance Vector Algorithms 31
For next timeFor next time……No new reading… although review the section about link state routing since that’s what we’ll be talking about