Home »

How does communication between webclient and web server work. ?

Question ListCategory: NetworkingHow does communication between webclient and web server work. ?
alisataylore190 author asked 2 years ago
1 Answers
jully882 author answered 10 months ago

In the below diagram, the PC is on the internal network with the IP address 192.168.1.2.
The default gateway of the PC is configured as 192.168.1.1, which is the LAN IP address

of the router. The WAN interface of the router is connected to the internet and has a public

IP address provided by the ISP. NAT is configured on the router for allowing internal IP

addresses to be sent out to the internet. The DNS server used by the ISP is as shown in the

diagram.

5242

The Web server, which hosts the Website, has a public IP. The DNS Server contains the IP

address to domain name mapping for the IP address and domain name of the website on

the Web Server. The following sequences of events are followed when a user on the PC

types the URL of the website and views the website content on the browser.

1. User opens the browser on the PC and types the URL of the website –

http://www.tcpipguru.com

2. The PC has to identify the IP address corresponding to the name http://www.tcpipguru.com.

For this the TCP/IP on the PC sends a DNS request to the DNS server IP address which is

configured on it’s TCP/IP adapter alongside the IP address.

Note: If the DNS server IP address is not provided, the communication would fail and the

website cannot be viewed.

3. In a typical scenario, the DNS server IP address is provided as the LAN IP address of

the router. When the router receives the DNS request packet, it forwards it to the actual

DNS server residing on the internet.

4. The DNS server responds with the IP address corresponding to the domain

name,www.tcpipguru.com to the PC.

5. Once the PC receives the IP address of the webserver on which the website is hosted, it

initiates a TCP 3 way handshake to the Web server on destination port 80. This is because,

HTTP communication on Web servers are on port 80.

6. Once the TCP 3 way handshake is successful, the Web client and the server exchanges

data with TCP.

Please login or Register to Submit Answer