École polytechnique fÉdÉrale de lausanne external routing bgp · École polytechnique fÉdÉrale...

67
1 External Routing BGP Jean‐Yves Le Boudec 2015 ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE

Upload: buihuong

Post on 23-Dec-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

1

External RoutingBGP

Jean‐YvesLeBoudec2015

ÉCOLE POLYTECHNIQUEFÉDÉRALE DE LAUSANNE

2

ContentsA. WhatInter‐DomainRoutingdoes

1. Inter‐DomainRouting2. PolicyRouting

B. HowBGPworks1. Howitworks2. Aggregation3. InteractionBGP—IGP—Packet

Forwarding4. OtherAttributes5. BellsandWhistles

C. IllustrationsandStatistics

TextbookSection5.1.1,Thecontrolplane

3

A. 1. Inter‐Domain RoutingWhyinvented?TheInternetistoolargetoberunbyoneroutingprotocol

HierarchicalroutingisusedtheInternetissplitintoDomains,orAutonomousSystemswithOSPF:largedomainsaresplitintoAreas

Routingprotocolsaresaidinterior:(InternalGatewayProtocols,IGPs):insideASs:RIP,OSPF(standard),IGRP(Cisco)exterior:betweenASs:BGP(today)EGP(old)andBGP‐1toBGP‐4(today),IDRP(tomorrow,maybe)

4

What is an ARD ? An AS ?ARD= AutonomousRoutingDomain

= routingdomainunderonesingleadministrationoneormoreborderroutersallsubnetworks insideanARDshouldbeconnectedshouldlearnaboutothersubnetworkprefixes‐ theroutingtablesofinternalroutersshouldcontainentriesofalldestinationoftheInternet

AS = AutonomousSystem= ARDwithanumber(“ASnumber”)

ASnumberis32bitsdenotedwithdottedintegernotatione.g.23.34560.559meansthesameas559PrivateASnumbers:0.64512– 0.65535

ARDsthataredonotneedanumberaretypicallythosewithdefaultroutetotherestoftheworldExamples

AS1942‐ CICG‐GRENOBLE,AS2200‐ RenaterAS559‐ SWITCHTeleinformatics ServicesAS5511– OPENTRANSITEPFL:oneARD,nonumber

BGP and IGP

ARDscanbetransit(BandD),stub(A)ormultihomed (C).OnlynonstubdomainsneedanASnumber.AnIGPisusedinsideadomain,BGPisusedbetweendomains

5

ARD C

C2

C1

C4C3

EIGRP

B2

B1B4

B3

A2

A1

A4

A3

Autonomous Routing Domain A

ARD B

BGP-4

BGP-4

RIP, RIPng

ARD D

BGP-4

BGP-4D2

D3

D1

D4

D6OSPF

area 0

area 2area 1

D5

6

What does BGP do ?WhatdoesBGPdo?BGPisaroutingprotocolbetweenARDs.ItisusedtocomputepathsfromonerouterinoneARDtoanynetworkprefixanywhereintheworld

BGPcanhandlebothIPv4andIPv6addressesinasingleprocess

ThemethodofroutingisPathvectorWithpolicy

Path Vector RoutingWhatistherequirement?

Findbestroutes,inasensethatcanbedecidedbyeveryARDusingtheirowncriteria

Howdoesitwork?aroutebetweenneighboursis(path:dest)wherepathisasequenceofASnumbersanddest isanIPprefixexample:BA:n1everyASusesitsownrulesfordecidingwhichpathisbetterBGPtable keepsarecordofbestpathstoalldestinationsASannouncesonlythebestpathsitknows

7

A

B

C

En1, n2

A:n1,n2

A:n1,n2

C A:n1,n2C:n3

B A:n1,n2B:n5

D

D C A:n1,n2D C: n3D: n4

dest AS path

n1 B An2 B An3 D Cn4 D n5 B

BGP table in En5

n3

n4

Border Gateways, E‐ and I‐BGPArouterthatrunsBGPiscalledaBGPspeakerAttheboundary between2ARDsthereare2BGPspeakers,oneineachdomain

