• Aucun résultat trouvé

WebGC Gossiping on Browsers without a Server [Live Demo/Poster]

N/A
N/A
Protected

Academic year: 2021

Partager "WebGC Gossiping on Browsers without a Server [Live Demo/Poster]"

Copied!
7
0
0

Texte intégral

(1)

HAL Id: hal-01251787

https://hal.inria.fr/hal-01251787

Submitted on 6 Jan 2016

HAL is a multi-disciplinary open access

archive for the deposit and dissemination of

sci-entific research documents, whether they are

pub-lished or not. The documents may come from

teaching and research institutions in France or

abroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire HAL, est

destinée au dépôt et à la diffusion de documents

scientifiques de niveau recherche, publiés ou non,

émanant des établissements d’enseignement et de

recherche français ou étrangers, des laboratoires

publics ou privés.

WebGC Gossiping on Browsers without a Server [Live

Demo/Poster]

Raziel Carvajal-Gómez, Davide Frey, Matthieu Simonin, Anne-Marie

Kermarrec

To cite this version:

Raziel Carvajal-Gómez, Davide Frey, Matthieu Simonin, Anne-Marie Kermarrec. WebGC Gossiping

on Browsers without a Server [Live Demo/Poster]. Web Information System Engineering, Nov 2015,

MIAMI, United States. Web Information System Engineering. �hal-01251787�

(2)

[Live Demo/Poster]

Raziel Carvajal-G´omez, Davide Frey,

Matthieu Simonin and Anne-Marie Kermarrec name.surname@inria.fr

INRIA Rennes, France

Abstract. 1Decentralized social networks have attracted the attention

of a large number of researchers with their promises of scalability, pri-vacy, and ease of adoption. Yet, current implementations require users to install specific software to handle the protocols they rely on. The WebRTC framework holds the promise of removing this requirement by making it possible to run peer-to-peer applications directly within web browsers without the need of any external software or plugins. In this demo, we present WebGC, a WebRTC-based library that supports gossip-based communication between web browsers and enables them to operate with Node-JS applications. Due to their inherent scalability, gossip-based protocols constitute a key component of a large number of decentralized applications including social networks. We therefore hope that WebGC can represent a useful tool for developers and researchers.

1

Introduction

A number of authors have proposed the use of gossip-based protocols for the implementation of decentralized social networks [13, 9, 14], these protocols form an unstructured distributed system to disseminate information in a periodic way, they are easy to deploy and resilient to failures. Yet, like for other peer-to-peer (P2P) solutions, their implementations have always required users to install specific software to support decentralized protocols to enable users to access the social network from their web browsers. This constitutes a major show stopper for the adoption of decentralized social-network solutions.

In this demo, we present WebGC, a library for gossip-based communication between web browsers. Based on the WebRTC framework, WebGC has the po-tential to improve the applicability of decentralized user-centric applications like social networks by enabling them to run directly within web browsers. WebGC is a Javascript library to provide a simplified framework for building gossip-based applications. This includes the implementations of standard components such

1 A previous version of this demo appeared in [8]. Since then, we have integrated the

library with a new decentralized signaling service and introduced support for web workers.

(3)

2

as random-peer-sampling [11] and clustering [19] protocols. Moreover, it aug-ments the WebRTC connection-initiation protocol by means of a decentralized signaling mechanism.

WebRTC’s primary goal consists in enabling direct communication between two browsers for media and real-time communication. For this reason, WebRTC relies on a signaling server that makes it possible to establish a connection be-tween two browsers that do not know each other. While this feature is very convenient for applications that need to establish a small number of connec-tions, the signaling server quickly becomes a bottleneck in the context of P2P applications. WebGC’s decentralized signaling service establishes connections by exploiting the very operation of peer-sampling protocols.

The demo will present a running example of a WebGC-enabled application: a semantic overlay grouping users by interests. Attendees will be able to join the application using their own laptops and follow its evolution in real time on a web page.

2

WebGC Architecture

