Get connected with Jxta

Jxta architect Li Gong explains motivation for new P2P protocol

June 8, 2001-- Project Jxta (pronounced jux-ta), a new protocol for creating peer-to-peer applications, has been one of the most talked-about technologies at this year's JavaOne developers' conference. Sun Microsystems is giving Jxta top billing at the conference and on its Website. In addition, one of the company's top engineers has devoted months of time to create the technology. And yet on April 25, Sun donated the source code to a new open source project, releasing it under an Apache-style open license. Why would Sun do such a thing?

In a standing-room-only session at the JavaOne developer conference on Thursday, Li Gong, Jxta architect and a distinguished engineer at Sun, presented the case for Jxta. In the hour-long session, Li explained why Sun would develop a strategic technology and then give it away, provided an overview of Jxta technology, and gave some examples for potential peer-to-peer applications.

The case for peer-to-peer

The success of peer-to-peer (P2P) applications such as Gnutella and Napster have made P2P the new buzzword. Li explained that peer-to-peer is the next step in the gradual evolution of computing paradigms, following first the client-server and then the Web-based computing models. Problems with the Web, said Li, include the difficulty of finding information, bandwidth bottlenecks, and uneven distribution of processor usage. For example, the most popular Websites strain under their bandwidth and processor loads, while the majority of computers on the Internet sit idle. What if all of that idle processing power and unused bandwidth could be leveraged to solve these problems?

In Web applications, browsers or other applications access data from centralized servers. But Websites can become victims of their own success. The Slashdot effect, where Websites become virtually unreachable because of overwhelming traffic due to a spike in interest, is a term that has entered common parlance.

Peer-to-peer networking prevents these bottlenecks by spreading information distribution, bandwidth usage, and processor utilization across the network. In peer-to-peer applications, every machine is both a client and a server. Each computer running a particular application knows some information and requests data or services from its neighbors, who may either serve the request or pass it on to yet another neighbor. Data storage, processing power, and bandwidth all operate in a totally decentralized way.

In his Jxta talk, Li Gong explained why the Web-based computing model is not sufficient for future networking needs. Li said that, while the world produces two exabytes (2 x 10 18 bytes) of data per year, only 300 terabytes(300 x 10 12 bytes) per year are published. The largest search engine, Google, indexes only 1.3 billion (1.3 x 10 9) pages.

Even though a single fiber's bandwidth has increased by a million-fold since 1975, Web traffic is still congested, particularly for the most popular services. Although Moore's Law (processor speed doubles every 18 months) continues to hold, data centers continue to be computing bottlenecks.

Clearly, the existing Web-based computing model will not scale to handle future information volumes.

Li proposed that peer-to-peer networking optimizes processor utilization, bandwidth, and other resources. He pointed out that "new paradigms don't invalidate old ones." Centralized servers, Li said, are not required in peer-to-peer applications, but may still play an important role. And there will always be a place for traditional "data silo" client/server architectures and Web-based systems. Peer-to-peer simply adds another, highly scalable option.

Sun's motivation for an open source protocol

Given that P2P makes servers unnecessary, and given that Sun Microsystems makes servers, why would Sun want to evangelize peer-to-peer?

Li had four answers to this question. First, Li said that P2P is really just another instance of Sun's vision of the unity of networking and computing. Second, Li quoted Alan Kaye, saying "the best way to predict the future is to invent it... [so] the best way for Sun to move forward is to be part of [P2P]." Sun's goal is to play an active role in developing new technologies.

Third, Sun wants "to keep an open, level, competitive playing field for P2P." As an explanation, Li paraphrased O'Reilly & Associates President Tim O'Reilly's comment in the opening keynote on Wednesday, saying, "Microsoft .Net is all about deciding what they should own, and then [letting] others own the rest, whereas Jxta is about deciding what's so critical that nobody should own [it], and [making] sure that it is free. And that's one of our major purposes [with Jxta]."

And, lastly, said Li, Sun recognizes that there's money to be made in the P2P arena.

Li made it clear that Sun has no intention of trying to control Jxta. "Our approach is not to be the owner ... we want to be the initiator and instigator of this technology. We want the community to own it." Sun opened the source code as a truly open source, Apache-style project on April 25 to encourage collaborative development. "The whole motivation is to really light this fire for the community, and to unite the P2P community around Jxta ... because of the benefits of having one interoperability layer that's used by all."

Sun initiated the Jxta project and contributed the original source base. Sun plans to remain on the Jxta Advisory Council, providing guidance and feedback as the technology matures. Yet Sun's expressed intent is to be simply another contributor -- although an important one -- as well as an adopter and evangelizer, but not an owner of the technology.

Jxta objectives

Jxta is a XML-based wire protocol that enables runtime discovery, federation, and execution of peer-to-peer information services. Jxta's main objectives are interoperability across peer-to-peer systems and independence in platform, transport, and programming language.

Jxta is designed to be programming-language neutral. While the first implementation of Jxta is built on Java, implementations in other languages such as C are currently being developed. This feature mirrors the language-neutrality of Microsoft's proprietary .Net framework, but through an open source, community-based approach.

