Skip to content

Commit

Permalink
added protocol text doc
Browse files Browse the repository at this point in the history
  • Loading branch information
visskiss committed Dec 19, 2010
1 parent 9a8e5b9 commit 3953ac4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions protocol/The Pig Protocol.txt
@@ -0,0 +1,8 @@
The Pig ProtocolBackground__________
The PIG protocol is a protocol which allows for automatic organization and messaging of peers on the internet. A peer is a single instance or application which responds appropriately to the PIG protocol.
Assumptions
___________The PIG protocol relies on several assumptions.1. A Peer is capable of responding to requests on a certain arbitrary port. This port is the main �listening port�. A peer requires at least one listening port, otherwise it becomes an �Edge Peer�. Edge Peer�s functionality is a subset of a full Pig Peer functionality.2. A Peer has at it�s disposal a list of recently connected peers. When a Peer starts up, this list of peers is recalled and used to initiate it�s joining of the network. 2.1 How this list is maintained is outside the scope of the PIG protocol.2.2 The PIG protocol can provide via interface a way of retrieving currently connected peers at any time. This will allow the service responsible for maintaining a peer list a way of updating this list.Network Organization
____________________The network is organized into Upstream and Downstream. Upstream indicates that an upstream Peer MUST be able to listen to incoming requests from the downstream peer. Downstream indicates only that a downstream peer may make a request to an Upstream peer. A downstream peer does not necessarily need to be able to listen to requests from an Upstream peer.A peer can have an arbitrary number of upstream and downstream connections depending on its capabilities and bandwidth. How a Peer chooses the number of connections it may have is up to the peer itself.A peer MUST allow at least one downstream connection. If such a connection is impossible, the peer is considered an Edge peer.A peer MUST have at least one upstream connection in order to consider itself on the network.A Peer is able to organize itself into the current peer network using the available list of Peers. To do this, each Peer must respond to certain requests.

Requests
________A Peer MUST reply to a join request from another peer. This is a priority request. It MUST reply in the affirmative if it can accept the requesting peer into it's downstream connections. If a Peer does not receive any such requests (such as inability to communicate). It is a de-facto Edge Peer.A Peer MUST provide a list of Peers to which it is connected upon request. The list of peers is separated into downstream and upstream peers and MUST include any relevant information required for the requesting peer to make connections to these peers itself (ie IP address and port). This is a priority request.A Peer MAY...
Expand Down

0 comments on commit 3953ac4

Please sign in to comment.