Computer Networks

GATE CS previous year questions · 22 questions

Topics

GATE CS 2025 Set 1 | Question 16

MCQ · 1 mark · −0.33

Identify the ONE CORRECT matching between the OSI layers and their corresponding functionalities as shown.

OSI LayersFunctionalities
(a) Network layer(I) Packet routing
(b) Transport layer(II) Framing and error handling
(c) Datalink layer(III) Host to host communication
Options for GATE CS 2025 Set 1 | Question 16

Explanation

Answer: (B)

The network layer decides the path a packet takes from network to network, so (a)-(I) Packet routing. The transport layer works end to end, carrying data between the source and destination hosts, so (b)-(III) Host to host communication. The data link layer packs bits into frames and detects and handles errors on each single link, so (c)-(II) Framing and error handling.

Answer: B

GATE CS 2025 Set 1 | Question 22

MSQ · 1 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?

Options for GATE CS 2025 Set 1 | Question 22

Explanation

Answer: (B), (D)

In the 3-way handshake the client opens with a SYN segment (P1: SYN = 1, ACK = 0). The server replies with SYN + ACK (P2: SYN = 1, ACK = 1), and the client finishes with a pure acknowledgement (P3: SYN = 0, ACK = 1).

  • (A) False: P3 has SYN = 0.
  • (B) True: P2 acknowledges the client’s SYN and carries the server’s own SYN.
  • (C) False: P2 must have SYN = 1.
  • (D) True: P1 is the connection request, so SYN = 1.

Answer: B, D

GATE CS 2025 Set 1 | Question 40

MCQ · 2 marks · −0.66

A packet with the 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 AddressSubnet Mask (in CIDR notation)Interface
145.36.0.0/16E1
145.36.128.0/17E2
145.36.64.0/18E3
145.36.255.0/24E4
Default--E5
Options for GATE CS 2025 Set 1 | Question 40

Explanation

Answer: (A)

A router uses longest prefix match: among the entries that match the destination, the one with the longest mask wins. The first two octets (145.36) agree with every listed subnet, so only the third octet matters: \(109 = 01101101_2\).

  • /16 (145.36.0.0): matches.
  • /17 (145.36.128.0): needs the third octet to begin with bit 1 (128 to 255); 109 begins with 0, so no match.
  • /18 (145.36.64.0): needs the third octet to begin with 01 (64 to 127); 109 does, so it matches.
  • /24 (145.36.255.0): needs the third octet to be 255, so no match.

Of the matches (/16, /18 and the default route), /18 is the longest, so the packet is sent on E3.

Answer: A

GATE CS 2025 Set 1 | Question 56

NAT · 2 marks

Suppose a 5-bit message is transmitted from a source to a destination through a noisy channel. The probability that a bit of the message gets flipped during transmission is 0.01. Flipping of each bit is independent of one another. The probability that the message is delivered error-free to the destination is ______ . (rounded off to three decimal places)

Explanation

Answer: 0.95

The message arrives error-free only if none of its 5 bits flips. Each bit survives with probability \(1 - 0.01 = 0.99\), and the bits are independent, so the probabilities multiply.

\[P = (0.99)^5 = 0.95099 \approx 0.951\]

Answer: 0.951

GATE CS 2025 Set 1 | Question 57

NAT · 2 marks

Suppose a message of size 15000 bytes is transmitted from a source to a destination using IPv4 protocol via two routers as shown in the figure. Each router has a defined maximum transmission unit (MTU) as shown in the figure, including IP header. The number of fragments that will be delivered to the destination is ________ . (Answer in integer)

Source to Router-1 (MTU = 5000 bytes) to Router-2 (MTU = 3000 bytes) to Destination

Explanation

Answer: 7

Use the standard 20-byte IPv4 header. The data in every fragment except the last must be a multiple of 8 bytes, and routers never reassemble: each router only splits the packets it receives.

  • Router-1 (MTU 5000): at most \(5000 - 20 = 4980\) data bytes, i.e. 4976 as a multiple of 8. The 15000 bytes become \(4976 + 4976 + 4976 + 72\): 4 fragments.
  • Router-2 (MTU 3000): at most \(3000 - 20 = 2980\), i.e. 2976 data bytes. Each 4976-byte fragment splits into \(2976 + 2000\), but the last fragment (72 data bytes, 92 bytes with its header) already fits and passes through unchanged.

Fragments delivered \(= 3 \times 2 + 1 = 7\). The tempting \(4 \times 2 = 8\) wrongly splits the small fourth fragment again; even ignoring the multiple-of-8 rule (4980, 4980, 4980, 60) the count is 7.

