You are on page 1of 20

Advanced Distributed

Computing
Peer-to-Peer Network
Reading Assignment
Peer-to-Peer Systems

❏ Centralized Database
❏ Napster

❏ Query Flooding
❏ Gnutella

❏ Intelligent Query Flooding


❏ KaZaA

❏ Swarming
❏ BitTorrent

2
Peer-to-Peer Systems - The Lookup Problem

3
Peer-to-Peer Systems

❏ Common Primitives:
❏ Join: how to I begin participating?

❏ Publish: how do I advertise my file?

❏ Search: how to I find a file?

❏ Fetch: how to I retrieve a file?

4
P2P: Napster
❏ In 1999, S. Fanning launches Napster
❏ Peaked at 1.5 million simultaneous users
❏ Jul 2001, Napster shuts down
❏ At peak, several million users were registered and swapping files
❏ Napster architecture includes centralized indexes
❏ User supplied files from personal computer
❏ Issues - Copyright infringement - Automated way to illegally copy
copyrighted material
❏ Napster was banned in 2001
5
P2P: Napster

6
P2P: Napster

7
Gnutella - First Generation P2P System
❏ No central server
❏ Gnutella software on your machine
❏ Need to know at least one server on network
❏ Query distributed among all the peers
❏ TTL limit placed on query

8
Gnutella

❏ Query Flooding:
❏ Join: on startup, client contacts a few other nodes; these become its
“neighbors”
❏ Publish: no need
❏ Search: ask neighbors, who ask their neighbors, and so on... when/if
found, reply to sender.
❏ Fetch: get the file directly from peer

9
Gnutella

10
Gnutella

❏ Gnutella protocol has 5 main message types


❏ Ping (to probe network for other peers)
❏ Pong (reply to ping, contains address of another peer)
❏ Query (Search for file)
❏ QueryHit (response to query)
❏ Push (download request for firewalled servents)
❏ File transfers are handled using HTTP
❏ Uses “flooding protocol” – speak to all neighbors.
11
Gnutella

❏ Join – ‘Ping’ packet is used to announce your presence on the


network
❏ At least one node should be known to join the network
❏ Ping packet is sent to the known nodes
❏ Other Nodes willing to connect respond with a "Pong" packet.
❏ Also forwards Ping message to other connected peers
❏ A Pong packet also contains <IP address, port number >

12
Gnutella

❏ Search - Query packet is used to search for a file on network


❏ Flood the “Query”
❏ If requested resource found, reply with “QueryHIT” to sender
following the same route
❏ Else send the ‘Query’ message to all the neighbors
❏ TTL (Time to Live) limits propagation

13
Gnutella - Packet HEADER

14
Gnutella

❏ disadvantages
❏ No guarantee of file

availability
❏ Your machine is a part of

network, generating reply


and consume bandwidth

15
Answer the following

❏ In Gnutella, the flooding hogs network bandwidth. Is there any to


reduce bandwidth usage?

❏ To disrupt Napster, simply block the server sites. How can we disrupt
the Gnutella network?

16
KaZaA

❏ Kazaa uses a decentralized system


❏ Kazaa uses the FastTrack protocol
❏ The system divides Kazaa users into two
groups: supernodes and ordinary nodes
❏ Supernodes are powerful computers with
fast network connections, high bandwidth
and quick processing capabilities
❏ Each supernode may serve between 60 and
150 ordinary 17
KaZaA
❏ Every time the user launches the Kazaa
application - computer registers with the
central server and then chooses from a list
of currently active supernodes
❏ The file request is routed through supernode
which further connect with other supernode
❏ Query is forward to other clients through
supernode
❏ File is downloaded directly from source
❏ Typical TTL value used is 7
18
Second Generation P2P System

❏ Lesson learned from Napster and Gnutella leads to a second


generation of P2P systems
❏ Chord
❏ Pastry
❏ Tapestry
❏ Kademlia
❏ KaZaA
❏ Bit-torrent
❏ CAN 19
Explore Yourself!

❏ Bit-torrent

20

You might also like