30
Introduction to BGP

Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing: Which information

Embed Size (px)

Citation preview

Page 1: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

Introduction to BGP

Page 2: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

What Is BGP?

Border Gateway Protocol BGP-4The de-facto interdomain routing protocolBGP enables policy in routing:

Which information gets advertised and how

BGP is a Distance Vector like protocolWithin an AS, Internal Gateway Protocol (IGP

or I-BGP)

Page 3: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

CS 640

3Internet Structure

Original idea

Backbone service provider

Large corporation

Smallcorporation “Consumer ” ISP

“Consumer” ISP“ Consumer” ISP

“Consumer ” ISP

Smallcorporation

Smallcorporation

Smallcorporation

Page 4: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

CS 640

4Internet Structure

Today

Backbone service provider

Peeringpoint

Peeringpoint

Large corporation

Large corporation

Smallcorporation

“Consumer ” ISP

“Consumer” ISP

“ Consumer” ISP

Page 5: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

CS 640

5Route Propagation in the Internet

Autonomous System (AS) corresponds to an administrative domain examples: University, company, backbone network assign each AS a 16-bit number

Two-level route propagation hierarchy interior gateway protocol (each AS selects its own) exterior gateway protocol (Internet-wide standard)

Routes information is propagated at various levels hosts know local router local routers know site routers site routers know core router core routers know everything

Page 6: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

CS 640

6Popular Interior Gateway ProtocolsRIP: Route Information Protocol

distributed with BSD Unix distance-vector algorithm based on hop-count (infinity set to 16)

OSPF: Open Shortest Path First recent Internet standard uses link-state algorithm supports load balancing supports authentication

Page 7: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

CS 640

7

EGP: Exterior Gateway Protocol

Overview Original standard for Internet routing protocol (c 1983) designed for tree-structured Internet

Single backbone concerned with reachability, not optimal routes

Protocol messages neighbor acquisition: one router requests that another be

its peer; peers exchange reachability information neighbor reachability: one router periodically tests if the

another is still reachable; exchange HELLO/ACK messages; uses a k-out-of-n rule: ¼ to stay up, ¾ to establish

routing updates: peers periodically exchange their routing tables (including route weights) using a basic distance vector method There can be multiple connections between ASs

Page 8: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

CS 640

8

Limits of EGP

At first glance, EGP seems like a distance vector protocol since updates carry lists of destinations and distances – but distances are NOT reliable.

EGP was designed to support tree topologies, not meshes False routes injected by accident can have really bad consequences

(black holes) – there is no easy way for dealing with this problem Loops can easily occur – all we are doing is forwarding routing tables

EGP was not designed to easily support fragmented IP packets – all data is assumed to fit in MTU.

Solutions to these and other EGP problems were all manual

Page 9: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

CS 640

9

BGP-4: Border Gateway Protocol

BGP-1 developed in 1989 to address problems with EGP. Assumes Internet is an arbitrarily interconnected set of

ASsAS traffic types

Local starts or ends within an AS

Transit passes through an AS

AS Types stub AS: has a single connection to one other AS

carries local traffic only multihomed AS: has connections to more than one AS

refuses to carry transit traffic transit AS: has connections to more than one AS

carries both transit and local traffic

Page 10: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

CS 640

10

BGP-4 contd.Each AS has:

one or more border routers Handles inter-AS traffic

one BGP speaker for an AS that participates in routing BGP speaker establishes BGP sessions with peers and

advertises: local network names other reachable networks (transit AS only) gives path information including path weights (MEDs) withdrawn routes

BGP goal: find loop free paths between ASs Optimality is secondary goal It’s neither a distance-vector nor a link-state protocol

Hard problem Internet’s size (~12K active ASs) means large tables in BGP

routers Autonomous domains mean different path metrics Need for flexibility

Page 11: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

CS 640

11BGP Example

Speaker for AS2 advertises reachability to P and Q network 128.96, 192.4.153, 192.4.32, and 192.4.3, can

be reached directly from AS2

Speaker for backbone advertises networks 128.96, 192.4.153, 192.4.32, and 192.4.3 can

be reached along the path (AS1, AS2).Speaker can cancel previously advertised paths

Backbone network(AS 1)

Regional provider A(AS 2)

Regional provider B(AS 3)

Customer P(AS 4)

Customer Q(AS 5)

Customer R(AS 6)

Customer S(AS 7)

128.96192.4.153

192.4.32192.4.3

192.12.69

192.4.54192.4.23

Page 12: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

CS 640

12

Some BGP details

Path vectors are most important innovation in BGP Enables loop prevention in complex topologies If AS sees itself in the path, it will not use that path

Routes can be aggregated Based on CIDR (classless) addressing

