BGP — Border Gateway Protocol

Routing Protocol used between AS’s

Currently Version 4

Runs over TCP

Path Vector Protocol

Incremental Updates

AS 100

AS 101

AS 102

A

C

BGP speakers
are called peers

BGP Peers

eBGP TCP/IP

Peer Connection

Peers in different AS’s
are called External Peers

Note: eBGP Peers normally should be directly connected.

E

B

D

220.220.8.0/24

220.220.16.0/24

220.220.32.0/24

AS 100

AS 101

A

C

BGP speakers are called peers

BGP Peers

iBGP TCP/IP

Peer Connection

Peers in the same AS
are called Internal Peers

AS 102

E

B

D

Note: iBGP Peers don’t have to be directly connected.

220.220.8.0/24

220.220.16.0/24

220.220.32.0/24

AS 100

AS 101

A

C

BGP Peers

AS 102

D

220.220.8.0/24

220.220.16.0/24

220.220.32.0/24

E

B

BGP Peers exchange
Update messages containing Network Layer Reachability Information (NLRI)

BGP Update

Messages

Configuring BGP Peers

interface Serial 0

ip address 222.222.10.2 255.255.255.252

router bgp 100

network 220.220.8.0 mask 255.255.255.0

neighbor 222.222.10.1 remote-as 101

interface Serial 0

ip address 222.222.10.1 255.255.255.252

router bgp 101

network 220.220.16.0 mask 255.255.255.0

neighbor 222.222.10.2 remote-as 100

eBGP TCP Connection

BGP Peering sessions are established using the BGP “neighbor” configuration command

222.222.10.0/30

B

C

D

A

AS 100

AS 101

.2

220.220.8.0/24

220.220.16.0/24

.2

.1

.2

.1

.1

External (eBGP) is configured when AS numbers are different

Internal (iBGP) is configured when AS numbers are same

AS 100

AS 101

Configuring BGP Peers

222.222.10.0/30

.2

interface Serial 1

ip address 220.220.16.2 255.255.255.252

router bgp 101

network 220.220.16.0 mask 255.255.255.0

neighbor 220.220.16.1 remote-as 101

B

interface Serial 1

ip address 222.220.16.1 255.255.255.252

router bgp 101

network 220.220.16.0 mask 255.255.255.0

neighbor 220.220.16.2 remote-as 101

C

iBGP TCP Connection

BGP Peering sessions are established using the BGP “neighbor” configuration command

D

220.220.8.0/24

220.220.16.0/24

A

.2

.1

.2

.1

.1

External (eBGP) is configured when AS numbers are different

Configuring BGP Peers

Each iBGP speaker must peer with every other
iBGP speaker in the AS

iBGP TCP/IP

Peer Connection

AS 100

A

B

C

Configuring BGP Peers

Loopback interface are normally used as
peer connection end-points

AS 100

215.10.7.1

215.10.7.2

215.10.7.3

A

B

C

iBGP TCP/IP

Peer Connection

iBGP TCP/IP

Peer Connection

Configuring BGP Peers

AS 100

A

215.10.7.1

215.10.7.2

215.10.7.3

C

B

interface loopback 0

ip address 215.10.7.1 255.255.255.255

router bgp 100

network 220.220.1.0

neighbor 215.10.7.2 remote-as 100

neighbor 215.10.7.2 update-source loopback0

neighbor 215.10.7.3 remote-as 100

neighbor 215.10.7.3 update-source loopback0

A

Configuring BGP Peers

AS 100

A

215.10.7.1

215.10.7.2

215.10.7.3

C

A

interface loopback 0

ip address 215.10.7.2 255.255.255.255

router bgp 100

network 220.220.5.0

neighbor 215.10.7.1 remote-as 100

neighbor 215.10.7.1 update-source loopback0

neighbor 215.10.7.3 remote-as 100

neighbor 215.10.7.3 update-source loopback0

B

iBGP TCP/IP

