Application Layer Protocols

GATE CS previous year questions · 1 question

GATE CS 2024 Set 1 | Question 16

MCQ · 1 mark · −0.33

A user starts browsing a webpage hosted at a remote server. The browser opens a single TCP connection to fetch the entire webpage from the server. The webpage consists of a top-level index page with multiple embedded image objects. Assume that all caches (e.g., DNS cache, browser cache) are all initially empty. The following packets leave the user’s computer in some order.

(i) HTTP GET request for the index page
(ii) DNS request to resolve the web server’s name to its IP address
(iii) HTTP GET request for an image object
(iv) TCP SYN to open a connection to the web server

Which one of the following is the CORRECT chronological order (earliest in time to latest) of the packets leaving the computer ?

Options for GATE CS 2024 Set 1 | Question 16

Explanation

Answer: (C)

Follow what the browser needs at each step:

  • (ii) It knows only the server’s name and the DNS cache is empty, so it must first send a DNS request for the IP address.
  • (iv) With the address known, it opens the TCP connection by sending a SYN.
  • (i) Over that connection it requests the index page.
  • (iii) Only after the index page arrives does the browser learn which images are embedded, so an image GET comes last.

So the order is (ii), (iv), (i), (iii). Options A and D send the SYN before the address is known, and option B requests an image before the index page.

Answer: C