From what I understand, as a random user on the Internet, you cannot really know if an IPv4 address is unicast or anycast. However if you ping that IPv4 from two hosts physically located on two different continents far apart and get a ping time < 30 ms in both cases for the same IPv4 address, you can be sure it's two different servers answering the ping for that particular IPv4 (*).
So two different servers are answering for the same IPv4 IP: does this mean anycast is used for sure?
If anycast is used, does this mean there's IPv6 somewhere or can anycast be used in an hypothetical network which would be IPv4 only?
Answer
There are two different ways of doing anycast: routing-based and on a single subnet. The routing based one can be done for both IPv4 and IPv6. The single-subnet way cannot be done with IPv4.
Routing based anycast is done by announcing the same IPv4 or IPv6 prefix into a routing protocol from multiple routers. All of them announce they have a direct connection to those addresses. The routing protocol (if used on a global scale BGP, if used within one organisation it might also be e.g. OSPF etc) calculates the shortest path to that prefix and thereby uses the 'closest' instance. What is considered 'closest' depends on the routing protocol's algorithm and metrics.
IPv6 has a subnet based form of anycast for use within a single subnet. It works by letting multiple hosts answer to the same address for Neighbor Discovery queries (think the IPv6 equivalent of IPv4 ARP queries). The sender will use the first answer it gets, which is assumed to be the closest and/or fastest.
I hope this explains the confusion: two different techniques with the same name.
No comments:
Post a Comment