1 / 39

Project JXTA

Project JXTA. Instructor: Dr. Erdogan Dogdu Presented by: Liu Shuai http://tinman.cs.gsu.edu/~cscsnlx/ProjectJXTA.ppt. Outline. Introduction - what is JXTA Goal - what JXTA is aiming at Structure - how JXTA is built Protocols - what protocols JXTA has

pierce
Download Presentation

Project JXTA

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Project JXTA Instructor: Dr. Erdogan Dogdu Presented by: Liu Shuai http://tinman.cs.gsu.edu/~cscsnlx/ProjectJXTA.ppt

  2. Outline • Introduction - what is JXTA • Goal - what JXTA is aiming at • Structure - how JXTA is built • Protocols - what protocols JXTA has • Implementation – JXTA programming in Java • Applications - what can be done with JXTA

  3. Introduction • started by Sun's Chief Scientist Bill Joy • JXTA is pronounced as “juxta” , is short for juxtapose, as in side by side. • an effort to create a common platform for building distributed services and applications, especially for P2P networking.

  4. What is P2P? • Server-Client model

  5. What is P2P? (Cont.) • Problem with Server-Client Model • Scalability • As the number of users increases, there is a higher demand for computing power, storage space, and bandwidth associated with the server-side • Reliability • The whole network will depend on the highly loaded server to function properly

  6. What is P2P? (Cont.) • Peer-to-Peer model

  7. What is P2P? (Cont.) • Advantage of P2P model • The system is based on the direct communication between peers • There is zero reliance on centralized serviced or resources for operations • The system can survive extreme changes in network composition • They thrive in a network with heterogeneous environment • This model is highly scalable

  8. Goals • Interoperability • — JXTA technology is designed to enable peers providing various P2P services to locate each other and communicate with each other. • Platform independence • — JXTA technology is designed to be independent of programming languages, transport protocols, and deployment platforms. • Ubiquity • — JXTA technology is designed to be accessible by any device with a digital heartbeat, not just PCs or a specific deployment platform.

  9. JXTA Community Applications Sun Applications JXTAShellPeerCommands JXTA Community Services SunJXTA Services Peer Groups Peer Pipes Peer Monitoring Security Structure JXTA Applications JXTA Services JXTA Core Any Peer on the Web (Desktop, cell phone, PDA, Server)

  10. Technology Concepts • Peer • Any networked device that implements one or more of the JXTA protocols • Peer group • A collection of peers that have agreed on a common set of services. • Each peer group can establish its own membership policy • One peer can belong to more than one peer group • Advertisement • An XML-structured format file describing all existing resource, such as peer, peer group, pipe, service.

  11. Technology Concepts(Cont.) • Message • A set of name/value pairs sent between JXTA peers. • Pipe • Message transfer mechanism for service communication • A message queue supporting create, open, close, delete, send and receive operations

  12. Protocol • JXTA is a set of six protocols • Peer Discovery Protocol - find peers, groups, advertisements • Peer Resolver Protocol - send/receive search queries for peers • Peer Information Protocol - learn peers’ status/properties • Peer Membership Protocol - sign in, sign out, authentication • Pipe Binding Protocol - pipe advertisement to pipe endpoint • Endpoint Routing Protocol - available routes to destination

  13. Implementation • JXTA in Java • JXTA Standard platform for JDK1.3 • PJAVA for Personal Java • JXME for J2ME (CLDC/MIDP) • Implementation in other language including • C • Perl 5.0 • Python • Ruby • Smalltalk

  14. Application • Create a group of peers that provide a service • Securely communicate with other peers on the network • Find other peers on the network with dynamic discovery across firewalls • Easily share documents with anyone across the network • Find up to the minute content at network sites • Monitor peer activities remotely

  15. Application - examples • Connected game/chat systems so that multiple people in multiple locations can locate each other, send messages securely. • Distributed file caching/knowledge base for data sharing. To share and search file/media over the network

  16. A sample program public class DiscoveryDemo implements DiscoveryListener { static PeerGroup netPeerGroup = null; private DiscoveryService discovery; PeerAdvertisement peerAdv; public DiscoveryDemo() { . . . } // method to start the JXTA platform private void startJxta() { try { netPeerGroup = PeerGroupFactory.newNetPeerGroup(); }catch ( PeerGroupException e) { ... } // Get the discovery service from our peer group discovery = netPeerGroup.getDiscoveryService(); }

  17. A sample program(cont.) //This thread loops forever discovering peers every minute, and displaying the results. public void run() { try { // Add ourselves as a DiscoveryListener for DiscoveryResponse events discovery.addDiscoveryListener(this); while (true) { System.out.println("Sending a Discovery Message"); // look for any peer discovery.getRemoteAdvertisements(null, DiscoveryService.PEER,null, null, 5, null); // wait a bit before sending next discovery message try { Thread.sleep(10 * 1000); } catch(Exception e) { ... } } //end while } catch(Exception e) { ... } }

  18. A sample program(cont.) public void discoveryEvent(DiscoveryEvent ev) { DiscoveryResponseMsg res = ev.getResponse(); String aRes = res.getPeerAdv(); try { InputStream is = new ByteArrayInputStream( (aRes).getBytes() ); peerAdv = (PeerAdvertisement) AdvertisementFactory.newAdvertisement( new MimeMediaType( "text/xml" ), is); System.out.println (" [ Got a Discovery Response ["+ res.getResponseCount()+ " elements] from peer : " + peerAdv.getName() +" ]"); } catch (java.io.IOException e) { ... } Enumeration enum = res.getResponses(); String str=null; PeerAdvertisement newAdv=null;

  19. A sample program(cont.) while (enum.hasMoreElements()) { try { str = (String) enum.nextElement(); newAdv =(PeerAdvertisement) AdvertisementFactory.newAdvertisement (new MimeMediaType ("text/xml"), new ByteArrayInputStream(str.getBytes())); System.out.println(" Peer name = " + newAdv.getName()); } catch (java.io.IOException e) { ... } } } // end while }

  20. A sample program(cont.) static public void main(String args[]) { DiscoveryDemo myapp = new DiscoveryDemo(); myapp.startJxta(); myapp.run(); } }

  21. Reference • L. Gong, "Sun's Project JXTA: A technology Overview," http://www.jxta.org/project/www/docs/TechOverview.pdf • 'Project JXTA': A Technology Overview, JavaOne 2001 • Project JXTA: Java™ Programmer’s Guide http://www.jxta.org

  22. Creating JXTA Systems Instructor: Dr. Erdogan Dogdu Presented by: Yan Gu

  23. Outline • Application level design and architecture • a top-down look at Jxta • A distributed data collection problem. • Analyze and design a solution through Jxta • How Jxta changes the networking landscape by juxtaposition • Jxta Service and Client

  24. A specific example Create a large-scale distributed weather data collection and analysis system. • Collectors: • Are weather data collection points • Dispersed all over the world • Not all of them connected directly to the Internet • May go online or offline at anytime. • Concentrator: • Monitors data from many collectors • feed data in realtime into relational database • Vary in number and location • Relational Database • Supercomputer: • Analysis for data from relational database

  25. Problem to solve how can our system • operate continuously • allow for the dynamic addition and removal of both collectors and concentrators • with little impact on overall performance? .

  26. Solutions: Juxtaposition

  27. Data Collector Network

  28. Jxta Benefits for P2P Network • Uniform decentralized addressing • Easy addition and removal of new collectors or concentrators • Network virtualization • simplicity in design • Fault Resiliency • continuous operations • Dynamic self-organized network • maintenance-free operations • Support for a diversity of implementations • hardward platforms, programming languages, and communication protocols

  29. Unique Identifier • Uniquely identify an entity and serves to locate it • No central name server like DNS • Presented as URN • Sort of URI • 64 bytes array • Typical id: • urn:jxta:uuid 59616261646162…C8168F0E4BDA903

  30. Network Virtualization

  31. Peer Endpoint Protocol • Used to dynamically find a route to send a message to another peer • Uses queries send to other routers • Caches route information locally and uses remote peers • Uses the relay service for peers that are not reachable (firewall) • Leasing mechanism • Uses the Endpoint service to send messages • The PeerAdvertisement contains a list of Transport Protocols • Endpoint service used to delegate the sending part to the appropriate protocol

  32. End point protocols as drivers

  33. Jxta routing example

  34. Fault Resiliency • P2P network topology will change • unreliable nature of P2P peer • reroute message on the fly as peers come and go in the network • peergroup level • support peergroup service -- redundantly implemented services that should always be available within a peergroup

  35. Dynamic self-organized network A peer with a uniform ID must • Locate the local peers and discover their capabilities • discover the peergroups that are available and join one • discover the services available in a peergroup and start using them A peergroup • serve as a network-partitioning mechanism • ensuring that advertisements are only related to he group members • also serve authentication domain for certain applications

  36. Weather station example • Concentrator - Jxta Services • Collector - Jxta clients

  37. Concentrator Implementation • Read and process appropriate configuration file • Start Jxta • Join the group in the configuration file • Determine if the service ad is present. If not, create one and publish it. • Wait on pipe for message from collectors • Process the message and store in database • Go back to step 6

  38. Collector Implementation • Read and process appropriate configuration file • Start Jxta • Join the group specified in the configuration file • Discover service ad by concentrator. If not, we can not go ahead. • Extract pipe information from service ad. • Collect data at timed intervals • Create message containing the collector location and data • Send message to concentrator through pipe • Go back to step 6

  39. Application Pattern • Two extremely loosely coupled populations • Consumer and Producer • Consumer not willing to committed to one specific producer • Consumer may want • Select the best producers at any time • Reduce dependence on one single producer • Choose from one large dynamic community whose size and topology is unmanageable

More Related