BGP and RPKI: How Autonomous Systems Route the Internet — and How Cryptographic Signing Secures It

Every packet that travels across the Internet — from a search query typed into a phone in Paris to a video stream from a server on the other side of the world — crosses a series of decisions made by autonomous systems that do not trust each other. The Internet is not a single network run by a single owner; it is a federation of roughly 100,000 independently operated networks, each with its own policies, its own hardware, and its own business reasons for choosing one path over another. The protocol that coordinates these independent decisions is the Border Gateway Protocol, or BGP. The system that increasingly tries to make those decisions verifiable is the Resource Public Key Infrastructure, or RPKI. Together they describe the central design problem of the modern Internet: how to route data across a public, heterogeneous, and adversarially exposed network while keeping its routing information honest.

The Three-Napkin Protocol

BGP begins as a back-of-an-envelope idea. In June 1989, Kirk Lougheed (Cisco Systems) and Yakov Rekhter (T.J. Watson Research Center, IBM Corp.) published the protocol as RFC 1105, a specification often remembered as the “Three-Napkin Protocol” because it was designed on three napkins, as the authors themselves have recalled. The problem it addressed was practical: the Internet was growing, and the internal routing protocols that handled traffic inside a single organization — protocols like RIP and OSPF — could not scale across the entire network. Those protocols were built around the assumption that a network was a single administrative unit, with one coherent view of the topology. The Internet had no such unit. It was a loose collection of autonomous systems, each free to route however it liked, linked by a small number of external connections.

RFC 1105 defined a simple model: each autonomous system advertises the network prefixes it owns, and other autonomous systems advertise what they can reach and through whom. There is no central authority deciding what is true. Instead, each router trusts the route information it receives from its direct neighbors — and passes it on. This trust model is the source of both BGP’s flexibility and its fragility. The protocol deliberately trades correctness guarantees for reachability: if a peer tells you a path exists, you will use it, because there is no other way to learn about the rest of the Internet.

From the Napkins to BGP-4

The original design grew. By March 1995, the specification became RFC 1771, commonly known as BGP-4. BGP-4 introduced several mechanisms that remain central today: the distinction between interior (inside an autonomous system) and exterior (between autonomous systems) routing, the AS_PATH attribute — a list of the autonomous system numbers a route has traversed, which both prevents loops and reveals the path a packet would follow — and the NEXT_HOP attribute, which tells receiving routers the next address to use when forwarding traffic for a prefix. The NEXT_HOP is subtle but crucial: a receiving router may not actually be able to reach the advertised prefix directly, so it needs to know where to send the packet next, and in an eBGP scenario that address is typically the advertising peer itself.

BGP-4 also formalized the concept of peering. Two autonomous systems can establish a BGP session directly — an eBGP session — and exchange routes. Alternatively, an autonomous system can purchase transit: a larger network will carry traffic on behalf of a smaller one, and the smaller network will advertise its prefixes through that transit provider. This peering-versus-transit distinction shapes the economics and politics of the Internet. A company that peers with another pays a fixed fee (or nothing) and gets direct connectivity; a company that buys transit pays for capacity but gains a route to the whole Internet. The AS_PATH mechanism is what lets each network tell the story of how a prefix was learned, and why it might be a poor or expensive path.

By 2006, the specification had been updated to RFC 4271 (January 2006), which obsoleted RFC 1771 and introduced additional path-selection attributes and the ability to carry more information in the path vector. CIDR — Classless Inter-Domain Routing — was the key companion concept. Before CIDR, IP addresses were assigned in rigid classes (A, B, and C), which wasted large blocks of address space. CIDR, formalized around the same era, allowed prefixes to be assigned at arbitrary lengths, which is what allowed the Internet to allocate addresses efficiently and aggregate routes. BGP-4 with CIDR is the combination that made the modern Internet’s address space usable at scale.

Autonomous System Numbers: The Internet’s Names

An autonomous system is identified by an Autonomous System Number (ASN), a number that uniquely identifies the network that originates or propagates a route. The original ASN space was 16 bits wide — 65,535 possible numbers — which proved insufficient as the Internet grew. 4-octet (32-bit) ASNs were first specified in RFC 4893 (May 2007) and updated by RFC 6793 (December 2012). The IANA AS Numbers registry tracks the allocation of these numbers. The 32-bit expansion matters because the Internet has grown far beyond the original 16-bit assumption; many large networks now operate with 32-bit numbers, and the protocol supports both, with the path vector carrying the appropriate width.

The AS_PATH attribute is the Internet’s version of a postal routing slip. It records the sequence of ASNs that a route has traversed. When a router receives a BGP update, it prepends its own ASN to the AS_PATH and advertises the route to its neighbors. This has two critical effects. First, it prevents routing loops: if a router sees its own ASN already in the AS_PATH, it rejects the route. Second, it reveals the path: by inspecting the AS_PATH, a router can understand how a prefix was learned and decide whether to trust it. The AS_PATH is also the mechanism by which a network can refuse traffic: if a route passes through an ASN that you do not want to carry, you can decline it.

How a Route Actually Travels

To understand why the AS_PATH matters, it helps to trace a single route through the system. A small network — say, an academic department with its own ASN and a handful of prefixes — needs to reach the rest of the Internet. It establishes an eBGP session with a transit provider, and announces its prefixes. The transit provider prepends its own ASN to the AS_PATH and advertises the route to its own upstream providers. Each hop along the way adds its own ASN. By the time the route reaches a distant router, the AS_PATH is a long list: the department’s ASN, the transit provider’s ASN, the transit provider’s upstream ASN, and so on. A router receiving this route can see the full chain of networks that have carried the traffic, and can decide whether to trust the path.

AS_PATH: 64512 64513 64514
NEXT_HOP: 192.0.2.1
Prefix: 203.0.113.0/24

