27
Deploying BGP Large Communities Greg Hankins [email protected] Nokia 2017-04-26 GPF 12.0, New York City 1

Deploying BGP Large Communities - Peering Forumpeeringforum.com/pastEvents/gpf12.0/greg_hankins_gpf-12.0... · 26.04.2017 · Deploying BGP Large Communities Greg Hankins [email protected]

Embed Size (px)

Citation preview

DeployingBGPLargeCommunities

[email protected]

Nokia

2017-04-26 GPF12.0,NewYorkCity 1

NetworkOperatorsUseBGPCommunities• RFC1997 stylecommunitieshavebeenavailableforthepast20years– Encodesa32-bitvaluedisplayedas:“16-bitASN:16-bitvalue”

– DesignedtosimplifyInternetroutingpolicies

– Signalsroutinginformationbetweennetworkssothatanactioncanbetaken

• BroadsupportinBGPimplementations• WidelydeployedandrequiredbynetworkoperatorsforInternetrouting

2017-04-26 GPF12.0,NewYorkCity 2Source:https://www.us.ntt.net/support/policy/routing.cfm (AS2914)

RFC1997CommunitiesExamples

NeededRFC1997StyleCommunities,butLarger

• Weknewwe’drunoutof16-bitASNseventuallyandcameupwith32-bitASNs– RIRsstartedallocating32-bitASNsbyrequestin2007,nodistinctionbetween16-bitand32-bitASNsnow

• However,youcan’tfita32-bitvalueintoa16-bitfield– Can’tusenative32-bitASNswithRFC1997communities

• NeededanInternetroutingcommunitiessolutionfor32-bitASNsforalmost10years– ParityandfairnesssoeveryonecanusetheirgloballyuniqueASN

2017-04-26 GPF12.0,NewYorkCity 3

TheSolution:RFC8092“BGPLargeCommunitiesAttribute”

• IdeaprogressedrapidlyfrominceptioninMarch2016

• FirstI-DinSeptember2016toRFCpublicationonFebruary16,2017injustsevenmonths

• Finalstandard,plusanumberofimplementationandtoolsdevelopedaswell

• Networkoperatorscantestanddeploythenewtechnologynow

2017-04-26 GPF12.0,NewYorkCity 4CakeandphotocourtesyoftheNTTCommunicationsNOC.

EncodingandUsage

• Auniquenamespaceforall16-bitand32-bitASNs– NonamespacecollisionsbetweenASNs

• Largecommunitiesareencodedasa96-bitquantityanddisplayedas“32-bitASN:32-bitvalue:32-bitvalue”

• Canonicalrepresentationis$Me:$Action:$You

2017-04-26 GPF12.0,NewYorkCity 5

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

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Global Administrator | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Local Data Part 1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Local Data Part 2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Operator-DefinedValue(Action)

AutonomousSystemNumber(Me)

Operator-DefinedValue(You)

PlanningforLargeCommunities

• Theentirenetworkecosystemneedstosupportlargecommunitiesinordertoprovision,deployandtroubleshootthem

• Askyourvendorsandimplementersforsoftwaresupport

• Updateyourtoolsandprovisioningsoftware• Extendyourroutingpolicies,andopenlypublishthisinformation

• Trainyourtechnicalstaff

2017-04-26 GPF12.0,NewYorkCity 6

Imagesources:https://www.sunet.se/blogg/all-i-want-for-christmas-is-large-bgp-communities/“Alli wantforchristmas is…LargeBGPCommunities”byFredrik"Hugge"Korsbäck

DevelopaComprehensiveCommunitiesPolicy

• ClassicRFC1997communitieswillcontinuetobeusedtogetherwithlargecommunities– There’snoflagdaytoconvert,largecommunitiessimplyprovideanadditionalwaytosignalinformation

• Yourexistingroutingpolicywithclassiccommunitiesisstillvalid• Well-knowncommunitiessuchas“no-advertise”,“no–export”,“blackhole”,etc.arestillused

• Extendyourpolicywithlargecommunitiesthatallownetworkoperatorstosignalthesameinformationastheycanwithclassiccommunities

2017-04-26 GPF12.0,NewYorkCity 7

BGPLargeCommunityExamples

• NonamespacecollisionsoruseofreservedASNs• Enablesoperatorstouse32-bitASNsin$Meand$Youvalues2017-04-26 GPF12.0,NewYorkCity 8

