📝 Kademlia identifier space (9 MCQs)
Binary IDs Define the Kademlia Keyspace
Kademlia assigns each node and data key a binary identifier of fixed length. In the original protocol, the identifier length is 160 bits, creating 2^160 possible values. A node ID identifies a participant, while a key identifies a value or resource to be located through the DHT. XOR ordering controls lookup decisions regardless of physical network distance between peers.
XOR as the Identifier Distance Metric
For identifiers x and y, the distance is x XOR y, interpreted as a non-negative integer. Equal identifiers have distance zero. A difference in a more significant bit produces a larger distance than a difference in a less significant bit, creating the metric used by routing and bucket organization. Bucket structure bounds state while covering distinct XOR distance ranges around each node.
Assigning Keys and Locating Responsible Nodes
Applications commonly hash resource names or content identifiers to generate keys. A lookup compares the target key with known node IDs using XOR distance and seeks the closest participants. A deployment may store values at or replicate them among nodes close to the key according to its storage rules. Responses can add closer contacts before the next query round.
A Four-Bit XOR Distance Calculation
For a small illustration, let key be 1010 and candidate node IDs be 1000 and 1011. Their XOR distances are 0010 and 0001, so 1011 is closer. Real Kademlia identifiers are much longer, but the same bitwise operation is applied across all identifier bits. XOR values, not decimal subtraction, determine which candidate is nearer here.
Uniform Distribution and Distance Classes
A suitable hash function spreads node IDs and keys through the binary space, reducing predictable clustering. Kademlia groups contacts by the magnitude of XOR distance, not by physical network location or IP subnet. This structure lets each node maintain a limited view of peers across different distance ranges. Availability still depends on replicas and reachable contacts near the key.
XOR Distance Is Symmetric but Not Geographic
'XOR distance measures physical latency' is false because it compares identifier bits. 'A larger decimal ID is always farther away' ignores the XOR metric. 'Node ID and key mean the same thing' overlooks their roles: one identifies a peer, while the other identifies the data being sought. Distance measures identifiers, not latency, ownership, or physical separation between peers.
Bitwise Comparison and Distance Ordering
Be able to XOR two binary identifiers bit by bit, convert the result to an integer if required, and rank candidate nodes from closest to farthest. Distinguish the identifier length from the number of nodes actually online. Explain how the resulting distance values determine Kademlia's routing buckets. Write each XOR result before ranking candidate contacts for lookup.
Kademlia Keyspace and XOR Terms
- Keyspace - Set of possible binary identifiers..
- 160-bit ID - Identifier length used in original Kademlia..
- XOR - Bitwise operation producing identifier distance..
- Distance - Integer comparing two identifiers..
- Node identifier - Binary value representing a peer..
- Target key - Binary value identifying one requested resource..
📝 All Kademlia identifier space MCQs
Q1. RTP sequence numbers are 16‑bit and wrap around after reaching the maximum value. If a sender transmits packets with sequence numbers 65534, 65535, 0, 1, what is the most likely consequence for a receiver that does not handle wrap‑around correctly?
📖 Explanation: When the receiver assumes a monotonically increasing sequence, the sudden jump from 65535 to 0 appears as a regression. Without wrap‑around logic, it treats the new packet as already received, discarding it. This creates a perceived loss and can disrupt ordering, leading to gaps in the media stream.
Q2. Suppose an ongoing VoIP session loses 5 % of its RTCP packets due to network congestion. Which of the following statements best infers the impact on the sender’s ability to adapt its transmission rate?
📖 Explanation: RTCP provides periodic reports that inform the sender about packet loss, jitter, and round‑trip time. Losing 5 % of these reports means the sender receives incomplete feedback, leading it to assume the network is healthier than it actually is. Consequently, it may keep or raise its bitrate, aggravating congestion and degrading call quality.
Q3. If a stream sends RTP packets and the packet loss probability is , what is the expected number of lost packets, and how might that affect the jitter buffer size assuming each lost packet requires an additional buffering of ms?
📖 Explanation: The expected number of lost packets equals . If each loss adds 5 ms of buffering, the total extra delay is or 1 second. Therefore the jitter buffer must be enlarged by roughly one second to absorb the additional variability.
Q4. Which statement correctly contrasts the primary functions of RTP and RTCP in a multimedia session?
📖 Explanation: RTP (Real‑time Transport Protocol) is responsible for the timely delivery of audio, video, or other media streams. RTCP (RTP Control Protocol) operates alongside RTP, exchanging statistics, quality reports, and participant information. This separation allows media to flow continuously while control messages are sent less frequently to monitor and adapt the session.
Q5. Considering scalability in large‑scale deployments, which advantage does SIP have over H.323 that most directly reduces the load on network resources?
📖 Explanation: SIP registrars can be deployed in a distributed fashion, allowing multiple servers to share the registration load. This design prevents any single node from becoming a bottleneck, reduces latency for registration queries, and scales more gracefully as the number of endpoints grows, directly easing network resource consumption.
Q6. A video source compresses each frame using a lossy codec that reduces the frame size from 2 MB to 500 KB. If the RTP payload limit is 1 500 bytes, how many RTP packets are required per frame, and what is the approximate bandwidth reduction factor compared to sending the raw frames at 30 fps?
📖 Explanation: The compressed frame of 500 KB equals about 512 000 bytes. Dividing by the payload limit of 1 500 bytes yields roughly 341 packets per frame. Raw frames of 2 MB (≈2 097 152 bytes) at 30 fps require about 505 Mbps, whereas compressed frames need about 123 Mbps, giving a reduction factor close to 4×.
Q7. In SIP, each call is identified by a unique Call‑ID header generated from a large identifier space. How does increasing the size of this identifier space most directly affect the probability of Call‑ID collisions in a busy network?
📖 Explanation: A larger identifier space expands the pool of possible Call‑IDs, making the chance that two independently generated IDs coincide drop dramatically. According to the birthday‑paradox principle, the collision probability falls roughly with the square of the space size, so expanding it renders accidental collisions practically impossible.
Q8. When designing a streaming application that uses RTP together with lossless compression (e.g., FLAC for audio), which trade‑off best describes the relationship between latency, bandwidth, and error resilience?
📖 Explanation: Lossless compression preserves the original data, so any bit error can be detected and often corrected, enhancing error resilience. However, preserving all information typically yields larger file sizes than lossy alternatives, increasing the required bandwidth. The higher bandwidth can introduce additional queuing delay, raising overall latency, which must be managed in real‑time applications.
Q9. If the identifier space for SIP Call‑IDs becomes exhausted due to a bug that reuses IDs too quickly, what mechanism should be introduced at the protocol level to mitigate the risk of session misrouting, and why is this mechanism effective?
📖 Explanation: Appending a timestamp (e.g., epoch time) to the Call‑ID creates a value that changes with each new session, guaranteeing temporal uniqueness even if the random portion repeats. This prevents accidental reuse of an identifier within the window where a previous session might still be active, thereby avoiding misrouting or cross‑talk.