2-1 JXTA Concepts
2-1 Learning Objectives ● This module will help you... – Understand P2P principles – Learn about JXTA virtual network core building blocks – Understand the JXTA software architecture – Gain familiarity with the JXTA shell
2-1 Peer-to-Peer Principles ● Build complex behaviors by juxtaposing elementary ones ● Replicate information towards consumer peers ● Discover and adapt to new information sources ● Increase performance as system ages and more peers participate ● Protect data by replicating information ● Build reliability from interchangeable peers
2-1 Peer-to-Peer Security Principles ● Individual Privacy – No centralized servers mean messages cannot be read or forged on a centralized mail server ● No central point of knowledge – Unconstrained content replication means it is difficult to deny access since nobody knows the exact location of all copies of a content ● Web of trust – Trust based on peer behaviors and other peers' accumulated trust level on that peer ● Localized contamination – Virus only transmitted to peer's neighbors – when a server is contaminated, all its clients are also contaminated ● Age does matter – Older peers are typically more known than newer peers – self-protect against new intruders
2-1 Protocols Drive Distributed Computing Peer-to-Peer Web-based Client-Server TCP/IP HTTP JXTA
2-1 What is JXTA? ● An open set of XML-based protocols for creating peer-to-peer style network computing applications and services – Protocol based --> language, OS, network, and service agnostic technology – A virtual network overlay – Defines mechanisms, not policies – Open Source project:
2-1 JXTA Protocols ● JXTA defines XML message formats, or protocols, for communication between peers ● Protocols used to discover peers, advertise and discover resources, communicate and route messages, and provide monitoring ● Asynchronous; based on query/response model ● Can be implemented in any language
2-1 JXTA Protocol Stack Peer Discovery Protocol Pipe Binding Protocol Peer Info Protocol Peer Resolver Protocol Peer Endpoint Protocol Peer Rendezvous Protocol Core Protocols (Required) Standard Services Protocols (Optional)
2-1 JXTA Virtual Network Firewall NAT Virtual Mapping TCP/IP Physical Network HTTP JXTA Virtual Network Peer
2-1 UNIX as a Model ● Provide a simple set of abstractions to build complex systems ● “Virtualized” UNIX over the Internet In JXTA ● Universal IDs ● Everything is represented as an advertisement ● Peergroups as resource scoping mechanism ● Pipes as virtual communication channels ● Resolver as distributed resource locator In UNIX ● IDs ● Everything is represented as a file ● Process as resource scoping mechanism ● Pipes as communication channels ● Filesystem as resource locator
2-1 JXTA Virtual Network ● Uniform peer addressing – Peer Ids ● Dynamically configurable peer domains – Peergroups ● Uniform resource representation – Advertisements ● Universal binding – Resolver = searching for advertisements ● Virtual communication channels – Pipes ● Security and Monitoring Building Blocks
2-1 JXTA Software Architecture Sample Applications JXTA Services JXTA Applications JXTA Services JXTA Core Peer Groups Peer Pipes Peer Monitoring Peer Advertisements Security Any Connected Device Peer IDs SearchIndexingDiscoverMembership Instant Messaging File Sharing Resource Sharing Collaborative Apps Auctions
2-1 JXTA Shell
2-1 What is the JXTA Shell? ● Interactive environment for the JXTA platform – Modeled after UNIX Shell – Executes within a network ● Basic commands – Discover peers/peergroups, join and leave peergroups, create pipes, and send messages ● Environment variables – Can bind symbolic names to JXTA objects
2-1 JXTA Shell
2-1 Starting the JXTA Shell ● Windows – Select Programs -> JXTA -> JXTA Shell from the Start Menu ● Other platforms demo% cd /files/JXTA_Demo/Shell demo% sh shell.sh ● JXTA Configuration Tool – Need to enter peer name and username/password
2-1 Shell Commands ● Getting help JXTA> man ● Verify rendezvous peer connection JXTA> rdvstatus ● Access Shell history JXTA> history 0 man 1 rdvstatus – Use up, down arrows to access commands – Use ! to access specific command General Information
2-1 Shell Commands ● Display information about current peer JXTA> whoami my Shell urn:jxta:uuid A EFF0C0B7CD394BD1B91 99E340B4A9E7A03 tcp:// :9701/... Current Peer Information
2-1 Peers
2-1 Peers ● Any networked device that implements one or more JXTA protocols – PC, server, PDA, cell phone, etc. ● Operate independently, asynchronously ● Spontaneously discover each other on the network – Transient relationships – Persistent relationships (peergroups)
2-1 JXTA Network Uniform Addressing ● A Peer is identified by: – A unique Peer ID (UUID) – Example Peer ID: urn:jxta:uuid A EFF0 C0B7CD394BD1B9199E340B4A9E7A03 ● Unique Peer IDs – Enable peers to be addressed independently of their physical location (firewalls and NATs) in the network
2-1 Anatomy of a JXTA ID URI JXTA Namespace UUID Format ID Value – urn:jxta:uuid F825503
2-1 Peer Endpoints ● Network interface(s) published by peer ● Example: – TCP/IP (tcp:// :9700) – HTTP ( ● Used to establish point-to-point connections between two peers ● Direct connection not required – Intermediary peers can route messages
2-1 JXTA Peer Types ● Micro peers ● Standard peers ● Super peers – Rendezvous peer – Relay peer – Proxy peer
2-1 Shell Commands ● Display a list of all peers JXTA> peers peer0: name = my Shell peer1: name = JXTA.ORG ● Display peer IDs JXTA> peers -l peer0: ID = uuid A ED194F913EA D A91203 name = myShell Peers
2-1 Shell Commands ● Initiate discovery of other peers JXTA> peers -r peer discovery message sent ● Flush all cached peers JXTA> peers -f Peer Discovery
2-1 Relay Peers ● Special peers used to route messages for other peers within the physical network – Support multi-hops message transfers – JXTA messages contain self-routing information – Relay peers maintain dynamic route information – Cache messages to temporarily unavailable, or non-reachable peers ● Any peer can become a Relay peer ● Primarily used for traversing firewalls and NATs ● Enable dynamic route discovery
2-1 Relay Peers ● Located outside firewalls and NATs ● Provide fast network connectivity Peer PeerID Relay Peer Firewall NAT TCP/IP Physical Network HTTP
2-1 Message Routing via Relay Peers Firewall Peer Super Peer Send Message Receive Message Request Message A B
2-1 Message Routing Via Relay Peers Multiple Relay Peers Firewall Peer Super Peer Send Message Receive Message Request Message A B Super Peer Relay Message
2-1 Rendezvous Peers ● Rendezvous organize themselves into a “semi-consistent” network ● Rendezvous maintain index of edge peers advertisements ● Queries only propagated within Rendezvous tree structure using different walkers (DHT, multicast, sequential walk) ● Each service in a peergroup may use its own Rendezvous tree for scoping purpose
2-1 Request Propagation via Rendezvous Network JXTA Peer (uses R1) JXTA Peer (uses R1) JXTA Peer JXTA Rendezvous JXTA Peer (uses R2) JXTA Peer JXTA Rendezvous (knows R2 and R3) Additional rendezvous peers and other peers JXTA Peer JXTA Rendezvous Internet A B C R1 R2 R3
2-1 Shell Commands ● Display rendezvous status JXTA> rdvstatus Rendezvous Connection Status: _____________________________ Is Rendezvous : [false] Rendezvous Connections : Rendezvous name: ensd_1 Rendezvous name: dI_lab1 Rendezvous name: JXTA.ORG 235 Rendezvous Disconnections : [None] Rendezvous Status
2-1 Peergroups
2-1 Peergroups Virtual Mapping Physical Network JXTA Virtual Network Peer
2-1 Peergroups ● Defined by users without requiring network administrators ● Identified by a unique “PeerGroup ID” ● Enable self-organization of peers (dynamic) ● Associate a set of services: PeerGroup services ● Configurable membership policy
2-1 Why Peergroups? ● Create secure and protected domains ● Scope peer operations – Discovery, search, communications ● Provide a “group” identity – Group peers sharing a common interest ● Enable monitoring
2-1 JXTA Peer JXTA Public Relay/Rendezvous Internet NetPeerGroup Public PeerGroup Private PeerGroup PrivatePeerGroup Peergroup Scoping JXTA Peer Firewall
2-1 PrivatePeerGroup Private Peergroups JXTA Peer JXTA Public Relay/Rendezvous Internet JXTA Peer Firewall Private PeerGroup NetPeerGroup
2-1 Public and Private Peergroups PrivatePeerGroup JXTA Peer JXTA Public Relay/Rendezvous Internet JXTA Peer Firewall Private PeerGroup NetPeerGroup JXTA Peer Firewall JXTA Private Relay/Rendezvous PrivatePeerGroup Public PeerGroup
2-1 Shell Commands ● Initiate discovery JXTA> groups -r group discovery message sent ● Display peergroups JXTA> groups group0: mygroup group1: some_other_group... ● Create a peergroup JXTA> mygroupadv = mkadv -g mygroup JXTA> mkpgrp -d mygroupadv Discovering & Creating Peergroups
2-1 Shell Commands ● Joining a new peergroup JXTA> mkpgrp mygroup JXTA> join mygroup ● Changing peergroup context JXTA> chpgrp some_other_group group0: mygroup group1: some_other_group... ● Leaving current groups JXTA> leave Joining Peergroups
2-1 Advertisements
2-1 Advertisements ● Every resource in the JXTA network is represented by an advertisement – Peer advertisement – PeerGroup advertisement – Pipe advertisement – Endpoint advertisement – Module advertisement – Content advertisement – PeerInfo advertisement
2-1 Advertisements are XML Documents PeerGroup Advertisement: urn:jxta: uuid-ABCBCDEABDBBBABEABBBABA urn:jxta:uuid-DEFDBFEFDEDFBABAFRUDBACE My Group This group is to be used for my own testing
2-1 Peer Advertisement urn:jxta:uuid A A EBC6C88D3C138B43903 urn:jxta:jxta-NetGroup bill tcp:// :9701
2-1 Advertisement Caching ● Peers cache advertisements (not required) ● Peers publish and discover advertisements ● Each advertisement is published with a time-to-live: – Relative expiration date – Advertisements are removed from the system when they have expired – Advertisements can be re-published
2-1 Resolver ● All traditional “binding” operations in the JXTA network are implemented as a search for an advertisement ● Examples: – DNS (searching for Peer or PeerGroup advertisements) – Service Location (searching for Module advertisements) – Directory Service (searching for Peer advertisements) – Socket Binding (searching for Pipe advertisements) – File systems (searching for Content advertisements) => No Centralization Required !! Universal Binding Mechanism
2-1 Advertisement Discovery & Searching ● Local Neighbor Discovery – TCP/IP multicast (subnet scope) ● Rendezvous Peers – Peers which have agreed to cache a large number of advertisements – Every peer may become a rendezvous peer – Discovery requests are forwarded between rendezvous peers – Each peer group has its own set of rendezvous ● Invitation – JXTA Business card (Peer/PeerGroup Advertisement) ● Distributed Indexes – Shared Resource Distributed Index (SRDI)
2-1 Shell Commands ● Make a peergroup advertisement – JXTA> grpadv = mkadv -g newgroup JXTA> env grpadv = PeerGroup Advertisement (class net.jxta.impl.protocol.PeerGroupAdv)... ● Display an advertisement JXTA> cat grpadv urn:jxta:uuid-20810AEF6C2F DA8C4AE75D Make Advertisements
2-1 Shell Commands ● Make an advertisement available to other peers JXTA> share grpadv Publish Advertisements
2-1 Shell Commands ● Search for an advertisement – JXTA> search -r JXTA Advertisement search message sent ● Search for a specific advertisement JXTA> search -aName -vChat* JXTA Advertisement adv0 (Search criteria: Attribute="Name" Value="Chat*") JXTA>cat adv0... ChatService... Search for Advertisements
2-1 Pipes and Messages
2-1 JXTA Pipes ● Non-localized communication channel between two or more peers – Asynchronous and unreliable – Unique “Pipe ID” – Pipe Advertisement – “Data-Typed” stream (XML schemas) – Input and output pipe endpoint (channel access point) – Dynamic peer binding Virtual Communication Channel
2-1 Pipe Communication Abstraction Layer Input Pipe Service A JXTA Virtual Network PeerGroup Pipe Pipe Endpoint Physical Network Pipe Binding Peer HTTP Peer NAT Peer PeerID Service A Service C Output Pipe
2-1 Pipe Types ● Point-to-Point Pipe – Connects exactly two peer endpoints together ● Propagate Pipe – Connects one output pipe to multiple input pipes Additional pipe types (e.g., secure, streaming, reliable) can be created from the core types. A B A B C D Send Receive Send Receive E Input Pipe Output Pipe
2-1 Pipe Communication Model ● Connect services independently of their peer locations ● Dynamic binding (at pipe creation or for every message sent) ● Asynchronous (connect & disconnect mode) ● Build highly-available services (transparent fail-over by reconnecting pipe endpoints) ● Pipeline multiple services to form complex service
2-1 Messages ● Object sent between JXTA peers – Message = basic unit of data exchange ● Ordered sequence of named/typed contents called Elements ● Each message contains its own routing information ● XML and binary representations used
2-1 Shell Commands ● Create pipe advertisement JXTA> myPipeAdv = mkadv -p ● Create input and output pipes JXTA> myInPipe = mkpipe -i myPipeAdv JXTA> myOutPipe = mkpipe -o myPipeAdv Pipe Commands
2-1 Shell Commands ● Create a file (myFile) containing message data – a set of arbitrary XML tags Hello, JXTA ● Import into the JXTA Shell JXTA> importfile -f myFile myData ● Create a message JXTA> myMsg = mkmsg JXTA> put myMsg myTag myData Message Commands
2-1 Shell Commands ● Send a message JXTA> send myOutPipe myMsg ● Receive a message JXTA> newMsg = recv myInPipe recv has received a message ● Extract and display the message JXTA> newData = get newMsg myTag JXTA> cat newData Hello, JXTA Message Commands (continued)
2-1 Modules and Services
2-1 Services ● Set of functions that a provider offers ● Provider peer publishes service advertisement ● Pipes used to communicate with service ● Types of services – Peer Services – Peer Group Services (discovery, membership, etc.)
2-1 JXTA “Core” Peergroup Services ● Services to support a peergroup – Discovery Service – PeerInfo Service – Pipe Service – Resolver Service – Membership Service – Rendezvous Service – Endpoint Service
2-1 JXTA Modules ● JXTA Heterogeneous network of peers needs a platform-independent service representation: – Module = platform-independent representation of a service – Service agnostic (WSDL, SOAP, RMI, ORB, etc) – Viral effect (joining a group -> instantiating new services)
2-1 Module Advertisements ● Module Class – Advertise the existence of a service ● Module Specification – Advertise how to access a service (API, messages) ● Module Implementation – Advertise a platform-specific implementation
2-1 Security ● Every peer has its own root certificate ● Public key certificate part of each Peer advertisement ● TLS Endpoint Transport (point-to-point secure pipe) ● Credential certificate embedded in every JXTA protocol messages ● Private Groups (membership policy)
2-1 Monitoring and Metering ● Provide generic framework to collect peer monitoring and metering information – Collect network traffic information – Service queue statistics – Accounting and billing ● Show peer info statistics JXTA> peerinfo -l ● Show metering JXTA> monitor
2-1 JXTA Concepts ● JXTA virtual network ● JXTA software architecture ● JXTA objects – Peers – Peergroups – Advertisements – Pipes and messages – Services ● Security ● Monitoring and metering Review
2-1 End – JXTA Concepts