livello rete i protocolli di routing: rip, ospf,...
TRANSCRIPT
Reti(già “Reti di Calcolatori”)
Livello ReteI protocolli di Routing: RIP, OSPF, BGP
RenatoLoCigno
http://disi.unitn.it/locigno/index.php/teaching-duties/computer-networks
Acknowledgement
• Credits– Partof thematerialis based onslides provided by thefollowing authors• JimKurose,KeithRoss,“ComputerNetworking:ATopDownApproach,”4thedition,Addison-Wesley,July2007
• DouglasComer,“ComputerNetworksandInternets,”5thedition,PrenticeHall
• Behrouz A.Forouzan,Sophia Chung Fegan,“TCP/IPProtocol Suite,”McGraw-Hill,January 2005
• Latraduzione,sepresente,èingeneraleopera(eresponsabilità)deldocente
[email protected] LivelloRete- Protocollidirouting 2
Contenuto e temi
• Spaziodiindirizzamento
• IndirizziIPelorouso
• Consegnadeipacchetti
• ConfigurazionedeiPCedellereti
• InstradamentoeRouting
[email protected] LivelloRete- Protocollidirouting 3
Routing: What is it?
• Processoffindingapathfromasourcetoeverydestinationinthenetwork
• SupposeyouwanttoconnecttoAntarcticafromyourdesktop– whatrouteshouldyoutake?– doesashorterrouteexist?– whatifalinkalongtheroutegoesdown?– whatifyou’reonamobilewirelesslink?
• Routingdealswiththesetypesofissues
[email protected] LivelloRete- Protocollidirouting 4
Basics
• Aroutingprotocolsetsuparoutingtable inrouters– internaltablethatsays,foreachdestination,whichisthenextoutputtotake
• Anodemakesalocalchoicedependingonglobaltopology:thisisthefundamentalproblem
[email protected] LivelloRete- Protocollidirouting 5
Key problem
• Howtomakecorrectlocaldecisions?– eachroutermustknowsomethingaboutglobalstate
• Globalstate– inherentlylarge– dynamic– hardtocollect
• Aroutingprotocolmustintelligentlysummarizerelevantinformation
[email protected] LivelloRete- Protocollidirouting 6
Requirements
• Minimizeroutingtablespace– fasttolookup– lesstoexchange
• Minimizenumberandfrequencyofcontrolmessages• Robustness:avoid
– blackholes– loops– oscillations
• Useoptimalpath
[email protected] LivelloRete- Protocollidirouting 7
Different degrees of freedom
• Centralizedvs.distributedrouting– centralizedissimpler,butpronetofailureandcongestion
• Globalvslocalinformationexchange– conveyglobalinformationisexpensive
• Staticvsdynamic– staticmayworkattheedge,notinthecore
• Stochasticvs.deterministic– stochasticspreadsload,avoidingoscillations,butmisorders
• Singlevs.multiplepath– primaryandalternativepaths(comparewithstochastic)
• State-dependentvs.state-independent– doroutesdependoncurrentnetworkstate(e.g.delay)
[email protected] LivelloRete- Protocollidirouting 8
Dynamic Routing And Routers
• Toensurethatallroutersmaintaininformationabouthowtoreacheachpossibledestination– eachrouterusesaroutepropagationprotocol
• toexchangeinformationwithotherrouters– whenitlearnsaboutchangesinroutes
• updatesthelocalroutingtable• Becauseroutersexchangeinformationperiodically
– thelocalroutingtableisupdatedcontinuously
[email protected] LivelloRete- Protocollidirouting 9
1
23
0111
valore nell’intestaz.del pacchetto entrante
Algoritmo d’instradamento
Tabella d’instrad. localeVal. intestaz. link in usc.
0100010101111001
3221
Routing e Forwarding
[email protected] LivelloRete- Protocollidirouting 10
Grafo: G = (N,E)
N = insieme di nodi (router) = { u, v, w, x, y, z }
E = insieme di archi (collegamenti) ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Grafo di una rete di calcolatori
N.B.:Ilgrafoèun’astrazioneutileancheinaltricontestidirete
Esempio:P2P,doveNèuninsiemedipeeredEèuninsiemedicollegamentiTCP
u
yx
wv
z2
21
3
1
1
2
53
5
[email protected] LivelloRete- Protocollidirouting 11
Grafo di una rete: costi
u
yx
wv
z2
21
3
1
1
2
53
5 • c(x,x’)=costodelcollegamento(x,x’)
- es.,c(w,z)=5
• ilcostodiuncamminoèsemplicementelasommadituttiicostidegliarchilungoilcammino
Costodiuncammino(x1,x2,x3,…,xp)=c(x1,x2)+c(x2,x3)+…+c(xp-1,xp)
Domanda:Qualèilcamminoacostominimotrauez?
Algoritmod’instradamento:determinailcamminoacostominimoProtocollod’instradamento:procuraall’algoritmoidatinecessarialcalcoloediffondeirisultati
[email protected] LivelloRete- Protocollidirouting 12
Monotonia e coerenza dei camminiminimi
Definec(i,k)>=0:costfromi tok(directconnection)D(i,j):costofleast-costpathfromi toj
è Thesubsetofashortestpathisalsotheshortestpathbetweenthetwointermediatenodes
• Then,iftheshortestpathfromnodei tonodej,withdistanceD(i,j),passesthroughneighbork,withlinkcostc(i,k),wehave:– D(i,j)=c(i,k)+D(k,j)
ik j
[email protected] LivelloRete- Protocollidirouting 14
Distance Vector (DV) algorithm
• Initialdistancevalues(iteration1):– D(i,i)=0– D(i,k)=c(i,k)ifkisaneighbor(kisone-hopaway)– D(i,j)=INFINITYforallothernon-neighborsj
• ThesetofvaluesD(i,*)isadistancevectoratnodei• Thealgorithmmaintainsanext-hopvalue(forwardingtable)for
everydestinationj,initializedas:– next-hop(i)=i;– next-hop(k)=kifkisaneighbor,and– next-hop(j)=UNKNOWN ifjisanon-neighbor.
[email protected] LivelloRete- Protocollidirouting 15
Distance Vector (DV) algorithm
• Aftereveryiterationeachnodei exchangesitsdistancevectorsD(i,*)withallitsimmediateneighbors.
Foranyneighborkifc(i,k)+D(k,j)<D(i,j)then{D(i,j)=c(i,k)+D(k,j)next-hop(j)=k
}
[email protected] LivelloRete- Protocollidirouting 16
In summary
Basicidea:• Fromtime-to-time,eachnodesendsitsowndistancevector
estimatetoneighborsAsynchronous• WhenanodexreceivesnewDVestimatefromneighbor,itupdates
itsownDVusingB-Fequation:D(x,y)←minv{c(x,v)+D(v,y)}foreachnodey∊ N
• Underminor,naturalconditions,theestimateD(x,y)convergestotheactualleastcost
[email protected] LivelloRete- Protocollidirouting 17
In summary
• Iterative,asynchronous:eachlocaliterationcausedby:– locallinkcostchange– DVupdatemessagefromneighbor
• Distributed:eachnodenotifiesneighborsonlywhenitsDVchanges– neighborsthennotifytheirneighborsifnecessary
wait for (change in local link cost or msg from neighbor)
recompute estimates
if DV to any dest has changed, notify neighbors
Eachnode:
[email protected] LivelloRete- Protocollidirouting 18
Distance Vector: example (initialization)
A
B C
D
7
1
1
2
25
E
A
àAàBàCàDàE
dist
07--1
NH
-B--E
B
àAàBàCàDàE
dist
701-5
NH
A-C-E
C
àAàBàCàDàE
dist
-102-
NH
-B-D-
NH
--C-E
D
àAàBàCàDàE
dist
--202
NH
AB-D-
E
àAàBàCàDàE
dist
[email protected] LivelloRete- Protocollidirouting 19
Distance Vector: example (running)
A
B C
D
7
1
1
2
25
E
C
àAàBàCàDàE
dist
-102-
NH
-B-D-
D
àAàBàCàDàE
dist
--202
NH
--C-E
E
àAàBàCàDàE
dist
15-20
NH
[email protected] LivelloRete- Protocollidirouting 20
Distance Vector: example (running)
A
B C
D
7
1
1
2
25
E
C
àAàBàCàDàE
dist
-1024
thr.
-B-DD
NH
ABDD-
E
àAàBàCàDàE
dist
15420
NH
--C-E
D
àAàBàCàDàE
dist
[email protected] LivelloRete- Protocollidirouting 21
Distance Vector: example (running)
A
B C
D
7
1
1
2
25
E
NH
ABDD-
E
àAàBàCàDàE
dist
15420
NH
--C-E
D
àAàBàCàDàE
dist
--202
A
àAàBàCàDàE
dist
07--1
NH
-B--E
B
àAàBàCàDàE
dist
701-5
NH
A-C-E
[email protected] LivelloRete- Protocollidirouting 22
Distance Vector: example (running)
A
B C
D
7
1
1
2
25
E
NH
ABDD-
E
àAàBàCàDàE
dist
15420
NH
EEC-E
D
àAàBàCàDàE
dist
37202
A
àAàBàCàDàE
dist
06531
NH
-EEEE
B
àAàBàCàDàE
dist
60175
NH
E-CEE
[email protected] LivelloRete- Protocollidirouting 23
[email protected] LivelloRete- Protocollidirouting 24
Distance Vector: example (final point)
A
B C
D
7
1
1
2
25
E
A
àAàBàCàDàE
dist
06531
NH
-EEEE
B
àAàBàCàDàE
dist
60135
NH
E-CCE
C
àAàBàCàDàE
dist
51024
NH
DB-DD
NH
ECC-E
D
àAàBàCàDàE
dist
33202
NH
ABDD-
E
àAàBàCàDàE
dist
15420
Problem: “counting to infinity”
• ConsidertheentriesineachroutingtablefornetworkNTW_1
• RouterDisdirectlyconnectedtoNTW_1
B
AC
D
1 1
110
NTW_1
Router ADest Next Metric
NTW_1 D 2
Router BDest Next Metric
NTW_1 A 3
Router CDest Next Metric
NTW_1 A 3
Router DDest Next Metric
NTW_1 dir 1
1
[email protected] LivelloRete- Protocollidirouting 25
Problem: “counting to infinity”
Router ADest Next Metric
NTW_1 Unr. -
Router BDest Next Metric
NTW_1 A 3
Router CDest Next Metric
NTW_1 A 3
Router DDest Next Metric
NTW_1 dir 1
B
AC
D
1 1
110
NTW_1
1
Link between B and D fails
time
Router ADest Next Metric
NTW_1 C 4
Router BDest Next Metric
NTW_1 C 4
Router CDest Next Metric
NTW_1 B 4
Router DDest Next Metric
NTW_1 dir 1
Router ADest Next Metric
NTW_1 C 5
Router BDest Next Metric
NTW_1 C 5
Router CDest Next Metric
NTW_1 B 5
Router DDest Next Metric
NTW_1 dir 1
[email protected] LivelloRete- Protocollidirouting 26
Problem: “counting to infinity”
B
AC
D
1 1
10
NTW_1
1
time
Router ADest Next Metric
NTW_1 C 11
Router BDest Next Metric
NTW_1 C 11
Router CDest Next Metric
NTW_1 B 11
Router DDest Next Metric
NTW_1 dir 1
Router ADest Next Metric
NTW_1 C 12
Router BDest Next Metric
NTW_1 C 12
Router CDest Next Metric
NTW_1 D 11
Router DDest Next Metric
NTW_1 dir 1
…
[email protected] LivelloRete- Protocollidirouting 27
Solutions to “counting to infinity”
• Maximumnumberofhopsboundedto15– thislimitstheconvergencetime
• SplitHorizon– simple
• eachnodeomits routeslearnedfromoneneighborinupdatesenttothatneighbor
– withpoisonedreverse• eachnodeinclude routeslearnedfromoneneighborinupdatesenttothatneighbor,settingtheirmetricstoinfinity
– drawback:routingmessagesizegreaterthansimpleSplitHorizon
[email protected] LivelloRete- Protocollidirouting 28
Distance Vector: link cost changes
• Iflinkcostchanges:– goodnewstravelsfast
• good=costdecreases– badnewstravelsslow
• bad=costincreases• Exercise
– trytoapplythealgorithminthesimplescenariodepictedabovewhen• thecostofthelinkAà Bchangesfrom4to1• thecostofthelinkAà Bchangesfrom4to60
A
CB4 1
50
[email protected] LivelloRete- Protocollidirouting 29
RIP at a glance
• RoutingInformationProtocol• Asimpleintradomainprotocol• StraightforwardimplementationofDistanceVectorRouting…
– DistributedversionofBellman-Ford(DBF)…withwellknownissues– slowconvergence– workswithlimitednetworksize
• Strengths– simpletoimplement– simplemanagement– widespreaduse
[email protected] LivelloRete- Protocollidirouting 30
RIP at a glance
• Metricbasedonhopcount– maximumhopcountis15,with“16”equalto“infinity”
• imposedtolimittheconvergencetime– thenetworkadministratorcanalsoassignvalueshigherthan1toasinglehop
• Eachrouteradvertisesitsdistancevectorevery30seconds(orwheneveritsroutingtablechanges)toallofitsneighbors– RIPusesUDP,port520,MulticastGroup224.0.0.9
• Changesarepropagatedacrossnetwork• Routesaretimeout(setto16)after3minutesiftheyarenot
updated
[email protected] LivelloRete- Protocollidirouting 31
RIP procedures: introduction
• RIProutingtablesaremanagedbyapplication-levelprocess– e.g.,routed onUNIXmachines
• AdvertisementsaresentinUDPpackets(port520)• RIPmaintains3differenttimerstosupportitsoperations
– Periodicupdatetimer(25-30sec)• usedtosentoutupdatemessages
– Invalidtimer(180sec)• Ifupdateforaparticularentryisnotreceivedfor180sec,routeisinvalidated
– Garbagecollectiontimer(120sec)• Aninvalidrouteinmarked,notimmediatelydeleted• Fornext120s.therouteradvertisesthisroutewithdistanceinfinity
IP
TCP UDP
route
Data Link
Physical
[email protected] LivelloRete- Protocollidirouting 32
RIP procedures: input processing
• RequestMessages– generatedbyroutersthatjustcomeup– action:therouterrespondsdirectlytotherequestor’saddressandport• requestisprocessedentrybyentry
• ResponseMessages– routersthatperformregularupdates,triggeredupdatesorrespondtoaspecificquery
– action:therouterupdatesitsroutingtable• incaseofnewrouteorchangedroutes,therouterstartsatriggeredupdateprocedure
[email protected] LivelloRete- Protocollidirouting 33
RIP procedures: output processing
• Outputaregenerated– whentheroutercomesupinthenetwork– ifrequiredbytheinputprocessingprocedures– byregularroutingupdate
• Action:theroutergeneratesthemessagesaccordingtothecommandsreceived– themessagescontainentriesfromtheroutingtable
timers
input output
request response
timers
input output
response response
timers
input output
response
[email protected] LivelloRete- Protocollidirouting 34
ALGORITMI E PROTOCOLLI LINK-STATE
Unapprocciodiversoe“centralizzato”pertrovareicamminiminimi
[email protected] LivelloRete- Protocollidirouting 35
Link State (LS) Approach
• Thelinkstate(Dijkstra)approachisiterative,butitpivotsarounddestinationsj,andtheirpredecessorsk=p(j)– Observethatanalternativeversionoftheconsistencyconditionholdsfor
thiscase:D(i,j)=D(i,k)+c(k,j)
• Eachnodei collectsalllinkstatesc(*,*)firstandrunsthecompleteDijkstraalgorithmlocally
ik
j
[email protected] LivelloRete- Protocollidirouting 36
Link State (LS) Approach…
• Linkstatesaredistributedtoallnodes,whichbuildagraphG(N,E)describingtheentirenetwork
• EachnodeappliesDijkstra:minimumshortestpathsfromitselftoallnodes
• Ateachiteration,thealgorithmfindsanewdestinationjandashortestpathtoit
• Aftermiterationsthealgorithmhasexploredpaths,whicharemhopsorsmallerfromnodei
• TheDijkstra algorithmatnodei maintainstwosets:
– setNthatcontainsnodestowhichtheshortestpathshavebeenfound
– setMthatcontainsallothernodes
– Forallnodesk,twovaluesaremaintained:
• D(i,k):currentvalueofdistancefromi tok
• p(k):thepredecessornodetokontheshortestknownpathfromi
[email protected] LivelloRete- Protocollidirouting 37
Dijkstra: Initialization
• Initialization:– D(i,i)=0andp(i)=i;– D(i,k)=c(i,k)andp(k)=i ifkisaneighborofi– D(i,k)=INFINITYandp(k)=UNKNOWN ifkisnotneighborofi– SetN={i },andnext-hop(i)=i– SetM={j|jisnoti}
• InitiallysetNhasonlythenodei andsetMhastherestofthenodes• Attheendofthealgorithm,setNcontainsallthenodes,andsetM
isempty
[email protected] LivelloRete- Protocollidirouting 38
Dijkstra: Iteration
• Ineachiteration,anewnodejismovedfromsetMintothesetN.
– NodejhastheminimumdistanceamongallcurrentnodesinMD(i,j)=min(kinM) D(i,k).
– Ifmultiplenodeshavethesameminimumdistance,anyoneofthemischosenasj
– Next-hop(j)=theneighborofi ontheshortestpath,orjitself
– ThedistancevaluesofanyneighborkofjinsetMisrecomputedas:IfD(i,k)> (D(i,j)+c(j,k))
D(i,k)=D(i,j)+c(j,k);p(k)=j
• Thisoperationiscalled“relaxing”theedgesofnodej
[email protected] LivelloRete- Protocollidirouting 39
Dijkstra’s algorithm: example
Step012345
set NA
ADADE
ADEBADEBC
ADEBCF
D(B),p(B)2,A2,A2,A
D(C),p(C)5,A4,D3,E3,E
D(D),p(D)1,A
D(E),p(E)infinity
2,D
D(F),p(F)infinityinfinity
4,E4,E4,E
A
ED
CB
F2
21
3
1
1
2
53
5
The shortest-paths spanning tree rooted at A is called an [email protected] LivelloRete- Protocollidirouting 40
Dijkstra’s algorithm, discussion
Algorithmcomplexity: nnodes• eachiteration:needtocheckallnodes,w,notinN• n(n+1)/2comparisons:O(n2)• moreefficientimplementationspossible:O(nlog(n))Oscillationspossible:• e.g.,linkcost=amountofcarriedtraffic
AD
CB
1 1+e
e0
e1 1
0 0
AD
CB
2+e 0
001+e 1
AD
CB
0 2+e
1+e10 0
AD
CB
2+e 0
e01+e 1
initially … recomputerouting
… recompute … recompute
[email protected] LivelloRete- Protocollidirouting 41
Open Shortest Path First (OSPF)
• InalternativaalprotocolloRIPditipo DistanceVectorinInternetesiste ilprotocolloOSPFditipo LinkState
• Itre principali criteri diprogettazione delprotocollo OSPFsono:– distinzione tra hosterouter– reti broadcast– suddivisione delle reti digrandi dimensioni
• Hli hostsono collocati nelle aree periferiche della reteasottoreti locali connessealla attraverso router(defaultgateway)
• Ilmodello linkstateprevede che il databaselinkstate includa una entryperognilinktra hosterouter
• OSPFassocia il linkdiaccesso aduna stubnetwork– una stubnetworkè una sottorete terminale che nonfornisce servizio di
transito– il linkdiaccesso viene identificatodall’indirizzo della sottorete
[email protected] LivelloRete- Protocollidirouting 42
Il protocollo OSPF
• IlprotocolloOSPFutilizza 3procedure,chiamati ancora `protocolli’,persvolgere leproprie funzioni
– HelloProtocol
– ExchangeProtocol
– FloodingProtocol
[email protected] LivelloRete- Protocollidirouting 43
Messaggi OSPF (1)
• Imessaggi OSPFsono trasportati direttamente all’internodei pacchetti IP– nonviene utilizzato il livello ditrasporto– viene usato l’indirizzomulticast224.0.0.5
• Tutti i messaggi OSPFcondividono lostesso header
Packet lengthTypeVersion #Router IDArea ID
Checksum Auth TypeAuthenticationAuthentication
[email protected] LivelloRete- Protocollidirouting 44
Messaggi OSPF (2)
• Version#=2• Type:indicailtipodimessaggio• PacketLength:numerodibytedelmessaggio• RouterID:indirizzoIPdelrouterdiriferimento
Packet lengthTypeVersion #Router IDArea ID
Checksum Auth TypeAuthenticationAuthentication
[email protected] LivelloRete- Protocollidirouting 45
Messaggi OSPF (3)
• AreaID:identificativo dell’area– OSPFconsente una divisione della retein“aree”perridurre lacomplessità
delcalcolo dei percorsi eperconsentire uninstradamentogerarchico.• Auth Type:tipo diautenticazione
– 0noautenticazione,1autenticazione conpasswd• Authentication:password
Packet lengthTypeVersion #Router IDArea ID
Checksum Auth TypeAuthenticationAuthentication
[email protected] LivelloRete- Protocollidirouting 46
Il protocollo Hello
• Funzioni:– verificarel’operativitàdeilink
• Messaggi:– Hello
PriorityOptionsDead interval
Designated router
Common header (type = 1, hello)Network mask
Hello interval
Backup Designated routerNeighbor
[email protected] LivelloRete- Protocollidirouting 47
Il protocollo Exchange
• Funzioni:– sincronizzazionedeidatabaselinkstate(bringupadjacencies)traduerouterchehannoappenaverificatol’operativitàbidirezionaledellinkcheliconnette
– protocolloclient-server– messaggi:
• DatabaseDescriptionPackets• LinkStateRequest• LinkStateUpdate
– N.B.ilmessaggioLinkStateUpdatevienedistribuitoinflooding
[email protected] LivelloRete- Protocollidirouting 48
Exchange Protocol: messaggi (1)
• DatabaseDescription
0OptionsDD sequence number
Link State Type
Common header (type = 2, db description)
Link State IDAdvertising router
00
Link State Sequence NumberLink State Checksum Link State Age
[email protected] LivelloRete- Protocollidirouting 49
Il protocollo di Flooding
• Funzioni:– aggiornare il databaselinkstatedell’autonomoussystemaseguito delcambiamento distato diunlink
– Garantisce laconsegna ditutti Imessaggi atutti,acosto diparecchie repliche
• Messaggi:– LinkStateUpdate
Number of link state advertisementLink state advertisement #1Link state advertisement #2
Common header (type = 4, link state update)
[email protected] LivelloRete- Protocollidirouting 50
Controlled Flooding
• Tutti i nodi inviano i pacchetti ricevuti dauna interfaccia su tutte lealtre
• Inuna reteconlinkpunto-punto il numerodipacchetti è pari alnumero dilink
• Inuna retecondomini dibroadcast,il numero dipacchetti è pari ilnumero didomini boradcast
[email protected] LivelloRete- Protocollidirouting 51
8repliche 2repliche
Summary
• Topologyinformationisfloodedwithintheroutingdomain
• Bestend-to-endpathsarecomputedlocallyateachrouter
• Bestend-to-endpathsdeterminenext-hops
• Basedonminimizingsomenotionofdistance
• Worksonlyifpolicyissharedanduniform
• Examples:OSPF
• Eachrouterknowslittleaboutnetworktopology
• Onlybestnext-hopsarechosenbyeachrouterforeachdestinationnetwork.
• Bestend-to-endpathsresultfromcompositionofallnext-hopchoices
• Doesnotrequireanynotionofdistance
• Doesnotrequireuniformpoliciesatallrouters
• Examples:RIP
Link State Distance Vector
[email protected] LivelloRete- Protocollidirouting 52
Comparison of LS and DV algorithms
Messagecomplexity• LS:withnnodes,Elinks,O(nE)msgs
sent• DV:exchangebetweenneighbors
only– convergencetimevaries
SpeedofConvergence• LS:O(n2)algorithmrequiresO(nE)
msgs– mayhaveoscillations
• DV:convergencetimevaries– mayberouting loops– count-to-infinity problem
Robustness:whathappensifroutermalfunctions?
• LS:– nodecanadvertiseincorrectlink
cost– eachnodecomputesonlyitsown
table• DV:
– DVnodecanadvertiseincorrectpathcost
– eachnode’s tableusedbyothers• errorpropagatethrunetwork
[email protected] LivelloRete- Protocollidirouting 53
Instradamento e Topologia Globaliin Internet
Comesi effettua il trasferimento el’instradamento complessivo intutta lareteQualche considerazione sulle proprietàglobali delsistema
Instradamento gerarchico
Scala: conmilionididestinazioni:r Archiviareleinformazioni
d’instradamentosuciascunasottoreterichiederebbeun’enormequantitàdimemoria
r IltrafficogeneratodagliaggiornamentiLSnonlascerebberobandaperipacchettididati!
Autonomiaamministrativa:r Internet=laretedelleretir Daunpuntodivistaideale,
ciascunodovrebbeessereingradodiamministrarelapropriaretenelmododesiderato,purmantenendolapossibilitàdiconnetterlaalleretiesterne
Finquiabbiamovistolaretecomeunacollezionedirouterinterconnessir Ciascunroutereraindistinguibiledaglialtrir Visioneomogeneadellarete
…nellapraticalecosenonsonocosìsemplici
Instradamento gerarchico
r Organizzazionedirouterin sistemiautonomi(AS,autonomous system).
r Irouterdiungruppoautonomoeseguonolostessoalgoritmod’instradamento.mProtocollod’instradamentointernoalsistemaautonomo(intra-AS).
mIrouterappartenentiadifferentiASpossonoeseguireprotocollid’instradamentointra-ASdiversi
BorderRoutersr Hannoilcompito
aggiuntivod’inoltrarepacchettiadestinazioniesterne.
3b
1d
3a
1c
2a
AS3
AS1
AS2
1a
2c2b
1b
Algoritmod’instradamento
(intra-AS)
Algoritmod’instradamento
(intra-AS)
Tabellad’inoltro
3c
Sistemi autonomi interconnessi
r Ciascunsistemaautonomosacomeinoltrarepacchettilungoilpercorsoottimoversoqualsiasidestinazioneinternaalgruppom IsistemiAS2eAS3hanno
trerouterciascunom Iprotocollid’instradamento
deitresistemiautonominonsononecessariamenteglistessi
m Irouter1b,1c,2ae3asonogateway
3b
1d
3a
1c2aAS3
AS1AS2
1a
2c2b
1b
3c
Instradamento tra sistemi autonomi
r SupponiamocheunrouterinAS1ricevaundatagrammalacuidestinazionericadealdifuoridiAS1m Ilrouterdovrebbeinoltrare
ilpacchettoversounodeiduegateway.Maquale??
AS1deve:1. Saperequalidestinazionisono
raggiungibiliattraversoAS2equaliattraversoAS3
2. Informaretuttiirouterall’internodelsistemainmodocheciascunopossaconfigurarelapropriatabellad’inoltropergestiredestinazioniesterne
3b
1d
3a
1c2aAS3
AS1AS2
1a
2c2b
1b
3cx
Esempio: scegliere fra più AS
r SupponiamoinoltrecheAS1apprendadalprotocollod’instradamentotrasistemiautonomichelasottoretex èraggiungibiledaAS2e daAS3
r Alfinediconfigurarelapropriatabellad’inoltro,ilrouter1Ddovrebbedeterminareaqualegateway,1bo1c,indirizzareipacchettidestinatiallasottoretex
r Anchequestoèuncompitochespettaalprotocollod’instradamentointer-AS!
r Lasceltaingeneresibasasudecisionilocaliditipoeconomico,commerciale,dipolitica(policy)
Border Gateway Protocol (BGP)
• Adifferenzadeiprotocolliintra-ASesisteunsoloprotocollointer-AS:BGPappunto
• Loscopodelprotocolloèdistribuireinformazionidiraggiungibilitàditutteledestinazioni
• BGPnoncercaunpercorsoottimo,lasciacheidiversiASprendanolelorodecisioniinbasealall’elencodiASchebisognaattraversareperraggiungereunadestinazione
• BGPsidivideindueparti• eBGP:(exterior),ilprotocollodirouting veroeproprioche
distribuiscelaraggiungibilitàditutte ledestinazioni• iBGP:(interior),tramite il qualeunrouterche partecipa aeBGP
comunica atutti i nodi delsuo ASdoveinstradare i pacchetti perlevarie destinazioni
[email protected] LivelloRete- Protocollidirouting 60
Fondamenti di BGP
r BGPsiappoggiaaunamagliadiconnessioniTCP:duerouterconnessisonopeer BGP,elaconnessioneèdettasessioneBGP
r QuandoAS2annunciaunprefissoaAS1,AS2sta promettendocheinoltreràidatagrammisuunpercorsoversoilprefissocuisonodestinati.mAS2puòaggregarepiùprefissinelsuoannuncio
m E`sufficientecheunrouterperASpartecipiaeBGP
3b
1d
3a
1c2aAS3
AS1
AS21a
2c
2b
1b
3c
Sessione eBGP
Sessione iBGP
Attributi del percorso e rotte BGP
r QuandounrouterannunciaunprefissoperunasessioneBGP,includeancheuncertonumerodiattributiBGPmprefisso+attributi=“rotta”
r Duedeipiùimportantiattributisono:mAS-PATH: elencaisistemiautonomiattraversoiqualièpassatol’annunciodelprefisso:es.AS67-AS17-AS21
mNEXT-HOP: indirizzodelrouter(interfaccia0dausareperaccedereadAS-PATH
r Quandounborder routerriceveunannunciodirotta,utilizzalepropriepolitiched’importazione perdecidereseaccettareofiltrarelarotta
Selezione dei percorsi BGP
r Unrouterpuòricavarepiùdiunarottaversoundeterminatoprefisso,edevequindisceglierneuna
r Regoledieliminazione:1. Allerottevieneassegnatocomeattributounvaloredi
preferenzalocale.Siselezionanoquindilerotteconipiùaltivaloridipreferenzalocale
2. SiselezionalarottaconvaloreAS-PATHpiùbreveescludendoquellechecontengonoASconcuinoncisonoaccordicommerciali
3. SiselezionaquellailcuirouterdiNEXT-HOPèpiùvicino4. Serimaneancorapiùdiunarotta,ilrouterfaunascelta
casuale
Messaggi BGP
r ImessaggiBGPvengonoscambiatiattraversoTCP.
rMessaggiBGP:
mOPEN: aprelaconnessioneTCPeautenticailmittente
mUPDATE: annunciailnuovopercorso(ocancellaquellovecchio)
mKEEPALIVE mantienelaconnessioneattivainmancanzadiUPDATE
mNOTIFICATION: riportaglierroridelprecedentemessaggio;usatoancheperchiudereilcollegamento.
Politiche d’instradamento BGP
Figure 4.5-BGPnew: a simple BGP scenario
A
B
C
W X
Y
legend:
customer
network:
provider
network
r A,B,Csonoretidiproviderdidorsaler X,W,Ysonoretistubr Xèunaretestub apiùdomicili
m XnonvuolecheiltrafficodaBaClepassiattraversom ...ecosìXnonannunceràaBlarottaversoC
Retedelprovider
Retedelcliente
Legenda
Politiche d’instradamento BGP
Figure 4.5-BGPnew: a simple BGP scenario
A
B
C
W X
Y
legend:
customer
network:
provider
network
r AannunciaaBilpercorsoAW.r BannunciaaXilpercorsoBAW.r BdeveannunciareaCdelpercorsoBAW?
m Certocheno!Bnonhanessun“interesse”nellarottaCBAWpoichénéW néCsonoclientidiB
m BvuolecostringereCadinstradareversoW attraversoAm Bvuoleinstradaresoloda/versoisuoiclienti!
Retedelprovider
Retedelcliente
Legenda
inter-ASvsintra-AS
Politiche:r Inter-AS:ilcontrolloamministrativodesideraavereilcontrollosu
comeiltrafficovieneinstradatoesuchiinstradaattraversolesuereti.
r Intra-AS:unicocontrolloamministrativo,ediconseguenzalequestionidipoliticahannounruolomoltomenoimportantenellosceglierelerotteinternealsistema
Scala:r L’instradamentogerarchicofa“risparmiare”sulletabelle
d’instradamento,eriduceiltrafficodovutoalloroaggiornamento
Prestazioni:r Intra-AS:orientatoalleprestazionir Inter-AS:lepolitichepossonoprevaleresulleprestazioni
Topologia di Internet
• Troppocomplessaperpoterla“disegnare”– AnchesologliASsonooltre50.000,iprefissididestinazioneoltre1milione(alivelloBGP,quindiaggregati)
• Caratteristiche“smallworld”– Pochinodicontantissimeconnessioni– Tantissiminodiconpocheconnessionie“stub”– Pochi“hop”(alivelloAS)perarrivareovunque
• Proprietàdelgrafointeressantiecomplesse– esisteunaintera“scienza”dianalisidellecaratteristichedellatopologiadiInternet
[email protected] LivelloRete- Protocollidirouting 68