You are on page 1of 28

Border Gateway Protocol (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

• Routing within an AS is taken care by common IGP.


• Routing between ASes is handled by EGP.
3 v1.2
Dynamic Routing Protocol Classification
Dynamic Routing
Protocols

Interior Gateway Exterior Gateway


Protocol (IGP) Protocol (EGP)

Distance-Vector
Link-State Protocol Path-Vector Protocol
Protocol

RIP IGRP OSPF IS-IS BGP

EIGRP

4 v1.2
Autonomous System Number (ASN)
Range ASN Description Reference
0 Reserved RFC1930, RFC7607

1 – 64495 (except 23456) Public Internet

16-bit range 23456 Represents 32-bit ASN in 16-bit world RFC6793


0 – 65535 64496 – 64511 Documentation RFC5398

64512 – 65534 Private use RFC1930, RFC6996

65535 Reserved RFC7300

65536 – 65551 Documentation RFC4893, RFC5398

65552 – 131071 IANA Reserved ASNs


32-bit range
65536 – 4294967295 131072 – 4199999999 Public Internet
(RFC4893)
4200000000 – 4294967294 Private use RFC6996

4294967295 Reserved RFC7300

5 v1.2
Border Gateway Protocol (BGP)
• An Exterior Gateway Protocol (EGP).
• Designed for exchanging routing information between
different Autonomous Systems.

Exterior Gateway Protocol (EGP)


AS65000 Border Gateway Protocol (BGP) AS65001

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

Rejects prefix 172.18.1.0/24 Prepends 65001 to the path


due to own ASN is in the path AS64512 of prefix 172.18.1.0/24
AS_PATH: 64512 65001 65000 AS_PATH: 65001 65000

Prepends 64512 to the path Receives


of prefix 172.18.1.0/24 prefix 172.18.1.0/24
AS_PATH: 64512 65001 65000 AS_PATH: 65001 65000
10 v1.2
Introduction to BGP

BGP-4 & MP-BGP

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

• RFC1105: A Border • RFC1163: A Border • RFC1267: A Border • RFC1654: A Border


Gateway Protocol Gateway Protocol Gateway Protocol 3 Gateway Protocol 4
(BGP) (BGP) (BGP-3) (BGP-4)
• June 1989 • June 1990 • October 1991 • July 1994

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)

• Each network layer protocol is distinguished and serviced


differently by an individual Address Family.

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”

• MP-BGP supports multiple Address Families.


• MP-BGP processes information and behaves based on the
features of each Address Family.
– For example, when Address Family is IPv4 Unicast (AFI = 1, SAFI = 1)
• BGP installs received IPv4 prefixes into IPv4 Unicast routing table
• BGP verifies whether a matching IPv4 route exists in the IPv4 Unicast routing table
before advertising an IPv4 prefix

15 v1.2
AFIs and SAFIs
AFI Description Reference SAFI Description Reference
1 IPv4 1 Unicast RFC4760

2 IPv6 2 Multicast RFC4760

25 L2VPN RFC4761, RFC6074 4 MPLS Label RFC8277

16388 BGP-LS RFC4364, RFC8277 5 MCAST-VPN RFC6514

65 VPLS RFC4761, RFC6074


• Lists of AFIs and SAFIs maintained
by IANA: 66 BGP MDT RFC6073

– Address Family Numbers 70 BGP EVPNs RFC7432

• https://www.iana.org/assignments/address- 71 BGP-LS RFC7752


family-numbers/address-family-numbers.xhtml
72 BGP-LS-VPN RFC7752
– Subsequent Address Family Identifiers
(SAFI) Parameters 128 L3VPN Unicast RFC4364, RFC8277
• https://www.iana.org/assignments/safi- 129 L3VPN Multicast RFC6513, RFC6514
namespace/safi-namespace.xhtml
16 v1.2
Introduction to BGP

EBGP & IBGP

17 v1.2
EBGP & IBGP
• There are two types of BGP peer:
– External BGP (EBGP) and Internal BGP (IBGP)

Peering between routers from different ASes


AS65000 External BGP (EBGP) AS65001

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

• Do not run an IGP between EBGP peers.

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

• Requires a full mesh of BGP peers.


– IBGP re-advertises prefixes learned from EBGP peers
– IBGP does not re-advertise prefixes learned from IBGP peers

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

• If there are 10 IBGP routers, then 45 IBGP sessions are


required for a fully mesh IBGP configuration.
– S = 10 (10 - 1) / 2 = 45

• Avoid full mesh: Route Reflection or Confederation


21 v1.2
Introduction to BGP

Use Case of BGP

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)

• Connected to one ISP with only one link


• Does not require a public ASN
EBGP EBGP
– Dual-homed (Transit) (Transit)

• Connected to one ISP with two links IBGP


• Does not require a public ASN
AS64512
– Multi-homed
• Connected to multiple ISPs
• Often implemented with a public ASN

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

– Default route AS64512


• Receives a BGP default route from the ISP, or
point a static default route to the ISP
• All Internet upload traffic will be sent to a single
link or a single ISP
27 v1.2
BGP in Enterprise Networks
• In smaller networks, normally only Global Internet

EBGP is needed for accessing the


Internet. ISP1 EBGP
ISP2
(Peering)

• Intra-AS routing is taken care by


IGP. EBGP EBGP
(Transit) (Transit)
• RIP, OSPF, EIGRP
IBGP

• Larger networks may run IBGP in AS64512


case their IGP is not scalable.

28 v1.2

You might also like