Q:comparetoOSPFInsideoneARDthereareusuallyseveralBGPspeakers

Theyalltalktoeachother,toexchangewhattheyhavelearntUsing“InternalBGP”(I‐BGP)OverTCPconnections,fullmeshcalledthe“BGPmesh”I‐BGPisthesameasE‐BGPexceptfortworules:

routeslearnedfromanodeinthemesharenotrepeatedinsidethemeshrouterdoesnotprependownASnumberoverI‐BGP

8

D1 D2

D4 D5

D3

A B

G H

C D

E F

X:n1 X:n1

E-BGP

E-BGP

I-BGP R

BGP sessions overTCP connections

Physical links

Which BGP updates may be sent ?

9

1. 2. 3. 4. 5. 6. 7. 8. 9.

0% 0% 0% 0%0%0%0%0%0%

Say what is always true

1. 12. 23. 1and24. None5. Idon’t know

111. 2. 3. 4. 5.

0% 0%0%0%0%

AS A is a stub; A2 has default route to D6;could AS A avoidusing BGP ?

1. Nobecauseinterdomainroutingrequiresaninterdomainroutingprotocol

2. Yes,ifA2injectsthedestination0/0intoRIPandRIPng

3. Yesbutusinganothermethod4. Idon’tknow

121. 2. 3. 4.

0% 0%0%0%

2. Policy Routing

Whyinvented?InterconnectionofASs(=peering)isself‐organized

pointtopointlinksbetweennetworks:ex:EPFLtoSwitch,SwitchtoTelianetinterconnectionpoints:NAP(NetworkAccessPoint),MAE(MetropolitanAreaEthernet),CIX(CommercialInterneteXchange),GIX(GlobalInterneteXchange),IXP,SFINX,LINX

Mainly3typesofrelationsCustomer‐provider:EPFLiscustomerofSwitch.EPFLpaysSwitchSharedCostpeer:EPFLandCERNarepeers:costsofinterconnectionissharedSiblings:EPFL‐Ecublens andEPFL‐IMTareinsidethesameorganization

14

15

What is the Goal of Policy Routing ?

Example:ISP3‐ISP2istransatlanticlink,costsharedbetweenISP2andISP3ISP3‐ ISP1isalocal,inexpensivelinkCi iscustomerofISPi,ISPsarepeers

ItisadvantageousforISP3tosendtrafficton2viaISP1ISP1doesnotagreetocarrytrafficfromC3toC2

ISP1offersa“transitservice”toC1anda“non‐transit”servicetoISP2andISP3

Thegoalof“policyrouting”istosupportthisandothersimilarrequirements

provider

customerShared

cost

ISP 1

ISP3

ISP2

C1

C2C3

n2

Policy Routing is implemented by means of Import and Export filters

ExamplesImportFilterforISP1:fromC1acceptC1fromISP2acceptISP2fromISP2acceptISP2C2fromISP3acceptISP3fromISP3acceptISP3C3

ExportFilterforISP1:toC1announceANYtoISP2announceISP1toISP2announceISP1C1toISP3announceISP1toISP3announceISP1C1

TheRouteSelectionProcess(seelater)alsoinfluencesthechoiceofroutes

16

ISP 1

ISP3

ISP2

C1

C2C3

n2

ISP1 does not announce C3 to ISP2ISP1 refuses to import C2 from ISP3

Typical Policies

Customertoprovider:announceallroutesofcustomer;acceptallroutes

Providertocustomer:announceallroutes;acceptallroutesofcustomer

SharedcostpeersAnnounce/acceptallinternalroutesandofcustomer

SiblingsAnnounce/acceptallroutes

17

ISP 1

ISP 3 ISP 2

C1

C2C3

n2n3

B. BGP (Border Gateway Protocol)1. How it works, Fundamental Examples

BGP‐4,RFC1771BGProuterstalktoeachotheroverTCPconnectionsBGPmessages:OPEN,NOTIFICATION(=RESET),KEEPALIVEUPDATEUPDATEmessagescontainsmodifications

