a p2p irc network built on top of the kademlia distributed hash table

20
A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

Upload: shannon-french

Post on 12-Jan-2016

217 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

Page 2: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

Overview

History Distributed Hash Tables

IRC

Design

Demo

Page 3: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

Distributed Hash Tables (DHTs)

Operations get(key) put(key, value)

How do you find information in a p2p network?

How do peers locate eachother?

Who’s responsible for what?

Generally decentralized

Fault tolerance is important

Must scale well

Page 4: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

DHTs– What are they good for?

Web caching and CDNs

Distributed file systems

DNS

Instant messaging

P2P file sharing

Page 5: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

History of DHTs - Centralized

Napster

Peers sent local files upon join

Central point of failure

Can only grow as much as central server can

Page 6: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

History of DHTs - Gnutella

Flooding

Avoided central point of failure

O(n) look up

Inefficient Extensive modification by devs made it much more

efficient

Page 7: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

History of DHTs - Chord

Peers and keys share 160-bit key-space (SHA-1)

Logical ring of keys and peers

successor(k) indicates node responsible for a key k

Each node keeps track of nodes ahead of you in the ring O(n) look up

Finger table improves look up speed Peers keep table of m other peers ith entry contains successor((n+2^(i-1)) mod2^m) O(logn) look up

Page 8: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

Kademlia

Peers and keys share 160-bit key-space (SHA-1)

Use XOR to determine distance between peers/keys Symmetric distance measure Satisfies triangle inequality Hashes with long shared prefixes considered close

If local lookup fails, ask peers with IDs closer to key by XOR

O(logn) look up

Page 9: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

Kademlia

Peers keep up to 160 buckets of peers called k-buckets Initially one bucket Buckets split into two once they contain k peers

Peers ping peers in k-buckets and remove stale peers to make room for new peers

How do new peers find out about others? Bootstrap nodes

Page 10: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

Kademlia

KRPC protocol ping(node_id) find_node(node_id)

If node_id isn’t in your local list, find nodes closer to it than you are (if any) and send find_node(node_id) to them.

get(key) Keep track of peers already queried. Stop the query once

the value is found or no nodes closer to the value is found put(key,value)

Similar to get(key)

Page 11: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table

IRC

Internet Relay Chat

Servers host channels

Clients connect to servers, join channels and send eachother messages

RFC 2810,2811,2812,2813

RFC 1459

Page 12: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table
Page 13: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table
Page 14: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table
Page 15: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table
Page 16: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table
Page 17: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table
Page 18: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table
Page 19: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table
Page 20: A P2P IRC Network Built on Top of the Kademlia Distributed Hash Table