Skip to content
Official PYQ · 2014

GATE CS 2014 Set 3 Q27 — Fragmentation and IP Addressing, IPv4, CIDR

Explain with AI
Every host in an IPv4\textsf{IPv4} network has a 1-second1\text{-second} resolution real-time clock with battery backup. Each host needs to generate up to 10001000 unique identifiers per second. Assume that each host has a globally unique IPv4\textsf{IPv4} address. Design a 50-bit50\text{-bit} globally unique ID for this purpose. After what period (in seconds) will the identifiers generated by a host wrap around?
View worked solution

Answer: 256

To design a 50-bit50\text{-bit} globally unique ID, we divide the bits into global and local components:

  • Global Identifier: Since each host has a globally unique IPv4\textsf{IPv4} address, we use the 32-bit32\text{-bit} IPv4\textsf{IPv4} address to ensure global uniqueness.
  • Local Identifier: This leaves 50−32=1850 - 32 = 18 bits for generating unique IDs locally on each host.

The host has a 1-second1\text{-second} resolution real-time clock and needs to generate up to 10001000 unique IDs per second. To achieve this, the 18-bit18\text{-bit} local identifier is split into two parts:

  1. Counter: To distinguish up to 10001000 IDs generated within the same second, we need a counter. The number of bits required is:⌈log⁡2(1000)⌉=10 bits\lceil \log_2(1000) \rceil = 10 \text{ bits}
  2. Timestamp: The remaining bits are allocated to the timestamp (which increments every second):18−10=8 bits18 - 10 = 8 \text{ bits}

With 88 bits allocated for the timestamp, the maximum number of unique seconds that can be represented before wrapping around is:

28=256 seconds2^8 = 256 \text{ seconds}

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Fragmentation and IP Addressing, IPv4, CIDR questions