Steering traffic at the network layer with IP Anycast
IP Anycast is another common approach for global traffic distribution. Figure 2.13 depicts an example of how it works:
Figure 2.10 – IP Anycast
Both servers have a public IP address of 144.12.11.5. Customers are automatically routed to the closest one. This makes DNS simple; you just need a single A record for myapp.io pointing to that IP.
You may be asking yourself: wait, I thought public IP addresses had to be unique on the internet? That is normally true. However, if one has access to their provider-independent IP space from IANA, some tricks can be utilized.
Recall the situation in Figure 2.3, which shows the peering that happens between different ASs on the internet. When that peering happens, one AS tells another AS about the IP prefixes inside of it. It also passes along BGP community information, which is a series of variables that can override the normal mechanism BGP uses to figure...