retagged by
13,175 views
31 31 votes

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.

  1. HTTP GET request for the index page
  2. DNS request to resolve the web server's name to its IP address
  3. HTTP GET request for an image object
  4. 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?

  1. $\text{(iv), (ii), (iii), (i)}$
  2. $\text{(ii), (iv), (iii), (i)}$
  3. $\text{(ii), (iv), (i), (iii)}$
  4. $\text{(iv), (ii), (i), (iii)}$

3 Answers

26 26 votes

Correct Answer - Option C
The standard sequence of operations when trying to reach a server are as follows. 

  1. Device checks with local DNS server to identify the destination IP address. 
  2. Since HTTP uses TCP network protocol, it has to setup a link with the webserver, hence it sends a syn packet to the server's IP that was resolved using DNS query. 
  3. After a TCP connection has been established, The host would request for an index of the webpage using the HTTP GET command. 
  4. Based on the Index recieved, Host would make further requests to get the other information that it made the connection for. 

    Option C would be the best fit for the discussed sequence 
6 6 votes

(a) DNS vs TCP vs HTTP

When you type a URL and hit enter:

  1. DNS:

    • You only know the name (e.g., www.example.com), not its IP.

    • So first your machine sends a DNS request to resolve that name to an IP address.

  2. TCP connection:

    • HTTP runs over TCP.

    • Once you know the server IP, you can send a TCP SYN to that IP to start the 3-way handshake.

  3. HTTP GET for the HTML (index page):

    • After TCP connection is established, the browser sends an HTTP GET for the main HTML page (index).

  4. HTTP GET for embedded objects (images, CSS, JS, etc.):

    • Browser receives the HTML, parses it, sees <img>, <link>, <script> tags.

    • Then it sends HTTP GETs for those embedded objects.

    • In this question, it says single TCP connection is used to fetch entire webpage → so all GETs happen over that same TCP connection (no extra SYNs).

1 1 vote

Ans (C)  

Timeline as follows:


User enters URL
         │
        ▼
DNS Request
         │
        ▼
DNS Reply
         │
        ▼
TCP SYN
         │
        ▼
TCP Handshake completes
         │
        ▼
HTTP GET (Index Page)
         │
        ▼
Receive HTML
         │
        ▼
Browser parses HTML
         │
        ▼
HTTP GET (Image Objects)

Answer:
Position:
Show:

Related questions

24 24 votes
5 5 answers
12.7k
12.7k views
Arjun asked Feb 16, 2024
12,658 views
​$\mathrm{TCP}$ client $\mathrm{P}$ successfully establishes a connection to $\text{TCP}$ server $\mathrm{Q}$. Let $\text{N}_{P}$ denote the sequence number in the $\text...
39 39 votes
5 5 answers
20.1k
20.1k views
Arjun asked Feb 16, 2024
20,069 views
Which of the following fields is/are modified in the $\text{IP}$ header of a packet going out of a network address translation $\text{(NAT)}$ device from an internal netw...
38 38 votes
8 8 answers
22.5k
22.5k views
Arjun asked Feb 16, 2024
22,464 views
Consider a network path $\mathrm{P}-\mathrm{Q}-\mathrm{R}$ between nodes $\mathrm{P}$ and $\mathrm{R}$ via router $\mathrm{Q}$. Node $\mathrm{P}$ sends a file of size $10...
52 52 votes
4 4 answers
25.3k
25.3k views
Arjun asked Feb 16, 2024
25,341 views
Consider the entries shown below in the forwarding table of an $\text{IP}$ router. Each entry consists of an $\text{IP}$ prefix and the corresponding next hop router for ...