SlideShare a Scribd company logo
P2P Resource Discovery for the Browser
HI, I’M DAVID
://daviddias.me
://blog.daviddias.me
://github.com/diasdavid
://twitter.com/daviddias
P2P Resource Discovery for the Browser
P2P Resource Discovery for the Browser
P2P Resource Discovery for the Browser
RESOURCE DISCOVERY
RESOURCE DISCOVERY FOR THE WEB
PLATFORM ON TOP OF A P2P OVERLAY
NETWORK USING WEBRTC AS THE
LAYER OF TRANSPORT
P2P Resource Discovery for the Browser
URL
{
“KEY” : ”VALUE”
}
GET http://recipes.com/francesinha
GET http://recipes.com/latest
GET http://recipes.com/latest
GET http://recipes.com/latest
GET http://recipes.com/latest LB
GET http://recipes.com/latest LB
Centralized
GET http://recipes.com/latest
L
L L
L
P2P Resource Discovery for the Browser
DECENTRALISED
ARCHITECTURES
P2P Resource Discovery for the Browser
P2P networks are only as useful as their Resource
Discovery capabilities remain efficient when they scale up
P2P Overlay Networks primary focus
is not to find a peer, it is to find a resource.
Peers are ephemeral, resources should be
permanent and discoverable.
GNUTELA 0.4
P2P Resource Discovery for the Browser
• march 2000, Justin Frankel and Tom Pepper
• topology is completely random
• routing and search using flooding with TTL
and hop counter
• really slow
• lot’s of signalling traffic
P2P Resource Discovery for the Browser
P2P Resource Discovery for the Browser
P2P Resource Discovery for the Browser
P2P Resource Discovery for the Browser
P2P Resource Discovery for the Browser
GNUTELA 0.6
P2P Resource Discovery for the Browser
UNSTRUCTURED
P2P NETWORKS
Without an implicit way to organize content
STRUCTURED
P2P NETWORKS
CHORD
• DHT
• Highly scalable
• Each node only knows of m number of other nodes
• Each node has a unique identifier
• Each node is responsible for a segment of the data
• Ids are 160 bits (SHA-1 for Uniform Distribution)
• CHORD is awesome
P2P Resource Discovery for the Browser
02160
• 160 bit
namespace
0
1
2
3
4
5
6
7
• 3 bit
namespace
• Id = hash(IP)
0
1
2
3
4
5
6
7
• each node is
responsible for
a segment
0
1
2
3
4
5
6
7
• minimum
requirement -
each node has
to know their
successor
0
1
2
3
4
5
6
7
• each node is
going to have
it’s finger table
start interval sucessor
start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m
interval(k) = start(k) = start(k+1)
sucessor - first node after start(k)
n - ID of the peer
m - number of bits used
k - row number
0
1
2
3
4
5
6
7
start interval sucessor
start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m

interval(k) = [start(k), start(k+1) )

sucessor - first node after start(k)
0
1
2
3
4
5
6
7
start interval sucessor
1
start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m

interval(k) = [start(k), start(k+1) )

sucessor - first node after start(k)
interval(k) = 

[(0+2*1-1) mod 23 ,

(0+2*2-1) mod 23) =

[1,2)
0
1
2
3
4
5
6
7
start interval sucessor
1 [1,2) 1
start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m

interval(k) = [start(k), start(k+1) )

sucessor - first node after start(k)
interval(k) = 

[(0+2*1-1) mod 23 ,

(0+2*2-1) mod 23) =
0
1
2
3
4
5
6
7
start interval sucessor
1 [1,2) 1
2
start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m

interval(k) = [start(k), start(k+1) )

sucessor - first node after start(k)
interval(k) = 

[(0+2*2-1) mod 23 ,

(0+2*3-1) mod 23)
0
1
2
3
4
5
6
7
start interval sucessor
1 [1,2) 1
2 [2,4) 3
start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m

interval(k) = [start(k), start(k+1) )

sucessor - first node after start(k)
interval(k) = 

[(0+2*2-1) mod 23 ,

(0+2*3-1) mod 23)
0
1
2
3
4
5
6
7
start interval sucessor
1 [1,2) 1
2 [2,4) 3
4
start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m

interval(k) = [start(k), start(k+1) )

sucessor - first node after start(k)
interval(k) = 

