# Understanding kademlia
resources
* [Kademlia Visualization](https://kelseyc18.github.io/kademlia_vis/basics/5/)
* [Kademlia paper](https://pdos.csail.mit.edu/~petar/papers/maymounkov-kademlia-lncs.pdf)
* [Beginner level explanation of Kademlia](https://www.youtube.com/watch?v=Lr9FJRDcNzk&list=PLiYqQVdgdw_sSDkdIZzDRQR9xZlsukIxD&index=1)
* [DHT using consistant hashing](https://www.youtube.com/watch?v=XHRF_7JRqDc)
* [DHT via kademlia](https://www.youtube.com/watch?v=NxhZ_c8YX8E)
**What is a real life use case of Kademlia?**
Kademlia is used by p2p file sharing systems like bitTorrent
**Kademlia is a p2p distributed hash table, what do we mean by this above statement?**
we would like to have a `hash table` that can serve the below two requests
`put(k,v)`
`get(k)`
but the problem is this hash table doesn't fit in a single node/computer, Kademlia solves this problem.
the `key` here is the nodeID which is a 160bit random number assigned to every new node that joins this network
the `value` is the `(IP-Address, UDP-Port)`
> Kademlia helps us achieve a key addressable
network
**What is an Overlay network?**
This is a virtual network that sits on top of physical network.

**What is a routing table? how are they built?**
a routing table is the local table per node that stores enough information such that any two nodes in the Overlay network are capable of communicating with each other if they know each others nodeIDs
Refer the Kademlia paper for the details, things are explained very well there.
**How can a node join a network? what happens during this process?**
**Can you share some git repos where this is being implemented?**
1. [maidsafe/sn_routing](https://github.com/maidsafe/sn_routing)
2. [MaidSafe-wiki](https://github.com/maidsafe-archive/MaidSafe-RUDP/wiki)