chapter

    Application Layer Protocols and Web Communication Pyqs for Gate Cs

    Solve 5+ Application Layer Protocols and Web Communication previous year questions for GATE CS with answers and detailed solutions. Free sample questions belo

    Try a question

    Answer it here to see how it works. Nothing is recorded until you sign in.

    Question 1
    2026 Slot Set2 PYQ
    Level 3: Exam Standard

    Which one of the following protocols may need to broadcast some of its messages?

    Question 2
    2026 Slot Set1 PYQ
    Level 3: Exam Standard

    Which of the following statements is/are true with respect to the interaction of a web browser with a web server using HTTP 1.1?

    Question 3
    2024 Slot Set1 PYQ
    Level 3: Exam Standard
    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 ?
    Question 4
    2023 PYQ
    Level 4: Challenger
    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?
    Question 5
    2022 PYQ
    Level 3: Exam Standard

    Consider the resolution of the domain name <code>www.gate.org.in</code> by a DNS resolver. Assume that no resource records are cached anywhere across the DNS servers and that iterative query mechanism is used in the resolution. The number of DNS query-response pairs involved in completely resolving the domain name is_____________.

    Free preview ends here

    Login to view the complete previous-year questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Application Layer Protocols and Web Communication PYQs for GATE CS

    Solve 5+ Application Layer Protocols and Web Communication previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Chapter Roadmap: Application Layer Protocols and Web Communication

    Chapter Roadmap: Application Layer Protocols and Web Communication

    1. DNS Resolution and Web Request Sequencing
    Focus: High. Foundation for all web latency problems. Master the exact packet order and iterative query counting.
    2. HTTP Connections, Persistence and Web Latency
    Focus: High. Master RTT calculations for non-persistent versus persistent HTTP with and without pipelining.
    3. Application Protocol Message Delivery
    Focus: Moderate. Understand port numbers, UDP versus TCP usage in application protocols, and broadcast requirements.

    Topic Hero: DNS Resolution and Web Request Sequencing

    Topic Hero: DNS Resolution and Web Request Sequencing

    The Bridge from Human Name to Data Transfer

    Before any web content can be fetched, the system must complete a strict sequence of network events. This topic focuses on:

    • Name Resolution: Translating a human-readable domain name into an IP address.
    • Connection Establishment: The three-way TCP handshake to create a reliable pipe.
    • Application Request: The first HTTP GET message sent over that established pipe.

    Understanding this exact sequence is the prerequisite for calculating total web page fetch time and identifying correct packet traces.

    Application Layer Protocols and Web Communication: Solved Questions with Step-by-Step Explanations (5 Problems)

    Question 1 · Computer Networks · 2026_Set2 MCQ

    Which one of the following protocols may need to broadcast some of its messages?

    1. A.

      SMTP

    2. B.

      FTP

    3. C.

      DHCP

    4. D.

      HTTP

    Correct Answer:

    C

    Step-by-Step Solution

    Insight: Application layer protocols only use broadcast when they suffer from the "bootstrap problem" — they need to find a server but do not yet know its IP address.

    Exam route: SMTP, FTP, and HTTP are all unicast TCP protocols; they connect to specific, known server IPs. DHCP, however, is used by a client that has just joined a network and has no IP address and no knowledge of the DHCP server's IP. It must broadcast (using 255.255.255.255) to discover the server. Thus, DHCP is the correct answer.

    Learning route: Let us evaluate the transport and delivery requirements of each protocol.

    1. SMTP (Simple Mail Transfer Protocol): Uses TCP port 25. Requires a reliable, point-to-point connection to a specific mail server. Unicast only.
    2. FTP (File Transfer Protocol): Uses TCP ports 20/21. Requires reliable, point-to-point connection for large file transfers. Unicast only.
    3. HTTP (HyperText Transfer Protocol): Uses TCP port 80/443. Requires reliable connection to a specific web server. Unicast only.
    4. DHCP (Dynamic Host Configuration Protocol): Uses UDP ports 67/68. When a host boots up, it sends a DHCPDISCOVER message. Since it lacks a destination IP, it uses the limited broadcast address.

    Therefore, only DHCP requires broadcasting.

    Question 2 · Computer Networks · 2026_Set1 MSQ

    Which of the following statements is/are true with respect to the interaction of a web browser with a web server using HTTP 1.1?

    1. A.

      HTTP 1.1 facilitates downloading multiple objects of the same webpage over the same TCP connection, if the objects are stored in the same server

    2. B.

      HTTP 1.1 facilitates downloading multiple objects of the same webpage over the same TCP connection, even if they are stored in different servers

    3. C.

      HTTP 1.1 facilitates sending a request for downloading one object without waiting for a previously requested object to be downloaded completely

    4. D.

      HTTP 1.1 facilitates downloading multiple webpages on the same server to be downloaded over a single TCP connection

    Correct Answer:

    ["A","C","D"]

    Step-by-Step Solution

    Insight: HTTP/1.1 introduced persistent connections (keep-alive) and pipelining to overcome the massive overhead of HTTP/1.0, but TCP constraints still limit connections to a single server endpoint.

    Exam route: Evaluate each statement against HTTP/1.1 RFC specifications.

    A: True. Persistent connections allow multiple objects from the same server to reuse one TCP socket.

    B: False. A TCP connection is strictly between one client IP/port and one server IP/port. It cannot span different servers.

    C: True. HTTP/1.1 supports pipelining, allowing the client to send multiple GET requests back-to-back without waiting for individual responses.

    D: True. The persistent connection remains open for any subsequent requests to the same server, including entirely different webpages.

    Learning route: Let us break down the mechanics of HTTP/1.1.

    1. <b>Persistent Connections (Keep-Alive):</b> In HTTP/1.0, the TCP connection closed after every single object. HTTP/1.1 defaults to keeping the connection open. This validates Option A.
    2. <b>TCP Endpoint Limits:</b> TCP is a point-to-point protocol. A socket is defined by (Client IP, Client Port, Server IP, Server Port). You cannot multiplex objects from server1.com and server2.com over the same TCP stream. This invalidates Option B.
    3. <b>Pipelining:</b> HTTP/1.1 allows the client to issue a new request without waiting for the previous response to arrive. This reduces idle RTTs. This validates Option C.
    4. <b>Scope of Persistence:</b> The connection is tied to the server host, not the specific HTML document. If you click a link to another page on the same domain, the browser reuses the existing TCP connection. This validates Option D.
    Question 3 · Computer Networks · 2024_Set1 MCQ
    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 ?
    1. A.

      (iv), (ii), (iii), (i)

    2. B.

      (ii), (iv), (iii), (i)

    3. C.

      (ii), (iv), (i), (iii)

    4. D.

      (iv), (ii), (i), (iii)

    Correct Answer:

    C

    Step-by-Step Solution

    Insight: Web fetching follows a strict dependency chain: you cannot connect to a server without its IP (DNS), you cannot request data without a connection (TCP), and you cannot request embedded objects without parsing the base page (HTML). Exam route: First, the host must resolve the domain name via a DNS request (ii). Once the IP is known, it initiates a TCP connection with a SYN packet (iv). After the handshake, it requests the base index page via HTTP GET (i). Only after receiving and parsing the HTML can it discover and request embedded images via another HTTP GET (iii). Thus, the order is (ii), (iv), (i), (iii). Learning route: Let us trace the dependencies. 1. The browser only has a URL string. It must map this to an IP address. This requires a DNS request (ii). 2. With the IP address, the transport layer can establish a reliable pipe. This begins with a TCP SYN (iv). 3. The application layer can now speak HTTP. It requests the main document (index page) using an HTTP GET (i). 4. The browser renders the HTML, finds `` tags, and issues subsequent HTTP GETs for the images (iii). Any sequence violating these dependencies is physically impossible. Option C perfectly matches this chain.
    Question 4 · Computer Networks · 2023 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.

    Correct Answer:

    ["C","D"]

    Step-by-Step Solution

    Insight: Total web latency is the sum of three sequential phases: DNS resolution, base HTML fetch, and embedded objects fetch. Each phase has specific RTT costs depending on the HTTP mode.

    Exam route:

    Phase 1: DNS. 3-tier hierarchy = 3 RTTs (Root, TLD, Auth).

    Phase 2: HTML. TCP Handshake (1 RTT) + HTTP GET/RESP (1 RTT) = 2 RTTs.

    Phase 3: Objects (10 total).

    • Non-persistent, 5 parallel: 2 batches of 5. Each batch = 1 RTT (TCP) + 1 RTT (HTTP) = 2 RTTs. Total = 4 RTTs.
    • Persistent, pipelined: Reuse HTML TCP socket. Send 10 GETs together = 1 RTT total.

    Totals: Non-persistent = 3 + 2 + 4 = 9 RTTs. Persistent = 3 + 2 + 1 = 6 RTTs.

    Learning route: Let us calculate the exact RTT budget for each component.

    <b>1. DNS Resolution Phase:</b>

    The local DNS server queries the 3-tier hierarchy iteratively.

    Query 1 (Root) = 1 RTT.

    Query 2 (TLD) = 1 RTT.

    Query 3 (Auth) = 1 RTT.

    DNS Subtotal = 3 RTTs.

    <b>2. Base HTML Fetch Phase:</b>

    TCP 3-way handshake = 1 RTT.

    HTTP GET + Server Response = 1 RTT.

    HTML Subtotal = 2 RTTs.

    Time elapsed so far = 5 RTTs. The browser now parses the HTML and finds 10 objects.

    <b>3. Embedded Objects Phase (10 objects):</b>

    <i>Case A: Non-persistent HTTP with 5 parallel TCP connections.</i>

    The browser opens 5 parallel TCP connections (takes 1 RTT for the handshakes).

    It sends 5 GETs and receives 5 responses (takes 1 RTT). Batch 1 is done (2 RTTs).

    It repeats this for the remaining 5 objects: 1 RTT (handshakes) + 1 RTT (HTTP) = 2 RTTs.

    Objects Subtotal = 4 RTTs.

    Total Time = 3 (DNS) + 2 (HTML) + 4 (Objects) = 9 RTTs. (Option C is correct).

    <i>Case B: Persistent HTTP with pipelining.</i>

    The browser reuses the existing TCP connection from the HTML fetch (0 RTT for handshake).

    It sends all 10 pipelined GETs back-to-back. The server sends all 10 responses back-to-back. This takes exactly 1 RTT.

    Objects Subtotal = 1 RTT.

    Total Time = 3 (DNS) + 2 (HTML) + 1 (Objects) = 6 RTTs. (Option D is correct).

    Question 5 · Computer Networks · 2022 NAT

    Consider the resolution of the domain name <code>www.gate.org.in</code> by a DNS resolver. Assume that no resource records are cached anywhere across the DNS servers and that iterative query mechanism is used in the resolution. The number of DNS query-response pairs involved in completely resolving the domain name is_____________.

    Correct Answer:

    4.00

    Step-by-Step Solution

    Insight: Count the exact number of query-response pairs generated by the stub resolver and the recursive resolver traversing the hierarchy.

    Exam route: The host's stub resolver queries the Local DNS server (1 pair). The Local DNS server then iteratively queries the Root server (1 pair), the TLD server for .in (1 pair), and the Authoritative server for gate.org.in (1 pair). Total = 1 + 3 = 4 pairs.

    Learning route: Let us trace the message flow step-by-step for an empty cache using iterative queries.

    1. <b>Host Local DNS Server:</b> The stub resolver on the host sends a query to its configured Local DNS server. The server responds. (Pair 1)
    2. <b>Local DNS Root Server:</b> The Local DNS server queries a root server. The root server replies with a referral to the .in TLD servers. (Pair 2)
    3. <b>Local DNS TLD Server:</b> The Local DNS server queries a .in TLD server. The TLD server replies with a referral to the authoritative servers for .org.in or gate.org.in. (Pair 3)
    4. <b>Local DNS Authoritative Server:</b> The Local DNS server queries the authoritative server for gate.org.in. The authoritative server replies with the final IP address for www.gate.org.in. (Pair 4)

    The Local DNS server then returns this IP to the host (completing the response for Pair 1).

    Total query-response pairs involved in completely resolving the name = 4.

    More previous year questions (pyqs) in this unit