Peer-To-Peer Network (Week 3, Lec-7,8 and 9)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Peer-to-Peer Network

Shah Khalid
A-212
SEECS Faculty Block
Last Lecture

● Overlay Network

○ Structured and Unstructured Overlay Network

● Peer to Peer Systems

● Chord

○ DHT

○ How to create DHT

○ Search, join and Leaving in P2P structured overlay Network

○ Alert- Next Class Quiz


2
Today- Content Distributed Systems

Overview of deployed P2P systems


❏ Centralized Index
❏ Napster

❏ Query Flooding
❏ Gnutella

❏ Intelligent Query Flooding


❏ KaZaA

❏ Swarming
❏ BitTorrent

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
Unstructured 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
Napster -The Lookup Problem

6
Napster: How it Worked
 Napster was based on a central index server
 Actually a server farm
 User registers with the central server
 Give list of files to be shared
 Central server know all the peers and files in network

 Searching based on keywords


 Search results were a list of files with information about the file and the peer sharing it
 For example, encoding rate, size of file, peer’s bandwidth
 Some information entered by the user, hence unreliable

7
Napster: Queries 1. Peers register with
Content index: central server, give list of
Server farm files to be shared
1.
2. Peers send queries to
1. central server which has
content index of all files
1.
3. File transfers happen
2. directly between peers

3. Last point is common to all


P2P networks and is their
main strength as it allows
them to scale well
8
P2P: Napster

9
P2P: Napster

10
Napster: Strengths

 Consistent view of the network


 Central server always knows who is there and who is not
 Fast and efficient searching
 Central server always knows all available files
 Efficient searching on the central server
 Answer guaranteed to be correct
 “Nothing found” means none of the current on-line peers in the
network has the file

11
Napster: Weaknesses

 Central server is a single point of failure


 Both for network attacks…
-as well as all kinds of attacks
 Ultimately this was a big factor in the demise of Napster
 Central server needs enough computation power to handle all queries
 How, Google handles a lot more…….?
 This weakness can be solved with money, by adding hardware

12
Napster: Weaknesses

 Results unreliable
 No guarantees about file contents (as in most P2P networks)

 Some information (e.g., user bandwidth) entered by the user, not


guaranteed to be even close to correct (i.e., not measured)

13
Gnutella – Unstructured P2P System

14
Gnutella – Unstructured P2P System
❏ No central server
❏ Gnutella software on your machine
❏ Need to know at least one Node on network
❏ Query distributed among all the peers
❏ TTL limit placed on query

15
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

16
Gnutella

17
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.

18
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 >

19
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

20
Gnutella - Packet HEADER

21
Gnutella
❏ disadvantages
❏ No guarantee of file availability

❏ Your machine is a part of

network, generating reply and


consume bandwidth

22
Gnutella VS Napster

Similarities
1. Users place the files they want to share on their hard disks and make
them available to everyone else for downloading in peer-to-peer fashion.
2. Users run a piece of Gnutella software to connect to the Gnutella network.

Differences
1. No central database
2. Many different client applications available to access the Gnutella
network……. LimeWire , Morpheus, Gnucleus and many more…
Because of both of these features, it would be difficult for a simple
court order to shut Gnutella down.
23
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

24
KaZaA

❏ Every time the user launches the Kazaa


application - computer registers with the
Kazaa 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

25
BitTorrent
● peer-to-peer content sharing over the Internet.
● The protocol was designed by Bram Cohen in 2001.

26
BitTorrent Terminology

27
How BITTORRNT WORKS?

28
Deployed P2P Systems --What we covered

❏ Chord
❏ Napster
❏ Gunetella
❏ Pastry
❏ Tapestry
❏ Kademlia
❏ KaZaA
❏ Bit-torrent
❏ CAN- Assignement- Explore Yourself

29
Explore Yourself!

Assignment #1

❏ CAN- Content Addressable Network


❏ How CAN maps object-location in P2P networks
❏ Routing in CAN, Joining and Searching
❏ How is it different from Chord -Advantages over Chord

Due Data: 24/02/2022

30

You might also like