8/9/2019 Peer to Peer Systems Copy
1/41
1
Peer-to-Peer Systems
SVTH: Lê Thành Nguyên 00707174
Võ Lê Quy Nhơn 00707176
8/9/2019 Peer to Peer Systems Copy
2/41
2
Peer-to-Peer
n !"tern!t#$e to the %"#ent&ser$er mo'e" o( '#str#)ute' %om*ut#ng#s the *eer-to-*eer mo'e"+
,"#ent&ser$er #s #nherent"y h#er!r%h#%!" .#th resour%es %entr!"#/e'on ! "#m#te' num)er o( ser$ers+
n *eer-to-*eer net.ors )oth resour%es !n' %ontro" !re .#'e"y'#str#)ute' !mong no'es th!t !re theoret#%!""y e2u!"s+ 3 no'e.#th more #n(orm!t#on )etter #n(orm!t#on or more *o.er m!y )emore equal,5 )ut th!t #s ! (un%t#on o( the no'e not the net.or%ontro""ers+
8/9/2019 Peer to Peer Systems Copy
3/41
3
e%entr!"#/!t#on
ey (e!ture o( *eer-to-*eer net.ors #s 'e%entr!"#/!t#on+ Th#sh!s m!ny #m*"#%!t#ons+ 8o)ustness !$!#"!)#"#ty o( #n(orm!t#on!n' (!u"t-to"er!n%e ten's to %ome (rom re'un'!n%y !n' sh!re'
res*ons#)#"#ty #nste!' o( *"!nn#ng org!n#/!t#on !n' the#n$estment o( ! %ontro""#ng !uthor#ty+
9n the e) )oth %ontent *ro$#'ers !n' g!te.!ys try to *ro(#t )y%ontro""#ng #n(orm!t#on !%%ess+ %%ess %ontro" #s more '#((#%u"t #n
*eer-to-*eer !"though N!*ster 'e*en'e' on ! %entr!" #n'e;+
8/9/2019 Peer to Peer Systems Copy
4/41
4
Te%hno"ogy Tr!ns#t#on
The Client/Server Model
The Peer-to-Peer Model
8/9/2019 Peer to Peer Systems Copy
5/41
,"!ss#(#%!t#on
Pure P
8/9/2019 Peer to Peer Systems Copy
6/41
**"#%!t#ons outs#'e ,om*uter S%#en%e
C#o#n(orm!t#%s
D'u%!t#on !n' !%!'em#%
E#"#t!ry
Cus#ness
Te"e$#s#on
Te"e%ommun#%!t#on
6
8/9/2019 Peer to Peer Systems Copy
7/41
7
hy Peer-to-Peer Net.or#ngF
The nternet h!s three $!"u!)"e (un'!ment!" !ssets-
#n(orm!t#on )!n'.#'th !n' %om*ut#ng resour%es - !"" o( .h#%h
!re $!st"y un'er ut#"#/e' *!rt"y 'ue to the tr!'#t#on!" %"#ent-
ser$er %om*ut#ng mo'e"+
Information - H!r' to (#n' #m*oss#)"e to %!t!"og !n' #n'e;
Bandwidth - Hot "#ns get hotter %o"' ones st!y %o"'
Computing resources - He!$#"y "o!'e' no'es get o$er"o!'e'#'"e no'es rem!#n #'"e
8/9/2019 Peer to Peer Systems Copy
8/41
8
n(orm!t#on @!ther#ng
The .or"' *ro'u%es t.o e;!)ytes o( #n(orm!t#on
3
8/9/2019 Peer to Peer Systems Copy
9/41
9
C!n'.#'th ?t#"#/!t#on
s#ng"e (#)erKs )!n'.#'th h!s #n%re!se' )y ! (!%tor o(
106 'ou)"#ng e$ery 16 months s#n%e 1J7
Tr!((#% #s st#"" %ongeste' Eore 'e$#%es !n' *eo*"e on the net
Eore $o"ume o( '!t! to mo$e !roun' s!me 'est#n!t#ons
3 eC!y M!hoo et%+
8/9/2019 Peer to Peer Systems Copy
10/41
10
,om*ut#ng 8esour%es
EooreKs L!.: *ro%essor s*ee' 'ou)"es
e$ery 1G months
,om*ut#ng 'e$#%es 3 ser$er P, P %e""*hone !re
more *o.er(u" th!n e$er Stor!ge %!*!%#ty h!s #n%re!se' 'r!m!t#%!""y
,om*ut!t#on st#"" !%%umu"!tes !roun'
'!t! %enters
8/9/2019 Peer to Peer Systems Copy
11/41
11
Cene(#ts (rom P
8/9/2019 Peer to Peer Systems Copy
12/41
12
#gure 10+1: P !n' o$er"!y rout#ng
(or *eer-to-*eer
IP Application-level routing overlay
Scale IPv4 is limited to 232 addressable nodes. The
IPv6 name space is much more generous(2128 ), but addresses in both versions are
hierarchically structured and much of the space
is pre-allocated according to administrativerequirements.
Peer-to-peer systems can address more objects.
The GUID name space is very large and flat(>2128 ), allowing it to be much more fully
occupied.
Load balancing Loads on routers are determined by network
topology and associated traffic patterns.
Object locations can be randomized and hence
traffic patterns are divorced from the networktopology.
Network dynamics(addition/deletion of
objects/nodes)
IP routing tables are updated asynchronously ona best-efforts basis with time constants on the
order of 1 hour.
Routing tables can be updated synchronously orasynchronously with fractions of a second
delays. Fault tolerance Redundancy is designed into the IP network by
its managers, ensuring tolerance of a single
router or network connectivity failure. n-foldreplication is costly.
Routes and object references can be replicated
n-fold, ensuring tolerance of n failures of nodes
or connections.
Target identification Each IP address maps to exactly one targetnode.
Messages can be routed to the nearest replica ofa target object.
Security and anonymity Addressing is only secure when all nodes aretrusted. Anonymity for the owners of addresses
is not achievable.
Security can be achieved even in environmentswith limited trust. A limited degree of
anonymity can be provided.
8/9/2019 Peer to Peer Systems Copy
13/41
13
#str#)ute' ,om*ut!t#on
9n"y ! sm!"" *ort#on o( the ,P? %y%"es o( most %om*uters #sut#"#/e'+ Eost %om*uters !re #'"e (or the gre!test *ort#on o( the'!y !n' m!ny o( the ones #n use s*en' the m!Oor#ty o( the#r t#me.!#t#ng (or #n*ut or ! res*onse+
num)er o( *roOe%ts h!$e !ttem*te' to use these #'"e ,P?%y%"es+ The )est no.n #s the SDThome *roOe%t )ut other
*roOe%ts #n%"u'#ng %o'e )re!#ng h!$e use' #'"e ,P? %y%"es on
'#str#)ute' m!%h#nes+
8/9/2019 Peer to Peer Systems Copy
14/41
14
#s%uss#on Quest#on: ,om*uter or
n(om!%h#neF
The (#rst %om*uters .ere use' *r#m!r#"y (or %om*ut!t#ons+ 9nee!r"y use .!s %!"%u"!t#ng )!""#st#% t!)"es (or the ?+S+ N!$y 'ur#ngor"' !r +
To'!y %om*uters !re use' more (or sh!r#ng #n(orm!t#on th!n%om*ut!t#ons*erh!*s #n(om!%h#ne m!y )e ! more !%%ur!ten!me th!n %om*uterF
#str#)ute' %om*ut!t#on m!y )e )etter su#te' to *eer-to-*eer
systems .h#"e #n(orm!t#on ten's to )e h#er!r%h#%!" !n' m!y )e )etter su#te' to %"#ent&ser$er+
NAT h!s )oth ,om*uter S%#en%e !n' n(orm!t#on Systems'e*!rtments+
8/9/2019 Peer to Peer Systems Copy
15/41
,urrent Peer-Peer ,on%erns
To*#%s "#ste' #n the DDD 7th !nnu!" %on(eren%e:
15
8/9/2019 Peer to Peer Systems Copy
16/41
!ngers !n' tt!%s on P
8/9/2019 Peer to Peer Systems Copy
17/41
17
The SDThome *roOe%t
The SDT 3Se!r%h (or D;tr! Terrestr#!" nte""#gen%e *roOe%t
"oos (or *!tterns #n r!'#o (re2uen%y em#ss#ons re%e#$e' (rom
r!'#o te"es%o*es th!t suggest #nte""#gen%e+ Th#s #s 'one )y
*!rt#t#on#ng '!t! re%e#$e' #nto %huns !n' sen'#ng e!%h %hun
to se$er!" '#((erent %om*uters o.ne' )y SDT $o"unteers (or
!n!"ys#s+
L#n: htt*:&&set#!thome+ss"+)ere"ey+e'u&
http://setiathome.ssl.berkeley.edu/http://setiathome.ssl.berkeley.edu/http://setiathome.ssl.berkeley.edu/http://setiathome.ssl.berkeley.edu/
8/9/2019 Peer to Peer Systems Copy
18/41
,h#"'ren o( SDThome
n
8/9/2019 Peer to Peer Systems Copy
19/41
o"'#nghome
s o( Se*tem)er
8/9/2019 Peer to Peer Systems Copy
20/41
20
N!*ster
The (#rst "!rge s%!"e *eer-to-*eer net.or .!s N!*ster set u* #n1JJJ to sh!re '#g#t!" mus#% (#"es o$er the nternet+ h#"e N!*sterm!#nt!#ne' %entr!"#/e' 3!n' re*"#%!te' #n'#%es the mus#% (#"es.ere %re!te' !n' m!'e !$!#"!)"e )y #n'#$#'u!"s usu!""y .#th
mus#% %o*#e' (rom ,s to %om*uter (#"es+ Eus#% %ontent o.nerssue' N!*ster (or %o*yr#ght $#o"!t#ons !n' su%%ee'e' #n shutt#ng'o.n the ser$#%e+ #gure 10+< 'o%uments the *ro%ess o(re2uest#ng ! mus#% (#"e (rom N!*ster+
8/9/2019 Peer to Peer Systems Copy
21/41
21
#gure 10+
8/9/2019 Peer to Peer Systems Copy
22/41
22
N!*ster: Lessons Le!rne'
N!*ster %re!te' ! net.or o( m#""#ons o( *eo*"e .#th thous!n's o((#"es )e#ng tr!ns(erre' !t the s!me t#me+
There .ere 2u!"#ty #ssues+ h#"e N!*ster '#s*"!ye' "#n s*ee's to!""o. users to %hoose (!ster 'o.n"o!'s the (#'e"#ty o( re%or'#ngs$!r#e' .#'e"y+
S#n%e N!*ster users .ere *!r!s#tes o( the re%or'#ng %om*!n#es
there .!s some %entr!" %ontro" o$er se"e%t#on o( mus#%+ 9ne )ene(#t .!s th!t mus#% (#"es '#' not nee' u*'!tes+
There .!s no gu!r!ntee o( !$!#"!)#"#ty (or ! *!rt#%u"!r #tem o(mus#%+
8/9/2019 Peer to Peer Systems Copy
23/41
23
E#''"e.!re (or Peer-to-Peer
ey *ro)"em #n Peer-to-Peer !**"#%!t#ons #s to *ro$#'e ! .!y(or %"#ents to !%%ess '!t! resour%es e((#%#ent"y+ S#m#"!r nee's #n%"#ent&ser$er te%hno"ogy "e' to so"ut#ons "#e NS+ Ho.e$er
NS re"#es on *re-%on(#gur!t#on !n' #s not s%!"!)"e enough (or *eer-to-*eer+
Peer %"#ents nee' to "o%!te !n' %ommun#%!te .#th !ny !$!#"!)"eresour%e e$en though resour%es m!y )e .#'e"y '#str#)ute' !n'
%on(#gur!t#on m!y )e 'yn!m#% %onst!nt"y !''#ng !n' remo$#ngresour%es !n' %onne%t#ons+
8/9/2019 Peer to Peer Systems Copy
24/41
24
Non-un%t#on!" 8e2u#rements (or
Peer-to-Peer E#''"e.!re
@"o)!" S%!"!)#"#ty
Lo!' C!"!n%#ng
Lo%!" 9*t#m#/!t#on
'Oust#ng to 'yn!m#% host !$!#"!)#"#ty
Se%ur#ty o( '!t!
nonym#ty 'en#!)#"#ty !n' res#st!n%e to %ensorsh#*3#n some !**"#%!t#ons
8/9/2019 Peer to Peer Systems Copy
25/41
25
8out#ng 9$er"!ys
rout#ng o$er"!y #s ! '#str#)ute' !"gor#thm (or ! m#''"e.!re "!yerres*ons#)"e (or rout#ng re2uests (rom !ny %"#ent to ! host th!t ho"'sthe o)Oe%t to .h#%h the re2uest #s !''resse'+
ny no'e %!n !%%ess !ny o)Oe%t )y rout#ng e!%h re2uest through !se2uen%e o( no'es e;*"o#t#ng no."e'ge !t e!%h o( theme to "o%!tethe 'est#n!t#on o)Oe%t+
@"o)!" ?ser s 3@? !"so no.n !s o*!2ue #'ent#(#ers !re use'!s n!mes )ut 'o not %ont!#n "o%!t#on #n(orm!t#on+
%"#ent .#sh#ng to #n$oe !n o*er!t#on on !n o)Oe%t su)m#ts !re2uest #n%"u'#ng the o)Oe%tKs @? to the rout#ng o$er"!y .h#%hroutes the re2uest to ! no'e !t .h#%h ! re*"#%! o( the o)Oe%t res#'es+
8/9/2019 Peer to Peer Systems Copy
26/41
26
#gure 10+I: #str#)ut#on o(
#n(orm!t#on #n ! rout#ng o$er"!y
8/9/2019 Peer to Peer Systems Copy
27/41
8out#ng 9$er"!ys
C!s#% *rogr!mm#ng #nter(!%e (or ! '#str#)ute' h!sh t!)"e 3HT !s #m*"emente'
)y the PST P o$er P!stry
put(GUID, data)
The data #s store' #n re*"#%!s !t !"" no'es res*ons#)"e (or the o)Oe%t #'ent#(#e' )y
GUID+
remove(GUID)
e"etes !"" re(eren%es to GUID !n' the !sso%#!te' '!t!+
value = get(GUID)
The '!t! !sso%#!te' .#th GUID #s retr#e$e' (rom one o( the no'es res*ons#)"e #t+
The HT "!yer t!e res*ons#)#"#ty (or %hoos#ng ! "o%!t#on (or '!t! #tem stor#ng
#t 3.#th re*"#%!s to ensure !$!#"!)#"#ty !n' *ro$#'#ng !%%ess to #t $#! get3
o*er!t#on+
8/9/2019 Peer to Peer Systems Copy
28/41
8out#ng 9$er"!ys
C!s#% *rogr!mm#ng #nter(!%e (or '#str#)ute' o)Oe%t "o%!t#on !n' rout#ng 39L8 !s#m*"emente' )y T!*estry
publish(GUID)
GUID %!n )e %om*ute' (rom the o)Oe%t+ Th#s (un%t#on m!es the no'e *er(orm#ng ! publish o*er!t#on the host (or the o)Oe%t %orres*on'#ng toGUID+
unpublish(GUID)
E!es the o)Oe%t %orres*on'#ng to GUID #n!%%ess#)"e+
sendToObj(msg, GUID, [n])
o""o.#ng the o)Oe%t-or#ente' *!r!'#gm !n #n$o%!t#on mess!ge #s sent to !n o)Oe%t #n or'er to !%%ess#t+ Th#s m#ght )e ! re2uest to o*en ! T,P %onne%t#on (or '!t! tr!ns(er or to return ! mess!ge%ont!#n#ng !"" or *!rt o( the o)Oe%tKs st!te+ The (#n!" o*t#on!" *!r!meter [n], #( *resent re2uests the
'e"#$ery o( the s!me mess!ge to n re*"#%!s o( the o)Oe%t+
9)Oe%t %!n )e store' !ny.here !n' the 9L8 "!yer #s res*ons#)"e (or m!#nt!#n#ng !m!**#ng )et.een @?s !n' the !''resses o( the no'es !t .h#%h re*"#%!s o( the o)Oe%ts!re "o%!te'+
8/9/2019 Peer to Peer Systems Copy
29/41
P!stry
"" the no'es !n' o)Oe%ts th!t %!n )e !%%esse' through P!stry
!re !ss#gne' 1
8/9/2019 Peer to Peer Systems Copy
30/41
P!stry
hen ne. no'es Oo#n the o$er"!y they o)t!#n the '!t! nee'e' to
%onstru%t ! rout#ng t!)"e !n' other re2u#re' st!te (rom e;#st#ng
mem)ers #n 93"ogN mess!ges .here N #s the num)er o( hosts
*!rt#%#*!t#ng #n the o$er"!y+
n the e$ent o( ! no'e (!#"ure or 'e*!rture the rem!n#ng no'es %!n
'ete%t #ts !)sen%e !n' %oo*er!t#$e"y re%on(#gure to re("e%t the re2u#re'
%h!nges #n the rout#ng stru%ture #n ! s#m#"!r num)er o( mess!ges+
D!%h !%t#$e no'e stores ! "e!( set- ! $e%tor L 3o( s#/e
8/9/2019 Peer to Peer Systems Copy
31/41
P!stry- 8out#ng !"gor#thm
The (u"" rout#ng !"gor#thm #n$o"$es the use o( ! rout#ng t!)"e !t
e!%h no'e to route mess!ges e((#%#ent"y )ut (or the *ur*oses o(
e;*"!n!t#on .e 'es%r#)e the rout#ng !"gor#thm #n t.o st!ges: The (#rst st!ge 'e%r#)es ! s#m*"#(#e' (orm o( the !"gor#thm
.h#%h routes mess!ges %orre%t"y )ut #ne((#%#ent"y .#thout !
rout#ng t!)"e
The se%on' st!ge 'es%r#)es the (u"" rout#ng !"gor#thm .h#%hroutes ! re2uest to !ny no'e #n 93"ogN mess!ges+
8/9/2019 Peer to Peer Systems Copy
32/41
P!stry- 8out#ng !"gor#thm
St!ge 1:
ny no'e th!t re%#e$es ! mess!ge E .#th 'est#n!t#on !''ress
routes the mess!ge )y %om*!r#ng .#th #ts o.n @? !n'
.#th e!%h o( the @?s #n #ts "e!( set !n' (or.!r'#ng E to theno'e !mongst them th!t #s numer#%!""y %"oset to
t e!%h ste* E #s (or.!r'e' to no'e th!t #s %"oser to th!n the
%urrent no'e !n' th!t th#s *ro%ess .#"" e$entu!""y 'e"#$er E to
the !%t#$e no'e %"oser to Very #ne((#%#ent re2u#r#ng N&
8/9/2019 Peer to Peer Systems Copy
33/41
P!stry- 8out#ng !"gor#thm
The '#!gr!m #""ustr!tes the
rout#ng o( ! mess!ge (rom no'e61, to 461, us#ng "e!(
set #n(orm!t#on !"one !ssum#ng
"e!( sets o( s#/e G 3"4
8/9/2019 Peer to Peer Systems Copy
34/41
P!stry- 8out#ng !"gor#thm
St!ge
8/9/2019 Peer to Peer Systems Copy
35/41
P!stry- 8out#ng !"gor#thm
St!ge < 3%ont+:
The rout#ng t!)"e #s "o%!te' !t the no'e .hose @? )eg#ns 61
8/9/2019 Peer to Peer Systems Copy
36/41
P!stry- 8out#ng !"gor#thm
St!ge < 3%ont+:To h!n'"e ! mess!ge E !''resse' to ! no'e 3.here 8*#W #s the
e"ement !t %o"umn # ro. * o( the rout#ng t!)"e
1+ ( 3L-" X X L" Y &&the 'est#n!t#on #s .#th#n the "e!( set or #s the %urrent no'e
8/9/2019 Peer to Peer Systems Copy
37/41
8/9/2019 Peer to Peer Systems Copy
38/41
8/9/2019 Peer to Peer Systems Copy
39/41
8/9/2019 Peer to Peer Systems Copy
40/41
S2u#rre" .e) %!%he
9r#g#n ser$er
Home no'e
8/9/2019 Peer to Peer Systems Copy
41/41
S2u#rre" .e) %!%he
D$!"u!t#on The re'u%t#on #n tot!" e;tern!" )!n'.#'th use':
#th e!%h %"#ent %ontr#)ut#ng 100EC o( '#s stor!ge h#t r!t#o o(