<s>
A	O
distributed	B-Operating_System
hash	I-Operating_System
table	I-Operating_System
(	O
DHT	O
)	O
is	O
a	O
distributed	B-Architecture
system	I-Architecture
that	O
provides	O
a	O
lookup	O
service	O
similar	O
to	O
a	O
hash	B-Algorithm
table	I-Algorithm
.	O
</s>
<s>
key	B-Application
–	I-Application
value	I-Application
pairs	I-Application
are	O
stored	O
in	O
a	O
DHT	O
,	O
and	O
any	O
participating	O
node	B-Protocol
can	B-Protocol
efficiently	O
retrieve	O
the	O
value	O
associated	O
with	O
a	O
given	O
key	B-Application
.	O
</s>
<s>
The	O
main	O
advantage	O
of	O
a	O
DHT	O
is	O
that	O
nodes	O
can	B-Protocol
be	O
added	O
or	O
removed	O
with	O
minimum	O
work	O
around	O
re-distributing	O
keys	O
.	O
</s>
<s>
Keys	O
are	O
unique	O
identifiers	O
which	O
map	O
to	O
particular	O
values	O
,	O
which	O
in	O
turn	O
can	B-Protocol
be	O
anything	O
from	O
addresses	O
,	O
to	O
documents	B-Protocol
,	O
to	O
arbitrary	O
data	B-General_Concept
.	O
</s>
<s>
This	O
allows	O
a	O
DHT	O
to	O
scale	B-Architecture
to	O
extremely	O
large	O
numbers	O
of	O
nodes	O
and	O
to	O
handle	O
continual	O
node	B-Protocol
arrivals	O
,	O
departures	O
,	O
and	O
failures	O
.	O
</s>
<s>
DHTs	O
form	O
an	O
infrastructure	O
that	O
can	B-Protocol
be	O
used	O
to	O
build	O
more	O
complex	O
services	O
,	O
such	O
as	O
anycast	B-Protocol
,	O
cooperative	O
web	B-Protocol
caching	I-Protocol
,	O
distributed	B-Protocol
file	I-Protocol
systems	I-Protocol
,	O
domain	B-Protocol
name	I-Protocol
services	I-Protocol
,	O
instant	B-Application
messaging	I-Application
,	O
multicast	O
,	O
and	O
also	O
peer-to-peer	O
file	O
sharing	O
and	O
content	O
distribution	O
systems	O
.	O
</s>
<s>
Notable	O
distributed	O
networks	O
that	O
use	O
DHTs	O
include	O
BitTorrent	B-Protocol
's	O
distributed	O
tracker	O
,	O
the	O
Kad	O
network	O
,	O
the	O
Storm	O
botnet	O
,	O
the	O
Tox	B-Protocol
instant	I-Protocol
messenger	I-Protocol
,	O
Freenet	B-Protocol
,	O
the	O
YaCy	B-Application
search	B-Application
engine	I-Application
,	O
and	O
the	O
InterPlanetary	B-Protocol
File	I-Protocol
System	I-Protocol
.	O
</s>
<s>
DHT	O
research	O
was	O
originally	O
motivated	O
,	O
in	O
part	O
,	O
by	O
peer-to-peer	O
(	O
P2P	O
)	O
systems	O
such	O
as	O
Freenet	B-Protocol
,	O
Gnutella	B-Protocol
,	O
BitTorrent	B-Protocol
and	O
Napster	B-Application
,	O
which	O
took	O
advantage	O
of	O
resources	O
distributed	O
across	O
the	O
Internet	O
to	O
provide	O
a	O
single	O
useful	O
application	O
.	O
</s>
<s>
In	O
particular	O
,	O
they	O
took	O
advantage	O
of	O
increased	O
bandwidth	O
and	O
hard	B-Device
disk	I-Device
capacity	O
to	O
provide	O
a	O
file-sharing	O
service	O
.	O
</s>
<s>
These	O
systems	O
differed	O
in	O
how	O
they	O
located	O
the	O
data	B-General_Concept
offered	O
by	O
their	O
peers	O
.	O
</s>
<s>
Napster	B-Application
,	O
the	O
first	O
large-scale	O
P2P	O
content	O
delivery	O
system	O
,	O
required	O
a	O
central	O
index	O
server	O
:	O
each	O
node	B-Protocol
,	O
upon	O
joining	O
,	O
would	O
send	O
a	O
list	O
of	O
locally	O
held	O
files	O
to	O
the	O
server	O
,	O
which	O
would	O
perform	O
searches	O
and	O
refer	O
the	O
queries	O
to	O
the	O
nodes	O
that	O
held	O
the	O
results	O
.	O
</s>
<s>
Gnutella	B-Protocol
and	O
similar	O
networks	O
moved	O
to	O
a	O
query	B-Protocol
flooding	I-Protocol
model	O
in	O
essence	O
,	O
each	O
search	O
would	O
result	O
in	O
a	O
message	O
being	O
broadcast	O
to	O
every	O
other	O
machine	O
in	O
the	O
network	O
.	O
</s>
<s>
While	O
avoiding	O
a	O
single	B-Architecture
point	I-Architecture
of	I-Architecture
failure	I-Architecture
,	O
this	O
method	O
was	O
significantly	O
less	O
efficient	O
than	O
Napster	B-Application
.	O
</s>
<s>
Later	O
versions	O
of	O
Gnutella	B-Protocol
clients	O
moved	O
to	O
a	O
dynamic	O
querying	O
model	O
which	O
vastly	O
improved	O
efficiency	O
.	O
</s>
<s>
Freenet	B-Protocol
is	O
fully	O
distributed	O
,	O
but	O
employs	O
a	O
heuristic	B-Algorithm
key-based	B-Protocol
routing	I-Protocol
in	O
which	O
each	O
file	O
is	O
associated	O
with	O
a	O
key	B-Application
,	O
and	O
files	O
with	O
similar	O
keys	O
tend	O
to	O
cluster	O
on	O
a	O
similar	O
set	O
of	O
nodes	O
.	O
</s>
<s>
Queries	O
are	O
likely	O
to	O
be	O
routed	B-Protocol
through	O
the	O
network	O
to	O
such	O
a	O
cluster	O
without	O
needing	O
to	O
visit	O
many	O
peers	O
.	O
</s>
<s>
However	O
,	O
Freenet	B-Protocol
does	O
not	O
guarantee	O
that	O
data	B-General_Concept
will	O
be	O
found	O
.	O
</s>
<s>
Distributed	B-Operating_System
hash	I-Operating_System
tables	I-Operating_System
use	O
a	O
more	O
structured	O
key-based	B-Protocol
routing	I-Protocol
in	O
order	O
to	O
attain	O
both	O
the	O
decentralization	O
of	O
Freenet	B-Protocol
and	O
Gnutella	B-Protocol
,	O
and	O
the	O
efficiency	O
and	O
guaranteed	O
results	O
of	O
Napster	B-Application
.	O
</s>
<s>
One	O
drawback	O
is	O
that	O
,	O
like	O
Freenet	B-Protocol
,	O
DHTs	O
only	O
directly	O
support	O
exact-match	O
search	O
,	O
rather	O
than	O
keyword	O
search	O
,	O
although	O
Freenet	B-Protocol
's	O
routing	B-Protocol
algorithm	I-Protocol
can	B-Protocol
be	O
generalized	O
to	O
any	O
key	B-Application
type	O
where	O
a	O
closeness	O
operation	O
can	B-Protocol
be	O
defined	O
.	O
</s>
<s>
In	O
2001	O
,	O
four	O
systemsCAN	O
,	O
Chord	B-Application
,	O
Pastry	O
,	O
and	O
Tapestryignited	O
DHTs	O
as	O
a	O
popular	O
research	O
topic	O
.	O
</s>
<s>
Outside	O
academia	O
,	O
DHT	O
technology	O
has	O
been	O
adopted	O
as	O
a	O
component	O
of	O
BitTorrent	B-Protocol
and	O
in	O
the	O
Coral	O
Content	O
Distribution	O
Network	O
.	O
</s>
<s>
Autonomy	B-Operating_System
and	I-Operating_System
decentralization	I-Operating_System
:	O
The	O
nodes	O
collectively	O
form	O
the	O
system	O
without	O
any	O
central	O
coordination	O
.	O
</s>
<s>
Fault	B-General_Concept
tolerance	I-General_Concept
:	O
The	O
system	O
should	O
be	O
reliable	O
(	O
in	O
some	O
sense	O
)	O
even	O
with	O
nodes	O
continuously	O
joining	O
,	O
leaving	O
,	O
and	O
failing	O
.	O
</s>
<s>
Scalability	B-Architecture
:	O
The	O
system	O
should	O
function	O
efficiently	O
even	O
with	O
thousands	O
or	O
millions	O
of	O
nodes	O
.	O
</s>
<s>
A	O
key	B-Application
technique	O
used	O
to	O
achieve	O
these	O
goals	O
is	O
that	O
any	O
one	O
node	B-Protocol
needs	O
to	O
coordinate	O
with	O
only	O
a	O
few	O
other	O
nodes	O
in	O
the	O
system	O
–	O
most	O
commonly	O
,	O
O(log n )	O
of	O
the	O
n	O
participants	O
(	O
see	O
below	O
)	O
–	O
so	O
that	O
only	O
a	O
limited	O
amount	O
of	O
work	O
needs	O
to	O
be	O
done	O
for	O
each	O
change	O
in	O
membership	O
.	O
</s>
<s>
The	O
structure	O
of	O
a	O
DHT	O
can	B-Protocol
be	O
decomposed	O
into	O
several	O
main	O
components	O
.	O
</s>
<s>
The	O
foundation	O
is	O
an	O
abstract	O
keyspace	B-Application
,	O
such	O
as	O
the	O
set	O
of	O
160-bit	O
strings	O
.	O
</s>
<s>
A	O
keyspace	B-Application
partitioning	B-General_Concept
scheme	O
splits	O
ownership	O
of	O
this	O
keyspace	B-Application
among	O
the	O
participating	O
nodes	O
.	O
</s>
<s>
An	O
overlay	B-Architecture
network	I-Architecture
then	O
connects	O
the	O
nodes	O
,	O
allowing	O
them	O
to	O
find	O
the	O
owner	O
of	O
any	O
given	O
key	B-Application
in	O
the	O
keyspace	B-Application
.	O
</s>
<s>
Suppose	O
the	O
keyspace	B-Application
is	O
the	O
set	O
of	O
160-bit	O
strings	O
.	O
</s>
<s>
To	O
index	O
a	O
file	O
with	O
given	O
and	O
in	O
the	O
DHT	O
,	O
the	O
SHA-1	B-Algorithm
hash	I-Algorithm
of	O
is	O
generated	O
,	O
producing	O
a	O
160-bit	O
key	B-Application
,	O
and	O
a	O
message	O
is	O
sent	O
to	O
any	O
node	B-Protocol
participating	O
in	O
the	O
DHT	O
.	O
</s>
<s>
The	O
message	O
is	O
forwarded	O
from	O
node	B-Protocol
to	O
node	B-Protocol
through	O
the	O
overlay	B-Architecture
network	I-Architecture
until	O
it	O
reaches	O
the	O
single	O
node	B-Protocol
responsible	O
for	O
key	B-Application
as	O
specified	O
by	O
the	O
keyspace	B-Application
partitioning	B-General_Concept
.	O
</s>
<s>
That	O
node	B-Protocol
then	O
stores	O
the	O
key	B-Application
and	O
the	O
data	B-General_Concept
.	O
</s>
<s>
Any	O
other	O
client	O
can	B-Protocol
then	O
retrieve	O
the	O
contents	O
of	O
the	O
file	O
by	O
again	O
hashing	O
to	O
produce	O
and	O
asking	O
any	O
DHT	O
node	B-Protocol
to	O
find	O
the	O
data	B-General_Concept
associated	O
with	O
with	O
a	O
message	O
.	O
</s>
<s>
The	O
message	O
will	O
again	O
be	O
routed	B-Protocol
through	O
the	O
overlay	O
to	O
the	O
node	B-Protocol
responsible	O
for	O
,	O
which	O
will	O
reply	O
with	O
the	O
stored	O
.	O
</s>
<s>
The	O
keyspace	B-Application
partitioning	B-General_Concept
and	O
overlay	B-Architecture
network	I-Architecture
components	O
are	O
described	O
below	O
with	O
the	O
goal	O
of	O
capturing	O
the	O
principal	O
ideas	O
common	O
to	O
most	O
DHTs	O
;	O
many	O
designs	O
differ	O
in	O
the	O
details	O
.	O
</s>
<s>
Most	O
DHTs	O
use	O
some	O
variant	O
of	O
consistent	B-Algorithm
hashing	I-Algorithm
or	O
rendezvous	B-Algorithm
hashing	I-Algorithm
to	O
map	O
keys	O
to	O
nodes	O
.	O
</s>
<s>
The	O
two	O
algorithms	O
appear	O
to	O
have	O
been	O
devised	O
independently	O
and	O
simultaneously	O
to	O
solve	O
the	O
distributed	B-Operating_System
hash	I-Operating_System
table	I-Operating_System
problem	O
.	O
</s>
<s>
Both	O
consistent	B-Algorithm
hashing	I-Algorithm
and	O
rendezvous	B-Algorithm
hashing	I-Algorithm
have	O
the	O
essential	O
property	O
that	O
removal	O
or	O
addition	O
of	O
one	O
node	B-Protocol
changes	O
only	O
the	O
set	O
of	O
keys	O
owned	O
by	O
the	O
nodes	O
with	O
adjacent	O
IDs	O
,	O
and	O
leaves	O
all	O
other	O
nodes	O
unaffected	O
.	O
</s>
<s>
Contrast	O
this	O
with	O
a	O
traditional	O
hash	B-Algorithm
table	I-Algorithm
in	O
which	O
addition	O
or	O
removal	O
of	O
one	O
bucket	O
causes	O
nearly	O
the	O
entire	O
keyspace	B-Application
to	O
be	O
remapped	O
.	O
</s>
<s>
Since	O
any	O
change	O
in	O
ownership	O
typically	O
corresponds	O
to	O
bandwidth-intensive	O
movement	O
of	O
objects	O
stored	O
in	O
the	O
DHT	O
from	O
one	O
node	B-Protocol
to	O
another	O
,	O
minimizing	O
such	O
reorganization	O
is	O
required	O
to	O
efficiently	O
support	O
high	O
rates	O
of	O
churn	O
(	O
node	B-Protocol
arrival	O
and	O
failure	O
)	O
.	O
</s>
<s>
Consistent	B-Algorithm
hashing	I-Algorithm
employs	O
a	O
function	O
that	O
defines	O
an	O
abstract	O
notion	O
of	O
the	O
distance	O
between	O
the	O
keys	O
and	O
,	O
which	O
is	O
unrelated	O
to	O
geographical	O
distance	O
or	O
network	O
latency	O
.	O
</s>
<s>
Each	O
node	B-Protocol
is	O
assigned	O
a	O
single	O
key	B-Application
called	O
its	O
identifier	O
(	O
ID	O
)	O
.	O
</s>
<s>
A	O
node	B-Protocol
with	O
ID	O
owns	O
all	O
the	O
keys	O
for	O
which	O
is	O
the	O
closest	O
ID	O
,	O
measured	O
according	O
to	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
Chord	B-Application
DHT	I-Application
uses	O
consistent	B-Algorithm
hashing	I-Algorithm
,	O
which	O
treats	O
nodes	O
as	O
points	O
on	O
a	O
circle	O
,	O
and	O
is	O
the	O
distance	O
traveling	O
clockwise	O
around	O
the	O
circle	O
from	O
to	O
.	O
</s>
<s>
Thus	O
,	O
the	O
circular	O
keyspace	B-Application
is	O
split	O
into	O
contiguous	O
segments	O
whose	O
endpoints	O
are	O
the	O
node	B-Protocol
identifiers	O
.	O
</s>
<s>
If	O
and	O
are	O
two	O
adjacent	O
IDs	O
,	O
with	O
a	O
shorter	O
clockwise	O
distance	O
from	O
to	O
,	O
then	O
the	O
node	B-Protocol
with	O
ID	O
owns	O
all	O
the	O
keys	O
that	O
fall	O
between	O
and	O
.	O
</s>
<s>
In	O
rendezvous	B-Algorithm
hashing	I-Algorithm
,	O
also	O
called	O
highest	B-Algorithm
random	I-Algorithm
weight	I-Algorithm
(	O
HRW	O
)	O
hashing	O
,	O
all	O
clients	O
use	O
the	O
same	O
hash	O
function	O
(	O
chosen	O
ahead	O
of	O
time	O
)	O
to	O
associate	O
a	O
key	B-Application
to	O
one	O
of	O
the	O
n	O
available	O
servers	O
.	O
</s>
<s>
Given	O
some	O
key	B-Application
k	O
,	O
a	O
client	O
computes	O
n	O
hash	O
weights	O
.	O
</s>
<s>
The	O
client	O
associates	O
that	O
key	B-Application
with	O
the	O
server	O
corresponding	O
to	O
the	O
highest	O
hash	O
weight	O
for	O
that	O
key	B-Application
.	O
</s>
<s>
A	O
server	O
with	O
ID	O
owns	O
all	O
the	O
keys	O
for	O
which	O
the	O
hash	O
weight	O
is	O
higher	O
than	O
the	O
hash	O
weight	O
of	O
any	O
other	O
node	B-Protocol
for	O
that	O
key	B-Application
.	O
</s>
<s>
This	O
can	B-Protocol
enable	O
a	O
more	O
efficient	O
execution	O
of	O
range	B-Data_Structure
queries	I-Data_Structure
,	O
however	O
,	O
in	O
contrast	O
to	O
using	O
consistent	B-Algorithm
hashing	I-Algorithm
,	O
there	O
is	O
no	O
more	O
assurance	O
that	O
the	O
keys	O
(	O
and	O
thus	O
the	O
load	O
)	O
is	O
uniformly	O
randomly	O
distributed	O
over	O
the	O
key	B-Application
space	I-Application
and	O
the	O
participating	O
peers	O
.	O
</s>
<s>
DHT	O
protocols	O
such	O
as	O
Self-Chord	O
and	O
Oscar	O
address	O
such	O
issues	O
.	O
</s>
<s>
Self-Chord	O
decouples	O
object	O
keys	O
from	O
peer	O
IDs	O
and	O
sorts	O
keys	O
along	O
the	O
ring	O
with	O
a	O
statistical	O
approach	O
based	O
on	O
the	O
swarm	B-Architecture
intelligence	I-Architecture
paradigm	O
.	O
</s>
<s>
Sorting	O
ensures	O
that	O
similar	O
keys	O
are	O
stored	O
by	O
neighbour	O
nodes	O
and	O
that	O
discovery	O
procedures	O
,	O
including	O
range	B-Data_Structure
queries	I-Data_Structure
,	O
can	B-Protocol
be	O
performed	O
in	O
logarithmic	O
time	O
.	O
</s>
<s>
Each	O
node	B-Protocol
maintains	O
a	O
set	O
of	O
links	O
to	O
other	O
nodes	O
(	O
its	O
neighbors	O
or	O
routing	B-Protocol
table	I-Protocol
)	O
.	O
</s>
<s>
Together	O
,	O
these	O
links	O
form	O
the	O
overlay	B-Architecture
network	I-Architecture
.	O
</s>
<s>
A	O
node	B-Protocol
picks	O
its	O
neighbors	O
according	O
to	O
a	O
certain	O
structure	O
,	O
called	O
the	O
network	B-Architecture
's	I-Architecture
topology	I-Architecture
.	O
</s>
<s>
All	O
DHT	O
topologies	B-Architecture
share	O
some	O
variant	O
of	O
the	O
most	O
essential	O
property	O
:	O
for	O
any	O
key	B-Application
,	O
each	O
node	B-Protocol
either	O
has	O
a	O
node	B-Protocol
ID	O
that	O
owns	O
or	O
has	O
a	O
link	O
to	O
a	O
node	B-Protocol
whose	O
node	B-Protocol
ID	O
is	O
closer	O
to	O
,	O
in	O
terms	O
of	O
the	O
keyspace	B-Application
distance	O
defined	O
above	O
.	O
</s>
<s>
It	O
is	O
then	O
easy	O
to	O
route	O
a	O
message	O
to	O
the	O
owner	O
of	O
any	O
key	B-Application
using	O
the	O
following	O
greedy	B-Algorithm
algorithm	I-Algorithm
(	O
that	O
is	O
not	O
necessarily	O
globally	O
optimal	O
)	O
:	O
at	O
each	O
step	O
,	O
forward	O
the	O
message	O
to	O
the	O
neighbor	O
whose	O
ID	O
is	O
closest	O
to	O
.	O
</s>
<s>
When	O
there	O
is	O
no	O
such	O
neighbor	O
,	O
then	O
we	O
must	O
have	O
arrived	O
at	O
the	O
closest	O
node	B-Protocol
,	O
which	O
is	O
the	O
owner	O
of	O
as	O
defined	O
above	O
.	O
</s>
<s>
This	O
style	O
of	O
routing	B-Protocol
is	O
sometimes	O
called	O
key-based	B-Protocol
routing	I-Protocol
.	O
</s>
<s>
Beyond	O
basic	O
routing	B-Protocol
correctness	O
,	O
two	O
important	O
constraints	O
on	O
the	O
topology	B-Architecture
are	O
to	O
guarantee	O
that	O
the	O
maximum	O
number	O
of	O
hops	B-Protocol
in	O
any	O
route	O
(	O
route	O
length	O
)	O
is	O
low	O
,	O
so	O
that	O
requests	O
complete	O
quickly	O
;	O
and	O
that	O
the	O
maximum	O
number	O
of	O
neighbors	O
of	O
any	O
node	B-Protocol
(	O
maximum	O
node	B-Protocol
degree	O
)	O
is	O
low	O
,	O
so	O
that	O
maintenance	O
overhead	O
is	O
not	O
excessive	O
.	O
</s>
<s>
degree	O
Max	O
route	O
length	O
Used	O
in	O
Note	O
Worst	O
lookup	O
lengths	O
,	O
with	O
likely	O
much	O
slower	O
lookups	O
times	O
Koorde	B-Algorithm
(	O
with	O
constant	O
degree	O
)	O
More	O
complex	O
to	O
implement	O
,	O
but	O
acceptable	O
lookup	O
time	O
can	B-Protocol
be	O
found	O
with	O
a	O
fixed	O
number	O
of	O
connections	O
Chord	B-Application
Kademlia	B-Operating_System
Pastry	O
Tapestry	O
Most	O
common	O
,	O
but	O
not	O
optimal	O
(	O
degree/route	O
length	O
)	O
.	O
</s>
<s>
The	O
most	O
common	O
choice	O
,	O
degree/route	O
length	O
,	O
is	O
not	O
optimal	O
in	O
terms	O
of	O
degree/route	O
length	O
tradeoff	O
,	O
but	O
such	O
topologies	B-Architecture
typically	O
allow	O
more	O
flexibility	O
in	O
choice	O
of	O
neighbors	O
.	O
</s>
<s>
In	O
general	O
,	O
all	O
DHTs	O
construct	O
navigable	O
small-world	O
network	B-Architecture
topologies	I-Architecture
,	O
which	O
trade-off	O
route	O
length	O
vs.	O
network	O
degree	O
.	O
</s>
<s>
Maximum	O
route	O
length	O
is	O
closely	O
related	O
to	O
diameter	O
:	O
the	O
maximum	O
number	O
of	O
hops	B-Protocol
in	O
any	O
shortest	O
path	O
between	O
nodes	O
.	O
</s>
<s>
Route	O
length	O
can	B-Protocol
be	O
greater	O
than	O
diameter	O
,	O
since	O
the	O
greedy	O
routing	B-Protocol
algorithm	I-Protocol
may	O
not	O
find	O
shortest	O
paths	O
.	O
</s>
<s>
Aside	O
from	O
routing	B-Protocol
,	O
there	O
exist	O
many	O
algorithms	O
that	O
exploit	O
the	O
structure	O
of	O
the	O
overlay	B-Architecture
network	I-Architecture
for	O
sending	O
a	O
message	O
to	O
all	O
nodes	O
,	O
or	O
a	O
subset	O
of	O
nodes	O
,	O
in	O
a	O
DHT	O
.	O
</s>
<s>
These	O
algorithms	O
are	O
used	O
by	O
applications	O
to	O
do	O
overlay	O
multicast	O
,	O
range	B-Data_Structure
queries	I-Data_Structure
,	O
or	O
to	O
collect	O
statistics	O
.	O
</s>
<s>
Two	O
systems	O
that	O
are	O
based	O
on	O
this	O
approach	O
are	O
Structella	O
,	O
which	O
implements	O
flooding	O
and	O
random	O
walks	O
on	O
a	O
Pastry	O
overlay	O
,	O
and	O
DQ-DHT	O
,	O
which	O
implements	O
a	O
dynamic	O
querying	O
search	O
algorithm	O
over	O
a	O
Chord	B-Application
network	O
.	O
</s>
<s>
Because	O
of	O
the	O
decentralization	O
,	O
fault	B-General_Concept
tolerance	I-General_Concept
,	O
and	O
scalability	B-Architecture
of	O
DHTs	O
,	O
they	O
are	O
inherently	O
more	O
resilient	O
against	O
a	O
hostile	O
attacker	O
than	O
a	O
centralized	O
system	O
.	O
</s>
<s>
Open	O
systems	O
for	O
distributed	O
data	B-General_Concept
storage	O
that	O
are	O
robust	O
against	O
massive	O
hostile	O
attackers	O
are	O
feasible	O
.	O
</s>
<s>
A	O
DHT	O
system	O
that	O
is	O
carefully	O
designed	O
to	O
have	O
Byzantine	B-Operating_System
fault	I-Operating_System
tolerance	I-Operating_System
can	B-Protocol
defend	O
against	O
a	O
security	O
weakness	O
,	O
known	O
as	O
the	O
Sybil	O
attack	O
,	O
which	O
affects	O
most	O
current	O
DHT	O
designs	O
.	O
</s>
<s>
Petar	O
Maymounkov	O
,	O
one	O
of	O
the	O
original	O
authors	O
of	O
Kademlia	B-Operating_System
,	O
has	O
proposed	O
a	O
way	O
to	O
circumvent	O
the	O
weakness	O
to	O
the	O
Sybil	O
attack	O
by	O
incorporating	O
social	O
trust	O
relationships	O
into	O
the	O
system	O
design	O
.	O
</s>
<s>
The	O
new	O
system	O
,	O
codenamed	O
Tonika	O
or	O
also	O
known	O
by	O
its	O
domain	O
name	O
as	O
5ttt	O
,	O
is	O
based	O
on	O
an	O
algorithm	O
design	O
known	O
as	O
"	O
electric	O
routing	B-Protocol
"	O
and	O
co-authored	O
with	O
the	O
mathematician	O
Jonathan	O
Kelner	O
.	O
</s>
<s>
Several	O
real-world	O
DHTs	O
use	O
128-bit	O
or	O
160-bit	O
key	B-Application
space	I-Application
.	O
</s>
<s>
Some	O
real-world	O
DHTs	O
use	O
hash	O
functions	O
other	O
than	O
SHA-1	B-Algorithm
.	O
</s>
<s>
In	O
the	O
real	O
world	O
the	O
key	B-Application
could	O
be	O
a	O
hash	O
of	O
a	O
file	O
's	O
content	O
rather	O
than	O
a	O
hash	O
of	O
a	O
file	O
's	O
name	O
to	O
provide	O
content-addressable	B-Data_Structure
storage	I-Data_Structure
,	O
so	O
that	O
renaming	O
of	O
the	O
file	O
does	O
not	O
prevent	O
users	O
from	O
finding	O
it	O
.	O
</s>
<s>
For	O
example	O
,	O
key	B-Application
could	O
be	O
the	O
node	B-Protocol
and	O
associated	O
data	B-General_Concept
could	O
describe	O
how	O
to	O
contact	O
this	O
node	B-Protocol
.	O
</s>
<s>
In	O
the	O
simplest	O
case	O
,	O
is	O
just	O
a	O
random	O
number	O
that	O
is	O
directly	O
used	O
as	O
key	B-Application
(	O
so	O
in	O
a	O
160-bit	O
DHT	O
will	O
be	O
a	O
160-bit	O
number	O
,	O
usually	O
randomly	O
chosen	O
)	O
.	O
</s>
<s>
Redundancy	O
can	B-Protocol
be	O
added	O
to	O
improve	O
reliability	O
.	O
</s>
<s>
The	O
key	B-Application
pair	O
can	B-Protocol
be	O
stored	O
in	O
more	O
than	O
one	O
node	B-Protocol
corresponding	O
to	O
the	O
key	B-Application
.	O
</s>
<s>
Usually	O
,	O
rather	O
than	O
selecting	O
just	O
one	O
node	B-Protocol
,	O
real	O
world	O
DHT	O
algorithms	O
select	O
suitable	O
nodes	O
,	O
with	O
being	O
an	O
implementation-specific	O
parameter	O
of	O
the	O
DHT	O
.	O
</s>
<s>
In	O
some	O
DHT	O
designs	O
,	O
nodes	O
agree	O
to	O
handle	O
a	O
certain	O
keyspace	B-Application
range	O
,	O
the	O
size	O
of	O
which	O
may	O
be	O
chosen	O
dynamically	O
,	O
rather	O
than	O
hard-coded	O
.	O
</s>
<s>
Some	O
advanced	O
DHTs	O
like	O
Kademlia	B-Operating_System
perform	O
iterative	O
lookups	O
through	O
the	O
DHT	O
first	O
in	O
order	O
to	O
select	O
a	O
set	O
of	O
suitable	O
nodes	O
and	O
send	O
messages	O
only	O
to	O
those	O
nodes	O
,	O
thus	O
drastically	O
reducing	O
useless	O
traffic	O
,	O
since	O
published	O
messages	O
are	O
only	O
sent	O
to	O
nodes	O
that	O
seem	O
suitable	O
for	O
storing	O
the	O
key	B-Application
;	O
and	O
iterative	O
lookups	O
cover	O
just	O
a	O
small	O
set	O
of	O
nodes	O
rather	O
than	O
the	O
entire	O
DHT	O
,	O
reducing	O
useless	O
forwarding	O
.	O
</s>
<s>
In	O
such	O
DHTs	O
,	O
forwarding	O
of	O
messages	O
may	O
only	O
occur	O
as	O
part	O
of	O
a	O
self-healing	O
algorithm	O
:	O
if	O
a	O
target	O
node	B-Protocol
receives	O
a	O
message	O
,	O
but	O
believes	O
that	O
is	O
out	O
of	O
its	O
handled	O
range	O
and	O
a	O
closer	O
node	B-Protocol
(	O
in	O
terms	O
of	O
DHT	O
keyspace	B-Application
)	O
is	O
known	O
,	O
the	O
message	O
is	O
forwarded	O
to	O
that	O
node	B-Protocol
.	O
</s>
<s>
Otherwise	O
,	O
data	B-General_Concept
are	O
indexed	O
locally	O
.	O
</s>
<s>
Of	O
course	O
,	O
such	O
an	O
algorithm	O
requires	O
nodes	O
to	O
publish	O
their	O
presence	O
data	B-General_Concept
in	O
the	O
DHT	O
so	O
the	O
iterative	O
lookups	O
can	B-Protocol
be	O
performed	O
.	O
</s>
<s>
Since	O
on	O
most	O
machines	O
sending	O
messages	O
is	O
much	O
more	O
expensive	O
than	O
local	O
hash	B-Algorithm
table	I-Algorithm
accesses	O
,	O
it	O
makes	O
sense	O
to	O
bundle	O
many	O
messages	O
concerning	O
a	O
particular	O
node	B-Protocol
into	O
a	O
single	O
batch	O
.	O
</s>
<s>
Assuming	O
each	O
node	B-Protocol
has	O
a	O
local	O
batch	O
consisting	O
of	O
at	O
most	O
operations	O
,	O
the	O
bundling	O
procedure	O
is	O
as	O
follows	O
.	O
</s>
<s>
Each	O
node	B-Protocol
first	O
sorts	O
its	O
local	O
batch	O
by	O
the	O
identifier	O
of	O
the	O
node	B-Protocol
responsible	O
for	O
the	O
operation	O
.	O
</s>
<s>
Using	O
bucket	B-Algorithm
sort	I-Algorithm
,	O
this	O
can	B-Protocol
be	O
done	O
in	O
,	O
where	O
is	O
the	O
number	O
of	O
nodes	O
in	O
the	O
DHT	O
.	O
</s>
<s>
When	O
there	O
are	O
multiple	O
operations	O
addressing	O
the	O
same	O
key	B-Application
within	O
one	O
batch	O
,	O
the	O
batch	O
is	O
condensed	O
before	O
being	O
sent	O
out	O
.	O
</s>
<s>
For	O
example	O
,	O
multiple	O
lookups	O
of	O
the	O
same	O
key	B-Application
can	B-Protocol
be	O
reduced	O
to	O
one	O
or	O
multiple	O
increments	O
can	B-Protocol
be	O
reduced	O
to	O
a	O
single	O
add	O
operation	O
.	O
</s>
<s>
This	O
reduction	O
can	B-Protocol
be	O
implemented	O
with	O
the	O
help	O
of	O
a	O
temporary	O
local	O
hash	B-Algorithm
table	I-Algorithm
.	O
</s>
