jxta tech brief l.
Skip this Video
Loading SlideShow in 5 Seconds..
JXTA: Tech Brief PowerPoint Presentation
Download Presentation
JXTA: Tech Brief

Loading in 2 Seconds...

play fullscreen
1 / 31

JXTA: Tech Brief - PowerPoint PPT Presentation

  • Uploaded on

JXTA: Tech Brief Dan Berger, Suvidhean Dhirakaosal, Essia Hamouda, Demetris Zeinalipour CS 202 Spring 2003 Outline Problem Statement/Motivation Architecture Overview Experiments/Demonstrations Conclusions Motivation

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'JXTA: Tech Brief' - Gabriel

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
jxta tech brief

JXTA: Tech Brief

Dan Berger, Suvidhean Dhirakaosal, Essia Hamouda, Demetris Zeinalipour

CS 202 Spring 2003

  • Problem Statement/Motivation
  • Architecture Overview
  • Experiments/Demonstrations
  • Conclusions
  • Existing P2P solutions have had rapid adoption and success – so why build another?
  • JXTA attempts to address 3 key “shortcomings” of typical P2P systems:
    • Interoperability
    • Platform Independence
    • Ubiquity
  • Gnutella for file sharing, ICQ/AIM/Yahoo/Jabber/MSN for instant messaging
    • But none of them can talk to each other.
    • This has led to the development of apps like Gaim (linux) and Trillian (windows) that provide a single front-end to multiple protocols.
  • JXTA aims to standardize at the protocol level.
platform independence
Platform Independence
  • JXTA is “independent” of programming language, operating system, and networking platform.
  • The core of JXTA are protocol definitions, not API’s.
  • JXTA was designed to be scalable to any device with a “network heartbeat” – cited examples are:
    • Sensors
    • Consumer electronics (toasters, cell phones)
    • PDAs
    • Etc.
enough buzzwords already
Enough Buzzwords, Already
  • JXTA proposes a set of services to enable building a securable logical overlay network linking “peers:”
    • Peer Discovery
    • Peer Resolution
    • Rendezvous
    • Pipe Binding
    • Endpoint Routing
just the facts
Just the Facts
  • Each node in the JXTA network
    • has a “peer id” - a “globally” unique ID (UUID)
      • Urn:jxta:idform3-31:08:66:42:67:::91:24::73
    • Is Autonomous and may operate independently of all peers
  • Peers (self)organize into peer groups – loosely hierarchical.
    • All peers belong to the “World” group.
  • Peers and services are advertised with advertisements (XML documents)
  • Used to describe peers, peers groups, pipes, content, services and resources
  • Used to pass info between peers
  • Are presented in XML
    • Peer Adv.
    • Peer group Adv.
    • Module Class Adv.
    • Module Spec. Adv.
    • Module Implementation Adv.
discovery query
Discovery Query

<xs:element name="DiscoveryQuery" type="jxta:DiscoveryQuery"/>

<xsd:simpleType name="DiscoveryQueryType">

<xsd:restriction base="xsd:string">

<!-- peer -->

<xsd:enumeration value="0"/>



<xs:complexType name="DiscoveryQuery">


<xs:element name="Type" type="jxta:DiscoveryQueryType"/>

<xs:element name="Threshold" type="xs:unsignedInt" minOccurs="0"/>

<xs:element name="Attr" type="xs:string" minOccurs="0"/>

<xs:element name="Value" type="xs:string" minOccurs="0"/>

<!-- The following should refer to a peer adv, but is instead a whole doc for historical reasons -->

<xs:element name="PeerAdv" type="xs:string" minOccurs="0"/>



  • LAN-based (broadcast)
  • Invitation (in or out of band, via an advertisement)
  • Cascaded (controlled view across discovered peers)
  • Rendezvous (napster-esqe)
  • In general – a service that resolves advertisements into endpoints.
  • JXTA ships with one implementation – “Rendezvous” – in which hosts serve as switchboards for messages.
  • More complex/decentralized resolvers are possible, but not specified/provided.
  • Pipes are unidirectional communication channels.
  • Peers can host input pipes (incoming messages), or output pipes (outgoing messages).
  • Pipes can be chained to link peers across multiple logical hops, and can be one-to-many.
  • Pipes are bound to peer ids, not IP address.
  • Allows peers to discover routes for reaching a peer which can not be directly connected to.
    • I.e. behind a firewall, NAT device, different network platform, etc.
required components
Required Components
  • www.jxta.org has Java and C implementations of the core protocols.
    • The C version is based on the APR (apache portable runtime) and trails behind the JAVA version in terms of functionality and ease of use.
  • For Java – requires the J2SE JDK
installation configuration
Installation & Configuration
  • Install a JRE/JDK (e.g. Sun 1.3.1_1)
  • Download the latest JXTAInst_VM.exe

InstallAnywhere installer (JXTA v2.0)

http://download.jxta.org/easyinstall/install.html (4.71MB)

(Or download JXTAInst.exe which contains VM)

  • Download tutorials/code from


