Networking & Routing

What is BGP?

Also known as: Border Gateway Protocol

Definition

BGP (Border Gateway Protocol) is the path vector routing protocol that networks use to exchange reachability information between autonomous systems on the public internet.

BGP (Border Gateway Protocol) is the inter-domain routing protocol that governs how data packets traverse the public internet. It operates as a path vector protocol, exchanging network layer reachability information (NLRI) between autonomous systems (ASes). BGP version 4, defined in RFC 4271, is the current standard and has been in use since 1994. It is the glue that allows independent networks, such as ISPs, cloud providers, and large enterprises, to advertise their IP address blocks and learn routes to every other network on the internet.

BGP works by establishing TCP sessions on port 179 between routers in different ASes (eBGP) or within the same AS (iBGP). Each BGP speaker maintains a Routing Information Base (RIB) and selects a single best path for each prefix based on a decision process that evaluates attributes like AS_PATH length, MULTI_EXIT_DISC (MED), LOCAL_PREF, and origin type. Updates are incremental and triggered by changes in network topology, making BGP more scalable than distance-vector protocols like RIP. BGP does not have built-in security; the RPKI and BGPsec extensions (RFC 8205) have been developed to address route hijacking and origin validation.

In the broader network stack, BGP sits at the application layer of the TCP/IP model but serves as a routing protocol for the internet layer. It is the only protocol that can handle the scale and policy diversity of the global routing table, which exceeds 950,000 prefixes as of 2024. Edge routers at Internet Exchange Points (IXPs) and ISP peering links run BGP to negotiate which routes to accept or announce, with each AS defining its own routing policies. Without BGP, the internet would fragment into isolated networks unable to route traffic between different administrative domains.

Key facts

  • BGP version 4 is defined in RFC 4271 and updated by RFCs 6286, 6608, 6793, and others.
  • Uses TCP port 179 for reliable session transport between BGP peers.
  • Decision process selects a single best route based on up to 12 attributes in a tie-breaking order.
  • AS_PATH attribute prevents routing loops by listing every AS a route has traversed.
  • Route hijacks remain a risk; RPKI (RFC 6810) helps validate origin AS ownership.

How it works in practice

When you visit a website hosted on a server in another country, your ISP uses BGP to find a path from its AS to the AS that owns the website's IP block. Your ISP may have multiple upstream providers or direct peers; BGP chooses the best route based on business agreements and path length. If a link fails, BGP withdraws the affected routes and converges on an alternate path within seconds to minutes.

Related terms

AS (Autonomous System) eBGP iBGP OSPF RPKI Route Flap Damping IGP (Interior Gateway Protocol)

References

More in Networking & Routing

Anycast

Anycast is a network addressing and routing method where a single IP address is assigned to multiple servers, and routers send traffic to the nearest server based on routing protocol metrics.

AS Path

A BGP path attribute that lists the sequence of autonomous system numbers a route has passed through, used for loop detection and path selection.

ASN

A globally unique 16 or 32 bit number assigned to an autonomous system for use in BGP routing between organizations on the Internet.

Autonomous System

An Autonomous System (AS) is a group of IP networks under a single administrative routing policy, identified by a unique ASN (Autonomous System Number) for exterior gateway routing.

CIDR

CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing packets using variable-length subnet masks (e.g., /24) instead of fixed classful boundaries.

Hop

A hop is one passage of a packet through a router or other layer-3 forwarding device as it travels from source to destination across an internetwork.

IPv4

IPv4 is the core Internet Protocol using 32-bit addresses, providing roughly 4.3 billion unique identifiers for network interfaces on the global internet.

IPv6

IPv6 is the most recent version of the Internet Protocol, using 128-bit addresses to provide an effectively unlimited number of unique identifiers for networked devices.

Latency

Latency (or round-trip time, RTT) is the time required for a packet to travel from a source to a destination and back, measured in milliseconds, and is a critical metric in network performance.

Looking Glass

A looking glass is a public web-based tool that provides read-only access to a network's BGP routing table, ping, and traceroute diagnostics from that network's perspective.

Who Is Online

In total there are 80 users online: 0 registered, 75 guests and 5 bots.

Bots: Facebook Majestic Other Bot Other Spider SemrushBot

Users active in the past 15 minutes. Total registered members: 340