WebGC is a Javascript library and relies on two underlying frameworks: We-bRTC, and SimplePeer. The former is directly provided by compatible web browsers and implements the low-level interaction primitives that make it pos-sible to establish communication between browsers. The latter also takes the form of a Javascript library and provides a wrapper around WebRTC that sim-plifies the establishment of data connections between peers. The left diagram in Figure 1 places WebGC in the context of these two libraries.

The figure also shows that WebGC comprises a decentralized signaling service that replaces the centralized signaling server used in WebRTC applications. This makes it possible to eliminate bottlenecks when operating in environments that do not involve NAT and firewalls. When these are present, WebGC relies on ICE, STUN, and TURN like standard WebRTC applications. However, we are currently considering augmenting the library with NAT traversal solutions such as Nylon [12] or Croupier [10]. In the following, we describe the gossip-based framework provided by our library and detail its decentralized signaling service. WebGC Internals. The right diagram in Figure 1 depicts WebGC’s architecture. Its core consists of a Coordinator object that instantiates the gossip proto-cols and acts as a communication broker dispatching incoming messages to the various protocols. The library currently includes the implementation of two peer sampling protocols, Cyclon [18] and the generic protocol suite from [11], as well as a clustering protocol [19, 7]. All protocols implement a GossipProto-col “interface”—since Javascript does not natively support interfaces, we adopt the interface pattern described in [15]. The Coordinator makes it possible to stack these protocols on top of each other [7] to implement applications.

The GossipProtocol interface follows the scheme proposed in the litera-ture [17, 16, 11] and defines the high-level operations that constitute a gossip-protocol. Developers can use the protocols provided by the library, but they

(4)

Fig. 1. General architecture

can also implement the operations in GossipProtocol to define new proto-cols. Finally, the latest version of WebGC also includes support for web workers. This makes it possible to run complex CPU-intensive tasks without blocking the browser’s user interface.

Decentralized Signaling. A Signaling Service acts a mediator between two peers,

say P1 and P2, by assisting them during the establishment of a mutual

con-nection. Let us assume P1 wants to initiate a connection to P2. WebRTC does

not allow nodes to contact each other using their IP addresses. So P1 sends its

connection request to P2via the signaling service. P2responds by sending a

re-ply also through the signaling service, and finally P1initiates a direct link with

P2 thanks to the data (IP address, communication protocol, etc.) contained in

the request and reply messages. WebRTC does not require a specific signaling server but most existing solutions rely on a centralized architecture. However, a centralized signaling server would easily become a bottleneck in a peer-to-peer setting, particularly when using gossip-based protocols, which frequently need to establish new connections.

While other decentralized signaling libraries exist [1], WebGC integrates sig-naling within the operation of peer-sampling and clustering protocols. In both these types of protocols, which we refer to as overlay protocols, nodes main-tain data structures called views that conmain-tain references to other nodes, and periodically exchange messages that contain subsets of their views.

Our decentralized signaling solution maintains an additional routing table that contains an entry for each of the node references that appear in any of the views of running overlay protocols. Each such entry contains the node reference of a mediator node, i.e. a node that has an active connection with the node in the entry. When a node needs to establish a connection to another node in its table, it simply contacts the node’s mediator and uses it as a signaling server.

WebGC maintains its routing tables by augmenting the messages sent by the overlay protocols it hosts. Specifically, for each message sent by one such protocol, WebGC also sends a routing table update that tells the receiving node how to establish a connection which each of the nodes referenced in the overlay

message. Consider a node Pj sends to node Pi a message containing a reference

to node Pk. If Pj has an open connection with Pk, then Pj itself can act as

a mediator between Pi and Pk, so it sends a routing table entry < Pk, Pj >.

(5)

4

Pk and thus sends an entry < Pk, Rj[k] >, where Rj[k] is the mediator for Pk

stored in Pjs routing table.

3

Demo Timeline

Our demo will present a simple WebGC-based application consisting of two stacked overlay protocols and a chat service. We will provide one or two demo machines, but users will also be able to join the demo using their laptops. The application’s web interface will require each user to specify his/her own interests in the form of keywords. This will organize users into a semantic overlay thereby identifying groups of users with similar interests.