Jxta is also platform-independent. Any computer capable of communicating over a network and sending XML messages can use Jxta. Mobile devices, servers, desktop computers, and other devices can all communicate and use each other's services by employing Jxta as a hub format.

Jxta is also transport-independent. Describing transport independence, Li said, "We are not at a point where everything is converging on TCP/IP yet. That may happen sometime in the future, [but now] you have multiple network senders. ATM is still there, but you don't talk about it because it's subsumed by TCP/IP. We want to have a virtual layer of communication ... so you are not tied to any particular transport. No matter how the underlying network technology is involved, Jxta is going to be valid."

Jxta technologies

At its core, Jxta technology is a minimal set of wire protocols that comprises the basic functionality necessary for peer-to-peer software development. "We want to figure out the minimum to bootstrap something like this ... and then let the community figure it out," said Li. The Jxta protocol supports concepts such as peers, peer groups, pipes, and advertisements.

A Jxta peer is simply any object capable of communicating over a network using Jxta protocols. Peers can be servers, desktop computers, mobile devices, or even smart cards.

A peer group is a set of associated peers that agree on how to communicate and share information.

Advertisementsare XML messages that a peer can send to other peers, announcing the availability and access methods for a Jxta service.

The basic means of communications in Jxta is a called a pipe,which is a unidirectional, asynchronous messaging channel. Pipes resemble traditional Unix pipes, except they are designed for communication between peers on a network, rather than processes within an operating system. Any sort of data can be sent through a Jxta pipe.

Jxta messages are encoded as XML, so peers written in any programming language can read data from a Jxta pipe, generate output, and write results to another pipe. Pipes can be built to be reliable, secure, or synchronous, as needed. A pipe is an abstract communication channel that is not tied to any particular peer. Pipes are also forwardable: an existing pipe can redirect to another peer, just as one phone number might forward to a different number.

On top of the basic Jxta protocols, Jxta offers additional protocols, among which are:

  • Discovery protocol:Finds services of a particular type and finds out how to connect with them
  • Resolver protocol:Handles bindings between peers, groups, and pipes
  • Information protocol:Finds the status of other peers
  • Membership protocol:Joins and leaves groups or learns what's necessary to do so

Describing types of distributed computing, Li remarked, "Computing isn't about only getting data from the backend. For anything useful, you want to just find it, get it, and use it." The availability of services is important, not where those services happen to be located.

Possible applications

Li outlined several possible future killer applications for P2P. He discussed searching and indexing, where peers in a group could handle search requests and provide search results to other peers. (This is the searching model taken by InfraSearch, which was acquired by Sun Microsystems in March.)

Integrated messaging is a likely candidate for popular P2P applications. Li gave the example of P2P email: why is an email server really necessary? What if someone wanted to send you an email, and could connect directly to your computer and send the email to your machine, wherever you are? The reconnectability of pipes means that your email service pipe could disconnect from your desktop email program when you leave your office, and connect to your wireless device, your pager, or your voice mail.

Yet another application Li discussed was peer-to-peer DNS. If peers in a peer group sometimes access the same Website, they could share a distributed DNS lookup cache, resulting in much less traffic on the centralized DNS server.

Finally, Li demonstrated (in slides) a Jxta application already part of the Jxta distribution: the Jxta shell. The shell operates similarly to a Unix shell, except that the pipes in the Jxta shell are persistent -- they can be reused and reconnected to different Jxta services.


Li concluded his presentation with a quick look at the status of the Jxta community, and some near-term plans. Over 25 organizations are already involved in Jxta development, and there have been 50,000 downloads of Jxta since its release five weeks ago. Li mentioned that this number surpasses the downloads for Java in the same period after its release. Over 2,000 developers have already registered, and 14 projects have been started on Collabnet. C/C++ and Java 2 Platform, Micro Edition implementations are being developed, as are several extensions, including advanced discovery, secure and reliable pipes, naming and authentication services, and shells.

In a question and answer session following the presentation, one participant asked a question on a lot of developer's minds: What about Jini? Some people think that Jxta supersedes Jini, but Li disagrees:

"Jini and Jxta started from different premises. Jini started with the premise that both ends have JVMs (1.3 and upward). So if you depend on both ends having JVMs, there are lots of things you could do. On the other hand, you are also constrained. Of course the surrogate architecture will help Jini to interface with devices that are not fully Jini-compliant. Jxta started with a much lower premise. The only assumption [Jxta makes is that] there's something that implements the protocol. This gives a wider field to play in... [Jini and Jxta] are different but complementary in the sense that it's very easy to imagine Jini being used to provide directories for Jxta networks. People who have Jini and have Java can do more ... you get a maximum return if Java is on both ends; there's no doubt about it."

Another thing about which there is no doubt is that peer-to-peer networking is going to be on everybody's mind this year -- and the Jxta community will be a major player.

Mark Johnsonis a writer, a consultant, and a JavaBeans columnist and XML guru at JavaWorld. His interests include design patterns, structured data representation, software architecture, enterprise data systems, and codeless software development. He is the president of elucify technical communications (etc), a Colorado-based corporation dedicated to clarifying novel or complex ideas through clear explanation and example. His client list currently includes Sun Microsystems, where he is a contract technical writer.

Learn more about this topic