Answer: 7

GATE CS 2025 Set 2 | Question 16

MCQ · 1 mark · −0.33

Consider 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?

Options for GATE CS 2025 Set 2 | Question 16

Explanation

Answer: (B)

(i) is TRUE. A host that knows the IP address of a machine on its local network still needs that machine’s link-layer (MAC) address to build a frame. ARP broadcasts a request for that IP address and gets back the matching hardware address.

(ii) is FALSE. TCP is full duplex, and every segment header has an acknowledgement number field, so a segment carrying data from S to R can also acknowledge data received from R. This is called piggybacking, and it is the normal case when both sides are sending.

Answer: B

GATE CS 2025 Set 2 | Question 17

MCQ · 1 mark · −0.33

Consider the routing protocols given in List I and the names given in List II:

List IList II
(i) Distance vector routing(a) Bellman-Ford
(ii) Link state routing(b) Dijkstra

For matching of items in List I with those in List II, which ONE of the following options is CORRECT?

Options for GATE CS 2025 Set 2 | Question 17

Explanation

Answer: (A)

In distance vector routing (used by RIP), a router learns only the distance vectors of its neighbours. It keeps improving its own estimates with the Bellman-Ford relation \(D_x(y) = \min_v \{c(x, v) + D_v(y)\}\): the cost to a neighbour \(v\) plus that neighbour's distance to \(y\). So (i) matches (a).

In link state routing (used by OSPF), every router floods the costs of its own links, so each router learns the whole topology and runs Dijkstra's shortest path algorithm from itself. So (ii) matches (b).

The other options pair at least one protocol family with the wrong algorithm.

Answer: A

GATE CS 2025 Set 2 | Question 18

MCQ · 1 mark · −0.33

A 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 possible candidate for X?

Options for GATE CS 2025 Set 2 | Question 18

Explanation

Answer: (D)

The protocol field names the protocol whose message sits directly in the payload of the IP datagram, so X must be a protocol that runs immediately on top of IP.

  • ICMP (protocol number 1) and IGMP (2) are carried directly in IP datagrams.
  • OSPF also runs directly over IP, with protocol number 89.
  • RIP does not. Its messages travel inside UDP datagrams on port 520, so a datagram carrying RIP has 17 (UDP) in its protocol field, and RIP is identified only by the UDP port.

So RIP cannot be X.

Answer: D

GATE CS 2025 Set 2 | Question 23

MCQ · 1 mark · −0.33

Consider 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 its data field. A UDP segment is transmitted. The payload (data) in the UDP segment is 7488 bytes.

Which ONE of the following choices has the CORRECT total number of fragments transmitted and the size of the last fragment including IPv4 header?

Options for GATE CS 2025 Set 2 | Question 23

Explanation

Answer: (D)

IP fragments the whole UDP segment, header included: \(8 + 7488 = 7496\) bytes of IP data.

A fragment has a 20-byte IPv4 header and must fit in 1500 bytes, so it carries at most 1480 data bytes. Since 1480 is a multiple of 8, as fragment offsets require, every fragment except the last carries exactly 1480 bytes.

  • Five full fragments carry \(5 \times 1480 = 7400\) bytes.
  • The remaining \(7496 - 7400 = 96\) bytes form a sixth fragment of \(96 + 20 = 116\) bytes.

Leaving out the UDP header gives 88 data bytes (108 bytes with the IP header), the trap in options B and C.

Answer: D

GATE CS 2025 Set 2 | Question 36

MCQ · 2 marks · −0.66

Suppose 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 bps (bits/second) and the propagation delay between the two nodes is 100 milliseconds. Assume that the processing times at the source and destination are negligible. Also, assume that the size of the acknowledgement packet is negligible. Which ONE of the following most accurately gives the channel utilization for the above scenario in percentage?

Options for GATE CS 2025 Set 2 | Question 36

Explanation

Answer: (A)

In Stop-and-Wait the sender transmits one frame and then waits idle until the acknowledgement comes back, so one cycle lasts \(T_t + 2T_p\) (the ACK and processing times are negligible).

  • Transmission time: \(T_t = \frac{3000}{2000} = 1.5\) s.
  • Round-trip propagation: \(2T_p = 2 \times 0.1 = 0.2\) s.

Utilization \(= \frac{T_t}{T_t + 2T_p} = \frac{1.5}{1.7} \approx 0.8824\), about 88.2%, which is option A. Option B (93.75) comes from counting the propagation delay only one way: \(\frac{1.5}{1.6} = 0.9375\).

Answer: A