Book Cover: JXTA - Click to enlargeThis page hosts the final PDFs and example code for my book “JXTA” available from New Riders. JXTA presents the next step in the evolution of the peer-to-peer paradigm’s development into a mature technology suitable for creating enterprise solutions. Project JXTA, an open source project spearheaded by Sun Microsystems, has developed a set of XML-based protocols to manage the common interactions required to create ad-hoc P2P networks, including peer discovery, firewall traversal, data exchange, and segmentation of the network space.

This book presents a guided tour of the JXTA platform, including all of the critical information required to begin producing P2P solutions built on top of JXTA. Reference information on each of the JXTA protocols provides an understanding of the underlying principles of P2P networking, and examples built on the JXTA reference implementation provide the hands-on experience necessary to become fluent in JXTA technology. Information in the book has been broken into the following chapters:

  • Chapter 1: This chapter is a general introduction to the topic of peer-to-peer (P2P) computing, including the history of the development of the P2P paradigm, the advantages and disadvantages of P2P, and an introduction to Project JXTA.
  • Chapter 2: Introduces the basic concepts of P2P networking, the problems posed by P2P, and the terminology required to understand the rest of the book. This chapter provides a technical introduction to the components required to implement a complete P2P network.
  • Chapter 3: This chapter introduces JXTA and the solutions it provides to address basic problems in P2P networking. It discusses the design philosophy, assumptions, capabilities, and limitations of JXTA. The majority of the chapter is devoted to using the JXTA Shell application to familiarize the reader with the JXTA implementation of P2P, and allow some preliminary experimentation without requiring the reader to program anything just yet. In addition, a small introduction on XML familiarizes the reader with the form of messages used by all of the JXTA protocols.
  • Chapter 4: This chapter details the Peer Discovery Protocol (PDP), which provides JXTA P2P applications with a mechanism for discovering other peer resources. Without the PDP, a P2P client would be useless, unable to find and use the resources offered by other peers. The chapter elaborates on the purpose of the PDP, its use in JXTA applications, and the format of PDP messages. Examples using the JXTA Shell, and Java code written using the reference JXTA implementation guide the reader through the use of the PDP to discover other peer resources on the network.
  • Chapter 5: The Peer Resolver Protocol (PRP) provides P2P applications with a generic request and response format to use when communicating with other peers. Once a peer has been discovered using the Peer Discovery Protocol, the PRP can be used to send messages to the peer for processing, and to receive messages from the peer containing the results. This chapter details the purpose of the PRP, the use of the PRP in JXTA applications, the format of PRP messages, and guides the reader through example code that uses the PRP to send and receive simple messages between two peers.
  • Chapter 6: This chapter details the Rendezvous Protocol (RVP), used by a peer to connect to a rendezvous peer and have messages propagated on their behalf to other peers that are also connected to the rendezvous peer. Rendezvous peers provide a mechanism for peers to broadcast messages to many peers without relying on a specific network transport. This chapter provides information on the format of the RVP messages and the flow of messages between a peer and the rendezvous peer. This chapter also covers the Rendezvous service dual role, providing both a local interface to remote rendezvous peers, and rendezvous peer services to remote peers.
  • Chapter 7: Once a peer has been discovered using the Peer Discovery Protocol, the status or capabilities of the peer may be required. The Peer Information Protocol (PIP) provides a set of messages capable of querying a peer in order to obtain status information. This chapter details the purpose of the PIP, the use of the PIP in JXTA applications, the format of PIP messages, and guides the reader through an example application that uses the PIP to send and receive messages to communicate peer status information.
  • Chapter 8: Pipes in JXTA provide a virtual communication channel connecting endpoints on the P2P network. The Pipe Binding Protocol (PBP) allows peer group members to establish a connection to another peer, independent of the transport mechanism. This chapter details the purpose of the PBP, the use of the PBP in P2P applications, the format of PBP messages, and guides the reader through an example application that uses the PBP to exchange messages over a pipe with another peer.
  • Chapter 9: Due to the ad hoc nature of a P2P network, a mechanism is required to enable messages to be routed between peers. The Endpoint Routing Protocol (ERP) provides peers with a mechanism for determining a route to an endpoint. This routing mechanism is provide transparently by the Endpoint service, this allowing a peer to send messages without needing to take special steps to handle communication via intermediary peers. This chapter details the purpose of the ERP, the format of the ERP’s messages, and guides the user through an example application that uses the ERP and the Endpoint service to send messages to another peer endpoint.
  • Chapter 10: This chapter covers the use of peer groups to segment the network space, and provide new services on the JXTA network. The chapter discusses peer group creation and configuration, as well the process of bootstrapping the JXTA platform. Much coverage of the topic of modules is provided, and the chapter’s example demonstrates the creation of a new peer group service and the creation of a peer group configured to use the new peer group service.
  • Chapter 11: This chapter guides the reader through the process of creating their own complete P2P solution using all of the JXTA protocols. Examples from each of the preceding chapters are used as the foundation of the application, and brought together to provide all of the elements of the final P2P solution.
  • Chapter 12: This chapter outlines some of the future directions currently being pursued by JXTA project groups, including implementations of JXTA for other languages, and bindings to other network transports. In addition, this chapter introduces some of the other community projects building on JXTA to provide services and applications.

Two appendices provide a glossary of terms and Three Letter Acronyms (TLA) used in the book, and a list of related online resources.

All examples in the book use the JXTA reference implementation written in Java, allowing the example code to be run on any device with a Java Virtual Machine (JVM), thereby reaching the largest possible development audience. To download the Java 2 SDK Standard Edition for Windows 2000, or a number of other platforms, go to www.javasoft.com/j2se/ and download the appropriate SDK for your operating system. For Mac users, a Mac implementation of the Java 2 Standard Edition SDK is available from www.apple.com/java/, but only for users of the Mac OS X operating system.

This book is targeted at software developers doing peer-to-peer application development who are interested in detailed information on the JXTA platform technologies and concepts. This book assumes an intermediate level of Java development knowledge, and basic knowledge of networking. Those developers not familiar with Java should still be able to understand and run the book’s example code with a minimum of difficulty.