Peer Connection

Configuring BGP Peers

AS 100

A

215.10.7.1

215.10.7.2

215.10.7.3

A

B

interface loopback 0

ip address 215.10.7.3 255.255.255.255

router bgp 100

network 220.220.1.0

neighbor 215.10.7.1 remote-as 100

neighbor 215.10.7.1 update-source loopback0

neighbor 215.10.7.2 remote-as 100

neighbor 215.10.7.2 update-source loopback0

C

iBGP TCP/IP

Peer Connection

Unfeasible Routes Length (2 Octets)

Withdrawn Routes (Variable)

Total path Attribute Length (2 Octets)

Network Layer Reachability Information (Variable)

Path Attributes (Variable)

The BGP UPDATE Message

Length (I Octet)

Prefix (Variable)

Attribute Type

Length (I Octet)

Prefix (Variable)

Attribute Length

Attribute Value

A BGP update is used to advertise a single feasible route to a peer, or to withdraw multiple unfeasible routes

Each update message contains attributes, like origin, AS-Path, Next-Hop, …….

BGP Update Messages

BGP Updates — NLRI

Network Layer Reachability Information

Used to advertise feasible routes

Composed of:

Network Prefix

Mask Length

BGP Updates — Attributes

Used to convey information associated with NLRI

AS path

Next hop

Local preference

Multi-Exit Discriminator (MED)

Community

Origin

Aggregator

Sequence of ASes a route has traversed

Loop detection

Apply policy

AS 100

AS 300

AS 200

AS 500

AS 400

170.10.0.0/16

180.10.0.0/16

150.10.0.0/16

Network Path

180.10.0.0/16	300 200 100

170.10.0.0/16	300 200

150.10.0.0/16	300 400

Network Path

180.10.0.0/16 300 200 100

170.10.0.0/16 300 200

AS-Path Attribute

160.10.0.0/16

150.10.0.0/16

192.10.1.0/30

.2

AS 100

AS 200

Network Next-Hop Path

160.10.0.0/16 192.20.2.1 100

C

Next Hop Attribute

.1

BGP Update

Messages

B

A

.1

.2

192.20.2.0/30

AS 300

E

D

Next hop to reach a network

Usually a local network is the next
hop in eBGP session

140.10.0.0/16

Next hop to reach a network

Usually a local network is the next
hop in eBGP session

160.10.0.0/16

150.10.0.0/16

192.10.1.0/30

.2

AS 100

AS 200

C

Next Hop Attribute

.1

B

A

.1

.2

192.20.2.0/30

BGP Update

Messages

E

D

Next Hop updated between
eBGP Peers

AS 300

140.10.0.0/16

Network Next-Hop Path

150.10.0.0/16 192.10.1.1 200

160.10.0.0/16 192.10.1.1 200 100

Next hop not changed
between iBGP peers

160.10.0.0/16

150.10.0.0/16

192.10.1.0/30

.2

AS 100

AS 200

Network Next-Hop Path

150.10.0.0/16 192.10.1.1 200

160.10.0.0/16 192.10.1.1 200 100

C

Next Hop Attribute

.1

B

A

.1

.2

192.20.2.0/30

BGP Update

Messages

D

E

AS 300

140.10.0.0/16

Next Hop Attribute (more)

IGP should carry route to next hops

Recursive route look-up

Unlinks BGP from actual physical topology

Allows IGP to make intelligent forwarding decision

BGP Updates —
Withdrawn Routes

Used to “withdraw” network reachability

Each Withdrawn Route is composed of:

Network Prefix

Mask Length

BGP Updates —
Withdrawn Routes

AS 321

AS 123

192.168.10.0/24

192.192.25.0/24

.1

.2

x

Connectivity lost

BGP Update

Message

Withdraw Routes

192.192.25.0/24

Network Next-Hop Path

150.10.0.0/16 192.168.10.2 321 200

192.192.25.0/24 192.168.10.2 321

