![Page 1: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/1.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/2.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/3.jpg)
Client/Server Model
![Page 4: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/4.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/5.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/6.jpg)
P2P Model
![Page 7: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/7.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/8.jpg)
Centralized P2P Networks
![Page 9: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/9.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/10.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/11.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/12.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/13.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/14.jpg)
Pure P2P Networks
![Page 15: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/15.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/16.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/17.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/18.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/19.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/20.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/21.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/22.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/23.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/24.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/25.jpg)
Hybrid P2P Networks
![Page 26: Peer-to-Peer Networks João Guerreiro Truong Cong Thanh Department of Information Technology Uppsala University](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/26.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/27.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/28.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/29.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/30.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/31.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/32.jpg)
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](https://reader030.vdocument.in/reader030/viewer/2022032703/56649d2b5503460f94a002ec/html5/thumbnails/33.jpg)
THE END