🎓 BookMCQ
← Back to 29. Peer to Peer Paradigm

📝 Kademlia routing table (15 MCQs)

Contact Knowledge Organized by XOR Ranges

A Kademlia routing table stores contact information for other nodes in a set of k-buckets. Each bucket represents a range of XOR distances from the local node's identifier, allowing the node to retain contacts across the keyspace. A contact normally includes the peer's node ID, IP address, and port. XOR ordering controls lookup decisions regardless of physical network distance between peers.

Bucket Index and Contact Capacity

For an m-bit identifier, distance ranges are grouped by the position of the highest differing bit. In the original 160-bit design, up to 160 distance classes are possible. Each k-bucket holds at most k contacts, so routing state remains bounded rather than storing every participant. Bucket structure bounds state while covering distinct XOR distance ranges around each node.

Updating Contacts and Testing Reachability

When a node receives a valid message from a known contact, it can refresh that contact's recency. A newly discovered contact may be added if space exists; if the bucket is full, the implementation may test the least recently seen contact before deciding whether to retain the newcomer. This favors stable reachable peers. Responses can add closer contacts before the next query round.

Selecting Contacts for a Lookup

To find a key, a node sorts known contacts by XOR distance to the target and queries the closest candidates. Responses can reveal additional contacts that are even closer. The routing table supplies starting knowledge; iterative queries expand the search toward the target without broadcasting to the entire network. XOR values, not decimal subtraction, determine which candidate is nearer here.

Small State and Resilience to Peer Churn

K-buckets provide a bounded and distributed view of the overlay, while multiple contacts in a range help a node continue when some peers fail. Periodic bucket refreshes and lookup traffic can improve stale knowledge. Exact bucket maintenance policies may vary among implementations, while the XOR organization remains central. Availability still depends on replicas and reachable contacts near the key.

A Routing Table Is Not a Complete Membership List

'Every node knows every peer' is false because each table is bounded. 'A bucket stores nodes at equal numeric intervals from the IP address' confuses XOR distance with network addressing. 'A new contact always replaces an old one' ignores reachability checks and recency-based retention. Distance measures identifiers, not latency, ownership, or physical separation between peers.

Bucket Ranges and Contact Selection

Be able to explain how a node ID determines XOR-distance classes, why each bucket has a capacity k, and how candidate contacts are ranked for a target key. Trace a lookup using the closest known contacts, and distinguish routing-table maintenance from storing application values. Write each XOR result before ranking candidate contacts for lookup.

Kademlia Routing Table Terms

  • Routing table - Local collection of known peer contacts..
  • k-bucket - Contacts for one XOR distance range..
  • Contact - Node ID plus network endpoint..
  • Bucket capacity - Maximum contacts allowed in a bucket..
  • Recency - How recently a peer was observed..
  • Refresh - Operation updating stale routing knowledge..
5
Easy
6
Medium
4
Hard

📝 All Kademlia routing table MCQs

Q1. If a router receives a packet for a destination IP that is not explicitly listed in its routing table, what is the most likely action it will take?

A.Drop the packet and log an error
B.Broadcast an ARP request for the destination
C.Forward the packet to the default gateway entry ✅
D.Generate an ICMP Destination Unreachable message
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: When no specific route matches, the router consults its default route (0.0.0.0/0). If present, the packet is forwarded to that next‑hop, typically a gateway toward the broader network. Dropping, ARP broadcasting, or ICMP generation are only used when no default route exists, making forwarding the default behavior.

Q2. A router has two overlapping routes: 192.168.0.0/16 via Interface A and 192.168.1.0/24 via Interface B. Which route will be selected for a packet destined to 192.168.1.45, and why?

A.Interface A because it appears first in the table
B.Interface B because it has the longer prefix length ✅
C.Interface A because /16 is more general
D.Interface B because it is learned via a dynamic protocol
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The longest‑prefix match rule selects the route with the most specific subnet mask. Here, /24 (192.168.1.0/24) is more specific than /16, so Interface B is chosen. The order in the table or protocol source does not override the prefix length rule.