Each of them will be able to follow the application’s evolution on the web interface in the form of graphs that will display their RPS [11] and a cluster-ing [19] views. In addition, users will be able to broadcast messages to each of the users in either view. Thanks to this feature, the demo might also provide workshop attendees with a way to exchange messages during the workshop.

4

Related work

The introduction of WebRTC [2] has motivated a number of developers to de-sign in-browser peer-to-peer solutions. PeerJS [3], SimplePeer [4], and P [1] all seek to o↵er a simplified API to program peer-to-peer applications on top of WebRTC. The previous version of WebGC [8] was built on top of PeerJS and ex-ploited PeerServer, its associated signaling server. Since then, we have performed a complete refactoring to build our decentralized signaling solution, and to sup-port multi-threading by means of web workers. In the process, we also migrated from PeerJS to SimplePeer, which simplified the library’s requirements and made it possible to run WebGC applications without a browser on NodeJS [5].

While we designed our decentralized signaling solution to work in conjunction with gossip-based overlay maintenance, others have considered the idea of having a decentralized signaling server. P [1], for example, uses servers only for boot-strapping and then each peer can take up the role of a mediator. Unlike WebGC, however, P does not integrate signaling with gossip-based overlay maintenance. Finally, our work on WebGC is closely related to past e↵orts dedicated to the modular implementation of gossip protocols [16, 11, 17, 6].

5

Conclusions

We presented WebGC, a library that simplifies the development of gossip-based applications based on the WebRTC framework. Built on top of SimplePeer [4], WebGC includes a decentralized signaling service as well as the implementation of several standard gossip protocols. Our demo demonstrates the e↵ectiveness of our library in a real context, with a gossip-based chat application.

(6)

References

1. https://github.com/unsetbit/p/ 2. http://www.webrtc.org/ 3. http://peerjs.com/ 4. https://github.com/feross/simple-peer/ 5. https://nodejs.org/ 6. http://gossiplib.gforge.inria.fr/

7. Bertier, M., Frey, D., Guerraoui, R., Kermarrec, A., Leroy, V.: The gossple anony-mous social network. In: Middleware 2010, Bangalore, India, 29/11 - 3/12, 2010. pp. 191–211 (2010)

8. Carvajal-Gomez, R., Frey, D., Simonin, M., Kermarrec, A.: Webgc: browser-based gossiping. In: Proceedings of the Middleware ’14 Posters & De-mos Session, Bordeaux, France, December 8-12, 2014. pp. 13–14 (2014), http://doi.acm.org/10.1145/2678508.2678515

9. Datta, A., Sharma, R.: Godisco: Selective gossip based dissemination of infor-mation in social community based overlays. In: Aguilera, M., Yu, H., Vaidya, N., Srinivasan, V., Choudhury, R. (eds.) Distributed Computing and Networking, Lec-ture Notes in Computer Science, vol. 6522, pp. 227–238. Springer Berlin Heidelberg (2011)

10. Dowling, J., Payberah, A.H.: Shu✏ing with a croupier: Nat-aware peer-sampling. In: 2012 IEEE 32nd International Conference on Distributed Com-puting Systems, Macau, China, June 18-21, 2012. pp. 102–111 (2012), http://dx.doi.org/10.1109/ICDCS.2012.19

11. Jelasity, M., Voulgaris, S., Guerraoui, R., Kermarrec, A.M., van Steen, M.: Gossip-based peer sampling. ACM TOCS 25(3) (2007)

12. Kermarrec, A., Pace, A., Qu´ema, V., Schiavoni, V.: Nat-resilient gossip peer sam-pling. In: 29th IEEE International Conference on Distributed Computing Systems (ICDCS 2009), 22-26 June 2009, Montreal, Qu´ebec, Canada. pp. 360–367 (2009) 13. Mega, G., Montresor, A., Picco, G.: Efficient dissemination in decentralized social

networks. In: Peer-to-Peer Computing (P2P), 2011 IEEE International Conference on. pp. 338–347 (Aug 2011)