[(0+2*3-1) mod 23 ,

(0+2*4-1) mod 23)
0
1
2
3
4
5
6
7
start interval sucessor
1 [1,2) 1
2 [2,4) 3
4 [4,0) 6
start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m

interval(k) = [start(k), start(k+1) )

sucessor - first node after start(k)
P2P Resource Discovery for the Browser
WEBRTC-EXPLORER
• Chord inspired P2P overlay network
designed for the Web Platform
• Uses CHORD routing scheme
• Uses WebRTC for transport
• WebSockets for Signalling
• Peers (browsers) route messages amongst
them
• 48 bits Ids
• Brings a full DHT to the browser
WEBRTC-EXPLORER
WEBRTC-RING
http://blog.daviddias.me/
2014/12/20/webrtc-ring
HOW DOES IT WORK
var Explorer = require(‘webrtc-explorer’);
var config = {
signalingURL: '<url>'
};
var peer = new Explorer(config);
peer.events.on(‘registered', function(data) {
console.log('Id:', data.peerId);
});
peer.events.on('ready', function() {
console.log('ready to send messages');
});
peer.events.on('message', function(envelope) {
console.log(envelope);
});
peer.register();
//peer.send(‘<dst_id>’, <data_to_send>);
s-register
c-registered
{ id: “<this_peer_id>” }
c-finger-update

c-finger-update

c-finger-update
s-send-offer
c-offer-accepted
1
4
s-accept-offer
s-offer-accepted
2
3
5
RTCPeerConnection
DEMO
PAPERS• Afify, Y. (2008). Access Control in a Peer-to-peer Social Network. Ph. D. thesis, ECOLE POLYTECHNIQUE FEDERALE DE
LAUSANNE.
• Anderson, B. D. P., J. Cobb, E. Korpela, & M. Lebofsky (2002). SETI@Home, an Ex- perimentinPublic-ResourceComputing.
45(11).
• Anderson, D. (2004). Boinc: A system for public-resource computing and storage. In
• Grid Computing, 2004. Proceedings.
• Armbrust, M., I. Stoica, M. Zaharia, A. Fox, R. Griffith, A. D. Joseph, R. Katz, A. Kon- winski, G. Lee, D. Patterson, & A.
Rabkin (2010, April). A view of cloud computing. Communications of the ACM 53(4), 50.
• Bakhtiari, S. & J. Pieprzyk (1995). Cryptographic hash functions: A survey.” Centre for Computer Security Research,
Department of Computer Science. pp. 1–26.
• Barabási,a.L.,V.W.Freeh,H.Jeong,&J.B.Brockman(2001,August). Parasitic computing. Nature 412(6850), 894–7.
• Barraca, J. a. P., A. Matos, & R. L. Aguiar (2011, April). User Centric Community Clouds. Wireless Personal Communications
58(1), 31–48.
• Bharambe, A. R., M. Agrawal, & S. Seshan. Mercury : Supporting Scalable Multi- Attribute Range Queries. pp. 353–366.
• Byers, J., J. Considine, & M. Mitzenmacher (2003). Simple Load Balancing for Dis- tributed Hash Tables. In M. Frans Kaashoek
; Ion Stoica (Ed.), Peer-to-Peer Systems II, pp. 80–88. Springer Berlin Heidelberg.
• Clarke, I., O. Sandberg, B. Wiley, & T. Hong (2001). Freenet: A distributed anony- mous information storage and retrieval
system. In H. Federrath (Ed.), Designing Privacy, pp. 46–66. Springer Berlin Heidelberg.
PAPERS• Cohen, B. (2009). The BitTorrent Protocol Specification.
• Costa, F., J. Silva, L. Veiga, & P. Ferreira (2012). Large-scale volunteer computing over
• the Internet. Internet Services and Applications, 1–18.

D. Eastlake, 3rd Motorola; P. Jones Systems, C. (2001). RFC 3174 US Secure Hash
• Decandia, G., D. Hastorun, M. Jampani, G. Kakulapati, A. Lakshman, A. Pilchin, S. Sivasubramanian, P. Vosshall, & W. Vogels (2007).
Dynamo : Amazon’s Highly Avail- able Key-value Store. pp. 205–220.
• Definition, P. (2003). The Gnutella Protocol Specification v0 . 4. Solutions, 1–8. Desmedt, Y. & Y. Frankel (1990). Threshold
cryptosystems. Advances in Cryptol-
• ogy—CRYPTO’89 . . . .

