KadOH Kademlia over HTTP a Javascript framework bringing DHT to - - PowerPoint PPT Presentation

kadoh
SMART_READER_LITE
LIVE PREVIEW

KadOH Kademlia over HTTP a Javascript framework bringing DHT to - - PowerPoint PPT Presentation

Alexandre Lachze Pierre Guilleminot KadOH Kademlia over HTTP a Javascript framework bringing DHT to mobile applications What have been done so far in the DHT landscape ? * * Distributed Hash Table Theoretical resuts Chord Kademlia


slide-1
SLIDE 1

Kademlia over HTTP

a Javascript framework bringing DHT to mobile applications

Alexandre Lachèze Pierre Guilleminot

KadOH

slide-2
SLIDE 2

What have been done so far in the DHT landscape ?

* * Distributed Hash Table

slide-3
SLIDE 3

Theoretical resuts

Chord Kademlia Improvement proposals

slide-4
SLIDE 4

Public large scale implementations

File sharing eMule BitTorrent’s Mainline

slide-5
SLIDE 5

What is missing ?

slide-6
SLIDE 6

Mobiles

Ignored by DHTs Huge and growing audience Private data

slide-7
SLIDE 7

Web Applications

taking advantage of DHTs scalability

slide-8
SLIDE 8

Beyond file sharing...

  • verlay networks

improving privacy protections

slide-9
SLIDE 9

What have we done ?

slide-10
SLIDE 10

A Javascript framework implementing Kademlia in browsers using XMPP over HTTP

a.k.a. KadOH

slide-11
SLIDE 11

Why Javascript ?

  • improved portability vs. native
  • good performance
  • event-driven asynchronous I/O
  • simplified distribution process
  • automated backward compatibility
slide-12
SLIDE 12

Why XMPP ?

slide-13
SLIDE 13

How to establish peer to peer connections ?

slide-14
SLIDE 14

Common problem on obstrusive cellular networks

highly restrictive firewalls technicaly impossible need a for third party router

slide-15
SLIDE 15

Develop our own router ?

Router

slide-16
SLIDE 16

Develop our own routers ?

Router Router

s2s

distributed

slide-17
SLIDE 17

Develop our own routers ?

heavy does not scale against the end-to-end principle

slide-18
SLIDE 18

Unsing the XMPP infrastructures

GTalk

Jabber.com

peer to peer messaging distributed – already scaled

  • pen
slide-19
SLIDE 19

XMPPprotocol

eXtensible Messaging and Presence Protocol

  • pen and standard

based on XML made for instant messaging and extensible

<message from='juliet@jabber.org’ to='romeo@jabber.org' xml:lang='en'> <body>Art thou not Romeo, and a Montague? &lt;3</body> </message>

TCP

slide-20
SLIDE 20

But in the browser ?

bosh bosh

GTalk

Jabber.com

Bidirectional-streams Over Synchronous HTTP XHR long polling XMPP in browser

slide-21
SLIDE 21

Good news : It works !

slide-22
SLIDE 22

How does it work ?

slide-23
SLIDE 23

ValueManagement

Node RoutingTable

Reactor

KBucket

*

1 1 1 1 1 1

Transport

(XMPP, UDP, ..)

1 1 1

RPC

*

1

FindNodeRPC StoreRPC FindValueRPC PingRPC

IterativeFind

1

*

Architecture

modular extensible independant parts highly hackable

slide-24
SLIDE 24

How to use it ?

slide-25
SLIDE 25

node = new KadOH.Node(id, options)

Instantation

slide-26
SLIDE 26

node.connect(function() { node.join(); });

Connection and joining

slide-27
SLIDE 27

node.put('0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', 'Hello world !');

Store

slide-28
SLIDE 28

node.get('62cdb7020ff920e5aa642c3d4066950dd1f01f4d', function(value) { alert(value); });

Retrieve

slide-29
SLIDE 29

That’s it !

...but possibility to access to lower level functions

  • r totally rewrite the logic
slide-30
SLIDE 30

Some extra sugar ?

  • runs in Node.js
  • supports various transports :
  • UDP
  • raw XMPP
  • WebSocket
  • connects to the Mainline DHT
slide-31
SLIDE 31

DEMO Proxy to Mainline

slide-32
SLIDE 32

How to test a DHT from scratch ?

  • instantiate a large number of peers
  • automatic behavior – bots
  • heavy computing capacity

Amazon EC2

slide-33
SLIDE 33

EC2 instance

elastic ip

EC2 instance EC2 instance

bot

fork process

bootstraps

XMPP server

bosh

Bar.com

testing device

slide-34
SLIDE 34

DEMO XMPP & DHT simulation

slide-35
SLIDE 35

Benchmarking

  • sequence of iterative look ups
  • 5 non reaching
  • 5 reaching
  • collected relevant metrics on multiple devices
slide-36
SLIDE 36

Benchmarking

5000 10000 15000 20000 250 500 750 1000 1500 2000 3000 3500

Non resolved Iterative find - time (ms)

5000 10000 15000 20000 250 500 750 1000 1500 2000 3000 3500

Resolved Iterative find - time (ms) chrome firefox iphone-wifi iphone-3g

slide-37
SLIDE 37

Let’s sum up.

slide-38
SLIDE 38

A Javascript framework implementing Kademlia in browsers using XMPP over HTTP

< 5s (even in3G)

slide-39
SLIDE 39

KadOH

https://github.com/jinroh/kadoh http://jinroh.github.com/kadoh/

slide-40
SLIDE 40

And now ?

  • still lots of features to implement
  • focus on new promising technologies