Uni-Sine
Computer ScienceNetworks

How does the internet work?

How does the internet work? The internet is a worldwide network of networks. When you send anything, from a message to a request for a web page, it is split into small chunks called packets, each labelled with where it is going. Routers pass the packets from network to network, through your home, your internet provider and long-distance fibre links, until they reach the other device, which puts them back together. Shared rules called protocols make sure every device along the way understands them.

The internet and the World Wide Web

They are not the same thing. The internet is the network itself: the cables, routers and addresses that move packets between billions of devices. The World Wide Web is one service that runs on it, made of web pages fetched with the HTTP and HTTPS protocols. Email, video calls and online games also use the internet without being part of the web. The AQA GCSE specification describes the internet as the biggest example of a WAN, a wide area network.

What happens when you open a website

Say you type a web address into your phone at home. In about a second, this happens:

  1. DNS lookup. Packets need a number, not a name, so your phone asks a DNS server for the site's IP address. If no one nearby has the answer saved, the lookup works through root, top-level domain and the site's own name servers.
  2. Wi-Fi to the router. Your phone sends packets by radio to the wireless access point in your home router box. Anything for another network goes to the router, your default gateway.
  3. Out through the modem. The router swaps your phone's private address for the home's one public address (this is NAT), and the modem, or ONT on full fibre, turns the data into signals for the line out of your home.
  4. Across the internet. Your internet service provider (ISP) passes the packets to other networks over high-speed fibre links. Each router reads the destination address and sends the packet one hop closer.
  5. At the server. The web server receives the request, which says which page you want, and sends the page back as packets of its own.
  6. Back on your phone. The packets arrive, possibly out of order, are put back in sequence, and your browser draws the page.

Put the hardware in order yourself, then press Mark to check it in the course:

Practice: order the hardware a request passes through on its way to the internet.

Press Mark to have your answer marked in the Networking Hardware course.

Packets and packet switching

A file is never sent in one piece. A 1.5 MB photo crosses the internet as roughly 1,000 packets, because on a typical Ethernet or Wi-Fi link each packet carries at most about 1,500 bytes. Every packet has a header holding the source and destination IP addresses and a sequence number, followed by its share of the data.

Each packet is routed on its own, so packets from the same file can take different paths and arrive out of order. The receiving device uses the sequence numbers to rebuild the file, and TCP asks again for any packet that went missing. This is packet switching.

Packet switching vs circuit switching

Packet switching (the internet)Circuit switching (old phone calls)
PathEach packet finds its own routeOne fixed path reserved for the whole call
SharingMany users share every link at onceThe circuit is reserved even when nobody speaks
If a link failsRouters send packets round itThe call drops
DelayCan vary with trafficSteady once connected

Packet switching uses the network far more efficiently and keeps working when parts fail, which is why the internet is built on it.

Addresses: IP, MAC and ports

An IP address says which device, and which network, a packet is for, and routers use it to choose the next hop. Inside one local network, switches deliver frames using each network card's MAC address. A port number then picks the right program on the device: 443 for secure web pages, for example. The IP Addressing & Protocols course covers subnets, NAT, DHCP and DNS in detail.

Protocols and the TCP/IP model

A protocol is a set of rules for how data is formatted and sent. Internet protocols are grouped into the four layers of the TCP/IP model, and each layer only deals with its own job.

LayerWhat it doesExamples
ApplicationWhere programs such as browsers and email apps workHTTP, HTTPS, SMTP, IMAP, DNS
TransportSets up the connection between the two devices, splits data into numbered pieces and checks it all arrivesTCP, UDP
InternetAdds IP addresses and routes packets across networksIP
LinkThe network hardware that moves data over one physical linkEthernet, Wi-Fi

Going out, each layer wraps the data from the layer above with its own header. Coming in, each layer unwraps its part and passes the rest up. TCP is the protocol that makes delivery reliable; HTTPS adds encryption so others on the network cannot read your data.

The physical internet

Under all the protocols is real hardware. Homes connect over phone lines, TV cables or fibre to the ISP. ISPs connect to each other and to large backbone networks through fibre optic cables, which carry data as pulses of light through thin glass strands, over very long distances and at very high speeds. Cables laid across the sea floor link the continents, and data centres full of servers sit at the ends.

Common mistakes

  • Calling the web the internet. The web is one service that runs over the internet.
  • Calling Wi-Fi the internet. Wi-Fi only links your device to your router. You can have Wi-Fi with no internet connection.
  • Saying packets all follow the same route. Each packet is routed separately.
  • Mixing up the router and the modem. The router directs packets between networks; the modem turns data into signals for the line. Home boxes usually combine both.

Common questions

How does the internet work in simple terms?
Your data is cut into small labelled packets. Routers pass each packet towards its destination address, network by network, and the receiving device puts them back together. Protocols are the shared rules that let every device understand each other.
Who owns the internet?
No single company or country. It is thousands of separate networks, run by internet providers, universities, businesses and governments, that agree to connect and exchange traffic using the same protocols.
What is packet switching?
A way of sending data where it is split into packets that each travel independently, possibly by different routes, and are reassembled in order at the destination. It lets many users share the same links.
What is the difference between the internet and the World Wide Web?
The internet is the global network that moves data. The web is a collection of linked pages and sites that you reach over the internet using HTTP or HTTPS.
What does an ISP do?
An internet service provider connects your home or business to the internet, gives your connection a public IP address, often runs DNS servers, and passes your traffic on to other networks.
What are the four layers of the TCP/IP model?
Application, transport, internet and link. The application layer holds programs such as browsers, the transport layer manages the connection, the internet layer addresses and routes packets, and the link layer is the network hardware.

Revision cards

Say the answer first, then flip the card to check it.

Where to go next

  • Learn it

    Networking Hardware

    Routers, switches, access points and how they connect the world

    Start the course
  • Test it

    GCSE Computer Science

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Computer Science · NetworksWhat is TCP? How it works, the handshake and TCP vs UDPWhat TCP is, how the three-way handshake, sequence numbers and resends make data arrive in order, the TCP/IP model, and TCP vs UDP with examples.