JXTA PRESENTATION JXTA au CNAM

-JXTA was an evolution from UNIX to Java to XML and to P2P ... 2.-The set of six protocols (one, more/ not all). →(Implemented)-→API (Framework ... sharing, distributed file systems, resource aggregation and .... Rather, they are just Java language programs ... Instructions for downloading a pre-built version the JXTA Shell.
668KB taille 16 téléchargements 248 vues
JXTA PRESENTATION JXTA au CNAM

JXTA

PRESENTATION

Page 1 sur 26

1.0

JXTA ORIGIN

JXTA started as a research project by of Bill Joy and Mike Clary of Sun Microsystems, to address the short falls in P2P computing. -On Feb.15, 2001 Bill Joy poses JXTA initiatives at the O'Reilly P2P conference, in San Francisco USA. He compared P2P computing efforts of today with early instances of UNIX. -On April 25, 2001, Bill opened this Web site to the public during an online Web cast. It includes specifications, implementations, and the infrastructure to start collaboration among peers. -JXTA was an evolution from UNIX to Java to XML and to P2P computing: creating an open and a distributed platform for P2P communications.

Protocols Drive Distributed Computing

JXTA

PRESENTATION

Page 2 sur 26

2.0 WHAT IS JXTA 1.-JXTA means ‘juxtaposition’, which is putting side by side. It is a recognition that P2P model juxtaposed to client-server or Web-based computing, which today is traditional distributed computing model. 2.-The set of six protocols (one, more/ not all) !(Implemented)-!API (Framework /middleware)--!coded (by developers)--!Applications (distributed N2N)--!Downloaded (by users)-!JXTA_NET (JXTA virtual network).

3.-Project JXTA creates new programming platform designed to

solve a number of problems in modern distributed computing, especially in the area broadly referred to as peer-to-peer (P2P) computing.

JXTA

PRESENTATION

Page 3 sur 26

WHAT IS JXTA CONTIN……………… Conceived with a set of objectives, JXTA Project was intended to address the shortcomings of the peer-to-peer systems already in existence or under development: • Interoperability -Interconnected peers to easily locate each other, -communicate with each other, -participate in community-based activities, -offer services to each other across different P2P systems and different communities. • Platform independence -Independent of programming languages (such as C or the Java programming language), -system platforms (such as the Microsoft Windows and UNIX operating systems), -networking platforms (such as TCP/IP or Bluetooth). •

Ubiquity. -Implemented on any device with a digital heartbeat, including sensors, consumer electronics, PDAs, appliances, network routers, desktop computers, data-centre servers, and storage systems.

JXTA

PRESENTATION

Page 4 sur 26

3.0 NEED OF JXTA 1. JXTA enables developers to create services and a wide range of applications. – Sharing files, distributed search and indexing – Sharing CPU and storage resources – Instant messaging & devices communicating together – Collaborative work (and games) MMG – Web services, Sensor network – P2P distributed computing (Chat P2P,

2.

JXTA Sample Applications --myJXTA2 and PicShare

JXTA

PRESENTATION

Page 5 sur 26

4.0 JXTA ARCHITECTURE

1) Platform Layer (JXTA Core):-For P2P applications mechanism creation of peers, peer groups and associated security primitives. -Services Layer:-Is here P2P networks operate occur. Searching and indexing, directory, storage systems, file sharing, distributed file systems, resource aggregation and renting, protocol. -Applications Layer:-Where implementation of integrated applications P2P instant messaging, file sharing, entertainment, content management and delivery. 2) Three aspect of the JXTA architecture that distinguishes it from other distributed network models: - The use of XML documents (advertisements) to describe network resources. -Abstraction of pipes to peers and peer to endpoints without reliance upon a central naming/addressing authority such as DNS. -A uniform per addressing scheme (peer ID S) JXTA

PRESENTATION

Page 6 sur 26