Douceur, J. R. (2002). The Sybil Attack. In P. D. Druschel@cs.rice.edu & A. R.
• Antr@microsoft.com (Eds.), Peer-to-Peer Systems, pp. 251–260. Springer Berlin Heidelberg. Duda, J. & W. Dłubacz (2013).
Distributed evolutionary computing system based on
• web browsers with javascript. Applied Parallel and Scientific Computing.
• Ecma, S. (2009). ECMA-262 ECMAScript Language Specification.
• Filipe, P. & G. Oliveira (2011). Gridlet Economics : Resource Management Models and Policies for Cycle-Sharing Systems.
• Golle, P., K. Leyton-brown, I. Mironov, & M. Lillibridge (2001). Incentives for Sharing in Peer-to-Peer Networks. pp. 75–87.
• Handley, M. & R. Karp (2001). A Scalable Content-Addressable Network. In SIG- COMM ’01 Proceedings of the 2001 conference on
Applications, technologies, architectures, and protocols for computer communications, Volume 21, pp. 161–172.
• Karger, D., T. Leightonl, D. Lewinl, E. Lehman, & R. Panigrahy (1997). Consistent Hashing and Random Trees : Distributed Caching
Protocols for Relieving Hot Spots on the World Wide Web *. In STOC ’97 Proceedings of the twenty-ninth annual ACM symposium on
Theory of computing, pp. 654–663.
PAPERS• Karger, D. R. & M. Ruhl (2004). Simple efficient load balancing algorithms for peer-to- peer systems. Proceedings of the sixteenth
annual ACM symposium on Parallelism in algorithms and architectures - SPAA ’04, 36.
• Koloniari, G. & E. Pitoura (2005). Peer-to-Peer Management of XML Data : Issues andResearchChallenges. 34(2),6–17.
• Korpela, E. & D. Werthimer (2001). SETI@Home, Massively Distributed Computing for SETI. Computing in Science &
Engineering, 78–83.
• Larson, S., C. Snow, & M. Shirts (2002). Folding@ Home and Genome@ Home: Using distributed computing to tackle previously
intractable problems in computational biol- ogy.
• Marti, S. & H. Garcia-molina (2006, March). Taxonomy of Trust : Categorizing P2P Reputation Systems. Computer Networks
(April 2005), 472–484.
• Maymounkov, P. & D. Mazie`res. Kademlia: A Peer-to-peer Information System Based on the XOR Metric.
• Merelo,J.-j.,A.Mora-garćıa,J.Lupión,&F.Tricas(2007).Browser-basedDistributed Evolutionary Computation : Performance and
Scaling Behavior Categories and Subject Descriptors. pp. 2851–2858.
• Milojicic, D. S., V. Kalogeraki, R. Lukose, K. Nagaraja, J. Pruyne, B. Richard, S. Rollins, Z. Xu, & J. I. M. Pruyne (2003). Peer-to-
Peer Computing. Technical report.
• Navarro, L. (2012). Experimental research on community networks. Technical report.
• Nurmi, D., R. Wolski, C. Grzegorczyk, G. Obertelli, S. Soman, L. Youseff, & D. Zagorodnov (2009). The Eucalyptus Open-Source
Cloud-Computing System. 2009 9th IEEE/ACM International Symposium on Cluster Computing and the Grid, 124–131.
• Paulson, L. (2005, October). Building rich web applications with Ajax. Com- puter 38(10), 14–17.
• Preneel, B. (1999). The State of Cryptographic Hash Functions. pp. 158–182.
• Ranjan, R., A. Harwood, & R. Buyya (2006). A study on peer-to-peer based discovery of grid resource information. Australia,
Technical Report GRIDS, 1–36.
PAPERS• Rao, A., K. Lakshminarayanan, S. Surana, & R. Karp (2003). Load Balancing in Structured P2PSystems. 0225660,68–79.
• Rieche, S., L. Petrak, & K. Wehrle. A thermal-dissipation-based approach for balanc- ing data load in distributed hash tables. 29th
Annual IEEE International Conference on Local Computer Networks, 15–23.
• Ripeanu, M. (2002). Peer-to-peer architecture case study: Gnutella network. Proceed- ings First International Conference on Peer-
to-Peer Computing, 99–100.
• Rodrigues, R. & P. Ferreira. GiGi : An Ocean of Gridlets on a “ Grid-for-the-Masses ”.
• Rowstron, A. & P. Druschel (2001a). PAST A large-scale , persistent peer-to-peer storage utility. Proceedings of the eighteenth
ACM symposium on Operating systems principles - SOSP ’01, 75–80.
• Rowstron, A. & P. Druschel (2001b). Pastry : Scalable , Decentralized Object Location , and Routing for Large-Scale Peer-to-Peer
Systems. pp. 329–350.
• Ruellan, H. & R. Peon (2013). HPACK-Header Compression for HTTP/2.0. draft-ietf- httpbis-header-compression-04 (work in
progress) (c), 1–57.
• Silva, J. a. N., L. Veiga, & P. Ferreira (2008, October). nuBOINC: BOINC Extensions for Community Cycle Sharing. In 2008
Second IEEE International Conference on Self-Adaptive and Self-Organizing Systems Workshops, pp. 248–253. IEEE.
• Silva, J. a. N., L. Veiga, & P. Ferreira (2011, August). A2HA—automatic and adap- tive host allocation in utility computing for bag-
of-tasks. Journal of Internet Services and Applications 2(2), 171–185.
• Stoica,I.,R.Morris,D.Karger,M.F.Kaashoek,H.B.Ý,&H.Balakrishnan(2001). Chord : A Scalable Peer-to-peer Lookup Service for
Internet. pp. 149–160.
• T. Klingberg, R. M. (2002). RFC - Gnutella 0.6 Protocol Specification.
• Thomson, M. & A. Melnikov (2013). Hypertext Transfer Protocol version 2.0 draft- ietf-httpbis-http2-09.
PAPERS
• Tilkov, S. & S. V. Verivue (2010). Node.js : Using JavaScript to Build High- Performance Network Programs.
• Vishnumurthy, V., S. Chandrakumar, & G. Emin (2003). Karma: A secure economic framework for peer-to-peer resource sharing.
• Vogt, C., M. Werner, & T. Schmidt (2013). Leveraging WebRTC for P2P Content Distribution in Web Browsers. 21st IEEE
Internanicoal Conference.
• Wallach, D. S. (2003). A Survey of Peer-to-Peer Security Issues. In M. O. Mitsu@abelard.flet.keio.ac.jp (Ed.), Software Security
— Theories and Systems, pp. 42–57.
• Zakai, A. (2011). Emscripten: an llvm-to-javascript compiler. In Proceedings of the ACM international conference companion on
Object oriented programming systems languages and applications companion. ACM.
• Zhao, B. Y., J. Kubiatowicz, & A. D. Joseph (2001). Tapestry : An Infrastructure for Fault-tolerant Wide-area Location and
Routing. Technical Report April, University of California, Berkeley,.
THANK YOU!
:D

More Related Content

Similar to P2P Resource Discovery for the Browser (20)

PPTX
02 - Topologies of Distributed Systems
Dilum Bandara
 
PPT
Introduction P2p
Davide Carboni
 
PDF
Resource Discovery for the Web Platform using a P2P Overlay Network with WebR...
David Dias
 
PPT
Peer-to-peer Systems.ppt
Ashok Chandrasekaran
 
PPT
An overview of Peer-to-Peer technology new
chizhangufl
 
PDF
F233842
irjes
 
PPT
Vitus Masters Defense
derDoc
 
PPTX
UNIT III DIS.pptx
Premkumar R
 
PDF
SECURITY CONSIDERATION IN PEER-TO-PEER NETWORKS WITH A CASE STUDY APPLICATION
IJNSA Journal
 
PDF
Flexible Bloom for Searching Textual Content Based Retrieval System in an Uns...
Uvaraj Shan
 
PDF
Flexible bloom for searching textual content
Uvaraj Shan
 
PDF
Flexible bloom for searching textual content
Uvaraj Shan
 
PDF
Top 10 reseach articles for academia - International Journal of peer-to-peer ...
ijp2p
 
PDF
Module: Mutable Content in IPFS
Ioannis Psaras
 
PDF
P2P File Sharing Web App
IRJET Journal
 
PPTX
INC 2004: An Efficient Mechanism for Adaptive Resource Discovery in Grids
James Salter
 
PDF
The International Journal of Engineering and Science (IJES)
theijes
 
PPTX
Peer to peer Paradigms
hassan ahmed
 
PPTX
20120412 searching techniques in peer to peer networks
Zia Ush Shamszaman
 
PPTX
Peer-to-Peer Networking Systems and Streaming
Dilum Bandara
 
02 - Topologies of Distributed Systems
Dilum Bandara
 
Introduction P2p
Davide Carboni
 
Resource Discovery for the Web Platform using a P2P Overlay Network with WebR...
David Dias
 
Peer-to-peer Systems.ppt
Ashok Chandrasekaran
 
An overview of Peer-to-Peer technology new
chizhangufl
 
F233842
irjes
 
Vitus Masters Defense
derDoc
 
UNIT III DIS.pptx
Premkumar R
 
SECURITY CONSIDERATION IN PEER-TO-PEER NETWORKS WITH A CASE STUDY APPLICATION
IJNSA Journal
 
Flexible Bloom for Searching Textual Content Based Retrieval System in an Uns...
Uvaraj Shan
 
Flexible bloom for searching textual content
Uvaraj Shan
 
Flexible bloom for searching textual content
Uvaraj Shan
 
Top 10 reseach articles for academia - International Journal of peer-to-peer ...
ijp2p
 
Module: Mutable Content in IPFS
Ioannis Psaras
 
P2P File Sharing Web App
IRJET Journal
 
INC 2004: An Efficient Mechanism for Adaptive Resource Discovery in Grids
James Salter
 
The International Journal of Engineering and Science (IJES)
theijes
 
Peer to peer Paradigms
hassan ahmed
 
20120412 searching techniques in peer to peer networks
Zia Ush Shamszaman
 
Peer-to-Peer Networking Systems and Streaming
Dilum Bandara
 

More from David Dias (9)

PDF
Enter Gossipsub, A scalable, extensible & hardened P2P PubSub Router protocol
David Dias
 
PDF
browserCloud.js - David Dias M.Sc Thesis Defense Deck
David Dias
 
PDF
IPWB and IPFS at WAC2017
David Dias
 
PDF
RDM#2- The Distributed Web
David Dias
 
PDF
Node.js Interactive
David Dias
 
PDF
Understanding The Community Lifecycle
David Dias
 
PDF
Lisboa WebRTC - May 21, 2015 - Intro to WebRTC
David Dias
 
PDF
TriConf 2014 - LXJS, the Lisbon Javascript Conference
David Dias
 
PDF
JSConfBR - Securing Node.js App, by the community and for the community
David Dias
 
Enter Gossipsub, A scalable, extensible & hardened P2P PubSub Router protocol
David Dias
 
browserCloud.js - David Dias M.Sc Thesis Defense Deck
David Dias
 
IPWB and IPFS at WAC2017
David Dias
 
RDM#2- The Distributed Web
David Dias
 
Node.js Interactive
David Dias
 
Understanding The Community Lifecycle
David Dias
 
Lisboa WebRTC - May 21, 2015 - Intro to WebRTC
David Dias
 
TriConf 2014 - LXJS, the Lisbon Javascript Conference
David Dias
 
JSConfBR - Securing Node.js App, by the community and for the community
David Dias
 
Ad

Recently uploaded (20)

PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
Complete Network Protection with Real-Time Security
L4RGINDIA
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
July Patch Tuesday
Ivanti
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
Complete Network Protection with Real-Time Security
L4RGINDIA
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Ad

P2P Resource Discovery for the Browser

  • 7. RESOURCE DISCOVERY FOR THE WEB PLATFORM ON TOP OF A P2P OVERLAY NETWORK USING WEBRTC AS THE LAYER OF TRANSPORT
  • 9. URL
  • 21. P2P networks are only as useful as their Resource Discovery capabilities remain efficient when they scale up
  • 22. P2P Overlay Networks primary focus is not to find a peer, it is to find a resource. Peers are ephemeral, resources should be permanent and discoverable.
  • 25. • march 2000, Justin Frankel and Tom Pepper • topology is completely random • routing and search using flooding with TTL and hop counter • really slow • lot’s of signalling traffic
  • 33. UNSTRUCTURED P2P NETWORKS Without an implicit way to organize content
  • 35. CHORD
  • 36. • DHT • Highly scalable • Each node only knows of m number of other nodes • Each node has a unique identifier • Each node is responsible for a segment of the data • Ids are 160 bits (SHA-1 for Uniform Distribution) • CHORD is awesome
  • 40. 0 1 2 3 4 5 6 7 • each node is responsible for a segment
  • 41. 0 1 2 3 4 5 6 7 • minimum requirement - each node has to know their successor
  • 42. 0 1 2 3 4 5 6 7 • each node is going to have it’s finger table
  • 43. start interval sucessor start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m interval(k) = start(k) = start(k+1) sucessor - first node after start(k) n - ID of the peer m - number of bits used k - row number
  • 44. 0 1 2 3 4 5 6 7 start interval sucessor start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m interval(k) = [start(k), start(k+1) ) sucessor - first node after start(k)
  • 45. 0 1 2 3 4 5 6 7 start interval sucessor 1 start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m interval(k) = [start(k), start(k+1) ) sucessor - first node after start(k) interval(k) = [(0+2*1-1) mod 23 , (0+2*2-1) mod 23) = [1,2)
  • 46. 0 1 2 3 4 5 6 7 start interval sucessor 1 [1,2) 1 start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m interval(k) = [start(k), start(k+1) ) sucessor - first node after start(k) interval(k) = [(0+2*1-1) mod 23 , (0+2*2-1) mod 23) =
  • 47. 0 1 2 3 4 5 6 7 start interval sucessor 1 [1,2) 1 2 start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m interval(k) = [start(k), start(k+1) ) sucessor - first node after start(k) interval(k) = [(0+2*2-1) mod 23 , (0+2*3-1) mod 23)
  • 48. 0 1 2 3 4 5 6 7 start interval sucessor 1 [1,2) 1 2 [2,4) 3 start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m interval(k) = [start(k), start(k+1) ) sucessor - first node after start(k) interval(k) = [(0+2*2-1) mod 23 , (0+2*3-1) mod 23)
  • 49. 0 1 2 3 4 5 6 7 start interval sucessor 1 [1,2) 1 2 [2,4) 3 4 start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m interval(k) = [start(k), start(k+1) ) sucessor - first node after start(k) interval(k) = [(0+2*3-1) mod 23 , (0+2*4-1) mod 23)
  • 50. 0 1 2 3 4 5 6 7 start interval sucessor 1 [1,2) 1 2 [2,4) 3 4 [4,0) 6 start(k) = (n+2k-1) mod 2m, 1 ≤ k ≤ m interval(k) = [start(k), start(k+1) ) sucessor - first node after start(k)
  • 53. • Chord inspired P2P overlay network designed for the Web Platform • Uses CHORD routing scheme • Uses WebRTC for transport • WebSockets for Signalling • Peers (browsers) route messages amongst them • 48 bits Ids • Brings a full DHT to the browser WEBRTC-EXPLORER
  • 55. HOW DOES IT WORK
  • 56. var Explorer = require(‘webrtc-explorer’); var config = { signalingURL: '<url>' }; var peer = new Explorer(config); peer.events.on(‘registered', function(data) { console.log('Id:', data.peerId); }); peer.events.on('ready', function() { console.log('ready to send messages'); }); peer.events.on('message', function(envelope) { console.log(envelope); }); peer.register(); //peer.send(‘<dst_id>’, <data_to_send>); s-register c-registered { id: “<this_peer_id>” }
  • 59. DEMO
  • 60. PAPERS• Afify, Y. (2008). Access Control in a Peer-to-peer Social Network. Ph. D. thesis, ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE. • Anderson, B. D. P., J. Cobb, E. Korpela, & M. Lebofsky (2002). SETI@Home, an Ex- perimentinPublic-ResourceComputing. 45(11). • Anderson, D. (2004). Boinc: A system for public-resource computing and storage. In • Grid Computing, 2004. Proceedings. • Armbrust, M., I. Stoica, M. Zaharia, A. Fox, R. Griffith, A. D. Joseph, R. Katz, A. Kon- winski, G. Lee, D. Patterson, & A. Rabkin (2010, April). A view of cloud computing. Communications of the ACM 53(4), 50. • Bakhtiari, S. & J. Pieprzyk (1995). Cryptographic hash functions: A survey.” Centre for Computer Security Research, Department of Computer Science. pp. 1–26. • Barabási,a.L.,V.W.Freeh,H.Jeong,&J.B.Brockman(2001,August). Parasitic computing. Nature 412(6850), 894–7. • Barraca, J. a. P., A. Matos, & R. L. Aguiar (2011, April). User Centric Community Clouds. Wireless Personal Communications 58(1), 31–48. • Bharambe, A. R., M. Agrawal, & S. Seshan. Mercury : Supporting Scalable Multi- Attribute Range Queries. pp. 353–366. • Byers, J., J. Considine, & M. Mitzenmacher (2003). Simple Load Balancing for Dis- tributed Hash Tables. In M. Frans Kaashoek ; Ion Stoica (Ed.), Peer-to-Peer Systems II, pp. 80–88. Springer Berlin Heidelberg. • Clarke, I., O. Sandberg, B. Wiley, & T. Hong (2001). Freenet: A distributed anony- mous information storage and retrieval system. In H. Federrath (Ed.), Designing Privacy, pp. 46–66. Springer Berlin Heidelberg.
  • 61. PAPERS• Cohen, B. (2009). The BitTorrent Protocol Specification. • Costa, F., J. Silva, L. Veiga, & P. Ferreira (2012). Large-scale volunteer computing over • the Internet. Internet Services and Applications, 1–18.
 D. Eastlake, 3rd Motorola; P. Jones Systems, C. (2001). RFC 3174 US Secure Hash • Decandia, G., D. Hastorun, M. Jampani, G. Kakulapati, A. Lakshman, A. Pilchin, S. Sivasubramanian, P. Vosshall, & W. Vogels (2007). Dynamo : Amazon’s Highly Avail- able Key-value Store. pp. 205–220. • Definition, P. (2003). The Gnutella Protocol Specification v0 . 4. Solutions, 1–8. Desmedt, Y. & Y. Frankel (1990). Threshold cryptosystems. Advances in Cryptol- • ogy—CRYPTO’89 . . . .
 Douceur, J. R. (2002). The Sybil Attack. In P. D. [email protected] & A. R. • [email protected] (Eds.), Peer-to-Peer Systems, pp. 251–260. Springer Berlin Heidelberg. Duda, J. & W. Dłubacz (2013). Distributed evolutionary computing system based on • web browsers with javascript. Applied Parallel and Scientific Computing. • Ecma, S. (2009). ECMA-262 ECMAScript Language Specification. • Filipe, P. & G. Oliveira (2011). Gridlet Economics : Resource Management Models and Policies for Cycle-Sharing Systems. • Golle, P., K. Leyton-brown, I. Mironov, & M. Lillibridge (2001). Incentives for Sharing in Peer-to-Peer Networks. pp. 75–87. • Handley, M. & R. Karp (2001). A Scalable Content-Addressable Network. In SIG- COMM ’01 Proceedings of the 2001 conference on Applications, technologies, architectures, and protocols for computer communications, Volume 21, pp. 161–172. • Karger, D., T. Leightonl, D. Lewinl, E. Lehman, & R. Panigrahy (1997). Consistent Hashing and Random Trees : Distributed Caching Protocols for Relieving Hot Spots on the World Wide Web *. In STOC ’97 Proceedings of the twenty-ninth annual ACM symposium on Theory of computing, pp. 654–663.
  • 62. PAPERS• Karger, D. R. & M. Ruhl (2004). Simple efficient load balancing algorithms for peer-to- peer systems. Proceedings of the sixteenth annual ACM symposium on Parallelism in algorithms and architectures - SPAA ’04, 36. • Koloniari, G. & E. Pitoura (2005). Peer-to-Peer Management of XML Data : Issues andResearchChallenges. 34(2),6–17. • Korpela, E. & D. Werthimer (2001). SETI@Home, Massively Distributed Computing for SETI. Computing in Science & Engineering, 78–83. • Larson, S., C. Snow, & M. Shirts (2002). Folding@ Home and Genome@ Home: Using distributed computing to tackle previously intractable problems in computational biol- ogy. • Marti, S. & H. Garcia-molina (2006, March). Taxonomy of Trust : Categorizing P2P Reputation Systems. Computer Networks (April 2005), 472–484. • Maymounkov, P. & D. Mazie`res. Kademlia: A Peer-to-peer Information System Based on the XOR Metric. • Merelo,J.-j.,A.Mora-garćıa,J.Lupión,&F.Tricas(2007).Browser-basedDistributed Evolutionary Computation : Performance and Scaling Behavior Categories and Subject Descriptors. pp. 2851–2858. • Milojicic, D. S., V. Kalogeraki, R. Lukose, K. Nagaraja, J. Pruyne, B. Richard, S. Rollins, Z. Xu, & J. I. M. Pruyne (2003). Peer-to- Peer Computing. Technical report. • Navarro, L. (2012). Experimental research on community networks. Technical report. • Nurmi, D., R. Wolski, C. Grzegorczyk, G. Obertelli, S. Soman, L. Youseff, & D. Zagorodnov (2009). The Eucalyptus Open-Source Cloud-Computing System. 2009 9th IEEE/ACM International Symposium on Cluster Computing and the Grid, 124–131. • Paulson, L. (2005, October). Building rich web applications with Ajax. Com- puter 38(10), 14–17. • Preneel, B. (1999). The State of Cryptographic Hash Functions. pp. 158–182. • Ranjan, R., A. Harwood, & R. Buyya (2006). A study on peer-to-peer based discovery of grid resource information. Australia, Technical Report GRIDS, 1–36.
  • 63. PAPERS• Rao, A., K. Lakshminarayanan, S. Surana, & R. Karp (2003). Load Balancing in Structured P2PSystems. 0225660,68–79. • Rieche, S., L. Petrak, & K. Wehrle. A thermal-dissipation-based approach for balanc- ing data load in distributed hash tables. 29th Annual IEEE International Conference on Local Computer Networks, 15–23. • Ripeanu, M. (2002). Peer-to-peer architecture case study: Gnutella network. Proceed- ings First International Conference on Peer- to-Peer Computing, 99–100. • Rodrigues, R. & P. Ferreira. GiGi : An Ocean of Gridlets on a “ Grid-for-the-Masses ”. • Rowstron, A. & P. Druschel (2001a). PAST A large-scale , persistent peer-to-peer storage utility. Proceedings of the eighteenth ACM symposium on Operating systems principles - SOSP ’01, 75–80. • Rowstron, A. & P. Druschel (2001b). Pastry : Scalable , Decentralized Object Location , and Routing for Large-Scale Peer-to-Peer Systems. pp. 329–350. • Ruellan, H. & R. Peon (2013). HPACK-Header Compression for HTTP/2.0. draft-ietf- httpbis-header-compression-04 (work in progress) (c), 1–57. • Silva, J. a. N., L. Veiga, & P. Ferreira (2008, October). nuBOINC: BOINC Extensions for Community Cycle Sharing. In 2008 Second IEEE International Conference on Self-Adaptive and Self-Organizing Systems Workshops, pp. 248–253. IEEE. • Silva, J. a. N., L. Veiga, & P. Ferreira (2011, August). A2HA—automatic and adap- tive host allocation in utility computing for bag- of-tasks. Journal of Internet Services and Applications 2(2), 171–185. • Stoica,I.,R.Morris,D.Karger,M.F.Kaashoek,H.B.Ý,&H.Balakrishnan(2001). Chord : A Scalable Peer-to-peer Lookup Service for Internet. pp. 149–160. • T. Klingberg, R. M. (2002). RFC - Gnutella 0.6 Protocol Specification. • Thomson, M. & A. Melnikov (2013). Hypertext Transfer Protocol version 2.0 draft- ietf-httpbis-http2-09.
  • 64. PAPERS • Tilkov, S. & S. V. Verivue (2010). Node.js : Using JavaScript to Build High- Performance Network Programs. • Vishnumurthy, V., S. Chandrakumar, & G. Emin (2003). Karma: A secure economic framework for peer-to-peer resource sharing. • Vogt, C., M. Werner, & T. Schmidt (2013). Leveraging WebRTC for P2P Content Distribution in Web Browsers. 21st IEEE Internanicoal Conference. • Wallach, D. S. (2003). A Survey of Peer-to-Peer Security Issues. In M. O. Mitsu@abelard.flet.keio.ac.jp (Ed.), Software Security — Theories and Systems, pp. 42–57. • Zakai, A. (2011). Emscripten: an llvm-to-javascript compiler. In Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion. ACM. • Zhao, B. Y., J. Kubiatowicz, & A. D. Joseph (2001). Tapestry : An Infrastructure for Fault-tolerant Wide-area Location and Routing. Technical Report April, University of California, Berkeley,.