How the Internet works

Routing, chapter 15 of 36

BGP: The Protocol That Holds It Together

Nothing in the 54-octet UPDATE proved that AS64505 holds 192.0.2.0/24, and border1 believed it anyway.

Our SYN leaves border1 with a TTL of 60 and crosses the peering LAN toward 203.0.113.20. The route that sent it there arrived earlier over a TCP connection to port 179: a prefix, 192.0.2.0/24, the list of networks the announcement had crossed, one entry long, and an address to forward to. border1 passed it on to the four other routers of AS64500, and bng1 now holds two routes to the same prefix.

1,091,990
IPv4 prefixes in the CIDR Report of 12 November 2026. Merit counted 173 routes in July 1988
1989
the IETF lunch where Lougheed and Rekhter sketched the Two Napkin Protocol
180 s
FRR 10.7.1's default hold time in its traditional profile, which its code calls an RFC default. RFC 4271 suggests 90

The decision process as a machine

The two routes to 192.0.2.0/24 fall through the tie-breakers of RFC 4271, Section 9.1.2.2 in order. Change an attribute, switch off next-hop-self or ADD-PATH, or move to another router.

What does the UPDATE for 192.0.2.0/24 say?

An UPDATE has three parts: prefixes to withdraw, path attributes, and the prefixes that share them, the NLRI (RFC 4271, Section 4.3). Ours carries ORIGIN IGP, an AS_PATH with the single AS 64505 in four octets, NEXT_HOP 203.0.113.20, and Only to Customer (OTC) with AS 64505, which AS64505 adds to every route it sends to a peer (RFC 9234, Section 5).

An unrecognized optional transitive attribute should be accepted and passed on with the partial bit set. New attributes can cross routers that predate them, and a broken attribute travels equally far before any router checks it.

Why carry a list of networks instead of a distance?

A list lets a router detect loops, which a distance cannot do. A speaker excludes every route whose AS_PATH contains its own AS number (RFC 4271, Section 9.1.2), so an announcement that comes back around is dropped on arrival instead of counting to infinity as RIP did. The list also lets each network judge a route by who carried it.

Geoff Huston still calls BGP "a Bellman-Ford distance vector routing algorithm" [Huston2026]. The path ends counting to infinity, but it does not stop a router from trying many dead paths in turn, which is where convergence time goes.

How does the route get from border1 to bng1?

Over internal sessions, with different rules: AS_PATH stays unchanged, LOCAL_PREF is added, and NEXT_HOP would stay 203.0.113.20 by default (RFC 4271, Section 5.1.3), an address that IS-IS in AS64500 does not know. So border1 puts its own loopback there, a setting operators call next-hop-self.

No speaker may pass on a route learned from one internal peer to another (RFC 4271, Section 9.2), and RFC 4271 assumes sessions between all speakers of an AS. Together the rules demand a full mesh, n(n-1)/2 sessions: 10 for AS64500, 4,950 for 100 speakers (RFC 4456, Section 1). A route reflector removes it but reflects only its best path.

Which of the two routes does bng1 choose?

bng1 holds border1's route and one from border2 with AS_PATH 64510 64505, learned from the transit provider. LOCAL_PREF ties at 100, and the exchange wins on the next step because its path is one AS shorter (RFC 4271, Section 9.1.2.2). Had the paths been equally long, the IGP costs would have tied at 20, and the lower BGP Identifier, border1's 198.51.100.253, would have decided.

Under the base specification bng1 would not know the transit route: border2 prefers border1's route and may advertise only what it uses. ADD-PATH (RFC 7911) on border2's internal sessions lets it send its own as well.

What happens to an UPDATE that a router cannot parse?

Under RFC 4271, Section 6, nearly every error ends the session, which withdraws every route the peer had sent. On 27 August 2010 the RIPE NCC announced a prefix with an optional transitive attribute that was "in accordance with the BGP specification" and "had never been announced on the Internet before". Some Cisco models corrupted it while passing it on, their peers dropped the sessions, and unstable prefixes peaked at almost 4,500 [Romijn2010].

RFC 7606 (2015) replaced the reset with milder responses for most cases. A reset remains where the prefixes cannot be located at all (RFC 7606, Section 3), hence MP_REACH_NLRI's place up front.

Why does the Internet take minutes to agree?

The MinRouteAdvertisementIntervalTimer (MRAI) sets the minimum time between two advertisements for the same destination to the same peer (RFC 4271, Section 9.2.1.1). Suggested values are 30 seconds toward external peers and 5 toward internal ones (RFC 4271, Section 10).

