IAE Academy

GATE 2023 CS Q.52: solution and answer

GATE 2023 · CSQ.52 · 2 marks · MSQ

Suppose in a web browser, you click on the www.gate-2023.in URL. The browser cache is empty. The IP address for this URL is not cached in your local host, so a DNS lookup is triggered (by the local DNS server deployed on your local host) over the 3-tier DNS hierarchy in an iterative mode. No resource records are cached anywhere across all DNS servers.

Let RTT denote the round trip time between your local host and DNS servers in the DNS hierarchy. The round trip time between the local host and the web server hosting www.gate-2023.in is also equal to RTT. The HTML file associated with the URL is small enough to have negligible transmission time and negligible rendering time by your web browser, which references 10 equally small objects on the same web server.

Which of the following statements is/are CORRECT about the minimum elapsed time between clicking on the URL and your browser fully rendering it?

  1. (A)

    7 RTTs, in case of non-persistent HTTP with 5 parallel TCP connections.

  2. (B)

    5 RTTs, in case of persistent HTTP with pipelining.

  3. (C)

    9 RTTs, in case of non-persistent HTTP with 5 parallel TCP connections.

  4. (D)

    6 RTTs, in case of persistent HTTP with pipelining.

See the question in the paper

Answer and solution

ANSWER

Options (C) and (D) are correct: the minimum time is 9 RTTs for non-persistent HTTP with 5 parallel connections, and 6 RTTs for persistent HTTP with pipelining.

Official answer: C, DSource: Official answer key, GATE 2023 CS (IIT Kanpur)

  1. The local DNS server runs on the local host, so the host-to-resolver hop costs nothing. In iterative mode it asks the root server, then the TLD (.in) server, then the authoritative server, one after another. Each query costs one RTT, so DNS takes .

  2. Fetching the base HTML file takes one RTT for the TCP handshake and one RTT for the HTTP request and response, so .

  3. Time before any referenced object can be requested: .

  4. Non-persistent HTTP with 5 parallel connections: every object needs a new TCP connection, which is one RTT for the handshake and one RTT for the request and response, so per object. Ten objects over 5 parallel connections need rounds, which is .

  5. Non-persistent total: . So (C) is correct, and (A), which says 7 RTTs, is wrong.

  6. Persistent HTTP with pipelining: the connection opened for the HTML file is reused, so no new handshake is needed. All 10 requests are sent back to back, and the responses return in .

  7. Persistent total: . So (D) is correct, and (B), which says 5 RTTs, is wrong.

KEY IDEA

Add the stages in order. DNS costs 3 RTT (iterative, with the resolver on the host). The base page costs 2 RTT (handshake plus request). The 10 objects then cost 4 RTT in two rounds of 2 RTT each (non-persistent, 5 parallel), or 1 RTT in total (persistent with pipelining).

WATCH OUT FOR

Counting one RTT per object for the non-persistent case and forgetting the TCP handshake, which gives 7 instead of 9. Another slip is adding a fourth RTT for the host-to-resolver hop, or leaving out the handshake for the base page, which gives 5 for the persistent case.

From the GATE 2023 CS paper. Every question of this paper · Download the full paper · All 5 DNS & HTTP questions, with notes

More DNS & HTTP questions