Routes can be filteredRuns over TCPMost of the same messages as EGP

Open, Update, Notify, Keepalive

BGP session have only recently been made secure

Page 13: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

CS 640

13

BGP in practice

10-20 “tier 1” ASs which are the Internet backbone

Clearly convergence is an issue – why?Black holes are always a potential problemThere are lots of BGP updates every day!BGP is really the heart of the InternetBGP is a means by which network operators

control congestion in the Internet.BGP is really a big problem!

Page 14: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

How A BGP graph Looks Like

Each AS has designated BGP routers

BGP routers of an AS communicate internally with another protocol (IGP)

AS 1

AS 2

AS 3

AS 4

AS 5

Page 15: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

What is different with BGP?

BGP goal: enable business relationshipsOpts for: flexibility, scalabilityPerformance optimization is secondary

Page 16: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

Some Basic Numbers

• ~20,000 Autonomous Systems approx.• Corporate Networks• ISP Internal Networks• National Service Providers

• Identified by ASN a 16 bit value• Assigned by IANA

• Superlinear growth

Page 17: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

17

Size of the Routing Table at the core of the Internet

Source: http://www.telstra.net/ops/bgptable.html

0

20000

40000

60000

80000

100000

120000

140000

Aug-87 May-90 J an-93 Oct-95 J ul-98 Apr-01 J an-04

Num

ber

of

prefi

xes

Page 18: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

Routing is Based on Prefixes

A BGP Routing table has prefixes for entriesFor a IP address of a packet, find longest matchExample: packet IP 128.32.101.1128.32.0.0/16 match for 16 bits128.32.101.0/24 is a longer match No matches:

128.1.1.4 128.32.5.0/24

Page 19: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

Prefix Matching in More Detail

For a IP address of a packet, find longest matchExample: Compare

packet IP 128.32.101.1 With 128.32.0.0/16 IP : 01000000. 001000000. 01100101 .00000001 Mask : 11111111. 111111111. 00000000 .00000000 AND : 01000000. 001000000. 00000000 .00000000 Prefix : 01000000. 001000000. 00000000. 00000000 Equal? Yes

Page 20: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

Advertising Routing Information

Each AS advertises what it can reach from each BGP router

Policies I: filter what you advertisePolicies II: filter from what you hear

advertised Build up a BGP routing table

Remember which prefix you hear from which link

Page 21: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

What Does a Routing Table Look Like?

Origin AS “owns” the address

Prefix Origin AS

Path

128.32.0.0/16 123 14 56 123

123 34 101 203 123

128.32.101.0/24 15 50 15 15

Page 22: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

Basic AS relationships

Customer – Provider Customer pays Provider for service The Customer is always right

Peer to Peer: mutual cooperation Ex. MCI and AT&T

Sibling-Sibling Ex. AT&T research and AT&T wireless

Page 23: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

The Internet as a Directed Graph

Every edge is bidirectional

Business relationships are represented

Provider Customer

Peer Peer

Page 24: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

The Initial Idea

Data flows between customers-providersTop level providers are peers

They exchange information to ensure connectivity

What can possibly go wrong?

Page 25: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

And then came the rain…

Thousands of ASsComplicated relationshipsMultiple providers for one AS!!

Multihoming

Traffic engineering I want to use multiple paths and load balance

Page 26: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

AS Relationships

Customer – Provider: customer pays and is always right Peer to Peer: Exchange traffic only between their customers Sibling-Sibling: Exchange traffic at will

10

1

100 200

11

4

12 13

2 3

Provider Customer

PeerPeer

Page 27: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

The Rules of BGP Routing

Transit traffic: traffic that does not go to my customers (or their customers)

A provider carries any traffic to or from a customer

Peers exchange traffic only if between their customers

Page 28: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

How BGP Policy Restricts Routing

Routing rules: Provider accept

everything Peer only if it is for its

customers

Path Properties: Up then down No up-down-up, at most 1

peer-peer steps

Provider Customer

10

1

100 200

11

4

12 13

2 3

Peer Peer

Page 29: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

Implementing BGP Rules

What do you do with an advertisement:Through customer link

Advertise to all (customers, peers, providers)

Through provider link Advertise to customer only (and possibly siblings)

Through peer link Advertise to customer only (and possibly siblings)

Through sibling link Advertise to all

Page 30: Introduction to BGP. What Is BGP? Border Gateway Protocol BGP-4 The de-facto interdomain routing protocol BGP enables policy in routing:  Which information

How Policies Affect RoutingA Provider will get rid

of traffic as soon as possible,

But a Provider will carry the traffic for its customer

Did anyone say traffic is asymmetric?

Customer 1

ISP1

ISP2Customer 2