CS 204: BGP Jiasi Chen Lectures: MWF 12:10-1pm in WCH 139 - - PowerPoint PPT Presentation

cs 204 bgp
SMART_READER_LITE
LIVE PREVIEW

CS 204: BGP Jiasi Chen Lectures: MWF 12:10-1pm in WCH 139 - - PowerPoint PPT Presentation

CS 204: BGP Jiasi Chen Lectures: MWF 12:10-1pm in WCH 139 http://www.cs.ucr.edu/~jiasi/teaching/cs204_spring16/ 1 Overview Inter-AS routing BGP Forwarding example AS hierarchy Paper discussion 2 Autonomous Systems


slide-1
SLIDE 1

CS 204: BGP

Jiasi Chen Lectures: MWF 12:10-1pm in WCH 139 http://www.cs.ucr.edu/~jiasi/teaching/cs204_spring16/

1

slide-2
SLIDE 2

Overview

  • Inter-AS routing
  • BGP
  • Forwarding example
  • AS hierarchy
  • Paper discussion

2

slide-3
SLIDE 3

Autonomous Systems

  • Autonomous system (AS)
  • Unit of routing policy
  • ~50k ASes in use
  • E.g., UCR has AS#6061, AT&T has AS#144, Princeton has AS#88

3

AS6061 3b 3c 3a AS144 1c 1a 1d 1b

AS88

2a 2c 2b

  • ther

networks

  • ther

networks

slide-4
SLIDE 4

Review of Routing

  • Inter-AS routing
  • BGP
  • Intra-AS routing
  • RIP
  • OSPF

4

Link-state? Distance vector?

AS6061 3b 3c 3a AS144 1c 1a 1d 1b

AS88

2a 2c 2b

  • ther

networks

  • ther

networks

slide-5
SLIDE 5

Why different Intra-, Inter-AS routing ?

policy:

  • inter-AS: admin wants control over how its traffic

routed, who routes through its net.

  • intra-AS: single admin, so no policy decisions needed

scale:

  • hierarchical routing saves table size, reduced update

traffic performance:

  • intra-AS: can focus on performance
  • inter-AS: policy may dominate over performance

5

slide-6
SLIDE 6

3b 1d 3a 1c 2a AS3 AS1

AS2

1a 2c 2b 1b

Intra-AS Routing algorithm Inter-AS Routing algorithm

Forwarding table

3c

Interconnected ASes

vforwarding table configured by both intra- and inter-AS routing algorithm § intra-AS sets entries for internal dests § inter-AS & intra-AS sets entries for external dests

6

slide-7
SLIDE 7

Example: setting forwarding table in router 1d

AS3

AS2

3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b

  • ther

networks

  • ther

networks

x

a b c

Send packet on interface a, b, or c? Determine b is on least cost path, install forwarding table entry (x,b)

7

slide-8
SLIDE 8

Example: choosing among multiple ASes

AS3

AS2

3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b

  • ther

networks

  • ther

networks

x Which path to choose? This is also the job of the inter-AS protocol

8

slide-9
SLIDE 9

learn from inter-AS protocol that subnet x is reachable via multiple gateways use routing info from intra-AS protocol to determine costs of least-cost paths to each

  • f the gateways

hot potato routing: choose the gateway that has the smallest least cost determine from forwarding table the interface that leads to least-cost gateway. Enter that interface in forwarding table

Example: choosing among multiple ASes

AS3

AS2

3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b

  • ther

networks

  • ther

networks

x

9

slide-10
SLIDE 10

Overview

  • Inter-AS routing
  • BGP
  • Forwarding example
  • AS hierarchy
  • Paper discussion

10

slide-11
SLIDE 11

Internet inter-AS routing: BGP

  • BGP (Border Gateway Protocol):thede facto

inter-domain routing protocol

  • “glue that holds the Internet together”
  • BGP provides each AS a means to:
  • eBGP:obtain subnet reachability information from

neighboring ASs.

  • iBGP:propagate reachability information to all AS-

internal routers.

  • determine “good” routes to other networks based on

reachability information and policy.

  • allows subnet to advertise its existence to rest of

Internet: “I am here”

11

slide-12
SLIDE 12

BGP basics

  • when AS3 advertises a prefix to AS1:
  • AS3 promises it will forward datagrams towards that prefix
  • AS3 can aggregate prefixes in its advertisement

AS3

AS2

3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b

  • ther

networks

  • ther

networks

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

12

slide-13
SLIDE 13

Path attributes and BGP routes

  • advertised prefix includes BGP attributes
  • prefix + attributes = “route”
  • two important attributes:
  • AS-PATH: contains ASs through which prefix advertisement

has passed

  • NEXT-HOP: indicates specific internal-AS router to next-hop
  • AS. (may be multiple links from current AS to next-hop-AS)

13

slide-14
SLIDE 14

BGP basics: distributing path information

AS3

AS2

3b 3a AS1 1c 1a 1d 1b 2a 2c 2b

  • ther

networks

  • ther

networks eBGP session iBGP session

3c

14

slide-15
SLIDE 15

BGP route selection

vrouter may learn about more than 1 route to destination AS, selects route based on:

  • 1. local preference value attribute: policy decision
  • 2. shortest AS-PATH
  • 3. closest NEXT-HOP router: hot potato routing
  • 4. additional criteria
  • gateway router receiving route advertisement uses

