DEV Community

JAYA SRI J
JAYA SRI J

Posted on

how a request originates from client and reaches server

How a Request Travels from Client to Server

Every time you open a website, send a message, or watch a video online, something fascinating happens behind the scenes. A simple action—like typing a URL—sets off a chain reaction across the internet.

But how exactly does your request travel from your device (the client) to a server somewhere in the world?

Step 1: You Make a Request

It all starts with you.

You open your browser and type something like:

www.wikipedia.org.
Enter fullscreen mode Exit fullscreen mode

At this moment, your device (phone, laptop, etc.) becomes the client, and it’s asking:

“Hey, can I see this website?”


Step 2: The Browser Checks Cache

Before going out to the internet, your browser does a quick check:

  • “Do I already have this data saved?”

If yes, it loads instantly.
If not, it proceeds to the next step.

This saves time and reduces unnecessary network traffic.

Step 3: DNS — Finding the Server’s Address

Humans use names like wikipedia.org, but computers need numbers.

So your system contacts a DNS (Domain Name System) server to translate the domain into an IP address.

Think of DNS as the internet’s phonebook.

Example:

www.wikipedoa.org → 10.1.34.81
Enter fullscreen mode Exit fullscreen mode

Now your device knows where to send the request.

Step 4: Building the Request

Your browser now prepares a proper request using a protocol called HTTP (or HTTPS).

This request includes:

  • The resource you want (like a webpage)
  • Your browser details
  • Other metadata

It’s like writing a letter with:

  • Address
  • Message
  • Sender info Step 5: Breaking Data into Packets

The request doesn’t travel as one big chunk.

Instead, it is broken into small packets. Each packet contains:

  • Part of the data
  • Source IP (your device)
  • Destination IP (server)
  • Sequence info

Why?
Because smaller pieces travel faster and more reliably.

Step 6: Traveling Across the Network

here we can see the forward proxy and reverse proxy
FORWARD PROXY :
where it multiple requests goes to internet.
REVERSE PROXY:
where it comes from the internet.

Your packets travel through:

Each router acts like a traffic controller, deciding:

“Where should this packet go next?”

Packets don’t always take the same path—but they all eventually reach the destination.

Step 7: Reaching the Server

Finally, the packets arrive at the server.

The server:

  1. Reassembles the packets
  2. Understands the request
  3. Processes it

Step 8: Server Sends a Response

Once processed, the server sends back a response.

This response is again:

  • Broken into packets
  • Sent back through the internet
  • Routed back to your device

Step 9: Browser Renders the Page

Your device receives the packets and:

  1. Reassembles them
  2. Interprets the content
  3. Displays it on your screen

And just like that—you see the website.

All of this typically happens in milliseconds.
A Simple Real-Life Analogy

Imagine ordering food online:

  1. You place an order (request)
  2. App finds the restaurant (DNS)
  3. Order is prepared (server processing)
  4. Delivery travels through roads (network routing)
  5. Food reaches you (response)

Top comments (0)