BGP Protocol
What Is BGP?
n
BGP is an inter-domain routing protocol that communicates
prefix reachability
BGP is a path vector protocol
n
n
n
n
n
n
Routing Policy
Similar to distance vector
BGP views the Internet as a collection of autonomous systems
Stability is very important to the Internet and BGP
BGP supports CIDR
BGP routers exchange routing information between peers
Defined in RFC 1771
BGP Fundamentals
n
Routes consist of destination prefixes with an AS path
and BGP-specific attributes
Each BGP update contains one path advertisement
and attributes
n
Many destinations can share the same path
BGP compares the AS path and attributes to choose
the best path
Unfeasible routes can be advertised
n
Unreachable routes are withdrawn
BGP Connections
n
BGP updates are incremental
n
n
No regular refreshes
Except at session establishment, when volume of routing
can be high
BGP runs over TCP connections
n
n
TCP port 179
TCP Services
n
Routing Policy
Fragmentation, Acknowledgments, Checksums, Sequencing,
and
Flow Control
No automatic neighbor discovery
BGP Peering
n
BGP sessions are established between peers
n
Two types of peering sessions
n
n
BGP Speakers
E-BGP (external) peers with different AS's
I-BGP (internal) peers within the same AS
Still requires interior gateway protocols (IGPs)
n
n
IGP connects BGP speakers within the AS
IGP advertises internal routes
E-BGP and I-BGP
ISP-X AS 2
R
I-BGP
I-BGP
E-BGP
E-BGP
OSPF
OSPF
R
R
E-BGP
E-BGP
Customer AS 1
R
I-BGP
I-BGP
No AS number;
uses default route
to the Internet
R
ISP-Y AS 3
Customer 2
Routing Policy
I-BGP Loopback Interfaces
n
I-BGP peering is often done using loopback interfaces
n
n
Loopback interfaces are more stable
Not tied to a single physical path
The AS needs an IGP so that I-BGP speakers can reach each others loopback
address
Lo0: 192.168.255.2/32
Lo0: 192.168.255.1/32
R
Full-Mesh
Full-Mesh
I-BGP
I-BGP
Router B
Router A
Router C
Lo0: 192.168.255.3/32
AS 1
Default BGP Advertisement
Rules
ISP 1 AS 2
R
I-BGP
I-BGP
E-BGP
E-BGP
I-BGP
I-BGP
R
R
Customer AS 1
(1) I-BGP advertises
routes learned from
E-BGP, and
Routing Policy
(2) E-BGP advertises any
route learned from I-BGP
or E-BGP, but
(3) I-BGP does not
advertise any routes
learned via I-BGP
The Need for a Full I-BGP Mesh
How do the default rules
of I-BGP/E-BGP impact
AS2?
AS1
Advertise
N22
Advertise
N22
N23
R11
AS2
N22
I-BGP
Advertise
N22
N23
Advertise
N22
N23
X N23
E-BGP
R12
R22
R21
N22
Advertise
N23
R13
N23
R23
CIDR and Aggregate
Addresses
(1) AS 2 has the
detailed routes
AS 1
192.168.0.0/24
192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
Router A
(3) AS 1 learns
only the aggregate
and not the details
Router B
172.20.2.2
R
172.30.3.2
AS 2
192.168.0/22
192.168.0/22
172.20.2.1
(2) BGP with
Routing Policy can
172.30.3.1 advertise a prefix
that aggregates
Router C
the detailed routes
AS 3
Routing Policy
BGP Operation
n
BGP performs three types of
routing:
n
Inter-autonomous system routing
Intra -autonomous system routing
Transit autonomous system routing
Stub AS
Between AS
Within an AS
Source
Transit
Autonomous
System
Stub AS
R
Destination
BGP Neighbor States
Trying to
acquire a peer
3-Active
2-Connect
Waiting for
TCP Connection
A Stop event
OPEN
OPEN
Waiting for an
OPEN message
from a peer
4-OpenSent
NOTIFICATION
NOTIFICATION
KEEPALIVE
5-OpenConfirm
Routing Policy
Waiting for
a Start Event
NOTIFICATION
KEEPALIVE
UPDATE
KEEPALIVE
Waiting for a
KEEPALIVE or
NOTIFICATION
from a peer
1-Idle
6-Established
Neighbor negotiation
is complete
BGP Message Types
n
Four BGP message types:
n
n
n
n
Open
Update
Keepalive
Notification
Messages use a common header
When to Use BGP
n
Enterprise network that is multihomed to two or
more ISPs
n
To support full or partial routes
To participate as an Internet Backbone Provider
Internet
ISP 1
ISP 2
R
R
R
Corporate
Network
Routing Policy
Summary
n
The Border Gateway Protocol (BGP) is an interautonomous system and a distance-vector routing
protocol; BGP uses TCP as its transport protocol.
BGP is a protocol in which routing information
exchanges occur between exactly two nodes, called
peers; the term peer is equivalent to the term
neighbor, used with other routing protocols.
Routes in BGP consist of destination networks and
attributes associated with those routes.
BGP4 supports classless interdomain routing (CIDR);
CIDR makes it easy to aggregate routes.
Summary
n
BGP exchanges between autonomous systems are
called external BGP or E-BGP sessions and handle
intra-AS routing.
BGP exchanges within an AS are called internal BGP
or I-BGP sessions and handle inter-AS routing.
BGP messages are sent over TCP.
n
Routing Policy
The four types of messages are Open, Update, Keepalive,
and Notification.