CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures:...

40
CS 204: BGP Jiasi Chen Lectures: MWF 12:10-1pm Humanities and Social Sciences 1403 http://www.cs.ucr.edu/~jiasi/teaching/cs204_spring17/ 1

Transcript of CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures:...

Page 1: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

CS204:BGPJiasi Chen

Lectures:MWF12:10-1pmHumanitiesandSocialSciences1403

http://www.cs.ucr.edu/~jiasi/teaching/cs204_spring17/

1

Page 2: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Overview

• ASrelationships• Inter-ASrouting

• BGP• Example

• Paperdiscussion

2

Q:Howto“gluetogether”the“networkofnetworks”?

Page 3: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

WheredidYouTubego?

3Source:https://www.cnet.com/news/how-pakistan-knocked-youtube-offline-and-how-to-make-sure-it-never-happens-again/

Page 4: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

WheredidYouTubego?

• In2008,PakistanigovernmentdecidedtoblockYouTube• PakistanTelecom(PT)beganadvertisingaroutetoYouTube

• Advertised256addresseswithinYouTube’sIPblock• Actuallyledtoa“blackhole”

• AHongKong-basedtelecomcompanypickeduptheadvertisement• AnnouncementspreadtoothermajorISPswithin10sofseconds• YouTubecountermeasures

• Advertise64addresseswithinYouTube’sIPblock• Morespecificruleshouldoverridegeneralone

• Fullrecoveryafter~2hoursafterPTstoppedadvertisingtheroute

4Source:https://www.cnet.com/news/how-pakistan-knocked-youtube-offline-and-how-to-make-sure-it-never-happens-again/

Page 5: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Overview

• ASrelationships• Inter-ASrouting

• BGP• Example

• Paperdiscussion

5

Q:Howto“gluetogether”the“networkofnetworks”?

Page 6: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

AutonomousSystems

• Autonomoussystem(AS)• Unitofroutingpolicy• ~50kASes inuse• E.g.,UCRhasAS#6061,AT&ThasAS#144,PrincetonhasAS#88

AS60613b

3c3a

AS144

1c1a

1d1b AS88

2a2c

2bothernetworks

othernetworks

6

Page 7: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

PeeringandTransitISPs

• Peering

• Transit

7

Peer Peer

• Trafficflowsarebi-directional• ISPsjointlypayforequipment

costs

Transitprovider

Transitcustomer

• Trafficflowsarebi-directional• Arrow=Paymentfrom

customertoproviderforupstreamanddownstreamtraffic

Page 8: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

PricingContract

• Pricingcontractsaretypicallynotpublicinformation• $/Mbps/monthforalltraffictoalldestinations

• Variations• Paidpeering

• E.g.NetflixpaidComcastfordirectpeering• Backplanepeering

• ChargesmallISPsforaccesstoISP’speers• Regionalpricing

• Paytoaccessdifferentgeographicalregions,owncustomersvsexternalISPs

8

Page 9: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Examples

• DoestrafficflowbetweenAandD?• Whopayswho?

9

B

DA

C

B

DA

C

Page 10: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Examples(2)

10

B

DA

C

Peeringconnectiononlyopentocustomers

Q:WillCannounceBtoD?

Page 11: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

11

WhocannetworkGsee?• NetworkGcanseeallthenetworks

becausenetworksE,DandHbuytransitfromit.

CanAseeBthroughF?• NetworkAcanseenetworkFandits

customersdirectly,butnotnetworkBthroughnetworkF.

CanCseeBthroughDorF?• NetworkCcanseeNetworkBthroughits

peerD,butnotviaitstransitcustomerF.

WilltrafficfromCtoHgothroughEorDorboth?• TrafficfromCtoHwillgothroughE,but

notthroughD.Source:https://arstechnica.com/features/2008/09/peering-and-transit/2/

Page 12: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

InternetExchangePoints(IXP)

• Whentwonetworkspeer,itattractsothernetworkstopeertheretoo• Transitproviders• DirectconnectionbetweenISPsstillpreferred• Runasnon-profits(Europe)orprivatebusiness(USA)

• Providenetworkequipment,switches,etc.• MonthlyfeetojointheIXP

12

Page 13: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Overview

• ASrelationships• Inter-ASrouting

• BGP• Example

• Paperdiscussion

13

Q:Howto“gluetogether”the“networkofnetworks”?

Page 14: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

ReviewofRouting

• Inter-ASrouting• BGP

• Intra-ASrouting• RIP• OSPF

Link-state?Distancevector?

AS60613b

3c3a

AS144

1c1a

1d1b AS88

2a2c