BGP Routing Information Base

BGP RIB

D 10.1.2.0/24

D 160.10.1.0/24

D 160.10.3.0/24

R 153.22.0.0/16

S 192.1.1.0/24

Network Next-Hop Path

router bgp 100

network 160.10.0.0 255.255.0.0

no auto-summary

Route Table

*>i160.10.1.0/24 192.20.2.2 i

*>i160.10.3.0/24 192.20.2.2 i

BGP ‘network’ commands are normally used to populate the BGP RIB with routes from the Route Table

BGP Routing Information Base

BGP RIB

router bgp 100

network 160.10.0.0 255.255.0.0

aggregate-address 160.10.0.0 255.255.0.0 summary-only

no auto-summary

Route Table

Network Next-Hop Path

D 10.1.2.0/24

D 160.10.1.0/24

D 160.10.3.0/24

R 153.22.0.0/16

S 192.1.1.0/24

*> 160.10.0.0/16 0.0.0.0 i

* i 192.20.2.2 i

s> 160.10.1.0/24 192.20.2.2 i

s> 160.10.3.0/24 192.20.2.2 i

BGP ‘aggregate-address’ commands may be used to install summary routes in the BGP RIB

BGP ‘redistribute’ commands can also be used to populate the BGP RIB with routes from the Route Table

BGP Routing Information Base

BGP RIB

Network Next-Hop Path

router bgp 100

network 160.10.0.0 255.255.0.0

redistribute static route-map foo

no auto-summary

access-list 1 permit 192.1.0.0 0.0.255.255

route-map foo permit 10
match ip address 1

Route Table

D 10.1.2.0/24

D 160.10.1.0/24

D 160.10.3.0/24

R 153.22.0.0/16

S 192.1.1.0/24

*> 160.10.0.0/16 0.0.0.0 i

* i 192.20.2.2 i

s> 160.10.1.0/24 192.20.2.2 i

s> 160.10.3.0/24 192.20.2.2 i

*> 192.1.1.0/24 192.20.2.2 ?

BGP Routing Information Base

BGP RIB

IN Process

Update

Network Next-Hop Path

173.21.0.0/16 192.20.2.1 100

* 173.21.0.0/16 192.20.2.1 100

BGP “in” process

receives path information from peers

results of BGP path selection placed in the BGP table

“best path” flagged (denoted by “>”)

Update

Network Next-Hop Path

*>i160.10.1.0/24 192.20.2.2 i

*>i160.10.3.0/24 192.20.2.2 i

OUT Process

>

BGP Routing Information Base

OUT Process

Network Next-Hop Path

160.10.1.0/24 192.20.2.2 200

160.10.3.0/24 192.20.2.2 200

173.21.0.0/16 192.20.2.2 200 100

192.20.2.1

BGP RIB

> 173.21.0.0/16 192.20.2.1 100

Network Next-Hop Path

*>i160.10.1.0/24 192.20.2.2 i

*>i160.10.3.0/24 192.20.2.2 i

*

IN Process

Update

Update

BGP “out” process

builds update using info from RIB

may modify update based on config

Sends update to peers

Next-Hop changed

BGP Routing Information Base

BGP RIB

D 10.1.2.0/24

D 160.10.1.0/24

D 160.10.3.0/24

R 153.22.0.0/16

S 192.1.1.0/24

Network Next-Hop Path

*>i160.10.1.0/24 192.20.2.2 i

*>i160.10.3.0/24 192.20.2.2 i

*> 173.21.0.0/16 192.20.2.1 100

Best paths installed in routing table if:

B 173.21.0.0/16

Route Table

prefix and prefix length are unique

lowest “protocol distance”

The ‘Bible’ & other resources

Route-views.oregon-ix.net

Internet Routing Architectures

Bassam Halabi

pg. 168 BGP Decision Process Summary

Beginner's Guide to Connecting to the MBONE

Beau Williamson

1997-05-08T06:44:35

ymbk