SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
James F. Kurose, Keith W. Ross
Chapter:
Application Layer
Exercise:
Problems
Question:29 | ISBN:9780132856201 | Edition: 6

Question

Because an integer in [0, 2 n ⫺ 1] can be expressed as an n-bit binary number in a DHT, each key can be expressed as k = (k 0 , k 1 , . . . , k n–1 ), and each peer iden-tifier can be expressed p = (p 0 , p 1 , . . . , p n–1 ). Let’s now define the XOR distance between a key k and peer p as

Describe how this metric can be used to assign (key, value) pairs to peers. (To learn about how to build an efficient DHT using this natural metric, see [Maymounkov 2002] in which the Kademlia DHT is described.)

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

For each key, we first calculate the distances (using d(k,p)) between itself and all peers, and then store the key in the peer that is closest to the key (that is, with smallest distance value).

1 0

Discussions

Post the discussion to improve the above solution.