This action might not be possible to undo. Are you sure you want to continue?
M. Ranganathan ITG/ANTD/NIST
Focus at the application level
Create an overlay network : Separation between physical and logical structure using one layer of indirection.
• Application Characteristics:
– – – – – – – – – – Centralization not possible or desired. Massive Scalability Relationships are transient or ad hoc Resources are distributed Resilience is desired 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 JXTA is a set of open XML-based protocols to build Peer to Peer Applications. Project JXTA is sponsored by SUN. JXTA open source community hosted at http://www.jxta. J2ME. . C++ etc. API bindings for the protocols are defined for J2SE.org.
and other connected devices) • Security / monitoring features to enable commercial deployment. servers. • Minimal Hardware assumptions: enable new applications to run on any device that has a digital heartbeat (desktop computers. JXTA is a set of protocols. .any language. PDAs. any OS.Goal/Purpose • Enable a wide range of distributed computing applications by developing a common set of general purpose P2P protocols • Platform independence . cell phones. any hardware.
• Protocols can be implemented in any language.JXTA is based on Protocols • Defines XML message formats or protocols for communication between peers. advertise or discover resources communicate. . • Protocols are used to discover peers. route messages and provide monitoring.
Peers providing a common service – Peer Group Service – A fragment of code that is common to the peer group.A JXTA speaking process. asynchronous. • Advertisements – XML Document that publishes existence of resources • Pipes – uni-directional.JXTA Protocol Abstractions • Peer . – Peer Service – A Fragment of code specific to a peer • Peer Groups . • Messages – XML envelopes . virtual channels for point-point and point-multi-point communication.
pipes. Peer groups.JXTA Abstractions • Each JXTA resource is identified by a UUID. message contents. . • Six types of JXTA entities with unique IDs: – Peers. module classes and module specifications.
Structure JXTA CommunityApplications JXTA Applications Sun Applications JXTA Shell JXTA Community Services JXTA Services Peer JXTA Services Commands Sun Peer Groups JXTA Core Security Peer Pipes Peer Monitoring Any Peer on the Web .
The Layers • Platform Layer. also known as the JXTA core. but are often used to make some tasks easier. document and resource sharing and P2P email systems. . • Application Layer. peer groups and security primitives. The Service layer includes the services that are not completely necessary for P2P networking. encapsulates the minimal and essential primitives that are common to all P2P environments. These include the creation of peers. Implementations of integrated applications: i P2P instant messaging. • Service Layer.
• Uniquely identified with a Peer ID. • Intermediate peers may be used to route messages. • Peers publish one or more network interfaces for use with the JXTA protocols. . • Each peer operates independently and asynchronously from all other peers.Peers • Peer is any networked device that implements one or more of the JXTA protocols.
• Peers may belong to more than one peer group simultaneously. • All peers belong to the NetPeerGroup. • Each Peer group is identified using a unique peer group ID.Peer Groups • Collection of Peers that have agreed upon a common set of services. .
.Motivations for Peer Groups • To Create a Secure Environment: – Local domain of control in which a specific security policy can be enforced. Peer group boundaries permit members to access/publish protected contents. • To Create a Scoping Environment: – Allow the establishment of a local domain of specialization.
. Membership Service: Accept/deny new members.Peer Group Services • A set of services that are replicated through the whole peer group. – Monitoring Service: Allow one peer to monitor the other members of the same peer group. Access Service: Validate requests Pipe Service: Create / Manage pipe connections Resolver Service: Send generic queries to other peers. • Root peer group has the following services: – – – – – Discovery Service: search for peer group resources.
• Peer Group Service: A collection of instances of the service (potentially collaborating with each other).Network Services • Peer Service: Accessible only on the peer that is publishing the service: – Multiple instances of the service can be run on different peers. . – Peer group services are published as part of the peer group advertisement.
• Modules: Abstraction to represent a piece of Code. • Can be java class, DLL a set of XML messages or a script. • Generic Abstraction to allow a peer to instantiate new behavior. • JXTA platform uses module advertisements to describe itself.
• Module Class : identified by unique class id. • Module Spec: Contains all the information necessary to access a module. Module Spec implies network compatibility:
– For a service module spec may contain pipe advertisement.
• Module Implementation – can be multiple module implementations for a given module spec.
• Virtual communication channel that may connect peers that do not have a direct physical link. • JXTA peers use PIPES to send messages to each other. • Pipes are an asynchronous and unidirectional message transfer mechanism used for service communication. • Pipes support transfer of binary/text. • JXTA pipes may have endpoints that are connected to different peers at different times or not connected at all.
Pipes Hide Plumbing Details .
the output pipe and all input pipes must belong to the same peer group. That is. . – All propagation is done in the scope of a peer group. • Secure Unicast Pipe: – Point-to-point secure communication channel.Pipes • Point-to-point Pipes: – Connect exactly two endpoints together • Propagate Pipes: – Connect one output pipe to multiple input pipes.
• Peers discover resources by searching for corresponding advertisements. . • JXTA protocols use advertisements to describe and publish the existence of peer resources.Advertisements • All network resources are represented by advertisements. • Advertisement is published with a lifetime that specifies the availability of associated resources.
JXTA Advertisement <?xml version="1.0"?> <!DOCTYPE jxta:PipeAdvertisement> <jxta:PipeAdvertisement xmlns:jxta="http://jxta.org"> <Id> urn:jxta:uuid-59616261646162614E5047205CFDF904 </Id> <Type> JxtaUnicast </Type> <Name> foo </Name> </jxta:PipeAdvertisement> .
– Formally documents the existence of a module class. • Pipe Advertisement: – Describes a Pipe Communication channel.Advertisements • Peer Advertisement: – Describes Peer Resources • Peer Group Advertisement: – Describes Peer group specific resources. • Module Class Advertisement: – Describes a Module Class. .
. – Includes name.Advertisements • Module Spec Advertisement – Defines a Module Specification – Provides references to the documentation needed to create a conforming implementations of that specification. code. module spec Id . package and parameter fields which enable the peer to retrieve the data necessary to execute the advertisement. • Module Impl Advertisement – Defines an implementation of a module spec.
• Peer Info Advertisement – Describes peer info resources.Advertisements • Rendezvous Advertisement – Describes a peer that acts as a rendezvous. . – Holds information about the current state of a peer.
. – Discover the advertisement. – Publish the Advertisements. – Use the advertised pipe to send a file from peer to peer.Quick JXTA Demo • Demo will do the following: – Make advertisements.
– Make the other two use the rdv peer. – Examine the peer advertisement. • Make a Pipe advertisement (from sh2) – p = mkadv –p pipename – publish –d p – inpipe = mkpipe –i p . – Make one jxta shell the rendezvous peer.Demo • Start 3 jxta shells on the same machine. – Test peer discovery.
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 .
You can extend the shell and add new commands to it. . • Conversely. Some amount of configuration necessary. • • • • Mailbox like message delivery Advertisements are persistent.Note • Asynchronous programming model – Results are cached and cache is queried. you can imbed jxta into another shell (tcl/tk).
firewalls. Public vs.JXTA Protocols • Allow Peers to dynamically route messages to any other peer in the network. • Peers can co-operate to form self-organized and self configured peer-groups independent of their positions in the network ( edges. without the need for a centralized management infrastructure. Private Addresses). . potentially traversing firewalls. • Allow Peers advertise their resources and discover resources. NATS.
pipe advertisement to pipe endpoint • Peer Resolver Protocol . authentication • Pipe Binding Protocol . advertisements • Peer Information Protocol . sign out.Protocols • Peer Discovery Protocol .find peers. groups.learn peers’ status/properties • Peer Membership Protocol .send/receive search queries • Endpoint Routing Protocol .available routes to destination .sign in.
Routing Via Network Transport Rendezvous Peer Endpt Routing Peer Endpt Routing Network Transport Network Transport .JXTA Protocol Stack Peer Disc Peer Info Pipe Bind Via Peer Rslv Via Peer Rslv Via Peer Rslv Peer Disc Peer Info Pipe Bind Peer Rslv Rendezvous Via Peer Rslv Peer Rslv Via Endpt.
org/graphics/adv.Animation of Scenarios Advertisement Animation http://platform.jxta.jxta.org/TutorialGraphics.html .swf Connection Scenarios http://platform.
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. – Peer Info message used to respond to a ping . 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.
• Query requests can be sent to specific peer or can be propagated via rendezvous service within the scope of a peer group.Peer Resolver Protocol (PRP) • Enables Peer to send generic query requests to other peers and identify matching responses. – PIP and PDP built using PRP. .
• Pipe IDs are unique.Pipe Binding Protocol (PBP) • Used by peer group members to bind a pipe advertisement to a pipe endpoint. close (unbind). send and receive. delete. . • PBP message sent to find a pipe endpoint bound to the same pipe advertisement. • Pipe is an abstract named message queue supporting open/resolve (bind).
. • If there is no direct route then the peer needs to find an intermediate peer or set of peers to route the message.Endpoint Routing Protocol • A protocol that allows an endpoint to discover a route (sequence of hops) used to send a message to another peer.
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.
Must implement the Peer Resolver Protocol and Endpoint Routing Protocol. Rendezvous peer. • Minimal Edge Peer: – Device with minimal capability. Standard Peer. Super Peer.Network Architecture • JXTA Peers have different capabilities: – Micro Peer. • Full Featured Edge Peer – Will Cache advertisements. .
Network Architecture • Rendezvous Peer: – RDV peer forwards advertisements. . Discovery requests are forwarded through RDV peers • Relay Peer: – Maintains information about routes to other peers and routes messages to them. Peers seek RDV peers in their peer groups. – Forward messages on behalf of peers that cannot directly access another peer.
Discovery Service • Retrieve Remote / Local Advertisements – Application can dispatch queries using getLocal/Remote Advertisements to fetch advertisements. . – Delivers discovery event when a query is processed. • • • • Publish Advertisements Locally Publish Advertisements remotely Flush local advertisements. Informs the application through an asynchronous Listener Interface.
• Developer can register a query handler for a resolver query for a given handler name.Resolver Service • Encapsulates the Resolver Protocol and hides its complexity. • Developer can create a Resolver Query message at any time and send query to a specific Resolver handler on a remote peer. – Discovery Service uses the resolver service. • Resolver Service needs two types of messages: – Resolver query message and Response message. .
– Queries are only propagated to RDV peers. • When edge peers publish new advertisements. . they use the SRDI service to push advertisement indexes to the Rendezvous peer.Shared Distributed Index (SRDI) • Optimization to reduce the number of messages for search.
• Firewall traversal depends upon the existence of a RDV peer that both communicating parties can contact. – Use polling to pipeline the message through the firewall.Firewalls and NATs • Firewalls offend and defend the nation’s IT infrastructure. – Ugly but effective solution. • Assumption – Firewall allows HTTP through. .
• Refutability – guard against replay attack. • Integrity.Message was not modified in transit.Security Requirements • Confidentiality – contents of a message are not divulged. • Authentication – guarantees a sender is who he claims to be • Authorization – Sender is authorized to send the message. .
• Authentication method using X. it receives PG creator’s Root cert under TLS – Certificate Service Request is used to acquire group membership cert. .JXTA Security • Peer group is a “web of trust” – Group can have an authentication method for allowing peers to join the group.509v3 certificates: – Peer must have X509 root cert of any peer with which it wishes to communicate securely – When peer joins the PG. – Peers can authenticate each other using the group membership certificate.
• Peer certificates are digitally signed by the JXTA platform. an end to end TLS channel is created.Virtual TLS • JXTA pipe might span multiple relays. – JXTA creates a self signed root certificate and issues a peer certificate based on that root certificate. . • Peer certificates are exchanged and verified during initialization of the secure pipe. • When a JXTA secure pipe is created and the associated endpoints are resolved. Independent of the relays and underlying physical transport.
. – Credential – token that can be used to identify the sender.Security • XML meta data in advertisements provide Credentials. Digests and Public Keys. Certificates. – Credentials are used for authorization and authentication. • Message can be encrypted/decrypted using private/public key pairs. • Certificates are distributed using TLS.
hash computation and digital signature. • Provides support for cypher / decypher. • JXTA API does not provide support for key distribution.JXTA Security API • API are based on the JAVA Smart Card API. .
org/cog/projects/jxa/?Projects=& .unix.JXTA based Grid Broker Service Broker – matches jobs to available resources Resource or User Registration – Peer Advertisements User wants to submit the job to broker – Job Advertisement Broker matches jobs and resource – Pipe Message sent back to User Job Submission – Using Pipe to send the job to resource Res. Avail Adv Job Adv broker Resource Adv User Adv JOB Discover Pipe Publish Resource http://www.globus.
JXTA XML RPC and JXTA SOAP • SOAP – Simple Object Access Protocol. – Everybody can run a web server like in the good old days! . • Tunnel XML RPC (lightweight SOAP) or SOAP on JXTA Pipes. • Allow users to build and publish web services in a firewall-controlled environment. – Free the web from the tyranny of system administrators.
Voice Over P2P • Try to stream voice over JXTA pipes. – People will tolerate bad quality for convenience.jxta. http://vop2p. • Disadvantages: – Voice quality will likely be bad. • Why? Firewalls.org/ . • Advantages – Instant deployment – No need for complex protocol (RADIUS/DIAMETER whatnot).
• A simulation of JXTA vs other P2P protocols: – Decentralization and timeouts means inconsistencies in application state are possible. . – How to tune cache advertisement timeouts. – The variation of responsiveness and peer discovery with group size (what is the latency of finding a pipe or advertisement as a function of network parameters).Project Ideas (discussion) • Measurements of peer to peer protocol performance.
skype.com over 300000 downloads of the beta client in a single day). .Project Ideas (discussion) • Firewalls are here to stay: – Firewalls are a huge barrier for IP Telephony. – Effective FW solution is a huge win (see www.
What performance can you expect? .Project Ideas (discussion) • JXTA allows P2P interaction through firewalls: – What bandwidth/delay characteristics can we expect. – How can we bridge between SIP/SDP (which specifies RTP parameters) and JXTA? – Can we build a gateway which will allow you to do voice calls through a SIP phone using JXTA as a transport for everything (signaling and voice)? – If so you can use your MSN messenger or SIP phone through a FW and deployment would be easy (could be an applet).
– JINI relies on java object serialization. except for the RDV peers??). .JXTA vs. – JINI uses a centralized service location broker. JINI • Language dependence – JXTA is XML based. – JXTA protocols are language independent. • Centralization – JXTA assumes no centralization (well.
brendonwilson.org • JXTA in a Nutshell by Scott Oaks.com ) .org • JXTA Programmers Reference – http://www.jxta.jxta. Bernard Travesat and Li Gong – O’Reilly publishing • JXTA by Brendon Wilson – New Riders Publishing ( Free PDF available from http://www.Material for this talk • JXTA Protocol Specification – http://spec.
This action might not be possible to undo. Are you sure you want to continue?