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?
Packet headers.
A packet is like a sealed mailing envelope. Its headers are like things written on the face of an envelope, including an address. Chunks of data on the internet are so many letters in these envelopes, carried and delivered by a network of other computers.
To expand on this: every website that you go to online (i.e. www.google.com) is backed by an IP address.
And the Domain Name (Google.com) get’s converted from words we understand to the IP address. This is the Domain Name System, or DNS. Everyone on the network agrees that Google.com equals 142.250.189.174. If that address changes, the change gets passed through the system until everyone agrees on the new IP address. DNS is how your computer learns the address.