Sistemi P2P - Dipartimento di Ingegneria dell`Informazione

Transcript

Sistemi P2P - Dipartimento di Ingegneria dell`Informazione
Dipartimento di Sistemi e Informatica, University of Florence
Sistemi Distribuiti
Corso di Laurea in Ingegneria
g g
Prof. Paolo Nesi
Parte 4a: Sistemi P2P
Department of Systems and Informatics
University of Florence
Via S. Marta 3, 50139, Firenze, Italy
tel: +39-055-4796523,
+39 055 4796523
fax:
fa : +39-055-4796363
+39 055 4796363
Lab: DISIT, Sistemi Distribuiti e Tecnologie Internet
[email protected], [email protected]
www: http://www.dsi.unifi.it/~nesi
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
1
Sistemi P2P











Aspetti Generali
A li
Applicazioni
i i
Evoluzione Storica
Motivazioni per il P2P
Requirements
Architecture P2P e caratteristiche
Esempio di JXTA
Esempio di DiMOB
Esempio di uso del P2P Tool Kit
Soluzione P2P per il B2B, basata su BitTorrent
P2P for progressive Download of audio/visual content
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
2
Sistemi Distribuiti, Prof. Paolo Nesi
1
Dipartimento di Sistemi e Informatica, University of Florence
Coupling and Scalability
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
3
The P2P World: Current Status

first wave
 spreadsheet and word processors

second wave
 Internet and Mosaic ….. Netscape, …IE

third wave
 Napster: over 60 million users
 AOL Instant Messaging: 100 million subscribers
 In search for “Killer
Killer Apps
Apps” for Networked Objects

forth wave
 P2P on real time applications: streaming, WEB TV,
3D streaming,
 P2P on mobiles is coming
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
4
Sistemi Distribuiti, Prof. Paolo Nesi
2
Dipartimento di Sistemi e Informatica, University of Florence
Peer--To
Peer
To--Peer Computing
A network-based computing model for applications where
computers share resources via direct exchanges between
the participating computers
Source: Sun Microsystems, Project JXTA, 2001
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
5
Application areas 1/2

Content and resource sharing
 NetworkNetwork-wide file/document sharing (e.g. Mangosoft
Mangosoft,, napster
napster,,
eDonkey,, Gnutella, Freenet
eDonkey
Freenet))
 Distributed databases: Mariposa
 knowledge management (e.g. NextPage
NextPage))
 Resource sharing: seti@home,
seti@home, Popular power, mojo natio
 Cascaded content distribution
 Edge services
 P2P search and discovery (e.g. www.fedstats.gov
www.fedstats.gov))
 Network bandwidth sharing

Distributed computation (GRID)




Internet-based (e.g. United devices, entropia)
Internetentropia)
Intranet--based ((www.datasynapse.com
Intranet
www.datasynapse.com,, NetBatch of Intel)
Web testing (e.g., United devices)
Esempio:: gridella
Esempio
gridella,, etc….
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
6
Sistemi Distribuiti, Prof. Paolo Nesi
3
Dipartimento di Sistemi e Informatica, University of Florence
Application areas 2/2

collaborations  CSCW (Computer Support
Cooperative Work)
 On
On--demand, multimulti-institutional virtual organizations
 Marketplace (e.g. www.firstpeer.com
www.firstpeer.com))
 Peer communities of common interests
 Online development projects (e.g. www.oculustech.com
www.oculustech.com))
 Online games
 Remote maintenance
 Examples: Groovem Buzpad
Buzpad,, WuWu
 E-commerce: ebay
ebay,, B2B market, etc.

Social Networks
 PC and mobiles, CSCW
 3D social environments via P2P protocol
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
7
P2P Applications mainly for file sharing








Napster
Gnutella
Freenet
Kazaa
Emule, Emule Plus: both based on kademlia
Mojo Nation
BitTorrent (Azureus client)
…
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
8
Sistemi Distribuiti, Prof. Paolo Nesi
4
Dipartimento di Sistemi e Informatica, University of Florence
Grow AVG, Mill. Download files per year, EU 25, P2P
EITO
2007
9
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
Trend of tech. penetration on accessing digital content
EITO
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
2007
10
Sistemi Distribuiti, Prof. Paolo Nesi
5
Dipartimento di Sistemi e Informatica, University of Florence
P2P Main requirements

Creation of the P2P community
 Discovering of the Peers

Discovering of resources/services
 Resources may be objects, files or disk space, or computational power, etc.
 Allocation of resources/objects into the P2P network
 Global Unique ID, GUID for the objects
 Indexing of the resources into the P2P network
 Customization of query for getting information

Managing updates in the information shared
 In the information requested only
 Removing obsolete files and/or references
 it is not always possible in P2P solutions in which it is tracked who has
downloaded the file, or has the reference
 Notification of changes in the downloaded files, in the accessed resources, etc.
 Versioning, replacement
 Notification to all peers that have downloaded, please stop providing the
last version.
 Again: also in this case the system has to keep trave of who has the file or
the reference
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
11
P2P Main requirements

Interoperability
 between the applications (peer client) built by using different P2P
infrastructures
E.g.: JXTA and Microsoft P2P
Different protocols: from low level to high level
Different information management
Different Routing models
Different metadata
Different certification and authentication of content
 Client che fanno query multiple
multiple, su piu
piu-- protocolli P2P
 La vera interoperabilita’
interoperabilita’ sarebbe poter postate un file in una rete
P2P e vederlo nell’altra indicizzato direttamente
Client the utilizzano piu
piu’’ protocolli fanno solo download da
piu’’ canali
piu
Partially true on BTorrent
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
12
Sistemi Distribuiti, Prof. Paolo Nesi
6
Dipartimento di Sistemi e Informatica, University of Florence
P2P Main requirements
Scalability of the P2P solution

 From 1 file to Millions and Millions
Intrinsic limits of the model, for example a bound on of OUID,
object unique ID
how is the cost and model to grow in terms
• Number of servers
• Networks capability, bandwidth
 From 1 Peer to Millions and Millions
Intrinsic limits of the model, a bound on the PUID, Peer user ID
• Discovery, query, versioning, maintenance, etc.
how is the cost and model/velocity to/of grow
From Intranet to internet,
• In intranet UTP can be used
• In Internet UTP CANNOT be used
• Peers need to perform the boot of the P2P network in Internet
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
13
Definition of Peer

The peer is a node client of the P2P network
 Each client peer has many files
 Some in download and/or uploads

The peer is a single thread, process of download and/or
upload, such as in BitTorrent Terminology
 Each client node has many peers, typically no more than
5/10 at the same time.

We can have a network that at a give instant may have
 4Mpeers, 1.2Mfiles and 890Kusers
 Some are seeders the other are passively reading only !
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
14
Sistemi Distribuiti, Prof. Paolo Nesi
7
Dipartimento di Sistemi e Informatica, University of Florence
P2P Main requirements

Performance
 Analysis and control of the network connections
Banda per esempio in terminini di Mbps/Kbps
massimo numero di connessioni apribili
apribili//attive in ingresso
(download) ed uscita (upload)
From the peer to a set of reference peers/servers
 Measuring CPU features:
fixing % of free CPU reserved
 Space on the HD disk:
space reserved, (maximum) space accessible, effectively free
space used in the shared files,
files etc..
etc
 Max Number of shared files:
reserved and maintained visible
 Time to download, time to start the download
Time to perform the download, start
start--end time
 etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
15
Performance of P2P solutions


Perfo
ormance

Grafo dell’andamento delle prestazioni (download rate) in funzione del
numero dei peer che hanno un certo file, misurato in un certo punto
della rete.
rete.
L’obiettivo della distribuzione e’ arrivare ad avere valore oltre una
certa soglia nel minor tempo possibile
S
Saturazione
i
d
dovuta aii lilimiti
i i di b
banda
d d
dell client
li
Number
of replicas on Peers
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
16
Sistemi Distribuiti, Prof. Paolo Nesi
8
Dipartimento di Sistemi e Informatica, University of Florence
Velocity of Penetration/diffusion/seeding
Velocity by means of which a file becomes accessible (is
seeded) in enough peers to guarantee a certain download
rate in a certain area with a certain level of certainty
Rate
of download
o

Andamento
non noto
????
Dipende
dal comportamento
delle persone che scelgono il
contenuto
t
t
Si
possono fare delle ipotesi
time
17
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
Trend of Penetration in a given area

In general non predicatable, depends on:
 the users’ interest and activities
 The content type and size
 The time, etc…
#
Down,
Vel
#
of Down,
of replicas
Time
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
18
Sistemi Distribuiti, Prof. Paolo Nesi
9
Dipartimento di Sistemi e Informatica, University of Florence
Distribution of the Downloads in a given area
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
19
P2P Main requirements

Assessment of peers,
Assessment of user’s behaviour (single or cluster)
 For:
organizing requests in a queue on the basis of past assessment and
scoring of peers
Providing better services to more virtuous peers
Recognising bonus to more virtuous peers, if the P2P network is
created for ee-commerce
 Assessment for reputation and scoring of peer behaviour
Number of provided files, bandwidth, behaviour (leaving files)
 Assessment for repudiation of peers
Performance
P f
evaluation
l ti off peers, etc.
t
Not enough: CPU power %, disk space, files to be downloaded,
sockets open,
 Assessment of peers to exploit them as supersuper-peers
 etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