AdditionsandwithdrawalsInsteadystate,aBGProutertransmitsonlymodifications

18

A BGP Router …

…receives routesfromneighboursStoresinAdj‐RIB‐in(oneperBGPpeer,internalorexternal)Accepts/rejectsthem(importpolicy)Processesattributes

StorestheresultsintheLoc‐RIB…appliesdecisionprocess

Foreverysubnetworkprefix,atmost1route isselectedThewinningroutesaremarkedintheLoc‐RIB

UpdatesRoutingTablewithwinningroutes…sendstoneighbors

Decideswhethertosendornot(exportpolicy)Aggregatemultipleroutesintoone,ifapplicableStoreresultinAdj‐RIB‐out(oneperBGPpeer)andsendtoneighborOnlyrouteslearntfromE‐BGParesenttoanI‐BGPneighborSendsupdateswhenAdj‐RIB‐outchanges(additionordeletion)

19

20

Model of a BGP Router

= Routing table

21

Routes, RIBs, Routing TableTherecordssentinBGPmessagesarecalled“Routes”. Routes+theirattributesarestoredintheAdj‐RIB‐in,Loc‐RIB,Adj‐RIB‐out.Arouteismadeof:

destination(subnetworkprefix)pathtothedestination(AS‐PATH)Attributes

Well‐knownMandatory:ORIGIN(routelearntfromIGP,BGPorstatic),AS‐PATH,NEXT‐HOPWell‐knownDiscretionary:LOCAL‐PREF(seelater),ATOMIC‐AGGREGATE(=routecannotbedis‐aggregated)OptionalTransitive:MULTI‐EXIT‐DISC(MED)(seelater),AGGREGATOR(whoaggregatedthisroute):OptionalNontransitive :WEIGHT(seelater)

Inaddition,likeanyIPhostorrouter,aBGProuteralsohasaRoutingTable =IPforwardingtable

Usedforpacketforwarding,inrealtime

The Decision ProcessThedecisionprocess decideswhichrouteisselected;Atmostonebestroutetoexactlythesameprefixischosen

Onlyonerouteto2.2/16canbechosenButtherecanbedifferentroutesto2.2.2/24and2.2/16

Aroutecanbeselectedonlyifitsnext‐hopisreachableRoutesarecomparedagainsteachotherusingasequenceofcriteria,untilonlyonerouteremains.Thedefaultsequenceis

0.Highestweight(Ciscoproprietary)1. HighestLOCAL‐PREF2. ShortestAS‐PATH3. LowestMED,iftakenseriouslybythisnetwork4. E‐BGP>I‐BGP5. ShortestpathtoNEXT‐HOP,accordingtoIGP6. LowestBGPidentifier

22

Fundamental Example

Inthissimpleexamplethereare4BGProuters.TheycommunicatedirectlyorindirectlyviaE‐BGPorI‐BGP,asshownonthefigure.Thereare2ASs,xandy.Wedonotshowthedetailsoftheinternalsofy.R3andR4sendtheBGPmessagesshown.Weshownextonlyasubsetoftherouteattributes(suchas:destination,path,NEXT‐HOP)

WefocusonR1andshowitsBGPinformation:

23

R1 R2

R3 R4

Step

 1

(importfilters)R1acceptstheupdatesandstorestheminAdj‐RIB‐In(DecisionProcess)R1designatestheseroutesasbestroutes(exportfilters)R1putsupdatesintoAdj‐RIB‐Out,whichwillcausethemtobesenttoBGPneighbours

24

From R3 10.1/16AS=yNEXT‐HOP=1.1.1.2 BestFrom R3 10.2/16AS=yNEXT‐HOP=1.1.1.2 Best

ToR2 10.1/16AS=yNEXT‐HOP=1.1.1.2ToR2 10.2/16AS=yNEXT‐HOP=1.1.1.2

10.1/16 AS =y10.2/16 AS=y

Step

 2

1. Yes2. No3. Idon’tknow

25