14. Nilizadeh, S., Jahid, S., Mittal, P., Borisov, N., Kapadia, A.: Cachet: A decen-tralized architecture for privacy preserving social networking with caching. In: Proceedings of the 8th International Conference on Emerging Networking Exper-iments and Technologies. pp. 337–348. CoNEXT ’12, ACM, New York, NY, USA (2012), http://doi.acm.org/10.1145/2413176.2413215

15. Osmani, A.: Learning JavaScript Design Patterns. JavaScript

and jQuery developer’s guide, O’Reilly Media, Inc. (2012),

http://books.google.fr/books?id=JYPEgK-1bZoC

16. Rivi`ere, E., Baldoni, R., Li, H., Pereira, J.: Compositional gossip: a conceptual architecture for designing gossip-based applications. SIGOPS Operating Systems Review (2007)

17. Ta¨ıani, F., Lin, S., Blair, G.S.: Gossipkit: A unified

componentframe-work for gossip. IEEE Trans. Software Eng. 40(2), 123–136 (2014),

http://doi.ieeecomputersociety.org/10.1109/TSE.2013.50

18. Voulgaris, S., Gavidia, D., van Steen, M.: CYCLON: inexpensive membership man-agement for unstructured P2P overlays. J. Network Syst. Manage. 13(2), 197–217 (2005), http://dx.doi.org/10.1007/s10922-005-4441-x

19. Voulgaris, S., van Steen, M.: Epidemic-style management of semantic overlays for content-based searching. pp. 1143–1152. EuroPar 2005, Lisbon, Portugal

(7)

A

s

Sc

al

ab

le

A

s

Pos

si

bl

e:

Fou

nd

at

ion

s

of

la

rge

-s

cal

e

dyn

am

ic

di

st

rib

ut

ed

sys

te

m

s

Te am Le ad er : Fr an c¸o is Ta ¨ıani We b sit e: ht tp :/ /w ww .in ria .fr /e n/ te am s/ as ap 1email: name.las tname@inria.fr

W

eb

G

C

G

os

si

pi

ng

on

B

ro

w

se

rs

w

ith

ou

t

a

Se

rve

r

Ra zie lC arv aj al-G ´omez 1-Da vid e Fr ey 1-M at th ieuS im on in 1-A nn e-M ar ieK er m ar re c 1 In tr od uc tion In one hand, the inclus ion of Real Time Communication (R TC) API’s such as We bR TC in we b br ow se rs ha s re ne we d th e in te re st in pe er -to -p ee r (P 2P ) ap -plications . In the other hand, ep idemic (gos sip) proto cols have alw ays pla yed a pr om in en t ro le in P2 P ap pl ica tio ns du e to th eir in he re nt sc ala bi lity ,r es ilie nc e to fai lures and wi de appl icabi lit y. No wada ys, hav ing gossi pi ng in real time commu-nications implies the next cons iderations : P ros (l ef t) & C on s (r igh t) of G os si p P rot oc ol sEas y to de pl oy: P2 P app licatio ns ,Mo bile Co m pu tin g, Da ta Ce nt er s • V er sat ile : Over lay Net wo rks , Br oadcas t se rv ice s, Vi de o St re ami ng Ne tw ork st at ist ics, Re comme nd at ion • Se lf-ad ap tive : Re sil ien t to ch urn , ca ta s-tro phic failur es • Sof tw ar e po rt ab ili ty: exis ting gos sip-bas ed applications require us ers to ins tall sp ec ific soft wa re to ma na ge gossi p ex -changes . In a wo rld where mo re and mo re cutting-edge applications run within web br ow se rs , th is re pr es en ts a cle ar di sa dv an -tag e fo repidem ic pr oto co ls. W eb G C :b ro w se r-bas ed gos si p lib ra ry We pr op os e We bG C, a libr ar y fo r go ss ip -b as ed co m m un ica tio n be twe en we b br ow se rs . • It is build on the top of W ebR TC, it contains 3 gos sip pr oto col im ple m en tations . • Pr oto co ls’ sp ecifi catio n is do ne via a JS ON object. • Fe w Ja va Sc rip tl in es ar e re qu ire d to ex te nd we b ap pl ica tio ns wi th go ss ip te ch ni qu es . • Ad ec en tra lis eds ig na lin g se rv ice ,t o cr ea te ne wp ee rc on ne ct io ns ,i so ffer ed. • We bG C ru ns on No de JS to o an d re lie sr eli es on th e sim pl e-pe er pr oj ec t [3 ]. We bG C A rc hi te ct ur e The lib ra ry co ns ists of a Co ordina to r and a set of Go ss ip pr oto co ls . • The Co ordina to r ins tantiates go ss ip pr oto co ls, m anag es peer co nnectio ns and link s de-pe nd en cie s be tw ee n pr ot oc ol s. Th e lib ra ry cu rre nt ly co nt ain s an im pl em en ta tio n of th e pe er sa mp lin g prot oc ol [5] ,a sw ell as a clu st eri ng prot oc ol [4] imp leme nt at ion . • All pr oto co ls im plem ent a co m m on Go ss ip P ro to co l “int erface”—si nce Jav aScri pt do es not natively supp ort interfaces ,w e adopt the interface pattern des crib ed in [6]. • One C on fi gu ra ti on O bj ec t is red to defi ne a go ss ip applicatio n, this m ak es po ss ible to st ac k a comb in at ion of gossi p prot oc ol st o ac hi ev e ne w comp lex ap pl ica tion s. • Connections bet wee n peer s ar e us ed by the dece ntr alis ed signalling ser vice to cr eate new con-nections . Figure 1: W ebGC architecture W eb G C In A ct ion The next tw o fig ur es sho w ho w eas y it is to set up the lib ra ry. Fig ur e 2 co ntains an example of the configuration object: a JS ON object that defines the settings and the dep end en cies bet ween gos sip proto cols .Figure 3 sho ws the interface that enables us ers to extend W ebGC with ot her implementations . Figure 2: Configuration object Figure 3: M eth ods to implement of the Gos -sip Prot oc ol in te rfa ce D em on st rat ion Fo llow th e ne xt st ep sf or try in g We bG C: • Op en a web br ows er ,j us tChr ome 37+ or Fir ef ox 32+ is supp or ted • Connect to UR L given by the exp os ito r • Ty pe an id en tifi er (t yp ica lly yo ur na m e) • Se lec ty ou rp rofil e (se tof top ics in comp ut er sc ien ce ) • Click on the sta rt button • Chat with your neighb our s Figure 4: Scre en shot of the W ebGC demons tration Figure 4 sho ws you what you will see in the demons tration and it is divided in thr ee se ctio ns: • U se r P rofi le (t op ): us ers select a lis t of topics in computer science. Through the us e of two go ss ip pr ot oc ol s (R PS an d Cl us te rin g) ,We bG C is go in g to fin d ot he r pe er s wi th sim ilar pr ofi les • G rap h vi su al is at ion (m id dl e) : the over lay of tw o go ss ip pr oto co ls ar e sho wed in this se ct ion . • A pp lic at ion (b ot tom ): chat with peers you have a connection with D o not re in ve nt th e w he el We bG C re lie so n th e re ce nt in tro du ct io n of We bR TC ,a nd two pr oj ec ts : • Si mpl e-P eer is a Peer im plem entatio n to cr eate co nnectio ns bet ween br ows er sand it is co m patible with No deJS to o • Pe er Se rve r is a centr alis ed sig nalling ser vice. W ebGC us es a cus to m ised ver sio n of Peer Ser ver [2 ]to boo ts tra p in co m in g pe er s. Exp er im en tal R es ul ts We ev alu at ed th e pr op er tie so ft he gr ap hs ge ne ra te d by th e RP S an d Cl us te rin g pr ot oc ol s along the lines of [5]. 1. 7 1. 8 1. 9 2 2. 1 2. 2 2. 3 2. 4 2. 5 0 20 40 60 80 100 120 Avera ge Path Len gth Nu mb er o f cy cl es A v era g e Pa th L en g th o f th e R PS p ro to co l w ith 120 p eers P u sh -P u ll, V iew S iz e= 10, a n d Cy cl e= 20s H ea ler (H = 5, S = 0) S w a p p er (H = 0, S = 5) Figure 5: Average Path Length of RPS 1. 8 1. 9 2 2. 1 2. 2 2. 3 2. 4 2. 5 2. 6 0 20 40 60 80 100 120 Avera ge Path Len gth Nu mb er o f cy cl es A v era g e Pa th L en g th o f th e Cl u steri n g p ro to co l w ith 120 p eers P u sh -P u ll, V iew S iz e= 10, a n d Cy cl e= 20s "A v era g eP a th Len g th .d a t" u si n g 1: 2 Figure 6: Average Path Length of Clus tering 0. 14 0. 16 0. 18 0. 2 0. 22 0. 24 0. 26 0. 28 0. 3 0. 32 0. 34 0 20 40 60 80 100 120 Clu steri ng Co effici ent Nu mb er o f cy cl es Cl u steri n g Co effi ci en t o f th e R PS p ro to co l w ith 120 p eers P u sh -P u ll, V iew S iz e= 10, a n d Cy cl e= 20s H ea ler (H = 5, S = 0) S w a p p er (H = 0, S = 5) Figure 7: Clus tering Co effi cient of RPS 0. 1 0. 2 0. 3 0. 4 0. 5 0. 6 0. 7 0 20 40 60 80 100 120 Clu steri ng Co effici ent Nu mb er o f cy cl es Cl u steri n g Co effi ci en t o f th e Cl u steri n g p ro to co l w ith 120 p eers P u sh -P u ll, V iew S iz e= 10, a n d Cy cl e= 20s "Cl u steri n g Co efi ci en t. d a t" u si n g 1: 2 Figure 8: Clus tering Co effi cient of Clus tering C on cl us ion s an d on goi ng w or k We pl an to te st We bG C wi th a ce rta in de gr ee of ch ur n. References [1] http://www.webrtc.org/ . [2] https://github.com/peers/peerjs-server . [3] https://github.com/feross/simple-peer . [4] M .B er tie r, D. Fr ey ,R .G ue rra ou i, A. Ke rm ar re c, an d V. Le ro y. Th e Go ss pl e an on ym ou ss oc ial ne tw or k. In Middlew are 2010, Bangalo re ,India [5] M. Jelas ity ,R .Guer raoui, A.-M. Ker ma rrec, and M. van Steen. The peer samp lin g ser vice: exp er imental evaluation of uns tructur ed gos sip-bas ed im plem entatio ns . Middlew are 2004 To ro nt o, Ca na da .O ct ob er 20 14 . [6] A. Os m ani. Le ar ni ng Ja va Sc rip tDe sig n Pa tt er ns .J av aS cr ip ta nd jQ ue ry de ve lo pe r’s gu id e. O ’R eil ly M ed ia, In c. ,2 01 2.

Figure

Fig. 1. General architecture

Références

Documents relatifs

(LFR) [1] is based on the configuration model [17], which generates networks with power law degree distribution, too. However, unlike Bagrow’s method, LFR generates power law

Due to the hybrid framework that allows the coexistence of VSNs and OSNs in a common platform, both SOLVER Mobile platform and the SOLVER Cloud platform show two separated

Offline throughput is the data rate at which a device can receive data waiting for it in the Contrail cloud’s persistent storage; this is data sent to the cloud while the

We therefore propose that the rules underpinning the molecular evolution of cytoplasmic genomes (i.e. genome size, substitution rate and number of copies per cell), is in

Once activity data have been extracted and represented according to the ontolo- gies briefly described above, the next step consists in identifying and aggregating, in this data

Furthermore, a higher percentage (69%) of users in the highest spending category are more likely to desire the support of recommendation technology. Characterizing and evaluating

Participation can have a big impact on the workflows of heritage institutions, for instance, by inviting users to assist in the selection, cataloguing, contextualization

This paper presents work-in-progress on the Social Semantic Server, an open framework providing applications and their users with a growing set of services of different granularity