DEV Community

Ashiq Omar
Ashiq Omar

Posted on

HOW A REQUEST ORGINATES FROM CLIENT AND REACHES THE SERVER?

How a Request Travels from Client to Server

A client is simply the end user who makes a request, usually by typing something like a website name into a browser. This request is in a human-readable format. computers dont understand domain names directly the system needs a way to convert this into a machine-readable format. Thats where the Domain Name System comes in.

What Happens Behind the Scenes

  • When a user enters a domain like www.google.com the request is first handled by DNS
  • DNS translates the domain name into an IP address which is what servers actually understand.
  • Once the correct IP address is found, the request is sent to the appropriate server where the required data is stored.
  • After processing the request the server sends the response back. Even though the communication happens using IP addresses the browser presents everything in a human-readable format.

Example
Request:
www.google.com
DNS converts it into an IP address like:
www.google.com
→ 126.xxx.xxx.0
This IP address helps identify the exact server where the website is hosted.

Role of Protocols and Data Transfer

  • When the request is sent, it uses protocols like HTTP or HTTPS. These protocols define how data is transferred between the client and the server.
  • The request includes important details like:
    Source IP address
    Destination IP address

  • The data is then broken into smaller packets. These packets travel through multiple routers across the internet.

  • Routers make sure the packets reach the correct destination without data loss.

  • Once the server receives the request, it processes it and sends the response back in the same way through the internet and routers, until it reaches the users browser.

Work Flow:

Top comments (0)