BGP: the internet's map
The internet is thousands of separate networks, and none of them sees the whole map. Follow one address block, 203.0.113.0/24, as its owner announces it with BGP: every network adds its own number to the AS_PATH, a loop is spotted and dropped, your ISP picks a path by policy, and when a link breaks the route is withdrawn and traffic finds another road.
5 quick questions
Pick an answer to see why. Your score saves with your progress.
01B receives an announcement for 203.0.113.0/24 with AS_PATH 64496 and passes it on to D. What AS_PATH does D see?
Over eBGP, the sender puts its own AS number in front of the path. B is AS64497, so D hears 64497 64496. D adds its own number only when it passes the route on.
02A receives an update whose AS_PATH is 64497 64496. A is AS64496. What does it do?
Finding your own AS number in the AS_PATH means the route has gone round in a loop. BGP routers ignore such routes (RFC 4271 §9.1.2).
03D hears two routes of the same length: one from B, a peer it does not pay, and one from C, a provider it pays. Which does it usually pick, and why?
Local preference is checked before AS_PATH length. Most networks prefer customer routes, then peer routes, then provider routes, because that keeps their costs down.
04Which transport does BGP use between two routers?
BGP-4 runs over a TCP connection to port 179. TCP gives it reliable, in-order delivery, so BGP only has to send changes.
05The A-B link breaks and B has no other route to 203.0.113.0/24. What does B send to D?
An UPDATE message can carry withdrawn routes as well as new ones. D removes the route through B and falls back to its route through C.
Glossary
- Autonomous system (AS)
- A network run by one organisation with one routing policy, such as an ISP, a cloud provider or a university.
- AS number (ASN)
- The number that identifies an AS in BGP. Numbers 64496 to 64511 are reserved for examples like this lesson.
- BGP
- Border Gateway Protocol, version 4: how ASes tell each other which address blocks they can reach.
- eBGP / iBGP
- External BGP runs between two different ASes; internal BGP shares those routes between routers inside one AS.
- Prefix
- A block of IP addresses written with its length, like 203.0.113.0/24. BGP announces prefixes, not single addresses.
- AS_PATH
- The list of AS numbers an announcement has passed through, newest first. Used to spot loops and to compare routes.
- Local preference
- A number a network gives its own routes to rank them by policy. Higher wins, and it is checked before path length.
- Withdrawal
- The part of an UPDATE message that says a prefix can no longer be reached through the sender.
Notes and sources
- AS numbers 64496-64511 (RFC 5398) and the prefixes 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 (RFC 5737) are reserved for documentation.
- "More than 75,000 ASes" is the number seen in the global routing table; it grows every week.
- Local preference values 200 / 100 / 50 are illustrative. Each network sets its own, usually customer > peer > provider.
- Inside an AS, iBGP passes routes between its own routers without adding the AS number again.
- A router that carries the full internet table holds about a million IPv4 routes, all learned this way.
- RFC 4271: A Border Gateway Protocol 4 (BGP-4)
- RFC 6793: BGP support for four-octet AS numbers
- RFC 5398: AS number reservation for documentation use
- RFC 5737: IPv4 address blocks reserved for documentation
- RFC 9234: Route leak prevention using roles in UPDATE and OPEN messages
- The CIDR Report (weekly counts of ASes and prefixes)
Quiz Unlocks after the last step.