Reading 1: How Data Travels: Packets and Layers

It gets there in pieces.

The Problem: Getting Data from Here to There

When you type a URL into your browser and press Enter, a webpage appears on your screen within a second or two. That webpage might be stored on a server on a different continent. The data had to travel through dozens of routers, across physical cables and wireless links, through multiple networks operating under different protocols — and it arrived correctly, in order, almost instantly.

How does that work? The answer is a layered software architecture that divides the job of moving data into distinct responsibilities, each handled by a different layer of software. Every device connected to the Internet runs this same software stack, which is what makes it possible for a laptop in Iowa to communicate reliably with a server in Singapore.

A Useful Analogy: Shipping a Package

Before diving into the technical layers, consider how a physical package travels across the country. If you ship a gift from Iowa to a friend in New York, the process involves a hierarchy of participants:

Notice that each level uses the level below it without needing to understand its details. You do not know how the airline routes its flights. The shipping company does not know what is inside your package. Each layer does its job and hands off to the next.

Internet communication works the same way — but with software layers instead of people and businesses.

The Four Software Layers

Internet software is organized into four layers. A message starts at the top and passes down through the layers as it is prepared for transmission. At the destination, it passes back up through the layers until it arrives at the application that was waiting for it.

Layer Analogy What It Does
Application You (the sender/recipient) Creates and consumes messages — your browser, email client, or streaming app lives here
Transport The shipping company Breaks messages into packets for transmission; reassembles them at the destination
Network The airline Decides which direction each packet should travel at each step; lives on routers
Link The physical aircraft Handles the actual transmission of each packet across one network segment (Ethernet, WiFi, fiber, etc.)

Each layer communicates only with the layers directly above and below it. The application layer does not know or care whether the link layer is using WiFi or fiber optic cable. The link layer does not know or care whether the message is an email or a webpage. This clean separation of responsibilities is what allows the Internet to work across so many different physical technologies and application types.

Why Messages Are Broken into Packets

The transport layer does not send a message as one unbroken stream of data. It divides long messages into small, numbered chunks called packets. Each packet travels independently through the Internet and is reassembled into the original message at the destination.

Why break messages into pieces? Imagine the Internet as a network of busy intersections. If one vehicle (a long message) occupied every lane at once for a long time, everything else would be stuck waiting. Short packets, by contrast, can interweave at routers — a packet from your email slips through between packets from someone else's video call. The result is that the network serves many users simultaneously, with no single long message blocking others.

The transport layer adds sequence numbers to each packet so that the destination's transport layer can reassemble them in the correct order even if they arrive out of sequence — which they often do, since different packets may take different routes through the Internet.

This is packet switching. The Internet is a packet-switched network: data is broken into packets, each of which is independently routed through the network and reassembled at the destination. This is fundamentally different from a circuit-switched network (like old telephone systems), where a dedicated connection was held open for the entire duration of a call. Packet switching is more efficient because the network capacity is shared rather than reserved.

How Packets Find Their Way: Routing

Once the transport layer has created packets, the network layer takes over. Its job at each router along the path is simple but critical: look at the packet's destination address, consult the router's forwarding table, and decide which direction to send the packet next.

Packets do not travel along a pre-determined fixed path. Each router makes an independent forwarding decision based on current network conditions. If one path is congested or a router has failed, packets can be rerouted around the problem — this is the Internet's famous fault tolerance in action. The redundancy of paths between any two points means the network can route around damage or failure automatically.

Each packet also carries a hop count (sometimes called "time to live") — a counter that decrements by one at each router. If the hop count reaches zero, the packet is discarded. This prevents misdirected packets from circling the Internet forever, consuming bandwidth and never arriving.

The Full Journey: How a Webpage Reaches Your Browser

Now we can trace the complete sequence of events that happens when you type a URL into your browser and press Enter. Every step happens in well under a second.

Step What Happens Layer / Component
1. DNS lookup Your browser extracts the domain name from the URL (e.g., wikipedia.org) and asks a DNS server to translate it into an IP address. Application layer + DNS server
2. HTTP request formed Your browser creates an HTTP request message asking the web server for the specific page you want (identified by the URL's directory path and document name). Application layer (browser)
3. Message broken into packets The transport layer divides the HTTP request into numbered packets, each addressed to the web server's IP address. Transport layer
4. Packets routed across the Internet Each packet hops from router to router. At each stop, the network layer consults the forwarding table and sends the packet in the right direction. Different packets may take different paths. Network + Link layers (routers)
5. Packets received and reassembled The transport layer at the web server collects all the arriving packets and reassembles the original HTTP request in sequence-number order. Transport layer (server side)
6. Web server responds The web server's application layer processes the request and sends back the webpage content (HTML, images, etc.) as an HTTP response. This response goes through the same four-layer process in reverse, traveling back to your browser. Application layer (web server)
7. Browser displays the page Your browser's application layer receives and reassembles the response, interprets the HTML, and renders the page on your screen. Application layer (browser)

This entire process — DNS lookup, packet transmission across potentially dozens of routers, reassembly, server processing, and response delivery — typically completes in under one second for a simple webpage. The speed comes from the fact that every step is automated, every router forwards packets in microseconds, and the whole system was designed from the start to be fast, redundant, and fault-tolerant.

For your classroom: The next time a student complains that a webpage is loading slowly, you can now identify where the slowness might be. Is DNS taking too long? Is the server overloaded? Are packets being rerouted around congestion? Is the last mile connection to the school slow? Each of these is a real, diagnosable cause, and each corresponds to a specific part of the journey you just traced.