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.
| 2026 | 2025 | 2024 | 2023 | 2022 | 2021 |
|---|---|---|---|---|---|
| 8.5 | 7 | 9 | 8 | 10 | 8 |
Computer Networks: Network Layer — GATE CS PYQ (16)
- GATE CS 2026 Set 2 · Q21Computer Networksmcq1 markConsider 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
Open GATE CS 2026 Set 2 Q21 · discuss this question →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.) - A.
- GATE CS 2025 Set 1 · Q40Computer Networksmcq2 marksA 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
Open GATE CS 2025 Set 1 Q40 · discuss this question →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. - A.
- GATE CS 2025 Set 2 · Q17Computer Networksmcq1 markConsider the routing protocols (List I) and the names (List II):
Which ONE of the following is CORRECT?List I | List II (i) Distance vector routing | (a) Bellman-Ford (ii) Link state routing | (b) Dijkstra- A.(i) - (a) and (ii) - (b)✓
- B.(i) - (a) and (ii) - (a)
- C.(i) - (b) and (ii) - (a)
- D.(i) - (b) and (ii) - (b)
Open GATE CS 2025 Set 2 Q17 · discuss this question →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. - A.
- GATE CS 2024 Set 1 · Q31Computer Networksmsq1 markWhich 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
Open GATE CS 2024 Set 1 Q31 · discuss this question →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. - A.
- GATE CS 2024 Set 1 · Q36Computer Networksmcq2 marksFile 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
Open GATE CS 2024 Set 1 Q36 · discuss this question →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. - A.
- GATE CS 2024 Set 1 · Q58Computer Networksnat2 marksForwarding 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 _______Open GATE CS 2024 Set 1 Q58 · discuss this question →
Answer: 40
Solution
Answer: 40 Longest-prefix match for each host:Hosts via R2: 10.1.1.132 and 10.1.1.191 -> packets.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 - GATE CS 2024 Set 1 · Q65Computer Networksnat2 marksAn 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 ________Open GATE CS 2024 Set 1 Q65 · discuss this question →
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:
Total delivered fragments.520 -> 336 + 184 (2 frags) 520 -> 336 + 184 (2 frags) 360 -> 336 + 24 (2 frags) - GATE CS 2024 Set 2 · Q28Computer Networksmsq1 markWhich 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
Open GATE CS 2024 Set 2 Q28 · discuss this question →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. - A.
- GATE CS 2024 Set 2 · Q32Computer Networksmsq1 markWhich 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✓
Open GATE CS 2024 Set 2 Q32 · discuss this question →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. - A.
- GATE CS 2023 · Q25Computer Networksmsq1 markWhich 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.
Open GATE CS 2023 Q25 · discuss this question →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. - A.
- GATE CS 2023 · Q65Computer Networksnat2 marksThe 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 __________Open GATE CS 2023 Q65 · discuss this question →
Answer: 3
Solution
Answer: 3 Check matches (longest prefix wins):Longest matching prefix is /24 -> interface 3./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 - GATE CS 2022 · Q22Computer Networksmcq1 markAn 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?

- A.3
- B.12
- C.6✓
- D.8
Open GATE CS 2022 Q22 · discuss this question →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. - A.
- GATE CS 2022 · Q55Computer Networksmsq2 marksRouting 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✓
Open GATE CS 2022 Q55 · discuss this question →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. - A.
- GATE CS 2022 · Q57Computer Networksnat2 marksNetwork 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 __________.Open GATE CS 2022 Q57 · discuss this question →
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 . - GATE CS 2021 Set 1 · Q55Computer Networksmsq2 marksConsider 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.
Open GATE CS 2021 Set 1 Q55 · discuss this question →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. - A.
- GATE CS 2021 Set 2 · Q55Computer Networksmsq2 marksConsider 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?

