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?
Comments are correct here with one missing high level component for routers. That is the very top level routers are designed for tier 1. I started an internet company and we got large enough to decide to become a tier 1 provider. There is one big difference in this configuration is that we publish our own blocks of IPs and we listen for published IPs. We have routers that essentially maintained a list of where all the IPs or block of IPs worldwide needed to go. More importantly, I would send out a list of my IP blocks that would propagate across all the tier 1 routers across the world. That could take an hour but more likely minutes.
Having this allowed me to essentially connect to the internet at zero cost. There is some cost to be assigned IPs but I was trusted. While I say zero cost, I still had to pay for large bandwidth dark fiber to new York or other major meet me points. I also had to pay rack space to put a tier1 router into these buildings. But what is really gives me is the ability to have multiple connections to the pipes and because I publish my own IPs, I can balance all the routes and other providers can find the best way to me thru a process called weighing. Also if I loose a connection which is rare at this level, I could rapidly and automatically republish my route on working connections and usually within 15 minutes, all the routers in the world would know. 15 minutes actually is likely long. These days 5 minutes.
Now the interesting part of this, I publish my own IPs. I have to be extremely careful as with a single stroke, I could say I own all the IPs to China. Well likely a few strokes. I certainly could make a simple mistake and take control of a shit load of IPs. That means suddenly traffic could come to me that was destined for another country. More correct, because they are publishing, it would just make a mess and take some IPs down. If I publish a big block in China, I would essentially DOS myself because the pipe sizes I buy are factors smaller. Now this is a trusted system because we all connect together randomly. There is and can not be any central control as we all need to publish freely for this to work. But if I were to screw up and say divert a shit load of IPs destined to say Washington, it would rapidly be figured out and I would rapidly be determined to not be trusted. I would be shut down physically at some point.
Essentially I have fairly normal routers with one feature that allows them to dynamically keep track of all the routes worldwide and to periodically publish all the IPs I own.