Q3. When a router updates its routing table using a distance‑vector protocol, what indirect effect can cause routing loops if split horizon is not enforced?

A.Increased convergence speed
B.Incorrect next‑hop information being advertised back to the source ✅
C.Higher bandwidth consumption on links
D.Reduced CPU utilization
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Distance‑vector protocols advertise routes to neighbors. Without split horizon, a router may send back to its source the route it learned from that source, causing the source to believe a shorter path exists through the neighbor, creating a loop. This indirect effect is mitigated by split horizon or poison reverse.

Q4. Consider a router that receives two equal‑cost routes to the same destination from different protocols (OSPF and EIGRP). Which factor most likely determines which route is installed in the routing table?

A.Administrative distance of the protocols ✅
B.Metric value advertised by each protocol
C.Interface bandwidth of the outgoing link
D.Timestamp of route advertisement
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Administrative distance (AD) is a trust metric that the router uses to rank routes from different sources. The route with the lower AD is preferred. Since OSPF typically has an AD of 110 and EIGRP of 90, the EIGRP route would be installed, regardless of equal metric values.

Q5. A router's routing table contains a default route with a metric of 5, while a more specific route to the same destination has a metric of 10. Which route will the router use and why?

A.The default route because it has a lower metric ✅
B.The specific route because it matches more bits
C.Both routes are used in load‑balancing
D.The router will discard both routes as ambiguous
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Routing decisions prioritize the longest‑prefix match first; if a more specific route exists, it is chosen even if its metric is higher. However, when both routes cover the same destination (e.g., default versus specific) and the specific route is truly more specific, it wins regardless of metric. In this case, the specific route is selected.

Q6. Compare static and dynamic routing tables in terms of scalability. Which statement best captures their difference?

A.Static tables scale better because they require no protocol overhead
B.Dynamic tables scale better because they can automatically adapt to network changes ✅
C.Both scales equally; the difference lies only in configuration complexity
D.Static tables are more scalable in large, homogeneous networks
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Dynamic routing protocols continuously exchange information, allowing routers to learn new paths and adjust to topology changes, which greatly enhances scalability in large or evolving networks. Static routes must be manually configured on each router, making them impractical as the network grows.

Q7. Analyze the impact of increasing the subnet mask length in a routing table entry from /24 to /28 on the number of possible host addresses. What is the effect?

A.The number of host addresses doubles
B.The number of host addresses increases by four
C.The number of host addresses decreases by a factor of sixteen ✅
D.The number of host addresses remains unchanged
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: A /24 subnet provides 28−2=2542^{8}-2 = 254 usable hosts, while a /28 provides 24−2=142^{4}-2 = 14 usable hosts. The host space shrinks by a factor of 24=162^{4}=16. Therefore, the number of usable addresses decreases dramatically, illustrating the trade‑off between granularity and address availability.

Q8. Differentiate between link‑state and distance‑vector routing protocols in terms of the information each maintains about the network. Which description is accurate?

A.Link‑state protocols keep only next‑hop information, while distance‑vector protocols maintain a full topology map
B.Link‑state protocols store a complete map of the network topology, whereas distance‑vector protocols store only the distance and direction to each destination ✅
C.Both protocols store identical information but use different algorithms to compute routes
D.Distance‑vector protocols store link costs, while link‑state protocols store hop counts
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Link‑state protocols like OSPF flood LSAs, allowing each router to build a full topology graph. Distance‑vector protocols such as RIP only advertise the total cost (distance) and the next hop (vector) to each destination, lacking a global view of the network.

Q9. Evaluate why a router might prefer a route learned via BGP over one learned via OSPF, even if the OSPF route appears more specific. Which factor is most decisive?