21
Sistemi Distribuiti, Prof. Paolo Nesi
10
Dipartimento di Sistemi e Informatica, University of Florence
P2P Main requirements

Security and Trust of users
 Authentication of users
Identification of the user in terms of name/surname, etc., or in terms
of a simple
p UID, watermark
• Knowledge of who has posted the file
 Privacy is typically preferred by P2P users
Privacy vs Authentication of users and Peers

Security and Trust of Content
 Data/file/object certification: consistency
Authentication lead to higher level of trustiness
Trust of metadata and data
data, certification of content:
per verificare/
verificare/riconoscere la firma del content,
garantire la consistenza fra metadati e dati
 Authorization to delivering and use content
Controllo dei diritti,
diritti, Digital rights managment
gestione dei diritti/rights,
diritti/rights, licenze
licenze,, etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
22
P2P Main requirements

Security and Trust of Peer applications
 authentication and certification of peers devices
riconoscere
riconoscere:: la firma del tool,, il fingerprint
g p
del tool in modo da
sapere a chi appartiene e non dargli uno score che non e’ il suo
 To be sure that the Peer Client is working according to the rules of the
community
In terms of respecting scoring, etc.
See later the routing overlay
 Certification that the Peer has not been manipulated to provide a
behavior non conformant to the rules of the community/protocol
 Certification
C tifi ti th
thatt P
Peer Cli
Clientt application
li ti iis nott d
damaging
i your system
t
or exploiting more resources than those assigned
What about the rest of your data ??
Some clients may do other actions: hiding other information,
spreading virus/messages, etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
23
Sistemi Distribuiti, Prof. Paolo Nesi
11
Dipartimento di Sistemi e Informatica, University of Florence
P2P Main requirements
Robustness, Fault tolerance

 Robustness with respect to eventual fault of
Single peers
• Interruption of downloads
• Interruption of query/interrogation service
• Interruption of instradation service (see Routing Overlay)
SuperNodes that permit the indexing and/or the boot of the P2P
community
Network problems, turn off/on of the peers
 Definition of solutions for recovery from failure
 Recovering the interrupted download of file when it is
monolithic: total restart
segmented: restart of the segment
Choosing a different Peer from which the download can be
performed
 Duplication of resources (usage of strategies for duplication)
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
24
P2P Main requirements

QOS, Quality of service:

QOS as an Integrated set of features
 Quality as perceived by the user
 Performance
P f
in
i discovery,
di
discovery
, creating
ti th
the network
t
k
 Performance in providing the services, how fast the
distribution of files is. Trend of the performance in terms of
Mbps as a function of # of peers
 Performance in querying
 Performance in delivering resources
 Fault tolerance
 Usability of the application
 Installability of the application
 Files with zero replicas at 100%
 Files not completed
 Identical files with different ID
 Etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
25
Sistemi Distribuiti, Prof. Paolo Nesi
12
Dipartimento di Sistemi e Informatica, University of Florence
P2P Technological Challenges

Architecture
 Usable on different platforms
Java has been the most selected
 Interoperability between the applications built on different
P2P infrastructures (diff. protocols, languages, etc.)
 Controllability of Peers
 Monitoring of user/peer behavior
 Performance
 Fault tolerance
 Scalability
S l bilit
 Security
Privacy
Trust of content and of Peers
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
26
P2P Technological Challenges

Architecture
 Efficient in joining the network, discovery if needed
 Efficient setup of the P2P community
 Query/search of resources
Complex queries: such as those based on SQL or RDF,
based on semantics: title xx, author YY, ….
Connection with local databases: ODBC, JDBC, etc.
 Deleting of files
Removing from the network
 Changing of files
Notification of changes in the files posted/changed on the
network
versioning
 QOS: Quality of Service
performance in querying and in the download for B2B and for
B2C
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
27
Sistemi Distribuiti, Prof. Paolo Nesi
13
Dipartimento di Sistemi e Informatica, University of Florence
P2P Technological Challenges

Usability aspects
 Passing thought firewalls, standard or proprietary protocols,
may be based on HTTP with XML, etc.
Ports to be open, protocols to be enabled
HTTP, XML are slower but more open and accepted
 Easy to configure
 Easy to installation
 Portable on different operating systems
 Certification of the peer, trusting peer, etc.
 Certification of Content,
 Creation of virtual communities that may exploit the P2P in
a transparent manner each other
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
28
P2P Technological Challenges

Development capabiliies
 So called “P2P Tool kits”
disappeared
pp
 at DISIT Lab, DSI, University of Florence:
DIMOB P2P
AXMEDIS P2P, derived from Azureus
 Several Groups:
java (JXTA), open source, …
Microsoft P2P Tool Kit, …..
Others are C++, etc.
Many of them are open source projects
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
29
Sistemi Distribuiti, Prof. Paolo Nesi
14
Dipartimento di Sistemi e Informatica, University of Florence
Architetture P2P

Concentrate, centralized

Distribuite, Distributed, decentralized

Hierarchical or hybrid
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
30
Centralized P2P Architectures

Concentrated, centralized
 One server and N peers, in some cases, more servers
 Example: Napster (central index)

Also called “Server
“Server--based”




Log, registration peer, etc.
Boot: performed asking to the server
Search: performed asking to the server
Collection of data, index, query, etc.
Table to know where the files (their replicas) and their
segments
t are: obj45:
bj45 n3,
3 n4,
4 n56,
56 n78
78
 Server problem: fault, size, performance, cost, etc.

Gli scambi dei file/risorse possono essere:
 Centralised or P2P, multisource
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
31
Sistemi Distribuiti, Prof. Paolo Nesi
15
Dipartimento di Sistemi e Informatica, University of Florence

http://www.napster.com
 direct swapping MP3 music files
 over 50 million users by midmid-2001
Napster
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
32
Napster History

May 1999: Napster Inc. file share service founded by Shawn Fanning and
Sean Parker
Dec 7 1999: Recording Industry Association of America (RIAA) sues
Napster for copyright infringement
April 13, 2000: Heavy metal rock group Metallica sues Napster for
copyright infringement
April 27, 2000: Rapper Dr. Dre sues Napster
May 3, 2000: Metallica’s attorney claims 335,000 Internet users
illegally share Metallica’s songs via Napster
July 26, 2000: Court orders Napster to shut down
Oct 31, 2000: Bertelsmann becomes a partner and drops lawsuit
Feb 12, 2001: Court orders Napster to cease trading copyrighted songs
and to prevent subscribers to gain access to content on its search index
that could potentially infringe copyrights
Feb 20, 2001: Napster offers $1
$ billion to record companies (rejected)
March 2, 2001: Napster installs software to satisfy the order

NOW Naptser is of ROXIO for distributing copyright protected files.










Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
33
Sistemi Distribuiti, Prof. Paolo Nesi
16
Dipartimento di Sistemi e Informatica, University of Florence
Napster Pros and Problems



Veloce per l’entrata nella comunità tramite server centrale o
server locali ma sempre tramite server
Anonimità degli utenti
Nessun controllo su dati coperti da IPR (intellectually property
right) e questi venivano centralizzati (come indice) in modo non
autorizzato
 Questo problema e’ stato risolto nella versione attuale non molto
diffusa ed apprezzata, dalla massa

Sicurezza:
 Contenuti non certificati
 Utenti
Ut ti non autenticati
t ti ti
 Non accesso a database, query molto semplici


Protocollo proprietario,
proprietario, filtrato da firewal
Scarsa scalabilità
 Costi elevati di gestione
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
34
Napster




Architettura centralizzata per la condivisione di file
Query centralizzata
Copie
p dei contenuti centralizzate, in p
parte
Al crescere del numero degli utenti e’ necessario
aumentare le prestazioni e lo spazio disco del server
centrale che dai il servizio
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
35
Sistemi Distribuiti, Prof. Paolo Nesi
17
Dipartimento di Sistemi e Informatica, University of Florence
Napster: search files
36
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
Napster: peerpeer-to
to--peer file sharing with a
centralized, replicated index
peers
Napster server
Index
1. File location
request
2. List of peers
offering the file
Napster server
Index
3. File request
5. Index update
4. File delivered
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
37
Sistemi Distribuiti, Prof. Paolo Nesi
18
Dipartimento di Sistemi e Informatica, University of Florence
Clustering of Servers
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
38
Distributed P2P Architecture


Distribuited, decentralized
Also called Pure P2P networks
N p
peers all identical
 Example: Gnutella (gnutella hosts), freenet
 Boot: massive discovery, highly complex
 Search: fully distributed !, high complexity
 No problems of fault
Redundancy of information
 Problems:
Low performance on search and discovery
(distributed), etc.
No Administration, no Certification
No control on the network
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
39
Sistemi Distribuiti, Prof. Paolo Nesi
19
Dipartimento di Sistemi e Informatica, University of Florence
Gnutella





March 2000
Molto semplice
Meccanismi di distribuzione e monitoraggio dei
file in HTTP
Molto diffuso
Non vi sono meccanismi di sicurezza
 Non e’ possibile autenticare gli utenti
 Gli oggetti non sono certificati
 metadati e contenuti possono non essere
consistenti

http://www.gnutelliums.com

