2-1 jxta concepts. 2-1 learning objectives ● this module will help you... – understand p2p...

Post on 29-Jan-2016

215 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

2-1

JXTA ConceptsJXTA 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: www.jxta.org

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 DiscoveryProtocol

Pipe BindingProtocol

Peer InfoProtocol

Peer Resolver Protocol

Peer Endpoint Protocol

Peer Rendezvous

ProtocolCoreProtocols

(Required)

StandardServicesProtocols

(Optional)

2-1

JXTA Virtual Network

Firewall

NAT

Virtual Mapping

TCP/IP

PhysicalNetwork

HTTP

JXTA VirtualNetwork

Peer

Peer PeerPeer Peer

Peer PeerPeer

2-1

UNIX as a Model● Provide a simple set of abstractions to

build complex systems● “Virtualized” UNIX over the Internet

In JXTAIn JXTA● Universal IDsUniversal IDs● Everything is Everything is

represented as an represented as an advertisementadvertisement

● Peergroups as resource Peergroups as resource scoping mechanismscoping mechanism

● Pipes as virtual Pipes as virtual communication channelscommunication channels

● Resolver as distributed Resolver as distributed resource locatorresource locator

In UNIXIn UNIX● IDsIDs● Everything is Everything is

represented as a filerepresented as a file● Process as resource Process as resource

scoping mechanismscoping mechanism● Pipes as communication Pipes as communication

channelschannels● Filesystem as resource Filesystem as resource

locatorlocator

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 ArchitectureSample ApplicationsSample Applications

JXTA ServicesJXTA Services

JXTAApplications

JXTAServices

JXTACore

Peer GroupsPeer Groups Peer PipesPeer Pipes Peer MonitoringPeer Monitoring

Peer AdvertisementsPeer Advertisements SecuritySecurity

Any Connected Device

Peer IDsPeer IDs

SearchSearch IndexingIndexing DiscoverDiscover MembershipMembership

Instant MessagingInstant Messaging File SharingFile Sharing Resource SharingResource Sharing

Collaborative AppsCollaborative Apps AuctionsAuctions

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 helpJXTA> man

● Verify rendezvous peer connectionJXTA> rdvstatus

● Access Shell historyJXTA> history0 man1 rdvstatus

–Use up, down arrows to access commands–Use !<number> to access specific command

General Information

2-1

Shell Commands

● Display information about current peerJXTA> whoami<Peer>my Shell</Peer><PeerId>urn:jxta:uuid-59616261646162614A78746150325033EFF0C0B7CD394BD1B9199E340B4A9E7A03</PeerId><TransportAddress>tcp://192.168.1.102:9701/</TransportAddress>...

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-59616261646162614A78746150325033EFF0 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-5961626161503...F825503

2-1

Peer Endpoints

● Network interface(s) published by peer● Example:

