routing on the internet - lunds tekniska högskolabuilding a shortest path tree 2012-10-30 etsf10 -...
TRANSCRIPT
RoutingontheInternet
ETSF05/ETSF10– InternetProtocols
Howdoesroutingwork?
ETSF05/ETSF10- InternetProtocols 3
Choosinganoptimalpath• Accordingtoacostmetric• Decentralisedforwarding– eachrouterhasfull/necessaryinformation
Packet-switchedRouting
4ETSF05/ETSF10- InternetProtocols
Routing inPacketSwitchingNetworks
• Selectrouteacrossnetworkbetweenendnodes• Characteristicsrequired:– Correctness– Simplicity– RobustnessvsStability– FairnessvsOptimality– Efficiency
ETSF05/ETSF10- InternetProtocols 5
SA DA Data SA DA Data
Router
• Internetworkingdevice– Passesdatapacketsbetweennetworks– ChecksNetworkLayeraddresses– UsesRouting/forwardingtables
Two functions:❶ Routing❷ Forwarding
7ETSF05/ETSF10- InternetProtocols
RouterArchitectureOverview
ETSF05/ETSF10- InternetProtocols 8
InputPort
Decentralizedswitching:• Givendestination,lookupoutputportusingroutingtable
• Goal:completeinputportprocessingat‘linespeed’
Physicallayer:bit-levelreception
Datalinklayer:e.g.,Ethernet
9ETSF05/ETSF10- InternetProtocols
InputPortQueuing
• Fabricslowerthatsumofinputportsà queuing• Delayandloss duetoinputbufferoverflow• Head-of-the-Line(HOL)blocking:Datagramatfrontofqueuepreventsothersinqueuefromproceeding
10ETSF05/ETSF10- InternetProtocols
OutputPort
PriorityScheduling:• Schedulingdisciplinemaychooseamongqueueddatagramsfortransmission
11ETSF05/ETSF10- InternetProtocols
OutputPortQueuing
• Datagrams’arrivalratethroughtheswitchexceedsthetransmissionrateoftheoutputlineà buffering
• Delayandlossduetooutputportbufferoverflow
12ETSF05/ETSF10- InternetProtocols
SwitchingFabrics
13ETSF05/ETSF10- InternetProtocols
ForwardingTable
OSPFDomain
RIPDomain
BGP
OSkernel
OSPFProcess
OSPFRoutingtables
RIPProcess
RIPRoutingtables
BGPProcess
BGPRoutingtables
ForwardingTableManager
Staticroutingtable
RoutingTablesandForwardingTable
14ETSF05/ETSF10- InternetProtocols
Routercache
• Savenexthopforpackettype(e.g.addr andTOS)– Keeppacketswithinasessiononthesamepath– Prohibitsreordering– decreasesdelayvariations
• Worksinbothdirections– Replytakethesamepathasrequest
• Drawback:forlongsessions(e.g.video)sessioncontinuitymightbebrokeniflink fails (e.g.mobility)
• Typicalforusernetworks
ETSF05/ETSF10- InternetProtocols 15
PerformanceCriteria
• Usedforselectionofroute• Simplestistochoose“minimumhop”• Canbegeneralizedas“leastcost”routing• Because“leastcost”ismoreflexibleitismorecommonthan“minimumhop”
ETSF05/ETSF10- InternetProtocols 16
Flooding
• InFlooding anincomming packetisretransmittedonalloutgoing links.Ahopcounter isused toprevent loops
• What are thealternativestofind theleast costpath.
B
BestPath:DecisionTimeandPlace
Decisiontime(when?)• Packetorvirtualcircuit(session)basis• Fixedordynamicallychanging
Decisionplace(where?)• Distributed- madebyeachnode• Morecomplex,butmorerobust
• Centralized– madebyadesignatednode• Source– madebysourcestation
ETSF05/ETSF10- InternetProtocols 20
NetworkInformationSourceandUpdateTiming• Routingdecisionsusuallybasedonknowledgeofnetwork,trafficload,andlinkcost– Distributedrouting
• Usinglocalknowledge, information fromadjacentnodes,information fromallnodesonapotential route
– Centralrouting• Collectinformation fromallnodes
Issueofupdatetiming
• Dependsonroutingstrategy• Fixed- neverupdated• Adaptive- regularupdates
ETSF05/ETSF10- InternetProtocols 21
RoutingStrategies- FixedRouting
• Useasinglepermanentrouteforeachsourcetodestinationpairofnodes
• Determinedusingaleastcostalgorithm• Routeisfixed– Untilachangeinnetworktopology– Basedonexpectedtrafficorcapacity
• Advantageissimplicity• Disadvantageislackofflexibility– Doesnotreacttonetworkfailureorcongestion
ETSF05/ETSF10- InternetProtocols 22
RoutingStrategies- AdaptiveRouting
• Usedbyalmostallpacketswitchingnetworks• Routingdecisionschangeasconditionsonthenetworkchangeduetofailureorcongestion
• RequiresinformationaboutnetworkDisadvantages• Morecomplex• Tradeoffbetweenqualityandoverhead• Tooquickupdatesmayleadtooscillations• Tooslowupdatesmayleadtooutdatesinformation
ETSF05/ETSF10- InternetProtocols 24
Linkcost
• Acost function describes thecost fortransmittingapacketoveralink
• Thelink cost can depend one.g.– Datarate– Load– Length– Transmissionmedia– etc
Graf
N={A,B,C,D,E}
Anetworkcanbedescribedbyagraph,consistingofnodes(N)andadges (E)withweightsw(e),i.e.costs.Example (undirectedgraph)
E w(e)AB 3
AD 1
BC 1
BD 1
BE 1
CE 3
DE 3
ARPANETRoutingStrategies1stGeneration
DistanceVectorRouting
• 1969• Distributedadaptiveusingestimateddelay
– Queuelengthusedasestimateofdelay• VersionofBellman-Ford algorithm• Nodeexchangesdelayvectorwithneighbors• Updateroutingtablebasedonincominginformation• Doesn'tconsiderlinespeed,justqueuelengthandrespondsslowlytocongestion
ETSF05/ETSF10- InternetProtocols 29
Leastcostalg 1Bellman-Ford• Find theshortes path fromone sourcenode s totheothers.• Let !(#) bethecost from% to#
• Addition:Keep track of thepath!!
Init:!(%) = 0! # = ∞, # ≠ %
fori = 1./ 0 − 1foreach # ∈ 0
! # = min5∈6
{! 8 +:(8, #)} //Findtheshortestpathfrom//nodeutonodeninonestep
Example Bellman-Ford
Nod A B C D E
init 0 ∞ ∞ ∞ ∞i=1 0 3 ∞ 1 ∞i=2 0 2 4 1 4
i=3 0 2 3 1 3
i=4 0 2 3 1 3
A
D
B
E
C1
11 1
Netgraph asatree
Nod Dist
A 0
B 2
C 3
D 1
E 3
Distantvector forAwhen thealgorithmconverged
Bellman-Fordsalgoritmgrafiskt
<=> = min ?=@ + <@> , ?=A + <A> , ?=B + <B> …
<=> = DE# <=>, ?=F + <F>
Jmf Stallings kap 19.2
Distance Vector Routing
• Best path info shared locally– Periodically– Upon any change
• Routing tables updated for– New entries– Cost changes
2012-10-30 15ETSF10 - Internet Protocols
Updating a Routing Table
2012-10-30 ETSF10 - Internet Protocols 16
to C (+2)
Updating Algorithm (Bellman-Ford)if (advertised destination not in table)
{
add new entry // rule #1
}
else if (adv. next hop = next hop in table)
{
update cost // rule #2
}
else if (adv. cost < cost in table)
{
replace old entry // rule #3
}2012-10-30 17ETSF10 - Internet Protocols
Completed Routing Tables
2012-10-30 ETSF10 - Internet Protocols 18
Problem: Count to Infinity (1)
I can reach A at cost 1A I can reach
A at cost 2I can reach A at cost 3
I can reach A at cost 3
I don’t know A, so I will not tellA I can reach
A at cost 2
2012-10-30 19
1 2 3
1 2 3
ETSF10 - Internet Protocols
Problem: Count to Infinity (2)
A I can reach A at cost 5
2012-10-30 20
A I can reach A at cost 3
I can reach A at cost 4
A I can reach A at cost 2
I can reach A at cost 5
I can reach A at cost 6
I can reach A at cost 7
1 2 3
1 2 3
1 2 3
ETSF10 - Internet Protocols
Solution: Split Horizon
A I can’t reach A
I can reach A at cost 2 but I won’t tell 1
A I can’t reach A
I can’t reach A
A I can reach A at cost 2 but I won’t tell 1
I can reach A at cost 1
2012-10-30 21
1 2 3
1 2 3
1 2 3
ETSF10 - Internet Protocols
ARPANETRoutingStrategies2ndGeneration
Link-StateRouting• 1979• Distributedadaptiveusingdelay criterion– Usingtimestampsofarrival,departureandACKtimes
• Re-computesaveragedelaysevery10seconds• Anychangesarefloodedtoallothernodes• Re-computesroutingusingDijkstra’s algorithm• Goodunderlightandmediumloads• Underheavyloads,littlecorrelationbetweenreporteddelaysandthoseexperienced
ETSF05/ETSF10- InternetProtocols 35
Leastcostalg 2Dijkstra
Init:!(%) = 0! # = ∞, # ≠ %G = ∅ //Visited nodes
whileG ⊂ J8 = KLMmin
5∉O!(8) //Find least weight tounvisted node
G = G⋃8 //Add u tovisited nodesfor# ∉ G
! # = min{! # , ! 8 +:(8,#)} //Lesscost togoton viau?
• Findtheshortes path fromone sourcenode s totheothers.• Let !(#) bethecost from% to#
• Addition:Keep track of thepath!!
SPFexempelmedgrafA
D
B
E
C3
1
A
D
B
E
C3
12
4
A
D
B
E
C
12
4
3
3
A
D
B
E
C
12
3
3 6
A
D
B
E
C
12
3
3
Rotnod
Permanent nod
Preliminär nod
Potentiell väg
Permanent väg
Dijkstra tabell
Besökt L(A) L(B) L(C) L(D) L(E)Q 0 ∞ ∞ ∞ ∞{A} 3:A ∞ 1:A ∞{A,D} 2:D ∞ 4:D
{A,D,B} 3:B 3:B
{A,D,B,C} 3:B
{A,D,B,C,E}
Link State Routing
• Local topology info flooded globally– Periodically– Upon any change
• Routing tables updated for– Link state changes– Cost changes
2012-10-30 28ETSF10 - Internet Protocols
Initial Link State Knowledge
2012-10-30 ETSF10 - Internet Protocols 29
Tree Generation Algorithm (Dijkstra)put yourself to tentative list
while tentative list not empty
{
pick node which can be reached
with least cumulative cost
add it to your tree*
put its neighbours to tentative list**
with cumulative costs to reach them
}*(a.k.a. permanent list)**(if not already there)
2012-10-30 30ETSF10 - Internet Protocols
Building a Shortest Path Tree
2012-10-30 31ETSF10 - Internet Protocols
• After flooding• Take: A
ARPANETRoutingStrategies3rdGeneration• 1987• Linkcostcalculationchanged– Dampenroutingoscillations– Reduceroutingoverhead
• Measureaveragedelayoverlast10secondsandtransformintolinkutilizationestimate
• Calculateaverageutilizationbasedoncurrentvalueandpreviousaverage
R # +1 = STU # + S
T R(#)• Useaslinkcostafunctionbasedntheaverageutilization
ETSF05/ETSF10- InternetProtocols 39
AutonomousSystems(AS)
• Exhibitsthefollowingcharacteristics:– Isasetofroutersandnetworksmanagedbyasingleorganization
– Consistsofagroupofroutersexchanginginformationviaacommonroutingprotocol
– Exceptintimesoffailure,isconnected(inagraph-theoreticsense);thereisapathbetweenanypairofnodes
ETSF05/ETSF10- InternetProtocols 40
InteriorRouterProtocol(IRP)InteriorGatewayProtocol(IGP)
• SharedroutingprotocolspassesroutinginformationbetweenrouterswithinanAS
• Customtailoredtospecificapplicationsandrequirements
• Examples:– RoutingInformationProtocol(RIP)– OpenShortestPathFirst(OSPF)
ETSF05/ETSF10- InternetProtocols 41
ExteriorRouterProtocol(ERP)ExteriorGatewayProtocol(EGP)
• ProtocolusedtopassroutinginformationbetweenroutersindifferentASs
• WillneedtopasslessinformationthananIRP– TotransmitadatagramfromahostinoneAStoahostinanotherAS,arouterinthefirstsystemneedonlydeterminethetargetASanddevisearoutetogetintoit
– OncethedatagramentersthetargetAS,therouterswithinthatsystemcancooperatetodeliverthedatagram
– TheERPisnotconcernedwithdetailsoftheroute• Examples:– BorderGatewayProtocol(BGP)– OpenShortestPathFirst(OSPF)
ETSF05/ETSF10- InternetProtocols 42
Figure 19.9 Application of Exterior and Interior Routing Protocols
Autonomous System 1Autonomous System 2
Subnetwork1.4
Subnetwork1.3
Subnetwork1.2
Subnetwork1.1
Subnetwork2.3
Subnetwork2.2
Subnetwork2.4
Subnetwork2.1
Interior router protocolExterior router protocol
R4R1
R5
R8
R7
R6R2R3
ETSF05/ETSF10- InternetProtocols 43
RoutingAlgorithmsandProtocols
ETSF05/ETSF10- InternetProtocols 48
Distance-VectorRouting• Requiresthateachnodeexchangeinformationwithitsneighboringnodes– Twonodesaresaidtobeneighborsiftheyarebothdirectlyconnectedtothesamenetwork
• Usedinthefirst-generationroutingalgorithmforARPANET
• Eachnodemaintainsavectoroflinkcostsforeachdirectlyattachednetworkanddistanceandnext-hopvectorsforeachdestination
• RoutingInformationProtocol(RIP)usesthisapproach
ETSF05/ETSF10- InternetProtocols 49
RIP(RoutingInformationProtocol)
• IncludedinBSD-UNIXDistributionin1982• Distancemetric:– #ofhops(max15)todestinationnetwork
• Distancevectors:– exchangedamongneighboursevery30secondviaResponseMessage(advertisement)
• Implementation:– Applicationlayerprotocol,usesUDP/IP
ETSF05/ETSF10- InternetProtocols 50
RIPupdatemessage
• Contains thewhole forwarding table• Actiononreception:– Add 1to cost inreceivedmessage– Changenext hopto sending router– Apply RIPupdating algorithm
• Received update msgs identify neighbours!
ETSF05/ETSF10- InternetProtocols 52
RIP:LinkFailureandRecovery
• Ifnoadvertisementheardafter180seconds– Neighbour/linkdeclareddead– Routesvianeighbourinvalidated(infinitedistance=16hops)
– Newadvertisementssenttoneighbours(triggeringachainreactioniftableschanged)
– “Poisonreverse”usedtopreventcounttoinfinityloops
– “Goodnewstravelfast,badnewstravelslow”
57ETSF05/ETSF10- InternetProtocols
RoutingAlgorithmsandProtocols
ETSF05/ETSF10- InternetProtocols 58
Link-StateRouting• Whenarouterisinitialized,itdeterminesthelinkcostoneachofitsnetworkinterfaces
• Therouterthenadvertisesthissetoflinkcoststoallotherroutersintheinternettopology,notjustneighboringrouters
• Fromthenon,theroutermonitorsitslinkcosts• Whenthereisasignificantchange,therouteradvertisesitslinkcoststoallotherrouters
• TheOSPFprotocolisanexample• Thesecond-generationroutingalgorithmforARPANETalsousesthisapproach
ETSF05/ETSF10- InternetProtocols 59
OpenShortestPathFirst(OSPF)Protocol• RFC2328(RequestForComments)• UsedastheinteriorrouterprotocolinTCP/IPnetworks
• Computesaroutethatincurstheleastcostbasedonauser-configurablemetric
• Isabletobalanceloadsovermultipleequal-costpaths
ETSF05/ETSF10- InternetProtocols 60
OSPF(OpenShortestPathFirst)
• Dividesdomainintoareas– Limitsfloodingforefficiency– One”backbone”areaconnectsall
• Distancemetric:– Costtodestinationnetwork
61ETSF05/ETSF10- InternetProtocols
Areas,RouterandLinkTypes
62ETSF05/ETSF10- InternetProtocols
Graph
Networktopologyexpressedasagraph• Routers• Networks– Transit,passingdatathrough– Stub,nottransit
• Edges– Direct,routertorouter– Indirect,routertonetwork
ETSF05/ETSF10- InternetProtocols 63
Figure 19.11 A Sample Autonomous System
3 1
13
1
2
1 8 8
86
6
8 88
N13 N14N12
7 6
67
5
1N15
N12
1
3
1
4
2
9
1 21
3
1210
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12H1
N10
N7
N8
N9
N11
N4
N6
N3
N1
N2
ETSF05/ETSF10- InternetProtocols 64
Figure 19.12 Directed Graph of Autonomous System of Figure 19.11
31
1
3
2
1
8
8
6
6
88 8
N14N13N12
7
6
6
7
5
1 N15
N12
1
3 1
4
29
1
21
3
1
210
1
7
N1
N2
R1
R2
N3
8R3
N4
R4R5
R6
R7
N6
R8
R10
N8R11
N9
R9
N11
H1
R12
N10 N7
ETSF05/ETSF10- InternetProtocols 65
Transitnetwork
Stubnetwork
Direct edgePoint to point
Indirect edge
LinkStateAdvertisements
• Whattoadvertise?– Differententitiesasnodes– Differentlinktypesasconnections– Differenttypesofcost
ETSF05/ETSF10- InternetProtocols 69
RouterLinkAdvertisement
70ETSF05/ETSF10- InternetProtocols
NetworkLinkAdvertisement
• Networkisapassiveentity– Itcannotadvertiseitself
ETSF05/ETSF10- InternetProtocols 71
SummaryLinktoNetwork
• Donebyareaborderrouters– Goesthroughthebackbone
ETSF05/ETSF10- InternetProtocols 72
ExternalLinkAdvertisement
• Linktoasinglenetworkoutsidethedomain
ETSF05/ETSF10- InternetProtocols 74
Hellomessage
• Find neighbours• Keep contact with neighbours:Iam stillalive!• Sentout periodically,typically every 10second• Ifnohellos received during holdtime (typically30seconds),neighbour declared dead.
• Compare RIPupdate messages
ETSF05/ETSF10- InternetProtocols 75
Routing Algorithms andProtocols
• InteriorandExteriorRouterProtocols• Distancevector– Bellman-Ford– Announcewholetabletoneighbors– RIP
• LinkState– Dijkstra– Announceneighborconnectionstowholenetwork– OSPF
ETSF05/ETSF10- InternetProtocols 79