From R3 10.1/16AS=yNEXT‐HOP=1.1.1.2 BestFrom R2 10.1/16AS=yNEXT‐HOP=2.2.2.1From R3 10.2/16AS=yNEXT‐HOP=1.1.1.2 BestFrom R2 10.2/16AS=yNEXT‐HOP=2.2.2.1

10.1/16 AS =y NEXT-HOP =2.2.2.110.2/16 AS=y NEXT-HOP =2.2.2.1

Will the decision process promote the new routes to “best routes” ?

1. 2. 3.

0%0%0%

Fundamental Example, Continued

Therearenow3BGProutersinASx.Notethatthe3BGPinASxroutersmusthaveTCPconnectionswitheachother(sameinASy,butnotshownonfigure).AnIGP(forexampleOSPF)alsorunsonR1,R21andR22.Alllinkcostsareequalto1.TheannouncementsmadebyR3andR4aredifferent,asshownonthefigure.

We focusonR1andshowitsBGPinformation:

27

R1 R21

R3 R4

R22

Step

 1

R1accepts theupdatesandstoresit inAdj‐RIB‐InR1designates this routeasbestrouteR1puts routeinto Adj‐RIB‐Out,which will causethem tobesenttoBGPneighbours R21andR22

28

From R3 10.1/16AS=yNEXT‐HOP=1.1.1.2 Best

ToR21 10.1/16AS=yNEXT‐HOP=1.1.1.2ToR22 10.1/16AS=yNEXT‐HOP=1.1.1.2

10.1/16 AS =y

Step

 2

R1acceptstheupdatesandstoresitinAdj‐RIB‐InR1designatesthisrouteasbestrouteR1doesnotputrouteintoAdj‐RIB‐OuttoR21becauseI‐BGPisnotrepeatedoverI‐BGPR1doesnotputrouteintoAdj‐RIB‐OuttoR3thiswouldcreateanAS‐pathloop

29

From R3 10.1/16AS=yNEXT‐HOP=1.1.1.2 BestFrom R22 10.2/16AS=y NEXT‐HOP=2.2.2.1 Best

ToR21 10.1/16AS=yNEXT‐HOP=1.1.1.2ToR22 10.1/16AS=yNEXT‐HOP=1.1.1.2

10.2/16 AS =y NEXT-HOP=2.2.2.1

Step

3

1. Yes2. No3. Idon’t know

30

From R3 10.1/16AS=yNEXT‐HOP=1.1.1.2 BestFrom R22 10.2/16AS=y NEXT‐HOP=2.2.2.1 BestFrom R21 10.2/16AS=y NEXT‐HOP=3.3.3.1

10.2/16 AS =y NEXT-HOP=3.3.3.1

1. 2. 3.

33%33%33%

ISP1 and ISP2 are shared cost peers. Which path will be used by packets Customer 1 Customer 2 ?

1. R12‐R11‐R212. R12‐R22‐R213. Bothinparallel4. Idon’tknow

321. 2. 3. 4.

0% 0%0%0%

34

How are routes injected into BGP= How are routes originated ?

BGPpropagatesrouteinformation,buthowisthisbootstrapped?“Bootstrap”arouteiscalledOriginatearouteSeveralmethods

Staticconfiguration:tellthisBGProuterwhicharetheprefixestooriginated(“network”commandinquagga)Redistribute connected:tellthisBGProutertooriginateallprefixesthatareon‐linkwiththisrouter(assumesthatallroutersinnetworkrunBGP)

RedistributefromIGP:Example:redistributeRIPintoBGP=tellthisroutertooriginateallprefixesthatRIPhaslearnt

AssumesthatRIPeitherdoesnotpropagateexternalprefixes,orhasawaytodifferentiatethemSuchroutesaresenttoE‐BGPneighborsonly,withORIGIN=IGP

2. Aggregation

Domainsthatdonothaveadefaultroute(i.e.alltransitISPs)mustknowallroutesintheworld(severalhundredsofthousandsofprefixes)

inIProutingtablesunlessdefaultroutesareusedinBGPannouncements

