๐ŸŒ Networks & infrastructure

How the Internet Works: A Packet's Journey from PC to Server

What really happens when you open a website: local network, router, ISP, autonomous systems, BGP and IP packets explained clearly, one step at a time.

The Internet is not one giant cable, nor a central authority that sorts traffic. It is a federation of tens of thousands of independent networks that agreed to speak the same language and exchange traffic. Understanding how these pieces fit together helps you make sense of everyday problems: a slow website, a service that is unreachable only from certain providers, a video call that keeps freezing.

The starting point: your local network

When you type a website address, your device sits inside a local network (LAN), usually managed by your home or office router. On this network every device has a private IP address, such as 192.168.1.20, assigned automatically by the router via DHCP.

The device knows two essential things:

  • which addresses belong to the local network and can be reached directly;
  • which is the default gateway, the router that receives everything destined for the outside world.

Before sending any data, however, it has to turn the site name into an IP address. That is the job of DNS, which queries one or more servers to get the answer.

Packets: the Internet carries pieces, not files

No page travels whole. Data is split into packets, each with a header containing the source IP address, the destination address and other control information. On a typical Ethernet or Wi-Fi network an IP packet is no larger than about 1500 bytes.

Transport protocols work on top of IP:

  • TCP guarantees that all data arrives, in the right order, retransmitting whatever gets lost. It is traditionally used by the web, email and file transfers.
  • UDP sends packets without acknowledgements. It is lighter and favoured by real-time applications such as voice and gaming, and by modern protocols like QUIC, the foundation of HTTP/3.

The home router and the ISP

The router receives the packet and, on most home IPv4 connections, applies NAT: it replaces your device's private address with the public address the provider assigned to your line. It then forwards it to the provider's network over the access technology: fibre, copper, radio or mobile.

Inside the provider the packet crosses several devices: aggregation equipment, access routers, backbone routers. Each one looks at the destination address, checks its own routing table and decides which next device to send it to. No router knows the full path: each one knows only the best next hop.

Autonomous systems and BGP: how networks agree

Every large network (ISPs, backbone carriers, large companies, cloud services) forms an autonomous system (AS), identified by a unique number. Autonomous systems announce to each other which blocks of IP addresses they can reach, using the BGP protocol (Border Gateway Protocol).

There are two main kinds of relationship between networks:

Relationship How it works Example
Transit One network pays another to reach the whole Internet A small ISP buys transit from an international carrier
Peering Two networks exchange their customers' traffic directly, often without payment Two national ISPs connected at an exchange point

Internet Exchange Points (IXPs) are facilities where many networks connect physically to peer. If your provider and the network hosting the site meet at a nearby IXP, traffic stays short and fast; if it has to cross Europe and come back, latency goes up.

BGP picks routes based on commercial and technical policy, not just geographic distance. That is why a site may respond well on one provider and poorly on another: the paths are different.

Arriving at the server

When the packet reaches the destination network, it is delivered to the server, or more often to an intermediate system: a load balancer, a reverse proxy or a CDN node. These components receive the request, hand it to the application that generates the page and send the response back, which may follow a different path from the outbound one.

If the site uses HTTPS, a TLS negotiation takes place before content is exchanged, establishing an encrypted channel. This adds one or more round trips, which is why latency weighs so heavily on page load times.

Why this picture is useful

Knowing the chain helps you locate faults:

  1. If you cannot even reach the router, the problem is on the local network (cable, Wi-Fi, IP address).
  2. If you reach the router but no website, the problem is probably the line or the provider.
  3. If some sites work and others do not, suspect DNS or a specific routing issue.
  4. If only one service is slow, the cause may be the path to that network or the server itself.

Tools such as ping and traceroute let you check each of these steps and gather hard data before calling support.

In short

  • The Internet is a set of independent networks, autonomous systems, that exchange traffic using BGP.
  • Data travels split into IP packets, carried by TCP or UDP.
  • Each router knows only the next hop, not the whole path.
  • Peering and exchange points determine how short the route to a service is.
  • Thinking in segments (LAN, line, ISP, destination) makes troubleshooting much easier.
MM
Marco Marzaduri

Marco Marzaduri works in cybersecurity, digital forensics and web development. A computer science graduate, he combines rigorous technical analysis with attention to the people who use technology.

Read also