Jxta Tutorial Part1a

Embed Size (px)

Citation preview

  • 8/3/2019 Jxta Tutorial Part1a

    1/50

    1

    Project JXTA Guide to a peer-to-peer

    frameworkEkaterina ChtcherbinaSiemens AG, Corporate TechnologyMunich

    Thomas WielandSiemens AG, MunichUniversity of Applied Sciences, Coburg

  • 8/3/2019 Jxta Tutorial Part1a

    2/50

    2 Siemens CT, Chtcherbina/Wieland, 2002

    High-level agenda

    !

    Introduction! Peer-to-Peer Computing

    !

    The Project JXTA! JXTA Concepts

    ! JXTA Protocols

    ! "Hello JXTA-World"

  • 8/3/2019 Jxta Tutorial Part1a

    3/50

    3

    Introduction: Benefits of

    Peer-to-Peer Computing

  • 8/3/2019 Jxta Tutorial Part1a

    4/504 Siemens CT, Chtcherbina/Wieland, 2002

    5 Myths about P2P

    !

    It is always fully decentralized! P2P is about People-to-People

    communication

    ! It is only about file sharing

    ! P2P is not secure

    ! P2P is not scalable

  • 8/3/2019 Jxta Tutorial Part1a

    5/505 Siemens CT, Chtcherbina/Wieland, 2002

    Distributed Search

  • 8/3/2019 Jxta Tutorial Part1a

    6/506 Siemens CT, Chtcherbina/Wieland, 2002

    Multi-user applications and

    games

  • 8/3/2019 Jxta Tutorial Part1a

    7/50

    7 Siemens CT, Chtcherbina/Wieland, 2002

    Auctions

  • 8/3/2019 Jxta Tutorial Part1a

    8/50

    8 Siemens CT, Chtcherbina/Wieland, 2002

    Collaboration

  • 8/3/2019 Jxta Tutorial Part1a

    9/50

    9 Siemens CT, Chtcherbina/Wieland, 2002

    Resource sharing

  • 8/3/2019 Jxta Tutorial Part1a

    10/50

    10 Siemens CT, Chtcherbina/Wieland, 2002

    Distributed storage and file

    sharing

  • 8/3/2019 Jxta Tutorial Part1a

    11/50

    11 Siemens CT, Chtcherbina/Wieland, 2002

    Blackboards

  • 8/3/2019 Jxta Tutorial Part1a

    12/50

    12 Siemens CT, Chtcherbina/Wieland, 2002

    Examples of P2P

    Applications! Building facilities (sensor equipment)

    ! Collaboration work support (developmenttools, data sharing)

    !

    Medicine (effective collaboration, filesharing, distributed data processing)

    ! Building site automatization

    ! Business & entertainment communicationsupport

    ! Cars (driver support, location based

    services, car tracking)

  • 8/3/2019 Jxta Tutorial Part1a

    13/50

    13

    Peer-to-Peer Computing

  • 8/3/2019 Jxta Tutorial Part1a

    14/50

    14 Siemens CT, Chtcherbina/Wieland, 2002

    What is Peer-to-Peer

    Networking?! Traditional P2P network definition (comp. sc.

    encyclopedia):A type of network in which each workstation hasequivalent capabilities and responsibilities. This differsfrom client/server architectures, in which some computersare dedicated to serving others.

    ! Our P2P network definition:An adaptive, self-configuringnetwork which does not rely oncentral servers. The peers in aP2P network are devices that canact as both servers and clients(servents).

  • 8/3/2019 Jxta Tutorial Part1a

    15/50

    15 Siemens CT, Chtcherbina/Wieland, 2002

    Disadvantages of

    Client/Server Systems! Central servers (or server clusters)

    are potential bottlenecks and singlepoints of failure of distributed

    systems" P2P allows for efficient use of

    resources and robustness

  • 8/3/2019 Jxta Tutorial Part1a

    16/50

    16 Siemens CT, Chtcherbina/Wieland, 2002

    Peer-to-peer and Ad Hoc

    Networks! Ad hoc networks require self-

    configuration! Dynamic environment, unstable connectivity,

    infrastructureless

    ! Issues: addressing, service discovery &advertisement, dynamic service composition,connection mgt., routing

    " P2P enables self-configuration ofdynamic distributed systems

  • 8/3/2019 Jxta Tutorial Part1a

    17/50

    17 Siemens CT, Chtcherbina/Wieland, 2002

    Messages in C/S and P2P

    Server

    ServerCache

    Traditional trafficcongestion zone

    Client

    Client

    Client

    Client

    Client

    ClientClient

    Client

    Peer

    Peer

    Peer

    Peer

    Peer

    Peer Peer

    Peer

  • 8/3/2019 Jxta Tutorial Part1a

    18/50

    18 Siemens CT, Chtcherbina/Wieland, 2002

    Centralized Distributed

    Computing! Distributed networking technologies

    such as DCOM, CORBA and WebServices currently rely on a priori

    known directory servers (registry,naming server, UDDI, etc.)

    DatabaseServer

    ServiceClient

    1.

    3.

    2.

  • 8/3/2019 Jxta Tutorial Part1a

    19/50

    19 Siemens CT, Chtcherbina/Wieland, 2002

    Centralized Distributed

    Computing (2)! Distributed auto-configuration

    technologies such as Jini also rely ondirectory servers

    " P2P plug and play technologiessuch as UPnP are more suitable forinfrastructureless environments

    Peer

    Peer

    Peer

    Peer

    Peer

  • 8/3/2019 Jxta Tutorial Part1a

    20/50

    20 Siemens CT, Chtcherbina/Wieland, 2002

    Special Features! Decentralized

    ! Scalability/Redundancy/Fault tolerance

    ! P2P networks scale well with increasing

    numbers of users! Multiple distributed copies of of frequently

    accessed resources

    ! Nondeterministic! Peers can appear and vanish spontaneously

    ! Behaviour is less predictable

  • 8/3/2019 Jxta Tutorial Part1a

    21/50

    21 Siemens CT, Chtcherbina/Wieland, 2002

    Requirements for P2P

    Systems! Metadata/Interoperability

    ! When are they essentially independent ?

    ! Encapsulation? Privacy? Trust?

    ! Discovery! Who is out there ?

    ! How do I reach them ?

    !

    Messaging! QoS Security Trust/Reputation

    ! Peer-to-peer interaction issues

  • 8/3/2019 Jxta Tutorial Part1a

    22/50

    22

    Security in P2P Networks

  • 8/3/2019 Jxta Tutorial Part1a

    23/50

    23 Siemens CT, Chtcherbina/Wieland, 2002

    Security Issues! Authentication

    ! The process of determining whether or notsome entity is in fact who that entity declaresitself to be.

    ! Authorization! Process of giving an authenticated entity

    permissions to do some action or access some

    resource! Encryption and confidentiality

    ! Integrity

  • 8/3/2019 Jxta Tutorial Part1a

    24/50

    24 Siemens CT, Chtcherbina/Wieland, 2002

    Challenges in P2P Systems! Memberships and groups are dynamic

    ! People do not trust each other! Each peer is untrusted! Peers don't have trust relationships

    ! Unpredictable network latencies! Firewalls and other barriers! No central services (especially no directory)! Individuals can cause local damage that spreads

    ! Every peer may run run different software! Code may be mobile! Complex systems: hard to understand

  • 8/3/2019 Jxta Tutorial Part1a

    25/50

    25 Siemens CT, Chtcherbina/Wieland, 2002

    Solutions! Mostly based on "web of trust"

    ! A trusts B, B trusts C, so A can also trust C! Users exchange their public keys and encrypt messages

    with their private keys! Enrich by reputations

    Assign reputations to entities Allow others to retrieve reputations Use reputation to build trust relationships Example: eBay

    !

    Alternative: centrally issued group membershipcertificates (PKI)! Introduces dependencies from a server-like

    infrastructure component

    F th P ibl S it

  • 8/3/2019 Jxta Tutorial Part1a

    26/50

    26 Siemens CT, Chtcherbina/Wieland, 2002

    Further Possible Security

    Tools! Encryption

    ! Authentication

    ! Firewalls

    ! May be installed on each peer! Drawbacks: Block all traffic on port, not

    application; generally static rulesets

    ! Sandboxes! Essential for mobile code systems!

    ! E.g. in Java/JVM, .NET/CLR

  • 8/3/2019 Jxta Tutorial Part1a

    27/50

    27

    Search in P2P Networks

    Di t ib t d S h

  • 8/3/2019 Jxta Tutorial Part1a

    28/50

    28 Siemens CT, Chtcherbina/Wieland, 2002

    Distributed Search:

    Network Topology Based

    Centralized(e.g. Napster)

    Decentralized(e.g. Gnutella)

    !Relies on the organization of the peers within thenetwork to route requests

    !Optimization focuses on the reduction of the

    diameter (no. of hops, round trip time) of thegraph representing the distributed network

    Di t ib ted Se h Content

  • 8/3/2019 Jxta Tutorial Part1a

    29/50

    29 Siemens CT, Chtcherbina/Wieland, 2002

    Distributed Search: Content

    Mapping Based! Content addressable networks:

    distributed hash table. Content (orpointer to content) is stored in assignedpeers

    " not a practical approach for contentdescribed by multiple attributes

    ! Publish/subscribe networks: peers agreeon a certain query and advertisementtemplate. Content based routing.

  • 8/3/2019 Jxta Tutorial Part1a

    30/50

    30 Siemens CT, Chtcherbina/Wieland, 2002

    Hybrid approach:

    locally centralized +globally decentralized +publish/subscribe

    (e.g. JXTA Search)

    Hybrid Search

    $ No perfect solution, choice

    depends on the application

    SuperPeer

    Support for Message

  • 8/3/2019 Jxta Tutorial Part1a

    31/50

    31 Siemens CT, Chtcherbina/Wieland, 2002

    Support for Message

    Exchange! Routing in multi-hop ad hoc networks

    ! Caching mechanism (relaying) for overcoming! Disruptive connectivity

    ! Firewalls

    RelayPeer

    MobilePeer

    PeerA

    PeerB

    Firewall

    Peer

    C

    RelayPeer

    Polling

  • 8/3/2019 Jxta Tutorial Part1a

    32/50

    32 Siemens CT, Chtcherbina/Wieland, 2002

    Peer-to-Peer Systems! P2P platforms

    ! Sun Microsystems:JXTA

    ! Distributed computing

    ! SETI@home! Entropia

    ! File sharing

    ! Freenet! Gnutella

    ! KaZaA

    ! Messaging

    frameworks! Open Source: Jabber

    ! Collaboration

    ! Engenia Software, Inc

    ! Others

    ! Magi: Endevors

  • 8/3/2019 Jxta Tutorial Part1a

    33/50

    33

    Project JXTA

  • 8/3/2019 Jxta Tutorial Part1a

    34/50

    34 Siemens CT, Chtcherbina/Wieland, 2002

    What is JXTA?conceptual framework for Peer-to-Peer applications

    ! serves as a specification, an effort to create acommon platform for building distributed servicesand applications

    ! neither a standalone Peer-to-Peer application nora concrete framework implementation!

    ! But: Sun has provided a reference implementation(in Java) which incorporates the specifiedcomponents

    ! Napster, Gnutella, Freenet & Co. provide userswith limited ability to share resources and are

    unable to share data with other, similarapplications

  • 8/3/2019 Jxta Tutorial Part1a

    35/50

    35 Siemens CT, Chtcherbina/Wieland, 2002

    The Project JXTA! Started as a research project at Sun

    Microsystems by Chief Scientist Bill Joy! First official release of a Java reference

    implementation in April 2001

    ! Since then put under an open-source license

    The name JXTA is derived from the wordjuxtapose,meaning to place two entities side-by-side or in close

    proximity. By choosing this name, the developmentteam at Sun recognized that P2P solutions wouldalways exist alongside the current client/serversolutions, rather than replacing them completely.

    Brendon Wilson

  • 8/3/2019 Jxta Tutorial Part1a

    36/50

    36 Siemens CT, Chtcherbina/Wieland, 2002

    Key Assumptions! Platform Independence (any language, any OS, any

    hardware)! But: JXTA dependence! Allow for absolute heterogeneity of peers! Highly unreliable & changing network

    environment! Asynchronous,Unreliable,Uni-directional

    transport! Idempotent protocol exchanges No protocol

    state! Applications to build their own security &

    encryption models

  • 8/3/2019 Jxta Tutorial Part1a

    37/50

    37 Siemens CT, Chtcherbina/Wieland, 2002

    Technology! JXTA technology is based on XML, Java

    technology, and key concepts of UNIXoperating system! Transmitted information is packaged as

    messages! Messages define an XML envelop to transferany kind of data

    ! The use of Java language is not required! JXTA protocols can be implemented in C,

    C++, Perl, or any other programminglanguage

  • 8/3/2019 Jxta Tutorial Part1a

    38/50

    38

    JXTA Concepts

  • 8/3/2019 Jxta Tutorial Part1a

    39/50

    39 Siemens CT, Chtcherbina/Wieland, 2002

    JXTA ArchitectureApplication Level

    JXTA Services

    JXTA Platform

    pipes peers peer groups

    Components

    resolver pipe discovery membership

    peer groups

    Core Services

    propagation service

    router and relay services

    transports

  • 8/3/2019 Jxta Tutorial Part1a

    40/50

    40 Siemens CT, Chtcherbina/Wieland, 2002

    Key Aspects! XML documents (advertisements)

    used to describe network resources

    ! Abstraction of pipes to peers, and

    peers to endpoints! without reliance upon a central

    naming/addressing authority! A uniform peer addressing scheme

    (peer IDs)

  • 8/3/2019 Jxta Tutorial Part1a

    41/50

    41 Siemens CT, Chtcherbina/Wieland, 2002

    Peers and Peer Groups

    Peer

    Peer Group

    Net Peer Group

  • 8/3/2019 Jxta Tutorial Part1a

    42/50

    42 Siemens CT, Chtcherbina/Wieland, 2002

    Pipes

    Peer A

    Peer B

    Point-to-point pipe

    Peer A

    Peer B

    Peer C

    Peer D

    Peer E

    Propagate pipe

  • 8/3/2019 Jxta Tutorial Part1a

    43/50

    43 Siemens CT, Chtcherbina/Wieland, 2002

    Advertisements! Representation of JXTA resources

    ! Like peers, peer groups, pipes etc.

    ! Metadata structures

    ! Used to decribe and publish peerresources, e.g.! Peer advertisement: Comprises name, ID,

    endpoints, etc.

    ! Peer group advertisement: name, ID,decription, specification

    ! Pipe advertisement: ID, pipe type

  • 8/3/2019 Jxta Tutorial Part1a

    44/50

    44 Siemens CT, Chtcherbina/Wieland, 2002

    Kinds of peers! Minimal peer

    ! Simple peer

    ! Rendevour peer

    ! Relay peer

  • 8/3/2019 Jxta Tutorial Part1a

    45/50

    45 Siemens CT, Chtcherbina/Wieland, 2002

    Security in JXTA! Usual issues

    ! Confidentiality, integrity, availability - authentication, accesscontrol, encryption, secure communication, etc.

    ! Developing more concrete and precise securityarchitecture is an ongoing project

    ! JXTA does not mandate certain security polices, encryptionalgorithms or particular implementations!

    ! JXTA 1.0 provides Security Primitives:

    ! crypto library (MD5, RC4, RSA, etc.)

    ! Pluggable Authentication Module (PAM)

    ! password-based login

    ! transport security mechanism modeled after SSL/TLS

  • 8/3/2019 Jxta Tutorial Part1a

    46/50

    46 Siemens CT, Chtcherbina/Wieland, 2002

    Security Model! Role based trust model with four basic requirements

    ! Confidentiality! Authorization! Data Integrity! Refutability

    ! XML messages allow meta data such as credentials,

    digests,certificates! Credential a token when presented in a message

    uniquely identifies the sender, helps verify the sendersright to send a message to the endpoint

    !

    Credential default mechanism, Applications to implementmechanisms for better security! Need to establish trust among peers

  • 8/3/2019 Jxta Tutorial Part1a

    47/50

    47

    Summary

  • 8/3/2019 Jxta Tutorial Part1a

    48/50

    48 Siemens CT, Chtcherbina/Wieland, 2002

    Lessons from P2P! P2P is not a new concept, but it offers new possibilities

    !

    P2P applications! Sharing of files and other resources

    ! Distributed computation

    ! Instant messaging

    ! Self-configuring compound services! P2P applications need a standard open platform

    ! P2P networking does not suit to all application scenarios

    ! No QoS guarantee (variable connectivity)

    ! Hybrid solutions

    JXTA summary (for the

  • 8/3/2019 Jxta Tutorial Part1a

    49/50

    49 Siemens CT, Chtcherbina/Wieland, 2002

    y (

    moment ...)! JXTA An open-source framework and launching pad for

    p2p systems! Aims to be Interoperable, platform independent and

    ubiquitous! Peers are required to implement a low over-head stack of

    six JXTA protocols that standardize

    ! Peer discovery! Self organization into peer groups! Peer-to-peer Communication! Peer monitoring

    !

    Challenges! Naming & Binding services! Security & Trust models! Solutions to overcome limitations on NAT gateways &

    firewalls

  • 8/3/2019 Jxta Tutorial Part1a

    50/50

    50 Siemens CT, Chtcherbina/Wieland, 2002

    Thanks! Stay tuned for more details to come

    ! Any Questions?