www.gnutella.com
40
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
Gnutella: discovering peers
2.1
1.1
1
2.1
3.1
2.1
2
3
2.1
2
3.1
3
31
3.1
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
41
Sistemi Distribuiti, Prof. Paolo Nesi
20
Dipartimento di Sistemi e Informatica, University of Florence
Gnutella: searching (via routing)
2.1
2.1
2
1
3
2
3.1
3.1
3
3.1
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
42
Mojo Nation


Distributed file sharing
Meccanismo di valutazione della disponibilita’ di
un Peer basato sul “mojo”
j come unita’
 Mojo sono anche convertibili in moneta reale
 Forza le motivazioni alla condivisione per avere
una contropartita

Non vi sono meccanismi di sicurezza
 Non e’ possibile autenticare gli utenti
 Gli oggetti non sono certificati,
certificati metadati e
contenuti possono non essere consistenti

http://www.mojonation.net
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
43
Sistemi Distribuiti, Prof. Paolo Nesi
21
Dipartimento di Sistemi e Informatica, University of Florence
Hybrid P2P Architetture
Hierarchical, hybrid

 Mix of centralized and decentralized
 N peers not all identical (at least in the role)
some with the role of local concentrator that can be
activated when needed, the so called “super peers”
Some with the role for facilitating the starting/booting of
the peer network, recovering the list of closer peers
 Example:
Fast Track
Emule: with the servers for boot
 In most cases, the super
super--peers create a sort of a restricted
community around which the content is shared and are
marginally connected with others communities
In some cases, the link can be established
44
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
Hierarchical/Hybrid P2P Network
List of peers 1s
Nodo centrale di boot
0
List of peers 1s
S
Supernodi
di iintermedi
t
di
1
2
2
1
1
1
………
1
List of its peers 2s
2
2 2
2
2
2
2
2
2
Nodi foglia, client, peers
2
2
List of peers 2s +
its 1 super

2
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
Boot facilitation
Query
instradation
45
Sistemi Distribuiti, Prof. Paolo Nesi
22
Dipartimento di Sistemi e Informatica, University of Florence
Main Functionalities of Nodes

Nodo Centrale di Boot:
 NodeList GetList(): to provide list of supernodes level 1
 AddNode(node): to add a supernode of level 1 to the list
 DelNode(node): to remove a supernode of level 1 to the list,
performed by missing a ping for a while
 Bool Alive(): to verify if the node is alive

Level 1 Node :
 NodeList GetList(): to provide list of supernodes level 2
 Alive(), AddNode(node), DelNode(node), as above
 Result PassQuery(query): to pass a received query to lower level
nodes in its Node2List
 Result RedirectQuery(query): to pass a received query to nodes of
its level: Node1List

Level 2 Node: are almost all notifications




It does not receive any command from other nodes on the list
Result Query(query): another node is making a query
Data GetFileSegment(GUID): to get a file segment
Alive(), etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
46
Risposte delle Query

A fronte di una query

Risposta
p
con file singoli
g monolitici:
 FileABC: N1, N34, N56, N58, N67
 FileFGH: N5, N4, N75, N6, N88, N92, N60

Risposta con file a segmenti:
 FileABC: N1(1,3,4,56), N34(345,3,2,1), N56(4,56)
 FileFGH: N5(all), N4(3,5,7), N60(56,78,125)
 All means 100%

Where for Nx we intend:
 IP address, Port, position in the list, estimated time to wait, i
consider you a friend, location, bandwith, etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
47
Sistemi Distribuiti, Prof. Paolo Nesi
23
Dipartimento di Sistemi e Informatica, University of Florence
Recombination of Query Results
Nn
N1
N2
Q
R1
Q
R2
N3
N4
Q
R3
Q
R4
Nn
invia la query
Nn
deve ricombinare R1, 2, 3, 4
i
duplicati possono essere molti,
etc.
R1,2,3,4
Nn
Nn
N1
N2
N3
N4
Q
Q+R1
invia la query
Ni
riceve la query con i risultati
del nodo precedente e ne fa
l’unione con i propri, li passa al
nodo successivo
I
duplicati vengono integrati
via via
Q+R1,2
Q+R1,2,3
Nn
non ricombina risultati
Carico
R1,2,3,4
distribuito
Soluzioni
anche ibride
48
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
P2P layers
P2P
User
P2P
P2P
application information
Interaction
management
e-Bay
Y
N
N
Napster Y
Y
N
Gnutella Y
Gnutella,
Y
Y
freenet
EMULE
Y
Y
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
(Y)
50
Sistemi Distribuiti, Prof. Paolo Nesi
24
Dipartimento di Sistemi e Informatica, University of Florence
Download Multisorgente

File diviso in Parti di dimensioni ragionevoli per la rete, qualche
Kbyte o decina di Kbyte:
 F1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Nodi hanno delle parti nella loro memoria cache:




N1: 1, 3, 5, 7, 8
N2: 2, 4, 5, 7, 8, 10
N3: 5, 6, 2, 9
Etc..

Alcuni nodi possono anche averle tutte, cioe’ il file completo

Un nodo puo’ scaricare parti diverse da nodi diversi anche allo
stesso tempo sfruttando in questo modo un parallelismo
 P.es.: N3 puo scaricare 4 e 10 da N2, ed 3, 1, 8 da N1
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
51
Download Multisorgente

Politiche per scaricare le parti/file dai nodi:
 Il Nodo permette lo scarico in base ad una coda di richieste
Il nodo che chiede viene messo in coda, quando quelli
prima hanno avuto almeno una parte vengono messi in
fondo alla coda
Il nodo puo’ salire nella coda se ha da dare delle parti
anche lui all’altro nodo, per esempio
 Il Nodo ha una limitazione
sul numero di scaricamenti contemporanei
sulla banda sfruttata in uscita e/o ingresso
 Un Nodo puo’ acquisire un credito (uno score/voto) in base al
suo comportamento
t
t nell lasciare
l
i
scaricare
i
fil
file o nell permettere
tt
in uscita una banda larga.
In base a questo credito potrebbe/dovrebbe avere delle
facilitazioni/score in caso di richieste, per scalare delle
posizioni nelle code, etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
52
Sistemi Distribuiti, Prof. Paolo Nesi
25
Dipartimento di Sistemi e Informatica, University of Florence
bitTorrent

Programma di file sharing
 Principalmente P2P, ma con seme iniziale su semplici
pagine WEB, .torrent file
 Open Source
 Soluzioni in vari linguaggi, C++, Java, etc.

prestazioni migliori per file di grosse dimensioni

L’ipotesi e’, come per la maggior parte dei sistemi i P2P:
 che quando uno ha un file anche intero/completo lo continui
a condividere con gli altri e non lo tolga dalla directory che
contiene i file visibili per gli altri
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
53
bitTorrent

Idea:
 Un file .torrent contiene informazioni su come prendere le parti del file
DATI, dove prenderle
 chi sono i nodi che hanno porzioni di quel file
 Il file DATI viene diviso in parti e queste in segmenti
 Il primo pezzo che viene scaricato e’ casuale, i successivi vengono scelti
in modo da dare precedenza al piu’ raro, in modo che la sua rarita’ si
attenui visto che viene copiato su di un altro nodo.
A ha 1,4,5,7,8, e metà di 3
B ha 2,3,4,5, e metà di 6
C ha 2,5,6,7 e metà di 8




Quando A finisce con la parte 3, richiede una nuova parte.
Il programma analizza lo stato generale e trova i pezzi 1 e 6 che sono
i più rari.
Fra questi, A ha bisogno solo della parte 6, così A inizia a scaricare 6
poi passa agli altri segmenti
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
54
Sistemi Distribuiti, Prof. Paolo Nesi
26
Dipartimento di Sistemi e Informatica, University of Florence
Il tracker in bitTorrent





Quando si effettua una query la risposta e’ una lista di file
e per ognuno di questi un file .torrent
Il file .torrent contiene informationi su chi ha i segmenti
del file, eventuali duplicazioni, etc.
Il nodo contatta gli altri peer e parte con lo scarico in
base alla strategia vista
Archivi/tracker diversi possono avere file .torrent diversi e
questi possono o meno essere manutenuti aggiornati con
le informazioni su chi ha il file in questione
Un client p
puo’
o’ essere conneso a uno
no o pi
piu tracker per la
ricerca dei file .torrent
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
55
Azureus: Monitoraggio dello stato
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
56
Sistemi Distribuiti, Prof. Paolo Nesi
27
Dipartimento di Sistemi e Informatica, University of Florence
Azureus: Andamento del download/upload
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
57
Azureus: Mappa delle parti
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
58
Sistemi Distribuiti, Prof. Paolo Nesi
28
Dipartimento di Sistemi e Informatica, University of Florence
BitTorrent Terminology






Choked: a peer to whom the client refuses to send file
Choked:
pieces.
interested a downloader who wishes to obtain pieces of
a file the client has.
leech a peer who has a negative effect on the swarm by
having a very poor share ratio - in other words,
downloading much more than they upload.
peer one instance of a BitTorrent client running on a
computer on the Internet to which other clients connect
and transfer data
data.
seeder a peer that has a complete copy of the torrent
and still offers it for upload.
Nodes of the BT are the peers and seeders
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
59
BitTorrent Terminology

