IAE Academy

GATE 2020 CS Q.25: solution and answer

GATE 2020 · CSQ.25 · 1 mark · NAT

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 ________.

See the question in the paper

Answer and solution

ANSWER

The minimum number of TCP connections required is 6.

Official answer: 6Source: Official answer key, GATE 2020 CS (IIT Delhi)

  1. With non-persistent HTTP, every object is fetched over its own TCP connection, and the server closes that connection after sending the object.

  2. 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.

  3. The base HTML file needs 1 TCP connection.

  4. Each of the 5 images is a separate object and needs its own connection: .

  5. 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