I saw a map of undersea internet cables the other day and it’s crazy how many branches there are. It got me wondering - if I’m (based in the UK) playing an online game from someone in Japan for example, how is the route worked out? Does my ISP know that to get to place X, the data has to be routed via cable 1, cable 2 etc. but to get to place Z it needs to go via cable 3, 4?
https://www.khanacademy.org/computing/computers-and-internet/xcae6f4a7ff015e7d:the-internet/xcae6f4a7ff015e7d:routing-with-redundancy/a/internet-routing
I wouldn’t call that “messy and inefficient” but you do you. I’d be curious to know what’s a “clean and efficient” solution for you when it comes to routing packets around the planet :)
Ah yeah this and @MelastSB@sh.itjust.works 's comment clarify the routing table thing. Before I was assuming they just blindly forwarded stuff until one router knows where to go, but if they have a rough idea from the IP address prefix that makes more sense.
They dont have a rough idea, they have a very accurate picture of where they should send a packet based on the IP address.
Routers at the internet-backbone scale actually announce the IP addresses they are responsible for, as well as other routes (with an additional path cost added) that they can reach.
So, they match a destination IP to the most accurate IP block in their routing table (so a destination of 8.8.8.8 with 2 entries of 8.8.8.0/24 and 8.8.0.0/16, it will match the 8.8.8.0/24 route) and forward the packet to the router that announced it.
Routing at the internet scale is much smarter than routing at the home (even business) level