P2Psockets and Decentralized Collaborative Communities

Posted: September 18th, 2003 | No Comments »

p2psockets is an very interesting reimplementation of standard Java sockets on top of JXTA. Standard TCP/IP sockets and server sockets are theoretically peer-to-peer but in practice are not due to firewalls. The P2P Sockets project deals with these issues by re-implementing the standard Java classes on top of the JXTA. P2P Sockets effectively hides Jxta by creating a thin illusion that the peer-to-peer network is actually a standard TCP/IP network. If a peer wishes to become a server they simply create a P2P server socket with the domain name they want and the port other peers should use to contact them. P2P clients open socket connections to hosts that are running services on given ports. Hosts can be resolved either by domain name, such as “www.nike.laborpolicy”, or by IP address, such as “44.22.33.22″. Behind the scenes these resolve to JXTA primitives rather than being resolved through DNS or TCP/IP. For example, the host name “www.nike.laborpolicy” is actually the NAME field of a Jxta Peer Group Advertisement. P2P sockets and server sockets work exactly the same as normal TCP/IP sockets and server sockets.

The P2P Sockets project already includes a large amount of software ported to use the peer-to-peer network, including a web server (Jetty) that can receive requests and serve content over the peer-to-peer network; a servlet and JSP engine (Jetty and Jasper) that allows existing servlets and JSPs to serve P2P clients; an XML-RPC client and server (Apache XML-RPC) for accessing and exposing P2P XML-RPC endpoints; an HTTP/1.1 client (Apache Commons HTTP-Client) that can access P2P web servers; a gateway (Smart Cache) to make it possible for existing browsers to access P2P web sites; and a WikiWiki (JSPWiki) that can be used to host WikiWikis on your local machine that other peers can access and edit through the P2P network.

Paper Airplaine, a vision of a Mozilla plugin that helps creating collaborative communities without setting up servers should be bbased on p2psockets.