5.0 JXTA CONCEPT The core that make up JXTA system are the very same that can be identified in many P2P network implementations. -Peers: - Networked devices that implement one or more of the protocols. Publish one or more network interface for use with the JXTA protocols. -Peer groups: - Collection of peers that have agreed upon a common set of services. Each identified by a unique ID. -Services:-Peers cooperate and communicate to publish rendering services. Peer Services and Peer Group Services. -Pipes: - Peers sent messages to one another. Point-toPoint Pipes, Propagated Pipes, and Secure unicast Pipes -Messages: Object sent between JXTA peers. Pipe services and Endpoint services send and receive messages. -Advertisements: JXTA protocols use them to describe and publish the existence of peer resources. Peers discover resources by looking for the corresponding advertisement. -Security: -Peers operate in a role-based trust model, in which peers act under authority granted by another trusted peer to perform a task. Five basic security requirements: -confidentiality -Authentication -Authorization -Data integration -refutability -IDs: Peers, peer groups, pipes and other JXTA resource need to be uniquely identifiable. It on 128 bits

JXTA

PRESENTATION

Page 7 sur 26

6.0 JXTA PROTOCOLS 1. JXTA protocols standardize the manner in which peers: I. II. III. IV. V.

Discover each other Self-organize into peer groups Advertise and discover network services Communicate with each other Monitor each other

2.

3. The Project JXTA protocols are composed of six protocols divided into two categories: • Core Specification Protocols • Standard Service Protocols 1- Core Specification protocols The JXTA protocols are implemented on small systems.

JXTA

PRESENTATION

Page 8 sur 26

• The Endpoint Routing Protocol (ERP):-Used by a peer in requesting

information on routing to another peer.

• Peer Resolver Protocol (PRP): A peer can send a generic resolver query to one/ more peers, and receive a response (or multiple responses) to the query. 2- Standard Service Protocols The JXTA Standard Services protocols are optional JXTA protocols to create a complete JXTA implementation. The Standard Services protocols specification defines four protocols: • The Rendezvous Protocol (RVP). A peer can subscribe or be a subscriber to propagation services. RVP uses the Peer Resolver Protocol, to propagate messages. • The Peer Discovery Protocol (PDP) Used to publish its own advertisements, and discovers advertisements from other peers (peer, peergroup, module, pipe and content).They use PRP for sending and propagating discovery advertisement requests. • The Peer Information Protocol (PIP) Obtaining status information about other peers, such as state, uptime, traffic load, capabilities, etc. PIP uses the PRP for sending and propagating peer information requests. • The Pipe Binding Protocol (PBP) Establishing a virtual communication channel, or pipe between one or more peers. Peers bind two or more pipe ends of the connection (input and output pipe) to a physical peer endpoint. PBP uses the PRP for sending and propagating pipe binding requests. JXTA

PRESENTATION

Page 9 sur 26

7.0 JXTA PEERGROUPS Peer groups:-Is a logical grouping of peers.

JXTA

PRESENTATION

Page 10 sur 26

JXTA PEERGROUP SERVICES CONTIN………

JXTA

PRESENTATION

Page 11 sur 26

10. JXTA APPLICATIONS 1. Research and University Activities • Grid Research – University of Indiana (US) – University of Melbourne (AUS), University of Malaysia • Compute Power Market Project – Cardiff University (UK) • GridOneD Project – IRISA (FR) -JUXMEM • Large-scale Distributed memory

2. Why Project JXTA in Research? • True Open Source – No licensing problems, BSD-based license – Global project with large, active community • Pluggable architecture – Walker / Greeter mechanism – Multi transports – XML protocols – Security models – Service Architecture • Works Today – IPv4 friendly – Multiple implementations, small to large devices – Sun commitment to technology

JXTA

PRESENTATION

Page 12 sur 26

11. JXTA SERVICES -some services are:

-JXTA services are available for shared use by peers within a peer group. In fact, a peer may join a group primarily to use the services available within that group. The following are details of some services: -Pipe Services: Main means of communications between peers; provides an abstraction for a one-way, asynchronous conduit for information transfer -Membership Services: Determines which peers belong to a peer group; handles arrival and departure of peers within a peer group -Access Services: Security service for controlling access to services and resources within a peer group; a sort of security manager for the peergroup -Discovery Services: -Way peers can discover each other, the existence of other peer groups, pipes, services, and the like. -Resolver Services: Allows peers to refer to each other, peer groups, pipes, or services indirectly through a reference (called an advertisement in JXTA lingo); the resolver binds the reference to an implementation at run time.

