The Foundations of Computer Networks: A Journey from Cables to Cloud
A friendly introduction to networking for the curious and passionate
FIRST PAGENETWORKS AND DATA INFRASTRUCTURES


The Foundations of Computer Networks:
A Journey from Cables to Cloud
A friendly introduction to networking for the curious and passionate
Introduction:
The Invisible Magic That Keeps Us Connected
Have you ever thought about what really happens when you send a WhatsApp message or watch a YouTube video? In that precise instant, millions of bits traverse cables, routers, switches, and servers scattered across the planet, following precise rules and optimized paths, to deliver your content in a matter of milliseconds.
Behind these everyday gestures lies a fascinating world: computer networks. An invisible yet omnipresent universe that has radically transformed the way we live, work, and communicate.
Imagine the Internet as a gigantic city, with digital highways (fiber optic cables), urban roads (local connections), intelligent traffic lights (routers), toll booths (firewalls), and a sophisticated postal system that delivers billions of letters (data packets) every second. A city that never sleeps, that repairs and expands itself continuously, and that connects over 5 billion people worldwide.
In this article, I'll take you on a journey to discover this invisible city, explaining with simplicity the principles that govern it. Whether you're a curious beginner or a technician wanting to brush up on the basics, you'll find something interesting in this guided tour of the foundations of the network of networks.
The ISO/OSI Model:
The Seven-Layer Communication Cake
If computers had to talk to each other without precise rules, chaos would reign. It would be like having people from different countries speaking different languages without an interpreter or common protocol. This is why in the 1980s the International Organization for Standardization (ISO) developed the OSI model, which organizes communication into seven layers, like a layered cake.
Each layer has a specific task and only speaks with adjacent layers, making the entire system modular and efficient. This approach is genius: if one level is modified, the others can continue to function without problems, as long as the "interfaces" between levels remain constant.
Let's imagine sending an email with an attachment from the Milan office to the Tokyo office and follow the data's journey through the seven layers:
1. Physical Layer
This is the most concrete level, made of cables, radio waves, and electrical signals.
Here data is just sequences of 0s and 1s traveling as electrical pulses in copper cables, light waves in optical fibers, or radio signals in wireless connections.
This layer defines characteristics such as:
Voltage representing 0 and 1
Duration of each bit
Type of connector (RJ45, USB, etc.)
Transmission mode (simplex, half-duplex, full-duplex)
If we compare network communication to human conversation, the physical layer represents the air that carries sound waves or the paper on which we write.
2. Data Link Layer
Think of this as the local post office that packages bits into "envelopes" called frames. It handles:
Organizing raw bits into meaningful data blocks
Verifying that there are no transmission errors
Controlling data flow between sender and direct recipient
This layer is divided into two sub-layers:
MAC (Media Access Control): manages access to the shared physical medium
LLC (Logical Link Control): handles error control and flow management
This is where MAC addresses come into play, unique 48-bit identifiers embedded in every network card at the time of manufacture. If the IP address is your street address, the MAC address is like your DNA: it uniquely identifies you on the local network.
Ethernet technology operates at this level, as does Wi-Fi (802.11) and Bluetooth. When you connect a network cable, the blinking LED is telling you that these first two layers are working correctly.
3. Network Layer
This is the equivalent of mail carriers' GPS navigators. It decides which route packets should take to reach their destination, even if it's on the other side of the world. It's responsible for:
Logical addressing of devices (IP addresses)
Routing packets through multiple interconnected networks
Fragmentation and reassembly of packets when necessary
Here comes into play the famous IP (Internet Protocol), which assigns each device a unique "street address." When you type 8.8.8.8 in the browser (Google's public DNS), it's thanks to the network layer that your data finds its way to Google's servers and back.
Think of the network layer as the global postal system: it knows how to get a letter from Milan to Tokyo, passing through various post offices (routers) and different means of transport, but it doesn't worry about what's inside the envelope.
4. Transport Layer
Imagine a shipping service that can choose between two options: registered mail with receipt (TCP) or a postcard (UDP).
This layer handles:
Establishing, maintaining, and terminating connections
Segmenting data into smaller units and reassembling them on arrival
Guaranteeing (or not) reliable data delivery
Controlling flow and congestion
TCP/UDP ports (numbers from 0 to 65535) operate at this level and serve to direct data to the correct application. For example, the web typically uses port 80 (HTTP) or 443 (HTTPS), while email uses ports 25 (SMTP), 110 (POP3), or 143 (IMAP).
It's as if the IP address were the building's address, and the port number were the apartment or specific office number within the building.
5. Session Layer
It's like an operator managing calls: it establishes, maintains, and closes "conversations" between applications, ensuring they don't abruptly interrupt. This layer:
Manages dialogue between devices (who can talk and when)
Inserts checkpoints in communication to restore it in case of interruption
Synchronizes data streams
A practical example? When you watch a streaming movie and pause it, the session layer keeps the connection with the server active, so when you press "play" the movie resumes exactly where you left it.
6. Presentation Layer
It functions as a translator and cryptographer. It handles:
Translating data into a standard format understandable by both systems
Compressing data to reduce the amount of information to transmit
Encrypting and decrypting data to ensure privacy
When you open a JPEG image on different devices (Windows, Mac, Android, iOS), it's the presentation layer that ensures it displays correctly everywhere. When you visit an HTTPS site, it's also this layer that manages SSL/TLS encryption, protecting your sensitive information.
7. Application Layer
This is the interface we all use every day: web browsers, email clients, messaging apps. It's the visible part of the iceberg, the one we interact with directly.
Common protocols at this level include:
HTTP/HTTPS for web browsing
SMTP, POP3, IMAP for email
FTP for file transfer
DNS for domain name resolution
DHCP for automatic IP address assignment
When you type www.google.com in the browser, it's the DNS protocol at the application level that translates that name into an IP address that lower layers can use.
This division into layers is genius: if tomorrow we decided to change the cable (physical layer) with a wireless connection, all other layers would continue to work without noticing anything! It's a bit like changing the asphalt on a road: cars continue to travel regardless of the underlying material.
TCP vs UDP:
Registered Mail or Postcard?
On the fourth floor of our "network cake" we find two very different characters: TCP and UDP. Both are transport protocols, but they have completely opposite philosophies.
TCP: The Meticulous Postman
TCP (Transmission Control Protocol) is like a meticulous and slightly anxious postman:
Before delivering anything, he shows up at the door and makes sure you're home (establishes a connection with the "three-way handshake": SYN, SYN-ACK, ACK)
Numbers each packet so you always know if one is missing
Asks for delivery confirmation (acknowledgment) and, if he doesn't receive it within a certain time, knocks again (retransmission)
Ensures packets arrive in the right order, even if they took different routes on the network
If he notices the network is congested, he slows down deliveries to avoid worsening the situation (congestion control)
When he's finished all deliveries, he politely says goodbye and closes the connection (four-way handshake: FIN, ACK, FIN, ACK)
This makes it perfect for situations where accuracy is fundamental:
Web browsing (HTTP/HTTPS)
Email (SMTP, POP3, IMAP)
File transfer (FTP, SMB)
Remote connections (SSH, Telnet)
Distributed databases
When you download a file or check your bank account online, you can't afford to have even a single bit lost or altered. In these cases, TCP is the mandatory choice.
The price of all this reliability? Greater overhead (more control data) and higher latency. TCP is like taking the bus: safer but with more stops and checks.
UDP: The Hasty Postman
UDP (User Datagram Protocol), on the other hand, is like a hasty postman with a single objective: deliver as quickly as possible.
Throws packets (called datagrams) into your mailbox without checking if you're home
Doesn't worry if something gets lost along the way
Doesn't number packets, so they might arrive in random order
Doesn't implement congestion control mechanisms
Is incredibly simple and lightweight, with a minimal header
Sounds inefficient? Not always! There are many situations where speed is more important than 100% reliability:
Video streaming (delay is more annoying than an out-of-place pixel)
Video conferencing and VoIP (better a distorted word than a non-real-time conversation)
Online gaming (reactivity is crucial)
DNS (better to retry a query than wait too long)
IoT and sensors (devices with limited resources sending simple data)
In a video call, if you lose a frame you don't even notice, but if the video constantly freezes to ensure every pixel is perfect, the conversation becomes unusable.
UDP is like riding a motorcycle: fast, direct, but without seat belts. Applications using UDP typically implement control mechanisms at the application level when necessary.
A curiosity: many modern protocols are trying to get "the best of both worlds." QUIC (Quick UDP Internet Connections), developed by Google and now an IETF standard, uses UDP as transport but implements TCP-like mechanisms at the application level, offering faster and more reliable connections.
IP and Subnetting:
Digital Neighborhoods
Every device connected to the Internet has an IP address, a bit like your home address. In IPv4 (the still most widespread version), it consists of four numbers separated by dots, like 192.168.1.1.
Anatomy of an IPv4 Address
An IPv4 address is a 32-bit number, divided into four "octets" (numbers from 0 to 255). These addresses are divided into classes:
Class A: from 1.0.0.0 to 126.255.255.255 (first bit = 0)
Class B: from 128.0.0.0 to 191.255.255.255 (first two bits = 10)
Class C: from 192.0.0.0 to 223.255.255.255 (first three bits = 110)
Class D: from 224.0.0.0 to 239.255.255.255 (multicast)
Class E: from 240.0.0.0 to 255.255.255.255 (experimental)
There are also addresses reserved for special uses:
Private addresses: not routable on the Internet, used in local networks
10.0.0.0/8 (an entire Class A)
172.16.0.0/12 (16 contiguous Class B networks)
192.168.0.0/16 (256 contiguous Class C networks)
Loopback addresses: 127.0.0.0/8, mainly 127.0.0.1 ("localhost")
Link-local addresses: 169.254.0.0/16 (automatically assigned in the absence of DHCP)
But with billions of connected devices, addresses are scarce. Already in the 1990s it was understood that the 4.3 billion IPv4 addresses wouldn't be enough. Here come into play two solutions: subnetting and NAT.
Subnetting: Organizing the Network into Neighborhoods
Subnetting is a bit like dividing a large city into neighborhoods and districts, each with its own local administration.
Imagine a large company with 500 computers. Instead of requesting 500 public addresses on the Internet (now unobtainable), it can:
Obtain a single block of addresses
Divide it into internal "neighborhoods" (subnets)
Assign each department its neighborhood: Administration, Marketing, Development, etc.
To understand which devices belong to the same subnet, the subnet mask is used - a filter that separates the part of the address that identifies the "city" (network) from the one that identifies the "house" (host).
For example, with an address 192.168.1.25 and a subnet mask 255.255.255.0:
The first 24 bits (255.255.255) identify the network
The last 8 bits (the last number) identify the specific host
In CIDR (Classless Inter-Domain Routing) notation, this is written as 192.168.1.25/24, where the number after the slash indicates how many bits are dedicated to the network part.
The advantages of subnetting are numerous:
Savings: fewer public addresses are used
Security: sensitive departments can be isolated
Efficiency: less broadcast traffic on the network
Organization: simpler network management
Flexibility: subnets can have different sizes based on needs
A subnet with mask /24 (255.255.255.0) can host 254 devices (2^8 - 2, subtracting the network address and the broadcast address). If you have a department with only 30 computers, you can use a mask /27 (255.255.255.224) for that subnet, saving addresses.
NAT: Sharing One Address Among Multiple Devices
NAT (Network Address Translation) technology is the other trick that has allowed the Internet to continue growing despite the scarcity of IPv4 addresses.
Your home router implements a form of NAT called PAT (Port Address Translation):
Your home network uses private addresses (like 192.168.1.x)
The router has a single public IP address provided by your ISP (Internet Service Provider)
When a device on the internal network wants to access the Internet, the router:
Modifies the packet replacing the private IP address with its public IP
Keeps track of the connection in a table
When it receives the response, it redirects it to the original device
It's as if all the residents of an apartment building used the same mailing address, but specified the apartment number. The doorman (router) then sorts the mail to the various apartments.
IPv6: The Future of IP Addresses
To definitively solve the problem of address scarcity, IPv6 was developed, which uses 128-bit addresses instead of 32. This provides about 340 undecillion addresses (3.4 × 10^38), enough to assign billions of addresses to every person on Earth!
An IPv6 address looks like this: 2001:0db8:85a3:0000:0000:8a2e:0370:7334, also abbreviatable as 2001:db8:85a3::8a2e:370:7334.
The transition is ongoing, but slow: according to Google, as of March 2025 about 45% of users access its services via IPv6.
Switching:
Intelligent Traffic on the Local Network
Have you noticed when in the office you connect your computer to the company network? You probably connect it to a device called a switch. This apparently simple device is actually a logistics genius.
From Hub to Switch: The Evolution of Network Intelligence
Let's take a step back. The first interconnection devices were hubs, simple multiport repeaters that:
Received a signal on one port
Amplified it
Retransmitted it on all other ports
Simple, but inefficient: like shouting a message in a crowded room hoping the right person hears you. Everyone receives the message, even if it's intended for only one, causing:
Waste of bandwidth
Greater probability of collisions (when two devices transmit simultaneously)
Privacy issues (all devices see all traffic)
The switch was born to solve these problems. It's like a modern telephone switchboard that knows exactly who's calling whom. When a computer wants to send data to another:
The sending computer prepares a data packet with the recipient's MAC address
The switch receives the packet and consults its internal "address book" (MAC table)
Finds which port the recipient is connected to
Sends the packet only to that specific port
This process, called "packet switching," has revolutionized local networks:
Less useless traffic
Greater security (data goes only where it should)
Dedicated bandwidth for each connection
Fewer collisions, better performance
How Does the Switch Learn?
But how does the switch know which device is connected to which port? It doesn't need manual configuration, it learns by observing:
At power-on, its MAC table is empty
When a packet arrives, the switch memorizes the sender's MAC address and the port it came from
If it knows the recipient's port, it sends the packet only there
If it doesn't know it, it sends the packet to all ports (flooding) except the source port
When the recipient responds, the switch also learns its location
This automatic learning process is called "MAC address learning" and is one of the reasons modern networks are so easy to configure.
Advanced Switching Technologies
Modern switches do much more than forward packets. Here are some advanced technologies:
VLAN (Virtual Local Area Network)
Imagine being able to create separate logical networks on the same physical infrastructure. VLANs allow exactly this:
Traffic separation between different departments
Better security management
Reduction of broadcast domains
More flexibility in network organization
With VLANs, a switch can behave as if it were multiple distinct switches. Traffic between different VLANs must pass through a router (or Layer 3 switch), just like traffic between different physical networks.
Spanning Tree Protocol (STP)
In complex networks, redundant paths are often created to increase reliability. But this can create "loops" that would cause infinite packet duplication, saturating the network.
STP is a protocol that:
Analyzes the network topology
Temporarily disables redundant links
Maintains a spanning tree without cycles
Automatically reactivates links in case of failure
It's like having a road system with alternative routes that are opened only when the main ones are congested or blocked.
Power over Ethernet (PoE)
PoE allows switches to provide electrical power through the same network cable that carries data. It's ideal for:
IP cameras
VoIP phones
Wi-Fi access points
IoT devices
A single cable for data and power simplifies installation and increases flexibility.
QoS (Quality of Service)
Not all network traffic is equally important. A video conference with a client is probably more critical than a background update download.
QoS allows you to:
Identify different types of traffic
Assign priorities based on importance
Guarantee bandwidth for critical applications
Limit the impact of less important traffic
It's like having preferential lanes for ambulances and emergency vehicles.
Routing:
The GPS of the Internet
If the switch is the postman delivering letters in your building, the router is the central post office managing mail between different cities.
What Does a Router Actually Do?
The router is a Layer 3 (network layer) device that:
Connects different networks with different addressing schemes
Determines the best path for packets through the network
Filters and manages traffic based on rules
Converts between different media and communication protocols
When you send data to a server in Japan, your packet must traverse dozens of different networks. How does it find its way? Thanks to routers!
The Routing Process Step by Step
The router receives a packet and reads the destination IP address
Consults its "road map" (routing table)
Applies routing algorithms to determine the optimal path
Decides what the next "highway tollbooth" (hop) is toward the destination
Decrements the packet's TTL (Time To Live)
Recalculates the IP checksum
Sends the packet in the right direction
It's as if at every intersection there was a traffic officer indicating: "For Tokyo, take that direction." The beauty is that if a road is congested or interrupted, routers can collaborate to find alternative paths, just as your smartphone's navigator would do.
Static vs Dynamic Routing
Router "road maps" can be configured in two ways:
Static Routing
Manually configured by the administrator
Fixed routes that don't change automatically
Advantages: simple, predictable, low overhead
Disadvantages: doesn't adapt to network changes
Ideal for: small networks with simple and stable topology
It's like always following the same route to go to work, regardless of traffic.
Dynamic Routing
Routers exchange information about available routes
Automatically updates based on network changes
Reacts to failures by finding alternative paths
Requires more resources (CPU, memory, bandwidth)
Ideal for: medium and large networks with complex topologies
It's like using a GPS navigator that updates in real-time with traffic information.
Routing Protocols: The Languages Routers Use to Communicate
Routers use various protocols to exchange information about available routes:
RIP (Routing Information Protocol)
One of the oldest and simplest
Uses "hop count" as metric (max 15 hops)
Easy to configure but slow to converge
Suitable for small networks
OSPF (Open Shortest Path First)
"Link-state" protocol: each router has a complete map of the network
Metric based on path cost (influenced by bandwidth)
Converges quickly to changes
Supports large networks divided into areas
Widely used in enterprise networks and by ISPs
BGP (Border Gateway Protocol)
The "routing protocol of the Internet"
Connects different Autonomous Systems (AS) - large networks with autonomous management
Policy-based routing rather than just shortest path
Extremely scalable but complex
Used by Internet service providers for global route exchange
A Day in the Life of an IP Packet
Let's imagine a packet's journey from your computer to a web server:
You type www.example.com in the browser
Your computer asks DNS to resolve the name to an IP address
Your computer prepares an HTTP packet with that IP as destination
Checks if the IP is on the same local network (comparing with the subnet mask)
Not being on the local network, sends the packet to the default gateway (your router)
The home router:
Modifies the source address (NAT)
Consults its routing table
Forwards the packet to the ISP's router
The ISP's router consults its routing table and forwards the packet
The packet traverses a series of routers, each making an autonomous decision on the best "next hop"
Finally, the packet arrives at the destination network's router
This delivers it to the web server
The server processes the request and sends a response
The response follows a similar path (not necessarily identical) to return to your computer
All this happens in fractions of a second, thousands of times a day, for billions of devices worldwide. A perfectly orchestrated digital choreography!
Conclusion:
The Invisible Orchestra
Computer networks are like a symphony orchestra: each component plays its own instrument following a precise score, together creating a harmonious melody. From the simplicity of a cable to the complexity of the global Internet, it's the interaction between these technologies that makes our digital world possible.
What makes networks truly extraordinary is their ability to function without people needing to understand them. We don't need to understand electromagnetic wave theory to make a call, nor do we need to know dynamic routing to watch a YouTube video. The abstraction is so complete that complexity disappears, leaving only the user experience.
The next time you send an email, watch a streaming video, or make a video call, think for a moment about the incredible journey that data takes: from your fingers, through layers of software, undersea cables, satellites and data centers, until it reaches the recipient on the other side of the world, all in a fraction of a second. It's one of humanity's greatest technological achievements, an invisible orchestra playing in perfect sync, allowing us to be connected like never before in history.
Computer networks have broken down barriers of distance and time, making possible a world where information travels at the speed of light. They have democratized knowledge, transformed the global economy, and forever changed the way we communicate, work, and live.
Whether you're a simple user or a future network engineer, understanding even just the basics of this complex system helps you better appreciate the magic that happens every time you connect. After all, behind every click, every download, every message, there's an incredible dance of protocols, devices, and technologies working together to make possible what we now take for granted: a connected world.
This article is part of the "Networking Fundamentals" series by NetworkCaffè, where technology, philosophy, and culture meet.