Which 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 an external network?
- (A)
Source IP
- (B)
Destination IP
- (C)
Header Checksum
- (D)
Total Length
Which 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 an external network?
Source IP
Destination IP
Header Checksum
Total Length
ANSWER
The fields modified are Source IP and Header Checksum: options (A) and (C).
Official answer: A, CSource: Official answer key, GATE 2024 CS1 (IISc Bengaluru)
A NAT device sits between a private (internal) network and the Internet. For a packet going out, it replaces the private source address with its own public address, and usually rewrites the source port in the TCP/UDP header as well.
Source IP: the private source address is replaced by the NAT's public address, so this field is modified. Option (A) is correct.
Destination IP: the outgoing packet is still addressed to the same external host, so the field is unchanged. (The destination address is rewritten only on the reply, on its way back in.) Option (B) is not modified.
Header Checksum: the IPv4 header checksum is computed over the whole IP header, including the source address. Once the source address changes, the old checksum no longer matches, so the NAT must recompute it. This field is modified. Option (C) is correct.
Total Length: translating the address does not change the size of the header or payload (an IPv4 address is 4 bytes before and after), so the field stays the same. Option (D) is not modified.
Fields modified: Source IP and Header Checksum, which are options (A) and (C).
KEY IDEA
An outgoing NAT rewrites the source address (and port). Any field that depends on the rewritten bytes must also be updated, so the IP header checksum changes with it.
WATCH OUT FOR
Forgetting that the header checksum covers the source address, so it must be recomputed after translation. Another slip is to include the destination address, which changes only on the reverse (incoming) path.
From the GATE 2024 CS1 paper. Every question of this paper · Download the full paper · All 20 IPv4 questions, with notes