Top Banner
Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University
33

Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Peer-to-Peer Networks

João Guerreiro

Truong Cong Thanh

Department of Information Technology

Uppsala University

Page 2: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Overview

Motivation Centralized Networks Pure P2P Networks Hybrid Networks Distributed Hash Tables

Page 3: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Client/Server Model

Page 4: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Client/Server Model

The server must send a copy of the file to every client.

Excessive use of the server’s bandwidth. The more clients there will be, the more

the time it will take for all the clients to get the file.

Page 5: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

P2P Model

Every client (peer), can send a part of the file that he received to other peers.

Peers help the server distributing the file. Scalable !

Page 6: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

P2P Model

Page 7: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

P2P Model

We will share :

The responsabilities.The costs.

Page 8: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Centralized P2P Networks

Page 9: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Centralized P2P Networks

Presence of a central server. The server knows :

Which files are available.Who has which files.

To find a file it’s necessary to check the server.

The server puts the peers in touch.

Page 10: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Napster

Application for sharing musical files(.mp3). Closed in 2001 for legal reasons. Re opened and became a paying service.

Page 11: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Napster : Login

Peer sends a message to the server, containing its nick and password.

Server check the peer’s identity. Server sends an ACK to the peer. Peer sends to server the list of files he is

willing to share.

Page 12: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Napster : Getting a file

Peer sends a « SEARCH » message to the server.

Server checks its database. Server sends to peer, one or several

« RESPONSE » messages. Peer talks directly with the peer(s) who

have the file.

Page 13: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Napster : Conclusion

We find a file really quickly. If server crashes, the whole system is

down. The more peers, the more « powerful » the

server must be.

Page 14: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Pure P2P Networks

Page 15: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Pure P2P Networks

No central server. To connect, we must connect to peers

already inside.

Page 16: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.4

Gnu + Nutella = Gnutella. Share different types of files

(.jpg, .avi, .mp3, etc).

Page 17: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.4 : Login

If first time, the peer contacts a « startup server ».

Otherwise peer tries to connect to peers he knows from the past.

We connect to a few peers.

Page 18: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.4 : Finding a file

There is no central server. Q : How to know where is the file ? A : We will use flooding.

Page 19: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.4 : Flooding

We flood the network with messages. We send a message to every neighbor. Neighbors will ask their neighbors. Q : When to stop ? A : TTL = 0.

Page 20: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.4 : Time-to-Live (TTL)

Every message has a TTL. We decrease the TTL. TTL(0) = 7, considered enough.

Page 21: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.4 : Descriptor ID

Descriptor ID identifies the message. We keep for a while the received

Decriptor ID’s. Q : What to do if we know the Descriptor

ID of a new received message ? A : We don’t forward it. Goal : Avoid cycles.

Page 22: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.4 : PING & PONG

PING : Useful to explore the network. Lets us know who is alive.

PONG : Answer to a PING Provides IP address + port number. Provides the number of shared files. Provides size of shared files.

Remark : PONG follows the reverse path of PING.

Page 23: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.4 : QUERY & QUERYHIT

QUERY : Used to find a file. QUERYHIT : Answer to QUERY.

Can contain several results.

Remark: As with PING & PONG, QUERYHIT follows the reverse path of QUERY.

Page 24: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.4 : Conclusion

No central server so no crashes. Cannot be closed down.

A lot of generated traffic. We are not sure to find a file.

Page 25: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Hybrid P2P Networks

Page 26: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Hybrid P2P Networks

No central server. Hierarchical network. There will be Superpeers. Superpeers are the most powerful.

Page 27: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.6

Necessary update due to the crash. We keep the PING, PONG, QUERY and

QUERYHIT messages. New : Routing Tables.

Page 28: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.6 : Routing Tables

Each peer has one. When we connect to a Superpeer we send

a ROUTE TABLE UPDATE message. With this message, the peer informs the

Superpeer, which files he shares.

Page 29: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.6 : Network of Layers

Superpeers will be connected to other Superpeers.

Superpeers send frequently PINGs to other Superpeers.

When a « leaf » of a Superpeer sends a PING, the Superpeer answers with PONGs received previously.

Page 30: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Gnutella 0.6 : Conclusion

We decreased the traffic :Messages reach a wider number of peers,

efficiently. Superpeers « protect » their leafs from

PINGs.

Page 31: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Is this all ?

New type of system : Distributed Hash Tables (DHT)

Every peer is equal. Decentralized. Distributed indexing. Every node has an id. We find a file with an unique key. We find files faster. If a file exists, we alway find it.

Page 32: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

Want to know more ?

Andy Oram (Ed). Peer-to-Peer : Harnessing the Benefits of a Disruptive Technology. O’Reilly, 2001.

Ralf Steinmetz, Klaus Wehrle (Eds). Lecture Notes in Computer Science - Peer-to-Peer Systems and Applications. Springer, 2005.

Page 33: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University.

THE END