Professional Documents
Culture Documents
JXTA-Overview (Compatibility Mode)
JXTA-Overview (Compatibility Mode)
JXTA-Overview (Compatibility Mode)
M. Ranganathan
ITG/ANTD/NIST
Peer-peer networking
Focus at the application level
Create an overlay network : Separation between physical and logical structure using
one layer of indirection.
P2P Applications
• Application Characteristics:
– Centralization not possible or desired.
– Massive Scalability
– Relationships are transient or ad hoc
– Resources are distributed
– Resilience is desired
• Examples
– File sharing.
– Collaborative Applications
– Distributed/Grid Computing.
– Distributed Storage.
– Distributed Caches.
P2P Applications
• Search the entire web and all its connected devices
(not just servers) for needed information
• Save files and information to distributed locations on
the network
• Connect game systems so that multiple people in
multiple locations
• Participate in auctions among selected groups of
individuals
• Collaborate on projects from anywhere using any
connected device
• Share compute services, such as processor cycles or
storage systems, regardless of where the systems or
the users are located
• Wireless tic-tac-toe / picture sharing.
JXTA Overview
Sun Peer
JXTA
JXTA Community Services
Services JXTA Services Commands
<!DOCTYPE jxta:PipeAdvertisement>
<jxta:PipeAdvertisement xmlns:jxta="http://jxta.org">
<Id>
urn:jxta:uuid-59616261646162614E5047205CFDF904
</Id>
<Type>
JxtaUnicast
</Type>
<Name>
foo
</Name>
</jxta:PipeAdvertisement>
Advertisements
• Peer Advertisement:
– Describes Peer Resources
• Peer Group Advertisement:
– Describes Peer group specific resources.
• Pipe Advertisement:
– Describes a Pipe Communication channel.
• Module Class Advertisement:
– Describes a Module Class.
– Formally documents the existence of a module class.
Advertisements
• Module Spec Advertisement
– Defines a Module Specification
– Provides references to the documentation needed to
create a conforming implementations of that
specification.
• Module Impl Advertisement
– Defines an implementation of a module spec.
– Includes name, module spec Id , code, package and
parameter fields which enable the peer to retrieve the
data necessary to execute the advertisement.
Advertisements
• Rendezvous Advertisement
– Describes a peer that acts as a rendezvous.
• Peer Info Advertisement
– Describes peer info resources.
– Holds information about the current state of a
peer.
Quick JXTA Demo
• Demo will do the following:
– Make advertisements.
– Publish the Advertisements.
– Discover the advertisement.
– Use the advertised pipe to send a file from
peer to peer.
Demo
• Start 3 jxta shells on the same machine.
– Make one jxta shell the rendezvous peer.
– Make the other two use the rdv peer.
– Test peer discovery.
– Examine the peer advertisement.
• Make a Pipe advertisement (from sh2)
– p = mkadv –p pipename
– publish –d p
– inpipe = mkpipe –i p
Demo
• From shell 3 discover the pipe
– search –r #send out discovery request
– search #see what arrived in cache
– cat advxx #Examine the pipe advertisement
– outpipe = mkpipe –o advxx # make outpipe
• Make a message to send
– importfile –f data mydata #Create data object
– put mymsg mytag mydata #assign data tag
– cat mymsg #examine the message
Demo
• Send message through pipe (sh3):
– send outpipe mymsg
• Read from other end of pipe (sh2):
– newmsg = recv inpipe #blocking read
– cat newmsg #see what you got
– newdata = get newmsg mytag #extract data
– cat newdata #see what you got
Note
• Asynchronous programming model
– Results are cached and cache is queried.
• Mailbox like message delivery
• Advertisements are persistent.
• Some amount of configuration necessary.
• You can extend the shell and add new
commands to it.
• Conversely, you can imbed jxta into another
shell (tcl/tk).
JXTA Protocols
• Allow Peers to dynamically route messages to
any other peer in the network, potentially
traversing firewalls.
• Allow Peers advertise their resources and
discover resources.
• Peers can co-operate to form self-organized and
self configured peer-groups independent of their
positions in the network ( edges, firewalls,
NATS, Public vs. Private Addresses), without the
need for a centralized management
infrastructure.
Protocols
• Peer Discovery Protocol - find peers, groups,
advertisements
• Peer Information Protocol - learn peers’
status/properties
• Peer Membership Protocol - sign in, sign out,
authentication
• Pipe Binding Protocol - pipe advertisement to pipe
endpoint
• Peer Resolver Protocol - send/receive search queries
• Endpoint Routing Protocol - available routes to
destination
JXTA Protocol Stack
Peer Disc Via Peer Rslv Peer Disc
Advertisement Animation
http://platform.jxta.org/graphics/adv.swf
Connection Scenarios
http://platform.jxta.org/TutorialGraphics.html
Peer Discovery Protocol (PDP)
• Peers publish advertisements and
discover about resources using
advertisements.
• Every peer resource is described and
published using an advertisement.
• Advertisements are XML meta data that
describe resources.
Peer Information Protocol
• Once a peer is located, its capabilities and
status may be queried.
• PIP ping sent to a peer to check if the peer
is alive and to get info about the peer.
– Peer Info message used to respond to a ping
Peer Resolver Protocol (PRP)
• Enables Peer to send generic query
requests to other peers and identify
matching responses.
• Query requests can be sent to specific
peer or can be propagated via rendezvous
service within the scope of a peer group.
– PIP and PDP built using PRP.
Pipe Binding Protocol (PBP)
• Used by peer group members to bind a
pipe advertisement to a pipe endpoint.
• Pipe is an abstract named message queue
supporting open/resolve (bind), close
(unbind), delete, send and receive.
• Pipe IDs are unique.
• PBP message sent to find a pipe endpoint
bound to the same pipe advertisement.
Endpoint Routing Protocol
• A protocol that allows an endpoint to
discover a route (sequence of hops) used
to send a message to another peer.
• If there is no direct route then the peer
needs to find an intermediate peer or set
of peers to route the message.
Rendezvous Protocol (RVP)
• A mechanism by which peers can
subscribe to a propagation service.
• Within a peer group peers can be
Rendezvous peers or listening to RDV
peers.
• RVP is used by PRP and PBP in order to
propagate messages.
Network Architecture
• JXTA Peers have different capabilities:
– Micro Peer, Standard Peer, Super Peer,
Rendezvous peer.
• Minimal Edge Peer:
– Device with minimal capability. Must
implement the Peer Resolver Protocol and
Endpoint Routing Protocol.
• Full Featured Edge Peer
– Will Cache advertisements.
Network Architecture
• Rendezvous Peer:
– RDV peer forwards advertisements. Peers
seek RDV peers in their peer groups.
Discovery requests are forwarded through
RDV peers
• Relay Peer:
– Maintains information about routes to other
peers and routes messages to them.
– Forward messages on behalf of peers that
cannot directly access another peer.
Discovery Service
Resource Adv
Job Adv
User Adv
JOB Resource
Discover
Pipe
Publish
http://www.unix.globus.org/cog/projects/jxa/?Projects=&
JXTA XML RPC and JXTA SOAP