How Is Data Sent Over the Internet? Packets and Routers

14 min read · Updated: October 23, 2026

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.

  1. Look up the server's number from the site's name (for example, www.example.com)
  2. Get ready to start talking with the server
  3. Send a request: "Please send me this page"
  4. The page's data arrives, split into many chunks
  5. 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.

One piece of data is cut into small pieces, and each gets a header to become a packet Data to send (e.g. a photo) 1 2 3 4 1 2 3 4 Add a header: now a packet Inside one packet Header Piece of data To, from, etc. Part of the original
Large data is cut into small pieces, and each piece with a header attached is a packet. Left out: headers are stacked, one per layer (see the "layers" section later), and real data is cut into far more pieces.

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.

From a phone to a server, packets pass through routers in turn. When a line fails, they take another path Phone Wi-Fi Home router Network providers' routers R R R R Server Usual path Path after a failure R = router
Each router looks at the destination and picks only "the next neighbor." If a line on the way fails (×), the routing tables change and packets take another path. Left out: the real number of routers (far more), and long lines such as undersea cables.

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.

LayerMain protocolsJob
Application layerHTTP, HTTPS, DNSThe content of the conversation between the browser and the server
Transport layerTCP, UDPFixing lost or out-of-order data (TCP)
Internet layerIPDelivering across networks to the destination
Link layerWi-Fi, EthernetCarrying 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.

The layers of a phone, a router and a server. The sender passes data from top to bottom, the receiver from bottom to top, and the router goes up to the IP layer Phone Router Server HTTP TCP IP Wi-Fi IP Link HTTP TCP IP Wired Top down Reads up to IP Bottom up Each layer adds a header, then it is removed
The sender stacks on headers starting from the top layer, and the receiver removes them starting from the bottom layer. A router on the way usually reads only up to the IP layer. Left out: the many routers in between, the number rewriting done by the home router (NAT, see later), and the encryption layer of HTTPS.

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

ItemNumberFor comparison
Size of one packet (wired network, Wi-Fi)usually up to 1,500 bytesabout 700 for a 1 MB photo
Number of IPv4 addressesabout 4.3 billion (2 multiplied by itself 32 times)fewer than the world's population
Speed of light in optical fiberabout 200,000 km per secondabout 5 microseconds per km
Round trip, Tokyo–Osaka (about 400 km in a straight line)about 4 msthe 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 cablesover 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

Read next

Articles in the series “Networks and the internet”

  1. How Is Data Sent Over the Internet? Packets and Routers
  2. What Is an IP Address? IPv4, IPv6 and Private IPs Explained
  3. How Does Wi-Fi Work? Radio, Bands and Why Speeds Vary
  4. What Does HTTPS Mean? What the Padlock Does and Doesn't Do
  5. How Does DNS Work? From Domain Names to IP Addresses
  6. What Is 5G? How It Differs From 4G in Speed and Latency
  7. TCP vs UDP: What's the Difference? Reliability vs Speed
  8. How Does Bluetooth Work? Pairing, Hopping and BLE Explained
  9. What Is IoT? How Everyday Things Connect to the Internet
  10. What Is Ethernet? How a Wired LAN Carries Your Data
  11. What Is an API? Requests, JSON, API Keys and Integration
  12. How Do Web Browsers Work? What Happens After You Type a URL

Questions on this topic: Computer Networking Basics

Sources

All explainers