IAE Academy

GATE 2024 CS2 Q.32: solution and answer

GATE 2024 · CS2Q.32 · 1 mark · MSQ

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

  1. (A)

    Source IP Address

  2. (B)

    Protocol

  3. (C)

    Time to Live (TTL)

  4. (D)

    Header Checksum

See the question in the paper

Answer and solution

ANSWER

The fields always modified by a forwarding router are Time to Live (TTL) and Header Checksum: options C and D.

Official answer: C, DSource: Official answer key, GATE 2024 CS2 (IISc Bengaluru)

  1. A router that forwards an IPv4 packet must decrement the Time to Live (TTL) field by 1, so that packets cannot loop forever. TTL therefore changes at every hop, so option C is always modified.

  2. The header checksum is computed over the whole IP header. Because TTL changes at every hop, the checksum value must change too, and the router recomputes it. The checksum is therefore also changed at every hop, so option D is always modified.

  3. The Source IP Address stays the same from the sender to the receiver. Only a NAT device rewrites it, and an ordinary forwarding router does not, so option A is not always modified.

  4. The Protocol field names the payload carried (for example TCP or UDP). A router does not look at it or change it when forwarding, so option B is not modified.

  5. Some fields change only sometimes, such as total length, flags and fragment offset when a router fragments a packet. These do not count as always modified, and none of them is offered as an option.

  6. So the fields always modified are TTL and Header Checksum: options C and D.

KEY IDEA

A forwarding router must decrement TTL by 1. The header checksum covers the IP header, so changing TTL forces the router to recompute it. Both therefore change on every hop. The addresses and the Protocol field are left alone.

WATCH OUT FOR

Choosing only TTL and forgetting that the checksum must be recomputed after the TTL change. Another slip is picking Source IP Address because of NAT, which an ordinary router does not do.

From the GATE 2024 CS2 paper. Every question of this paper · Download the full paper · All 20 IPv4 questions, with notes

More IPv4 questions