superseed When a file is new, much time can be wasted
because the seeding client might send the same file
piece to many different peers, other pieces have not yet
b
been
d
downloaded
l d d att all.
ll
 Some clients, like ABC, Azureus, BitTornado,
TorrentStorm, and µTorrent have a "superseed" mode,
 they try to only send out pieces that have never been sent
out before, making the initial propagation of the file much
faster.

swarm all peers (including seeders) sharing a torrent are
called a swarm.
 For example, six ordinary peers and two seeders make a
swarm of eight.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
60
Sistemi Distribuiti, Prof. Paolo Nesi
29
Dipartimento di Sistemi e Informatica, University of Florence
Distribution of information in
a routing overlay
A’s
routing knowledge
D’s
routing knowledge
C
A
D
B
Object:
Node:
B’s
routing knowledge
C’s
routing knowledge
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
61
Rounting Overlay

Soddisfare tutti i requisiti precedenti e’ molto complesso

RO g
garantisce che ogni
g nodo p
puo’ accedere ad ogni
g
oggetto instradando la richiesta in modo oppure al fine di
far raggiungere il nodo dove si trova la risorsa (tramite
una sequenza di nodi)
 L’oggetto puo’ essere spostato in altri nodi senza
coinvolgimento degli utenti
 Al limite si crea una catena di riferimenti

Sistemi P2P usualmente replicano la risorsa
 In questo caso RO, deve tenere conto di dove sono le
repliche e puo’ facilitare la consegna fornendo a fronte delle
richiesta/query il nodo piu’ vicino
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
62
Sistemi Distribuiti, Prof. Paolo Nesi
30
Dipartimento di Sistemi e Informatica, University of Florence
Rounting Overlay

Le richieste possono essere effettuate tramite un GUID
(global unified ID)
 La richiesta fatta al RO produce in risposta il(un) nodo che
h lla risorsa.
ha
i

L’algoritmo di RO deve anche:
 Pubblicare/RenderePubblicare/Rendere-noto a tutti i nodi le eventuali nuove
pubblicazioni di GUID
 PROS: Poter cancellare da tutti i nodi gli oggetti e pertanto
la loro GUID che e’ stata rimossa
 PROS: Rendere aggiornati
gg
i nuovi nodi con la lista dei
GUID dandogli alcune delle responsabilita’, la gestione del
segemento di conoscenza che loro rappresentano
 CONS: Al momento in cui un nodo lascia deve ridistribuire
le responsabilita’/(la conoscenza) ai nodi che rimangono. In
modo da non creare delle falle.
63
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
Al momento in cui un nodo lascia deve ridistribuire
le responsabilità/(la conoscenza) ai nodi che
rimangono. In modo da non creare delle falle.
Se A va via, gli oggetti X devono essere presi in
carico da B o da altri,, altrimenti vengono
g
p
persi.
A’s
routing knowledge
D’s
routing knowledge
C
A
D
B
Object:
Node:
B’s
routing knowledge
C’s
routing knowledge
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
64
Sistemi Distribuiti, Prof. Paolo Nesi
31
Dipartimento di Sistemi e Informatica, University of Florence
GUID and DHT

GUID puo’ essere
calcolato tramite:
N1
 HASH function


Pertanto il problema
e’ simile ad avere
una tabella Hash
distribuita:
Distributed Hash
Table, DHT.
Si veda a destra una
semplificazione
N2
N3
N4
N5
Oggetto
Riferimento
65
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
Routing Overlay e repliche




un algoritmo random decide dove
mettere l’oggetto e le sue repliche
in modo da assicurare la loro
accessiblita’
accessiblita
Il numero di repliche puo’ essere
variabile. Se l’alg. Random
identifica ancora lo stesso nodo
deve essere ricalcolata un nuova
posizione
La posizione dipende dal valore di
GUID dell
dell’oggetto
oggetto
Un oggetto con GUID x (e.g., 5)
viene posto in nodi che hanno
GUID prossimi/vicini in modo da
massimizzare la probabilità di
trovarlo in fase di ricerca.
Pubblica
N1
N2
N3
N4
N5
Repliche
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
66
Sistemi Distribuiti, Prof. Paolo Nesi
32
Dipartimento di Sistemi e Informatica, University of Florence
Basic programming interface for a distributed
hash table (DHT) as implemented by the
PAST API over Pastry
put(GUID, data)
The data is stored in replicas at all nodes responsible for the
object identified by GUID.
remove(GUID)
Deletes all references to GUID and the associated data. Solo
accedendo a quelli che coprono tale conoscenza. Pertanto se vi
sono delle repliche prodotte da utenti, possono essere o meno
cancellate se non si operano particolari accorgimenti. Comunque
non sono piu’ recuperabili da altre operazioni di GET pertanto la
rete non le considera piu’
value = get(GUID)
The data associated with GUID is retrieved from one of the
nodes responsible for it. Quelli che coprono quella conocenza
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
67
Distributed Object Location and Routing


DOLR: e’ un modello di RO leggermente migliorato
Idea di base:
 Gli oggetti sono disposti dove si vuole, sono i riferimenti che
vengono disposti sulla base del GUID
 DOLR ha il compito di definire un mapping fra gli indirizzi dei
nodi che contengono repliche e gli oggetti (con i loro GUID)
 Gli oggetti sono memorizzati con lo stesso GUID in nodi
diversi, sono repliche
 RO ha la responsabilità di instradare le richieste verso il nodo
più vicino al richiedente
p

Posizione degli oggetti:
 Le repliche sono poste senza considerare la vicinanza del
valore di GUID secondo delle politiche: e.g., random
 Ogni replica deve essere notificata al DOLR tramite Publish()
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
68
Sistemi Distribuiti, Prof. Paolo Nesi
33
Dipartimento di Sistemi e Informatica, University of Florence
Basic programming interface for distributed object location
and routing (DOLR) as implemented by Tapestry
• publish(GUID)
•GUID can be computed from the object (or some part of it,
e.g.
g its name).
) This function makes the node performing
p
ga
publish operation the host for the object corresponding to
GUID.
• unpublish(GUID)
•Makes the object corresponding to GUID inaccessible.
• sendToObj(msg, GUID, [n])
•Following the object-oriented paradigm, an invocation
message is sent to an object in order to access it. This might be
a request to open a TCP connection for data transfer or to
return a message containing all or part of the object’s state.
The final optional parameter [n], if present, requests the
delivery of the same message to n replicas of the object.
69
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
Cambiamenti sui file

Se un certo oggetto e’ stato
cambiato/cancellato
 Notifcation to who:
 has performed the download for that
object in the past or
 is managing replica for that object
 has references for that object
 The object has to be reloaded, replicated
again, substituting the old one, not very
nice privacy problems

Cambia/cancella
N1
N2
N3
If the object is
 not replicated the change is immediate
 Who has downloaded has to be
informed as well
 replicated:
 Make a query to know where the
object is replicated
 removing/deleting the old versions
 Put/publish the new one
N4
N5
Oggetto
Riferimento
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
70
Sistemi Distribuiti, Prof. Paolo Nesi
34
Dipartimento di Sistemi e Informatica, University of Florence
Come instradare

Pastry e Tapestry usano il Prefix Routing per
determinare il percorso per l’instradamento per la
consegna dei messaggi/pacchetti/richieste indirizzate ad
un certo
t GUID.
GUID

Idea di base:
 Modelli basati sulla disposizione dei nodi in base ad una
gerarchia come per esempio in routing IP packets:
ogni byte identifica 256 possibili figli, ogni figlio 256 figli,
etc.. IP4 has 4 livelli.
Segmento il GUID in livelli, etc.
 Praticamente dei meccanismi che permettono di definire
delle distanze massime fra nodi
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
71
Criteri per la stima della distanza

CHORD come distanza usa la differenza fra il GUID del
nodo presente e di quello che si cerca.
 Distanza in un modello Hash uniforme
 Nodi geograficamente distanti potrebbero trovarsi vicini
nello spazio della tabella, questo non e’ positivo per
ottimizzare i tempi di comunicazione visto che nodi vicini si
devono parlare spesso

CAN:: usa una distanza dCAN
d-dimensionale nell’iperspazio
delle possibili posizioni dei nodi
 Dimensioni per esempio possono essere: IP (geografico),
location (nationality), language, fuso orario, codice postale,
h h etc.
hash,

Kademlia: usa lo XOR sulla coppia di GUID come
Kademlia:
distanza fra i nodi
 Anche questo puo’ evere i problemi che si hanno per
CHORD.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
72
Sistemi Distribuiti, Prof. Paolo Nesi
35
Dipartimento di Sistemi e Informatica, University of Florence
GUID storing

GUID non hanno senso per gli umani sono semplici
codici binari/esadecimali “lunghi”, non hanno un
significato diretto alla loro lettura

GUID puo’ essere calcolato sulla base dei dati che
compongono l’oggetto e/o le informazioni del nodo, per
esempio sulla base delle keyword che lo descrivono, il
file name, etc.

potrebbero essere anche ottenuti tramite lo standard
UUID che pero’ produce un valore assoluto non
ricostruibile dai dati dell’oggetto e dovrebbe essere dato
da un ente superparte, che oltre che generare l’ID
verifica di non avere dei duplicati
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
73
Overlay ed Architetture

