Question
The maximum number of IPv4 router addresses that can be listed in the record route (RR) option field of an IPv4 header is
Official answer and solution
- Official answer
- 9
- From
- Official GATE 2017 answer key
Solution
Calculate the maximum byte space available for IPv4 header options and determine how many 4-byte IP addresses fit into the Record Route option.
Calculate available space in the IPv4 header:
- The Internet Header Length (IHL) field is 4 bits, with a maximum value of . Since IHL counts length in 32-bit (4-byte) words, the maximum total IPv4 header length is:
- The mandatory base IPv4 header is 20 bytes.
- The maximum space available for options is:
Examine the format of the Record Route (RR) option:
- Option Type (Code): 1 byte (value 7)
- Option Length: 1 byte
- Pointer: 1 byte
Total overhead for the RR option fields is bytes.
The remaining bytes available for storing router IPv4 addresses are:
Each IPv4 address occupies 4 bytes. Therefore, the maximum number of router addresses that can be listed is:
9
Dividing 40 bytes directly by 4 without subtracting the 3-byte header overhead (Code, Length, Pointer) of the Record Route option.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2017 Computer Science and Information Technology (CS) Session 2
- Question
- 20 of 65, printed as CS Q.20
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.