BGP
Border Gateway ProtocolBGP is how the internet agrees where things are. The net is tens of thousands of independent networks — autonomous systems — and BGP is the language they use to advertise which addresses they can reach and along what path. Every route between networks you’ve ever used was chosen by BGP.
BGP lets independent networks advertise the address blocks they reach and pick paths by policy, not just distance.
How it works
The origin AS tells its neighbours “I own this prefix.”
Each AS adds its own number, then re-advertises — the path grows.
See your own AS in the path? Reject it — that’s how loops are avoided.
Every router ends up knowing not just that a prefix is reachable but the full list of networks to cross — and picks among competing paths by local policy first, shortest AS-path only after.
What BGP does, step by step
Two routers open a TCP 179 session and become neighbours — eBGP between AS, iBGP within one.
Each peer advertises the address blocks it can reach, with the AS-path and other attributes attached.
Local preference, AS-path length and MED decide the best route — often about money, not distance.
Only changes are sent after the initial dump; withdrawals pull a prefix back when a link dies.
In cybersecurity
BGP runs on trust between operators — it believes what peers announce — so a bad or forged advertisement can redirect a chunk of the internet.
An AS announces a block it doesn’t own; traffic to those addresses is drawn to the wrong network.
Re-advertising routes you shouldn’t sends traffic down a path never meant to carry it — often by accident.
Signed records say which AS may originate a prefix; origin validation drops announcements that disagree.
A subtle hijack passes traffic through, inspects it, then forwards on — hard to notice from the endpoints.
Prefix limits and strict inbound filters contain a peer that suddenly floods bad or excessive routes.
TCP-AO/MD5 and TTL security stop an outsider from spoofing or resetting the peering itself.