🎓 BookMCQ
← Back to 29. Peer to Peer Paradigm

📝 Kademlia protocol in P2P networks (9 MCQs)

📖 From Data Communication and Networks • 29. Peer to Peer Paradigm • 9 questions available

What is Kademlia protocol in P2P networks?

Kademlia is a P2P protocol that uses XOR-based distance metrics and parallel lookups to efficiently store and retrieve data in a decentralized manner, offering low latency and resilience against node failures through redundant storage.

3
Easy
4
Medium
2
Hard

📝 All Kademlia protocol in P2P networks MCQs

Q1. What binary operation does Kademlia use to compute the distance between two node identifiers?

A.XOR ✅
B.AND
C.OR
D.Addition
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Kademlia defines the distance between identifiers as the bitwise exclusive‑or (XOR) of the two IDs. XOR highlights the positions where the bits differ, producing a numeric value that can be ordered to guide routing. Because XOR is fast to compute and yields a symmetric metric, it is the operation used throughout the protocol.

Q2. Node X has identifier 0x1A30x1A3 and node Y has identifier 0x1B70x1B7. Which k‑bucket of X will contain Y based on the XOR distance?

A.Bucket 2
B.Bucket 3
C.Bucket 4 ✅
D.Bucket 5
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The XOR of the two IDs is 0x1A30x1B7=0x140x1A3 \oplus 0x1B7 = 0x14 (decimal 20). The most significant set bit of 20 is at position 4, so the distance falls into bucket 4 (bucket indices start at 0). Consequently, Y is stored in X’s bucket 4.

Q3. Compare two pairs of nodes: Pair 1 differs only in the most‑significant bit of their IDs, while Pair 2 differs only in the least‑significant bit. Which statement correctly describes the bucket each pair would occupy?

A.Both pairs are placed in bucket 0
B.Pair 1 goes to a higher‑index bucket than Pair 2 ✅
C.Both pairs go to the highest‑index bucket
D.Pair 2 goes to a higher‑index bucket than Pair 1
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: In Kademlia, the bucket index corresponds to the position of the highest differing bit. A difference in the most‑significant bit yields the largest possible index (the highest bucket), whereas a difference in the least‑significant bit yields index 0, the lowest bucket. Thus Pair 1 resides in a higher‑index bucket than Pair 2.

Q4. If the bucket size k is increased from 10 to 20 while keeping the network size constant, what is the most likely effect on lookup latency and network overhead?

A.Latency tends to decrease, but overhead increases ✅
B.Both latency and overhead decrease
C.Latency increases and overhead stays the same
D.There is no noticeable effect
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Larger k allows each bucket to hold more contacts, giving the routing algorithm more choices for each hop. With more options, the algorithm can often find a node that is closer to the target, reducing the number of hops (lower latency). However, maintaining additional contacts requires extra ping/refresh traffic, raising overall overhead.

Q5. A node has five full k‑buckets. During a lookup for target ID T, the XOR distance to T is smaller than any distance represented by bucket 3. Which buckets can supply the initial candidate nodes?

A.Only bucket 0
B.Buckets 0 through 2 ✅
C.Buckets 3 and 4
D.All five buckets
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The node selects candidates from buckets that contain IDs closer to the target than the bucket being considered. Since the target distance is smaller than any entry in bucket 3, only the buckets that store nearer distances—buckets 0, 1, and 2—can provide nodes that are potentially closer to T. Buckets 3 and 4 hold IDs that are farther away, so they are excluded.

Q6. How does a non‑uniform distribution of node identifiers affect the population of k‑buckets and overall routing efficiency in Kademlia?

A.Some buckets become overfull, causing longer lookup paths and higher churn ✅
B.Underfull buckets improve efficiency by reducing maintenance traffic
C.Bucket sizes remain balanced regardless of identifier distribution
D.All buckets experience equal load, so efficiency is unchanged
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When identifiers cluster, the buckets that correspond to the dense region receive more entries than their capacity k, forcing older contacts to be evicted. Overfull buckets may contain stale or less optimal peers, which can increase the number of hops needed to reach a target and amplify maintenance messages as nodes constantly refresh their tables. This degrades routing efficiency compared with a uniformly random ID space.

Q7. Explain why the XOR metric used in Kademlia satisfies symmetry and the triangle inequality, making it a valid distance function?

A.XOR is not symmetric and violates triangle inequality
B.XOR is symmetric but does not satisfy triangle inequality
C.XOR is symmetric and fulfills triangle inequality ✅
D.None of the above
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: For any two identifiers A and B, AB=BAA \oplus B = B \oplus A, establishing symmetry. Moreover, for any three identifiers A, B, and C, the bitwise differences obey (AB)(AC)+(CB)(A \oplus B) \le (A \oplus C) + (C \oplus B) because each differing bit contributes at most once to the combined distance, ensuring the triangle inequality holds. These properties qualify XOR as a proper metric for routing decisions.

Q8. In a network of 2102^{10} nodes where each k‑bucket stores at most 3 contacts, what is the worst‑case number of hops required to locate a specific target node using Kademlia’s lookup algorithm?

A.5 hops
B.7 hops
C.10 hops ✅
D.12 hops
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Kademlia guarantees that each hop reduces the XOR distance to the target by at least one bit, effectively halving the remaining search space. With 2102^{10} possible identifiers, the maximum number of distinct bit positions is 10, so in the worst case the algorithm may need one hop per bit, resulting in 10 hops. The bucket size does not change this logarithmic bound.

Q9. Node A has identifier 0x0F0F0x0F0F and node B has identifier 0xF0F00xF0F0. What is the XOR distance between them, and which k‑bucket index does B occupy relative to A?

A.Bucket 7
B.Bucket 12
C.Bucket 15 ✅
D.Bucket 8
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: Computing the XOR gives 0x0F0F0xF0F0=0xFFFF0x0F0F \oplus 0xF0F0 = 0xFFFF, which in binary is fifteen consecutive 1s. The most significant set bit is at position 15 (counting from 0), so the distance falls into bucket 15. This is the highest possible bucket for a 16‑bit identifier space, indicating that B is maximally distant from A according to the Kademlia metric.

🔗 Related Topics (MCQs)