Aggregationisawaytoreducethenumberofroutes

AggregationisexpectedtobeveryfrequentwithIPv6,lesswithIPv4

35

Can AS3 aggregate these routes into a single one ?

1. Yesandtheaggregatedprefixis2001:baba:bebe/472. Yesandtheaggregatedprefixis2001:baba:bebf/483. Yesbuttheaggregatedprefixisnoneoftheabove4. No5. Idon’tknow

36

AS1

AS2

AS3 AS4

2001:baba:bebe/48

2001:baba:bebf/48

2001:baba:bebe/48, AS-PATH = 1

2001:baba:bebf/48, AS-PATH = 2

1. 2. 3. 4. 5.

0% 0%0%0%0%

Can the decision process in AS4 designateboth routes as best ?

1. Yes2. No3. Idon’t know

38

AS1

AS2

AS3 AS4

2001:baba:bebe/48

2001:baba:bebf/48

2001:baba:bebe/48, AS-PATH = 1

2001:baba:bebf/48, AS-PATH = 2

2001:baba:bebf/48, AS-PATH = 2

2001:baba:bebe/47, AS-PATH = 3 {1 2}

1. 2. 3.

0%0%0%

Assume the decision process in AS4 designates both routes as best. Which path does a packet from AS4 to 2001:baba:bebf/48 follow ?

1. AS4‐AS3‐AS22. AS‐4‐AS23. Idon’t know

40

AS1

AS2

AS3 AS4

2001:baba:bebe/48

2001:baba:bebf/48

2001:baba:bebe/48, AS-PATH = 1

2001:baba:bebf/48, AS-PATH = 2

2001:baba:bebf/48, AS-PATH = 2

2001:baba:bebe/47, AS-PATH = 3 {1 2}

1. 2. 3.

0%0%0%

Assume the link AS2‐AS3 breaks …

AtAS4:keepalive detectslossofAS2Adj‐RIB‐InroutesaredeclaredinvalidDecisionprocessrecomputes bestrouteto2001:baba:bebf/48ThereisnoneTheroutingtableentry2001:baba:bebf/48isremovedApacketto2001:baba:bebf/48matchestheroute2001:baba:bebe/47andgoesviaAS3

42

AS1

AS2

AS3 AS4

2001:baba:bebe/48

2001:baba:bebf/48

2001:baba:bebe/48, AS-PATH = 1

2001:baba:bebf/48, AS-PATH = 2

2001:baba:bebf/48, AS-PATH = 2

2001:baba:bebe/47, AS-PATH = 3 {1 2}

3. How Forwarding Entries learnt by BGP are written into Routing Tables

Sofar,wehaveseenhowBGProuterslearnaboutalltheprefixesintheworld.Itremainstoseehowtheywritethecorrespondingentriesintheforwardingtable(i.e.routingtable).Therearetwopossiblewaysforthis:

Redistribution:routeslearntbyBGParepassedtoIGP(ex:RIP)Called“redistributionofBGPintoIGP”IGPpropagatestheroutestoallroutersindomainOptional‐ Notfoundmuchinpractice(tabletoolargeforIGP)

Injection:routeslearntbyBGParedirectlywrittenintotheforwardingtableofthisrouter

Routesdonotpropagate;thishelpsonlythisrouterWithCiscoroutersandinthelab:automaticallydone

43

44

Redistribution Example

R5advertises18.1/16 toR6viaE‐BGPR6transmitsittoR2viaI‐BGP

TCPconnectionbetweenR6andR2(redistributeBGPintoIGP)R6injects18.1/16intoIGP

IGPpropagates18.1/16(type4LSA)andupdatesforwardingtablesAfterIGPstabilizes,R1,R2nowhavearouteto18.1/6

R2advertisesroutetoR4viaE‐BGPPacketto18.1/16fromASyfindsforwardingtableentriesinR2,R1andR6

AS x

AS y

AS z

E-BGP

E-BGP

R4

R1

R2

R5 R6

18.1/16 I-BGP

