This tutorial explains the traffic flow, technology and protocols involved when a Web client( browser) and a Web Server (Website hosted on a Server).
In the above 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. 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 sequence 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 – www.tcpipguru.com
2. The PC has to identify the IP address corresponding to the name 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 succesfull, the Web client and the server exchanges data with TCP.
7. The data is the contents of the Website which is ultimately viewed on the browser by the user on the PC.
Buy the network communication Ebook – Contains 100 case studies – Click to view sample