Border Gateway Protocol decides how internet traffic flows between Autonomous Systems (the big networks like AT&T, Verizon, AWS). You don't run BGP, but it explains why a packet from your AWS us-east-1 server to a user in Mumbai might take a path through London. Understanding the basics demystifies cross-region latency.
ASes and peering
The internet = ~100K Autonomous Systems. Each AS is a network with its own routing policy. ASes 'peer' (exchange traffic free) or 'transit' (pay another AS to carry your traffic). BGP is the protocol announcing 'I can reach prefix X via path Y'.
Path selection
BGP picks routes based on a deterministic policy: shortest AS-path, highest local-pref, lowest MED. Many factors — and 'shortest' doesn't mean 'fastest geographically'. AS path length is a poor proxy for latency.
Why latency surprises happen
AS A and AS B may have no direct peering. Traffic from A to B routes through AS C (a tier-1) that has paid peering with both. C might be 1000 miles away. Your packet takes a detour. This is normal and unfixable from your application.
Anycast for fix
Major CDNs (Cloudflare, Google) announce the same IP from many locations worldwide. BGP routes user to the topologically-closest one — usually also geographically close. Your app gets the same IP everywhere; BGP magic picks the right server.
BGP outages
When an AS withdraws a route (config error, fiber cut), parts of the internet lose reachability for minutes. Famous 2021 Facebook outage was a BGP misconfiguration. Application teams can't fix BGP — but knowing it explains a class of 'internet is broken' incidents.