GATE CS Computer Networks PYQ with Solutions

Also searched as: GATE CN PYQ · GATE Networking PYQ

All 53 Computer Networks questions from every GATE Computer Science (CS/CSE) paper from 2021 to 2026, both sets where there were two, with the official answer key and a step-by-step solution. Computer Networks carries about 8.3 marks per paper on average. Questions are grouped chapter-wise, newest paper first.

Computer Networks — average marks per paper
202620252024202320222021
8.5798108

Computer Networks: Network Layer — GATE CS PYQ (16)

  1. GATE CS 2026 Set 2 · Q21Computer Networksmcq1 mark
    Consider a file of size 4 million bytes being transferred between two hosts connected via a path consisting of three consecutive links of bandwidth 2 Mbps, 500 kbps, and 1 Mbps, respectively. All processing delays and propagation delays are negligible. Assume that there is no other background traffic over the path and no other additional overhead to transfer the file. Which one of the following is the total time (in seconds) to transfer the file? Note: , .
    • A.
      731
    • B.
      64
      ✓
    • C.
      8
    • D.
      16

    Answer: B

    Solution

    Answer: (B) With store-and-forward over serial links, the sustained rate is set by the bottleneck link bps. File bytes bits.
    (The slightly higher pipeline fill at the faster links is negligible for this large file.)
    Open GATE CS 2026 Set 2 Q21 · discuss this question →
  2. GATE CS 2025 Set 1 · Q40Computer Networksmcq2 marks
    A packet with destination IP address 145.36.109.70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded to?
    Subnet Address | Subnet Mask (CIDR) | Interface
    ---------------+--------------------+----------
    145.36.0.0     | /16                | E1
    145.36.128.0   | /17                | E2
    145.36.64.0    | /18                | E3
    145.36.255.0   | /24                | E4
    Default        | --                 | E5
    • A.
      E3
      ✓
    • B.
      E1
    • C.
      E2
    • D.
      E5

    Answer: A

    Solution

    Answer: (A) E3 Routers use longest-prefix match. The third octet is . - /16 (): matches. - /17 (): needs third-octet top bit (); → no match. - /18 (): needs third-octet top two bits (range –); is in → match. - /24 (): third octet must be → no. The longest matching prefix is → interface E3.
    Open GATE CS 2025 Set 1 Q40 · discuss this question →
  3. GATE CS 2025 Set 2 · Q17Computer Networksmcq1 mark
    Consider the routing protocols (List I) and the names (List II):
    List I                      | List II
    (i) Distance vector routing | (a) Bellman-Ford
    (ii) Link state routing     | (b) Dijkstra
    Which ONE of the following is CORRECT?
    • A.
      (i) - (a) and (ii) - (b)
      ✓
    • B.
      (i) - (a) and (ii) - (a)
    • C.
      (i) - (b) and (ii) - (a)
    • D.
      (i) - (b) and (ii) - (b)

    Answer: A

    Solution

    Answer: (A) (i) - (a) and (ii) - (b) Distance-vector routing (e.g. RIP) is based on the Bellman-Ford algorithm; link-state routing (e.g. OSPF) is based on Dijkstra's shortest-path algorithm.
    Open GATE CS 2025 Set 2 Q17 · discuss this question →
  4. GATE CS 2024 Set 1 · Q31Computer Networksmsq1 mark
    Which field(s) is/are modified in the IP header of a packet going OUT of a NAT device from internal to external network?
    • A.
      Source IP
      ✓
    • B.
      Destination IP
    • C.
      Header Checksum
      ✓
    • D.
      Total Length

    Answer: A, C

    Solution

    Answer: (A) and (C) A NAT rewrites the private Source IP to its public address on outbound packets -> (A). Because a header field changed, the Header Checksum must be recomputed -> (C). The Destination IP and the Total Length are unchanged.
    Open GATE CS 2024 Set 1 Q31 · discuss this question →
  5. GATE CS 2024 Set 1 · Q36Computer Networksmcq2 marks
    File bytes sent P->Q->R in chunks of bytes, no wait between chunks. Each link has bandwidth bits/sec, negligible propagation. Q forwards each packet immediately and can receive and transmit simultaneously. P starts at . When does R receive all chunks?
    • A.
      8.000
    • B.
      8.008
      ✓
    • C.
      15.992
    • D.
      16.000

    Answer: B

    Solution

    Answer: (B) 8.008 Number of chunks . Chunk size bytes bits; transmission time per link ms. P streams all 1000 chunks onto link P-Q in ms s. The last chunk finishes arriving at Q at s, then takes one more link time ( ms) to reach R (the pipeline overlaps all earlier chunks). So R gets everything at s.
    Open GATE CS 2024 Set 1 Q36 · discuss this question →
  6. GATE CS 2024 Set 1 · Q58Computer Networksnat2 marks
    Forwarding table: 10.1.1.0/24->R1, 10.1.1.128/25->R2, 10.1.1.64/26->R3, 10.1.1.192/26->R4. The router sends 20 packets each to hosts 10.1.1.16, 10.1.1.72, 10.1.1.132, 10.1.1.191, 10.1.1.205. The number of packets forwarded via R2 is _______

    Answer: 40

    Solution

    Answer: 40 Longest-prefix match for each host:
    10.1.1.16  -> only /24      -> R1
    10.1.1.72  -> /26 (64-127)  -> R3
    10.1.1.132 -> /25 (128-255) -> R2
    10.1.1.191 -> /25 (128-255) -> R2   (not in 192/26 which is 192-255)
    10.1.1.205 -> /26 (192-255) -> R4
    Hosts via R2: 10.1.1.132 and 10.1.1.191 -> packets.
    Open GATE CS 2024 Set 1 Q58 · discuss this question →
  7. GATE CS 2024 Set 1 · Q65Computer Networksnat2 marks
    An IP datagram of 1420 bytes (incl 20-byte header) is sent over two links (MTU 542 then MTU 360) with a router between. The number of fragments delivered at the receiver is ________

    Answer: 6

    Solution

    Answer: 6 Payload bytes. Link 1 (MTU 542): max data (multiple of 8). Fragments: . Link 2 (MTU 360): max data . Re-fragment each:
    520 -> 336 + 184   (2 frags)
    520 -> 336 + 184   (2 frags)
    360 -> 336 + 24    (2 frags)
    Total delivered fragments.
    Open GATE CS 2024 Set 1 Q65 · discuss this question →
  8. GATE CS 2024 Set 2 · Q28Computer Networksmsq1 mark
    Which statements about IPv4 fragmentation is/are TRUE?
    • A.
      Fragmentation is performed only at the source
    • B.
      Fragmentation is performed at any router whose outgoing MTU is exceeded
      ✓
    • C.
      Reassembly is performed only at the destination
      ✓
    • D.
      Reassembly is performed at all intermediate routers

    Answer: B, C

    Solution

    Answer: (B) and (C) In IPv4, any router may fragment a datagram if it exceeds the next link's MTU (B). Reassembly is done only at the final destination (C), never at intermediate routers (D). So (A) is false (not only the source) and (D) is false.
    Open GATE CS 2024 Set 2 Q28 · discuss this question →
  9. GATE CS 2024 Set 2 · Q32Computer Networksmsq1 mark
    Which IP header field(s) is/are ALWAYS modified by any router before forwarding?
    • A.
      Source IP Address
    • B.
      Protocol
    • C.
      Time to Live (TTL)
      ✓
    • D.
      Header Checksum
      ✓

    Answer: C, D

    Solution

    Answer: (C) and (D) Every router decrements the TTL (C); since a field changed, it must recompute the Header Checksum (D). Source IP and Protocol are not changed by an ordinary router.
    Open GATE CS 2024 Set 2 Q32 · discuss this question →
  10. GATE CS 2023 · Q25Computer Networksmsq1 mark
    Which statements about OSPF are INCORRECT?
    • A.
      OSPF implements Bellman-Ford algorithm to find shortest paths.
      ✓
    • B.
      OSPF uses Dijkstra's shortest path algorithm.
    • C.
      OSPF is used as an inter-domain routing protocol.
      ✓
    • D.
      OSPF implements hierarchical routing.

    Answer: A, C

    Solution

    Answer: (A) and (C) OSPF is a link-state protocol that uses Dijkstra's algorithm (so B is correct, A is incorrect). OSPF is an INTRA-domain (interior gateway) protocol, not inter-domain (so C is incorrect; BGP is inter-domain). OSPF does support hierarchical routing via areas (D correct). The incorrect statements are A and C.
    Open GATE CS 2023 Q25 · discuss this question →
  11. GATE CS 2023 · Q65Computer Networksnat2 marks
    The router's forwarding table: 200.150.0.0/16->1, 200.150.64.0/19->2, 200.150.68.0/24->3, 200.150.68.64/27->4, Default->0. A packet to 200.150.68.118 is forwarded to interface ID __________

    Answer: 3

    Solution

    Answer: 3 Check matches (longest prefix wins):
    /16  200.150.0.0      -> matches (iface 1)
    /19  200.150.64.0     -> 68 in 64..95? yes third-octet range -> matches (iface 2)
    /24  200.150.68.0     -> third octet 68 matches -> matches (iface 3)
    /27  200.150.68.64    -> host range 64..95; 118 > 95 -> NO match
    Longest matching prefix is /24 -> interface 3.
    Open GATE CS 2023 Q65 · discuss this question →
  12. GATE CS 2022 · Q22Computer Networksmcq1 mark
    An enterprise network has two Ethernet segments, a web server, and a firewall, connected via three routers as shown. What is the number of subnets inside the enterprise network?
    GATE CS 2022 Question 22 figure
    • A.
      3
    • B.
      12
    • C.
      6
      ✓
    • D.
      8

    Answer: C

    Solution

    Answer: (C) 6 Each network segment (broadcast domain) is a subnet. Counting from the figure: the two Ethernet segments (2), the web-server link, and the point-to-point links joining the three routers and the firewall together form 6 distinct subnets inside the enterprise network.
    Open GATE CS 2022 Q22 · discuss this question →
  13. GATE CS 2022 · Q55Computer Networksmsq2 marks
    Routing table subnets: 12.20.164.0/22 (R1), 12.20.170.0/23 (R2), 12.20.168.0/23 (Interface 0), 12.20.166.0/23 (Interface 1), default (R3). Which CIDR prefixes can collectively aggregate all these subnets?
    • A.
      12.20.164.0/20
    • B.
      12.20.164.0/22
      ✓
    • C.
      12.20.164.0/21
    • D.
      12.20.168.0/22
      ✓

    Answer: B, D

    Solution

    Answer: (B) and (D) The subnets span 12.20.164.0 through 12.20.171.255. The clean aggregates are 12.20.164.0/22 (covers 164-167) and 12.20.168.0/22 (covers 168-171); together (B) and (D) exactly cover 164-171. Option (C) 12.20.164.0/21 actually aligns to 160.0/21 (covering 160-175), over-covering addresses outside the table, so it is not a correct tight aggregate.
    Open GATE CS 2022 Q55 · discuss this question →
  14. GATE CS 2022 · Q57Computer Networksnat2 marks
    Network with routers P-Q-R (links cost 1). After distance-vector routing converges, link Q-R fails. P and Q send updates at random times at equal rates. The probability (one decimal) of a routing loop (count-to-infinity) forming between P and Q is __________.

    Answer: 0.5

    Solution

    Answer: 0.5 Network P-Q-R (unit link costs); after link Q-R fails, P and Q send updates at random times at equal rates. A routing loop (count-to-infinity) forms only if Q advertises to P (based on the now-stale route) before P can inform Q. With both equally likely to send first, the probability of the loop-forming order is .
    Open GATE CS 2022 Q57 · discuss this question →
  15. GATE CS 2021 Set 1 · Q55Computer Networksmsq2 marks
    Consider two hosts and connected through a router . The maximum transfer unit (MTU) value of the link between and is 1500 bytes, and between and is 820 bytes. A TCP segment of size 1400 bytes was transferred from to through , with IP identification value as 0x1234. Assume that the IP header size is 20 bytes. Further, the packet is allowed to be fragmented, i.e., Don't Fragment (DF) flag in the IP header is *not* set by . Which of the following statements is/are correct?
    • A.
      Two fragments are created at and the IP datagram size carrying the second fragment is 620 bytes.
      ✓
    • B.
      If the second fragment is lost, will resend the fragment with the IP identification value 0x1234.
    • C.
      If the second fragment is lost, is required to resend the whole TCP segment.
      ✓
    • D.
      TCP destination port can be determined by analysing *only* the second fragment.

    Answer: A, C

    Solution

    The 1420-byte datagram is fragmented at for the 820-byte MTU: payload per fragment must be a multiple of 8, giving 800 + 620 bytes, so the second datagram is 620 bytes (A). does not retransmit (B false); loss recovery is by TCP at which resends the whole segment (C). The TCP header (with ports) is only in the first fragment, so (D) is false.
    Open GATE CS 2021 Set 1 Q55 · discuss this question →
  16. GATE CS 2021 Set 2 · Q55Computer Networksmsq2 marks
    Consider a computer network using the distance vector routing algorithm in its network layer. The partial topology is shown in the figure. The objective is to find the shortest-cost path from router to routers and . has three neighbours . During one iteration, measures its distance to as 3, 2 and 5 respectively. gets routing vectors indicating that the distance to from are 7, 6 and 5, and the distance to from are 4, 6 and 8 respectively. Which of the following statement(s) is/are correct with respect to the new routing table of , after updation during this iteration?
    GATE CS 2021 Set 2 Question 55 figure
    • A.
      The distance from to will be stored as 10.
    • B.
      The distance from to will be stored as 7.
      ✓
    • C.
      The next hop router for a packet from to is .
      ✓
    • D.
      The next hop router for a packet from to is .

    Answer: B, C

    Solution

    To : via , via , via ; minimum 8 via (so A false, C true). To : via , via , via ; minimum 7 via (so B true, D false).
    Open GATE CS 2021 Set 2 Q55 · discuss this question →