Puramente decentralizzato, no centralized:





distribuito puro
Tutti nodi identici, sia server che client
Orgnizzazione autonoma
Esempio: Gnutella, FreHaven
Partially Centralized
 Come il precedente ma alcuni nodi sono diversi e giocano il
ruolo di concentratori di indici, e.g., ai supernodi si possono
dare maggiori riferimenti e gestione della conoscenza
 Sono dei supernodi, che in molti casi possono essere
dinamicamente assegnati, certi nodi possono in forma
temporanei diventare supernodi, etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
74
Sistemi Distribuiti, Prof. Paolo Nesi
36
Dipartimento di Sistemi e Informatica, University of Florence
Overlay ed Architettura

Hybrid Centralized
 Esiste un nodo centrale, un server con l’indice che facilita
l’interazione fra I nodi.
Table con i nodi, CPU, banda, etc.
Table con gli oggetti, metadati, repliche, etc.
 Questi vengono anche chiamati
sistemi Peer
Peer--through
through--Peer oppure
broker
broker--mediated
 Sono sensibili ai fallimenti dei/del server
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
75
Caratteristica di Struttura di rete

Unstructured
 Il posizionamento del contenuto non dipende dalla
soluzione di overlay (dalla topologia di overlay), no RO
 Per la ricerca si deve operare a forza bruta
bruta, problemi di
scalabilita’, e persistenza dei dati
 Adatti per comunita’ che hanno una grande dinamicita’ in
termini di nodi attivi e di contenuto che cambia

Structured Infrastructure
 Usati principalmente per garantire una cerca scalabilita’
 File o puntatori/riferimenti a questi sono posizionati in modo
preciso da p
p
permettere strategie
g di ricerca p
precise.
 Per esempio sulla base della query e’ possibile dirigerla in
modo da sapere a priori chi puo dare il risultato corretto e
completo

Structured System……….
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
76
Sistemi Distribuiti, Prof. Paolo Nesi
37
Dipartimento di Sistemi e Informatica, University of Florence
Caratteristica di Struttura di rete

Structured System
 Sono soluzioni scalabili
 Indicati per query complesse che mirano ad un match
preciso fra la richiesta e la risposta
L’uso di query complesse risulta un problema aperto
 Sono difficili da manutenere in termini di struttura:
nei sistemi P2P i nodi tendono ad arrivare e lasciare
con una certa frequenza
la replica di molte informazioni di routing e’ difficile se
non impossibile
p
la migrazione della conoscenza e’ molto complessa e
costosa se i metadati sono molti
Si devono utilizzare nodi ridondati, supernodi, nodi
concentratori, etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
77
Confronto di Struttura di rete
Hybrid
Centralized
Unstructured
Napster,
Publius
Partially
Centralized
Kazaa,
Morpheus,
Gnutella,
Edutella
No Centralized
Gnutella,
Freehaven
Structured
Infrastructure
chord, CAN,
Tapestry, Pastry
Structured
System
Ocean Store
Mnemosyne,
Scan, PAST,
Kademlia, Tarzan
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
78
Sistemi Distribuiti, Prof. Paolo Nesi
38
Dipartimento di Sistemi e Informatica, University of Florence
GUID e indirizzi dei peer

Indirizzi logici e fisici dei peer
 Internet Service Provider danno in modo dinamico degli indirizzi su
base DHCP, sempre in un certo range, ma diversi
perdita di validita’ dei link,, dei riferimenti ai file,, etc…
p
L’ID del nodo dovrebbe essere effettuato su una base diversa.
 I Firewall di struttura offrono verso l’esterno un unico indirizzo per
tutti i nodi che ci stanno dietro
Si possono usare protocolli che espongono anche l’indirizzo
reale interno del nodo nella intranet, ma devono essere tenuti
tutti e due, tutte le intranet usano lo stesso range.
 Intranet e DHCP (ISP o firewall)
Possono dare indirizzi a rotazione periodica (alcune universita’)
altre hanno la reservation su base del MAC address pertanto
vegono sempre assegnati gli stessi con elevata prob.
 Il MAC addresse sarebbe un migliore identificativo ma molti
calcolatori ne hano diversi…diverse schede di rete. In alternativa un
fingerprint del calcolatore potrebbe aiutare a fare del riconoscimento
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
79
Controllo e supervisione della rete P2P

Sulla rete passano molte
informazioni
 Alcune sono sensibili per IPR
 Altre potrebbero esserlo per la
sicurezza nazionale, per il
penale

Eventuali monitoraggi, con
sniffer
 Controllo intorno al nodo che rice
riceve
e
 Controllo intorno al nodo che
trasmette
 Controllo sul provider e leve legali
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
80
Sistemi Distribuiti, Prof. Paolo Nesi
39
Dipartimento di Sistemi e Informatica, University of Florence
Controllo e supervisione della rete P2P


Per evitare di essere troppo
visibili come nodo provider
Soluzione di instradamento:
 Instradamento del file tramite
nodi intermedi terzi
 Se i nodi intermedi non fanno
caching, il controllo intorno al
nodo che trasmette e’ ancora
possibile visto che il traffico
esce comunque da quello
 Instradamento di uno stesso
file tramite nodi diversi
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
81
Controllo e supervisione della rete P2P

Per evitare di poter essere controllati sulla rete
 Soluzioni che utilizzano canali protetti, proteggono solo il
traffico ma non il monitoraggio dei volumi
 Soluzioni che utilizzano la rete P2P come un database
virtuale
Divisione del file in segmenti spread sui nodi, anche in
forma criptata….
Segmenti dello stesso file finiscono in nodi diversi
anche lontani
Perdita di controllo della porzione dell’HD, l’utente non
conosce cosa contiene, problemi di sicurezza visto che
potrebbe essere sfruttato per azioni non legali
Controlli non facilmente realizzabili
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
82
Sistemi Distribuiti, Prof. Paolo Nesi
40
Dipartimento di Sistemi e Informatica, University of Florence
Vediamo alcuni esempi

JXTA di SUN (www.jxta.org
(www.jxta.org))

P2P Tool Kit per la realizzazione di un sistema di Chat
e per l’editing
l editing di Musica cooperativo
cooperativo, sparito in seguito
dalla rete

DIMOB del DISIT, in seguito e’ stato espanso per
realizzare un sistema cooperativo per la musica ed il
multimedia.

P2P AXMEDIS del DISIT, basato su BitTorrent,
palestra per le valutazioni e nuovi modelli.

P2P su sistemi mobili, ne parleremo dopo ver parlato
di sistemi mobili
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
83
JXTA P2P della SUN

Progetto Open Source della SUN dal 2001
 Tool kit per la realizzazione di soluzioni P2P, GRID, etc.

Protocolli di comunicazione completamente
p
XML
 Costi di comunicazione elevati
 Possibilita’ di costruire nodi anche in C++/C




Rete virtuale di peer indipendente da firewall, NAT,
etc.
Ogni risorsa ha un JXTA ID, indirizzo logico
Web: http://www.jxta.org
http://www jxta org
Nel 2003 nasce il JXTA versione 2.0
 Propogazione delle query e migliore gestione delle risorse
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
84
Sistemi Distribuiti, Prof. Paolo Nesi
41
Dipartimento di Sistemi e Informatica, University of Florence
JXTA peers







non fa assunzioni sul software o sull’ hardware in uso su un
altro peer.
può implementare anche soltanto i protocolli JXTA di cui ha
bisogno
g p
per un corretta interazione con g
gli altri p
peer.
può inoltrare i messaggi per gli altri peer sulla rete JXTA,
questo è comunque un comportamento opzionale.
se riceve un messaggio danneggiato o compromesso allora
deve scartarlo immediatamente.
puo’ apparire e scomparire in ogni momento, o anche solo
spostarsi, i protocolli devono permettere scoperte e
riconnessioni dinamiche ad ogni cambiamento dell’ ambiente.
I protocolli dello JXTA Core non devono imporre requisito di
tempo sulla ricezione del messaggio.
I protocolli standard invece, e le applicazioni definite sopra
questi protocolli, possono imporre dei requisiti di tempo sulla
spedizione e la ricezione dei messaggi.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
85
JXTA, virtual network
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
86
Sistemi Distribuiti, Prof. Paolo Nesi
42
Dipartimento di Sistemi e Informatica, University of Florence
JXTA ARCHITECTURE
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
87
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
88
Sistemi Distribuiti, Prof. Paolo Nesi
43
Dipartimento di Sistemi e Informatica, University of Florence
Protocolli JXTA

Peer Discovery Protocol: definisce le regole per la ricerca di
servizi o risorse resi disponibili da altri peer all’interno della
rete.

Peer Information Protocol è un protocollo definisce come
richiedere e ottenere informazioni sullo stato di un peer
remoto.
Pipe Bindind Protocol è un protocollo che definisce come un
peer possa creare una pipe ed utilizzarla per comunicare.
 query per ricerca di un advertisement pubblicato nella rete

 Una pipe è un canale di comunicazione astratto e virtuale
utilizzato per gestire lo scambio di messaggi di dati tra i peer
astraendo dal livello inferiore (che trasporta l'informazione fisica
vera e propria utilizzando i protocolli transport TCP o HTTP).
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
89
Protocolli JXTA