RFC1997(Current)

BGPLargeCommunities Action

65400:peer-as 2914:65400:peer-as DonotAdvertisetopeer-as inNorthAmerica(NTT)

43760:peer-as 43760:1:peer-as Announceaprefixtoacertainpeer(INEX)

0:43760 43760:0:peer-as Preventannouncementofaprefixtoacertainpeer (INEX)

65520:nnn 2914:65520:nnn Lower LocalPreferenceinCountrynnn (NTT)

2914:410 2914:400:10 RouteReceived FromaPeeringPartner(NTT)

2914:420 2914:400:20 RouteReceivedFromaCustomer(NTT)

CommunitiesPolicyDevelopment

• draft-ietf-grow-large-communities-usage isanewRFC1998styleI-DintheIETFGROWWorkingGroup

• Providesexamplesandinspirationfornetworkoperatorstouselargecommunities

• Alsoprovidesmanyexamplesonhowtodevelopacommunitiespolicy– Informationalcommunities– Actioncommunities

2017-04-26 GPF12.0,NewYorkCity 9

InformationalCommunities

• Aninformationallabeltomarkaroutewith– Itsorigin:ISO3166-1numericcountryIDandUMM.49geographicregion

– Relationorpropagation:internal,customer,peer,transit• Providesinformationfordebuggingorcapacityplanning• TheGlobalAdministratorfieldissettotheASNthatlabelstheroutes

• MostusefulfordownstreamnetworksandtheGlobalAdministratoritself

2017-04-26 GPF12.0,NewYorkCity 10

InformationCommunitiesExample

• Forexample,acommunitiesvalueof“64497:1:52864497:2:15064497:3:2”wouldindicatedthatiswaslearnedintheNetherlands,inEurope,fromacustomer

2017-04-26 GPF12.0,NewYorkCity 11

ISO3166-1CountryID + UNM.49Region + Relation

LargeCommunity Description Large

Community Description LargeCommunity Description

64497:1:528 Netherlands 64497:2:2 Africa 64497:3:1 Internal64497:1:392 Japan 64497:2:9 Oceania 64497:3:2 Customer64497:1:840 USA 64497:2:145 Western Asia 64497:3:3 Peering

64497:2:150 Europe 64497:3:4 Transit

British PostalCodes(~31Bits) or GPSCoordinatesLargeCommunity PostalCode LargeCommunity Location

64497:9:849701135 E1W1LB (London) 64497:10:1281024 Amsterdam64497:9:1345374681 M901QX (Manchester) (52.37783,4.87995)

CDN/EyeballExample– Youdoalotwith32bits!

• Locationencodingcanbeusedtoprovideveryaccuratelocationinformationattachedtomore-specificroutesannouncedtoCDNcaches

• Britishpostalcodescanbeencodedbystrippingthewhitespaceanddoingasimplebase36tobase10conversion

• GPScoordinatescanbeencodedwithGeohash– Forexample52.37783,4.87995(Amsterdam)encodedwith600meterprecision– Python:importGeohash;Geohash.encode(52.37783,4.87995,precision=6)– Geohash result:“u173zp”– Convert“u173zp”frombase32tobase10=1281024

2017-04-26 GPF12.0,NewYorkCity 12

ActionCommunities

• AnactionlabeltorequestthataroutebetreatedinaparticularwaywithinanAS– Propagationcharacteristics:export,selectiveexport,noexport– Localpreference:influenceingresstrafficwithintheAS– ASPath:influencetrafficfromoutsidetheAS

• TheGlobalAdministratorfieldissettotheASNwhichhasdefinedthefunctionalityofthecommunity– AlsoistheASthatisexpectedtoperformtheaction

• MostusefulfortransitproviderstakingactiononbehalfofacustomerortheGlobalAdministrator

2017-04-26 GPF12.0,NewYorkCity 13

ActionCommunitiesExample

• Selectivenoexport– ASNbasedselectivenoexport– Locationbasedselectivenoexport

• SelectiveASpathprepending– ASNbasedselectiveASpathprepending– LocationbasedselectiveASpath

• Localpreference– Globallocalpreference– Regionbasedlocalpreference

2017-04-26 GPF12.0,NewYorkCity 14

ASNBasedNoExportLarge

Community Description

