1 telematica di base applicazioni p2p. 2 the peer-to-peer system architecture peer-to-peer is a...

34
1 Telematica di Base Applicazioni P2P

Upload: celestina-roberti

Post on 03-May-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

1

Telematica di BaseTelematica di Base

Applicazioni P2P Applicazioni P2P

Page 2: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

2

The Peer-to-Peer System Architecture

The Peer-to-Peer System Architecture

peer-to-peer is a network architecture where computer resources and services are direct exchanged between computer systems.

In such an architecture, computers that have traditionally been used solely as clients communicate directly among themselves and can act as both clients and servers, assuming whatever role is most efficient for the network.

http://www.peer-to-peerwg.org/whatis/index.html

peer-to-peer is a network architecture where computer resources and services are direct exchanged between computer systems.

In such an architecture, computers that have traditionally been used solely as clients communicate directly among themselves and can act as both clients and servers, assuming whatever role is most efficient for the network.

http://www.peer-to-peerwg.org/whatis/index.html

Page 3: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

3

Definition of P2P Definition of P2P

“P2P is a way of structuring distributed applications such that the individual nodes have symmetric roles. Rather than being divided into clients and servers each with quite distinct roles, in P2P applications a node may act as both a client and a server.”Excerpt from the Charter of Peer-to-Peer research Group,

IETF/IRTF, June 24, 2003

“P2P is a way of structuring distributed applications such that the individual nodes have symmetric roles. Rather than being divided into clients and servers each with quite distinct roles, in P2P applications a node may act as both a client and a server.”Excerpt from the Charter of Peer-to-Peer research Group,

IETF/IRTF, June 24, 2003

Page 4: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

4

P2PP2P In the peer-to-peer paradigm, the participating

processes play equal roles, with equivalent capabilities and responsibilities (hence the term “peer”).

Each participant may issue a request to another

participant and receive a response.

In the peer-to-peer paradigm, the participating processes play equal roles, with equivalent capabilities and responsibilities (hence the term “peer”).

Each participant may issue a request to another

participant and receive a response.process 1

request

response

request

response

process 2

Page 5: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

5

P2PP2P

The peer-to-peer paradigm is appropriate for applications such as instant messaging, peer-to-peer file transfers, video conferencing, and collaborative work.

The peer-to-peer paradigm is appropriate for applications such as instant messaging, peer-to-peer file transfers, video conferencing, and collaborative work.

Page 6: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

6

Page 7: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

7

P2P file sharingP2P file sharing

Alice runs P2P client application on her notebook computer

Intermittently connects to Internet; gets new IP address for each connection

Asks for “Hey Jude” Application displays other peers that have copy of Hey Jude.

Alice runs P2P client application on her notebook computer

Intermittently connects to Internet; gets new IP address for each connection

Asks for “Hey Jude” Application displays other peers that have copy of Hey Jude.

Alice chooses one of the peers, Bob.

File is copied from Bob’s PC to Alice’s notebook: HTTP GET

While Alice downloads, other users uploading from Alice.

Alice’s peer is both a Web client and a transient Web server.

All peers are servers = highly scalable!

Alice chooses one of the peers, Bob.

File is copied from Bob’s PC to Alice’s notebook: HTTP GET

While Alice downloads, other users uploading from Alice.

Alice’s peer is both a Web client and a transient Web server.

All peers are servers = highly scalable!

Page 8: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

8

P2P: directory centralizzata

P2P: directory centralizzata

NAPSTER1) Quando un peer si connette alla rete si collega ad un server centralizzato: Indirizzo IP Informazione condivisa

2) Alice effettua una query per trovare “Hey Jude”

3) Alice scarica il file da Bob

NAPSTER1) Quando un peer si connette alla rete si collega ad un server centralizzato: Indirizzo IP Informazione condivisa

2) Alice effettua una query per trovare “Hey Jude”

3) Alice scarica il file da Bob

centralizeddirectory server

peers

Alice

Bob

1

1

1

12

3

Page 9: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

9

DiscussioneDiscussione

Singolo punto di fallimento

Performance limitata

Copyright ….

Singolo punto di fallimento

Performance limitata

Copyright ….

Due aspetti

a) Trasferimento dei files: distribuito

b) La localizzazione dell’informazione e’ centralizzata

Due aspetti

a) Trasferimento dei files: distribuito

b) La localizzazione dell’informazione e’ centralizzata

Page 10: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

10

GnutellaGnutella

Distribuito: Non esiste un server globale