Rendezvous Protocol è un protocollo che definisce come
i messaggi debbano essere propagati tra i peer
all’interno di un gruppo.
 permette l’invio di messaggi a più peer
contemporaneamente (multicast), indipendentemente dal
fatto che il protocollo di trasporto su cui poggia supporti
questa modalità.

Peer Resolver Protocol permette ai peer di processare i
messaggi
gg ricevuti e comporre
p
una risposta
p
ad essi.

Endpoint Routing Protocol è il protocollo responsabile di
determinare una via di comunicazione tra due peer che
intendono comunicare tra loro.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
90
Sistemi Distribuiti, Prof. Paolo Nesi
44
Dipartimento di Sistemi e Informatica, University of Florence
Content Sharing with MyJXTA of DISIT LAB



Query distribuite
Certificazione dei metadati ??
Etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
91
Problemi di JXTA

Comunicazioni basate su XML, HTTP
 Ottimo per passare dentro firewall

Difficile da portare su sistemi mobili
 Protocolli XMLXML-based sono pesanti

Manca
 comunicazione sicura, SSL fra Peer
 Query SQL (ha solo query semplici);
con Edutella il problema e’
e stato parzialmente
risolto utilizzando RDF/XML
 Notifica dell’avvenuto aggiornamento di un oggetto
 Comunicazione con un database reale, anche
tramite Web Services
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
92
Sistemi Distribuiti, Prof. Paolo Nesi
45
Dipartimento di Sistemi e Informatica, University of Florence
DiMOB in via di sviluppo al DISIT Lab
(da noi a Firenze)
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
93
DiMOB, features

Scoperta dei nodi:
nodi:
 Discovering fra sistemi mobili e non
 Rendere disponibile il peer agli altri

Comunicazione di Messaggi
Messaggi::
 Inviare un mesaggio ad un particolare peer ((unicast
unicast))
 Inviare un messaggio a tutti (multicast)
 Ricevere messaggi dagli altri peer

Trasferimento File:
 Inviare
Inviare//ricevere un file ad/da
ad/da uno specifico peer

Generali
 Parallelismo:
Parallelismo: Effettuare piu’
piu’ cose di queste in parallelo
 Interoperabile
Interoperabile:: PC e PDA
 Efficiente in termini di risorse consumate
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
94
Sistemi Distribuiti, Prof. Paolo Nesi
46
Dipartimento di Sistemi e Informatica, University of Florence
DiMOB, parallelismo
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
95
Caratteristiche di DIMOB


Scritto in C++
Portabile su:
 Windows, Linux e PDA (pocket PC 2003)
 TCP/IP
 Comunicazioni: connessione di rete, Bluethoot
Bluethoot,, WiFi

Basso Footprint
 Adatto per sistemi mobili


Esiste uno strato per CSCW
Applicazioni “provate
“provate”:
”:





Music Editing
g cooperativo
p
File sharing
Chat
Editing cooperativo di grafici
Editing cooperativo di stringhe
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
96
Sistemi Distribuiti, Prof. Paolo Nesi
47
Dipartimento di Sistemi e Informatica, University of Florence
Scoperta Peer, rilevamento Peer non più
attivi o guasti
•
•
•
•
Ricerca di nuovi peer tramite messaggi UDP in broadcast.
Ad intervalli regolari di tempo ogni peer invia impulsi di scoperta.
Ciascun peer tiene traccia dello stato degli altri peer.
Crash o blocco di un peer vengono riconosciuti e gestiti:
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
97
DIMOB: Dipendenza tra le sezioni
 Le sezioni di Comunicazione e di Trasferimento
dipendono dalla sezione di Scoperta per il loro
funzionamento.
 Il modulo di Scoperta riempie una lista con i peer
scoperti e gli altri utilizzano questa per le loro operazioni.
SCOPERTA
COMUNICAZIONE
TRASFERIMENTO
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
98
98
Sistemi Distribuiti, Prof. Paolo Nesi
48
Dipartimento di Sistemi e Informatica, University of Florence
DIMOB: Diagramma delle classi
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
99
DiMob API
 PeerExplorer:
 Refresh( PeerList &list ): esegue la procedura di scoperta.
 EnableDiscovery():
bl i
() abilita
bili lla risposta
i
all peer richiedente.
i hi d
 PeerCommunicator:
 SendInstMessage( Peer dest, string message ): invia un messaggio
di testo ad un peer.
 SendInstMessageAll( PeerList &list, string message ): invia un
messaggio di testo a tutti i peer della lista.
 EnableRecvMessage(): abilita il lato server della comunicazione.
 FileRequest:
 BeginFileTransfer( Peer dest, string FilePath ): trasferisce un file.
 EnableRecvFile() : abilita la ricezione di un file.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
10010
0
Sistemi Distribuiti, Prof. Paolo Nesi
49
Dipartimento di Sistemi e Informatica, University of Florence
Applicazione di test per DiMob su PDA (1)
Lista dei peer presenti
Messaggio ricevuto da PeerID1
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
101
Applicazione di test per DiMob su PDA (2)
File Ricevuto con successo
File inviato a PeerID1
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
102
Sistemi Distribuiti, Prof. Paolo Nesi
50
Dipartimento di Sistemi e Informatica, University of Florence
Problemi di DIMOB

Scarsa scalabilita’:
 Non e’ in grado di fare discovery sulla rete, UDP non e’
usabile su reti geografiche il carico del discovery esaustivo
sarebbe eccessivo
 Potrebbe semplicemente fare download di un file dei
principali nodi accessibili nell’area o in globale, per poi
prendere da uno di questi l’informazione locale per mezzo
di un criterio distanza anche basato GUID o IP.

Ha un supporto parziale per il CSCW (Computer Support
Cooperative Work)

Ha una forma embrionale di soluzione per lo scambio di
file da multisorgente
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
103
Possibile Boot della rete di Peer a basso costo
Local Server
General Server
Local Server
Local Server
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
104
Sistemi Distribuiti, Prof. Paolo Nesi
51
Dipartimento di Sistemi e Informatica, University of Florence
Problemi di DIMOB

Pertanto ha le seguenti limitazioni:
 Non si basa su nessun algoritmo di Routing Overlay
GUID potrebbe essere basato su modelli anche diversi sembre
con codifica HASH, etc..
Un modello/meccanismo BitTorrent potrebbe essere integrato in
aggiunta
 Non ha un’interfaccia di monitoring dei download
 Non supporta la notifica di un aggiornamento di un oggetto sulla rete
(nodi P2P)
 Non supporta query: ne semplici ne complesse (SQL)
 Non ha una connessione con un Database, potrebbe essere
WebService based
 Non permette la creazione di un canale di comuncazione sicuro
(e.g., SSL)
 Non si basa su di un protocollo di alto livello HTTP, pertanto puo’
essere facilmente filtrato fuori dai firewall
 Non permette la sincronizzazione assoluta del tempo
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
105
Lavoro Cooperativo con P2P Tool Kit
Impossibile v isualizzare l'immagine. La memoria del computer potrebbe essere insufficiente per aprire l'immagine oppure l'immagine potrebbe essere danneggiata. Riav v iare il computer e aprire di nuov o il file. Se v iene v isualizzata di nuov o la x rossa, potrebbe essere necessario eliminare l'immagine e inserirla di nuov o.
Application layer

WDM layer

MOODS + WEDELMUSIC
Wedelmusic Dialog Manager
Peer-to-Network
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
106
Sistemi Distribuiti, Prof. Paolo Nesi
52
Dipartimento di Sistemi e Informatica, University of Florence
Lavoro Cooperativo con P2P Tool Kit

Peer’s
Peer
’s Discovery
 Several Groups
 Connessione ad un gruppo

Scambio
S
bi di messaggii
 Chat e comandi per un editor grafico



Gestione concentrata del modello dati come vedremo in
seguito quando prenderemo in esame i sistemi
cooperativi
Sistema di tempo reale
Problemi di sincronizzazione
 Causalità delle azioni effettuate sul modello dati
 Consistenza del modello
 Etc.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
107
WDM Message structure
0
2
ID GRUPPO





4
ID MITTENTE
6
ID DEST.
7
MSG TYPE
ID GRUPPO (2 Byte): ID del gruppo
a cui appartiene il messaggio.
ID MITTENTE (2 Byte): ID del peer
che ha inviato il messaggio.
ID DESTINATARIO (2 Byte): ID del
peer a cui e' destinato il messaggio.
MSG TYPE (1 Byte): Tipo di
messaggio.
gg
PAYLOAD: Contiene il carico utile del
pacchetto WDM, variabile secondo il
tipo di messaggio. Questo campo ha
dimensione massima di 50x1024
Byte.
PAYLOAD
Tipo
Significato
0 Messaggio di scoperta
1 Risposta ad un msg di scoperta
2 Messaggio di unione ad un gruppo
3 Risposta ad un msg di unione
N
l
4 Normale
5 Broadcast
6 ACK
7 Messaggio di Leave group
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
108
Sistemi Distribuiti, Prof. Paolo Nesi
53
Dipartimento di Sistemi e Informatica, University of Florence
Relazioni fra le classi

Timer
Frame
Lomas

Dimas

Mamas
Ldmas