IGP(OSPF)

IGP(OSPF)

2.2.2.2

45

Redistribution is Complex

AssumeweenableredistributionofBGPintoIGPinASxR6andR2canbothredistributetherouteto18.1/16Ideally,weshouldredistributeonlyexternalrouteslearntbyE‐BGPi.e.onlyR6shouldredistribute18.1/16Inpractice(inCiscorouters,inourlab)thingsareabitdifferentAllexternalroutesarere‐distributedbyallBGProutersButrouteslearntbyI‐BGPareflagged.Moreprecisely:routeshavean“AdministrativeDistance”intheforwardingtableArouteintheforwardingtableispreferredifdistanceissmallerE‐BGP=20,RIP=120,I‐BGP=200

AS x

AS y

AS z

E-BGP

E-BGP

R4

R1

R2

R5 R6

18.1/16 I-BGP

IGP(OSPF)

IGP(OSPF)

2.2.2.2

46

How Administrative Distances are used to coordinate BGP and RIP when  BGP is redistributed into RIP

AssumeR2andR6redistributeBGPintoRIPandassumeR2isfirsttodoit.at :R2redistributes18.1/16fromBGPintoRIPInR2’sforwardingtablewesee:18.1/6,AdminDist =200,cost=1,Next‐Hop2.2.2.2at :viaRIPR6learnstherouteandputsintoforwardingtable:18.1/6,AdminDist =120,cost=3,Next‐Hop2.2.2.2at :R6redistributes18.1/16fromBGPintoRIPinR6’sforwardingtablewesee:18.1/6,AdminDist =20,cost=1,Next‐Hop2.2.2.218.1/6,AdminDist =120,cost=3,Next‐Hop2.2.2.2Thefirstrouteispreferred,RIPnowpropagatesonlythefirstat :viaRIPR2learnstherouteandputsitintoforwardingtable:18.1/6,AdminDist =120,cost=3,Next‐Hop2.2.2.218.1/6,AdminDist =200,cost=1,Next‐Hop2.2.2.2

Re‐Distribution is Harmful

Inpractice,operatorsavoidre‐distributionofBGPintoIGPLargenumberofroutingentriesinIGPConvergencetimeafterfailuresislargeifIGPhasmanyroutingtableentries

Therefore,onlyinjection isusedInjectionisusuallycombinedwithrecursivetablelookup

WhenIPpacketissubmittedtorouter,theforwardingtablemayindicatea“NEXT‐HOP”whichisnoton‐linkwithrouterAsecondtablelookupneedstobedonetoresolvethenext‐hopintoanon‐linkneighbour

inpractice,secondlookupmaybedoneinadvance– notinrealtime– bypre‐processingtheroutingtable

47

48

Example of Recursive Table LookupAtR1,datapacketto10.1.x.yisreceivedTheforwardingtableatR1islookedupfirst,thenext‐hop2.2.2.63isfound;asecondlookupfor2.2.2.63isdone;thepacketissentto2.2..2.33overeth0

R1

To NEXT-HOP interface10.1/16 2.2.2.63 N/A2.2.2.63 2.2.2.33 eth0

2.2.2.33 2.2.2.63

2.2.2.93

10.1/16R2 R3

Forwarding Table at R1

49

Injection Example

R5advertises18.1/16, NEXT-HOP = 2.2.2.2 toR6viaE‐BGP

R6injects18.1/16, NEXT-HOP = 2.2.2.2intoitslocalforwardingtable(doesnotre‐distributeintoOSPF)

R2learnsroutefromR6viaI‐BGPR2injects18.1/16, NEXT-HOP = 2.2.2.2intoitslocalforwardingtable

Datapacketto18.1.2.3isreceivedbyR2RecursivetablelookupatR2canbeusedPacketissenttoR1

AS x

AS y

AS z

E-BGP

E-BGP

R4

R1

R2

R5 R6

18.1/16 I-BGP

IGP

IGP(OSPF)

2.2.2.2

Injection (no redistribution into IGP): What happens to this IP packet at R1 ?

