3

According to this answer Google DNS (8.8.8.8) has low worldwide latencies because it uses anycast.

How is anycast actually implemented? That is, how does a packet get routed to different computers around the world?

Wouldn't that mean that different versions of routing tables exists? If yes, who controls what these routing tables contain?

5

Wouldn't that mean that different versions of routing tables exists? If yes, who controls what these routing tables contain?

Yes. Each router maintains its own routing table. Anycast is simply that the same network is advertised from multiple places. A router receiving multiple advertisements for the same network will choose which advertisement to place in its routing table based on the metrics of the routing protocol. This results in the closest (from the perspective of the routing protocol metrics) destination being used by a router.

For example, the primary way that BGP determines which of multiple destinations is the closest by the number of ASes in the AS_PATH attribute. If a router receives five advertisements for the 8.8.0.0/16 network, it will choose one to place in its routing table, and it will route the traffic destined for 8.8.8.8 to that network. If the site with that network goes down, the entry in its routing table will be withdrawn, and the next closest destination will be placed in its routing table.

Different routers in different locations will each make their own independent determinations as to which destination is closest. Anycast is simply advertising the same network from multiple sites and letting each router determine for itself where to send traffic destined for that network.

  • "Anycast is simply advertising the same network from multiple sites", doesn't 8.8.8.8 have a different network for different (geographical) sites though? E.g. A ping to 8.8.8.8 would be routed to different machines from London then from Toronto Canada. – Darthtrader Sep 19 '17 at 16:31
  • 2
    No, 8.8.8.8 belongs to the network which contains that address. Individual addresses are not advertised on the public Internet. ISPs will not advertise a prefix longer than /24, so host prefixes (/32) cannot be advertised on the Internet. The networks containing the host addresses are what is advertised. – Ron Maupin Sep 19 '17 at 16:47
1

Each router has it's own routing table. The routing tables are built by the routers based on exchanging routing information with other routers and by policies set up by the owners of the routers.

The exact policies will vary between ISPs but as a general rule a shorter AS path will be preffered over a longer AS path and if the AS paths are the same length a closer exit will be preffered over a more distant exit.

Google interconnect with other networks at many locations around the world. At each of these locations they advertise 8.8.8.0/24 address block. The routing rules work out such that traffic to the 8.8.8.0/24 block is usually delivered to google's network at a location close to the sender.

Once inside google's network google can then route the traffic to a nearby cluster of DNS servers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.