When a prefix disappears, a router falls back to the next path it has heard, advertises it, and later learns that this path depended on the same failure, one MRAI round after another. Labovitz and colleagues injected several hundred thousand faults at exchange points, and failovers averaged three minutes [Labovitz2000].

border1 203.0.113.10AS64505 203.0.113.20 TCP handshake to port 179OPEN AS 64500, hold 90OPEN AS 64505, hold 180KEEPALIVE, which confirms the OPENKEEPALIVE, then UPDATE 192.0.2.0/24
From the book: The session between border1 and AS64505's router at the IXP

The book keeps asking

This chapter has 5,615 words and 13 questions. These 7 are answered only in the book and the audiobook.

  • How do two routers start talking BGP?
  • What does border1 put into its OPEN?
  • What are communities for?
  • How do a policy change and a restart avoid tearing down routes?
  • Why was flap damping switched off, and why is it back?
  • What does a new external session accept before anyone writes a policy?
  • How big is the table now?

Open the sources

  • RFC 4271 A Border Gateway Protocol 4 (BGP-4) 2006, Draft Standard
  • RFC 5492 Capabilities Advertisement with BGP-4 2009, Draft Standard
  • RFC 4760 Multiprotocol Extensions for BGP-4 2007, Draft Standard
  • RFC 6793 BGP Support for Four-Octet Autonomous System (AS) Number Space 2012, Proposed Standard
  • RFC 4456 BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP) 2006, Draft Standard
  • RFC 7606 Revised Error Handling for BGP UPDATE Messages 2015, Proposed Standard
  • RFC 8212 Default External BGP (EBGP) Route Propagation Behavior without Policies 2017, Proposed Standard
  • [OpenBGPD2026] OpenBGPD 9.3 in the OpenBSD source tree, usr.sbin/bgpd, -current (commit 21ea132db7ea, 1 November 2026) 2026, free

All 51 documents this chapter cites, each with a link to its publisher and a copy kept here.

Routing, chapter 16 of 36

Peering, Transit, and the Money

Routing, chapter 17 of 36

Securing the Routing System

Routing, chapter 18 of 36

MPLS and Segment Routing

Routing, chapter 19 of 36

Anycast and CDNs

Transport, chapter 20 of 36

UDP: Eight Bytes of Header

Transport, chapter 21 of 36

TCP: The Connection

Transport, chapter 22 of 36

Congestion Control: From Collapse to BBR

Transport, chapter 23 of 36

Beyond TCP: SCTP, DCCP, and Multipath

Names and Trust, chapter 24 of 36

DNS: The Namespace and the Wire Format

Names and Trust, chapter 25 of 36

Resolvers, DNSSEC, and Encrypted DNS

Names and Trust, chapter 26 of 36

TLS 1.3: The Handshake

Names and Trust, chapter 27 of 36

Certificates and the Web PKI

Applications, chapter 28 of 36

HTTP: Semantics and HTTP/1.1

Applications, chapter 29 of 36

HTTP/2: Multiplexing over One Connection

Applications, chapter 30 of 36

QUIC: A Transport in Userspace

Applications, chapter 31 of 36

HTTP/3: The Web on QUIC

Applications, chapter 32 of 36

Mail: SMTP and Forty Years of Patches

Applications, chapter 33 of 36

Time, Shells, and Files: NTP, SSH, Telnet, and FTP

The Whole Path, chapter 34 of 36

Measuring and Debugging the Path

The Whole Path, chapter 35 of 36

The Whole Journey, Byte by Byte

The Whole Path, chapter 36 of 36

Ossification and What Comes Next

You have reached the server. The book goes further.

Everything on this site is a short version. Follow the Packet is the long one: 36 chapters and about 280,000 words, with every protocol fact traced to the section of the standard that defines it, every byte dump built by a script you can run, and a directory of more than a thousand cited documents. It comes as a printable book and as an audiobook.

Hear how chapter 1 opens. 70 seconds, narrated by a synthetic voice.

Get the book or the audiobook Read the start of chapter 1 Browse every source

Cover of Follow the Packet: How the Internet Works, Layer by Layer, from ARPANET to QUIC, by Wolfgang Kerschbaumer

The signup uses double opt-in. Every message includes an unsubscribe link.

Published by Sysinit Press. The public addresses, AS numbers and names of the scenario come from ranges reserved for documentation, and the home network uses private addresses, so the site describes no real network. RFC texts are copied unchanged from the RFC Editor.