28
Peer to Peer Protocol CISC-856 TCP/IP & Upper Layer Protocols Abuthahir November 25, 2008 Acknowledgements Prof. Paul Amer Kurose and Ross

Peer to Peer Protocol

  • Upload
    kapila

  • View
    78

  • Download
    2

Embed Size (px)

DESCRIPTION

Gnutella. CISC-856 TCP/IP & Upper Layer Protocols. Peer to Peer Protocol. Abuthahir November 25, 2008. Acknowledgements Prof. Paul Amer Kurose and Ross. What is Gnutella?. Gnutella is a protocol for distributed search Each node in a Gnutella network acts as both a client and server - PowerPoint PPT Presentation

Citation preview

Page 1: Peer to Peer Protocol

Peer to Peer Protocol

CISC-856 TCP/IP & Upper Layer Protocols

Abuthahir

November 25, 2008

Acknowledgements

Prof. Paul Amer

Kurose and Ross

Page 2: Peer to Peer Protocol

Client Server

Peer to Peer

1.Resources are shared between the peers

2.Resources can be accessed directly from the peers

3.Peer is provider and requestor.

1.Server is the central

entity and only provider

of service and content.

2.Server as the higher

performance system.

3.Clients as the lower

performance system.

Ex: WWW

Centralized P2P1.All features of

Peer to Peer

included.

2.Central entity is

necessary to

provide the service.

3.Central entity is

some kind of

index/group

database.

Ex: Napster

Pure P2P1.All features of Peer to Peer included.

2.Any terminal entity can be removed without loss of functionality

No central entities.

Ex: Gnutella 0.4

Hybrid P2P1.All features of Peer

to Peer included.

2.Any terminal entity

can be removed

without loss of

functionality.

-dynamic central entities

Ex: Gnutella 0.6, JXTA

DHT Based P2P1.All features of Peer

to Peer included.

2.Any terminal entity

can be removed

without loss of

functionality

-no central entity

3.Connections in the

overlay are “fixed”

Ex: Chord,CAN

Page 3: Peer to Peer Protocol

What is Gnutella?

• Gnutella is a protocol for distributed search

• Each node in a Gnutella network acts as both a client and server

• Nodes are called “Servents” (Server and Client)

• Peer to Peer, decentralized model for file sharing

• Any type of file can be shared

Page 4: Peer to Peer Protocol

Peer Discovery

• IP addresses of a peer in Gnutella network:

- GWebCache server

-Host Cache File

IP Addresses

List of IP addresses

Page 5: Peer to Peer Protocol

Peer A Peer B

SYN

SYN + ACK

ACK

TCP Connection Established

TCP Connection Established

GNUTELLA CONNECT/0.4 <CR> <LF>

GNUTELLA/0.4 OK <CR> <LF>

GNUTELLA/0.4 OK <CR> <LF>

Gnutella Connection Established

Gnutella Connection Established

Gnutella Connection

Page 6: Peer to Peer Protocol

Flooding

• Node forwards Ping and Query descriptors (Gnutella PDUs) to all nodes connected to it

• Except:1. If descriptor’s TTL is decremented

to 02. Descriptor has already been

received before - Loop detection is done by storing Descriptor ID’s

• Pong and QueryHit descriptors retrace the exact path of their respective Ping and Query descriptors

Page 7: Peer to Peer Protocol

Peer A Peer B Peer C

PING

PING

PONG

Peer A learns info related to Peer B

Ping/Pong Routing

PING

PONG

Peer B learns info related to Peer A

PONG

PONG

PINGPING

PONG

PONG

Peer A learns info related to Peer C

Peer C learns info related to Peer A

Peer B updates info related to Peer C

Peer B updates info related to Peer A

Page 8: Peer to Peer Protocol

Ping

Ping

Ping

Pong

Pong

Pong

Pong

Pong

Pong

TTL=2TTL=1

TTL=0

TTL=0

Loop

Detection

Peer APeer B

Peer D

Peer CWhat happens if TTL =4?

Page 9: Peer to Peer Protocol

