Demystifying the Internet: A Beginner's Guide to Computer Networking

Introduction

Three years ago, I started learning about programming, and the internet became super interesting. Before that, I never really thought about what makes the online world tick. Just typing a web address and seeing a webpage pop up on my screen was like magic. This curiosity stuck with me, and at the beginning of this year, I decided it was time to figure out how computer networking and the internet work. My go-to guide for this exploration is Jim Kurose's 'Computer Networking: A Top-Down Approach.' In this article, my aim is to simplify these concepts for anyone else curious about the workings of the internet. So, let's dive right in.

In simple terms

On a very fundamental level, the Internet is a network. What does network mean here? You can think of a network as a large group of computers (including mobile devices, smart TVs, web servers, and any other device that allows you to send and receive information) communicating and sharing information with one another. It's like a digital community where devices are linked, allowing them to talk and share data. How is all this possible? Well, this is possible because of the infrastructure in place. So, let's delve into what this infrastructure is and explore it on a technical level.

Infrastructure

Recall when I mentioned that the internet essentially involves a bunch of computers talking to each other? Now I want to dig into something important. It's called a 'Network Protocol.' What's that? Well, think of it as a set of rules that computers follow when they talk. It's like their language for swapping information, making sure they understand each other clearly.

Let's bring in an analogy here: imagine two people attempting to communicate—Person A speaks only English, and Person B speaks only French. Person A asks, 'Where can I get food in this area?' to Person B, who looks utterly confused and doesn't understand a word. The problem? They lack a common language. This scenario mirrors computer communication. When two computers need to exchange information, they must agree on a common "language"—that's the protocol.

To properly understand how the Internet works, we must talk about the five layers that make this beautiful thing we call the Internet:

  1. The Application Layer: This is where we come in; it's like the surface level where we use apps and internet services, such as email, browsers, or file sharing. Think of it as a user-friendly playground. The languages (protocols) spoken here include HTTP, SMTP, FTP, and WebSocket; they help these apps chat with each other.

  2. The Transport Layer: The Transport Layer acts like a courier or delivery service in the internet world, focusing on local delivery. Here, 'local delivery' refers to the immediate network connected to your device. This network may include your modem, routers, MiFi devices, and the services provided by your Internet Service Provider (ISP). Essentially, the Transport Layer ensures safe and reliable message delivery within this local network, handling the initial stages of communication before messages are forwarded to the broader internet. When you click the "send" button in an application, the transport layer takes charge of the safe and reliable delivery within your immediate network. It ensures that messages or data packets move securely between devices within the local environment. There are two key protocols in this layer: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). These protocols not only ensure secure local delivery but also provide services like error detection, correction, and flow control. In summary, the Transport Layer, operating at a local level, ensures messages between apps on different devices within the same network are sent reliably, quickly, and without errors.

  3. Network Layer: You can think of this layer as a navigator for the courier/delivery service (Transport Layer). When you hit "send" and the Transport Layer takes charge, the Network Layer comes into play to guide the messages from your device to their destinations across the vast internet. It's like the navigator that helps our courier service find the best route to deliver your messages. This layer houses one of the most important protocols in the protocol stack, which is the IP (Internet protocol). This protocol assigns unique addresses (IP addresses) to devices on the network. You can think of an IP address as a bit like your device's location in the digital world. IP enables the efficient routing of messages, ensuring they reach the correct destination, even if it's on the other side of the world. So, while the transport layer focuses on local delivery, the network layer oversees the broader journey, making sure your messages traverse the internet and reach their intended recipients through the most efficient paths. In essence, it's the network layer that guides your messages across the global digital landscape, which is why I referred to it as a navigator.

  4. Link Layer: Think of your devices in a network like houses on a street. The network layer, which handles assigning IP addresses, is like the street address for your devices. It ensures each device has a unique 'street address' so they can be located globally. Now, when messages reach the "street" (local network), they need to find the right 'house' (device). This is where the Link Layer, our friendly postman, comes in. When you hit "send" and the Transport Layer does local delivery, the Link Layer takes over. It's like our diligent postman making rounds, delivering digital letters to various houses on the same digital street. The Link Layer works with MAC addresses, which are like the house addresses in your local network. Each device has a unique MAC address, just like each house has a unique address on a street. The Link Layer uses these addresses to efficiently navigate the digital neighborhood, making sure your messages find the right digital doorstep. So, while the Network Layer plans the big-picture journey and global navigation, the Link Layer acts as the local courier, managing direct communication within your immediate digital community. It ensures your digital messages are delivered reliably and swiftly to their digital neighbors. Examples of link-layer protocols include Ethernet, Wi-Fi, etc.

  5. Physical Layer: Imagine your digital messages as packages, and within each package are tiny, essential pieces called bits. The Network Layer plans the big routes for these packages; the Link Layer is the local courier delivering entire packages between houses (devices); and then we have the unsung hero, the Physical Layer. The physical layer deals with the bits inside each package. It's like the worker who carefully handles the tiniest pieces, making sure they travel smoothly and reliably from one digital doorstep to another. If the Link Layer (our postman) moves entire packages between neighbors, the Physical Layer ensures that every tiny bit inside these packages finds its way securely. Think of bits as the smallest building blocks of your digital messages, and the Physical Layer is the expert in moving these bits effectively, adapting its methods based on the 'digital road' used, whether it's twisted pair copper wires, fiber optics, or another medium. So, in simple terms, the Physical Layer is the behind-the-scenes hero, taking care of the smallest details and ensuring that every tiny piece (bit) of your digital messages reaches its destination intact.

Now that we've covered the five layers of the internet, let's dive into a few fascinating tools and discoveries I encountered on my journey of exploring and learning about computer networking.

  • Traceroute is a tool that helps you see the path a message takes before it gets to where it's going. Imagine you're sending a message from your computer, and you want to know the way it travels. Traceroute lets you do that by showing a list of devices or routers the message goes through on its journey. I found this very interesting, so I made a little traceroute myself. You can check out the code at this link: Github Repository

  • A packet sniffer is like a detective for computer messages. This tool lets you intercept a message before it reaches its destination and see what's inside it. It captures and analyzes the information flowing through computer networks, helping people like network administrators understand, troubleshoot, and monitor the network. It's a useful tool for keeping an eye on the messages traveling between devices and making sure everything is working smoothly.

  • A router is like a smart traffic warden for the internet. It works in the Network Layer, which is like the navigator of the digital world. Imagine your data packets (messages) are cars trying to reach their destination. The router checks the address on each packet, much like the street address on a letter. This is where the router's forwarding table comes in; it's like a map telling the router where to send each packet. Now, here's the cool part: the router doesn't just mindlessly send the packet forward. It uses a "store and forward" approach. Picture it as the router parking the car, checking it out, and then deciding the best route before letting it continue. So, in simple terms, a router sits in the network, reads the addresses on data packets, consults its map (forwarding table), and carefully guides them to their destinations, ensuring a smooth and efficient digital traffic flow.

As we conclude this initial exploration into understanding the intricacies of the Internet, I've intentionally kept things simple using analogies, knowing there's much more to unravel. This marks the beginning of a series where I'll delve deeper into the fascinating world of computer networking. Expect more insights, discoveries, and a shared learning journey as I continue to expand my knowledge on this subject.