A.BGP routes have lower administrative distance by default
B.BGP routes are always more secure
C.OSPF routes cannot be used for external destinations
D.BGP routes carry policy attributes that can override specificity ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: BGP includes policy attributes like local preference, MED, and community tags that can be configured to prioritize certain paths regardless of prefix length. Even if an OSPF route is more specific, the router may select the BGP route if its policy dictates higher preference.

Q10. Synthesize a scenario where a router uses route aggregation (summarization) and explain the primary benefit. Which outcome best describes the effect?

A.Increased number of routing table entries, leading to higher memory usage
B.Reduced routing table size, decreasing CPU processing time ✅
C.Loss of all specific route information, causing packet drops
D.Improved latency on all interfaces
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Route aggregation combines multiple contiguous networks into a single summary route (e.g., 192.168.0.0/16 summarizing 192.168.1.0/24 and 192.168.2.0/24). This reduces the number of entries the router must store and process, enhancing scalability and decreasing convergence time.

Q11. Apply the principle of longest‑prefix matching to determine which entry will be used for the destination 10.0.5.130 given the following routes: 10.0.0.0/8, 10.0.4.0/22, and 10.0.5.128/25. Which route is selected?

A.10.0.0.0/8
B.10.0.4.0/22
C.10.0.5.128/25 ✅
D.None of the above
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The longest‑prefix rule selects the route with the most specific mask that still matches the destination. 10.0.5.130 falls within 10.0.5.128/25 (covers 10.0.5.128‑10.0.5.255) which has a /25 mask, longer than /22 and /8. Hence, that entry is chosen.

Q12. Explain how a router’s forwarding information base (FIB) differs from its routing information base (RIB). Which statement correctly captures the relationship?

A.The FIB contains raw routing protocol updates, while the RIB stores the final forwarding decisions
B.The RIB holds the complete set of learned routes, and the FIB is a compiled table optimized for fast packet forwarding ✅
C.Both FIB and RIB are identical; the terms are interchangeable
D.The FIB is only used in software routers, whereas the RIB is used in hardware routers
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The RIB (or routing table) stores all routes learned from protocols, including multiple paths and metrics. The router then processes this information to create the FIB, a streamlined, hardware‑friendly structure (often in TCAM) that enables rapid look‑ups for each packet. Thus, the FIB is a subset derived from the RIB.

Q13. In a network employing both IPv4 and IPv6, how does a router maintain separate routing tables, and what is the main advantage of this separation?

A.It merges both address families into a single table to conserve memory
B.Separate tables allow independent convergence and prevent address‑family conflicts ✅
C.Separate tables are required only for security reasons
D.There is no functional difference; the separation is purely cosmetic
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: IPv4 and IPv6 have distinct address formats and routing protocols. Maintaining separate tables enables each protocol to converge independently, apply specific policies, and avoid ambiguity when matching prefixes. This isolation also simplifies troubleshooting and supports dual‑stack deployments without interference.

Q14. Consider a router with three interfaces: A (10.0.0.1/24), B (10.0.1.1/24), and C (10.0.2.1/24). If a packet destined for 10.0.2.45 arrives on interface A, which routing table entry will determine the outgoing interface, assuming a static route exists for 10.0.2.0/24 via interface C?

A.Interface A because the packet entered on A
B.Interface B because it is the next hop in the path
C.Interface C because the static route matches the destination subnet ✅
D.The router will broadcast on all interfaces
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The routing table is consulted after the packet is received. The static route 10.0.2.0/24 via interface C is the longest‑prefix match for the destination 10.0.2.45, directing the packet out through interface C regardless of the incoming interface.

Q15. Define a routing table in the context of IP networking.

A.A list of MAC addresses associated with each IP address
B.A database that maps destination networks to next‑hop interfaces and metrics ✅
C.A table that stores user credentials for network access
D.A schedule of periodic network backups
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: A routing table (also called a routing information base) is a data structure used by routers to decide where to forward packets. It contains entries that map destination network prefixes to next‑hop IP addresses, outgoing interfaces, and associated metrics or administrative distances.

🔗 Related Topics (MCQs)