public domain

Distribuito: Non esiste un server globale

public domainoverlay network: una struttura a grafo

Nodi sono i peerEsiste un arco tra X e Y se esiste una connessione TCP tra X e Y

Rete overlay = peer attivi e le loro connessioni

Tipicamente ogni nodo ha 10 vicini (al massimo)

overlay network: una struttura a grafo

Nodi sono i peerEsiste un arco tra X e Y se esiste una connessione TCP tra X e Y

Rete overlay = peer attivi e le loro connessioni

Tipicamente ogni nodo ha 10 vicini (al massimo)

Page 11: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

11

Page 12: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

12

GnutellaGnutella

Le query sono trasmesse sulle con. TCP

Query Forward: peers inoltrano i msg nella rete overlay

QueryHit : risposta alla query lungo il cammino “inverso” della rete overlay

Le query sono trasmesse sulle con. TCP

Query Forward: peers inoltrano i msg nella rete overlay

QueryHit : risposta alla query lungo il cammino “inverso” della rete overlay

Page 13: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

13

GnutellaGnutella

Query

QueryHit

Query

Query

QueryHit

Query

Query

QueryHit

File transfer:HTTP GET

Page 14: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

14

Gnutella: Peer joiningGnutella: Peer joining

1. Joining peer X must find some other peer in Gnutella network: use list of candidate peers

2. X sequentially attempts to make TCP with peers on list until connection setup with Y

3. X sends Ping message to Y; Y forwards Ping message.

4. All peers receiving Ping message respond with Pong message

5. X receives many Pong messages. It can then setup additional TCP connections

1. Joining peer X must find some other peer in Gnutella network: use list of candidate peers

2. X sequentially attempts to make TCP with peers on list until connection setup with Y

3. X sends Ping message to Y; Y forwards Ping message.

4. All peers receiving Ping message respond with Pong message

5. X receives many Pong messages. It can then setup additional TCP connections

Page 15: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

15

Gnutella: Query flooding

Gnutella: Query flooding

Query sono inviate ai viciniQuery forwardingSe l’oggetto viene trovato il riferimento è inviato direttamente al peer di partenza

Query sono inviate ai viciniQuery forwardingSe l’oggetto viene trovato il riferimento è inviato direttamente al peer di partenza

join

Page 16: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

16

Gnutella: caratteristiche innovative

Gnutella: caratteristiche innovative

overlay networkpeer sono i nodiconnessioni tra peer

Rete virtualebootstrap nodeun peer che si connette (peer join) deve individuare un peer nella overlay net

overlay networkpeer sono i nodiconnessioni tra peer

Rete virtualebootstrap nodeun peer che si connette (peer join) deve individuare un peer nella overlay net

vantaggiNon è presente una directory centralizzataIl servizio di localizzazione è distribuito tra i peer

svantaggiQuery flooding

TTL per delimitare il raggio di azione della query

vantaggiNon è presente una directory centralizzataIl servizio di localizzazione è distribuito tra i peer

svantaggiQuery flooding

TTL per delimitare il raggio di azione della query

Page 17: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

17

KaZaAKaZaA

Strutturazione dei peer Peer = group leader o e’ associato a un group leader.

TCP con Peer -- Group leader

TCP cons tra coppie di group leader.

Group leader: sono una sorta di directory centralizzata per i peer associati al gruppo.

Strutturazione dei peer Peer = group leader o e’ associato a un group leader.

TCP con Peer -- Group leader

TCP cons tra coppie di group leader.

Group leader: sono una sorta di directory centralizzata per i peer associati al gruppo.

ordinary peer

group-leader peer

neighoring relationshipsin overlay network

Page 18: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

18

Page 19: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

19

KaZaA: QueryingKaZaA: Querying

Each file has a hash and a descriptorClient sends keyword query to its group leader

Group leader responds with matches: For each match: metadata, hash, IP address

If group leader forwards query to other group leaders, they respond with matches

Client then selects files for downloadingHTTP requests using hash as identifier sent to peers holding desired file

Each file has a hash and a descriptorClient sends keyword query to its group leader

Group leader responds with matches: For each match: metadata, hash, IP address

If group leader forwards query to other group leaders, they respond with matches

Client then selects files for downloadingHTTP requests using hash as identifier sent to peers holding desired file

Page 20: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

20

Page 21: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

21

P2P Communications: IMP2P Communications: IM

Istant MessagingServer centrale con la buddy list