Querying

• Servent sends Query descriptor to nodes it is connected to.

• Queried Servents check to see if they have the file.

– If query match is found, a QueryHit is sent back to querying node

Page 10: Peer to Peer Protocol

Queryhit

File download

using HTTP

Peer A

Peer C

Peer D

Peer B

Query

Query

QuerhitQuery

Who hasDhoom.mp3

I have Dhoo

m.mp3

Page 11: Peer to Peer Protocol

Peer A

Peer C

Peer D

Peer B

HTTP GET

Incoming Connectio

n is blocked

Push

Push

GIVDownloading…

Firewalled Servents

Page 12: Peer to Peer Protocol

Firewalled Servents

If a servent is behind a firewall, it does not permit incoming connections to its Gnutella port.

The Servent attempting to download sends “push” message to the servent which has sent the query hit message.

The servent on receipt of “push” message, opens a TCP/IP connection and sends the following message:

GIV<File Index>:<Servent Identifier>/<Filename>\n\n

The Servent receives GIV message and sends a HTTP GET message to download the file.

Page 13: Peer to Peer Protocol

Peer A

Peer C

Peer B

Peer D

Bye

Graceful Termination (optional)

Page 14: Peer to Peer Protocol

Gnutella Terminology

• GUID: Short for Global Unique Identifier, a randomized string that is used to uniquely identify a host or message on the Gnutella Network. This prevents duplicate messages from being sent on the network.

• GWebCache: a distributed system for helping servents connect to the Gnutella network, thus solving the "bootstrapping" problem. Servents query any of several hundred GWebCache servers to find the addresses of other servents. GWebCache servers are typically web servers running a special module.

• Host Catcher: Pong responses allow servents to keep track of active gnutella hosts

• On most servents, the default port for Gnutella is 6346

Page 15: Peer to Peer Protocol

Gnutella Messages

Page 16: Peer to Peer Protocol

Gnutella Message Header

Page 17: Peer to Peer Protocol

Gnutella Message Header (Cont.)

Page 18: Peer to Peer Protocol

Ping Descriptor

Page 19: Peer to Peer Protocol

Pong Descriptor

Page 20: Peer to Peer Protocol

Query Descriptor

Page 21: Peer to Peer Protocol

Query Hit Descriptor

Page 22: Peer to Peer Protocol

Query Hit Descriptor (cont.)

Page 23: Peer to Peer Protocol

Push Descriptor

Page 24: Peer to Peer Protocol

Advantages

• Simple Protocol

• No centralized server - no single point of failure - low maintenance overhead

• Anonymity of queries

• Support more flexible queries

Page 25: Peer to Peer Protocol

Disadvantages

• Scales poorly: Querying and Pinging generate a lot of unnecessary traffic

Example:– If TTL = 10 and each site contacts six other sites– Up to 10^6 (approximately 1 million) messages could be

generated.

• Heavy messaging can result in poor performance• Vulnerable to denial-of-service attacks• TTL imposes a horizon• Upload speed << Download speed• Authentication

Page 26: Peer to Peer Protocol

Exploiting heterogeneity: Gnutella 0.6

• Each peer is either a supernode or assigned to a supernode.– TCP connection between

peer and its group leader.– TCP connections between

some pairs of group leaders.

• Supernode tracks the content in all its children.

ordinary peer

group-leader peer

neighoring re la tionshipsin overlay network

Page 27: Peer to Peer Protocol

Gnutella 0.6 : Querying

• On connection client updates,supernode with all the files that the client shares.

• Client sends keyword query to supernode• Supernode responds with matches.• Supernode forwards query to other supernodes• Client then selects files for downloading

Page 28: Peer to Peer Protocol

References

• www9.limewire.com/developer/gnutella_protocol_0.4.pdf

• rfc-gnutella.sourceforge.net/src/rfc-0_6-draft.html

• en.wikipedia.org/wiki/Gnutella

• computer.howstuffworks.com/file-sharing.htm • Text book :Computer Networking: A Top-Down Approach by James F. Kurose, Keith W. Ross