1. ItisforwardedtoR6becauseR1doesrecursivetablelookup

2. ItisforwardedtoR6becauseR1runsanIGP

3. ItcannotbeforwardedtoR64. Idon’tknow

501. 2. 3. 4.

25% 25%25%25%

52

Injection in Practice Requires all Routers to Run BGP

StandardBGPsetupAllroutersalsorunI‐BGP(inadditiontoIGP)evenifconnectedtonoexternalrouter(likeR1)Recursivetablelookupisdoneatallrouters«Redistribute connected»

Potentialproblem:sizeofI‐BGPmesh‐>usereflectorsIGPisstillneededtodiscoverpathstonext‐hops;buthandlesonlyinternalnetworks–veryfewOthersolutions:encapsulation,MPLS

AS x

AS y

AS z

E-BGP

E-BGP

R4

R1

R2

R5 R6

18.1/16 I-BGP

IGP

IGP(OSPF)

2.2.2.2

I-BGPI-BGP

53

4. Other Route AttributesLOCAL‐PREF

UsedinsideanAStoselectabestASpathAssignedbyBGProuterwhenreceivingrouteoverE‐BGP

PropagatedwithoutchangeoverI‐BGP

ExampleR6associatespref=100,R2pref=10R1choosesthelargestpreference

bgp default local-preference pref-value

AS xE-BGP

R1 R2

R6

I-BGP

I-BGP E-BGP

E-BGP pref=10

pref=100

LOCAL‐PREF Example: Link AS2‐AS4 is expensive

AS4setsLOCAL‐PREFto100toallroutesreceivedfromAS3andto50toallroutesreceivedfromAS2

R1receivestherouteAS2AS110.1/16overE‐BGP;setsLOCAL‐PREFto50R2receivestherouteAS3AS110.1/16overE‐BGP;setsLOCAL‐PREFto100

54

AS 1

AS 3AS 2

AS 4

AS 5

R1 R2

R3

AS1: 10.1/1610.1/16AS1: 10.1/16

What does R3 announce to AS5?

1. 10.1/16AS‐PATH=AS4AS2AS12. 10.1/16AS‐PATH=AS4AS3AS13. Both4. None5. Idon’tknow

551. 2. 3. 4. 5.

20% 20%20%20%20%

Weight

ThisisarouteattributegivenbyCiscoorZebrarouterItremainslocaltothisrouterNeverpropagatedtootherrouters,eveninthesamecloudThereforethereisnoweightattributeinrouteannouncements

57

58

MULTI‐EXIT‐DISC (MED)

OneASconnectedtoanotheroverseverallinksex:multinationalcompanyconnectedtoworldwideISPASyadvertisesitsprefixeswithdifferentMEDs(low=preferred)IfASxacceptstouseMEDsputbyASy:trafficgoesonpreferredlink

AS y

AS x

R4

R2R1

10.1/16 MED=1010.2/16 MED=50

10.1/16 MED=5010.2/16 MED=10

10.1/16 10.2/16

E-BGP E-BGP

R3

1.1.1.1 2.2.2.2

R1 has 2 routes to 10.2/16, one via R3, learnt from R3 by E‐BGP (MED=50), one via R4, learnt from R2 by I‐BGP (MED=10). The decision process at R1 prefers …

1. TherouteviaR22. TherouteviaR33. Both4. Idon’t know

591. 2. 3. 4.

0% 0%0%0%

Router R3 crashes …

R1clearsroutestoASy learntfromR3(keep‐alivemechanism)R2isinformedoftheroutesuppressionbyI‐BGPR2hasnowonly1routeto10.1/16and1routeto10.2/16;trafficto10.1/16nowgoestoR2MEDallowsASy tobedualhomedanduseclosestlink–otherlinksareusedasbackup

61

packet to 10.1.2.3

LOCAL‐PREF vs MED

MEDisusedbetweenASs(i.e.overE‐BGP);LOCAL‐PREFisusedinsideoneAS(overI‐BGP)MEDisusedtotelloneproviderASwhichentrylinktoprefer;LOCAL‐PREFisusedtotelltherestoftheworldwhichASpathwewanttouse,bynotannouncingtheotherones.

