From 3953ac493378c30d484950eafdcc249f783edb7f Mon Sep 17 00:00:00 2001 From: visskiss Date: Sun, 19 Dec 2010 12:28:54 +0100 Subject: [PATCH] added protocol text doc --- protocol/The Pig Protocol.txt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 protocol/The Pig Protocol.txt diff --git a/protocol/The Pig Protocol.txt b/protocol/The Pig Protocol.txt new file mode 100644 index 0000000..99bb3e1 --- /dev/null +++ b/protocol/The Pig Protocol.txt @@ -0,0 +1,8 @@ + The Pig Protocol Background __________ + 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... \ No newline at end of file