GATE CS Computer Networks Previous Year Questions

60 solved GATE CS questions on Computer Networks, drawn from 8 exam years and grouped by year. Every question shows the official answer and a step-by-step solution.

Want to practise this topic and ask follow-up questions? Explore Success Tracker.

Revision companion

Computer Networks: identify the layer, then apply its rules

Determine which protocol layer a question addresses before applying its mechanisms. These selected foundations connect the physical, data link, network, transport, and application layers. Protocol behavior depends on the specific mechanism's assumptions, not on generic layering claims.

Our study notes and original examples support the PYQs below; they are not official exam questions or a replacement for the current syllabus.

Before you start

  • Binary and hexadecimal notation and conversion between bits and bytes.
  • Basic understanding of client-server communication and the concept of protocol headers.

Concepts to revise before solving

Layering and encapsulation

Each layer adds its header (and sometimes trailer) to the payload from the layer above. The network layer handles host-to-host delivery; the transport layer handles process-to-process delivery. A frame encapsulates a packet, which encapsulates a segment.

Check yourself: At which layer does the question's mechanism operate?

Data link: framing, error detection, and MAC

CRC detects bit errors using polynomial division over GF(2). Ethernet uses CSMA/CD for shared media: sense, transmit, detect collisions. The minimum frame size constraint ensures collision detection within one round-trip time. Switches forward frames based on MAC address tables.

Check yourself: Is the channel shared (collision possible) or switched (dedicated)?

IP addressing and subnetting

An IPv4 address is 32 bits. A subnet mask determines the network and host portions. A /n prefix means the first n bits identify the network. The number of host addresses is 2^(32−n) − 2 (excluding network and broadcast addresses in a standard subnet). CIDR replaces classful addressing.

Check yourself: Have you subtracted the network and broadcast addresses from the host count?

Routing and forwarding

Forwarding uses the routing table to send a packet toward its destination by longest prefix match. Distance-vector protocols (e.g., RIP) share distance tables with neighbors; link-state protocols (e.g., OSPF) flood topology information. The count-to-infinity problem affects simple distance-vector protocols.

Check yourself: Which entry in the routing table provides the longest matching prefix?

Transport: TCP flow and congestion control

TCP provides reliable, ordered delivery using sequence numbers, acknowledgments, and retransmission. Flow control uses a receiver-advertised window. Congestion control (slow start, congestion avoidance, fast retransmit) adjusts the sender's window. UDP provides no reliability, ordering, or congestion control.

Check yourself: Is the question about flow control (receiver capacity) or congestion control (network capacity)?

Mistakes to avoid

Using classful default masks when the problem specifies a CIDR prefix.
Use the given /n prefix to determine the mask; classful defaults do not apply with CIDR.
Confusing throughput with bandwidth.
Bandwidth is link capacity; throughput is actual data delivered per unit time, limited by the protocol window, loss, and delay.
Assuming TCP's congestion window only increases.
The window decreases on timeout (reset to 1 MSS in standard TCP) and on triple duplicate ACK (halved in fast recovery).

Original teaching example · not a PYQ

Work through the reasoning

Original mini-example: a network is assigned the block 192.168.10.0/24. Subnet it into 4 equal subnets. Find the subnet addresses, broadcast addresses, and the number of usable host addresses per subnet.

  1. 4 subnets require 2 extra bits: /24 becomes /26. Each subnet has 2^(32−26) = 64 addresses.
  2. Subnet 1: 192.168.10.0/26, broadcast 192.168.10.63. Subnet 2: 192.168.10.64/26, broadcast 192.168.10.127.
  3. Subnet 3: 192.168.10.128/26, broadcast 192.168.10.191. Subnet 4: 192.168.10.192/26, broadcast 192.168.10.255.
  4. Each subnet has 64 − 2 = 62 usable host addresses (excluding network and broadcast).

Four /26 subnets with 62 usable hosts each. Subnets start at .0, .64, .128, .192.

Try it before reading the answer

A host sends a TCP segment with sequence number 100 and 50 bytes of data. What acknowledgment number does the receiver send for in-order delivery?

