Peer to Peer Protocol

Preview:

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

Peer to Peer Protocol

CISC-856 TCP/IP & Upper Layer Protocols

Abuthahir

November 25, 2008

Acknowledgements

Prof. Paul Amer

Kurose and Ross

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

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

Peer Discovery

• IP addresses of a peer in Gnutella network:

- GWebCache server

-Host Cache File

IP Addresses

List of IP addresses

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

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

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

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?

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

Queryhit

File download

using HTTP

Peer A

Peer C

Peer D

Peer B

Query

Query

QuerhitQuery

Who hasDhoom.mp3

I have Dhoo

m.mp3

Peer A

Peer C

Peer D

Peer B

HTTP GET

Incoming Connectio

n is blocked

Push

Push

GIVDownloading…

Firewalled Servents

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.

Peer A

Peer C

Peer B

Peer D

Bye

Graceful Termination (optional)

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

Gnutella Messages

Gnutella Message Header

Gnutella Message Header (Cont.)

Ping Descriptor

Pong Descriptor

Query Descriptor

Query Hit Descriptor

Query Hit Descriptor (cont.)

Push Descriptor

Advantages

• Simple Protocol

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

• Anonymity of queries

• Support more flexible queries

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

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

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

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

Recommended