29
BGP, The Good, The Bad, and The Ugly Missing Ideas to improve BGP Thomas Mangin NetMCR – Oct 2017

BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

Embed Size (px)

Citation preview

Page 1: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

BGP,TheGood,TheBad,andTheUgly Missing

IdeastoimproveBGP

ThomasManginNetMCR – Oct2017

Page 2: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

TL;DR

1. ShowhowBGPwas compactonthewireandmemoryfriendly2. Pointsomeminorweirdness/quirkiness

ExplainhowsuccessiveRFCruinedBGPand/ordidnotimprovethings3. Trytolookforwardatwaysonhowthiscouldbefixed4. ExplainwhythisisveryunlikelytohappenattheIETF

Ultimately,arguethatBGPneed”fixing”(oranewprotocolisneeded)bytheindustryinthehopesomeonewithmoney,timeandskillsislisteningsomewhereanddecidetohelp.

Page 3: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

TheProtocol IknowBGPFu

Bytheendoftheday…YouwillbeabletoreadBGP…without usingWireShark (orperhapsnot)

Page 4: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

• TCPport179• Easytocode• worksthroughNAT!!Good• TCPsessionfailuredetectionisvery,very,LONG… RST?• hencea“convoluted”protocolheartbeatmechanismBad

• Tricks• Therearequiteafew“undocumented”behaviourslikeAlcatelusingaTCPwindowsizeofzerototellspeakersthatnoCPUtimeisavailableandthatpeersshouldnotsendUPDATEsanymore.

Bad

“Layer2”Connection

Page 5: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

• SimplebinaryTLV..• Binary,compact&OOfriendly• OldschoolGood

• ManyTLV,orLVT,orLV,or..• Everydraftre-inventedaTLVvariant• NochanceinhelltogetthatfixedBad

Framing

• Maximummessage• 4kshouldbeenoughforeveryone..• DesignforRAMcontraintedsystems• 4kisaUNIXpagesize(easyallocation)• Hardcodedinthedraft,notpacketGood then Badnow

Onedraftlingeringforyeartryingtotheraisethelimitto65k..(finallyseriouslyconsidered).Missing,butthereishope...

MandatorySci-Fireference(ADalekfromStarTrek)

Page 6: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

ThisisaBGPHeader.

IntroducedwithBGPv3(likev6comesafterv4)inOctober1991

ToeraseBGP“v1”headers,notchanged/fixedsinceBad

Framing

Page 7: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

Lengthfirst,

ItallowstoputthepacketcontentinmemorywithonereadGood

Nosimplewaytoupgradeitto32bitsbychangingtheMESSAGETypeBad

Framing

Page 8: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

MessageTypeCode1. OPEN2. UPDATE3. NOTIFICATION4. KEEPALIVE

• MessageTypeOrder1. OPEN2. KEEPALIVE(s)3. UPDATE4. NOTIFICATION

Cannotseeanylogicinthenumbering…ItdoesnotmatterunlessyouhaveveryacuteOCD

ThisslideisheretotinkleyourOCD..

Page 9: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

BGPIdentifieraka“RouterID”NotanIPv4:anASNuniqueID(“linked”totheOSPFRouterID)

NotIPv6onlynetworkfriendlyHardtoforesee20yearsagoButapainforv6onlynetworks

Huaweitriedtochangethisandfailed.

OPEN

Page 10: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

MinimumHoldTime is3(or0fordisabling)

“KEEPALIVE”HeartbeatmessageseveryHoldTime/3(shouldbethetimervaluehere)

Besttimeforfailuredetectionis3seconds.… abit slownowdaysBad

OPEN

Page 11: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

Open–>Negotiation–>

• ASNarenot16bitsanymore• Caused“transitivesessionsdrop”Bad• Allfixedso“ok”..Good

• Explicitversioninheader• Everyimplementationchecksit• Wonderwhy,wehavethemarkerGood

• “Capabilities”negotiation• ItiswhatallowedBGPtoevolve• AndhavepartialfeatureimplementationGood• SizeconstraintslowlyshowingBad

• Anythingrecentis“negotiated”• 32bitsASN• Family(IPv6,VPN,FlowSpec,EVPN,…)• Add-Path

Page 12: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

UPDATE

• NLRIencoding• IPv4isVERY spaceefficientGood

• Multiprotocolafterthought(ie:IPv6)• AIPv6NLRIisanattribute!What!• ONEannouncement&withdrawBad• ThepackingisnowVERY wasteful!

Page 13: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

ThisisaBGPUPDATE

WecouldspeakatlengthaboutUPDATE“attributes”,buttheyare“ok”

Let’sskiptheirweirdencoding(7or15bits)AStransitivity stillscare somepeople.

Theyarehardtoexplaininquicktalk.ButfundamentaltoBGPdesign

Page 14: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

UPDATE

Nice,Simple,Compact!Justsimplifieda“bit”hereforclarity!(noPathAttribute)

Lovely packing, now feeling nostalgic about other “good old” binary format such as IFF, later PNG

Page 15: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

UPDATE

