Docsity

Peer-to-Peer - Computer Network Systems - Lecture Slides, Slides of Computer Networks

Partial preview of the text

Download Peer-to-Peer - Computer Network Systems - Lecture Slides and more Slides Computer Networks in PDF only on Docsity!

Lecture 10

Peer-to-Peer (p2p)

Goals of Today’s Lecture

Scalability in distributing a large file

Single server and N clients

Peer-to-peer system with N peers

Searching for the right peer

Central directory (Napster)

Query flooding (Gnutella)

Hierarchical overlay (Kazaa)

BitTorrent

Transferring large files

Preventing free-riding

Client-Server Communication

  • Client “sometimes on”
    • Initiates a request to the server when interested
    • E.g., Web browser on your laptop or cell phone
    • Doesn’t communicate directly with other clients
    • Needs to know the server’s address - Server is “always on” - Services requests from many client hosts - E.g., Web server for the www.unr.edu Web site - Doesn’t initiate contact with the clients - Needs a fixed, well-known address

Server Distributing a Large File

d 1

F bits

d 2

d 3

d 4

upload rate us

Download rates di

Internet

Speeding Up the File Distribution

Increase the upload rate from the server

Higher link bandwidth at the one server Multiple servers, each with their own link Requires deploying more infrastructure

Alternative: have the receivers help

Receivers get a copy of the data And then redistribute the data to other receivers To reduce the burden on the server

Peers Help Distributing a Large File

d 1

F bits

d 2

d 3

d 4

upload rate us

Download rates di

Internet

u 1 u 2 u^3

u 4

Upload rates ui

Comparing the Two Models

• Download time

  • Client-server: max { NF/u (^) s, F/d (^) min}
  • Peer-to-peer: max{F/u (^) s, F/d (^) min, NF/(u (^) s+sum (^) i (u (^) i ))}

• Peer-to-peer is self-scaling

  • Much lower demands on server bandwidth
  • Distribution time grows only slowly with N

• But…

  • Peers may come and go
  • Peers need to find each other
  • Peers need to be willing to help each other

Challenges of Peer-to-Peer

Peers come and go

Peers are intermittently connected

May come and go at any time

Or come back with a different IP address

How to locate the relevant peers?

Peers that are online right now

Peers that have the content you want

How to motivate peers to stay in system?

Why not leave as soon as download ends?

Why bother uploading content to anyone else?

Peer-to-Peer Networks: Napster

 Napster history: the rise  January 1999: Napster version 1.  May 1999: company founded  December 1999: first lawsuits  2000: 80 million users  Napster history: the fall  Mid 2001: out of business due to lawsuits  Mid 2001: dozens of P2P alternatives that were harder to touch, though these have gradually been constrained  2003: growth of pay services like iTunes

 Napster history: the resurrection  2003: Napster name/logo reconstituted as a pay service

Shawn Fanning, Northeastern freshman

Napster Technology: Directory Service

  • User installing the software
    • Download the client program
    • Register name, password, local directory, etc.
  • Client contacts Napster (via TCP)
    • Provides a list of music files it will share
    • … and Napster’s central server updates the directory
  • Client searches on a title or performer
    • Napster identifies online clients with the file
    • … and provides IP addresses
  • Client requests the file from the chosen supplier
    • Supplier transmits the file to the client
    • Both client and supplier report status to Napster

Napster: Limitations of Central Directory

  • Single point of failure
  • Performance bottleneck
  • Copyright infringement
  • So, later P2P systems were more distributed
    • Gnutella went to the other extreme…

File transfer is decentralized, but locating content is highly centralized

Peer-to-Peer Networks: Gnutella

  • Gnutella history
    • 2000: J. Frankel & T. Pepper released Gnutella
    • Soon after: many other clients
      • e.g., Morpheus, Limewire, Bearshare
    • 2001: protocol enhancements, e.g., “ultrapeers”
  • Query flooding
    • Join : contact a few nodes to become neighbors
    • Publish : no need!
    • Search : ask neighbors, who ask their neighbors
    • Fetch : get file directly from another node

Gnutella: Protocol

 Query message sent over existing TCP connections

 Peers forward Query message

 QueryHit sent over reverse path

Query QueryHit

Query QueryHit

File transfer: HTTP

Scalability: limited scope flooding

Gnutella: Peer Joining

Joining peer X must find some other peers

Start with a list of candidate peers

X sequentially attempts TCP connections with peers

on list until connection setup with Y

X sends Ping message to Y

Y forwards Ping message.

All peers receiving Ping message respond with Pong

message

X receives many Pong messages

X can then set up additional TCP connections