Network
P2PChat
Frame per
rendere
l’applicazione in
fi
finestra
t
LO, DI, MA
applicazioni di
editing
Network per la
WDM
P2PChat per il
P2P support con
discovery etc.
Chat2Cout
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
109
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
110
Impossibile v isualizzare l'immagine. La memoria del computer potrebbe essere insufficiente per aprire l'immagine oppure l'immagine potrebbe essere danneggiata. Riav v iare il computer e aprire di nuov o il file. Se v iene v isualizzata di nuov o la x rossa, potrebbe essere necessario eliminare l'immagine e inserirla di nuov o.
Sistemi Distribuiti, Prof. Paolo Nesi
54
Dipartimento di Sistemi e Informatica, University of Florence
MASAE--DLIOO Communication
MASAE
MASAE
DLIOO
p2p
2 InitSend(0)
I itS d(0)
GetListaMasaeSend()
p2p_InitSend(1)
ReadFromNetwork()
p2p_InitSend(2)
GetListaMasaeRcv()
p2p_InitSend(3)
ReadFromNetwork()
SendAck()
JoinGruppo()
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
111
Impossibile v isualizzare l'immagine. La memoria del computer potrebbe essere insufficiente per aprire l'immagine oppure l'immagine potrebbe essere danneggiata. Riav v iare il computer e aprire di nuov o il file. Se v iene v isualizzata di nuov o la x rossa, potrebbe essere necessario eliminare l'immagine e inserirla di nuov o.
Impossibile v isualizzare l'immagine. La memoria del computer potrebbe essere insufficiente per aprire l'immagine oppure l'immagine potrebbe essere danneggiata. Riav v iare il computer e aprire di nuov o il file. Se v iene v isualizzata di nuov o la x rossa, potrebbe essere necessario eliminare l'immagine e inserirla di nuov o.
Impossibile v isualizzare l'immagine. La memoria del computer potrebbe essere insufficiente per aprire l'immagine oppure l'immagine potrebbe essere danneggiata. Riav v iare il computer e aprire di nuov o il file. Se v iene v isualizzata di nuov o la x rossa, potrebbe essere necessario eliminare l'immagine e inserirla di nuov o.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
112
Sistemi Distribuiti, Prof. Paolo Nesi
55
Dipartimento di Sistemi e Informatica, University of Florence
Impossibile v isualizzare l'immagine. La memoria del computer potrebbe essere insufficiente per aprire l'immagine oppure l'immagine potrebbe essere danneggiata. Riav v iare il computer e aprire di nuov o il file. Se v iene v isualizzata di nuov o la x rossa, potrebbe essere necessario eliminare l'immagine e inserirla di nuov o.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
113
P2P Network of AXMEDIS

P2P for B2B content distribution and sharing

Main requirements:
 Secure in terms of IPR and DRM
 Fast content download
Immediate/fast high performances
 Control of the network
Fast seeding
Delete/change the objects/content
Via a number of superpeers with seeding of a given
object
 Certified metadata
 Support to make query
 Automated control
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
114
Sistemi Distribuiti, Prof. Paolo Nesi
56
Dipartimento di Sistemi e Informatica, University of Florence
Time of Seeding of a given object
in a given point
V [Bps]
Soglia oltre la quale si
ha una V accettabile
To
t
Tseed
115
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
AXMEDIS B2B Distribution and Sharing
Content Producers
VOD
Content Providers
Internet Distributor
Content Provider
Collecting Societies
Collecting Societies
Content Integrators
Content Integrators
i-TVs
STB
AXMEDIS
Portal
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
116
Sistemi Distribuiti, Prof. Paolo Nesi
57
Dipartimento di Sistemi e Informatica, University of Florence
Content Sharing among Content Archives
Archive B
Internet Distributor
Content Provider
Mediateque C
Content Provider
Archive A
Wireless LAN
Library C
Mobile Distributor
Content Integrator
Archive Z
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
117
P2P Network of AXMEDIS

Automated Control of P2P Network:
 Sharing and publishing of content
 Control of the P2P network:
network:
avoiding the distribution of non certified/authorized content
(e.g., content with metadata inconsistent with resources),
avoiding the sharing of illegal files (those that are shared
without the corresponding authorizations of the content
owner),
avoiding the access to P2P B2B facilities to non authorized (or
malicious) actors/users: that is registering the users;
 monitoring the activities of the P2P network (tools and users)
in terms of
performances,
f
queries performed and
content shared where and by who
statistical information that may be used to better tune the
service and understand the user behavior;
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
118
Sistemi Distribuiti, Prof. Paolo Nesi
58
Dipartimento di Sistemi e Informatica, University of Florence
P2P Network of AXMEDIS

Automated Control of P2P Network:
 querying on content on the basis of a large set of
metadata, including those to make search and queries on
business/trading aspects: complex metadata
metadata, licensing
rules and conditions, costs, etc.;
 set up of high quality services of content
distribution/sharing. This implies to guarantee the content
download according to predictable performance, QOS
(Quality Of Service); even when
a new content object/file is shared, thus when the P2P
network may not contains enough replicas;
faults occur in the network and/or in the nodes;
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
119
What it is lacking at traditional BT solutions


integration of protection support and DRM,
DRM, so that to
control the distribution and sharing of non certified
content;
querying/indexing of content on the basis of the
metadata and related object/file cataloguing and querying
for B2B and/or C2C (Consumer to Consumer).
 classical BitTorrent solutions, the queering/indexing is
delegated to external services.
 Typically, the Tracker has only capabilities of presenting the
list of objects,
j
the called catalogue
g and the metadata are
limited to the file name;
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
120
Sistemi Distribuiti, Prof. Paolo Nesi
59
Dipartimento di Sistemi e Informatica, University of Florence
What it is lacking at traditional BT solutions

control of the network allowing the
 removal of content/files from the network, that would means
to remove them at least from the tracker;
 fast notification of new files (changed files) and thus of
seeding of files among the network;
 automating the control of P2P network for publishing and
downloading files in an automatic manner, via the
integration of the P2P network facilities with the content
production facilities;

monitoring activities and user behavior on Nodes.
Nodes. In
addition to the classical P2P network monitoring that can
be performed on Tracker in a limited manner.
121
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
Tunin the service

Monitoring the network by means of the a uniform
distribution of supernodes allows to measure the:
 The velocity of download for each content for hours of the day
along the time of service
 This may be used to change the distribution of replicas on
supernodes so that to work in the guaranteed area since To
V [Bps]
Soglia oltre la quale si ha
una V accettabile
To
Tseed
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
t
122
Sistemi Distribuiti, Prof. Paolo Nesi
60
Dipartimento di Sistemi e Informatica, University of Florence
P2P Network of AXMEDIS


P2P for B2B content distribution and sharing
Exploitation of BitTorrent
 Hierarchical BitTorrent solution
solution, super
super--peers

Addition of:
 Support for MPEG
MPEG--21 files and normal files
Certification of objects
Centralized query support for search of
MPEG--21 files
MPEG
 Control of P2P network via a GRID
 Support to make measures on the tracker
 Support for controlling the P2P status
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
123
BitTorrent based solutions




When a file is published by a peer (initial seeding) a file (.torrent) is created
and sent to a reference Tracker
A peer can start the download having the BitTorrent file (can be obtained:
from the tracker knowing the ID, via email, from HTML pages, ftp, MMS,
etc. )
The Tracker periodically updates the list of peers involved in hosting the
file and notify them about the other active peers
Tracker has the list of objects, the catalogue, and the metadata are limited,
e.g., to the file name
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
124
Sistemi Distribuiti, Prof. Paolo Nesi
61
Dipartimento di Sistemi e Informatica, University of Florence
BitTorrent limitations

Typically the Tracker has no capabilities of providing support
 querying/indexing of content on the basis of the metadata and
related object/file cataloguing and querying for B2B and/or C2C
((Consumer to Consumer).
)
The querying/indexing is delegated to external services, the
content type is not uniform so that the classification is hard
and almost impossible
 for content protection and DRM, to control the publication
distribution and sharing of non certified/protected/authorized
content

BT solutions have not network control functionalities
 removall off content/files
t t/fil ffrom th
the network,
t
k th
thatt would
ld mean
removing them at least from the tracker, but also from the nodes
 fast notification of new files and thus of seeding of files among
the network so that to control the speed of seeding and to
guarantee the download performance
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
125
BitTorrent limitations

BitTorrent has no support for automating the network
control functionalities for
 automating the control of the P2P network for publishing
and downloading files in an automatic manner
manner, via the
integration of the P2P network facilities with the content
production facilities
 monitoring activities and user behavior on nodes. In
addition to the classical P2P network monitoring that can be
performed on the tracker in a limited manner

The proposed AXP2P Solution allows content owners
and distributors to exploit the capabilities of P2P
protocols to create efficient, controllable, legal and
secure P2P networks for content distribution and sharing
 to create P2P networks supporting a large range of
applications of content sharing from B2B, B2B2C and
classical C2C, among PCs and Mobiles
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
126
Sistemi Distribuiti, Prof. Paolo Nesi
62
Dipartimento di Sistemi e Informatica, University of Florence
AXMEDIS P2P solution

Satisfaction of all the above mentioned requirements for
B2B P2P networks

E t
Extension
i off the
th BitTorrent
BitT
t solution
l ti