64497:4:64498 AS6449864497:4:64499 AS6449964497:4:65551 AS65551

LocationBasedNoExportLarge

Community Description

64497:5:528 Netherlands64497:5:392 Japan64497:5:840 USA

GettingStartedWithLargeCommunities• 2018istheyearoflargeBGPcommunities– Preparation,testing,traininganddeploymentcantakeweeks,monthsorevenoverayear

– Starttheworknow,soyouarereadywhencustomerswanttouselargecommunities

• Lotsofresourcesareavailabletohelpnetworkoperatorslearnaboutlargecommunities– BGPspeakerimplementations– Analysisandecosystemtools– Presentations(http://largebgpcommunities.net/talks/)– Documentationforeachimplementation– Configurationexamples(http://largebgpcommunities.net/examples/)

2017-04-26 GPF12.0,NewYorkCity 15

LargeCommunitiesBeaconPrefixes• ThefollowingprefixesareannouncedwithASpath2914_15562$– 192.147.168.0/24(lookingglass)

– 2001:67c:208c::/48(lookingglass)

– BGPLargeCommunity:15562:1:1

2017-04-26 GPF12.0,NewYorkCity 16

route-views>show ip bgp 192.147.168.0BGP routing table entry for 192.147.168.0/24, version 98399100Paths: (39 available, best #30, table default)Not advertised to any peerRefresh Epoch 1701 2914 15562137.39.3.55 from 137.39.3.55 (137.39.3.55)Origin IGP, localpref 100, valid, externalunknown transitive attribute: flag 0xE0 type 0x20 length 0xCvalue 0000 3CCA 0000 0001 0000 0001

rx pathid: 0, tx pathid: 0

COLOCLUE1 11:06:17 from 94.142.247.3] (100/-) [AS15562i] Type: BGP unicast univBGP.origin: IGP BGP.as_path: 8283 2914 15562 BGP.next_hop: 94.142.247.3BGP.med: 0 BGP.local_pref: 100 BGP.community: (2914,410) (2914,1206) (2914,2203) (8283,1) BGP.large_community: (15562, 1, 1)

CiscoIOSOutput(WithoutLargeCommunitiesSupport)

BIRDOutput(WithLargeCommunitiesSupport)

BGPSpeakerImplementationStatus

2017-04-26 GPF12.0,NewYorkCity 17

Implementation Software Status Details

Arista EOS Planned FeatureRequestedBUG169446

Cisco IOSXE Planned 16.9.1(FCSJuly2018)source

Cisco IOSXR ✔ Done! Beta(perhapsin6.3.2forreal?)

cz.nic BIRD ✔ Done! BIRD1.6.3(commit)

ExaBGP ExaBGP ✔ Done! PR482

FreeRangeRouting frr ✔ Done! Issue46 (commit)

Juniper Junos OS Planned SecondHalf2017(perhaps17.3R1?)

MikroTik RouterOS Won’tImplementUntilRFC FeatureRequested2016090522001073

Nokia SROS Planned ThirdQuarter2017

nop.hu freeRouter ✔ Done!

OpenBSD OpenBGPD ✔ Done! OpenBSD6.1(commit)

OSRG GoBGP ✔ Done! PR1094

rtbrick Fullstack ✔ Done! FullStack 17.1

Quagga Quagga ✔ Done! Quagga1.2.0875

Ubiquiti EdgeOS Planned InternalEnhancementRequested

VyOS VyOS Requested FeatureRequestedT143

ToolsandEcosystemImplementationStatus

2017-04-26 GPF12.0,NewYorkCity 18

Implementation Software Status DetailsDE-CIX pbgpp ✔ Done! PR16

FreeBSD tcpdump ✔ Done! PR213423

Marcod’Itri zebra-dump-parser ✔ Done! PR3

OpenBSD tcpdump ✔ Done! OpenBSD6.1(patch)

pmacct.net pmacct ✔ Done! PR61

RIPENCC bgpdump ✔ Done! Issue41 (commit)

tcpdump.org tcpdump ✔ Done! PR543 (commit)

YoshiyukiYamauchi mrtparse ✔ Done! PR13

Wireshark Dissector ✔ Done! 18172(patch)

Visithttp://largebgpcommunities.net/implementations/ fortheLatestStatus

TestingLargeCommunities

• TheBGPLargeCommunitiesPlaygroundprovidesaneasywayrunseveralimplementationstogetherinalabenvironment

• SupportsBIRD,ExaBGP,GoBGP,Quaggaandpmacct• Dockerimagesareavailable• Usetheplaygroundto– Becomefamiliarwithlargecommunities– Testinteroperabilitywithyourvendor’sBGPimplementations– Design,configureandverifyyournewcommunitypolicies

2017-04-26 GPF12.0,NewYorkCity 19BGPLargeCommunitiesPlayground:https://github.com/pierky/bgp-large-communities-playground

Questions?Presentationcreatedby:

[email protected]@greg_hankins

[email protected]@JobSnijders

2017-04-26 GPF12.0,NewYorkCity 20

Visithttp://LargeBGPCommunities.net/ fortheLatestInfoReuseofthisslidedeckispermittedandencouraged!

ConfigurationandOutputExamples

2017-04-26 GPF12.0,NewYorkCity 21

BIRDConfiguration# matchif ((8283, 1, 2) ~ bgp_large_community) then return true;

# scrub / deletebgp_large_community.delete([(8283, *, *)]);bgp_large_community.delete([(8283, 0, 1)]);

# setbgp_large_community.add((8283, 0, 100));bgp_large_community.add([(8283, 0, 100), (8283, 2, 333)]);

2017-04-26 GPF12.0,NewYorkCity 22

IOSXRConfiguration(EFT– Beta“JustLikeCommunity”)

# matchroute-policy set-somethingif large-community matches-any (8283:4:3) thenset local-preference 120

endifend-policy

# scrub / deleteroute-policy set-somethingdelete large-community in (8283:*:*)delete large-community in (8283:4:3)

end-policy

# setroute-policy set-somethingset large-community (8283:45:29)additive

end-policy

2017-04-26 GPF12.0,NewYorkCity 23

NokiaSROSConfigurationpolicy-options

community "set" members "8283:45:29"community "match" members "8283:4:3"community "delete" members "8283:4:3"

2017-04-26 GPF12.0,NewYorkCity 24

policy-statement "set-something"entry 10

description "match"from

community "match"exit action accept

local-preference 120exit

exit entry 20

description "scrub / delete"action accept

community remove "delete"exit

exit entry 30

description "set" action accept

community add "set"exit

exit exit

OpenBGPD Configuration# matchallow from any large-community 8283:1:2match from any large-community 8283:1:2 set localpref 300deny to any peer-as neighbor-as \

large-community 8283:6:neighbor-as

# scrub / deletematch from any set { large-community delete 8283:*:* }match from any set { large-community delete 8283:1:2 }

# setmatch from any set { large-community 8283:1:2 }match from any set { large-community 8283:1:2 \

large-community 8283:4034:24824 }

