Académique Documents
Professionnel Documents
Culture Documents
Contents
A. WhatInterDomainRoutingdoes
1. Inter DomainRouting 1 InterDomain Routing 2. PolicyRouting 3. RouteAggregation
B. HowBGPworks
1. Howitworks 2. InteractionBGPIGPPacketForwarding 3. OtherBellsandWhistles
C. Examples D. IllustrationsandStatistics
A. WhatBGPDoes 1.InterDomainRouting
Whyinvented? TheInternetistoolargetoberunbyoneroutingprotocol The Internet is too large to be run by one routing protocol Hierarchicalroutingisused
theInternetissplitintoDomains,orAutonomousSystems withOSPF:largedomainsaresplitintoAreas
Routingprotocolsaresaid
interior:(InternalGatewayProtocols,IGPs):insideASs: RIP,OSPF(standard),IGRP(Cisco) e te o exterior:betweenASs: EGP(old)andBGP1toBGP4(today),IDRP(tomorrow,maybe)
WhatisanARD?AnAS?
ARD= = AutonomousRoutingDomain routingdomainunderonesingleadministration
oneormoreborderrouters allsubnetworksinsideanARDshouldbeconnected shouldlearnaboutothersubnetworkprefixes theroutingtablesofinternalrouters shouldcontainentriesofalldestinationoftheInternet
AS
= =
AutonomousSystem ARDwithanumber(ASnumber)
D6
D5 OSPF BGP-4
WhatdoesBGPdo?
WhatdoesBGPdo? BGPisaroutingprotocolbetweenARDs.Itisusedtocompute BGP is a routing protocol between ARDs It is used to compute pathsfromonerouterinoneARDtoanynetworkprefix anywhereintheworld ThereareonlytwolevelsforBGP:
Interdomain withindomain
Themethodofroutingis
Pathvector Withpolicy
6
PathVectorRouting
Whatistherequirement?
Findbestroutes,inasensethatcanbedecidedbyeveryARDusingtheirowncriteria
Howdoesitwork?
a route between neighbours is (path: dest) where path is a sequence of AS numbers and dest is aroutebetweenneighboursis(path:dest)wherepathisasequenceofASnumbersanddestis anIPprefix example:BA:n1 everyASusesitsownrulesfordecidingwhichpathisbetter BGPtable keepsarecordofbestpathstoalldestinations ASannouncesonlythebestpathsitknows
Q.ExplainhowEcanchoosethebestpathston1andn2? Q p Q.Howcanloopsbeavoided?solution
n5 A:n1,n2 B B A:n1,n2 B:n5
D C A:n1,n2 D C: n3 D: n4
7
BorderGateways,E andIBGP
ArouterthatrunsBGPiscalledaBGPspeaker Attheboundary between2ARDsthereare2BGPspeakers,oneineach domain
Q:comparetoOSPF
InsideoneARDthereareusuallyseveralBGPspeakers
Theyalltalktoeachother,toexchangewhattheyhavelearnt UsingInternalBGP(IBGP) OverTCPconnections,fullmeshcalledtheBGPmesh I BGPisthesameasE BGPexceptforonerule:routeslearnedfromanodeinthe IBGP is the same as EBGP except for one rule: routes learned from a node in the mesharenotrepeatedinsidethemesh
X:n1 D1 A X:n1
E-BGP
C D
I-BGP
E G D4 F
D3
E-BGP
D5
8
Q1:WhichofthefollowingannouncementsdoyouthinkrouterDwill sendtorouterE?
1. D>E:D2X:n1 2. D>E:D1X:n1 A:1only;2cannotbesentbecauseoverIBGPwedonotrepeataroutelearnt fromanotherBGPspeakerinthesameARD f th BGP k i th ARD
Q2:AssumethatinthefigurebelowtherouterRdoesnot runBGP.Isthis possible? A:yes. Q3:DoBGPspeakersinthesameARDneedtobeon link? Q3: Do BGP speakers in the same ARD need to be onlink ? A:no;CandFarenotdirectlyconnected(arenotonlink)
X:n1 X:n1
solution I-BGP
D1 A
E-BGP
C R E F D
D2
D3
G D4
E-BGP
D5
9
2.PolicyRouting
Whyinvented? InterconnectionofASsisselforganized
pointtopointlinksbetweennetworks:ex:EPFLtoSwitch,Switchto Telianet interconnectionpoints:NAP(NetworkAccessPoint),MAE(Metropolitan AreaEthernet),CIX(CommercialInterneteXchange),GIX(GlobalInternet eXchange),IXP,SFINX,LINX
Mainly3typesofrelations,dependingonmoneyflows
customer:EPFLiscustomerofSwitch.EPFLpaysSwitch provider:SwitchisproviderforEPFL;SwitchispaidbyEPFL peer:EPFLandCERNarepeers:costsofinterconnectionisshared thetypeofrelationisnegotiatedinbilateralagreements thereisnoarchitecturerule,justbusiness
10
10
WhatistheGoalofPolicyRouting?
Example:
ISP 3 ISP 2 ISP3 ISP2istransatlanticlink,costsharedbetween ISP3ISP2 is transatlantic link cost shared between ISP2andISP3 ISP3 ISP1isalocal,inexpensivelink CiiscustomerofISPi,ISPsarepeers
ISP 1 C3 C1 C2 n2
peers
provider customer
Thegoalofpolicyroutingistosupport thisandothersimilarrequirements
11
11
HowdoesPolicyRoutingWork?
PolicyroutingisimplementedbyrulesimposedtoBGP routersinsideanAS,whomay ISP 3
ISP 2 refusetoimportorannouncesomepaths refuse to import or announce some paths modifytheattributesthatcontrolwhichpathispreferred (seelater)
ISP 1 C3 n3 C1 C2 n2
Example
ISP1announcestoISP3allnetworksofC1 sothatC1can bereachedbyallsourcesintheworld ISP1announcestoC1allroutesithaslearntfromISP3and ISP2 sothatC1cansendtraffictoalldestinationsinthe world ISP2announcesISP2n2toISP3andISP1;assumethat ISP1annouces ISP1ISP2n2 to ISP3. ISP1 annouces ISP1 ISP2 n2toISP3. ISP3hastworouteston2:ISP2n2andISP1ISP2n2; assumethatISP3givespreferencetothelatter packetsfromn3ton2areroutedviaISP1 undesired solution:ISP1announcestoISP3onlyroutestoISP3s customers 12
12
TypicalPolicyRoutingRules
Provider(ISP1)tocustomer(C1)
ISP 3 ISP 2 announceallrouteslearntfromotherISs importonlyroutesthatbelongtodomainC1 example:importfromEPFLonlyoneroute 128.178/15
ISP 1 C3 C1 C2
Customer(C1)toProvider(ISP1)
announceallroutesthatbelongtodomainC1 importallroutes
Peers(ISP1toISP3)
announceonlyroutestoallcustomersofISP1 importonlyroutestoISP3scustomer theseroutesaredefinedaspartofpeering these routes are defined as part of peering agreement
13
3.Aggregation
Domainsthatdonothaveadefaultroute(i.e.alltransitISPs) mustknowallroutesintheworld(>170000prefixes) must know all routes in the world (> 170 000 prefixes)
inIProutingtablesunlessdefaultroutesareused inBGPannouncements
Aggregationisawaytoreducethenumberofroutes
14
14
AggregationExample1
AS1 AS2
193.212.0.0/24 193.212.0.0/23 193.212.0.0/23
AS3
193.212.1.0/24
AS4
AssumeAS3aggregatestheroutesreceivedfromAS1andAS2
AS1:193.212.0.0/24 AS2:193.212.1.0/24 AS3:193.212.0.0/23 AS4:193.212.0.0/23 AS4: 193 212 0 0/23 AS_PATH:1 AS_PATH:2 AS_PATH:3{12} AS_PATH:43{12} AS PATH: 4 3 {1 2}
15
15
AggregationExample2
AS1 AS2 n2=
197.8.2.0/24 197.8.2.0/23 197.8.2.0/23
AS3
197.8.3.0/24
AS4
n4
197.8.3.0/24 197.8.3.0/24
AS4receives
197.8.2.0/23 197.8.3.0/24 AS_PATH: 3 {1 2} AS_PATH: 2
16
ExampleWithoutAggregation
AS1 AS2
197.8.2.0/24 197.8.2.0/23 197.8.2.0/24 197.8.3.0/24 197.8.2.0/23
AS3
197.8.3.0/24
AS4
197.8.2.0/24 197.8.3.0/24
197.8.3.0/24
17
17
Morale
Aggregationshouldbeperformedwheneverpossible
whenallaggregatedprefixeshavethesamepath(example1) when all aggregated prefixes have the same path (example 1) whenallaggregatedprefixeshavethesamepathbeforetheaggregation point(example2)
AnAScandecideto
Aggregateseveralrouteswhenexportingthem Butstillmaintaindifferentroutingentriesinsideitsdomain(example2)
18
18
B.BGP(BorderGatewayProtocol) 1.Howitworks,FundamentalExamples
BGP4,RFC1771
BGProuterstalktoeachotheroverTCPconnections BGP routers talk to each other over TCP connections
Maintainadjacencytopeers(overTCPconnection):open,keepalive
Transmitonlymodifications
HowaBGProuterworks(seealsonextslide)
Receives routesfromneighbours
Accepts/rejectsthem(importpolicy) Processesattributes StoresinAdjRIBin(oneperBGPpeer,internalorexternal)
Sendstoneighbours
Decideswhethertosendornot(exportpolicy) Aggregatemultipleroutesintoone,ifapplicable A li l i if li bl StoreresultinAdjRIBout(oneperBGPpeer)andsendtoneighbour OnlyrouteslearntfromEBGParesenttoanIBGPneighbour SendsupdateswhenAdjRIBoutchanges
19
InsideBGP
One BGP Router updates in Import Policy
Decision Process:
one b t best route / destination
updates out d t t
Loc-RIB
Export p Policy
Routing Table
20
20
Routes,RIBs,RoutingTable
TherecordssentinBGPmessagesarecalledRoutes. Routes+their attributesarestoredintheAdjRIBin,LocRIB,AdjRIBout. Arouteismadeof: A route is made of:
destination(subnetworkprefix) pathtothedestination(ASPATH) Attributes
WellknownMandatory
ORIGIN(routelearntfromIGP,BGPorstatic) AS PATH ASPATH NEXTHOP
WellknownDiscretionary
LOCALPREF(seelater) ATOMICAGGREGATE(=routecannotbedisaggregated)
OptionalTransitive
MULTIEXITDISC(MED)(seelater) AGGREGATOR(whoaggregatedthisroute) AGGREGATOR (who aggregated this route)
OptionalNontransitive
WEIGHT(seelater)
21
TheDecisionProcess
Thedecisionprocess decideswhichrouteisselected; itsoutputiswrittenintoLocRIB Atmostonebestroutetoexactlythesameprefixis chosen
Onlyonerouteto2.2/16canbechosen Buttherecanbedifferentroutesto2.2.2/24and2.2/16
22
FundamentalExamples
AS x R1 10.1/16 AS=(y) 10.2/16 AS=(y) R3 10.1/16 10.2/16 10 2/16
Skriva war an daol
AS y
23
23
R1hasthefollowingRIBs,initiallyempty:
Adj-RIB-In from R3 Adj-RIB-In from R2 Loc-RIB Adj-RIB-Out to R3 Adj-RIB-Out to R2
R1appliesitsdecisionprocess,andselectsboth pp p , routes:
Adj-RIB-In from R3 10.1/16 AS=y 10.2/16 AS=y Adj-RIB-In from R2 Loc-RIB 10.1/16 AS=y 10.2/16 AS=y Adj-RIB-Out to R3 Adj-RIB-Out to R2 NEXT-HOP=1.1.1.2 NEXT-HOP=1.1.1.2 NEXT-HOP=1.1.1.2 NEXT-HOP=1.1.1.2
SinceAdjRIBOuttoR2changed,aBGPmessage issenttoR2 Similarly,atsometimeR1willreceivefromR2a BGPmessagewiththeroutes AS y BGP message with the routes 10.1/16 AS=y NEXT-HOP=2.2.2.1 and10.2/16 AS=y NEXTHOP=2.2.2.1: Adj-RIB-In from R3 10.1/16 AS=y NEXT-HOP=1.1.1.2 10.2/16 AS=y NEXT-HOP=1.1.1.2 Adj-RIB-In from R2 10.1/16 AS=y NEXT-HOP=2.2.2.1 10.2/16 AS=y NEXT-HOP=2.2.2.1 Loc-RIB 10.1/16 AS=y NEXT-HOP=1.1.1.2 10.2/16 AS=y NEXT-HOP=1.1.1.2 Adj-RIB-Out to R3 Adj-RIB-Out to R2 10.1/16 AS=y NEXT-HOP=1.1.1.2 10.2/16 AS=y NEXT-HOP=1.1.1.2
24
24
R1appliesagainitsdecisionprocess.Nowit hasseveralpossibleroutestoeachprefix. Thefirstapplicableruleinthedecision process(slideTheDecisionProcess)says thatifarouteislearntfromEBGPithas precedenceoveraroutelearntfromIBGP. SinceallroutesinAdj-RIB-In from R2 are learntfromI BGP,andallroutesinAdj learnt from IBGP, and all routes in AdjRIB-In from R3 arelearntfromEBGP,the winnersarethelatter,sothereisnochange inLoc-RIB:
Adj-RIB-In from R3 10.1/16 AS=y NEXT-HOP=1.1.1.2 10.2/16 AS=y NEXT-HOP=1.1.1.2 Adj-RIB-In from R2 10.1/16 AS=y NEXT-HOP=2.2.2.1 10.2/16 AS y NEXT HOP 2 2 2 1 10 2/16 AS=y NEXT-HOP=2.2.2.1 Loc-RIB 10.1/16 AS=y NEXT-HOP=1.1.1.2 10.2/16 AS=y NEXT-HOP=1.1.1.2 Adj-RIB-Out to R3 Adj-RIB-Out to R2 10.1/16 AS=y NEXT-HOP=1.1.1.2 10.2/16 AS=y NEXT-HOP=1.1.1.2
25
25
FundamentalExamples,continued
AS x R1 1.1.1.1 10.1/16 AS=(y) 3.3.3.2 10.2/16 AS=(y) 2.2.2.2
I-BGP E-BGP
1.1.1.2
R21
I-BGP I-BGP
R22
E-BGP
3.3.3.1 10.2/16 10 2/16
R3 10.1/16
AS y
Therearenow3BGProutersinASx.Notethatthe3BGPinASxroutersmusthave There are now 3 BGP routers in AS x Note that the 3 BGP in AS x routers must have TCPconnectionswitheachother(sameinASy,butnotshownonfigure). AnIGP(forexampleOSPF)alsorunsonR1,R21andR22.Alllinkcostsareequalto1. TheannouncementsmadebyR3andR4aredifferent,asshownonthefigure.
26
26
R1appliesitsdecisionprocess,acceptstherouteand sendsittoR22andR21
Adj-RIB-In from R3 10.1/16 AS=y NEXT-HOP=1.1.1.2 Adj-RIB-In from R22 Adj-RIB-In from R21 Loc-RIB 10.1/16 AS=y NEXT-HOP=1.1.1.2 Adj-RIB-Out to R3 Adj-RIB-Out to R22 10.1/16 AS=y NEXT-HOP=1.1.1.2 Adj-RIB-Out to R21 0 / 6 S y O 10.1/16 AS=y NEXT-HOP=1.1.1.2
thefigureanddiditsjob.R1receivesmessage10.2/16 AS=y, NEXT-HOP=3.3.3.1 fromR21overIBGP: Adj-RIB-In from R3 10.1/16 AS=y NEXT-HOP=1.1.1.2 Adj-RIB-In from R22 10.2/16 AS=y, NEXT-HOP=2.2.2.1 Adj-RIB-In from R21 10.2/16 AS=y, NEXT-HOP=3.3.3.1 Loc-RIB 10.1/16 AS=y NEXT-HOP=1.1.1.2 10.2/16 AS y NEXT HOP 2 2 2 1 10 2/16 AS=y NEXT-HOP=2.2.2.1 Adj-RIB-Out to R3 Adj-RIB-Out to R22 10.1/16 AS=y NEXT-HOP=1.1.1.2 Adj-RIB-Out to R21 10.1/16 AS=y NEXT-HOP=1.1.1.2
AssumeR21alsoreceivedtheEBGPmessagesshownon
Thedecisionprocessnowhastochoosebetweentwo routeswithsamedestinationprefix10.2/16.Bothwere learntfromIBGP,soweapplycriterion5inslideThe DecisionProcess. Thedistance,computedbytheIGP,to2.2.2.1is3andthe distanceto3.3.3.1is2.ThustheroutethathasNEXTHOP=3.3.3.1 ispreferredbythedecisionprocess: HOP=3 3 3 1 is preferred by the decision process:
Adj-RIB-In from R3 10.1/16 AS=y NEXT-HOP=1.1.1.2 Adj-RIB-In from R22 10.2/16 AS=y, NEXT-HOP=2.2.2.1 Adj-RIB-In from R21 10.2/16 AS=y, NEXT-HOP=3.3.3.1 Loc-RIB 10.1/16 AS=y NEXT-HOP=1.1.1.2 10.2/16 AS=y NEXT-HOP=3.3.3.1 Adj-RIB-Out to R3 Adj-RIB-Out to R22 10.1/16 AS=y NEXT-HOP=1.1.1.2 j Adj-RIB-Out to R21 10.1/16 AS=y NEXT-HOP=1.1.1.2
SincethenewmessageislearntfromIBGPitisnotput intoanyAdjRIBOut.
SincethenewmessageislearntfromIBGPitisnotput intoanyAdjRIBOut
27
27
Questions
WhatisthedifferencebetweenIBGPandIGP?
WhatisthedifferencebetweenIBGPandEBGP?
WhatisthedifferencebetweenaRIBandaRoutingTable?
28
28
Howareroutesinjectedinto BGP
BGPpropagatesrouteinformation,buthowisthis bootstrapped? bootstrapped ? Twomethods
Staticconfiguration:tellthisBGProuterwhicharetheprefixesownedby thisdomain ImportfromIGP:tellthisroutertocopyalltheprefixesthattheIGPhas learnt
AssumestheIGPeitherdoesnotpropagateexternalprefixes,orhasawayto differentiatethem SuchroutesaresenttoEBGPneighboursonly,withORIGIN=IGP
29
29
2.HowForwardingEntrieslearntbyBGParewritten intoRoutingTables
Sofar,wehaveseenhowBGProuterslearnaboutallthe prefixesintheworld.Itremainstoseehowtheyinformallthe prefixes in the world It remains to see how they inform all the routersintheirASabouttheseprefixes( writeforwarding entries inslide InsideBGP ).Thisisthetopicofthis section. Therearetwopossiblewaysforthis,usuallymutually exclusive: l i Redistribution:routeslearntbyBGParepassedtoIGP(ex: OSPF)
CalledredistributionofBGPintoOSPF OSPFpropagatestheroutesusingtype4LSAstoallroutersinOSPFcloud p p g g yp Notfoundmuchinpractice
Injection:routeslearntbyBGParewrittenintotheforwarding tableofthisrouter
Routesdonotpropagate;thishelpsonlythisrouter
30
30
RedistributionExample
R5 E-BGP
2.2.2.2
R6 IGP (OSPF) R1
18.1/16 AS z
R2
E-BGP R4
(redistributeBGPintoIGP)R6injects18.1/16intoIGP (OSPF)
OSPFpropagates18.1/16(type4LSA)andupdatesforwarding tables AfterOSPFconverges,R1,R2nowhavearouteto18.1/6R2 g , , / advertisesroutetoR4viaEBGP AS y
31
ExamplewithReDistribution
by___,FlearnsfromGtherouteD2D1n1 CredistributestheexternalrouteD2:n2intoOSPF by____,DlearnstherouteD2:n2;by____DlearnstherouteDYD2:n2;D b Dl th t D2 2 b Dl th t DYD2 2 D selectsD2:n2anddoesnotredistributeittoOSPF by___,BlearnstherouteD2:n2 by___,AlearnstherouteDX:D2:n2 by___,Llearnstherouteton2viaC
D1: n1 G D1 = EPFL n1 C B D1: n1 L DX D E D2 : n2 DY physical link TCP connection
32
D2 : n2
D2 = UCB n2
DY D2: n2
solution
32
ReDistributionisConsideredHarmful
Inpractice,operatorsavoidredistributionofBGPintoIGP
LargenumberofroutingentriesinIGP Large number of routing entries in IGP ConvergencetimeafterfailuresislargeifIGPhasmanyroutingtableentries
33
33
Example:RecursiveTableLookup
AtR1,datapacketto10.1.x.yisreceived TheforwardingtableatR1islookedup The forwarding table at R1 is looked up
Q:whatarethenextevents? Forwarding Table at R1
To T NEXT-HOP NEXT HOP layer-2 addr l 2 dd
10.1/16 2.2.2.63 N/A 2.2.2.63 2.2.2.33 x09:F1:6A:33:76:21
R2
2.2.2.63 10.1/16 R3
34
34
InjectionExample
R5 E-BGP
2.2.2.2
R6 IGP (OSPF) R1
18.1/16 AS z
R2
R2learnsroutefromR6viaIBGP
R2injects18.1/16, NEXT HOP R2 injects 18 1/16 NEXT-HOP = 2 2 2 2 into 2.2.2.2 into itslocalforwardingtable
AS y
Datapacketto18.1.2.3isreceivedbyR2 solution
RecursivetablelookupatR2canbeused Q:thereisaproblematR1:howcanwesolveit?
35
35
InjectioninPracticeRequiresallRouterstoRunBGP
R5 E-BGP
2.2.2.2
18.1/16 / AS z
Practicalsolutionoftendeployed
AllcoreroutersalsorunIBGP(inadditiontoIGP) RouteslearntfromBGPareinjectedintolocal forwardingtable Recursivetablelookupisdoneatallrouters Q:repeatthesequenceofpreviousslidewiththisnew assumption
R4
AS y
Potentialproblem:I BGPmesh >usereflectors Potential problem: IBGP mesh > use reflectors IGPhandlesonlyinternalnetworks veryfew solution
36
36
Questions
Whatisthedifferencebetweeninjectionandredistribution?
CanBGProutesbelearntbyanonBGProuter?
Whatisrecursivetablelookup?Whereisitneeded?
37
37
3.OtherBellsandWhistles MULTIEXITDISC(MED)
packet to 10.1.2.3 packet to 10.2.3.4 10 2 3 4
AS x R1 10.1/16 MED=10 10.2/16 10 2/16 MED=50 R3 10.1/16 AS y 10.2/16 R2
1.1.1.1 E-BGP
2.2.2.2 E-BGP
OneASconnectedtoanotheroverseverallinks
ex:multinationalcompanyconnectedtoworldwideISP ASyadvertisesitsprefixeswithdifferentMEDs(low=preferred) IfASxacceptstouseMEDsputbyASy:trafficgoesonpreferredlink
38
38
MEDExample
Q1:bywhichmechanismswillR1andR2makesurethat packetstoASyusethepreferredlinks? packets to ASy use the preferred links ? Q2:routerR3crashes;can10.1/16stillbereached?explainthe sequenceofactions.
solution
39
39
MEDQuestion
Q1:AssumenowASxandASyarepeers(ex:bothareISPs). ExplainwhyASxisnotinterestedintakingMEDintoaccount. Explain why ASx is not interested in taking MED into account Q2:BywhichmechanismscanASxpickthenearestroutetoASy ? solution
40
40
LOCALPREF
f 100 pref=100 R6 E-BGP I-BGP E-BGP R1
AS x
I-BGP
E-BGP R2 pref=10
Example
R6associatespref=100,R2pref=10 R1choosesthelargestpreference bgp default local-preference pref-value
41
41
LOCALPREFExample
Q1:ThelinkAS2AS4isexpensive.HowshouldAS4setlocalprefsonroutes receivedfromAS3andAS2inordertoroutetrafficpreferablythroughAS3? Q2:ExplainthesequenceofeventsforR1,R2andR3. Q2 E l i th f t f R1 R2 d R3
AS1: 10.1/16 10.1/16
AS 1
AS1: 10.1/16
AS 2
R1
AS 4
R2 R3
AS 3
AS 5
solution
42
42
LOCALPREFQuestion
Q:CompareMEDtoLOCALPREF solution
43
43
Weight
ThisisarouteattributegivenbyCiscoorZebrarouter
Itremainslocaltothisrouter It remains local to this router Neverpropagatedtootherrouters,eveninthesamecloud Thereforethereisnoweightattributeinrouteannouncements
44
44
RouteFlapDampening
Routemodificationpropagateseverywhere Sometimesroutesareflapping Sometimes routes are flapping
successiveUPDATEandWITHDRAW causedforexamplebyBGPspeakerthatoftencrashesandreboots
Solution:
decisionprocesseliminatesflappingroutes
How
withdrawnroutesarekeptinAdjRINin ifcomesupagainsoon(ie:flap),routereceivesapenalty ifpenalty suppresslimitrouteisnotselected penaltyfadesoutexponentially,seenextslide
45
45
RouteFlapDampening
penalty
suppress-limit
reuse-limit
time t1 t2
Routesuppressedatt1,restoredat t2
46
46
AvoidIBGPMesh:Confederations
AS P1 E-BGP I-BGP I-BGP AS P2 E-BGP I-BGP AS P3
ASdecomposedintosubAS
privateASnumber similartoOSPFareas
IBGPinsidesubAS(fullinterconnection) EBGPbetweensubAS
47
47
AvoidIBGPMesh:Routereflectors
I-BGP RR I-BGP I-BGP cluster 1 E-BGP cluster 2 AS z E-BGP E-BGP I-BGP cluster 3 RR I-BGP I-BGP RR
Clusterofrouters
oneIBGPsessionbetweenoneclientandRR CLUSTER_ID
Routereflector R fl
readvertisesaroutelearntviaIBGP toavoidloops
ORIGINATOR_IDattributeassociatedwiththeadvertisement
48
48
IBGPconfiguration
lo0
I-BGP
lo0
I-BGP
AS z
IBGPconfiguredonloopbackinterface(lo0)
interfacealwaysup i f l IPaddressassociatedwiththeinterface IGProutingguaranteespacketforwardingtotheinterface
49
49
AvoidEBGPmesh:Routeserver
E-BGP
50
Communities
Otherattributescanbeassociatedwithroutesinorderto simplify rules They are called communities rules.Theyarecalled
Predefined:Example:NOEXPORT(awellknown,predefinedattribute) seelaterforanexample DefinedbyoneAS(alabeloftheformASN:xwhereAS=ASnumber,x=a2 bytenumber)
51
51
NOEXPORT
WrittenonEBGPbyoneAS,transmittedonIBGPbyacceptingAS,not forwarded Example:AS2hasdifferentroutestoAS1butAS2sendsonlyoneaggregate routetoAS3
simplifiestheaggregationrulesatAS2 Whatistheroutefollowedbyapacketsentto2.2.48receivedbyR4?
R1
2.2.0/17
R3 R4
2.2/16
2.2.128/17 /
R5
R2 solution
52
52
C.Examples
Anetworkoperatorimplementstheirpolicybyselectingthe A network operator implements their policy by selecting the rulesfor
Importpolicy(acceptrouteornot,ifrequiredmodify/add/deleteattributes) Exportpolicy(exportornotaroute,decidewhichattributevalue)
53
53
Ex1:StubArea
Operator AS p
R2 R1
Client AS
54
54
Ex2:StubArea,DualHomingtoSingleProvider
AS x R1 10.1/16 10 1/16 MED=10 10.2/16 MED=50 R3 10.1/16
Client
10.2/16
AS y
WithnumberedClientAS
UseMEDtosharetrafficfromISPtoClientontwolinks UseClientIGPconfigurationtosharetrafficfromClienttotwolinks Q1:isitpossibletoavoiddistributingBGProutesintoClientIGP? Q2:isitpossibletoavoidassigninganASnumbertoClient? Q3:isitpossibletoavoidBGPbetweenClientandProvider? solution
55
55
Ex3:StubArea,DualHomingtoSeveralProviders
AS z AS x R1 AS y
R2
R3 2.0/17 /
R4
Client Cli t
AS 100
2 1/17 2.1/17
56
Ex4:HotPotatoRouting
Customer 1
R11
ISP1
R12
Customer 2
R21
ISP2
R22
PacketsfromCustomer2toCustomer1
BothR21andR22havearoutetoCustomer1 ShortestpathroutingfavoursR21 Q1:bywhichmechanismisthatdone?
Q2:whatisthepathfollowedinthereversedirection? solution
57
57
D.Illustrations:TheSwitchNetwork www.switch.ch
58
58
AnInterconnectionPoint
59
59
60
60
129.250.0.2 32
Not defined
2914:420 2914:2000 2914:3000 2603:666 3356:2 3356:86 3356:507 3356:666 3356:2076 12381:1653
RIPE NCC
128.178.0.0/ 15
2003-10-02 06:16:00Z
193.10.252. 5
193.10.252. 5
IGP
Netnod
2003-10-02 06:16:17Z 2003-10-02 06:16:37Z 2003-10-02 06:21:08Z 2003-10-02 06:21:17Z 2003-10-02 07:24:06Z
194.68.48.1
194.68.48.1
IGP
12381 1653 2603 20965 559 12381 1653 2603 3356 1299 559 2603 20965 559 12381 1653 2603 20965 559 2914 3549 559
Netnod
194.68.48.1
194.68.48.1
IGP
Netnod
193.10.252. 5
193.10.252. 5
IGP
Netnod
194.68.48.1 129.250.0.2 32
194.68.48.1 129.250.0.2 32
IGP
Netnod
Not defined
2914:420
61
61
TheWorldseenfromEPFL
http://www.ris.ripe.net/bgpviz/
62
62
Somestatistics
Source:http://www.cidrreport.org
Address prefixes
ASs
63
63
Numberofhosts
64
64
65
65
Exercise
WhatASsdoesEPFLreceiveservicefrom? WhatASsdoesSwitchreceiveservicefrom? FindthenamesofthenetworksthathavetheseASnumbers
66
66
Exercise
Lookuphttp://rpsl.info.ucl.ac.be.tofindouttherelationships betweenSwitchandotherproviders between Switch and other providers Howdoesthesoftwareonthissitedecidewhethera relationshipisclient,providerorpeer?
67
67
FurtherReading
Slowconvergenceafterroutesuppression BGPpath exploration similar to (but worse than) distance vector slow exploration,similarto(butworsethan)distancevectorslow convergence.Isinthenatureofpathvectorroutingwith explicitsuppression.
CraigLabovitz,AbhaAhuja,AbhijitBose,FarnamJahanian:DelayedInternet routingconvergence.IEEE/ACMTrans.Netw.9(3):293306(2001)
Routeflapdampeningslowsdownconvergence R t fl d i l d
ZhuoqingMorleyMao,RameshGovindan,GeorgeVarghese,RandyH.Katz: Routeflapdampingexacerbatesinternetroutingconvergence.SIGCOMM 2002:221233
Pathvector+policymaysufferfromincompatibilities(loops)
Thestablepathsproblemandinterdomainrouting Griffin,T.G.;Shepherd,F.B.;Wilfong,G. ACM/IEEEToNApril2002,Page(s):232243
68
68
References
TimothyGriffinshomepageatIntel RFC1771(BGP4) RFC 1771 (BGP 4) C.Huitema,LeRoutagedanslInternet JohnW.StewartIIIBGP4 www.ris.ripe.net :ASpaths www.cidrreport.org aggregationstatistics id t ti t ti ti www.caida.org mapofInternet rpsl.info.ucl.ac.be relationsbetweenASs
69
69
Solutions
70
70
PathVectorRouting
Q.ExplainhowEcanchoosethebestpathston1andn2
A.EreceivestheroutesBAn1andDCAn1.Eselectsasbestroutesthe oneswithshorterASpath.
Q.Howcanloopsbeavoided?
A:BGProutersrecognizeloopingannouncementsbytherepetitionofthe sameASinthepath.Suchannouncementsarediscarded back
BGP table in E n5 A:n1,n2 B B A:n1,n2 B:n5 dest n1 n2 n3 n4 n5 AS path B A B A D C D B
D C A:n1,n2 D C: n3 D: n4
71
71
Q1:WhichofthefollowingannouncementsdoyouthinkrouterDwill sendtorouterE?
1. D>E:D2X:n1 2. D>E:D1X:n1 A:1only;2cannotbesentbecauseoverIBGPwedonotrepeataroutelearnt fromanotherBGPspeakerinthesameARD f th BGP k i th ARD
Q2:AssumethatinthefigurebelowtherouterRdoesnot runBGP.Isthis possible? A:yes. Q3:DoBGPspeakersinthesameARDneedtobeon link? Q3: Do BGP speakers in the same ARD need to be onlink ? A:no;CandFarenotdirectlyconnected(arenotonlink)
X:n1 X:n1
back I-BGP
D1 A
E-BGP
C R E F D
D2
D3
G D4
E-BGP
D5
72
72
AggregationExample2
AS1 AS2 n2
197.8.3.0/24 197.8.2.0/24 197.8.2.0/23 197.8.2.0/23
AS3
197.8.3.0/24
AS4
n4
Q:whathappenstopacketsfromn4ton2? A:TherearetworoutingentriesinAS4routers:onefor 197.8.2.0/23 andonefor197.8.3.0/24. Longestprefix matchinthepacketforwardingalgorithmensuresthatpacketston2go onthedirectroute(senttoAS2). ( ) IfAS4injectsonlytheaggregaterouteintoitslocalroutingtables,what istheanswernow? Thereisnowonlyoneentry(197.8.2.0/23 )andallpacketston2 aresenttoAS3 back
73
73
AggregationExample3
AS1 AS2 n2
197.8.3.0/24 197.8.2.0/24 197.8.2.0/23 197.8.2.0/23
AS3
197.8.3.0/24
AS4
n4
197.8.3.0/24
AS5
197.8.3.0/24
AS6
AS4receives
197.8.2.0/23 197.8.3.0/24 AS_PATH: 3 {1 2} AS_PATH: 6 5 2
Both routes are received by AS4; Q.what happens for packets from n4 to n2? BothroutesarereceivedbyAS4;Q.whathappensforpacketsfromn4ton2? A.theygothelongway AssumenowthatonlyshortestASpathsroutesareinjectedintoroutingtables Q:whathappenstopacketsfromn4ton2? A:theygoviaAS3 back
74
74
ExampleWithoutAggregation
AS1 AS2
197.8.2.0/24 197.8.0.0/23 197.8.2.0/24 197.8.3.0/24 197.8.0.0/23
AS3
197.8.3.0/24
AS4
197.8.2.0/24 197.8.3.0/24
197.8.3.0/24
Q:IfAS3doesnotaggregate,whataretheroutesannouncedbyAS4? Isthereanybenefit? A:
197.8.0.0/23 197.8.2.0/24 197 8 2 0/24 197.8.3.0/24 AS_PATH: 4 3 AS_PATH: AS PATH: 4 3 1 AS_PATH: 4 2
75
NEXTHOP
E-BGP R5 R6 I-BGP R1 AS z E-BGP E BGP R3 R4 I-BGP R2 AS x
10.1/16
AS y
10.2/16
76
76
MEDExample
Q1:bywhichmechanismswillR1andR2makesurethat packetstoASyusethepreferredlinks? packets to ASy use the preferred links ? A:
R1andR2exchangetheirroutestoAXyviaIBGP R1has2routesto10.1/16,onelearntbyEBGP(MED=10),onelearntbyI BGP(MED=5=);preferstheformer R1has2routesto10.2/16,prefersthelatter(routeviaR2) R1 has 2 routes to 10 2/16 prefers the latter (route via R2)
Q2:routerR3crashes;can10.1/16stillbereached?explainthe sequenceofactions. A:
R1clearsroutestoASylearntfromR3(keepalivemechanism) R2isinformedoftheroutesuppressionbyIBGP R2hasnowonly1routeto10.1/16and1routeto10.2/16; trafficto10.1/16nowgoestoR2back
77
77
MEDQuestion
Q1:AssumenowASxandASyarepeers(ex:bothareISPs).ExplainwhyASx isnotinterestedintakingMEDintoaccount. A:ASxisinterestedinsendingtraffictoASytothenearestexit,avoiding transitinsideASxasmuchaspossible.ThusASxwillchoosethenearest routetoASy,andwillignoreMEDs Q2:BywhichmechanismscanASxpickthenearestroutetoASy? A:itdependsontheIGP.WithOSPF:allroutestoASyareinjectedintoOSPF bymeanstype5LSAs.TheseLSAssay:sendtorouterR3orR4.EveryOSPF routerinsideASxknowsthecost(determinedbyOSPFweights)ofthepath fromselftoR3andR4.Packetsto10.1/16and10.2/16areroutedtothe nearestamongR3andR4(nearest=lowestOSPFcost). back
78
78
LOCALPREFExample
Q1:ThelinkAS2AS4isexpensive.HowshouldAS4setlocalprefsonroutes receivedfromAS3andAS2inordertoroutetrafficpreferablythroughAS3? A:forexample:setLOCAL PREFto100toallroutesreceivedfromAS3andto50to A: for example: set LOCALPREF to 100 to all routes received from AS 3 and to 50 to allroutesreceivedfromAS2
AS1: 10.1/16 AS 2
10.1/16 AS 1
AS1: 10.1/16
Q2: Explain the sequence of events for R1, R2 and R3
R1
AS 4
R2 R3
AS 3
A:
R1 receives the route AS2 AS1 10.1/16 over E-BGP; sets LOCAL-PREF to 50 R2 receives the route AS3 AS1 10.1/16 over E-BGP; sets LOCAL-PREF to 100 R3 receives AS2 AS1 10.1/16, LOCALPREF=50 from R1 over I-BGP and AS3 AS1 10.1/16, LOCAL-PREF=100 from R1 over I-BGP R3 selects AS3 AS1 10.1/16, LOCAL l t 10 1/16 LOCALPREF=100 and installs it into local-RIB R3 announces only AS3 AS1 10.1/16 to AS 5
79
79
LOCALPREFQuestion
Q:CompareMEDtoLOCALPREF A: A:
MEDisusedbetweenASs(i.e.overEBGP);LOCALPREFisusedinsideone AS(overIBGP) MEDisusedtotelloneproviderASwhichentrylink toprefer;LOCALPREFis usedtotelltherestoftheworldwhichASpath wewanttouse,bynot g announcingtheotherones.
back
80
80
ExamplewithReDistribution
byIBGP,FlearnsfromGtheroutetoD2D1n1 CredistributestheexternalrouteD2:n2intoOSPF; byIBGP,DlearnstherouteD2:n2;byEBGPDlearnstherouteDYD2:n2;D b I BGP D l th t D2 2 b E BGP D l th t DYD2 2 D selectsD2:n2anddoesnotredistributeittoOSPF I-BGP - internal BGP byIBGP,BlearnstherouteD2:n2fromC E-BGP - external BGP byEBGP,AlearnstherouteDX:D2:n2 byOSPF,Llearnstherouteton2viaC
D1: n1 G D1 = EPFL n1 C B D1: n1 L DX D E D2 : n2 DY physical link TCP connection
81
D2 : n2
D2 = UCB n2
DY D2: n2
back
81
Example:RecursiveTableLookup
AtR1,datapacketto10.1.x.yisreceived TheforwardingtableatR1islookedup The forwarding table at R1 is looked up
Q:whatarethenextevents? A:first,thenexhop2.2.2.63isfound;asecondlookupfor2.2.2.63isdone; thepacketissenttoMACaddressx09:F1:6A:33:76:21
To T NEXT-HOP NEXT HOP layer-2 addr l 2 dd
2.2.2.63 R3 10.1/16
82
82
AvoidRedistribution:CombineRecursiveLookup andNEXTHOP
R5 E-BGP
2.2.2.2
R6 IGP (OSPF) R1
18.1/16 AS z
R2
Datapacketto18.1.2.3isreceivedbyR2
Q:thereisaproblematR1:howcanwesolveit? Q: there is a problem at R1: how can we solve it ? A:theproblemis:PacketissentbyR2towardsR1, whichistheneighbourtowards2.2.2.2.AtR1,thereis noforwardingentryto18.1/16 blackhole! Asolutionwouldbetouseloosesourcerouting:R2 adds2.2.2.2asloosesourceroutinginfointopacket. Anothersolutionislabelswitching(seeMPLSmodule) alsocalledtagswitching.R2establishesalabelswitched g g pathto2.2.2.2andforwardsthepacketonthispath. Inpracticehowever,anothersolution,asshownnext. back
AS y
83
83
AvoidRedistribution:PracticalSolution
R5 E-BGP
2.2.2.2
R6 IGP (OSPF)
AS x I-BGP
2.2.20.1
R2 IGP E-BGP
18.1/16 / AS z
R1
Q:repeatthesequenceofpreviousslidewiththisnewassumption R5advertises18.1/16, NEXT-HOP = 2.2.2.2 toR6viaEBGP R6transmits18.1/16, NEXT-HOP = 2.2.2.2 to R1andR2via IBGP I BGP
R6injects18.1/16, NEXT-HOP = 2.2.2.2 intoitslocalforwarding table R2injects18.1/16, NEXT-HOP = 2.2.2.2 intoitslocalforwarding table
R4
AS y
back
84
84
NOEXPORT
Q:Whatistheroutefollowedbyapacketsentto2.2.48receivedbyR4? A:thepacketissentviaR3andR1 p
R1
2.2.0/17
R3 R4
2.2/16
2.2.128/17 /
R5
R2
back
85
85
Sol.Ex2:StubArea,DualHomingtoSingleProvider
AS x R1 10.1/16 10 1/16 MED=10 10.2/16 MED=50 R3 10.1/16
Client
10.2/16
AS y
Q1:isitpossibletoavoiddistributingBGProutesintoClientIGP? A:yes,forexample:configureR3andR4asdefaultroutersinClientAS;trafficfrom ClientASisforwardedtonearestofR3andR4.IfR3orR4fails,totheremainingone Q2:isitpossibletoavoidassigninganASnumbertoClient? A:Yes,itissufficienttoassigntoClientaprivateASnumber:Providertranslatesthis , g p numbertoitsown. Q3:isitpossibletoavoidBGPbetweenClientandProvider? A:Yes,byrunningaprotocollikeRIPbetweenClientandProviderandredistributing ClientroutesintoProviderIGP.ThusProviderpretendstotherestoftheworldthat theprefixesofClientareitsown.back
86
86
Sol.Ex3:StubArea,DualHomingtoSeveralProviders
AS z AS x R1 AS y
R2
R3 2.0/17 /
R4
Client Cli t
AS 100
2 1/17 2.1/17
ClienthasownaddressspaceandASnumber Q:howcanroutesbeannouncedbetweenAS100andASx?ASxandASz? A:R3announces2.0/17and2.0/16;trafficfromASxto2.0/17willflowviaASx;if A: R3 announces 2.0/17 and 2.0/16; traffic from AS x to 2.0/17 will flow via AS x; if R3fails,itwillusethelongerprefixandflowviaAsy. ASxannounces2.0/17and2.0/16toASz Q:assumeClientwantsmosttraffictopreferASy.Howcanthatbedone? A:R3announcesanartificiallyinflatedpath:100100100100:2.0/17.ASzwill favourthepathviaASywhichhasashorterASpathlengthback
87
87
Sol.Ex4:HotPotatoRouting
Customer 1
R11
ISP1
R12
Customer 2
R21
ISP2
R22
PacketsfromCustomer2toCustomer1
BothR21andR22havearoutetoCustomer1 ShortestpathroutingfavoursR21 Q1:bywhichmechanismisthatdone? A: Choiceofthebestroute ( it i 5) A Ch i f th b t t (criteria5),assumingalllroutersinISP2runBGP i lll t i ISP2 BGP
Q2:whatisthepathfollowedinthereversedirection?
A:seepicture.Notetheasymmetricrouting
back
88
88
Exercise
WhatASsdoesEPFLreceiveservicefrom?
fromthepreviousroutes,wefindAS559(Switch) from the previous routes we find AS 559 (Switch)
WhatASsdoesSwitchreceiveservicefrom?
fromthepreviousroutesweseethatthereareatleast:
AS1299 AS20965 AS3549 AS 3549
FindthenamesofthenetworksthathavetheseASnumbers
fromwhoisonwww.ripe.net:
AS1299:Telianet AS20965:Geant AS3549:GlobalCrossing
89
89
Exercise
Lookuphttp://rpsl.info.ucl.ac.be.tofindouttherelationships betweenSwitchandotherproviders between Switch and other providers Howdoesthesoftwareonthissitedecidewhethera relationshipisclient,providerorpeer?
ASXisclientofSwitchifASXacceptsANYpathandannouncesonlyself(AS X) ASXisproviderofSwitchifASXannouncesANYpathandacceptsonlyAS Switch ASXisapeerifASXacceptsandannouncesonlyasmallsetofroutes
90
90
91
91