jxta jars
  • JXTA’s core uses 13 other JAR files like Jetty portable Web/Servlet Server, Log4J apache’s generic logging API.
  • Directory Structure so far
    • /InstantP2P -> A “full-fledged” instant P2P application
    • /lib -> The JAR Files
      • /lib/jxta.jar -> Contains the JXTA Programming API
    • /Shell -> Command-line Interface to JXTA
    • /tutorials -> Tutorials that we downloaded individually
step 0 source compiling creating a peergroup
Step 0: Source/Compiling“Creating a PeerGroup”

java -classpath jxta.jar;OTHER_JAR_FILES.jar; Hello

import net.jxta.peergroup.*;

import net.jxta.impl.id.UUID.*;

import net.jxta.impl.id.binaryID.*;

public class Hello


static PeerGroup netPeerGroup = null;

static DigestTool digestTool = new DigestTool();

public static void main(String args[]) {

try {

netPeerGroup = PeerGroupFactory.newNetPeerGroup();

System.out.println("Hello from JXTA group " +netPeerGroup.getPeerGroupName() );

System.out.println(" Group ID = " +netPeerGroup.getPeerGroupID().toString());

System.out.println(" Peer name = " + netPeerGroup.getPeerName());

System.out.println(" Peer ID = " + netPeerGroup.getPeerID().toString());

}catch(Exception e){e.printStackTrace();}



step 1 running the code
Step 1 : Running the code



Now a .jxtadirectory is created on disk which contains all settings

On the next run we only fill in an authentication box



step 2 jxta sockets as of v2 0
Step 2 : JXTA Sockets! (as of v2.0)
  • JXTA introduces a Socket API which is similar to the familiar sockets.
  • The Socket API attempts to make JXTA Pipe programming easier. (JxtaSocket is a bi-directional Pipe)
    • JxtaServerSocket: Server socket that waits for connections from clients.
    • JxtaSocket: Socket class used to create the I/O streams for both clients and servers.
step 3 jxta sockets example
Step 3 : JXTA Sockets Example
  • In this example we use to types of “advertisement” Discovery Services:
    • LAN-based discovery: Local broadcast over the subnet. ( to
      • Works if peers are within the same subnet or if multicast-enabled routers are connecting the peers
    • Discovery via rendezvous points A peer at a well-known address has the task of knowing and disseminating locations of peers.
      • Works if peers are fire-walled in which case direct connection between peers is not feasible.
step 3 jxta sockets example26
Step 3 : JXTA Sockets Example

Rendevouz Service


a)connect, b)receive msg,

c) send msg back





a)connect, b)receive msg,

c) send msg back

The Server I want


My ServerSocket

(multicast channel)

to connect to is


ID is




read the text file


read the text file


<!DOCTYPE jxta:PipeAdvertisement>

<jxta:PipeAdvertisement xmlns:jxta="http://jxta.org">








socket example



jxta sockets code snippets
JXTA Sockets Code Snippets

Server (main snippets)

// create, and Start the default jxta NetPeerGroup

PeerGroupnetPeerGroup = PeerGroupFactory.newNetPeerGroup();

// Read file from disk

FileInputStream is = new FileInputStream("socket.adv");

// Generate Pipe Advertisment

PipeAdvertisement pipeAdv = (PipeAdvertisement)AdvertisementFactory. new Advertisement(is);

// Launch ServerSocket

JxtaServerSocket serverSocket = new JxtaServerSocket(netPeerGroup, socEx.pipeAdv);

// if client connects, spawn two new Threads (input/output).

JxtaSocket socket = serverSocket.accept();

OutputStream out = socket.getOutputStream();

InputStream in = socket.getInputStream();

// send a message

String msg = “Hello JXTA”;


// receive message back

in.read(inbuf, 0, bufsize);

jxta sockets code snippets28
JXTA Sockets Code Snippets

Client (main snippets)

// create, and Start the default jxta NetPeerGroup

PeerGroupnetPeerGroup = PeerGroupFactory.newNetPeerGroup();

// Read file from disk

FileInputStream is = new FileInputStream("socket.adv");

// Generate Pipe Advertisment

PipeAdvertisement pipeAdv =

(PipeAdvertisement)AdvertisementFactory. new Advertisement(is);

// Launch Socket along with 2 new Threads (input/output).

JxtaSocket socket = new JxtaSocket(netPeerGroup, pipeAdv);

OutputStream out = socket.getOutputStream();

InputStream in = socket.getInputStream();

// receive message

read = in.read(inbuf, 0, bufsize);

System.out.println(">> " + new String(inbuf));

// send message back

out.write(inbuf, 0, read);

jxta sockets code snippets29
JXTA Sockets Code Snippets

Server acting also as Rendezvous

Client connecting to Rendezvous

ongoing jxta projects
Ongoing JXTA Projects

Full list available at : http://apps.jxta.org/servlets/ProjectHome

Gnougat: A Fully decentralized file caching

RossetChat: Localized JXTA Peer Text Messaging

Radiojxta: delivering audio content over JXTA networks

P2Pconference: A tool to conduct remote, text-based conferences

InstantP2P: To be interactively displayed.