DEV Community

Abirami Prabhakar
Abirami Prabhakar

Posted on

How a Request Travels from Client to Server

We use the internet every day—scrolling, clicking, searching—but rarely stop to think about what actually happens behind that one simple action. Let’s say you type google.com or click a button on a website. That tiny action quietly triggers a full journey across the internet.

It all starts with your device, also called the client. The moment you enter a URL, your system doesn’t immediately know where to go. Computers don’t understand names—they understand IP addresses. So your device reaches out to DNS (Domain Name System) to translate that human-friendly name into an IP address. You can think of DNS as a contact list—it converts names into numbers.

Once the IP address is found, your browser prepares an HTTP request. This request contains things like the method (GET, POST), headers, and some metadata about what you’re asking for. Before it is sent, the request goes through the TCP/IP protocol stack, where a connection is established using the TCP three-way handshake to ensure reliable communication.

Now comes the interesting part—the request is broken into smaller chunks called packets. These packets travel across multiple networks, routers, and systems using IP routing. Each router along the way decides the best possible path, kind of like how maps choose the fastest route.

Eventually, these packets reach the server. The server reassembles them, understands the request, and processes it. This might involve fetching data from a database, running backend logic, or simply returning a static webpage.

Once done, the server sends back an HTTP response—again in packets. These travel all the way back to your device, where they are reassembled, and your browser finally renders the content on your screen.

Top comments (0)