JXTA overview - SOR Group Home Page - LIP6

bricklayerbelchedInternet and Web Development

Feb 5, 2013 (3 years and 10 months ago)

105 views

JXTA

2

Acknowledgements

Bernard Traversat

Project JXTA

Sun Microsystems

Santa Clara, CA

Gabriel Antoniu

IRISA/INRIA Rennes

Projet Paris

3


P2P is an instance of our vision



“The Network Is the Computer™”



Advance Sun products' readiness for P2P

Sun's Interest in Peer
-
to
-
Peer

4

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

5

JXTA Virtual Network

JXTA Chat

(MIDP)

MyJXTA

(J2SE on Windows)

JXTA
-
C Shell

(C on Solaris)

JXTA Interoperability:

Any Platform, Any Network

6

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.


7

JXTA Services and
Applications


Distributed storage and data sharing


Search, indexing and file sharing



Large scale distributed computing



P2P messaging and collaboration tools


8

JXTA Virtual Network

Physical Network

Firewall

NAT



Virtual Mapping

TCP/IP



Physical

Network

HTTP

Project JXTA

Virtual Network

Peer

Peer

Peer

Peer

Peer

Peer

Peer

Peer

9

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

10

Peer Groups


Why Peer Groups?


Provide a “group” identity (common interest)


Create secure & protected domains


Scope peer operations (discovery, search, communications)


Enable monitoring


Peer
ID

Peer
ID

Peer
ID

Peer
ID

Peer
ID

Peer
ID

Peer
ID

Peer
ID

NetPeerGroup

PeerGroupA

PeerGroupB

11

Advertisements


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
-


BCBCDEABDBBBABEABBBABA000
000


</GID>


<MSID>



urn:jxta:uuid
-

BFEFDEDFBABAFRUDBACE00000
001


</MSID>


<Name>



My Group


</Name>


<Desc>



This group is to be used for my own
testing


</Desc>

</jxta:PGA>


12

Pipe: Virtual Communication
Channel


Non
-
localized
communication channel
between two or more
peers


Uni
-
directional


Asynchronous


Unreliable

Peer Group A

Input Pipe

Output Pipe

Peer

Peer

Peer

Peer

PeerGroup B

Send

Receive

Point
-
to
-
Point


Pipe

Propagate


Pipe

Propagate

13


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

14

Network Services


Peer Services



PeerGroup Services



Can be dynamically loaded

15

JXTA Protocol Stack


Peer Resolver Protocol



Peer Rendezvous

Protocol



Peer Endpoint

Protocol



Peer Discovery

Protocol



Pipe Binding

Protocol



Peer Info

Protocol


16

Community JXTA
Services

Community JXTA Applications

Security

Security

Peer Groups

Sun

JXTA

Applications

Peer Pipes

Peer
Monitoring

JXTA Shell




Peer

Commands

Any Peer on the Expanded Web

JXTA

Applications

JXTA

Services

JXTA

Core

Sun JXTA
Services


Indexing

Searching

File sharing

Core JXTA
Services


Indexing

Searching


P2P Software Architecture

17

JXTA: Core Services


Discovery Service


PeerInfo Service


Pipe Service


Resolver Service



Membership Service


Access Service


18

Query Propagation


Queries

only

propagated

among

rendezvous

peers


Edge

peers

only

receive

direct

queries

for

their

own

advertisements


Rendezvous

peers

self

organize

19

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

20

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


21

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

22

Publish advertisement

23

Search advertisement

24

Inconsistent view

25

Limited
-
range walker

26

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

27

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

28

WWW.JXTA.ORG

JXTA Community


Over 2,700,000
downloads


120+ active projects


18,000+ members


Active discussion
groups


Community actively
contributing and
integrating
technology

29

http://www.jxta.org/bookshelf.html


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


JXTA Bookshelf

30

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


31

JXTA Technology Tomorrow


Focus on stability, scalability and
security


Integration with web services


New P2P services


32

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.

33

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();


}

}


34

Resource discovery


Discovery Listener


interface discoveryListener


discovery.addDiscoveryListener(this)


discovery.getRemoteAdvertisments


discoveryEvent (DiscoveryEvent ev)

35

Pipe communication


Receiver


interface: PipeMsgListener


pipeService.createInputPipe


pipeMsgEvent



Sender


interface: OuputPipeListener


pipeService.createOutputPipe


outputPipeEvent

36

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

37

JuxMem

j
uxmem group

cluster

A group

cluster

B group


cluster

C group

Data group

Physical architecture

Logical architecture

38

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)

39

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 node

Client

Home

40

A Home
-
Based Protocol
Scheme

Home

41

Problem: Inter
-
cluster Latency

Higher than Intra
-
cluster Latency

Home

42

Next Step:

a Hierarchical Consistency Protocol

Local
home

Local
home

Local
home

Client

Global

home


Inspired by CLRC[LIP6] and H2BRC[PARIS]

43

Problem: Critical Entities May
Crash

Local
home

Local
home

Local
home

Client

Global

home

Question: how to support
home

crashes on a grid
infrastructure ?

44

Solution: Replicate Critical Entities

Using Fault
-
Tolerant Components

LDG

Client

GDG

LDG

LDG


Rely on replication techniques and group communication
protocols used in fault
-
tolerant distributed systems

GDG : Global Data Group

LDG : Local Data Group