2bothernetworks

othernetworks

14

Page 15: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

WhydifferentIntra-,Inter-ASrouting?policy:• inter-AS:adminwantscontroloverhowitstrafficrouted,whoroutesthroughitsnet.

• intra-AS:singleadmin,sonopolicydecisionsneededscale:• hierarchicalroutingsavestablesize,reducedupdatetraffic

performance:• intra-AS:canfocusonperformance• inter-AS:policymaydominateoverperformance

15

Page 16: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Internetinter-ASrouting:BGP• BGP(BorderGatewayProtocol): the defacto

inter-domainroutingprotocol• “gluethatholdstheInternettogether”

• BGPprovideseachASameansto:• eBGP: obtainsubnetreachabilityinformationfrom

neighboringASs.• iBGP: propagatereachabilityinformationtoallAS-

internalrouters.• determine“good” routestoothernetworksbasedon

reachabilityinformationandpolicy.• allowssubnettoadvertiseitsexistencetorestof

Internet:“Iamhere”

16

Page 17: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

BGPbasics

• whenAS3advertisesaprefixtoAS1:• AS3promises itwillforwarddatagramstowardsthatprefix• AS3canaggregateprefixesinitsadvertisement

AS3

AS2

3b

3c3a

AS1

1c1a

1d1b

2a2c

2bothernetworks

othernetworks

v BGP session: two BGP routers (“peers”) exchange BGP messages:§ advertising paths to different destination network prefixes (“path vector”

protocol) § exchanged over semi-permanent TCP connections

BGP message

17

Page 18: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

PathattributesandBGProutes

• advertisedprefixincludesBGPattributes• prefix+attributes=“route”

• twoimportantattributes:• AS-PATH: containsASsthroughwhichprefixadvertisementhaspassed

• NEXT-HOP: indicatesspecificinternal-ASroutertonext-hopAS

vExamplev Prefix:138.16.64/22vAS-PATH:AS3AS15…vNEXT-HOP:201.44.13.125

18

Page 19: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

BGPbasics:distributingpathinformation

AS3

AS2

3b3a

AS1

1c1a

1d1b

2a2c

2bothernetworks

othernetworks

eBGP session

iBGP session

3c

19

Page 20: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

BGPmessages• BGPmessagesexchangedbetweenpeersoverTCPconnection• BGPmessages:

• OPEN: opensTCPconnectiontopeerandauthenticatessender

• UPDATE: advertisesnewpath(orwithdrawsold)• KEEPALIVE: keepsconnectionaliveinabsenceofUPDATES;alsoACKsOPENrequest

• NOTIFICATION: reportserrorsinpreviousmsg;alsousedtocloseconnection

20

Page 21: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Overview

• ASrelationships• Inter-ASrouting

• BGP• Example

• Paperdiscussion

21

Q:Howto“gluetogether”the“networkofnetworks”?

Page 22: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

3b

1d

3a

1c2aAS3

AS1AS2

1a

2c2b

1b

Intra-ASRouting algorithm

Inter-ASRouting algorithm

Forwardingtable

3c

InterconnectedASes

vforwardingtableconfiguredbybothintra-andinter-ASroutingalgorithm§ intra-ASsetsentriesforinternaldests

§ inter-AS&intra-ASsetsentriesforexternaldests

22

Page 23: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

1

23

Dest IP

routing algorithms

local forwarding tableprefix output port

138.16.64/22124.12/16

212/8…………..

324…

Howdoesentrygetinforwardingtable?

entry

Assume prefix 138.16.64/22 is in another AS.

23

Page 24: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

High-leveloverview1. Routerbecomesawareofprefix2. Routerdeterminesoutputportforprefix3. Routerentersprefix-portinforwardingtable

Howdoesentrygetinforwardingtable?

24

Page 25: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Routerbecomesawareofprefix

AS3

AS2

3b

3c

AS1

1c1a

1d

2a2c

2bothernetworks

BGP message

v BGP message contains “routes”v “route” is a prefix and attributes: AS-PATH, NEXT-

HOP,…v Example

v Prefix: 138.16.64/22v AS-PATH: AS3 AS15 …v NEXT-HOP: 201.44.13.125

138.16.64/22

3a

1bAS15

25

Page 26: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Routermayreceivemultipleroutes

v Router may receive multiple routes for same prefixv Which route to pick?

1. local preference value attribute: policy decision2. shortest AS-PATH 3. closest NEXT-HOP router: hot potato routing4. additional criteria

AS3

AS2

3b

3c

AS1

1c1a

1d

2a2c

2bothernetworks

AS131

3a

1b138.16.64/22

