At Datapath.io we have been talking a lot about network performance and how it is affected by the routing protocols of the internet. Today let’s take a look at another aspect of network performance: Anycast.
There are a number of ways in which internet traffic can be routed, anycast is one of them. However, anycast is a relative newcomer to the network performance landscape. The most widely used routing methodology on the internet is unicast.
Before diving into routing methodologies a word about how internet routing works:
Internet routing is the process of selecting best paths from a source to a destination on a network. This process is usually undertaken by devices called routers through the use of routing protocols. Each router contains a map of the paths to other destinations in the network. Routing protocols analyze these maps and come up with the shortest path to a destination, based on the number of network hops or routers there are in a specific network path. The network path with the lowest number of intervening network routers is usually the one that is chosen. Network routers recognize other devices through IP addresses. Every router advertises an IP address which can then be used to forward traffic to it.
In Unicast every network device is assigned a unique IP address. Network traffic meant for that specific IP address is always forwarded to that network router. Take as an example a website that is on a unicast network, with an origin server or VPC in AWS Frankfurt. Requests to this website, from any location in the world will always be routed to that specific server in Frankfurt. As the speed of requests on the internet is limited, a request from say within Germany will take less time to reach the origin server as compared to one coming from India. This inevitably leads to longer page load times and slower applications.
Anycast on the other hand allows multiple network devices to advertise the same IP address. On an Anycast network, traffic meant for a specific IP address can be forwarded to any one of a number of origin servers, depending on the distance.
Anycast essentially plugs in multiple access points into the network that can then be used instead of other more distant access points.
Going back to the earlier example let us suppose we setup a VPC for our website in AWS Singapore and start advertising the same IP address for it from that server. Anycast then allows the requests coming from India to be forwarded to the server in Singapore. Requests originating in Germany are forwarded to the server in Germany. In fact, a server on an anycast network establishes a kind of gravity well around itself. Requests originating inside the gravity well of that particular server are forwarded to it.
Anycast and unicast differ in the number of possible destinations that are available for network traffic. Unicast has only one possible network destination whereas anycast can have a number of different possible destinations. Having multiple possible destinations has the obvious advantage of having some network nodes that are at a shorter distance as compared to other more distant ones.
Anycast usually comes in two flavours: anycast DNS and BGP anycast. Anycast DNS works by geographically distributing a network of identical DNS name servers, sitting behind the same IP address. DNS queries can then be forwarded to the nearest DNS server. BGP anycast allows multiple servers hosting instances of the same website or application to advertise the same IP address. Http requests can then be forwarded to the topologically nearest website server.
Anycast and Network Performance
Speed is one of the most obvious advantages of anycast. Both DNS queries and http requests on an anycast network have to travel shorter distances which translates into lower network latency. These effects are most readily seen as faster page load times and quicker applications.
Networks using anycast are readily scalable and robust accommodating unexpected spikes in traffic and growth.
Adding multiple instances of a server providing the same service increases redundancy and resilience to hardware failures.
Anycast can also be used to maximize availability and failover protection in cases of network outages.
Anycast at Datapath.io
At Datapath.io we leverage AWS DirectConnect connections to multiple AWS regions and transit providers to create a global anycast solution. Multiple VPCs providing the same service in different AWS regions advertise the same IP address. Internet traffic can then be re-routed to the nearest anycasted VPC or AWS region.
Datapath.io uses its Anycast architecture for both load balancing and Failover over multiple AWS regions. It helps AWS based services maximize uptime and availability and makes them more reliable, resilient and scalable.
Download the whitepaper to learn more about Anycast.