Computer Networks: Transport Layer — GATE CS PYQ (11)

  1. GATE CS 2026 Set 1 · Q18Computer Networksmcq1 mark
    With respect to a TCP connection between a client and a server, which one of the following statements is true?
    • A.
      The client and server use a two-way handshake mechanism before the start of data transmission
    • B.
      The server cannot initiate closing of the connection before the client initiates closing of the connection
    • C.
      The TCP connection is half-duplex
    • D.
      The client and server can initiate closing of the connection at the same time
      ✓

    Answer: D

    Solution

    Answer: (D) • (A) False: TCP uses a three-way handshake (SYN, SYN-ACK, ACK). • (B) False: either end may send the first FIN. • (C) False: TCP is full-duplex. • (D) True: simultaneous close is a defined case, in which both sides send FIN, pass through CLOSING, then TIME_WAIT.
    Open GATE CS 2026 Set 1 Q18 · discuss this question →
  2. GATE CS 2026 Set 1 · Q44Computer Networksmcq2 marks
    A TCP sender successfully establishes a connection with a TCP receiver and starts the transmission of segments. The TCP congestion control mechanism’s slow-start threshold is set to 10000 segments. Assume that the round-trip time is fixed at 1 millisecond. Assume that the sender always has data to send, the segments are numbered from 1, and no segment is lost. Let denote the time (in milliseconds) at which the transmission of segment number 2000 starts. Which one of the following options is correct?
    • A.
    • B.
      ✓
    • C.
    • D.

    Answer: B

    Solution

    Answer: (B) In slow start (the threshold of 10000 is never reached), cwnd doubles every RTT. The round starting at ms sends segments.
    Round starts at t (ms) | cwnd | Segments sent
    -----------------------+------+--------------
    0                      | 1    | 1
    1                      | 2    | 2–3
    2                      | 4    | 4–7
    …                      | …    | …
    9                      | 512  | 512–1023
    10                     | 1024 | 1024–2047
    Segment 2000 lies in the round that starts at 10 ms, so .
    Open GATE CS 2026 Set 1 Q44 · discuss this question →
  3. GATE CS 2026 Set 2 · Q58Computer Networksnat2 marks
    Consider a new TCP connection. The receiver advertised window is constant at 48 KB, the maximum segment size (MSS) is 2 KB, and the slow start threshold is 16 KB. Assume no timeouts or duplicate acknowledgements. The number of rounds of transmission required for the congestion control algorithm to reach the congestion avoidance phase is __________. (answer in integer) Note: .

    Answer: 4

    Solution

    In slow start, cwnd starts at 1 MSS KB and doubles each round: Round 1: 2 KB, Round 2: 4 KB, Round 3: 8 KB, Round 4: 16 KB. At cwnd KB ssthresh, TCP enters the congestion avoidance phase — after rounds.
    Open GATE CS 2026 Set 2 Q58 · discuss this question →
  4. GATE CS 2025 Set 1 · Q22Computer Networksmsq1 mark
    Consider the 3-way handshaking protocol for TCP connection establishment. Let the three packets exchanged during the connection establishment be denoted as P1, P2, and P3, in order. Which of the following option(s) is/are TRUE with respect to TCP header flags that are set in the packets?
    • A.
      P3: SYN = 1, ACK = 1
    • B.
      P2: SYN = 1, ACK = 1
      ✓
    • C.
      P2: SYN = 0, ACK = 1
    • D.
      P1: SYN = 1
      ✓

    Answer: B, D

    Solution

    Answer: (B) and (D) TCP's three-way handshake: - P1 (client → server): SYN (request). → (D) True. - P2 (server → client): SYN , ACK (SYN-ACK). → (B) True, so (C) is False. - P3 (client → server): SYN , ACK (pure ACK). → (A) is False.
    Open GATE CS 2025 Set 1 Q22 · discuss this question →
  5. GATE CS 2024 Set 1 · Q16Computer Networksmcq1 mark
    A browser opens a single TCP connection to fetch a webpage (index page + embedded images), all caches empty. The packets leaving the user's computer: (i) HTTP GET for index, (ii) DNS request, (iii) HTTP GET for an image, (iv) TCP SYN. Correct chronological order (earliest to latest)?
    • A.
      (iv), (ii), (iii), (i)
    • B.
      (ii), (iv), (iii), (i)
    • C.
      (ii), (iv), (i), (iii)
      ✓
    • D.
      (iv), (ii), (i), (iii)

    Answer: C

    Solution

    Answer: (C) (ii), (iv), (i), (iii) First resolve the server name: (ii) DNS request. Then open the connection: (iv) TCP SYN. Then request the index page: (i) HTTP GET index. Only after parsing the index are the embedded images known, so: (iii) HTTP GET image, last.
    Open GATE CS 2024 Set 1 Q16 · discuss this question →
  6. GATE CS 2024 Set 1 · Q29Computer Networksmsq1 mark
    TCP client P connects to server Q. = sequence number in the SYN from P. = acknowledgement number in the SYN-ACK from Q. Which statements is/are CORRECT?
    • A.
      is chosen randomly by P
      ✓
    • B.
      is always 0 for a new connection
    • C.
      equals
    • D.
      equals
      ✓

    Answer: A, D

    Solution

    Answer: (A) and (D) TCP chooses the initial sequence number (pseudo-)randomly (not 0) -> (A) true, (B) false. The SYN consumes one sequence number, so the server acknowledges with -> (D) true, (C) false.
    Open GATE CS 2024 Set 1 Q29 · discuss this question →
  7. GATE CS 2024 Set 2 · Q54Computer Networksnat2 marks
    A TCP connection has cwnd 12 MSS when a timeout occurs. Assuming all segments in the next two RTTs are acknowledged, the cwnd (in MSS) during the third RTT is _________

    Answer: 4

    Solution

    Answer: 4 On timeout, ssthresh and cwnd resets to 1, entering slow start (doubling each RTT):
    RTT1: cwnd = 1
    RTT2: cwnd = 2
    RTT3: cwnd = 4   (still below ssthresh=6, so still doubling)
    So during the third RTT, cwnd .
    Open GATE CS 2024 Set 2 Q54 · discuss this question →
  8. GATE CS 2023 · Q50Computer Networksmsq2 marks
    myTCP runs over 100 Mbps with RTT 150 ms and maximum segment lifetime 2 minutes. Which are valid lengths of the Sequence Number field?
    • A.
      30 bits
    • B.
      32 bits
      ✓
    • C.
      34 bits
      ✓
    • D.
      36 bits
      ✓

    Answer: B, C, D

    Solution

    Answer: (B), (C) and (D) The sequence number must not wrap within the maximum segment lifetime (120 s). Bytes sent in 120 s bytes. We need , i.e. bits . So 32, 34, 36 bits are valid; 30 bits () is too small.
    Open GATE CS 2023 Q50 · discuss this question →
  9. GATE CS 2022 · Q60Computer Networksnat2 marks
    For TCP over a 1 Gbps link with maximum segment lifetime 60 s, the minimum number of bits for the sequence number field (to prevent wrap-around during MSL) is __________.

    Answer: 33

    Solution

    Answer: 33 Bytes sent in one MSL . The sequence number must not wrap: , so bits
    Open GATE CS 2022 Q60 · discuss this question →
  10. GATE CS 2021 Set 1 · Q54Computer Networksmsq2 marks
    A TCP server application is programmed to listen on port number on host . A TCP client is connected to the TCP server over the network. Consider that while the TCP connection was active, the server machine crashed and rebooted. Assume that the client does not use the TCP keepalive timer. Which of the following behaviors is/are possible?
    • A.
      If the client was waiting to receive a packet, it may wait indefinitely.
      ✓
    • B.
      The TCP server application on can listen on after reboot.
      ✓
    • C.
      If the client sends a packet after the server reboot, it will receive a RST segment.
      ✓
    • D.
      If the client sends a packet after the server reboot, it will receive a FIN segment.

    Answer: A, B, C

    Solution

    After a crash the server loses all TCP state. A silent client may wait forever (A). The server can bind and listen on again after reboot (B). If the client sends data, the rebooted server has no matching connection and replies with RST, not FIN (C true, D false).
    Open GATE CS 2021 Set 1 Q54 · discuss this question →
  11. GATE CS 2021 Set 2 · Q17Computer Networksmcq1 mark
    Consider the three-way handshake mechanism followed during TCP connection establishment between hosts P and Q. Let X and Y be two random 32-bit starting sequence numbers chosen by P and Q respectively. Suppose P sends a TCP connection request message with the SYN bit set, SEQ number X, and ACK bit set to 0 to Q. Suppose Q accepts the connection request. Which one of the following choices represents the information present in the TCP segment header that is sent by Q to P?
    • A.
      The ACK bit is set to 0, SYN bit is set to 1, SEQ number is Y, and ACK number is X.
    • B.
      The ACK bit is set to 0, SYN bit is set to 0, SEQ number is Y, and ACK number is X.
    • C.
      The ACK bit is set to 1, SYN bit is set to 1, SEQ number is Y, and ACK number is X+1.
      ✓
    • D.
      The ACK bit is set to 1, SYN bit is set to 0, SEQ number is Y+1, and ACK number is X.

    Answer: C

    Solution

    The second handshake segment (SYN-ACK) has SYN=1 and ACK=1, carries Q's own initial sequence number Y, and acknowledges P's SYN with ACK number .
    Open GATE CS 2021 Set 2 Q17 · discuss this question →

