Anycast assigns the same IP address to multiple servers in different locations. Routers direct traffic to the nearest instance based on BGP path selection. CDNs, DNS root servers, and DDoS mitigation services use anycast to serve users from the closest point of presence – reducing latency and distributing load geographically.
Anycast is a routing technique where multiple nodes advertise the same IP prefix via BGP. Routers on the internet naturally select the closest node based on AS path length, IGP metrics, and BGP local preference. Cloudflare, Google (8.8.8.8), and all 13 DNS root server letters use anycast. Benefits: lower latency (users hit the nearest PoP), automatic failover (withdrawing a BGP announcement shifts traffic to the next-closest node), and DDoS absorption (attack traffic splits across all anycast nodes rather than concentrating on one). Anycast works well for stateless protocols (DNS, CDN) and connection-oriented protocols with short-lived connections (HTTPS with session resumption). Long-lived TCP connections can break if routing changes shift traffic to a different anycast node mid-session – QUIC's connection IDs solve this.
Routing Table
A routing table is a data structure in a router or host that maps destination network prefixes to next-hop addresses and interfaces. Longest prefix match determines which route applies. Routes come from static configuration, DHCP (default route), or dynamic protocols (BGP, OSPF). An empty routing table means no connectivity.
BGP Peering
BGP peering is a TCP session on port 179 between two routers that exchange routing information. eBGP peers are in different autonomous systems (inter-provider). iBGP peers are in the same AS (intra-network). Peering requires explicit configuration on both sides – BGP does not auto-discover neighbors.