– TCP/IP (tcp://129.127.29.65:9700)– HTTP (http://JxtaHttpClientuuid-….)

● 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 peersJXTA> peerspeer0: name = my Shellpeer1: name = JXTA.ORG 237...

● Display peer IDsJXTA> peers -lpeer0: ID = uuid-59616261646162614A78746150325033ED194F913EA14144810D91475606A91203 name = myShell

Peers

2-1

Shell Commands

● Initiate discovery of other peersJXTA> peers -rpeer discovery message sent

● Flush all cached peersJXTA> 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 Peer

Peer

Peer

Peer

Peer Peer

Peer

PeerID

PeerID

PeerID

PeerID

PeerID

PeerID

Relay Peer

Relay Peer

Firewall NAT

TCP/IP

Physical NetworkHTTP

2-1

Message Routing via Relay Peers

Firewall Firewall

Peer PeerPeerSuper Peer

SendMessage

ReceiveMessage

RequestMessage

A B

2-1

Message Routing Via Relay PeersMultiple Relay Peers

Firewall Firewall

Peer PeerPeer

Super Peer

SendMessage

ReceiveMessage

RequestMessage

A B

Super Peer

RelayMessage

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 PeerJXTA Rendezvous

JXTA Peer(uses R2)JXTA Peer

JXTA Rendezvous(knows R2 and R3)

Additionalrendezvouspeers andother peers

Additionalrendezvouspeers andother peers

JXTA PeerJXTA Rendezvous

Internet

AA

BB

CCR1R1R2R2

R3R3

2-1

Shell Commands

● Display rendezvous statusJXTA> rdvstatusRendezvous 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

PhysicalNetwork

JXTA VirtualNetwork

Peer

Peer PeerPeer

Peer

PeerPeer 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 PeerJXTA Peer

JXTA Peer

JXTA PublicJXTA PublicRelay/Rendezvous Relay/Rendezvous

InternetInternet

NetPeerGroupNetPeerGroup

Public PeerGroup

Private Private PeerGroupPeerGroup

Private Private PeerGroupPeerGroup

Peergroup Scoping

JXTA Peer

FirewallFirewall

2-1

Private Private PeerGroupPeerGroup

Private Peergroups

JXTA Peer

JXTA PublicJXTA PublicRelay/Rendezvous Relay/Rendezvous

InternetInternet

JXTA Peer

FirewallFirewall

JXTA PeerJXTA Peer

Private Private PeerGroupPeerGroup

NetPeerGroupNetPeerGroup

2-1

Public and Private Peergroups

Private Private PeerGroupPeerGroup

JXTA Peer

JXTA PublicJXTA PublicRelay/Rendezvous Relay/Rendezvous

InternetInternet

JXTA Peer

FirewallFirewall

JXTA PeerJXTA Peer

Private Private PeerGroupPeerGroup

NetPeerGroupNetPeerGroup

Private PeerGroupPrivate PeerGroup

JXTA PeerJXTA Peer JXTA PeerJXTA Peer

FirewallFirewall

JXTA PrivateJXTA PrivateRelay/Rendezvous Relay/Rendezvous

PrivatePrivatePeerGroupPeerGroup

Public PeerGroup

2-1

Shell Commands

● Initiate discoveryJXTA> groups -rgroup discovery message sent

● Display peergroupsJXTA> groupsgroup0: mygroupgroup1: some_other_group...

● Create a peergroupJXTA> mygroupadv = mkadv -g mygroupJXTA> mkpgrp -d mygroupadv

Discovering & Creating Peergroups

2-1

Shell Commands

● Joining a new peergroupJXTA> mkpgrp mygroup

JXTA> join mygroup

● Changing peergroup contextJXTA> chpgrp some_other_group

group0: mygroupgroup1: some_other_group...

● Leaving current groupsJXTA> 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 DocumentsPeerGroup Advertisement:

<?xml version="1.0"?><!DOCTYPE jxta:PGA><jxta:PGA>

<GID> urn:jxta: uuid-ABCBCDEABDBBBABEABBBABA0000001234563</GID><MSID> urn:jxta:uuid-DEFDBFEFDEDFBABAFRUDBACE000000010206</MSID><Name> My Group</Name><Desc> This group is to be used for my own testing</Desc>

</jxta:PGA>

2-1

Peer Advertisement<?xml version="1.0"?><!DOCTYPE jxta:PA><jxta:PA xmlns:jxta="http://jxta.org">

<PID>urn:jxta:uuid-59616261646162614A78746150325033958A35814213467EBC6C88D3C138B43903

</PID><GID>

urn:jxta:jxta-NetGroup</GID><Name>

bill</Name><Svc>

<Parm><jxta:RA xmlns:jxta="http://jxta.org”>

<jxta:APA xmlns:jxta="http://jxta.org"> <EA> http://192.18.190.196:9700 </EA> <EA> tcp://192.18.190.196:9701 </EA> </jxta:APA> </Dst> </jxta:RA>

</Parm></Svc>

</jxta:PA>

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> envgrpadv = PeerGroup Advertisement (class net.jxta.impl.protocol.PeerGroupAdv)...

● Display an advertisementJXTA> cat grpadv

<?xml version="1.0"?><!DOCTYPE jxta:PGA><jxta:PGA xmlns:jxta="http://jxta.org">

<GID>urn:jxta:uuid-20810AEF6C2F4711844DA8C4AE75D32502

</GID>...

Make Advertisements

2-1

Shell Commands

● Make an advertisement available to other peersJXTA> share grpadv

Publish Advertisements

2-1

Shell Commands

● Search for an advertisement– JXTA> search -rJXTA Advertisement search message sent

● Search for a specific advertisementJXTA> search -aName -vChat*

JXTA Advertisement adv0 (Search criteria: Attribute="Name" Value="Chat*")JXTA>cat adv0<?xml version="1.0"?><!DOCTYPE jxta:MCA><jxta:MCA xmlns:jxta="http://jxta.org">

...<Name>

ChatService</Name>

...

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 Input

PipePipe

Input Input PipePipe

ServiceServiceAA

JXTA Virtual Network

PeerGroup

Pipe

PipeEndpoint

Physical Network

Pipe Binding

Peer

HTTP

Peer

Peer

Peer Peer

Peer

NATPeer

Peer

PeerID

PeerID

PeerID

PeerID

PeerIDPeerID PeerID

PeerID

ServiceServiceAA

ServiceServiceCC

OutputOutput PiPipepeOutput Output

PipePipe

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, Additional pipe types (e.g., secure, streaming, reliable) can be created streaming, reliable) can be created

from the core types.from the core types.

AA BB

AA

BB

CC

DD

Send

Receive

Send

Receive

Receive

Receive

EE

Receive

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 advertisementJXTA> myPipeAdv = mkadv -p

● Create input and output pipesJXTA> myInPipe = mkpipe -i myPipeAdvJXTA> myOutPipe = mkpipe -o myPipeAdv

Pipe Commands

2-1

Shell Commands

● Create a file (myFile) containing message data – a set of arbitrary XML tags<Data> Hello, JXTA</Data>

● Import into the JXTA ShellJXTA> importfile -f myFile myData

● Create a messageJXTA> myMsg = mkmsgJXTA> put myMsg myTag myData

Message Commands

2-1

Shell Commands

● Send a messageJXTA> send myOutPipe myMsg

● Receive a messageJXTA> newMsg = recv myInPiperecv has received a message

● Extract and display the messageJXTA> newData = get newMsg myTagJXTA> cat newData<?xml version=”1.0”?><ShellDoc>

<Item><Data>Hello, JXTA</Data>

</Item></ShellDoc>

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 statisticsJXTA> 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 ConceptsEnd – JXTA Concepts

top related