Computer Networks: IPv4 — GATE CS PYQ (6)

  1. GATE CS 2026 Set 1 · Q56Computer Networksmsq2 marks
    An ISP having an address block 202.16.0.0/15 assigns a block of 6000 IP addresses to a client, using the classless internet domain routing (CIDR) super-netting approach. Which of the following address blocks can be assigned by the ISP?
    • A.
      202.16.0.0/19
      ✓
    • B.
      202.17.64.0/19
      ✓
    • C.
      202.16.32.0/19
      ✓
    • D.
      202.17.24.0/19

    Answer: A, B, C

    Solution

    Answer: A, B, C 6000 addresses need the next power of two, , so the prefix is . The ISP's /15 spans 202.16.0.0 – 202.17.255.255. A /19 must start on a boundary of 8192 addresses, which means the third octet must be a multiple of 32. • (A) 202.16.0.0 ✓ • (B) 202.17.64.0 ✓ • (C) 202.16.32.0 ✓ • (D) 202.17.24.0: 24 is not a multiple of 32, so it is not a valid /19 ✗
    Open GATE CS 2026 Set 1 Q56 · discuss this question →
  2. GATE CS 2026 Set 2 · Q33Computer Networksnat1 mark
    If an IP network uses a subnet mask of 255.255.240.0, the maximum number of IP addresses that can be assigned to network interfaces is __________. (answer in integer)

    Answer: 4094

    Solution

    Mask : the last leaves host bits. Total addresses ; excluding the network and broadcast addresses, assignable addresses .
    Open GATE CS 2026 Set 2 Q33 · discuss this question →
  3. GATE CS 2025 Set 1 · Q57Computer Networksnat2 marks
    A message of size 15000 bytes is transmitted from source to destination using IPv4 via two routers: Source → Router-1 (MTU bytes) → Router-2 (MTU bytes) → Destination. Each MTU includes the 20-byte IP header. The number of fragments delivered to the destination is ________. (Answer in integer)

    Answer: 7

    Solution

    Answer: 7 IP header bytes; fragment data must be a multiple of 8. At Router-1 (MTU 5000): max data per fragment round down to (multiple of 8). data bytes fragments of → 4 fragments. At Router-2 (MTU 3000): max data per fragment . - Each -byte fragment is refragmented into → 2 fragments. Three of them give . - The -byte fragment fits as is → 1 fragment. Total delivered fragments.
    Open GATE CS 2025 Set 1 Q57 · discuss this question →
  4. GATE CS 2025 Set 2 · Q18Computer Networksmcq1 mark
    A machine receives an IPv4 datagram whose protocol field holds the protocol number of a protocol X. Which ONE of the following is NOT a possible candidate for X?
    • A.
      Internet Control Message Protocol (ICMP)
    • B.
      Internet Group Management Protocol (IGMP)
    • C.
      Open Shortest Path First (OSPF)
    • D.
      Routing Information Protocol (RIP)
      ✓

    Answer: D

    Solution

    Answer: (D) Routing Information Protocol (RIP) The IPv4 protocol field names the protocol carried directly inside IP. ICMP (1), IGMP (2) and OSPF (89) ride directly on top of IP, so they have protocol numbers. RIP, however, runs over UDP (port 520) — it is not carried directly by IP, so it is not a value of the IPv4 protocol field.
    Open GATE CS 2025 Set 2 Q18 · discuss this question →
  5. GATE CS 2025 Set 2 · Q23Computer Networksmcq1 mark
    Consider a network using Ethernet and IPv4 (no IP options). Each Ethernet frame can carry a maximum of 1500 bytes in its data field. A UDP segment with 7488 bytes of payload is transmitted. Which ONE has the CORRECT total number of fragments and the size of the last fragment (including IPv4 header)?
    • A.
      5 fragments, 1488 bytes
    • B.
      6 fragments, 88 bytes
    • C.
      6 fragments, 108 bytes
    • D.
      6 fragments, 116 bytes
      ✓

    Answer: D

    Solution

    Answer: (D) 6 fragments, 116 bytes Total IP payload UDP header data bytes. With MTU and a -byte IP header, max data per fragment (already a multiple of ). Number of fragments . First five carry bytes; the last carries bytes of data. Including the -byte IP header, the last fragment is bytes.
    Open GATE CS 2025 Set 2 Q23 · discuss this question →
  6. GATE CS 2024 Set 2 · Q38Computer Networksmcq2 marks
    Which CIDR prefix exactly represents the range 10.12.2.0 to 10.12.3.255?
    • A.
      10.12.2.0/23
      ✓
    • B.
      10.12.2.0/24
    • C.
      10.12.0.0/22
    • D.
      10.12.2.0/22

    Answer: A

    Solution

    Answer: (A) 10.12.2.0/23 The range spans addresses , so the host part is 9 bits and the prefix is . The block covers – exactly (the 3rd octet varies over 2 and 3).
    Open GATE CS 2024 Set 2 Q38 · discuss this question →

Computer Networks: Application Layer — GATE CS PYQ (5)

  1. GATE CS 2026 Set 1 · Q19Computer Networksmsq1 mark
    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?
    • 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
      ✓
    • 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
    • C.
      HTTP 1.1 facilitates sending a request for downloading one object without waiting for a previously requested object to be downloaded completely
      ✓
    • D.
      HTTP 1.1 facilitates downloading multiple webpages on the same server to be downloaded over a single TCP connection
      ✓

    Answer: A, C, D

    Solution

    Answer: A, C, D • (A) True: HTTP/1.1 uses persistent connections by default. • (B) False: a TCP connection has exactly two endpoints, so objects on another server need another connection. • (C) True: pipelining lets the browser send the next request before the previous response finishes. • (D) True: a persistent connection is not tied to one page and can carry several pages from the same server.
    Open GATE CS 2026 Set 1 Q19 · discuss this question →
  2. GATE CS 2026 Set 2 · Q22Computer Networksmcq1 mark
    Which one of the following protocols may need to broadcast some of its messages?
    • A.
      SMTP
    • B.
      FTP
    • C.
      DHCP
      ✓
    • D.
      HTTP

    Answer: C

    Solution

    Answer: (C) A client that has no IP address yet uses DHCP and sends a DHCPDISCOVER as a broadcast () to locate a server. SMTP, FTP and HTTP are unicast, connection-oriented application protocols.
    Open GATE CS 2026 Set 2 Q22 · discuss this question →
  3. GATE CS 2025 Set 1 · Q16Computer Networksmcq1 mark
    Identify the ONE CORRECT matching between the OSI layers and their corresponding functionalities as shown.
    OSI Layer           | Functionality
    --------------------+----------------------------
    (a) Network layer   | (I)   Packet routing
    (b) Transport layer | (II)  Framing and error handling
    (c) Datalink layer  | (III) Host to host communication
    • A.
      (a)-(I), (b)-(II), (c)-(III)
    • B.
      (a)-(I), (b)-(III), (c)-(II)
      ✓
    • C.
      (a)-(II), (b)-(I), (c)-(III)
    • D.
      (a)-(III), (b)-(II), (c)-(I)

    Answer: B

    Solution

    Answer: (B) (a)-(I), (b)-(III), (c)-(II) - Network layer → packet routing (logical addressing, path selection): (I). - Transport layer → end-to-end / host-to-host communication (e.g. TCP, UDP): (III). - Data-link layer → framing and error handling (frames, CRC): (II).
    Open GATE CS 2025 Set 1 Q16 · discuss this question →
  4. GATE CS 2023 · Q52Computer Networksmsq2 marks
    Clicking www.gate-2023.in triggers an iterative DNS lookup over a 3-tier hierarchy (nothing cached). RTT is the same to DNS servers and to the web server. The HTML has negligible transmission/rendering time and references 10 small objects on the same server. Which are CORRECT about the minimum elapsed time to fully render?
    • A.
      7 RTTs, non-persistent HTTP with 5 parallel TCP connections.
    • B.
      5 RTTs, persistent HTTP with pipelining.
    • C.
      9 RTTs, non-persistent HTTP with 5 parallel TCP connections.
      ✓
    • D.
      6 RTTs, persistent HTTP with pipelining.
      ✓

    Answer: C, D

    Solution

    Answer: (C) and (D) DNS (iterative, 3-tier) takes 3 RTTs (local server queries root, TLD, authoritative). Then: - Persistent HTTP with pipelining: 1 RTT for TCP handshake + 1 RTT to fetch the HTML + 1 RTT to pipeline all 10 objects more RTTs. Total RTTs -> (D). - Non-persistent with 5 parallel connections: 1 RTT (connect) + 1 RTT (HTML), then 10 objects in 2 rounds of 5 parallel connections, each round costing 2 RTTs (connect + fetch) RTTs. Total RTTs -> (C).
    Open GATE CS 2023 Q52 · discuss this question →
  5. GATE CS 2022 · Q35Computer Networksnat1 mark
    Resolving www.gate.org.in by a DNS resolver with nothing cached and iterative queries, the number of DNS query-response pairs involved is __________.

    Answer: 4

    Solution

    Answer: 4 Resolving www.gate.org.in iteratively with nothing cached: the local resolver queries the root server (-> .in), then the .in TLD server (-> org.in), then the org.in server (-> gate.org.in), then the gate.org.in authoritative server (-> www). That is 4 query-response pairs.
    Open GATE CS 2022 Q35 · discuss this question →

Take a Computer Networks chapter-wise test

Pick any chapters and attempt their PYQs with a timer in the GATE interface, with instant analysis — free.

Create free account →

More GATE CS PYQ subject-wise