Show answer and reasoning

ACK number = 150.

TCP sequence numbers count bytes. The segment occupies bytes 100–149. The receiver acknowledges the next expected byte: 100 + 50 = 150.

Go deeper with free learning resources

Supplemental reading, not an official GATE reading list or an endorsement of these notes.

Apply this to the previous-year questions

Previous-year questions by year

This page shows 60 recent questions from the released archive, newest first. For older questions and complete papers, browse all GATE CS papers. Questions can carry more than one subject tag; counts are not marks weightage.

GATE CS 202611 questions

  1. Set 1 Q18With respect to a TCP connection between a client and a server, which one of the following statements is true?MCQ · +1 marks · Easy
  2. Set 1 Q19Which of the following statements is/are true with respect to the interaction of a web browser with a web server using HTTP 1.1?MSQ · +1 marks · Medium
  3. Set 1 Q44A TCP sender successfully establishes a connection with a TCP receiver and starts the transmission of segments. The TCP congestion control mechanism's…MCQ · +2 marks · Hard
  4. Set 1 Q45Consider the implementation of sliding window protocol over a lossless link, with a window size of WW frames, where each frame is of size 1000 bits (including…MCQ · +2 marks · Medium
  5. Set 1 Q56An ISP having an address block 202.16.0.0/15202.16.0.0/15 assigns a block of 6000 IP addresses to a client, using the classless internet domain routing (CIDR)…MSQ · +2 marks · Medium
  6. Set 2 Q21Consider 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…MCQ · +1 marks · Medium
  7. Set 2 Q22Which one of the following protocols may need to broadcast some of its messages?MCQ · +1 marks · Easy
  8. Set 2 Q33If 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 __________.NAT · +1 marks · Easy
  9. Set 2 Q43Consider 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…MCQ · +2 marks · Medium
  10. Set 2 Q58Consider a new TCP connection between a sender and a receiver. The receiver advertised window is constant at 48 KB, the maximum segment size (MSS) is 2 KB, and…NAT · +2 marks · Medium
  11. Set 2 Q65It is necessary to design a link-layer protocol between two hosts that are directly connected over a lossless link of length 3000 kilometers. Assume that the…NAT · +2 marks · Hard

GATE CS 20259 questions

  1. Set 1 Q16Identify the ONE CORRECT matching between the OSI layers and their corresponding functionalities as shown. | | OSI Layers | | Functionalities |…MCQ · +1 marks · Easy
  2. Set 1 Q22Consider the 3-way handshaking protocol for TCP connection establishment. Let the three packets exchanged during the connection establishment be denoted as…MSQ · +1 marks · Easy
  3. Set 1 Q40A packet with the destination IP address 145.36.109.70145.36.109.70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded to? |…MCQ · +2 marks · Medium
  4. Set 1 Q57Suppose a message of size 1500015000 bytes is transmitted from a source to a destination using IPv4 protocol via two routers as shown in the figure. Each router…NAT · +2 marks · Hard
  5. Set 2 Q16Consider the following statements: (i) Address Resolution Protocol (ARP) provides a mapping from an IP address to the corresponding hardware (link-layer)…MCQ · +1 marks · Easy
  6. Set 2 Q17Consider the routing protocols given in List I and the names given in List II: | List I | List II | | :--- | :--- | | (i) Distance vector routing | (a)…MCQ · +1 marks · Easy
  7. Set 2 Q18A machine receives an IPv4 datagram. The protocol field of the IPv4 header has the protocol number of a protocol X. Which ONE of the following is NOT a…MCQ · +1 marks · Medium
  8. Set 2 Q23Consider a network that uses Ethernet and IPv4. Assume that IPv4 headers do not use any options field. Each Ethernet frame can carry a maximum of 1500 bytes in…MCQ · +1 marks · Medium
  9. Set 2 Q36Suppose we are transmitting frames between two nodes using Stop-and-Wait protocol. The frame size is 3000 bits. The transmission rate of the channel is 2000…MCQ · +2 marks · Medium

GATE CS 202412 questions

  1. Set 1 Q16A 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…MCQ · +1 marks · Easy
  2. Set 1 Q29TCP client PP successfully establishes a connection to TCP server QQ. Let NPN_P denote the sequence number in the SYN sent from PP to QQ. Let NQN_Q denote…MSQ · +1 marks · Easy
  3. Set 1 Q31Which of the following fields is/are modified in the IP header of a packet going out of a network address translation (NAT) device from an internal network to…MSQ · +1 marks · Medium
  4. Set 1 Q36Consider a network path P—Q—R between nodes P and R via router Q. Node P sends a file of size 10610^6 bytes to R via this path by splitting the file into chunks…MCQ · +2 marks · Medium
  5. Set 1 Q58Consider the entries shown below in the forwarding table of an IP router. Each entry consists of an IP prefix and the corresponding next hop router for packets…NAT · +2 marks · Medium
  6. Set 1 Q65Consider sending an IP datagram of size 1420 bytes (including 20 bytes of IP header) from a sender to a receiver over a path of two links with a router between…NAT · +2 marks · Hard
  7. Set 2 Q23Node X has a TCP connection open to node Y. The packets from X to Y go through an intermediate IP router R. Ethernet switch S is the first switch on the…MSQ · +1 marks · Medium
  8. Set 2 Q28Which of the following statements about IPv4 fragmentation is/are TRUE?MSQ · +1 marks · Easy
  9. Set 2 Q32Which of the following fields of an IP header is/are always modified by any router before it forwards the IP packet?MSQ · +1 marks · Medium
  10. Set 2 Q38Which one of the following CIDR prefixes exactly represents the range of IP addresses 10.12.2.0 to 10.12.3.255?MCQ · +2 marks · Easy
  11. Set 2 Q54Consider a TCP connection operating at a point of time with the congestion window of size 12 MSS (Maximum Segment Size), when a timeout occurs due to packet…NAT · +2 marks · Medium
  12. Set 2 Q55Consider an Ethernet segment with a transmission speed of 10810^8 bits/sec and a maximum segment length of 500 meters. If the speed of propagation of the signal…NAT · +2 marks · Medium

GATE CS 20235 questions

  1. Set 1 Q17Suppose two hosts are connected by a point-to-point link and they are configured to use Stop-and-Wait protocol for reliable data transfer. Identify in…MCQ · +1 marks · Easy
  2. Set 1 Q25Which of the following statements is/are INCORRECT about the OSPF (Open Shortest Path First) routing protocol used in the Internet?MSQ · +1 marks · Medium
  3. Set 1 Q50Suppose you are asked to design a new reliable byte-stream transport protocol like TCP. This protocol, named myTCP, runs over a 100 Mbps network with Round…MSQ · +2 marks · Hard
  4. Set 1 Q52Suppose 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…MSQ · +2 marks · Hard
  5. Set 1 Q65The forwarding table of a router is shown below. | Subnet Number | Subnet Mask | Interface ID | | :--- | :--- | :--- | | 200.150.0.0 | 255.255.0.0 | 1 | |…NAT · +2 marks · Medium

GATE CS 20226 questions

  1. Set 1 Q22Consider an enterprise network with two Ethernet segments, a web server and a firewall, connected via three routers as shown below. [figure] What is the number…MCQ · +1 marks · Medium
  2. Set 1 Q35Consider the resolution of the domain name www.gate.org.in by a DNS resolver. Assume that no resource records are cached anywhere across the DNS servers and…NAT · +1 marks · Medium
  3. Set 1 Q55Consider routing table of an organization’s router shown below: | Subnet Number | Subnet Mask | Next Hop | | :--- | :--- | :--- | | 12.20.164.0 | 255.255.252.0…MSQ · +2 marks · Medium
  4. Set 1 Q57Consider a network with three routers P, Q, R shown in the figure below. All the links have cost of unity. [figure] The routers exchange distance vector…NAT · +2 marks · Hard
  5. Set 1 Q59Consider a 100 Mbps link between an earth station (sender) and a satellite (receiver) at an altitude of 2100 km. The signal propagates at a speed of 3x10⁸ m/s.…NAT · +2 marks · Medium
  6. Set 1 Q60Consider the data transfer using TCP over a 1 Gbps1\text{ Gbps} link. Assuming that the maximum segment lifetime (MSL) is set to 60 seconds60\text{ seconds}, the minimum…NAT · +2 marks · Medium

GATE CS 20219 questions

  1. Set 1 Q18Consider the following two statements. S1S_1: Destination MAC address of an ARP reply is a broadcast address. S2S_2: Destination MAC address of an ARP request…MCQ · +1 marks · Easy
  2. Set 1 Q39Assume that a 12-bit Hamming codeword consisting of 8-bit data and 4 check bits is d8d7d6d5c8d4d3d2c4d1c2c1d_8d_7d_6d_5c_8d_4d_3d_2c_4d_1c_2c_1, where the data bits and the check…MCQ · +2 marks · Medium
  3. Set 1 Q54A TCP server application is programmed to listen on port number PP on host SS. A TCP client is connected to the TCP server over the network. Consider that…MSQ · +2 marks · Hard
  4. Set 1 Q55Consider two hosts PP and QQ connected through a router RR. The maximum transfer unit (MTU) value of the link between PP and RR is 1500 bytes, and between…MSQ · +2 marks · Hard
  5. Set 1 Q59Consider the sliding window flow-control protocol operating between a sender and a receiver over a full-duplex error-free link. Assume the following: * The…NAT · +2 marks · Medium
  6. Set 2 Q17Consider the three-way handshake mechanism followed during TCP connection establishment between hosts PP and QQ. Let XX and YY be two random 32-bit…MCQ · +1 marks · Easy
  7. Set 2 Q44Consider the cyclic redundancy check (CRC) based error detecting scheme having the generator polynomial X3+X+1X^3 + X + 1. Suppose the message…MCQ · +2 marks · Medium
  8. Set 2 Q55Consider a computer network using the distance vector routing algorithm in its network layer. The partial topology of the network is as shown below. [figure]…MSQ · +2 marks · Medium
  9. Set 2 Q64Consider a network using the pure ALOHA medium access control protocol, where each frame is of length 1,0001,000 bits. The channel transmission rate is 11 Mbps…NAT · +2 marks · Medium

GATE CS 20204 questions

  1. Set 1 Q25Consider the following statements about the functionality of an IP based router. I. A router does not modify the IP packets during forwarding. II. It is not…MCQ · +1 marks · Medium
  2. Set 1 Q35Assume that you have made a request for a web page through your web browser to a web server. Initially the browser cache is empty. Further, the browser is…NAT · +1 marks · Easy
  3. Set 1 Q48An organization requires a range of IP addresses to assign one to each of its 1500 computers. The organization has approached an Internet Service Provider…MCQ · +2 marks · Hard
  4. Set 1 Q65Consider a TCP connection between a client and a server with the following specifications: the round trip time is 66 ms, the size of the receiver advertised…NAT · +2 marks · Medium

GATE CS 20194 questions

  1. Set 1 Q26Which one of the following protocol pairs can be used to send and retrieve e-mails (in that order)?MCQ · +1 marks · Easy
  2. Set 1 Q38Consider three machines M, N, and P with IP addresses 100.10.5.2, 100.10.5.5, and 100.10.5.6 respectively. The subnet mask is set to 255.255.255.252 for all…MCQ · +2 marks · Medium
  3. Set 1 Q39Suppose that in an IP-over-Ethernet network, a machine X wishes to find the MAC address of another machine Y in its subnet. Which one of the following…MCQ · +2 marks · Easy
  4. Set 1 Q59Consider that 15 machines need to be connected in a LAN using 8-port Ethernet switches. Assume that these switches do not have any separate uplink ports. The…NAT · +2 marks · Easy

Other GATE CS topics

Continue learning with Success Tracker

Keep working on Computer Networks

Reading a solution is a useful start. In Success Tracker, you can attempt questions yourself, review mistakes and return to the topics that need another pass.

AI-powered practice· Unlimited practice on eligible plans
PYQs with solutions
Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
Practice that adapts
Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
AI doubt support
Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.

Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.

This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.