A peer to peer idea - pseudocode
D3scr1p2p specification
2 types of entities occupy the d3scr1p2p network:
Angel
This entity has the server role on the network; it gathers connected peers and releases them to other peers. Angels are advertised in various websites upon connection automatically.
The Angels work like a straight matrix; they have a capacity of 300 connected peers. Each connection attempt by a certified d3sentity is recorded in a log. The last 3 entities recorded before the connection to a 4th entity are sent to this 4th entity. When log reaches 301 the last entry is deleted so that the number of entities in the log stays at 300
The only commands the Angel supports is: hello and an identifier.
Command hello, initiates the connection between the entity and the Angel. The Angel at this point records the entity’s Ip Address.
The Identifier command can be anything, but for the d3scr1p2p network especially, would be: d3s* where * could be C, G, and E for Chaos, Gaia and Eros respectively (The three primordial elements of the d3scr1p2p network.)
The Angel will then record the identifier class letter in an xml document with an attribute: the Ip address of the entity.
This Hierarchy and the xml document will allow for future improvements of the Angel, the entities, or creation of other p2p networks based on the Angels. Each Angel will have of course the choice of the p2p network to serve.
Element
Three primordial elements exist in the d3scr1p2p network, as mentioned above:
Chaos, Gaia and Eros.
Chaos would a peer that shares something more than 100G of data in the network and is willing not to move his files very often and has a good connection
Gaia would be a regular peer that values file sharing although for some reason he is not sharing so much, but he is willing to share less than 100G of data
Eros will be a freelancer, a lecher, his only contribution will be to share the file he is currently downloading and share entities’ Ip addresses.
Independent of their classification, elements will have some common... Elements and they could change the mode of their client application whenever they want, if permitted by the above rules.
The d3sElement, the d3scr1p2p client, would connect to a source of Angels, and connect to three of them simultaneously or one by one depending on his machine.
It will then initiate a connection; say hello, send identifier, and wait for the three peers from the Angel. Then proceed to the next Angel. This would give him 9 elements to connect to. It will send hello to the elements to see if the exist. If not he will keep contacting new angels until he always has 9 working elements.
Each element, upon request using the command: elements would give the requester his current list of recorded elements starting from his current nine, and then proceeding to elements from previous sessions after testing them for integrity if needed.
When an element has enough elements, it will be in a ready state, ready to make searches.

0 Comments:
Post a Comment
<< Home