import policy to accept/decline

  • e.g., never route through AS x
  • policy-based routing

15

slide-16
SLIDE 16

BGP messages

  • BGP messages exchanged between peers over TCP connection
  • BGP messages:
  • OPEN: opens TCP connection to peer and authenticates

sender

  • UPDATE: advertises new path (or withdraws old)
  • KEEPALIVE: keeps connection alive in absence of UPDATES;

also ACKs OPEN request

  • NOTIFICATION: reports errors in previous msg; also used to

close connection

16

slide-17
SLIDE 17

Overview

  • Inter-AS routing
  • BGP
  • Forwarding example
  • AS hierarchy
  • Paper discussion

17

slide-18
SLIDE 18

1

2 3

Dest IP

routing algorithms local forwarding table prefix

  • utput port

138.16.64/22 124.12/16 212/8 ………….. 3 2 4 …

How does entry get in forwarding table?

entry

Assume prefix is in another AS.

18

slide-19
SLIDE 19

High-level overview

  • 1. Router becomes aware of prefix
  • 2. Router determines output port for prefix
  • 3. Router enters prefix-port in forwarding table

How does entry get in forwarding table?

19

slide-20
SLIDE 20

Router becomes aware of prefix

AS3

AS2

3b 3c AS1 1c 1a 1d 2a 2c 2b

  • ther

networks

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/22 v AS-PATH: AS3 AS15 … v NEXT-HOP: 201.44.13.125

138.16.64/22

3a 1b

AS15

20

slide-21
SLIDE 21

Router may receive multiple routes

v Router may receive multiple routes for same prefix v Has to select one route

AS3

AS2

3b 3c AS1 1c 1a 1d 2a 2c 2b

  • ther

networks AS131

3a 1b

138.16.64/22

21

slide-22
SLIDE 22
  • Router selects route based on shortest AS-PATH

Select best BGP route to prefix

v Example: v AS2 AS17 to 138.16.64/22 v AS3 AS131 AS201 to 138.16.64/22 v What if there is a tie?

We’ll come back to that!

select

22

slide-23
SLIDE 23

Find best intra-route to BGP route

  • Use selected route’s NEXT-HOP attribute
  • Route’s NEXT-HOP attribute is the IP address of the router

interface that begins the AS PATH.

  • Example:

v AS-PATH: AS2 AS17 …; NEXT-HOP: 111.99.86.55

  • Router uses OSPF to find shortest path from 1c to

111.99.86.55

AS3

AS2

3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b

AS17 AS15

111.99.86.55

2a 3a

23

slide-24
SLIDE 24

Router identifies port for route

vIdentifies port along the OSPF shortest path vAdds prefix-port entry to its forwarding table:

§ (dest IP , port 4)

AS3

AS2

3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b

AS17 AS131

router port

1 2 3 4

24

slide-25
SLIDE 25

Hot Potato Routing

vSuppose there two or more best inter-routes. vThen choose route with closest NEXT-HOP

§ Use OSPF to determine which gateway is closest § Q: From 1c, chose AS3 AS131 or AS2 AS17? § A: route AS3 AS131 since it is closer

AS3

AS2

3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b

AS17 AS131

25

slide-26
SLIDE 26

Summary

  • 1. Router becomes aware of prefix

§ via BGP route advertisements from other routers

  • 2. Determine router output port for prefix

§ Use BGP route selection to find best inter-AS route § Use OSPF to find best intra-AS route leading to best inter-AS route § Router identifies router port for that best route

  • 3. Enter prefix-port entry in forwarding table

How does entry get in forwarding table?

26

slide-27
SLIDE 27

Overview

  • Inter-AS routing
  • BGP
  • Forwarding example
  • AS hierarchy
  • Paper discussion

27

slide-28
SLIDE 28

Overview

  • Inter-AS routing
  • BGP
  • Forwarding example
  • AS hierarchy
  • Paper discussion

28

slide-29
SLIDE 29

BGP routing policy

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

§ X does not want to route from B via X to C § .. so X will not advertise to B a route to C

A B C

W X Y

legend: customer network: provider network

29

slide-30
SLIDE 30

BGP routing policy (2)

v A advertises path AW to B v B advertises path BAW to X v 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

W X Y

legend: customer network: provider network

30

slide-31
SLIDE 31

Overview

  • Inter-AS routing
  • BGP
  • Forwarding example
  • AS hierarchy
  • Paper discussion

31

slide-32
SLIDE 32

Stable BGP Routing

  • Trying to get to destination A
  • Routes listed in order of preference

32

A B C

(B C A) (B A) (C B A) (C A)

slide-33
SLIDE 33

Stable BGP routing

  • Suppose we start off with the second choice options…

33

A B C

(B C A) (B A) (C B A) (C A) (B C A) (B A) (C B A) (C A) (B C A) (B A) (C B A) (C A)

time

slide-34
SLIDE 34

Paper Discussion

  • What are implicit and explicit policies?
  • What are the underlying assumptions?

34

slide-35
SLIDE 35

Sources

  • Computer Networking: A Top-Down Approach, Kurose & Ross
  • Lixin Gao and Jennifer Rexford, “Stable Internet Routing Without

Global Coordination,” IEEE Trans. Networking, 2001.

35