26

138.16.64/22

Page 27: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

2.ShortestASPath

v AS3 AS131 AS201 to 138.16.64/22

v AS2 AS17 to 138.16.64/22

select

27

AS3

AS2

3b

3c

AS1

1c1a

1d

2a2c

2bothernetworks

AS131

3a

1b138.16.64/22

138.16.64/22

Page 28: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Useintra-domainrouting• Useselectedroute’sNEXT-HOPattribute

• NEXT-HOP=IPaddressoftherouterinterfacethatbeginstheASPATH

• Example:vAS-PATH:AS2AS17…;NEXT-HOP:111.99.86.55

• RouterusesOSPFtofindshortestpathfrom1cto111.99.86.55

• Insertentry(138.16.64/22,4)into1c’sforwardingtable

AS3

AS2

3b

3c3a

AS1

1c1a

1d1b

2a2c

2bAS17

AS1312a

3a

28

111.99.86.55

138.16.64/22

138.16.64/2212 3

4

Page 29: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

3.ClosestNEXT-HOPRoutervSupposetheretwoormorebestinter-routes.vThenchooseroutewithclosestNEXT-HOP

§ UseOSPFtodeterminewhichgatewayisclosest§ Q:From1c,choseAS3AS131orAS2AS17?§ A:routeAS3AS131sinceitiscloser

AS3

AS2

3b

3c3a

AS1

1c1a

1d1b

2a2c

2bAS17

AS131

29

Page 30: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

1.Policydecision

v A,B,C are provider networksv X,W,Y are customer (of provider networks)v X is dual-homed: attached to two networks

A

B

C

WX

Y

legend:

customer network:

providernetwork

30

Page 31: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

1.Policydecision

v A advertises path AW to Bv B advertises path BAW to X v Q: Should B advertise path BAW to C?

§ No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers

§ B wants to force C to route to w via A§ B wants to route only to/from its customers!

A

B

C

WX

Y

legend:

customer network:

providernetwork

31

Page 32: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Summary1. Routerbecomesawareofprefix

§ viaBGProuteadvertisementsfromotherrouters2. Filtertheroutebasedonpolicy($$$)3. Determinerouteroutputportforprefix

§ UseBGProuteselectiontofindbestinter-ASroute§ UseOSPFtofindbestintra-ASrouteleadingtobestinter-

ASroute§ Routeridentifiesrouterportforthatbestroute

4. Enterprefix-portentryinforwardingtable

Howdoesentrygetinforwardingtable?

32

Page 33: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

InPractice

• SupposeyouwanttomaptheInternet…

33

IPaddress AS#AS#AS# Relationship

Page 34: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

IPAddress

• PrincetonIPranges• 128.112.0.0/16• 140.180.0.0/16• 204.153.48.0/23• 66.180.177.0/24• 192.12.53.0/24

• UCRIPranges• 138.23.0.0/16 • 192.31.146.0/24 • 192.31.148.0/24 • 192.35.223.0/24

34

Q:WhatisthedifferencebetweenIPaddressblocksandAS#?

Page 35: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Overview

• ASrelationships• Inter-ASrouting

• BGP• Example

• Paperdiscussion

35

Q:Howto“gluetogether”the“networkofnetworks”?

Page 36: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

StableBGPRouting

• TryingtogettodestinationA• Routeslistedinorderofpreference

A

B

C

(BCA)(BA)

(CBA)(CA)

36

Page 37: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

StableBGProuting

• Supposewestartoffwithacertaininitialconfiguration

A

B

C

(BCA)(BA)

(CBA)(CA)

(BCA)(BA)

(CBA)(CA)

time

37

Page 38: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

StableBGProuting

• Supposewestartoffwiththesecondchoiceoptions…

A

B

C

(BCA)(BA)

(CBA)(CA)

(BCA)(BA)

(CBA)(CA)

(BCA)(BA)

(CBA)(CA)

time

38

Page 39: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

PaperDiscussion

• Whatareimplicitandexplicitpolicies?

• Whataresomeoftheunderlyingassumptionsofthemodel?

• Doyouthinkitisfeasibletohaveacentralizedrouteregistry?

39

Page 40: CS 204: BGP - University of California, Riverside ·  · 2017-04-11CS 204: BGP JiasiChen Lectures: MWF 12:10-1pm ... BGP • BGP (Border Gateway Protocol): ... High-level overview

Sources

• ComputerNetworking:ATop-DownApproach,Kurose&Ross• Lixin GaoandJenniferRexford,“StableInternetRoutingWithoutGlobalCoordination,”IEEETrans.Networking,2001.

40