How Two Networks Agree to Talk
Configured by hand, carried over TCP, and silent until it is up
Step 1 of 2 — understand the idea. Read this first and the packet trace will confirm what you already expect, instead of teaching you two things at once.
What you'll be able to do
- ▸Explain why BGP peers are configured rather than discovered
- ▸Explain what BGP gets from running over TCP, and what that makes possible
- ▸Read a peer table and say what each state means about the session
- a shipping company
- → an autonomous system — one organisation's network
- the list of postcodes
- → the prefixes advertised in an UPDATE
- the chain of companies
- → the AS_PATH
- the depot layout nobody shares
- → the internal topology an IGP would flood
- deciding which offer to take
- → the decision process, driven by local policy
Where it breaks down: A shipping company can verify that a partner really does deliver to a postcode — parcels either arrive or they do not, and the invoice says so. Base BGP has no equivalent check: it accepts what a configured peer says about reachability with nothing verifying the claim. That gap is why route hijacks work and why RPKI was invented.
✗ Common misunderstanding: BGP picks the shortest or fastest path to a destination.
Why that's wrong: It measures nothing. There is no latency, no bandwidth and no distance anywhere in the protocol. The closest thing to a distance is the number of AS path entries, and even that is compared only after LOCAL_PREF — an operator's preference beats it outright. MED is a real metric attribute, but it is compared far down the list and usually only between routes from the same neighbouring AS.
Correct model: BGP applies a list of comparisons, several of which are knobs a human sets — and the list starts with local policy, which is why two vendors can order the early steps differently. The result expresses commercial policy at least as much as topology.
The packets prove it: In the LOCAL_PREF lab the route with an AS path of length 2 is installed over one of length 1, and the traffic visibly follows it.
✗ Common misunderstanding: All BGP routers eventually agree on the best path, the way OSPF routers do.
Why that's wrong: Each network applies its own policy to the same announcements. Two networks receiving identical information can legitimately install different routes, and neither is wrong.
Correct model: There is no global best path and no global agreement. Each AS optimises locally against constraints nobody else can see.
The packets prove it: In the LOCAL_PREF lab, AS 65001 prefers the transit path while AS 65002 and AS 65003 use the direct one. Every router is behaving correctly.
Watch these fields in the lab: bgp.myAs
- Autonomous system (AS)glossary
- One organisation's network, with a number. The unit BGP reasons about — it has no interest in what is inside one.
- Peeringglossary
- A configured relationship between two ASes. BGP defines no neighbour discovery, because routing relationships and policy must be intentional. The relationship may be settlement-free peering, customer-provider transit, a private interconnect, internal iBGP, or simply enterprise or lab policy.
- eBGP / iBGPglossary
- Between different ASes, or within one. The rules differ: the AS path is prepended only on the way out of an eBGP session.
- Prefix
- A block of addresses being advertised as reachable, e.g. 203.0.113.0/24. BGP announces reachability, not topology.
- Attributeglossary
- A value attached to an announcement — where it came from, which networks it crossed, how much this router likes it. Policy is written against these.
Watch these fields in the lab: bgp.type
✓ Concept check — before you open the packets
These test the idea, not the trace. You should be able to answer them from the explanation above.
Now that you understand the concept, observe how it appears in the packet exchange.
The lab runs a real simulated capture — pause, step, click any packet, and inspect every byte.