11.1 BGP Roles, AS Numbers and TCP Transport
Key Takeaways
BGP is a path-vector protocol carried over TCP destination port 179.
Private ASN ranges are 64512–65534 and 4200000000–4294967294.
AS_TRANS 23456 and AS4_PATH provide interoperability with legacy two-octet ASN speakers.
BGP Operations & Peering Mechanics
The Border Gateway Protocol (BGP-4), defined in RFC 4271, is the standard Exterior Gateway Protocol (EGP) of the global Internet and modern enterprise routing infrastructures. While Interior Gateway Protocols (IGPs) like OSPF and IS-IS calculate the shortest topological path within an administrative domain using link metrics, BGP is designed to exchange routing reachability information between independent routing domains—called Autonomous Systems (AS)—under strict administrative, business, and security policies.
In enterprise networks, BGP is deployed at the Internet edge to facilitate multi-homing to multiple Internet Service Providers (ISPs), across redundant WAN backbones connecting distributed campuses, and within modern data center Clos architectures utilizing EVPN-VXLAN overlays.
1. BGP Architecture & Enterprise Roles
BGP is fundamentally classified as a path-vector routing protocol. Unlike distance-vector protocols that evaluate hops blindly without topological context, BGP maintains the complete sequence of Autonomous System numbers that an advertisement has traversed in its AS_PATH attribute. This path-vector mechanism guarantees loop prevention across the global Internet: if a router observes its own local AS number within an incoming route advertisement, it immediately discards the route.
+---------------------------------------------------------------------------------------------------+
| ENTERPRISE MULTI-HOMING WITH BGP |
| |
| +------------------+ +------------------+ |
| | Upstream ISP A | | Upstream ISP B | |
| | AS 64496 | | AS 64497 | |
| +------------------+ +------------------+ |
| ^ ^ |
| EBGP | (TTL=1) EBGP | (TTL=1) |
| v v |
| +------------------+ +------------------+ |
| | Edge Router R1 |=========| Edge Router R2 | |
| | (AS 65000) | IBGP | (AS 65000) | |
| +------------------+ (TTL=255+------------------+ |
| \ / |
| \ Core / IGP / |
| +-----------------------+ |
| | Enterprise Campus | |
| +-----------------------+ |
+---------------------------------------------------------------------------------------------------+
Primary Enterprise Use Cases
- Internet Multi-Homing: Connecting to two or more ISPs to provide path redundancy, load distribution, and failover survivability. Enterprise edge routers exchange customer prefixes and receive either a full Internet routing table (over 950,000 IPv4 routes), a partial table (ISP direct routes + customer routes), or a simple default route (
0.0.0.0/0) accompanied by provider summaries. - Data Center Fabrics: BGP (often eBGP per rack or tier) serves as the scalable underlay and overlay control plane in modern spine-and-leaf fabrics, replacing complex IGP configurations.
- Inter-Data Center Interconnects (DCI): Extending Layer 2 and Layer 3 virtualization across geographically disparate enterprise sites using BGP-signaled overlays (such as EVPN).
2. Autonomous System Numbers (ASN)
An Autonomous System (AS) is a collection of connected IP routing prefixes under the control of one or more network operators on behalf of a single administrative entity, presenting a clearly defined interior routing policy to the Internet.
2-Byte vs. 4-Byte ASNs
Originally, RFC 1771 allocated 16-bit (2-byte) integers for Autonomous System Numbers, providing a ceiling of 65,535 ASNs. As the Internet expanded exponentially, IETF introduced 32-bit (4-byte) AS numbers in RFC 4893 and RFC 6793, expanding the address space to 4,294,967,295 ASNs.
+---------------------------------------------------------------------------------------------------+
| AUTONOMOUS SYSTEM NUMBER (ASN) RANGES & ALLOCATIONS |
+-----------------------+-----------------------------+---------------------------------------------+
| ASN Category | 2-Byte (16-bit) Range | 4-Byte (32-bit) Extended Range |
+-----------------------+-----------------------------+---------------------------------------------+
| Public ASNs | Allocated non-reserved values | 65,552 - 4,199,999,999 (subject to IANA allocation/reservations) |
| Documentation / RFC | 64,496 - 64,511 (RFC 5398) | 65,536 - 65,551 (RFC 5398) |
| Private ASNs | 64,512 - 65,534 | 4,200,000,000 - 4,294,967,294 |
| Reserved Special | 0 and 65,535 | 4,294,967,295 |
+-----------------------+-----------------------------+---------------------------------------------+
Representation Formats and Transition Mechanics
- asplain: Displays 4-byte numbers as a single, flat decimal integer (e.g.,
65536or4200000000). This is the native, default format used by Junos OS. - asdot: Displays 4-byte ASNs as two 16-bit values separated by a dot in
high.lownotation, wherehighis the upper 16 bits andlowis the lower 16 bits. For example, ASN65536is represented as1.0().
To ensure backward compatibility between modern 4-byte BGP speakers and legacy 2-byte routers, RFC 4893 introduced AS_TRANS (reserved ASN 23456). When a modern BGP speaker advertises a 4-byte ASN to an older 2-byte peer, it substitutes 23456 in the traditional 2-byte AS_PATH attribute and encodes the true 32-bit path in a newly defined transitive attribute named AS4_PATH. This allows legacy peers to forward traffic without corrupting 4-byte path-vector integrity.
3. TCP Transport Mechanics (Port 179)
Unlike IGPs such as OSPF (which encapsulates directly into IP protocol 89) or IS-IS (which runs natively over Layer 2 frames), BGP relies entirely on the Transmission Control Protocol (TCP) for reliable, sequenced, and flow-controlled transport. BGP communicates over TCP destination port 179.
Because TCP requires an underlying unicast IP path, BGP does not implement periodic Hello broadcasting or multicasting for neighbor discovery. The examples use explicitly configured neighbors. Junos also supports configured dynamic-neighbor/listen mechanisms; ordinary BGP does not discover arbitrary peers with Hello multicasts. Either router can initiate the three-way TCP handshake (SYN, SYN-ACK, ACK) toward port 179 using a random ephemeral source port.
Once the TCP connection is established, the BGP state machine begins exchanging protocol messages. If underlying IP routing fails or a firewall drops TCP port 179, BGP cannot advance past initial connection states.
What is the role of AS_TRANS (23456) when communicating a four-octet ASN path through a legacy two-octet BGP speaker?
It identifies the OSPF area that carries BGP packets
It replaces every private ASN with a public ASN permanently
It represents an ASN that cannot fit in the two-octet field while AS4_PATH carries the additional path information
It encrypts BGP OPEN messages during TCP establishment
Sections you finish are checked off in the contents.