- 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 .
Open GATE CS 2021 Set 2 Q55 · discuss this question →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). - A.
Computer Networks: Data Link Layer — GATE CS PYQ (15)
- GATE CS 2026 Set 1 · Q45Computer Networksmcq2 marksConsider the implementation of sliding window protocol over a lossless link, with a window size of frames, where each frame is of size 1000 bits (including header). The bandwidth of the link is 100 kbps (1k = ) and the one-way propagation delay is 100 milliseconds. Assume that processing times at the sender and receiver are zero and the transmission time of acknowledgements is also zero. Which one of the following options gives the minimum size of (in number of frames) required to achieve 100% link utilization?
- A.10
- B.21✓
- C.20
- D.11
Open GATE CS 2026 Set 1 Q45 · discuss this question →Answer: B
Solution
Answer: (B) 21 ms and ms. The first ACK comes back after ms. To keep the link busy all that time, the sender needs frames. The trap is answer 20 (), which forgets the first frame's own transmission time. - A.
- GATE CS 2026 Set 2 · Q43Computer Networksmcq2 marksConsider the transmission of data bits 110001011 over a link that uses Cyclic Redundancy Check (CRC) code for error detection. If the generator bit pattern is given to be 1001, which one of the following options shows the remainder bit pattern appended to the data bits before transmission?
- A.011
- B.101
- C.000
- D.100✓
Open GATE CS 2026 Set 2 Q43 · discuss this question →Answer: D
Solution
Answer: (D) The generator has degree 3, so append three 0s: , and divide (mod-2) by . Carrying out the XOR long division leaves the 3-bit remainder , which is appended before transmission. - A.
- GATE CS 2026 Set 2 · Q65Computer Networksnat2 marksIt is necessary to design a link-layer protocol between two hosts directly connected over a lossless link of length 3000 kilometers. The link bandwidth is bits per second and the propagation delay is 5 nanoseconds per meter. Every transmitted data byte is assigned a unique sequence number. Let be the minimum number of bits needed for the sequence number field such that (i) the sequence numbers do not wrap around before 60 seconds, and (ii) the maximum utilization of the link is achieved. The value of is ______. (answer in integer)Open GATE CS 2026 Set 2 Q65 · discuss this question →
Answer: 30
Solution
For maximum utilization the link sends continuously at bps for 60 s: bits → bytes . We need distinct sequence numbers for all these bytes: . Since , the minimum is . - GATE CS 2025 Set 1 · Q56Computer Networksnat2 marksA 5-bit message is transmitted through a noisy channel. The probability that a bit gets flipped is 0.01, independently for each bit. The probability that the message is delivered error-free is ______. (rounded off to three decimal places)Open GATE CS 2025 Set 1 Q56 · discuss this question →
Answer: 0.949 to 0.952
Solution
Answer: 0.951 Error-free means all 5 bits are received correctly. Each bit is correct with probability , independently: - GATE CS 2025 Set 2 · Q16Computer Networksmcq1 markConsider the following statements: (i) Address Resolution Protocol (ARP) provides a mapping from an IP address to the corresponding hardware (link-layer) address. (ii) A single TCP segment from a sender S to a receiver R cannot carry both data from S to R and acknowledgement for a segment from R to S. Which ONE of the following is CORRECT?
- A.Both (i) and (ii) are TRUE
- B.(i) is TRUE and (ii) is FALSE✓
- C.(i) is FALSE and (ii) is TRUE
- D.Both (i) and (ii) are FALSE
Open GATE CS 2025 Set 2 Q16 · discuss this question →Answer: B
Solution
Answer: (B) (i) is TRUE and (ii) is FALSE (i) ARP indeed maps an IP address to a MAC (link-layer) address — TRUE. (ii) TCP supports piggybacking: one segment can carry data in its payload and an acknowledgement in its ACK field simultaneously — so the statement is FALSE. - A.
- GATE CS 2025 Set 2 · Q36Computer Networksmcq2 marksFrames are transmitted using Stop-and-Wait. Frame size bits, channel rate bps, propagation delay ms. Processing times and ACK size are negligible. Which ONE most accurately gives the channel utilization (in percentage)?
- A.88.23✓
- B.93.75
- C.85.44
- D.66.67
Open GATE CS 2025 Set 2 Q36 · discuss this question →Answer: A
Solution
Answer: (A) 88.23 Transmission time s. One-way propagation s. - A.
- GATE CS 2024 Set 2 · Q23Computer Networksmsq1 markX has a TCP connection to Y through IP router R; Ethernet switch S is the first switch on the path X-R. For a packet from X to Y when it leaves X, which statements are TRUE?
- A.Destination IP is R's IP
- B.Destination IP is Y's IP✓
- C.Destination MAC is S's MAC
- D.Destination MAC is Y's MAC
Open GATE CS 2024 Set 2 Q23 · discuss this question →Answer: B
Solution
Answer: (B) The destination IP is the final destination's IP (Y) end-to-end -> (B) true, (A) false. The destination MAC is the next-hop L2 device, which is the first-hop router R (not the switch S, which forwards transparently by MAC, and not Y which is remote). So (C) and (D) are false. - A.
- GATE CS 2024 Set 2 · Q55Computer Networksnat2 marksEthernet: transmission speed bps, max segment length 500 m, propagation speed m/s. The minimum frame size (bits) for collision detection is _________Open GATE CS 2024 Set 2 Q55 · discuss this question →
Answer: 500
Solution
Answer: 500 Propagation time one-way . Minimum frame transmission time must be : - GATE CS 2023 · Q17Computer Networksmcq1 markTwo hosts use Stop-and-Wait over a point-to-point link. In which scenario is link utilization the LOWEST?
- A.Longer link length and lower transmission rate
- B.Longer link length and higher transmission rate✓
- C.Shorter link length and lower transmission rate
- D.Shorter link length and higher transmission rate
Open GATE CS 2023 Q17 · discuss this question →Answer: B
Solution
Answer: (B) Longer link length and higher transmission rate Utilization . It is lowest when the transmission time is small relative to the propagation time . Higher transmission rate reduces , and longer link increases — together they minimize utilization. - A.
- GATE CS 2022 · Q59Computer Networksnat2 marksA 100 Mbps link connects an earth station to a satellite at altitude 2100 km (signal speed m/s). The time (ms, two decimals) for the receiver to completely receive a 1000-byte packet is __________.Open GATE CS 2022 Q59 · discuss this question →
Answer: 7.07 to 7.09
Solution
Answer: 7.08 Transmission time ms. Propagation ms. The receiver fully receives the packet at transmission propagation ms. - GATE CS 2021 Set 1 · Q18Computer Networksmcq1 markConsider the following two statements. : Destination MAC address of an ARP reply is a broadcast address. : Destination MAC address of an ARP request is a broadcast address. Which one of the following choices is correct?
- A.Both and are true.
- B.is true and is false.
- C.is false and is true.✓
- D.Both and are false.
Open GATE CS 2021 Set 1 Q18 · discuss this question →Answer: C
Solution
An ARP request is broadcast (the sender does not yet know the target MAC), so is true. An ARP reply is unicast back to the requester, so is false. - A.
- GATE CS 2021 Set 1 · Q39Computer Networksmcq2 marksAssume that a 12-bit Hamming codeword consisting of 8-bit data and 4 check bits is , where the data bits and the check bits are given in the following tables:
Which one of the following choices gives the correct values of and ?Data bits: d8 d7 d6 d5 d4 d3 d2 d1 1 1 0 x 0 1 0 1 Check bits: c8 c4 c2 c1 y 0 1 0- A.is 0 and is 0.✓
- B.is 0 and is 1.
- C.is 1 and is 0.
- D.is 1 and is 1.
Open GATE CS 2021 Set 1 Q39 · discuss this question →Answer: A
Solution
Using even parity over the Hamming check-bit positions and solving the parity equations for the unknown data bit and check bit gives and . - A.
- GATE CS 2021 Set 1 · Q59Computer Networksnat2 marksConsider the sliding window flow-control protocol operating between a sender and a receiver over a full-duplex error-free link. Assume the following: - Processing time of the data frame at the receiver, and of the acknowledgement at the sender, is negligible. - The sender has infinite frames available. - Data frame size is 2,000 bits and acknowledgement frame size is 10 bits. - Link data rate in each direction is 1 Mbps ( bits per second). - One way propagation delay of the link is 100 milliseconds. The minimum value of the sender's window size in terms of the number of frames, (rounded to the nearest integer) needed to achieve a link utilization of 50% is ______.Open GATE CS 2021 Set 1 Q59 · discuss this question →
Answer: 50 to 52
Solution
Transmission time ms, ms. Utilization . Setting this : , so the minimum integer window is 51. - GATE CS 2021 Set 2 · Q44Computer Networksmcq2 marksConsider the cyclic redundancy check (CRC) based error detecting scheme having the generator polynomial . Suppose the message is to be transmitted. Check bits are appended at the end of the message by the transmitter using the above CRC scheme. The transmitted bit string is denoted by . The value of the checkbit sequence is:
- A.101
- B.110
- C.100✓
- D.111
Open GATE CS 2021 Set 2 Q44 · discuss this question →Answer: C
Solution
The generator is . Appending 3 zeros gives ; dividing modulo-2 by leaves remainder . So . - A.
- GATE CS 2021 Set 2 · Q64Computer Networksnat2 marksConsider a network using the pure ALOHA medium access control protocol, where each frame is of length 1,000 bits. The channel transmission rate is 1 Mbps ( bits per second). The aggregate number of transmissions across all the nodes (including new frame transmissions and retransmitted frames due to collisions) is modelled as a Poisson process with a rate of 1,000 frames per second. Throughput is defined as the average number of frames successfully transmitted per second. The throughput of the network (rounded to the nearest integer) is ______.Open GATE CS 2021 Set 2 Q64 · discuss this question →
Answer: 130 to 140
Solution
Frame time ms, so the offered load . Pure ALOHA throughput frames per frame-time, i.e. frames per second.
Computer Networks: Transport Layer — GATE CS PYQ (11)
- GATE CS 2026 Set 1 · Q18Computer Networksmcq1 markWith 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✓
Open GATE CS 2026 Set 1 Q18 · discuss this question →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. - A.
- GATE CS 2026 Set 1 · Q44Computer Networksmcq2 marksA 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.
Open GATE CS 2026 Set 1 Q44 · discuss this question →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.Segment 2000 lies in the round that starts at 10 ms, so .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 - A.
- GATE CS 2026 Set 2 · Q58Computer Networksnat2 marksConsider 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: .Open GATE CS 2026 Set 2 Q58 · discuss this question →
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. - GATE CS 2025 Set 1 · Q22Computer Networksmsq1 markConsider 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✓
Open GATE CS 2025 Set 1 Q22 · discuss this question →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. - A.
- GATE CS 2024 Set 1 · Q16Computer Networksmcq1 markA 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)
Open GATE CS 2024 Set 1 Q16 · discuss this question →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. - A.
- GATE CS 2024 Set 1 · Q29Computer Networksmsq1 markTCP 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✓
Open GATE CS 2024 Set 1 Q29 · discuss this question →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. - A.
- GATE CS 2024 Set 2 · Q54Computer Networksnat2 marksA 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 _________Open GATE CS 2024 Set 2 Q54 · discuss this question →
Answer: 4
Solution
Answer: 4 On timeout, ssthresh and cwnd resets to 1, entering slow start (doubling each RTT):So during the third RTT, cwnd .RTT1: cwnd = 1 RTT2: cwnd = 2 RTT3: cwnd = 4 (still below ssthresh=6, so still doubling) - GATE CS 2023 · Q50Computer Networksmsq2 marksmyTCP 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✓
Open GATE CS 2023 Q50 · discuss this question →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. - A.
- GATE CS 2022 · Q60Computer Networksnat2 marksFor 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 __________.Open GATE CS 2022 Q60 · discuss this question →
Answer: 33
Solution
Answer: 33 Bytes sent in one MSL . The sequence number must not wrap: , so bits - GATE CS 2021 Set 1 · Q54Computer Networksmsq2 marksA 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.
Open GATE CS 2021 Set 1 Q54 · discuss this question →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). - A.
- GATE CS 2021 Set 2 · Q17Computer Networksmcq1 markConsider 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.
Open GATE CS 2021 Set 2 Q17 · discuss this question →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 . - A.
Computer Networks: IPv4 — GATE CS PYQ (6)
- GATE CS 2026 Set 1 · Q56Computer Networksmsq2 marksAn 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
Open GATE CS 2026 Set 1 Q56 · discuss this question →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 ✗ - A.
- GATE CS 2026 Set 2 · Q33Computer Networksnat1 markIf 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)Open GATE CS 2026 Set 2 Q33 · discuss this question →
Answer: 4094
Solution
Mask : the last leaves host bits. Total addresses ; excluding the network and broadcast addresses, assignable addresses . - GATE CS 2025 Set 1 · Q57Computer Networksnat2 marksA 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)Open GATE CS 2025 Set 1 Q57 · discuss this question →
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. - GATE CS 2025 Set 2 · Q18Computer Networksmcq1 markA 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)✓
Open GATE CS 2025 Set 2 Q18 · discuss this question →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. - A.
- GATE CS 2025 Set 2 · Q23Computer Networksmcq1 markConsider 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✓
Open GATE CS 2025 Set 2 Q23 · discuss this question →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. - A.
- GATE CS 2024 Set 2 · Q38Computer Networksmcq2 marksWhich 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
Open GATE CS 2024 Set 2 Q38 · discuss this question →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). - A.
Computer Networks: Application Layer — GATE CS PYQ (5)
- GATE CS 2026 Set 1 · Q19Computer Networksmsq1 markWhich 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✓
Open GATE CS 2026 Set 1 Q19 · discuss this question →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. - A.
- GATE CS 2026 Set 2 · Q22Computer Networksmcq1 markWhich one of the following protocols may need to broadcast some of its messages?
- A.SMTP
- B.FTP
- C.DHCP✓
- D.HTTP
Open GATE CS 2026 Set 2 Q22 · discuss this question →Answer: C
Solution
Answer: (C) A client that has no IP address yet uses DHCP and sends aDHCPDISCOVERas a broadcast () to locate a server. SMTP, FTP and HTTP are unicast, connection-oriented application protocols. - A.
- GATE CS 2025 Set 1 · Q16Computer Networksmcq1 markIdentify 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)
Open GATE CS 2025 Set 1 Q16 · discuss this question →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). - A.
- GATE CS 2023 · Q52Computer Networksmsq2 marksClicking 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.✓
Open GATE CS 2023 Q52 · discuss this question →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). - A.
- GATE CS 2022 · Q35Computer Networksnat1 markResolving www.gate.org.in by a DNS resolver with nothing cached and iterative queries, the number of DNS query-response pairs involved is __________.Open GATE CS 2022 Q35 · discuss this question →
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.
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 →