The NEXT_HOP attribute is what makes the path actionable. A router that receives a route for 203.0.113.0/24 does not necessarily have a direct connection to that prefix. It needs to know where to send the packet next. The NEXT_HOP tells it: send to 192.0.2.1, which is the advertising peer. In an eBGP session, the NEXT_HOP is typically the peer itself; in an iBGP session, it can be the address of a router further along the path. This is the mechanism that lets a router build a forwarding decision without having a direct link to the destination.

The Trust Problem

The fundamental weakness of BGP is that it is a trust-based protocol. Each router trusts its neighbors, and passes on what they tell it. There is no cryptographic proof that a prefix is actually owned by the autonomous system that claims it. This is not a flaw in the sense of a bug; it is a deliberate design consequence of the three-napkin simplicity. But it has real consequences.

The most famous incident occurred in 2008, when Pakistan Telecom — a national ISP — accidentally advertised prefixes belonging to YouTube. The announcement propagated across the Internet, and YouTube was effectively unreachable for hours. The cause was not a sophisticated attack; it was a configuration error. A single BGP announcement, made by one network, caused a global outage. This is the inherent risk of a trust-based routing protocol: the Internet’s routing information is only as reliable as the weakest network in the chain.

A more recent example came in 2021, when a widespread Facebook outage was traced to a BGP-related configuration issue. The outage disrupted access to Facebook and its associated services for a large fraction of the Internet. Again, the mechanism was not a hack; it was a routing error. The scale of the outage was a reminder of how much of the modern Internet depends on a handful of routing decisions, and how fragile that dependency can be.

RPKI: Cryptographic Signing of Routing Information

The Resource Public Key Infrastructure — RPKI — was designed to address the trust problem directly. The idea is to let an autonomous system cryptographically sign a statement about the prefixes it owns, and to let other networks verify that statement before trusting the route. This is not a replacement for BGP; it is an addition, a layer of verification that can be applied to BGP announcements.

The core mechanism is the Route Origin Authorization, or ROA. A ROA is a cryptographically signed object that says: “This autonomous system is authorized to originate this prefix.” The ROA is signed using a certificate from the RPKI hierarchy, which is built on a chain of trust rooted in certificates issued by a small set of credential authorities. The RFC 6480 specification (February 2012) defines the overall RPKI architecture — “An Infrastructure to Support Secure Internet Routing” — while the certificate profile is defined in RFC 6487. The RFC 6811 specification defines origin validation — the process by which a router checks a BGP announcement against the ROA for the prefix in question. If the announcement matches the ROA, the router can accept it as valid; if it does not match, the router can reject it or mark it as suspect.

Origin validation is the key operation. When a router receives a BGP announcement for a prefix, it can check the announcement against the ROA for that prefix. If the announcement’s origin ASN matches the ROA’s authorized origin ASN, the announcement is valid. If the announcement does not match, it is invalid — and the router can reject it. There is also a third state: unknown, when no ROA exists. The policy decision — whether to reject unknown routes, accept them, or treat them as suspect — is left to the network operator. This is deliberate: the RPKI is a verification layer, not a routing protocol, and it does not force any particular policy.

The deployment of RPKI has been gradual. Not all networks operate ROAs, and the RPKI is not universally enforced. But it has grown steadily, and many large networks now operate origin validation. The system is designed to be opt-in at the network level: a network can choose to reject invalid routes, or to accept them with a warning, or to ignore the ROA entirely.

BGPsec: Cryptographic Signing of the Path

RPKI verifies the origin of a route — who is authorized to announce it — but it does not verify the path itself. The AS_PATH is still untrusted. An attacker could still announce a route with a valid origin ASN but a fabricated AS_PATH, and the RPKI would not catch it. BGPsec, specified in RFC 8205 (2017), addresses this gap by cryptographically signing the AS_PATH itself. BGPsec uses a chain of signatures, one per autonomous system, to prove that each segment of the path was traversed by the claimed ASN. This is a much stronger guarantee than the RPKI provides: not just the origin, but the entire path, is cryptographically verified.

BGPsec is not deployed at scale. The complexity of the protocol — each autonomous system must sign its segment, and the signatures must be validated by every router — has made adoption slow. But it represents the natural end of the RPKI line of thought: not just verifying the origin, but verifying the entire route.

The Bigger Picture

BGP and RPKI together describe the Internet’s central design tension: the need for global reachability versus the need for trust. BGP provides the reachability — the ability for any autonomous system to learn about any other autonomous system, and to route traffic across the federation. RPKI provides the trust — a cryptographic layer that allows networks to verify the claims made by other networks. Neither is a complete solution: BGP remains a trust-based protocol, and RPKI remains a partially deployed verification layer. But together they represent the most sophisticated effort to make the Internet’s routing information verifiable.

The historical arc is instructive. From a three-napkin protocol in 1989, to BGP-4 in 1995, to RFC 4271 in 2006, to 32-bit ASNs in 2007-2012, to RPKI in 2012-2013, to BGPsec in 2017 — each step has been an attempt to preserve the Internet’s global reach while adding more structure and more verification. The Internet is still not a single network, but it is getting closer to being a trustworthy one. The next generation of protocol work — including BGPsec adoption and the continued growth of origin validation — will determine how much of the trust problem can be solved cryptographically, and how much will remain a matter of policy and trust.

The Internet is not a single network. It is a federation of autonomous systems, and BGP is the protocol that coordinates them. RPKI is the attempt to make that coordination verifiable.

For more on how the Internet’s names and addresses evolved, see our article on DNS and domain names. For the physical and logical infrastructure that underlies all of this, see the invisible backbone. For the encryption layer that protects traffic once it reaches its destination, see SSL/TLS encryption.