What is BGP?
BGP (Border Gateway Protocol) is the exterior gateway protocol that routes traffic between autonomous systems (ASNs) on the Internet. It's sometimes described as the "glue" holding the Internet together.
How it works at a high level:
- Each ASN runs BGP routers that peer with neighboring ASNs
- An ASN announces the IP prefixes it owns via BGP
- Its neighbors learn those routes and announce them further (based on peering policy)
- Every router on the Internet eventually knows: "to reach prefix X, the next hop is AS Y via AS Z"
BGP decisions are influenced by AS-path length, route preferences, and business relationships (customer / peer / transit). When you visit a website, BGP determines the path your packets take.
BGP's biggest weakness: route hijacking. A misconfigured or malicious ASN can announce prefixes it doesn't own, and the Internet will believe it until detected. RPKI and BGPsec are mitigations.
WorldIP.io shows the BGP-announced prefix for every IP you look up.