View worked solution
Answer: 256
To design a globally unique ID, we divide the bits into global and local components:
- Global Identifier: Since each host has a globally unique address, we use the address to ensure global uniqueness.
- Local Identifier: This leaves bits for generating unique IDs locally on each host.
The host has a resolution real-time clock and needs to generate up to unique IDs per second. To achieve this, the local identifier is split into two parts:
- Counter: To distinguish up to IDs generated within the same second, we need a counter. The number of bits required is:
- Timestamp: The remaining bits are allocated to the timestamp (which increments every second):
With bits allocated for the timestamp, the maximum number of unique seconds that can be represented before wrapping around is:
Free practice · Your answers on this page are not saved.
