440 likes | 776 Views
JXTA. Acknowledgements. Bernard Traversat Project JXTA Sun Microsystems Santa Clara, CA. Gabriel Antoniu IRISA/INRIA Rennes Projet Paris. Sun's Interest in Peer-to-Peer. P2P is an instance of our vision — “The Network Is the Computer™” Advance Sun products' readiness for P2P.
E N D
Acknowledgements Bernard Traversat Project JXTA Sun Microsystems Santa Clara, CA Gabriel Antoniu IRISA/INRIA Rennes Projet Paris
Sun's Interest in Peer-to-Peer • P2P is an instance of our vision — “The Network Is the Computer™” • Advance Sun products' readiness for P2P
JXTA: a Generic Framework for P2P Computing • Open platform for P2P programming • Common functionalities • Language, OS, network agnostic • Set of interoperable protocols (XML) • Open source project: http://www.jxta.org
JXTA Interoperability:Any Platform, Any Network JXTA Chat (MIDP) JXTA Virtual Network MyJXTA (J2SE on Windows) JXTA-C Shell (C on Solaris)
Project JXTA: Technical Goal • Build a small, lightweight platform as the foundation for peer to-peer massively scalable network computing jux·ta·pose - v. tr. • To place side by side, especially for comparison or contrast.
JXTA Services and Applications • Distributed storage and data sharing • Search, indexing and file sharing • Large scale distributed computing • P2P messaging and collaboration tools
JXTA Virtual Network Project JXTA Virtual Network Peer Peer Peer Peer Peer Peer Peer Peer Virtual Mapping TCP/IP Physical Network NAT HTTP Firewall Physical Network
Peers • A peer • Unique identifier (UUID) • Addressable independently of its location (firewalls, NAT) • Multiple Peer “endpoint” address (TCP, HTTP, etc.) • Peer types • Minimal edge : send/receive • Full edge : + cache • Rendezvous : + fwd requests • Relay : +routing cache +firewall support
Peer Groups • Why Peer Groups? • Provide a “group” identity (common interest) • Create secure & protected domains • Scope peer operations (discovery, search, communications) • Enable monitoring NetPeerGroup PeerGroupA Peer ID Peer ID Peer ID Peer ID Peer ID Peer ID Peer ID Peer ID PeerGroupB
Every resource is represented by an advertisement Peer Peer group Pipe Service Content Peer status PeerGroup Advertisement: <?xml version="1.0"?> <!DOCTYPE jxta:PGA> <jxta:PGA> <GID> urn:jxta: uuid- BCBCDEABDBBBABEABBBABA000000 </GID> <MSID> urn:jxta:uuid- BFEFDEDFBABAFRUDBACE00000001 </MSID> <Name> My Group </Name> <Desc> This group is to be used for my own testing </Desc> </jxta:PGA> Advertisements
Input Pipe Output Pipe Peer Propagate Peer Propagate Pipe Receive Point-to-Point Pipe Peer Peer Send PeerGroup B Peer Group A Pipe: Virtual Communication Channel • Non-localized communication channel between two or more peers • Uni-directional • Asynchronous • Unreliable
Pipe Communication Model • Connect to services independently of their peer locations • Dynamic binding • At pipe creation or for every message sent • Build highly-available services • Transparent fail-over by reconnecting pipe endpoints • Pipeline multiple services to form complex service
Network Services • Peer Services • PeerGroup Services • Can be dynamically loaded
JXTA Protocol Stack Pipe Binding Protocol Peer Discovery Protocol Peer Info Protocol Peer Resolver Protocol Peer Endpoint Protocol Peer Rendezvous Protocol
JXTA Shell Peer Commands P2P Software Architecture Sun JXTAApplications JXTA Applications Community JXTA Applications Sun JXTA Services Indexing Searching File sharing Core JXTA Services Indexing Searching JXTAServices Community JXTA Services Peer Monitoring Peer Groups Peer Pipes JXTA Core Security Security Any Peer on the Expanded Web
JXTA: Core Services • Discovery Service • PeerInfo Service • Pipe Service • Resolver Service • Membership Service • Access Service
Query Propagation • Queries only propagated among rendezvous peers • Edge peers only receive direct queries for their own advertisements • Rendezvous peers self organize
DHT-based Resource Discovery • Edge peers publish indices of advertisements across Rdv network using Distributed Hash Tables (DHT) • DHTs are maintained by Rendezvous peers • Queries are directed to appropriate Rdv • If not found, a walk of the Rdv web is performed • Hash functions are pluggable
Loosely-Consistent DHT • Peers have high churn rate • Maintaining a consistent distributed index outweight the advantages of having one • Network crawling is expensive but does not have any maintenance cost
Rendezvous Peer View (RPV) • Each rendezvous peer maintains an ordered list of known rendezvous peer in the peergroup by their peer IDs • No strong consistency mechanism is used to enforce the consistency of the RPV across all rendezvous • Rendezvous periodically select random number of rendezvous from their RPV, and send them a random list of their known rendezvous
Finding Rendezvous Peers • Edge peers maintain lists of rendezvous peers • Dynamic fail-over when connection fails • Edge peers discover and cache Rdv advertisements • Seeding Rdvs are used to bootstrap • Auto-promotion to Rdv if none can be found in PeerGroup
JXTA Implementation Platforms • JXTA-J2SE Implementation (J2SE 1.4.1) • Full Implementation of JXTA Protocols • Tutorials and Programmer Guide • JXTA-C – recent results • JXTA 2.0 compliant • TCP transport • Others: Objective-C, Perl, Ruby, .Net
JXTA Community • Over 2,700,000 downloads • 120+ active projects • 18,000+ members • Active discussion groups • Community actively contributing and integrating technology WWW.JXTA.ORG
JXTA Bookshelf • JXTA: P2P Computing with Java, Sing Li, 2002 • JXTA, Brendon J. Wilson, 2002 • JXTA: Java P2P Programming, Daniel Brookshire et al, 2002 • Mastering JXTA Development, Joe Gradecki, 2002 • Java P2P Unleashed, Robert Flenner et al, 2002 • JXTA in a Nutshell, Scott Oaks et al, 2002 http://www.jxta.org/bookshelf.html
JXTA Technology Today • Enhanced Network and J2SE Platform • Mature, stable, secure, scalable platform. • 2.0 spec, code, demos, docs, and tutorials on-line • Public virtual network in place • Mix of large and small companies, government and education using technology for internal apps and product development • JXTA-C and JXME implementations available • Community Projects
JXTA Technology Tomorrow • Focus on stability, scalability and security • Integration with web services • New P2P services
Let's get started! • Hello JXTA ! • Resource discovery • Pipe communication • Discover and use a service Note: the following examples do not necessarily follow the exact API of the most recent version of JXTA. They are simply meant to illustrate the main concepts involved.
Hello JXTA ! import … public class SimpleJxtaApp { public static void main(String args[]) { try { // Create, and Start the default jxta NetPeerGroup PeerGroup netPeerGroup = PeerGroupFactory.newNetPeerGroup(); // Obtain the peer advertisement PeerAdvertisement myPeerAdv = netPeerGroup.getPeerAdvertisement(); //Get the discovery service DiscoveryService discovery = netPeerGroup.getDiscoveryService(); //Publish the peer advertisement discovery.publish(myPeerAdv); } catch (PeerGroupException pge) { pge.printStackTrace(); } }
Resource discovery • Discovery Listener • interface discoveryListener • discovery.addDiscoveryListener(this) • discovery.getRemoteAdvertisments • discoveryEvent (DiscoveryEvent ev)
Pipe communication • Receiver • interface: PipeMsgListener • pipeService.createInputPipe • pipeMsgEvent • Sender • interface: OuputPipeListener • pipeService.createOutputPipe • outputPipeEvent
JXTA Services • Server • Create a ModuleSpecAdvertisement • Include a pipe advertisement • Create the input pipe • Publish the advertisement • Read messages on the pipe (waitForMessage) • Client • Discover the ModuleSpecAdvertisement • Extract the pipe advertisement • Resolve the pipe advertisement and create an output pipe • Send a message on the pipe
juxmem group Data group cluster A group cluster B group JuxMem cluster C group Logical architecture Physical architecture
Goals ? • Ensure data availability even in presence of failure • Ensure data consistency JuxMem core (Mathieu Jan) • JuxMem core • ID • Communications (send / receive) • Publish / search (local and global)
Example: Building a Fault-Tolerant Consistency Protocol • Starting point: a home-based protocol for entry consistency • Relaxed consistency model • Explicit association of data to locks • MRSW : Multiple Reader Single Writer • acquire(L) • acquireRead(L) • Home-based protocol Home Home node Client
Problem: Inter-cluster Latency Higher than Intra-cluster Latency Home
Next Step: a Hierarchical Consistency Protocol • Inspired by CLRC[LIP6] and H2BRC[PARIS] Global home Local home Local home Client Local home
Problem: Critical Entities May Crash Question: how to support home crashes on a grid infrastructure ? Global home Local home Local home Client Local home
Solution: Replicate Critical EntitiesUsing Fault-Tolerant Components GDG : Global Data Group LDG : Local Data Group • Rely on replication techniques and group communication protocols used in fault-tolerant distributed systems GDG LDG LDG LDG Client