JXTA

PRESENTATION

Page 13 sur 26

12 JXTA SHELLS Networked Command-Line Interface JXTA Shell is used to interact with the JXTA platform core building blocks such as peers, peer groups, pipes, and codats. -You can publish, search, and execute codats, discover peers or peer groups, create pipes to connect two peers, and send and receive messages. The interpreter in the JXTA Shell accepts a command, interprets the command, executes the command, and then waits for another command. The shell displays a "JXTA>" prompt, to notify users that it is ready to accept a new command.

JXTA Shell Commands In Java-based implementation, most shell commands are not built in per se. Rather, they are just Java language programs that are dynamically loaded and started by the shell framework when the corresponding commands are typed in. Therefore, adding a new shell command is as easy as writing a program in the Java programming language.

Pipe Operator The JXTA Shell also supports piping in both directions, not just one. A special operator "" is used for creating crossing pipes between two commands. Jxta shell overview The Jxta shell is an application built on top of the Jxta Java Binding, the Jxta reference implementation in Java. The shell serves three basic purposes: JXTA

PRESENTATION

Page 14 sur 26

1. It demonstrates how easily you can build a meaningful application on top of Jxta. 2. It acts as a valuable reference for developers on how to use the Jxta APIs. 3. It serves as an environment where developers can directly interact with the Jxta platform without any programming. Thus, developers can get the concepts right even before they write any source code. Developers interact with the shell through user commands called shell commands. -The shell acts as an interpreter. First, the shell waits for a user command. Then, upon receiving the command, the shell executes it and waits for the next command. During the wait state, the shell displays a JXTA> prompt. The Jxta shell resembles the UNIX shell so that most developers would be familiar with it right away. For the same reason, most shell commands resemble UNIX commands as well. You will definitely notice these similarities as we proceed. Obtain and install the Jxta shell The first step is to get the shell running on your system. You need to download the shell from jxta.org. The shell comes with the Jxta demo, and the installable can be found in Resources. Download the installable appropriate for your operating system. Note that Jxta uses JDK 1.3.1; hence, you need at least version 1.3.1 of the JRE (Java Runtime Environment) for Jxta to run on your system. Once the download is complete, installation is straightforward, with an Install Anywhere wizard guiding you through the process. The default installation location is C:\Program Files\JXTA_Demo. Note that I use Windows NT as my operating system and hence use Windows conventions in this article; however you can easily find equivalents for other operating systems. Configure the Jxta shell The next step is to configure the shell. You can launch it by JXTA

PRESENTATION

Page 15 sur 26

using the Programs menu on your Windows machine. Alternatively, you could go to your installation location and launch the shell.exe application, available under the Shell subfolder. Once you launch the shell, a Jxta Configurator, as shown in the figure below, will greet you.

Obtaining the JXTA Shell Instructions for downloading a pre-built version the JXTA Shell to use for the experiments appear in this section. Provides alternative instructions for obtaining the latest version of the Shell from source control, and building the binaries. Running the JXTA Shell Provides details on how to configure the JXTA Shell application to connect to other peers; alternatively, provides instructions on how to run two JXTA shells on your own machine, so they can communicate with each other. This includes information on running the JXTA Shell as a JXTA router or resolver. Using the JXTA Shell This section walks the user through running commands within the JXTA Shell, allowing them to find other peers and peer groups, join and leave peer groups. A listing of the commands, Moreover, their meaning/operation/parameters are provided.

JXTA

PRESENTATION

Page 16 sur 26

13. JXTA SECURITY JXTA has adopted TLS version 1 for private connections between peers. Figure 1 shows an upper layer, the JXTA virtual TLS transport. The lower layer is the JXTA virtual network. Thus, we have the TLS transport multiplexing multiple pipe connections between two peers on the JXTA virtual network.

JXTA

PRESENTATION

Page 17 sur 26

