the internet

How is traffic routed on the internet?

natanaelginting / freepik.com

We use the internet for everything. From business communication, to chatting with friends, see what everyone is up to on social media, watch video and movies, listen to music and whatnot. We do that on good old computers, smartphones, tablets and Smart TVs. Cisco estimates the traffic that will pass through the worldwide web in 2022 will be 350EB (Exabytes). That is 367,001,600TB (Terabytes). But how does it all work? How does information travel on the internet from one point to another?

Information on the internet travels in the form of packets and every packet holds bits of data. As Wikipedia explains, a bit is the basic unit of information in computing and digital communications. When you interact with someone or something on the internet, you send packets full of bits to the other side, and then get packets full of bits as a response. 8 bits form 1 byte, then 1024 bytes form 1 megabyte, 1024 megabytes form 1 gigabyte and so on. 

The packets that you send go through devices called routers that we all have in our home. These small and usually silent boxes often have additional capabilities like WiFi radio built-in and a small switch that allows you to connect to the device (and the internet) through a network cable. All your devices then form a network, but this network is not the internet. Once the routers receive a packet full of bits, their job is to figure out where to forward it, which would be to another router - this time of your ISP. An ISP is short for Internet Service Provider, or in other words, the company that you pay for internet access. But that is still not the internet either. It's only a larger network of all households that use the the same ISP as you. It could be a small local ISP, a large national company, or it may be your mobile services provider. Your provider's routers are significantly more powerful than the one you have at home (and they are more expensive too) and they will usually hold what is know as the routing table of the internet. 

So how do these routers route the traffic on the internet?
The routing table of the internet is like a map where every computer network has it's own address. Like YellowPages, but for computer networks. When one packet needs to reach from one network to another, these routers have the map and can point it in the right direction. But they won't necessarily point the packet to the final destination. Many times they will simply tell the packet to which router it should go next. Because your ISP's router will show up on this internet map, but your own router at home is hidden behind it and it will not show up. The same happens on the other side, so a packet needs to first reach the router of the ISP of the computer, for which it is destined, and can only then be forwarded to it's final destination. However, because of long distances this is not always possible and here is where so called "transit" providers enter the game. 

Transit providers.
A transit provider of the T1 type (short for tier 1, a.k.a the lowest level in the chain), is a company that connects multiple networks that are not directly connected to each other. There are also T2 providers that do that, but Tier 1 Transit providers typically own the fiber optic cables that are burried under the ground and on the floors of seas and oceans, which connect one country with another, and one continent with another. Because they own the physical links that the packets thravel through, they do not pay anyone to carry their traffic the way that a T2 provider would. But it is nearly impossible for one company to lay and operate as much fiber cables all around the world to connect all the networks together, so there are multiple T1 transit providers around the world who interconnect with each other to make routing on the global internet possible. Your ISP is likely paying at least a few of these to provide you with your internet service.

But wait. What does this mean in terms of number of networks and routers that need to be used to get a packet from London to São Paulo? 
Well, you probably already guessed it, but usually the bigger the physical distance between the two computers that exchange packets is, the more networks and, therefore, routers will these packets go through before reaching their destination. These many routers are also known as network hops, and the entire route that a packet will have to take is known as the network path.

So then, this would pretty much be it, right? Well, no, it's not. Because routes change often and this presents a lot of challenges.
The internet, made out of all these routers that are hosted in different physical locations, is fragile. Being a physical, mechanical devices, routers can fail. The facilities in which these routers are located can also fail (as in,  really fail). Then, all these endless miles of fiber optic cable can fail too (as in, cutting an entire country off the internet). Obviously then, the route that a packet takes on the internet may change at any time, for any number of reasons. The reason may also be route optimization, where if a packet would travel through a different path towards the same destination, it could end up there sooner. Imagine that one road is faster towards one destination at this very moment, but then an hour later there is a traffic jam there, and another road becomes faster. Such optimizations are done constantly all over the internet, and this is one of the core things that a CDN does. Content delivery networks, which in this context you should imagine as something capable of carrying the load of a lorry (heavy video content, images and other static assets, that is), but at the speed of a sportscar, use various methods to avoid these traffic jams. They will route traffic through a path they believe is the fastest, or most stable, or both. This path will usually also happen to be the shortest (in physical distance) most of the time, but not always. A CDN would therefore not rely solely on the distance between two points to ensure speed and relibaility. At PUSHR we also use a global network of internet "probes" that do continious checks between our data centers and the rest of the internet, as well as check historical data that we have collected regarding transit providers' relibaility to various locations and, of course, a lot of manual route optimizations. Without optimizations and instant failover when a network path becomes overloaded or even unavailable, your video would freeze, your live meeting would fail and you could end up not being able to even tweet an angry tweet about it, until issues are resolved. 

So, that's the basics of how traffic is routed on the internet. There are multiple layers to how this communication between various devices can actually be utilized to move data, but it is too much to cover all of it at once, so we stop here.