Utente si connette al serverChatting among peersServer centralizzato

Soluzione a la Napster

Istant MessagingServer centrale con la buddy list

Utente si connette al serverChatting among peersServer centralizzato

Soluzione a la Napster

Page 22: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

22

P2P CommunicationsP2P Communications

Skype: Internet Telephony SoftwarePermette di effettuare chiamate telefoniche su internetReti telefoniche raggiungibili via internet

Progettato da chi ha progettato KaZaA

Architettura simile a KaZaA

Skype: Internet Telephony SoftwarePermette di effettuare chiamate telefoniche su internetReti telefoniche raggiungibili via internet

Progettato da chi ha progettato KaZaA

Architettura simile a KaZaA

Page 23: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

23

SkypeSkype

Applicazione proprietaria: non sono disponibili dettagli tecnici

Alcune informazioniServer centrale per “billing”GroupLeader come KaZaA

Funzionalita’ similariServizio di directory per gli utenti on-line

Applicazione proprietaria: non sono disponibili dettagli tecnici

Alcune informazioniServer centrale per “billing”GroupLeader come KaZaA

Funzionalita’ similariServizio di directory per gli utenti on-line

Page 24: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

24

SkypeSkype

VantaggiDiminuzione dei costiQualita’ elevata della comunicazione

Efficienza nella trasmissione e codifica del segnale sonoro

VantaggiDiminuzione dei costiQualita’ elevata della comunicazione

Efficienza nella trasmissione e codifica del segnale sonoro

Page 25: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

25

P2P CollaborationP2P Collaboration

Condivisione delle risorse Esempio: enciclopedia on line: wikipediaScrittura individualeModifiche individualiGuida on line

Condivisione delle risorse Esempio: enciclopedia on line: wikipediaScrittura individualeModifiche individualiGuida on line

Page 26: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

26

P2P EmailP2P Email

Il servizio di email su internet

Mailserver (mailbox utenti)POP3 -- Post Office ProtocolIMAP -- Internet Mail Access Protocol

Il servizio di email su internet

Mailserver (mailbox utenti)POP3 -- Post Office ProtocolIMAP -- Internet Mail Access Protocol

Page 27: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

27

EmailEmailTre componenti: user agent mail server simple mail transfer

protocol: smtp

User Agent Funzionalità: per

leggere, editare ed inviare mail

Eudora, Outlook, Pine, MacMail

Messaggi sono memorizzati nel server

Tre componenti: user agent mail server simple mail transfer

protocol: smtp

User Agent Funzionalità: per

leggere, editare ed inviare mail

Eudora, Outlook, Pine, MacMail

Messaggi sono memorizzati nel server

user mailbox

outgoing message queue

mailserver

useragent

useragent

useragent

mailserver

useragent

useragent

mailserver

useragent

SMTP

SMTP

SMTP

Page 28: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

28

E-Mail: mail serverE-Mail: mail server

Mail Server mailbox contiene i msg non ancora letti degli utenti

message coda dei msg da inviare

Smtp: protocollo di comunicazione tra i mail server

Mail Server mailbox contiene i msg non ancora letti degli utenti

message coda dei msg da inviare

Smtp: protocollo di comunicazione tra i mail server

mailserver

useragent

useragent

useragent

mailserver

useragent

useragent

mailserver

useragent

SMTP

SMTP

SMTP

Page 29: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

29

Scenario: Alice e Bob Scenario: Alice e Bob 1) Alice invia una e-

mail a [email protected]) Messsaggio è

inserito nella coda del mail server

3) SMTP (lato cliente) apre una connessione TCP con il mail server di Bob

1) Alice invia una e-mail a [email protected]

2) Messsaggio è inserito nella coda del mail server

3) SMTP (lato cliente) apre una connessione TCP con il mail server di Bob

4) SMTP (lato cliente) trasmette il messaggio di Alice sulla connessione TCP

5) Il mailserver di Bob memorizza il messaggio nella mailbox di Bob

6) Bob legge il messaggio tramite il suo user agent (usando POP3 o IMAP)

4) SMTP (lato cliente) trasmette il messaggio di Alice sulla connessione TCP

5) Il mailserver di Bob memorizza il messaggio nella mailbox di Bob

6) Bob legge il messaggio tramite il suo user agent (usando POP3 o IMAP)

useragent

mailserver

mailserver user

agent

1

2 3 4 56

Page 30: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

30

Page 31: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

31

Page 32: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

32

Page 33: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

33

Page 34: 1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services

34