14. DEMONSTRATIONS AND EXAMPLES 1. JXTA Programming Examples Simple “Hello World” -How to start JXTA from an Application -Accessing JXTA Services -Compiling and Running JXTA Application Import net.jxta.peergroup.PeerGroup; import net.jxta.peergroup.PeerGroupFactory; import net.jxta.exception.PeerGroupException; import net.jxta.discovery.DiscoveryService; import net.jxta.protocol.PeerAdvertisement; public class SimpleJxtaApp { public static void main(String args[]) { try { System.out.println ("Starting jxta ...."); // create, and Start the default jxta NetPeerGroup PeerGroup netPeerGroup = PeerGroupFactory.newNetPeerGroup(); // Obtain the group advertisement PeerAdvertisement myPeerAdv =netPeerGroup.getPeerAdvertisement(); System.out.println("Getting DiscoveryService"); DiscoveryService discovery = netPeerGroup.getDiscoveryService(); discovery.remotePublish(myPeerAdv, discovery.PEER,discovery.DEFAULT_EXPIRATION); System.out.println ("Good Bye ...."); } catch (PeerGroupException pge) { }

pge.printStackTrace();

} Compile and Run Hello World Compile and Run Hello World

JXTA

PRESENTATION

Page 18 sur 26

-Compile javac -classpath jxta.jar SimpleJxtaApp.java -Run java–classpath lib/jxta.jar:lib/log4j.jar:lib/beepcore.jar: lib/jxtasecurity.jar:lib/cryptix-asn1.jar: lib/cryptix32.jar:lib/jxtaptls.jar: lib/minimalBC.jar SimpleJxtaApp.

Starting jxta .... Getting DiscoveryService Good Bye ....

JXTA

PRESENTATION

Page 19 sur 26

15. J2SE AND J2ME 1. JXTA-J2SE is the first implementation of the JXTA Protocols. -- Proof of concepts for JXTA -- Serve as the Reference Implementation for the JXTA protocols -- http://spec.jxta.org/ -- Java because Java is a good for prototyping and testing new ideas --Others implementations include: C/C++, J2ME, Objective C, Perl, etc.

2. JXTA for mobile devices Some devices that run JXTA for J2ME™ API (non-exhaustive list) • Motorola’s i85, i90c, i95cl • Nokia’s 9290 Communicator • Samsung v205 • Siemens SL45i • Handspring Treo • Sharp Zaurus • Dallas Semiconductor’s TINI™ How to implement JXTA on a mobile device: Use JXTA with Java 2 Micro Edition (J2ME), which is well suited for mobile deployment due to: - its small virtual machine footprint, tools for easy development and device configuration, and - its profile specifications like CLDC (connection limited Device Configuration) and - MIDP (Mobile Information Device Profiles). - It used in higher-end J2ME profiles, such as the Personal Profile. The combination of JXTA for J2ME technology promises to increase interoperability, platform independence, and ubiquity in P2P mobile applications. JXME uses relays to connect lightweight mobile peers to the rest of the JXTA network. The relays themselves are rendezvous JXTA peers that have full capabilities to handle pipes, advertisements, and peer group services. Mobile peers communicate with relays through binary-over-HTTP connections

JXTA

PRESENTATION

Page 20 sur 26

using messages conforming to the JXTA Binary Message format. Relays offer a number of peer services to mobile peers: •

• •



A relay filters out unnecessary advertisements, and strips down those advertisements that are sent in order to save bandwidth. A relay routes (relays) messages to or from mobile peers. A relay translates the relayed messages from JXTA XML format to JXTA Binary Message format, and vice versa, in order to enable interoperability between mobile peers and ordinary peers. A relay acts as a proxy on behalf of its mobile peers. The relay interacts with other peers and pipes, and uses group services.

As developers, we do not need to worry about the exact format of the mobile-to-relay

In A nutshell • HTTP Relay --Relays messages between HTTP clients

JXTA

PRESENTATION

Page 21 sur 26

--Stores messages for disconnected operations • JXTA Proxy --Stores JXTA Advertisements --Filters JXTA traffic --Trims incoming messages -- Processes JXTA XML messages and converts them to a compact, binary, Easy-to-parse format ay Details • Runs on publicly addressable peers • Connects peers behind NAT and/or firewall • Provides message store for disconnected operations • Handles lease management • Generates JXTA-ID for JXTA for J2ME™ peers • Uses TCP and HTTP protocols • Gets and posts messages in a single round-trip to minimize latency Proxy Details • Is a JXTA Service • Provides services for client that -- Have limited storage -- Are on networks with limited bandwidth • Translates client requests to JXTA protocols and vice versa --Currently supports Discovery and Pipe protocols • Is asynchronous

JXTA

PRESENTATION

Page 22 sur 26

16. FUTURE OF JXTA Developed by Sun Microsystems and released to the community in April 2001, JXTA is an open, generalised peer-to-peer platform that allows any connected device on the network to communicate and collaborate. JXTA can be applied across multiple platforms including the Java 2 Platform, Standard Edition (J2SE), Java 2 Platform, Micro Edition (J2ME), C platform, PERL, Python, Ruby, and TINI and accessed by any device on the network including cell phones, two-way pagers, electronic sensors, PDAs, desktop computers, and servers. JXTA-Based Commercial Applications InView Software (www.inviewsoftware.com) and Internet Access Methods (www.iamethods.com) are part of a range of companies that are expected to release commercial products that leverage the collaborative strengths of the JXTA platform this year. InView Software developed its Momentum application using JXTA technology as its peer-to-peer communications infrastructure layer. Momentum enables file sharing and collaboration between users on the Solaris Operating Environment, Linux and Windows workstations. Users create workspaces containing files that they would like to share, and then invite other users to join that workspace. Momentum users can work collaboratively on documents such as drawings, charts, or timelines. Internet Access Methods built IAM-Developing, a collaborative Java Integrated Development Environment (IDE), using JXTA technology. IAM-Developing works across multiple plaforms. The product enables multiple developers to work securely on the same piece of source code, and see modifications made by others in real time across corporate firewalls.

JXTA

PRESENTATION

Page 23 sur 26

About Project JXTA JXTA can be applied across multiple platforms including the Java 2 Platform, Standard Edition (J2SE), Java 2 Platform, Micro Edition (J2ME), C language, and others. Any device on the network including cell phones, two-way pagers, electronic sensors, PDAs, desktop computers and servers, can be connected using JXTA. Sun Professional Services, is at the forefront of helping: -organizations leverage JXTA to deliver services to the Web, - engineering architectures to support pervasive -- any device, anywhere, any time -- access. In 2002, JXTA technology was awarded the "Most Innovative Java Product or Technology Award" from JavaWorld Magazine and the "Outstanding Group Contribution to Java Technology" from JavaPro Magazine.

JXTA

PRESENTATION

Page 24 sur 26

17. CONCLUSION -In conclusion, JXTA is an open, generalized peer-to-peer platform that allows any connected device on the network to communicate and collaborate. Sun Microsystems developed and released JXTA to the open source community in April 2001. Since JXTA, technology makes it easier and faster for developers and companies to create and deploy interoperable applications in a distributed and cross-platform environment. -Presently JXTA can be implemented on the -J2SE platform implementation and –J2ME platform implementation which is also between 2 modules; a JXTA peer, running on the MIDP device, and a JXTA relay, which is running on any device as a proxy of the JXTA network. -Combining JXTA and J2ME allows developers to design P2P applications for mobile devices, bringing the power of the Web and the potential of P2P networks and communities to the mobile world. Finally, P2P networking is coming, and promises to create computing world fundamentally different- and, in some ways, better –than the one based on the old client /server model.

JXTA

PRESENTATION

Page 25 sur 26

18. BIBLIOGRAGHY 1. On Sun web site: http://www.jxta.org/ • Li. Gong, JXTA: A Network Programming Environment and Internet Computing .Online, May/June, Vol.5 No. pp. 88-95. • S. Li, Early Adopter JXTA: Peer-to-Peer Computing with Java”, Wrox Press Inc, December 2001. • http://www-106.ibm.com/developerswork/java/library/jp2pint1.html • Simple and easy to use API • Visit http://jxme.jxta.org for the source code, White papers, API documentation, sample Applications and programmer’s guide • Send emails to [email protected] for help

JXTA

PRESENTATION

Page 26 sur 26