OSI and TCP/IP Protocol Stacks

GATE CS previous year questions · 4 questions

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 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 2024 Set 2 | Question 23

MSQ · 1 mark

Node 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 network path between X and R. Consider a packet sent from X to Y over this connection.

Which of the following statements is/are TRUE about the destination IP and MAC addresses on this packet at the time it leaves X?

Options for GATE CS 2024 Set 2 | Question 23

Explanation

Answer: (B)

IP addresses name the two ends of the journey, while a MAC address only names the next stop on the current link.

  • The IP header carries the final destination, so the destination IP address is Y's all the way; routers forward on it but do not rewrite it. B is true and A is false.
  • Y is on another network, so X sends the frame to its next-hop router R: the destination MAC address is R's, which X finds through ARP. R then puts the packet in a new frame for the next link.
  • An Ethernet switch is transparent. It forwards frames by their destination MAC address but is never itself the addressee, so C is false. Y's MAC address would be used only if Y were on X's own LAN, so D is false.

Answer: B

GATE CS 2024 Set 2 | Question 32

MSQ · 1 mark

Which of the following fields of an IP header is/are always modified by any router before it forwards the IP packet?

Options for GATE CS 2024 Set 2 | Question 32

Explanation

Answer: (C), (D)

When a router forwards an IPv4 packet:

  • it decrements the TTL by 1 (and discards the packet if the TTL reaches 0), so the TTL always changes;
  • the header checksum covers the whole header, TTL included, so it must be recomputed and rewritten every time.

The source IP address identifies the original sender and stays the same end to end; only special devices such as NAT boxes rewrite it, not every router. The protocol field names the protocol of the payload (for example 6 for TCP), which a router has no reason to change.

Answer: C, D