P2P

来源:互联网 发布:linux 创建卷的过程 编辑:程序博客网 时间:2024/04/17 05:39

P2P

A peer-to-peer (P2P) network is a type of decentralized and distributed network architecture in which individual nodes in the network (called "peers") act as both suppliers and consumers of resources, in contrast to the centralized client-server model where client nodes request access to resources provided by central server.
In a peer-to-peers who each make a portion of their resources (such as searching for files or streaming audio/video) are shared amongst multiple interconnected peers who each make a portion of their resources (such as processing power, disk storage or  network bandwidth) directly available to other network participants, without the need for centralized coordination by servers.


JXTA

JXTA 是Sun微系统对等网络(P2P)的标准。这种技术处于传输平台和P2P通信协议的环绕之中。其开发组织被取名为单词“juxtapose(并置)”的建议形式。

JXTA将建立核心的网络计算技术,提供支持在任何平台、任何地方以及任何时间实现P2P计算的一整套简单、小巧和灵活的机制。JXTA首先将归纳目前P2P的功能特别,而后建立核心的技术来表达目前的P2P计算的局限性。其重点是创建基本的机制,而具体的策略选择权,则交给应用开发者。JXTA将充分利用XML、Java等开放技术,是的UNIX操作系统更强大和灵活。比如,利用管道(Pipes)传输Shell命令实现复杂的计算任务。JXTA支持P2P应用的基本功能来建立一个P2P系统,还将努力正是这些可以成为建立更高层功能的基础构造模块。JXTA架构可以分为三个层面:JXTA核心层、JXTA业务层和JXTA应用层。

在2001年2月有O'Reilly Network组织的P2P会议上,Bill Joy,Sun的首席科学家解释了选择这个名字的原因:并置就是要让东西彼此相邻地放置,而“这正是对等网络的全部意义”。

P2P的作用不仅仅体现在网路媒体文件的共享,也应体现在协调计算,协调分析,协调处理等等方面。

在JXTA中,并列放置的实体是计算设备和计算机组。此标准就是要使在系统间和组间建立临时性的连接变得更容易。JXTA项目是在Joy和Mike Clary的领导下开始的,他们知道这项开发本着三个核心原则:他们尽可能选择使用熟悉的技术和标准,寻求行业专家的意见,以及鼓励开放式的开发。

JXTA具体来说是一种标准组建平台,它提供了用于开发分布式服务和应用程序的基本组件。整套技术有一组开放源码的P2P协议组成,这组协议使网络上任何连接着的计算设备的协作变为可能。基于协议而不是基于API意味着JXTA技术可以用任何语言在任何操作系统上运行。JXTA使可共同使用的P2P应用程序拥有了许多能力,其中包括:在能简单地穿过防火墙通信的不同设备的用户间建立对等,在网络上找对等体的能力---甚至穿过防火墙,简化文件共享,自动侦测到心的网站目录,对对等体的远程监控,访问深层网络的数据,以及提供安全的通讯。

JXTA(Juxtapose) is an open source peer-to-peer protocol specification begun by Sun Microsystems in 2001. The JXTA protocols are defined as a set of XML messages which allow any device connected to a network to exchange messages and collaborate independently of the underlying network topology.

As JXTA is base upon a set of open XML protocols, it can be implemented in any modern computer language. 

JXTA peers create a virtual overlay network which allows a peer to interact with other peers even when some of the peers and resources are behind firewalls and NATs or use different network transports. In addition, each resource is identified by a unique ID, a 160 bit SHA-1 URN in the Java binding, so that a peer can change its localization address while keeping a constant identification number.


Protocols in JXTA

(1). Peer Resolver Protocol

(2). Peer Information Protocol

(3). Rendezvous Protocol

(4). Peer Membership Protocol

(5). Pipe Binding Protocol

(6). Endpoint Routing Protocol


Categories of peers

JXTA defines two main categories of peers: edge peers and super-peers. The super-peers can be further divided into rendezvous and relay peers. Each peer has a well defined role in the JXTA peer-to-peer model.

(a). The edge peers are usually defined as peers which has transient, low bandwidth network connectivity. They usually reside on the border of the Internet, hidden behind corporate firewalls or accessing the network through non-dedicated connections.

(b). A Rendezvous peer is a special purpose peer which is in charge of coordinating the peers in the JXTA network and provides the necessary scope to message propagation. If the peers are located in different subnets then the network should have at least on Rendezvous peer.

(c). A Relay peer allows the peers which are behind firewalls or NAT systems to take part in the JXTA network. THis is performed by using a protocol which can traverse the firewall, like HTTP, for example.

NOTE:

Any peer in a JXTA network can be a rendezvous or relay as soon as they have the necessary credentials or network/storage/memory/CPU requirements.


Peer groups

A peer group provides a scope for message propagation and a logical clustering of peers. In JXTA, every peer is a member of a default group, NetPeerGroup, but a given peer can be member of many sub-gourps at the same time. A peer may play different roles in different groups; it may act as an edge peer in one group, but a rendezvous in another.

Each group should have at least one rendezvous peer and it is not possible to send messages between two groups.


Rendezvous network

The Rendezvous peers have an optimized routing mechanism which allows an efficient propagation of messages pushed by edge peers connected to them. This is achieved through the use of a loosely consistent network.


JXTA原型实现

发现机制:JXTA规范中并没有具体规定,JXTA version 1.0 支持一下发现机制

(1).基于局域网的发现

(2).通过邀请发现:一个同位体收到邀请,通过邀请的内容发现。

(3).层叠发现:如果一个同位体发现了第二个同位体,若第二个同位体允许的话,第一个可以通过第二个发现新的同位体,组和服务。

(4).通过集合点同位体:集合点同位体就是知道其他同位体信息的同位体。

传播范围:JXTA没有强制规定消息怎么传播,一个消息可能只在局域网上传播,也可能在INTERNENT上传播。现在的JXTA实现把同位体组作为隐士的传播范围,因为在理论上,任何范围都可以以对应的同位体组的形式表示。


原创粉丝点击