2017-04-26 GPF12.0,NewYorkCity 25

tcpdump 4.9.0PacketCapture# ./tcpdump -i eth3 -n -v -c 1 src port 179tcpdump: listening on eth3, link-type EN10MB (Ethernet), capture size 262144 bytes16:22:08.992920 IP (tos 0xc0, ttl 64, id 41807, offset 0, flags [DF], proto TCP (6), length 181)94.142.247.3.179 > 94.142.247.6.33785: Flags [P.], cksum 0xabce (incorrect -> 0x1e40), seq

58743671:58743800, ack 2012368616, win 2270, options [nop,nop,TS val 857977378 ecr 149127175], length 129: BGP

Update Message (2), length: 129Origin (1), length: 1, Flags [T]: IGPAS Path (2), length: 34, Flags [T]: 38930 1299 3910 721 27065 1554 1555 1501Next Hop (3), length: 4, Flags [T]: 94.142.247.3Multi Exit Discriminator (4), length: 4, Flags [O]: 0Local Preference (5), length: 4, Flags [T]: 100Atomic Aggregate (6), length: 0, Flags [T]:Aggregator (7), length: 8, Flags [OT]: AS #1501, origin 144.105.202.0Community (8), length: 8, Flags [OT]: 1299:20000, 8283:14Large Community (32), length: 12, Flags [OTP]:

8283:6:14Updated routes:

136.210.249.0/24

2017-04-26 GPF12.0,NewYorkCity 26

Wireshark2.3.0(Prerelease)PacketCapture

2017-04-26 GPF12.0,NewYorkCity 27