• Attributesareakitchensink• EveryBGPnewfeatureisanattributeVeryverybad• Easiercodetochangebyvendors

• UPDATEgenerationcodeisCOMPLEX• Havetobreakevery4kBad

• ManyissuesfixedinrecentRFC• ordering,reliability,…Good

Mandatory“cute”kitten

Page 16: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP
Page 17: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

WhereistheLATENCY usedwithBGP…

Missing

Page 18: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

AttributeMESSAGE,ideas!

• SeparationofAttributesandNRLIparsing• DissociateAttributesandUpdates• Sameattributesareparsedandparsedagain• MostoftheBGPparsingisattributesTerriblyBad forIPv6– JustveryBad forIPv4

• NewMESSAGEforattributesinformation?• CPU+bandwidthvsMemory/Caching• Memorynottheweakestlinktoachievegoodconvergence• RemovethedefinitionfromtheUPDATE,CreateanewMESSAGE• Reference“Attributes”MESSAGEinUPDATE(saveLOTofparsing)

Page 19: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

AttributeMESSAGE,ideas!

• Alsoallowattributecomposition?• ThisishowrouterconfigurationsarebuildonmodernCLI• Manycommunitiesareused:

Tosethigh/lowlocal-prefToremoveRFC1918,Todroptraffic,Toslicebread,…

• Around95%ofroutesintheDMZhaveuniqueAS_PATH• HavingtheAS_PATHpartofthegroupingissub-optimal• ItmaymakesensetomoveAS_PATHwithNLRI• Norealpersonalresearchonattributegrouping

Page 20: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

UPDATEMESSAGE,ideas

• A“route”isreallyaNLRI&anext-hop• Attributesareforrouteselection• Groupingnext-hopwithotherattributedataissub-efficientBad

• Itdoesmakesensetogroupbynext-hop• Butnext-hopnotreallyan“attribute”Splitnext-hopfromtheotherattributesandgroupNLRIpernext-hops

• Noneoftheideaspresentedchangetherouteselectionprocess

Page 21: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

UPDATE(2)MESSAGE,moreideas

• WhynotcreateanewMESSAGEtypeforMultiprotocol• Keepingthesameformatforattributes(improvedornot)

• JustdifferentNLRIencoding(notconsideringAS_PATH)• AFI/SAFI• MPwithdraw• Attributes(currentformatwithproposedidea)• Next-hop+setofMPannounce,• Next-hop+setofMPannounce,…

(Orhaveanattributeand/orcapabilitytosignalachangeofNLRIparsing)

Disclaimer:Thechanceofseeingtheseideashappenis(near)zeroButpleasefeelfreetoshowmewrong!

Page 22: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

Finally,anagreementwasreachedonastandardchange

Thisis/wasanopinionatedtalk… Iamrightandeveryoneelseiswrong

Page 23: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

BGP,meansIETF

• Vendorsareveryinfluent• Theypaypeoplewhocodethething• Theylistento$$$clients• BGPismadeby10sand10sofRFCs• Usefuldraftsinlimboforyears• Lotsofpolitics(likeeverywhere)• by“specwriters”not“programmers”

canleadtosomeweirdstuff

• Veryfewoperators• Mostlyonlylargenetworks• Notenoughoperatorfeedback• NotenoughoperationalfeedbackBad

NooneinterestedinfixingBGP,LikeHTTP/Bis fixedHTTP

Page 24: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

https://waitbutwhy.com/2016/03/doing-a-ted-talk-the-full-story.html

Youarehere..YESYOUARE.

AndIamlookingforwardtoseatdown..ButImay havespokentoofast

25slidesfor15minutesshouldbearoundgood

Emergencyextraslides?Wantmore?Questions?

Extraslides??

Page 25: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

BGP/StateMachine

Page 26: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

StateMachine

• ShouldmakesthingsclearinRFC4271..Should..• Veryhardto“get”(puttingcodeideasinwordsishard)• Mostdiagramsofitarewrong,inawayoranother• NootherRFCdoesreallyupdatethestatemachine(whentheysometimesshould)

• Mostimplementationsdonotimplementitfully/correctly• Tryto“suggest”animplementation(s)oftheBGPreactor(try/exceptcanachievethesamewithoutit)

Good /Bad … Pickone!

Page 27: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

BGPOther

• KEEPALIVE• 3needtogomissingtoconsiderthepeerdead

• NOTIFICATION• Notificationofissues/sessiongoingaway• Jobworkedonthis:-)

• EmptyUPDATE• KnownasEOR(ie:youcannowsynctheRIBtotheFIB)• MultiProtocol IPv4vsIPv4“native”– interopissuesinthepast(resolved)

• 2xKeepAlive• Samebutitisatrick..Notdocumentedanywhere

Page 28: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP

Becareful,GooglingBGPcanbesurprising…

Page 29: BGP, The Good Bad, and UglyMissing - Manginthomas.mangin.com/data/pdf/NetMCR - Oct 12 - BGP Good Bad Missing.pdf · BGP, The Good, The Bad, and The UglyMissing Ideas to improve BGP