Networking
What is BGP?
BGP is the protocol that autonomous systems use to exchange routing information and decide how traffic crosses the internet. BGP path selection is why two servers the same physical distance apart can have very different latency: the route matters as much as the distance.
Why BGP matters
BGP path selection is why two servers the same physical distance apart can have very different latency: the route matters as much as the distance.
BGP in practice
When you run a server, BGP is the routing table your upstream announces on your behalf. You don't configure BGP on a single box; you'd set up peering sessions at a colo or ask your provider for a session. You'd look at `ip route` and `traceroute` to see the path traffic takes. If you get a session wrong, you could blackhole traffic or leak routes. The cost is downtime and loss of connectivity.
What people get wrong about BGP
A common mistake is thinking BGP is a speed protocol. It doesn't make routes faster; it chooses the path based on AS path length, local preference, and other attributes, not latency. So you could end up on a slower route just because it's 'shorter' in AS hops. Correction: BGP's job is reachability and policy, not performance.
BGP — common questions
Why does my latency differ so much from another server nearby?
Distance isn't the main factor. BGP picks the route based on AS path length, local preference, and other policy rules. Your traffic might cross a congested IXP or take a longer path due to peering agreements. Check `traceroute` to see the actual path.
What's the difference between BGP and an IP transit provider?
IP transit is a service where a provider carries your traffic to the rest of the internet. BGP is the protocol used to exchange route information between your AS and your provider's AS. You need BGP to implement multihoming or traffic engineering.
More from networking
- ASN
- An ASN identifies a network that controls its own routing policy and announces its address space to the global routing table via BGP.
- IXP
- An IXP is a shared physical facility where networks interconnect directly rather than paying a transit provider to carry traffic between them.
- Peering
- Peering is a direct interconnection between two networks that exchange traffic with each other without paying a third party to carry it.
- IP transit
- Transit is a paid service in which one network carries another network's traffic to the rest of the internet.
- Anycast
- Anycast announces the same IP address from several locations at once, so each user is routed to the nearest instance by BGP.
- IPv6
- IPv6 is the current version of the Internet Protocol, using 128-bit addresses to replace the exhausted 32-bit IPv4 space.
- Reverse DNS
- Reverse DNS maps an IP address back to a hostname through a PTR record, the inverse of a normal DNS lookup.
- Port 25
- Port 25 is the TCP port used for server-to-server SMTP mail delivery.