Title: JXTA%20Concepts
1JXTA Concepts
2Learning 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
3Peer-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
4Peer-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
5Protocols Drive Distributed Computing
TCP/IP
HTTP
JXTA
Client-Server
Web-based
Peer-to-Peer
6What is JXTA?
- An open set of XML-based protocols for creating
peer-to-peer style network computing applications
and services - Protocol based --gt language, OS, network, and
service agnostic technology - A virtual network overlay
- Defines mechanisms, not policies
- Open Source project www.jxta.org
7JXTA 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
8JXTA Protocol Stack
Standard Services Protocols (Optional)
Peer DiscoveryProtocol
Pipe BindingProtocol
Peer InfoProtocol
Peer RendezvousProtocol
Peer Resolver Protocol
Core Protocols (Required)
Peer Endpoint Protocol
9JXTA Virtual Network
JXTA Virtual Network
Peer
Peer
Peer
Peer
Peer
Peer
Peer
Peer
Virtual Mapping
TCP/IP
Physical Network
Firewall
NAT
HTTP
10UNIX? 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
11JXTA Virtual Network
Building Blocks
- 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
12JXTA Software Architecture
Sample Applications
JXTA Applications
Instant Messaging
File Sharing
Resource Sharing
Collaborative Apps
Auctions
JXTA Services
JXTA Services
Search
Indexing
Discover
Membership
JXTA Core
Peer Groups
Peer Pipes
Peer Monitoring
Peer Advertisements
Security
Peer IDs
Any Connected Device
13 14What 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
15JXTA Shell
16Starting the JXTA Shell
- Windows
- Select Programs -gt JXTA -gt 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
17Shell Commands
General Information
- Getting help
- JXTAgt man
- Verify rendezvous peer connection
- JXTAgt rdvstatus
- Access Shell history
- JXTAgt history0 man1 rdvstatus
- Use up, down arrows to access commands
- Use !ltnumbergt to access specific command
18Shell Commands
Current Peer Information
- Display information about current peer
- JXTAgt whoamiltPeergtmy Shelllt/PeergtltPeerIdgturnjxt
auuid-59616261646162614A78746150325033EFF0C0B7CD3
94BD1B9199E340B4A9E7A03lt/PeerIdgtltTransportAddress
gttcp//192.168.1.1029701/lt/TransportAddressgt...
19 20Peers
- 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)
21JXTA Network Uniform Addressing
- A Peer is identified by
- A unique Peer ID (UUID)
- Example Peer ID urnjxtauuid-59616261646162614A
78746150325033EFF0 C0B7CD394BD1B9199E340B4A9E7A03
- Unique Peer IDs
- Enable peers to be addressed independently of
their physical location (firewalls and NATs) in
the network
22Anatomy of a JXTA ID
URI
UUID Format
- urnjxtauuid-5961626161503...F825503
JXTA Namespace
ID Value
23Peer Endpoints
- Network interface(s) published by peer
- Example
- TCP/IP (tcp//129.127.29.659700)
- HTTP (http//JxtaHttpClientuuid-.)
- Used to establish point-to-point connections
between two peers - Direct connection not required
- Intermediary peers can route messages
24JXTA Peer Types
- Micro peers
- Standard peers
- Super peers
- Rendezvous peer
- Relay peer
- Proxy peer
25Shell Commands
Peers
- Display a list of all peers
- JXTAgt peerspeer0 name my Shellpeer1 name
JXTA.ORG 237... - Display peer IDs
- JXTAgt peers -lpeer0 ID uuid-59616261646162614A
78746150325033ED194F913EA14144810D91475606A91203
name myShell
26Shell Commands
Peer Discovery
- Initiate discovery of other peers
- JXTAgt peers -rpeer discovery message sent
- Flush all cached peers
- JXTAgt peers -f
27Relay 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
28Relay Peers
- Located outside firewalls and NATs
- Provide fast network connectivity
PeerID
PeerID
Relay Peer
PeerID
PeerID
PeerID
PeerID
Relay Peer
TCP/IP
Peer
Peer
Peer
Peer
Peer
NAT
Firewall
Peer
Peer
Peer
HTTP
Physical Network
29Message Routing via Relay Peers
Firewall
Firewall
Request Message
A
B
Super Peer
Peer
Peer
Peer
Send Message
Receive Message
30Message Routing Via Relay Peers
Multiple Relay Peers
Firewall
Firewall
Request Message
B
A
Super Peer
Peer
Peer
Peer
Receive Message
Relay Message
Send Message
Super Peer
31Rendezvous 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
32Request Propagation via Rendezvous Network
Additionalrendezvouspeers andother peers
Internet
JXTA Peer JXTA Rendezvous
JXTA Peer (uses R2)
C
JXTA Peer (uses R1)
JXTA Peer JXTA Rendezvous(knows R2 and R3)
A
Additionalrendezvouspeers andother peers
JXTA Peer (uses R1)
JXTA Peer JXTA Rendezvous
B
33Shell Commands
Rendezvous Status
- Display rendezvous status
- JXTAgt rdvstatusRendezvous Connection
Status_____________________________Is
Rendezvous falseRendezvous Connections - Rendezvous name ensd_1 Rendezvous name
dI_lab1 Rendezvous name JXTA.ORG
235Rendezvous Disconnections None -
34 35Peergroups
JXTA Virtual Network
Peer
Peer
Peer
Peer
Peer
Peer
Peer
Peer
Virtual Mapping
Physical Network
36Peergroups
- 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
37Why Peergroups?
- Create secure and protected domains
- Scope peer operations
- Discovery, search, communications
- Provide a group identity
- Group peers sharing a common interest
- Enable monitoring
38Peergroup Scoping
Internet
Firewall
Private PeerGroup
Private PeerGroup
JXTA Peer
JXTA Peer
Public PeerGroup
JXTA Peer
NetPeerGroup
39Private Peergroups
Firewall
Internet
Private PeerGroup
JXTA Peer
JXTA Peer
JXTA Peer
Private PeerGroup
NetPeerGroup
40Public and Private Peergroups
Public PeerGroup
Firewall
Internet
Firewall
Private PeerGroup
Private PeerGroup
JXTA Peer
JXTA Peer
JXTA Peer
Private PeerGroup
Private PeerGroup
NetPeerGroup
JXTA Peer
JXTA Peer
41Shell Commands
Discovering Creating Peergroups
- Initiate discovery
- JXTAgt groups -rgroup discovery message sent
- Display peergroups
- JXTAgt groupsgroup0 mygroupgroup1
some_other_group... - Create a peergroup
- JXTAgt mygroupadv mkadv -g mygroupJXTAgt mkpgrp
-d mygroupadv
42Shell Commands
Joining Peergroups
- Joining a new peergroup
- JXTAgt mkpgrp mygroup
- JXTAgt join mygroup
- Changing peergroup context
- JXTAgt chpgrp some_other_group
- group0 mygroupgroup1 some_other_group...
- Leaving current groups
- JXTAgt leave
43 44Advertisements
- 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
45Advertisements are XML Documents
PeerGroup Advertisement lt?xml
version"1.0"?gt lt!DOCTYPE jxtaPGAgt ltjxtaPGAgt ltG
IDgt urnjxta uuid-ABCBCDEABDBBBABEABBBABA000
0001234563 lt/GIDgt ltMSIDgt
urnjxtauuid-DEFDBFEFDEDFBABAFRUDBACE000000010206
lt/MSIDgt ltNamegt My Group lt/Namegt ltDescgt
This group is to be used for my own
testing lt/Descgt lt/jxtaPGAgt
46Peer Advertisement
lt?xml version"1.0"?gt lt!DOCTYPE jxtaPAgtltjxtaPA
xmlnsjxta"http//jxta.org"gt ltPIDgt urnjxtauu
id-59616261646162614A78746150325033 958A35814213
467EBC6C88D3C138B43903 lt/PIDgt ltGIDgt urnjxtaj
xta-NetGroup lt/GIDgt ltNamegt bill lt/Namegt ltSvc
gt ltParmgt ltjxtaRA xmlnsjxta"http//jxta.org
gt ltjxtaAPA xmlnsjxta"http//jxt
a.org"gt ltEAgt
http//192.18.190.1969700 lt/EAgt
ltEAgt
tcp//192.18.190.1969701 lt/EAgt
lt/jxtaAPAgt lt/Dstgt
lt/jxtaRAgt lt/Parmgt lt/Svcgtlt/jxtaPAgt
47Advertisement 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
48Resolver
Universal Binding Mechanism
- 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) - gt No Centralization Required !!
49Advertisement 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)
50Shell Commands
Make Advertisements
- Make a peergroup advertisement
- JXTAgt grpadv mkadv -g newgroupJXTAgt envgrpadv
PeerGroup Advertisement (class
net.jxta.impl.protocol.PeerGroupAdv)... - Display an advertisement
- JXTAgt cat grpadvlt?xml version"1.0"?gtlt!DOCTYPE
jxtaPGAgtltjxtaPGA xmlnsjxta"http//jxta.org"gt
ltGIDgt urnjxtauuid-20810AEF6C2F4711844 DA8C4
AE75D32502 lt/GIDgt...
51Shell Commands
Publish Advertisements
- Make an advertisement available to other peers
- JXTAgt share grpadv
52Shell Commands
Search for Advertisements
- Search for an advertisement
- JXTAgt search -rJXTA Advertisement search message
sent - Search for a specific advertisement
- JXTAgt search -aName -vChatJXTA Advertisement
adv0 (Search criteria Attribute"Name"
Value"Chat")JXTAgtcat adv0lt?xml
version"1.0"?gtlt!DOCTYPE jxtaMCAgtltjxtaMCA
xmlnsjxta"http//jxta.org"gt ... ltNamegt ChatS
ervice lt/Namegt - ...
53 54JXTA Pipes
Virtual Communication Channel
- 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
55Pipe Communication Abstraction Layer
Input Pipe
ServiceA
ServiceA
Output Pipe
Pipe
Output Pipe
ServiceC
Input Pipe
PipeEndpoint
PeerGroup
Pipe Binding
PeerID
PeerID
PeerID
PeerID
PeerID
PeerID
PeerID
PeerID
JXTA Virtual Network
Physical Network
Peer
Peer
Peer
Peer
Peer
Peer
Peer
Peer
NAT
HTTP
56Pipe Types
Input Pipe
Output Pipe
- Point-to-Point Pipe
- Connects exactly two peer endpoints together
- Propagate Pipe
- Connects one output pipe to multiple input pipes
Receive
A
B
Send
Receive
B
Receive
Receive
A
C
E
Send
Receive
D
Additional pipe types (e.g., secure, streaming,
reliable) can be created from the core types.
57Pipe 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
58Messages
- 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
59Shell Commands
Pipe Commands
- Create pipe advertisement
- JXTAgt myPipeAdv mkadv -p
- Create input and output pipes
- JXTAgt myInPipe mkpipe -i myPipeAdvJXTAgt
myOutPipe mkpipe -o myPipeAdv
60Shell Commands
Message Commands
- Create a file (myFile) containing message data
a set of arbitrary XML tags - ltDatagt Hello, JXTAlt/Datagt
- Import into the JXTA Shell
- JXTAgt importfile -f myFile myData
- Create a message
- JXTAgt myMsg mkmsgJXTAgt put myMsg myTag myData
61Shell Commands
Message Commands (continued)
- Send a message
- JXTAgt send myOutPipe myMsg
- Receive a message
- JXTAgt newMsg recv myInPiperecv has received a
message - Extract and display the message
- JXTAgt newData get newMsg myTagJXTAgt cat
newDatalt?xml version1.0?gtltShellDocgt ltItemgt
ltDatagtHello, JXTAlt/Datagt lt/Itemgtlt/ShellDocgt
62 63Services
- 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.)
64JXTA Core Peergroup Services
- Services to support a peergroup
- Discovery Service
- PeerInfo Service
- Pipe Service
- Resolver Service
- Membership Service
- Rendezvous Service
- Endpoint Service
65JXTA 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 -gt instantiating
new services)
66Module 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
67Security
- 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)
68Monitoring 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
- JXTAgt peerinfo -l
- Show metering
- JXTAgt monitor
69JXTA Concepts
Review
- JXTA virtual network
- JXTA software architecture
- JXTA objects
- Peers
- Peergroups
- Advertisements
- Pipes and messages
- Services
- Security
- Monitoring and metering
70End JXTA Concepts