How exactly does the Internet Work? (for the average Joe)
Servers, packets, and TCP/IP demystified
If you are reading this article, you probably know how to use the internet, but have you ever wondered how it works? The internet is a highly sophisticated network of complex protocols and trying to learn it all can be very scary. However, they say the best way to learn about computers is bit by bit (pun intended). As such, here is a basic rundown of what happens behind the scenes of this massive global network we call the internet.
Servers and Clients
When I draft my articles on Medium, they are saved on one of Medium’s servers. A server is basically a computer that’s meant for sharing information and resources to other computers, called clients. For example, let’s say you’re the scheduling manager for a company, and you write down your employee’s schedule on a piece of paper. Each time an employee wants to see the schedule, you can get them to come to you physically and ask for the paper, or you can choose to have the paper posted in a central location for all employees to view. In the same way, let’s say I have a file called filename.txt on my personal computer; instead of individually sending it out to each person that needs to access it, I might choose to put it on a server so that anyone who needs it can access it whenever they’d like.
With the internet being as widespread as it is, it doesn’t make sense to individually go get these files yourself. Can you imagine if for every YouTube video you watched, you had to go to a YouTube server farm carrying a USB and bring back the video you wanted to watch? Not only is that completely unreasonable and inefficient, it also poses significant security flaws. This is why we’ve developed a series of sophisticated rules called protocols that allow you to access the files on YouTube’s server from the comfort of your home. If you’ve done any kind of computer networking, you might have heard of protocols like TCP, UDP, HTTPS and more. The most important one to understand, and the one that is most widely used, is TCP/IP (Transmission Control Protocol/Internet Protocol).
Transmission Control Protocol & Internet Protocol (TCP/IP)
Internet data is sent physically through mediums like wireless signals, fibre optics, or as electrical signals on ethernet cables. Because the internet is such a large network that’s used world wide, there needs to be rules and protocols in place to make sure things move smoothly. The TCP/IP system establishes a standard communication protocol that makes sure the right information is routed to the right place, intact. If the bits of data (called packets) travelling through the internet are like vehicles on the road, think of TCP/IP as the traffic laws and regulations, making sure all vehicles can safely arrive at their destination.
When you request a website (like by perhaps clicking on the link to this article, or by typing www.youtube.com into your browser), you are sent a series of packets, or pieces of information, in return as opposed to the entire file at once. The TCP/IP protocol specifies this because should there be any obstructions to the data on its way to your computer, it wouldn’t have to send the entire thing again. Instead, the website (or whatever file it is you are trying to access) is cut up into bits and pieces and reassembled at its destination. I like to think of it like bringing a table home from IKEA. I could strap the finished table to my car and risk it falling apart on the way home, or I could take the table apart and just put it together when I get home. This framework is also much faster, as each packet can take a different route to the final destination, meaning if one path is obstructed or congested, the other packets don’t have to form a “traffic jam” behind it; they can simply take a different path to it’s final destination.
The TCP/IP Model
The TCP/IP Model divides the different communication functions that happen over the internet into four conceptual layers: Application, Transport, Internet and Network Interface. Although perhaps difficult to wrap your head around at first, understanding these layers can significantly increase your understanding and appreciation for the internet and the engineers operating on it. There are protocols that operate on each layer that are beyond the scope of this article but will be included for some of the more advanced readers.
Application
The application layer is all about the end-user. All you need to know about the application layer is that it deals with the actual programs (…applications) you download and use, and the websites you interact with. This is where protocols like Hyper Text Transfer Protocol (HTTP), Domain Name System (DNS), and Secure Shell (SSH) operate. These are all examples of high-level protocols, which are protocols that handle data that’s passed through different processes, translating that data using code, and transport it from process to process.
Transport
The transport layer is exactly as it seems. It is responsible for the transport of data from the source computer to the destination computer through wired and wireless signals all around the world. The programs you use in the Application layer communicate with the protocols on the transport layer, through ports. Think of ports like doors to the rooms in a hotel; each port is assigned a service on the application layer and the transportation between your computer and the internet happens through that port. This is where protocols like TCP (not to be confused with the TCP/IP Model in question) and UDP operate. As mentioned earlier, the TCP protocol (operating on the transport layer of the TCP/IP Model) segments Application layer data into packets, to then be transported to the next layer down: the Internet layer.
Internet
The internet layer adds “headers” to these segments that tell them who they’re from and where to go using the Internet Protocol (IP). If you’ve ever played in an Xbox lobby, you are sure to have heard of the internet protocol in one way or another. Because the communication between source and destination over the internet is done using the Internet Protocol, there are tools that can track the packets being received and read the header information on them, which will contain the IP address of the receiving machine. Although most DDoS and location-tracking threats received in an Xbox lobby are pretentious, there is a certain validity to them from an IT standpoint.
Network Interface
The Network Interface layer is the last step in the TCP/IP process. It makes sure the data gets to the correct physical machine on the network using MAC Addresses, which, unlike IP addresses, are unique to each and every device on the planet. The internet layer header specifies a public IP address, which includes all the devices on your home network. You can actually check your public IP address by searching “What’s my IP address?” or clicking here. A packet is sent to your public IP address on the Internet layer, but the Network Interface layer is what then finally sends the data to your device.
…and that’s just the tip of the iceberg. We still haven’t gotten into IP routing, internet service providers (ISPs), or firewalls. Perhaps it’s true what they say about ignorance being bliss; this stuff can get really complicated, and to be completely honest, if my Netflix show gets to me reliably and relatively fast, I don’t actually care, nor do I expect you to. However, if it weren’t for the engineers that developed the internet and the ones who actively operate on it today, our lives would be significantly more difficult.
I hope reading this article gave you a glimpse into the world of Computer Networking and perhaps gave you a new appreciation for the internet. Next time your video buffers a little longer than normal, try and cut it some slack. From existing as a file on a server, to being segmented into packets, then being sent out as signals over the internet before reaching a device on your network, remember that that video has come a long way before you could watch it.
Hey! Thank you for reading my article. I’m 17 years old and love writing about technology, productivity and self-improvement. If you enjoyed the article or learned something new, consider sharing it with your friends or reach out to me on LinkedIn! 😁