Assume that you have made a request for a web page through your web browser to a web server. Initially the browser cache is empty. Further, the browser is configured to send HTTP requests in non-persistent mode. The web page contains text and five very small images. The minimum number of TCP connections required to display the web page completely in your browser is ________.
GATE 2020 CS Q.25: solution and answer
Answer and solution
ANSWER
The minimum number of TCP connections required is 6.
Official answer: 6Source: Official answer key, GATE 2020 CS (IIT Delhi)
With non-persistent HTTP, every object is fetched over its own TCP connection, and the server closes that connection after sending the object.
The browser cache is empty, so nothing can be reused. The browser has to fetch the base HTML file, which holds the text, and then each of the five images.
The base HTML file needs 1 TCP connection.
Each of the 5 images is a separate object and needs its own connection: .
Total connections . Each object is fetched exactly once, so this is the minimum.
KEY IDEA
In non-persistent HTTP, each object (the base HTML file and every embedded image) needs its own TCP connection. With an empty cache, the number of connections is 1 + the number of images.
WATCH OUT FOR
Counting only 5 connections (the images alone) and forgetting the base HTML page. Another slip is to assume one connection can be reused for all objects, which is persistent HTTP and not what is asked here.
From the GATE 2020 CS paper. Every question of this paper · Download the full paper · All 5 DNS & HTTP questions, with notes
More DNS & HTTP questions
- GATE 2026 CS1 Q.19 · MSQ · 1 markWhich of the following statements is/are true with respect to the interaction of a web browser with a web…
- GATE 2024 CS1 Q.16 · MCQ · 1 markA user starts browsing a webpage hosted at a remote server. The browser opens a single TCP connection to…
- GATE 2023 CS Q.52 · MSQ · 2 marksSuppose in a web browser, you click on the www.gate-2023.in URL. The browser cache is empty.
