01 BGP Overview
BGP (Border Gateway Protocol) is the routing protocol that runs the Internet. It is an Exterior Gateway Protocol (EGP): its job is to learn, advertise, and select paths between different Autonomous Systems across the Internet. BGP is classified as a path-vector protocol, because it selects paths based on a list of Autonomous Systems to cross plus a rich set of Path Attributes, not on a single cost metric.
Autonomous Systems (AS)
Every router on the Internet belongs to an Autonomous System, and every AS is managed by some authority. An AS is a network (or group of networks) under a single administrative control.
- AS numbers (ASN) are globally assigned and unique on the public Internet. Two organizations cannot use the same public ASN.
- Original ASNs were 16-bit: range 0 to 65535.
- 32-bit ASNs were introduced by RFC 6793 (which obsoleted the older RFC 4893), extending the range up to 4,294,967,294.
- Private ASN ranges exist for internal use, valid only as long as they are not advertised to the public Internet:
- 16-bit private: 64512 to 65535
- 32-bit private: 4,200,000,000 to 4,294,967,294
Private networks and the global table
BGP does not carry private (RFC 1918) networks in the global Internet routing table. However, BGP is still widely used internally with private addressing inside enterprises and in MPLS VPN environments. The “no private networks” rule applies to the public Internet, not to BGP as a protocol.
Transport and encapsulation
BGP messages are encapsulated inside TCP and use port 179. This is a key difference from IGPs:
- BGP relies on TCP for reliable, ordered delivery, so it does not implement its own reliability like OSPF or EIGRP do.
- BGP messages are unicast (one-to-one), unlike OSPF/EIGRP which use multicast.
ETH | IP | TCP | BGP | ETH
Peers (neighbors)
To exchange routes, BGP requires a manually configured relationship called a peer (or neighbor).
- Peers are not discovered dynamically. The administrator must explicitly define each neighbor.
- There are two types of peers: Internal BGP (iBGP) and External BGP (eBGP), covered in note 02.
What BGP exchanges
- BGP advertises Network Layer Reachability Information (NLRI): the reachable prefixes.
- BGP does not exchange link-state information the way OSPF does. Peers do not share a full topology map.
- BGP can carry more than just IPv4 prefixes (see MP-BGP, note 27).
- To choose the best path, BGP uses Path Attributes instead of a single metric. A router is not forced to use the lowest-cost path the way an IGP is.
Administrative Distance
BGP routes carry different AD values depending on the peer type:
| Route source | Administrative Distance |
|---|---|
| eBGP | 20 |
| iBGP | 200 |
The low eBGP AD (20) means externally learned BGP routes are preferred over most IGP routes, while the high iBGP AD (200) means internal BGP routes are less trusted than IGP routes.
Self-check
Q1 — What type of routing protocol is BGP?
A) A link-state protocol like OSPF
B) A distance-vector protocol like RIP
C) A path-vector protocol
D) An Interior Gateway Protocol
Respuesta
C is correct. BGP is a path-vector protocol: it selects paths using a list of Autonomous Systems to cross plus Path Attributes, not a single metric.
- A) False — link-state (topology map + SPF) describes OSPF, not BGP.
- B) False — BGP is not simple hop-count distance-vector; it carries a full AS path plus many attributes.
- D) False — BGP is an Exterior Gateway Protocol (EGP); it routes between AS, not within one.
Q2 — Which transport does BGP use, and why?
A) UDP port 179, for speed
B) TCP port 179, for reliable delivery
C) IP protocol 89, like OSPF
D) TCP port 179, but it still implements its own reliability
Respuesta
B is correct. BGP runs over TCP port 179; because TCP guarantees reliable, ordered delivery, BGP does not implement its own reliability.
- A) False — BGP does not use UDP; it needs reliable, ordered delivery.
- C) False — IP protocol 89 is OSPF; BGP rides on top of TCP.
- D) False — port is right, reasoning is wrong: BGP relies on TCP precisely so it does NOT need its own reliability.
Q3 — What is the maximum 32-bit ASN, and which RFC introduced it?
A) 65535, RFC 4893
B) 4,294,967,294, RFC 6793
C) 4,294,967,295, RFC 4893
D) 4,200,000,000, RFC 1918
Respuesta
B is correct. 32-bit ASNs reach up to 4,294,967,294 and were introduced by RFC 6793, which obsoleted RFC 4893.
- A) False — 65535 is the old 16-bit maximum.
- C) False — the RFC is outdated; 4893 was obsoleted by 6793.
- D) False — 4,200,000,000 is the start of the 32-bit private range; RFC 1918 is about private IPv4, not ASNs.
Q4 — What are the Administrative Distances for eBGP and iBGP?
A) eBGP 200, iBGP 20
B) eBGP 20, iBGP 200
C) Both 20
D) eBGP 110, iBGP 200
Respuesta
B is correct. eBGP has AD 20 (preferred over most IGPs) and iBGP has AD 200 (less trusted than IGP routes).
- A) False — the values are reversed; external routes carry the low AD.
- C) False — they do not share the same AD; only eBGP is 20.
- D) False — 110 is OSPF’s AD, not eBGP’s.