How Is Data Sent Over the Internet? Packets and Routers
The internet sends data in small chunks called "packets." Each packet carries the number of its destination (an IP address). Devices along the way called "routers" read that number and pass the packet on, one after another. When the packets arrive, the receiver puts them back in order and rebuilds the original data.
What you'll learn
- The steps that happen behind the scenes when you open a web page
- What packets, IP addresses and routers each do
- Why the work of communication is split into four "layers"
- Why data travels fast even through many devices, and where delays come from
Prerequisites: none. If you have ever looked at a web page on a phone, that is enough.
In everyday life
Tap a link to a news story on your phone, and the page usually appears in less than a few seconds. Its data comes from a computer somewhere far away. A computer that hands out data when asked is called a "server."
This article walks through what happens behind the scenes when you open one web page. Here is the rough flow.
- Look up the server's number from the site's name (for example, www.example.com)
- Get ready to start talking with the server
- Send a request: "Please send me this page"
- The page's data arrives, split into many chunks
- The phone puts the chunks back together and shows the page
Data is sent in "packets"
On the internet, photos and page text alike are sent as rows of 0s and 1s. Large data is not sent in one long piece. It is cut into small chunks, which are sent one at a time. Each chunk is called a packet.
A packet starts with a section that holds the destination's number, the sender's number and other details. This section is called the "header." The receiver uses the headers to collect the pieces and rebuild the original data.
There is a size limit for one packet. On home wired networks and Wi-Fi, it is usually 1,500 bytes (1 byte is eight 0s and 1s in a row). A 1 MB (1 million bytes) photo works out to about 700 packets.
There are two main reasons to go to the trouble of cutting data up. First, many people can share one line. With small packets, different people's traffic can take turns, a little at a time. Second, if part of the data is lost on the way, only the lost pieces need to be sent again.
Old landline telephones worked the opposite way. For the whole call, they reserved an entire line to the other person. Even when no one was talking, nobody else could use that line. The idea of cutting data up and sharing lines was developed in the 1960s, and it became the foundation of the internet.
IP addresses: the destination number on a packet
The destination on a packet is a number that identifies the other device. This number is called an IP address. Phones, PCs, servers: every device connected to the internet is given an IP address.
In the widely used format, an IP address looks like "192.0.2.10." It is four numbers from 0 to 255, separated by dots. In 0s and 1s it is 32 digits long, so only about 4.3 billion addresses are possible. That is not enough for all the devices in the world. So a newer format with many more digits (IPv6) is being rolled out. "IPv4 vs. IPv6" compares them in a table.
The set of rules for delivering packets to their destination using IP addresses is called IP (Internet Protocol). IP focuses on sending packets toward their destination. Checking whether they arrived is not IP's job.
Routers choose only "where to go next"
The internet is made of many small networks joined together. There are home networks, company networks, the networks of telecom companies and more. A device that sits at the border between networks and hands packets to the next network is called a router.
A router reads the destination IP address from the header of each packet that arrives. Then it checks a table of its own to decide which neighboring router to hand it to. This table is called a routing table (see IP routing). It holds entries like "numbers in this range go to that neighbor."
The key point is that no router knows the whole route to the destination. Each one knows only "where to hand it next." The full route is not worked out before sending. Packets are carried from router to router, like buckets passed down a line of people.
Routers exchange information with each other and rebuild their routing tables automatically. If a line somewhere fails, the tables change to avoid that path. Packets to the same destination usually take nearly the same path. Even so, the path can change in the middle of a connection, and packets keep arriving afterward.
Splitting the work into four "layers"
The story so far mixed several different jobs. One job carries a signal to the next device. Another finds a route to a faraway destination. Another makes sure nothing is lost. The internet splits these jobs into "layers" and sets rules for communication in each layer. Such a set of rules is called a "protocol."
The layers are usually described as the four below (known as the four layers of TCP/IP). In the table, higher layers are closer to apps, and lower layers are closer to radio waves and cables.
| Layer | Main protocols | Job |
|---|---|---|
| Application layer | HTTP, HTTPS, DNS | The content of the conversation between the browser and the server |
| Transport layer | TCP, UDP | Fixing lost or out-of-order data (TCP) |
| Internet layer | IP | Delivering across networks to the destination |
| Link layer | Wi-Fi, Ethernet | Carrying data to the next device as radio, electrical or light signals |
The bottom layer, the link layer, only carries data to the next connected device. For a phone on Wi-Fi, its job ends at the home router. From there, Ethernet (the standard for wired networks) or fiber-optic lines carry the data on to the next device.
At the top, the rules for exchanging web pages are set by HTTP. HTTP defines the shape of the conversation: "Please send me this page." "Here it is." The layers below take over that conversation, one after another, and carry it to the other side.
With layers, you can swap one layer without touching the others. For example, switching from Wi-Fi to a wired network does not mean rebuilding the browser or IP.
In networking courses and certification exams, you will often also meet the OSI reference model, which sorts the same ideas into seven layers. It just divides things more finely; the idea of "one layer per job" is the same. Roughly, the link layer (also called the network interface layer) matches OSI layers 1–2, and the internet layer matches layer 3. The transport layer matches layer 4, and the application layer matches layers 5–7.
DNS: looking up a number from a name
People remember sites by names such as "www.example.com." But the destination on a packet must be a number (an IP address). So a system turns names into numbers. It is called DNS (the Domain Name System).
First, the browser asks a DNS server, "What is the number for this name?" Only after getting the answer can it send packets to the page's server. This is step 1 of the flow at the start. Answers are remembered for a while, so the browser does not ask again every time.
TCP and UDP: reliable or lightweight?
IP's job ends once it sends packets on their way. A router that gets too busy may throw packets away, and packets may arrive out of order. Web pages still show up complete thanks to a set of rules called TCP.
With TCP, the sender gives the data serial numbers. The receiver sends back replies saying, "Everything up to here has arrived." The sender sends again any part that gets no reply. The receiver uses the numbers to put the data back in the right order.
TCP also exchanges a short greeting with the other side to get ready before sending data. This is step 2 of the flow at the start. The greeting takes one round trip.
The other option, UDP, skips the numbering and resending; it just sends packets and moves on. With fewer steps, it can cut waiting time. It is used where data from "right now" matters more than data that arrives late, such as video calls and online games. DNS lookups also mainly use UDP.
The newer HTTP/3 puts a set of rules called QUIC on top of UDP, and QUIC handles resending and similar jobs. "TCP vs. UDP" and "HTTP/1.1 vs. HTTP/2 vs. HTTP/3" compare them in tables.
The home router and number rewriting (NAT)
A home Wi-Fi box is often a Wi-Fi access point and a router in one device. Phones and PCs in the home get numbers that work only inside the home. Numbers starting with "192.168." are common. With those numbers alone, replies from across the internet could not find their way back.
So the home router rewrites the sender's number on outgoing packets to its internet-facing number. The router keeps track of which connection belongs to which device. When reply packets come back, it changes the number back and delivers them. This rewriting is called NAT. It lets many devices share the only roughly 4.3 billion numbers available.
HTTPS and the lock icon
Devices along the way could read the contents of packets if they wanted to. So data is changed, before sending, into a form that only someone with the key can turn back. This is called "encryption."
The way of sending web traffic in encrypted form is HTTPS. HTTPS also checks whether the other side is the real server.
For this, the server shows a "certificate," a kind of digital ID card. A certificate is a guarantee from a trusted issuer that it has checked who owns the site's name. The browser checks that guarantee before it starts talking.
The lock icon in the address bar has shown that this check and the encryption are in place. But the lock does not mean "the people running this site can be trusted." Even scam sites can get certificates. To avoid this misunderstanding, Chrome replaced the lock with a different icon, starting with version 117 in 2023.
Why is it fast, even through many devices?
Long-distance links mostly use fiber-optic cable. It sends signals as light through a thin glass strand about as fine as a hair. Inside it, light travels about 200,000 km per second. That is about two-thirds of the speed of light in a vacuum (about 300,000 km per second).
Per kilometer, that is about 5 microseconds (a microsecond is a millionth of a second). The time from sending data until a reply comes back is called the round-trip time (RTT). Tokyo and Osaka in Japan are about 400 km apart in a straight line. So the RTT is at least about 4 ms (a millisecond is a thousandth of a second). Real cables do not run in straight lines, so the actual path is longer.
Tokyo and Los Angeles are about 8,800 km apart along the shortest path over the Earth's surface. A round trip over fiber takes about 88 ms for the distance alone. Verizon, a US telecom company, publishes round-trip times between its hubs in the two cities. The monthly average in early 2026 was about 110 ms. The gap of about 20 ms comes from cables taking longer paths, and from processing and queuing in devices along the way.
When routers are not busy, their processing takes little time. For a faraway destination, most of the wait is the time the signal spends covering the distance. Most traffic across oceans goes through fiber-optic cables laid on the seabed. In a 2023 check, the research firm TeleGeography said this is true for over 99% of data between continents.
Common misconceptions
Myth: There is one private line between you and the server
In fact, lines are shared by many people, and your packets travel mixed in with everyone else's. The route is not fixed in advance either. Routers choose the next stop on the spot, and the route can change along the way. This idea is easy to pick up from the image of a phone call "connecting a line."
Myth: Wi-Fi and the internet are the same thing
In fact, Wi-Fi is only the radio link between your phone and your home router (the access point). Beyond that, lines such as fiber connect to the telecom company's network. That is why "connected to Wi-Fi, but no internet" can happen.
Myth: A faster connection speed always means faster responses
In fact, a number like "1 Gbps" is the amount of data that can be sent per second (bandwidth). It is not the same as the time until a reply comes back (RTT). For example, a small 100 KB piece of data takes about 8 ms at 100 Mbps and about 0.8 ms at 1 Gbps. But if the server is in the US, the round trip alone can take more than 100 ms.
So for small exchanges, ten times the bandwidth barely shortens the wait. Bandwidth makes the biggest difference for large file downloads. (This is simplified and leaves out TCP's detailed behavior.) You can try the math with the data transfer time calculator.
By the numbers
| Item | Number | For comparison |
|---|---|---|
| Size of one packet (wired network, Wi-Fi) | usually up to 1,500 bytes | about 700 for a 1 MB photo |
| Number of IPv4 addresses | about 4.3 billion (2 multiplied by itself 32 times) | fewer than the world's population |
| Speed of light in optical fiber | about 200,000 km per second | about 5 microseconds per km |
| Round trip, Tokyo–Osaka (about 400 km in a straight line) | about 4 ms | the floor set by distance alone |
| Round trip, Tokyo–Los Angeles (about 8,800 km at the shortest) | about 88 ms (floor) | measured: about 110 ms (Verizon, monthly average, early 2026) |
| Share of data between continents that goes through undersea cables | over 99% | TeleGeography's check (2023) |
"Floor" means the time for a round trip over the shortest distance at the speed of light in fiber. A real round trip can never be shorter than this.
Learn more
- Compare in a table: hub vs. switch vs. router (devices in home and office networks)
- Try the math: the IP subnet calculator (splits an IP address into a "network part" and a "device part")
- Terms for the next step: MAC address, default gateway, DHCP (how a home network works)
- More on HTTPS: certificate authority (the issuer of certificates), TLS (the encryption rules behind HTTPS)
- See the route yourself: traceroute (a command that lists the routers a packet passed through)
- Start from the foundation: servers and phones alike have a CPU inside that carries out instructions. See "What Is a CPU?"