62

Communities

Otherattributescanbeassociatedwithroutesinordertosimplify rules.Theyarecalled« communities »

Pre‐defined:Example:NO‐EXPORT(awellknown,pre‐definedattribute)– seelaterforanexampleDefinedbyoneAS(alabeloftheformASN:xwhereAS=ASnumber,x=a2byte—number)

63

NO—EXPORTWritten onE‐BGPbyoneAS,transmitted onI‐BGPbyaccepting AS,notforwardedExample:AS2hasdifferent routestoAS1butAS2sends only oneaggregateroutetoAS3

simplifiestheaggregationrulesatAS2

64

2.2.0/17

2.2.128/17

2.2.0/17 NO-EXPORT 2.2/16

2.2.128/17 NO-EXPORT 2.2/16

2.2/16

R1

R2

R5

R3

R4

5. Bells and WhistlesRoute Flap Dampening

RoutemodificationpropagateseverywhereSometimesroutesareflapping

successiveUPDATEandWITHDRAWcausedforexamplebyBGPspeakerthatoftencrashesandreboots

Solution:decisionprocesseliminatesflappingroutes

HowwithdrawnroutesarekeptinAdj‐RIN‐inifcomesupagainsoon(ie:flap),routereceivesapenaltyifpenalty¸ suppress‐limitrouteisnotselected

penaltyfadesoutexponentially,seenextslide65

66

Route Flap Dampening

Routesuppressedatt1,restoredat t2

reuse-limit

suppress-limit

penalty

time

t1 t2

67

Private AS Number

ClientusesBGPwithMEDtocontrolflowsoftraffic(e.g providershoulduseR1‐R3foralltrafficto10.1/16ClientcanuseaprivateASnumber ‐‐ notusableintheglobalinternet,usedonlybetweenClientandProviderProvidertranslatesthisnumbertohisownwhenexportingroutestotheoutsideworld

AS y

AS x

R4

R2R1

10.1/16 MED=1010.2/16 MED=50

10.1/16 MED=5010.2/16 MED=10

10.1/16 10.2/16

E-BGP E-BGP

R3

Client

Provider

Which way will packets from z to 2.1.1.1 go ?

1. Viax2. Viay3. Both4. Idon’t know

681. 2. 3. 4.

0% 0%0%0%

70

Avoid I‐BGP Mesh: Confederations

ASdecomposedintosub‐ASprivateASnumbersimilartoOSPFareas

I‐BGPinsidesub‐AS(fullinterconnection)E‐BGPbetweensub‐AS

AS zE-BGPE-BGP

E-BGP

AS P1 AS P2 AS P3

I-BGP I-BGP I-BGP

E-BGP

E-BGP

Avoid I‐BGP Mesh : Route reflectors

ClusterofroutersoneI‐BGPsessionbetweenoneclientandRRCLUSTER_ID

Routereflectorre‐advertisesaroutelearntviaI‐BGPtoavoidloops

ORIGINATOR_IDattributeassociatedwiththeadvertisement71

AS zE-BGPE-BGP

I-BGP

I-BGP I-BGP I-BGP

I-BGP

E-BGP

RR RR RR

I-BGP

cluster 1 cluster 2 cluster 3

72

Avoid E‐BGP mesh: Route server

AtinterconnectionpointInsteadofn(n‐1)/2peer‐to‐peerE‐BGPconnectionsn connectionstoRouteServerToavoidloopsADVERTISERattributeindicateswhichrouterintheASgeneratedtheroute

E-BGP

73

C. Illustrations:  The Switch Networkwww.switch.ch

74

An Interconnection Point

75

The World seen from EPFL

76

http://www.ris.ripe.net/bgpviz/

77

78

Some statistics

Source:http://www.cidr‐report.org

ASs

Address prefixes

Evolution of number of announced prefixes

79

IPv4

IPv6

bgp.potaroo.net