Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

The Jxta solution to P2P

Sun's new network computing platform establishes a base infrastructure for peer-to-peer application development

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone

Page 3 of 7

It is important to note that Jxta protocols by themselves do not promise interoperability. Here, you can draw parallels between Jxta and TCP/IP. Though both FTP and HTTP are built over TCP/IP, you cannot use an FTP client to access Webpages. The same is the case with Jxta. Just because two applications are built on top of Jxta doesn't mean that they can magically interoperate. Developers must design applications to be interoperable. However, developers can use Jxta, which provides an interoperable base layer, to further reduce interoperability concerns.

XML in Jxta

Undoubtedly, the first step towards providing a universal base protocol layer is to adopt a suitable representation that a majority of the platforms currently available can understand. XML is the ideal candidate for such a representation. The Jxta developers recognize that XML is fast becoming the default standard for data exchange. XML provides a universal, language-independent, and platform-independent form of data representation. XML can also be easily transformed into other encoding. Hence, the XML format defines all Jxta protocols.

Although Jxta messages are defined in XML, Jxta does not depend on XML encoding. In fact, a Jxta entity does not require an XML parser; it's an optional component. Just think of XML as a convenient form of data representation used by Jxta. Smaller entities like a mobile phone might use precompiled XML messages.

Understand the Jxta jargon

Before proceeding any further, let's quickly look at the various concepts in Jxta.

Peers
Any entity on the network implementing one or more Jxta protocols. A peer could be anything from a mainframe to a mobile phone or even just a motion sensor. A peer exists independently and communicates with other peers asynchronously.


Peer groups
Peers with common interests can aggregate and form peer groups. Peer groups can span multiple physical network domains.


Messages
All communication in the Jxta network is achieved by sending and receiving messages. These messages, called Jxta messages, adhere to a standard format, which is key to interoperability.


Pipes
Pipes establish virtual communication channels in the Jxta environment. Peers use them for sending and receiving Jxta messages. Pipes are deemed virtual because peers don't need to know their actual network addresses to use them. That is an important abstraction.


Services
Both peers and peer groups can offer services. A service offered by a peer individually, at a personal level, is called a peer service, a concept equivalent to centralization. No other peer needs to offer that service; if the peer is not active, the service might become unavailable.

Peer groups offer services called peer group services. Unlike peer services, these services are not specific to a single peer but available from multiple peers in the group. Peer group services are more readily available, because even if one peer is unavailable, other peers offer the same services.



Codats
Codat (Code/Data), in Jxta, means content that could be either code or data. Codats can be published, discovered, and replicated if necessary.


Advertisements
An advertisement publishes and discovers any Jxta resource such as a peer, a peer group, a pipe, or a codat. Advertisements are represented as XML documents.


Identifiers
Identifiers play a key role in the Jxta environment. Identifiers specify resources, not physical network addresses. The Jxta identifier is defined as a URN (Uniform Resource Name). A URN is nothing but a URI (Uniform Resource Identifier) that has to remain globally unique and persistent even when the resource ceases to exist (see Resources for more information on URNs and URIs).


World peer group
Every Jxta peer is, by default, a member of the world peer group. Each Jxta peer intrinsically knows the world peer group and can join this peer group, even if it can't find any other peers on the network. Even disconnected peers are members.


Net peer group
On a local network, the network administrators can usually configure a peer group that every peer on the network can join: the net peer group. This group resembles a DHCP (dynamic host configuration protocol) service. The net peer group provides peers with a global connectivity according to restrictions imposed by the administrators.


Rendezvous peers
A rendezvous peer is a special peer that stores information about other peers it knows about by caching these known peers' advertisements. Thus, a rendezvous peer can help peers discover other peers in the network. Rendezvous peers can also forward discovery requests to other rendezvous peers.


Endpoints
Endpoints are destinations on the network and can be represented by a network address. Peers don't generally use endpoints directly; they use them indirectly through pipes, which are built on top of endpoints.


Routers
Anything that moves packets around the Jxta network is called a Jxta router. Not all peers need to be routers. Peers that are not routers must find a router to route their messages.


The Jxta protocols

The key to Jxta lies in a set of common protocols defined by the Jxta community. These protocols can be used as a foundation to build applications. Designed with a low overhead, the protocols assume nothing about the underlying network topology over which an application that uses them is built.

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources