Deep dive into the workings of the WEB

The web is an application(a system of interlinked hypertext documents) that seats on the interconnected network or as you know it the Internet. Resources within the web are transferred via the Hypertext Transfer Protocol(HTTP).

Accessing a hypertext document involves communication between two end devices(usually between a device called a client with a web browser and a device with a web server). This communication is facilitated by the interconnected network in translation networking devices such as routers and switches to name a few, protocol suites mainly TCP/IP and OSI.

I would use the OSI model to explain this communication. The layers of the model are listed below:

7)Application layer 6)Presentation layer 5)Session layer 4)Transport layer 3)Network layer 2)Data Link layer 1)Physical layer

At the application layer of the client device, the DNS client sends a DNS query to a DNS server when a user types in a domain name(such as google.com) in a browser to convert this domain name into an IP address which it would use to locate Google's server and make the request for its web page. After a successful query, the DNS server replies with a DNS Answer which contains the IP address of Google's server.

At the Transport layer, the client device then encapsulates the PDU(Protocol Data Unit) in this case the request into a TCP segment. Encapsulation involves breaking up the data for more efficient transmitting through different routes. These broken data are also labeled to enable the other end device to reassemble the message in the right order.

At the Network layer, the IP address(gotten from the DNS query) is included and the shortest route to the server is determined.

At the Data Link and Physical layer, the data is then encoded into 1s and 0s and sent through the intermediary devices(routers, switches, ethernet, wireless, etc)

By now the data has gotten to the server which then goes through all this process in reverse to determine the content of the data. Figuring out it is a request for a web page, it now initiates the same process to get this web page to the source address.

When the web page gets to the client device, the presentation layer now presents the web page /Hypertext document into human-readable form.