d1 s1 Introduction To BGP
d1 s1 Introduction To BGP
Introduction to BGP
1 v1.2
Introduction to BGP
What is BGP?
2 v1.2
Autonomous System (AS)
• A collection of networks and routers under a single
administrative control.
• Identified by Autonomous System Number (ASN), a unique
32-bit integer.
– Initially was 16-bit, known as “2-byte ASN” or “2-octet ASN”
– Later expanded to be 32-bit, known as “4-byte ASN” or “4-octet ASN”
• RFC4893: BGP Support for Four-octet AS Number Space
Distance-Vector
Link-State Protocol Path-Vector Protocol
Protocol
EIGRP
4 v1.2
Autonomous System Number (ASN)
Range ASN Description Reference
0 Reserved RFC1930, RFC7607
5 v1.2
Border Gateway Protocol (BGP)
• An Exterior Gateway Protocol (EGP).
• Designed for exchanging routing information between
different Autonomous Systems.
6 v1.2
Border Gateway Protocol (BGP)
• Exchanges only reachability information.
• No topology information is exchanged.
• The only routing protocol that can handle the Internet’s global
routing table.
– Approximately 947k IPv4 routes or 205k IPv6 routes (February 2024)
• Classified as a path vector protocol.
– RFC1322: A Unified Approach to Inter-Domain Routing
7 v1.2
Border Gateway Protocol (BGP)
• Two BGP routers intended to establish connection for
exchanging BGP information are known as “BGP peer” or
“BGP neighbor”.
• “BGP session” referred to the established adjacency between
the BGP peers.
BGP Peer BGP Peer
AS64512 AS65000
H1 R1 BGP Session ISP1 S1
8 v1.2
Path Vector Implementation
• Treats the whole AS as a single point in the path.
• Prefixes are advertised with a list of ASNs along the path
called “AS Path”.
– A prefix means a network or a route in CIDR notation
– Path attribute “AS_PATH” is used for indicating AS Path of the prefixes
• Hides network topology of the AS to other ASes.
• Uses AS Path to prevent loop between ASes.
• Does not guarantee loop-free routing within an AS.
– IGP takes care of this
9 v1.2
Path Vector Implementation
• AS65000 originates and advertises prefix 172.18.1.0/24.
Prepends 65000 to the path Receives
of prefix 172.18.1.0/24 prefix 172.18.1.0/24
AS_PATH: 65000 AS_PATH: 65000
AS65000 AS65001
172.18.1.0/24
11 v1.2
BGP Versions
• BGP was first described in 1989 and has been in use on the
Internet since 1994.
• There are four versions of BGP:
BGP version 1 BGP version 2 BGP version 3 BGP version 4
12 v1.2
BGP-4
• BGP version 4.
• Current version of BGP.
• History of BGP-4:
– Published as RFC1654 in July 1994
– Obsoleted by RFC1771 in March 1995
– Obsoleted by RFC4271 in January 2006
• Supports Classless Inter-Domain Routing (CIDR) and route
aggregation.
• All BGP innovations since 1994 are implemented in the form of
optional extensions.
13 v1.2
MP-BGP
• At first, BGP supports only IPv4.
– When BGP-4 was created, IPv6 did not exist yet
• In 1998, BGP was extended to support other network layer
protocols, known as “Multiprotocol BGP” or “MP-BGP”.
– RFC2283: Multiprotocol Extensions for BGP-4 (February 1998)
– RFC2858: Multiprotocol Extensions for BGP-4 (June 2000)
– RFC4760: Multiprotocol Extensions for BGP-4 (January 2007)
14 v1.2
Address Family
• Identified by a combination of AFI and SAFI.
– “AFI” stands for “Address Family Identifier”
– “SAFI” stands for “Subsequent Address Family Identifier”
15 v1.2
AFIs and SAFIs
AFI Description Reference SAFI Description Reference
1 IPv4 1 Unicast RFC4760
17 v1.2
EBGP & IBGP
• There are two types of BGP peer:
– External BGP (EBGP) and Internal BGP (IBGP)
Peering between routers within the same AS: Peering between routers within the same AS:
Internal BGP (IBGP) Internal BGP (IBGP)
18 v1.2
External BGP (EBGP)
• Almost always formed between directly connected peers.
• Multi-hop configuration is required if peers are not directly
connected.
– Loopback peering for load sharing across multiple links to the same
neighboring router
• EBGP advertisement:
– Prepends own ASN to AS Path
– By default, next hop is changed to “self”
• Outgoing interface IP for directly connected peer
• Source interface IP for multi-hop peer
19 v1.2
Internal BGP (IBGP)
• Does not require peers to be directly connected.
– Usually formed between Loopback addresses
– IGP takes care of underlying connectivity
• IBGP advertisement:
– AS Path is not manipulated
– By default, next hop is unchanged
20 v1.2
IBGP Full Mesh
• Each IBGP router must peer directly with every other IBGP
router.
• S = n (n - 1) / 2
– “S” represents total number of IBGP sessions
– “n” represents total number of IBGP routers
22 v1.2
BGP in Service Provider Networks
• Routing the Internet.
– EBGP handles routing between different ASes in the Internet
– IBGP handles customer routes and Internet routes within each AS
AS65000 AS65001
The Internet
AS64512
23 v1.2
BGP in Service Provider Networks
• Relationship between ASes in the Internet:
– Transit Provider
• Provides Internet access to Transit Customers
• Usually with a paid contract
– Transit Customer
• Gets Internet access from Transit Providers
• Usually with a paid contract
– Peer
• Networks exchange traffic with each other
• Peering itself is usually free of charge
• Infrastructure expense is covered by one party or shared by multiple parties
24 v1.2
BGP in Service Provider Networks
• Runs as a signaling protocol for MPLS services.
– Layer 3 VPN (VPNv4, VPNv6)
– Layer 2 VPN (VPLS, EVPN)
AS65000 AS65001
MPLS VPN
AS64512
25 v1.2
BGP in Enterprise Networks
• Used for routing to the Internet Global Internet
when getting IP Transit from the
Internet Service Provider (ISP). ISP1 EBGP
ISP2
– Single-homed (Peering)
26 v1.2
BGP in Enterprise Networks
• IP Transit routing table options: Global Internet
– Full route
• Receives global routing table for the Internet ISP1 ISP2
EBGP
– 880k IPv4 prefixes or 120k IPv6 prefixes (June 2021)
(Peering)
• Provides full load sharing capability
• Requires huge memory space
– Partial route EBGP EBGP
(Transit) (Transit)
• Receives only specific prefixes from the ISP
• Provides limited load sharing capability IBGP
28 v1.2