Usage of the AXOID as unique identification of the
Insertion of a classification and query support
Insertion of DRM support
Insertion of control nodes for publication and monitoring
Addition of:
 P2P client tools for B2B: AXEPTool tool
 P2P client tools for Consumers, B2C and C2C: AXMEDIA
tool
 Server for classification and query: AXMEDIS Query
Support
 Server for DRM: AXMEDIS DRM
 GRID solution for Sistemi
P2PDistribuiti,
Network
control,
AXCP based
Univ. Firenze,
Paolo Nesi 2008-2009
127
AXMEDIS P2P network architecture
AXMEDIA P2P
Metadata
Query Support
AXTracker
AXMEDIS DRM
AXEPTool P2P
AXEPTool
AXCP P2P Control
Distributor
AXEPTool
Download
Distributor
AXCP P2P Control
AXEPTool
AXEPTool
AXMEDIS P2P Network
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
128
Sistemi Distribuiti, Prof. Paolo Nesi
63
Dipartimento di Sistemi e Informatica, University of Florence
P2P Network of AXMEDIS





AXTracker is a modified BitTorrent Tracker that
manages the AXMEDIS P2P network and community
AXEPTool is a special P2P BitTorrent Client Node,
suitable to play the role of a P2P Node for B2B activities
such as producers, distributors, integrators, etc., for B2B
content distribution.
AXMEDIA is a specific P2P BitTorrent Client Node for
final users content sharing and B2C (Business to
Consumer) content distribution.
AXCP GRID is an instance of the AXCP GRID tool to
control the activites of some AXEPTools
AXQuery Support is a server on which the user and the
AXCP may perform queries
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
129
AXMEDIS P2P Network

different kinds of P2P Nodes:
 content production, publications and
sharing
h i nodes
d iin which
hi h a controlling
t lli ttooll
(e.g., AXCP GRID) and at least one
AXEPTool are joined;
 content sharing and distribution nodes
which are constituted by an AXEPTool
only (controlled and supervised by other
AXCP GRID nodes);
 AXMEDIA P2P nodes for content sharing.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
130
Sistemi Distribuiti, Prof. Paolo Nesi
64
Dipartimento di Sistemi e Informatica, University of Florence
AXMEDIS P2P network: Benefits

Fast seeding of the P2P network
 Asking to superpeers to start downloading of new objects
 Immediate notification of new objects

Guaranteed quality of service
 With the deterministic number of superpeers and the possibility of
knowing their networking capabilities

Possibility of deleting object from the network
 Delete of objects on superpeers via GRID
 Delete of objects on the Tracker (to be done)


Possibility of having multiple GRIDs controlling the network for
publication of objects
P f
Performance
control:
t l
 Control of tracker performance
 Control of superpeer performance, in terms of networking,
seeding, space on disk, etc.
 Definition of policies of LRU on the network, optimisation of
content location
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
131
Use Cases per AXEPTool
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
132
Sistemi Distribuiti, Prof. Paolo Nesi
65
Dipartimento di Sistemi e Informatica, University of Florence
AXEPTool P2P client
Metadata
AXQuery Support
AXTracker
Query Service Interface
Publishing Interface
Other AXEPTools
and AXMEDIA tools
Downloading Interface
WS Downloading
AXCP GRID
WS P2P Monitoring
WS File Sharing
bitTorrent P2P client core
P2P AXEPTool
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
133
AXEPTool, P2P BT client, downloading
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
134
Sistemi Distribuiti, Prof. Paolo Nesi
66
Dipartimento di Sistemi e Informatica, University of Florence
AXMEDIS P2P Query Support
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
135
AXTracker Catalogue
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
136
Sistemi Distribuiti, Prof. Paolo Nesi
67
Dipartimento di Sistemi e Informatica, University of Florence
Example of AXEPTool monitoring
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
137
P2P Network control functionalities













publishing(AXEPToolURL, FileURI, AXTrackerURL)
download(AXEPToolURL, FileName or AXOID or
BitTorrentURL)
listContent
li tC t t lilistPublished(AXEPToolURL)
tP bli h d(AXEPT lURL)
listContent listDownloaded(AXEPToolURL)
infoStatus status(AXEPToolURL, FileName or AXOID)
controlDownload(AXEPToolURL, FileName or AXOID)
listAXOID query(AXQuerySupportURL, Query)
listContent catalogue(AXTrackerURL)
delete(AXEPToolURL FileName or AXOID)
delete(AXEPToolURL,
FileURI get(AXOID or FileName)
listAXEPTool listAXEPTool(AXTrackerURL)
infoNode statusNode(AXEPToolURL)
infoTracker statusTracker(AXTrackerURL, period)
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
138
Sistemi Distribuiti, Prof. Paolo Nesi
68
Dipartimento di Sistemi e Informatica, University of Florence
P2P Experiments
Publishing an object on all the AXEPTools of the P2P
Network for example to accelerate the seeding of a given
object on the network:





Axoid=getAXOID(MyFile);
publishing(MyAXEPTool, MyFile, TheAXTracker);
LA = listAXEPTool(TheAXTracker);
For each la of LA: download(la, Axoid);
4
3,5
3
Minuti
per
XXX Mbytes
2,5
2
1,5
1
Ragg.
Saturation for download rate
0,5
Dim (LA)
0
1
2
3
4
5
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
6
7
139
Programming P2P Experiments






Notifying the publication of new objects/files in the network among the
different AXCP GRIDs/AXEPTools controlled;
Removing/deleting of objects/files from the network, at least from the
AXEPTool nodes and from the AXTrackers and AXQuery Support;
Monitoring
g the status of the P2P Network: discovering
g which are the most
active/virtuous AXEPTools, their capabilities, how many downloads have been
performed, how many segments have been provided and for whose
objects/files, then they are active, etc. This allows to perform specific analysis
to assess the reputation of Business actors on the basis of their behavior on
the corresponding AXEPTool;
Controlling the content seeded by the AXEPTools, for example constrained
them to become an exact replica of each other (uniforming the seeding
distribution), or imposing some distribution for the content in the network of the
AXEPTools on the basis of the content distribution and statistical analysis;
Activating
g automated q
queries for obtaining,
g, downloading
g and p
posting
g these
objects into the database of specific content collection on the basis of complex
queries. So that, these active queries can be periodically activated to verify if
some new content satisfy the criteria and in the positive case, the automated
download can be activated as well;
Activating automated publishing on the P2P Network of accessible collections
from the AXCP GRID and crawling facilities
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
140
Sistemi Distribuiti, Prof. Paolo Nesi
69
Dipartimento di Sistemi e Informatica, University of Florence
P2P Progressive Download

The cost of streaming is very
high since the number of
streams/user supported
d
depends
d on th
the max b
bandwidth
d idth
supported by the server:
 e.g., 10Mbps -> 5x200 kbps,
YouTube…


P2P solution reduce the costs of
distribution while the user has to
y the
wait for the download to play
content.
Progressive P2P support the
play while P2P downloading.
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
141
BitTorrent:progressive download
Individuare un
compromesso tra la Rarest
First Policy e il download
sequenziale.

finestra di
segmenti
definite “urgenti
“urgenti””
Fondamentale la scelta della
dimensione della finestra.
d
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
142
Sistemi Distribuiti, Prof. Paolo Nesi
70
Dipartimento di Sistemi e Informatica, University of Florence
Applicazione SymTorrent:
Adattamento al download sequenziale
Riproduzione
del concetto di finestra di segmenti:
 La
L di
dimensione
i
ottimale
tti l della
d ll
finestra deve rispettare la
seguente equazione



w
= n° blocchi nella finestra
d
= playback delay (secondi)
b
= BitRate file (Kb/s)
c
= dimensione blocco in byte
Estrazione del BitRate dall’header
del file (formato WAVE e MP3);
Uso della rarest first policy nella
finestra;
Gestito lo spostamento della
finestra;
download
non
sequenziale
(SymTorrent
originale)
download
sequenziale
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
143
Implementazione:
Multimedia Streaming

Creata un’interazione tra le applicazioni: garantita la
contemporaneità dei servizi forniti dalle due

La strategia di buffering implementata fornisce all’utente una stima
del tempo di attesa necessario per garantire una riproduzione fluida
del media:
La formula w = d*b garantisce la riproduzione dei primi d secondi
c
Terminati i d secondi, è necessario rispettare la relazione
DR = velocità media di download del
file dalla rete
S = secondi necessari a scaricare i
w blocchi successivi
d
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
144
Sistemi Distribuiti, Prof. Paolo Nesi
71
Dipartimento di Sistemi e Informatica, University of Florence
Bibliography




progetto Jxta ( http://www.jxta.org )
progetto MyJxta2 ( http://myjxta2.jxta.org )
NetBeans & NetBeans IDE
( http://www.netbeans.org/ )
Bernard Traversa, Project JXTA 2.0 SuperSuper-Peer
Virtual Network,
Network, Maggio 2003.

http://www.p2ptoolkit.com (al momento è down)

Brendon J. Wilson, Jxta, Giugno 2002
( http://www.brendonwilson.com/projects/jxta )
AXMEDIS P2P solution extending BitTorrent

 www.axmedis.org
Sistemi Distribuiti, Univ. Firenze, Paolo Nesi 2008-2009
145
Sistemi Distribuiti, Prof. Paolo Nesi
72