Question
Every host in an IPv4 network has a 1-second resolution real-time clock with battery backup. Each host needs to generate up to 1000 unique identifiers per second. Assume that each host has a globally unique IPv4 address. Design a 50-bit globally unique ID for this purpose. After what period (in seconds) will the identifiers generated by a host wrap around?
Official answer and solution
- Official answer
- 256
- From
- Official GATE 2014 answer key
Solution
Allocate the 50 bits among the host identifier, within-second counter, and timestamp to determine the wrap-around time.
-
Components of the 50-bit Globally Unique ID:
- Every host has a globally unique IPv4 address, which occupies bits.
- Remaining bits for host-local identification: bits.
-
Bit Allocation for Unique IDs per Second:
- Each host generates up to unique identifiers per second.
- To represent distinct counter values within a single second, the required number of bits is:
-
Remaining Bits for the Seconds Timestamp:
- Bits remaining for the 1-second resolution clock counter:
- Bits remaining for the 1-second resolution clock counter:
-
Wrap-around Period:
- An 8-bit timestamp counter can count distinct seconds before wrapping back to zero.
- Therefore, the identifiers generated by a host will wrap around after 256 seconds.
256
Allocating 18 bits entirely to the timestamp without reserving 10 bits for distinguishing 1000 IDs per second.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 3
- Question
- 37 of 65, printed as CS Q.27
- 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.