第五章--JXTA协议

JXTA defines a series of XML messages, or protocols, for communication between peers. Peers use these protocols to discover one another, advertise and discover network resources, and communication and route messages

JXTA的定义了一个XML消息,或Peers之间的一系列协议通信。Peers利用这些协议来发现彼此,宣传和发现网络资源,信息和通信及路线

There are six standard JXTA protocols:
有六个Jxta协议:
Peer Discovery Protocol (PDP) — used by peers to advertise their own resources (e.g., peers, peer groups, pipes, or services) and discover resources from other peers. Each peer resource is described and published using an advertisement.

Peers用于宣传他们的(例如,Peers,PeersGroups,pipes,或services)及其他Peers资源发现自己的资源。每个Peers资源被描述和利用广告来发布。

Peer Information Protocol (PIP) — used by peers to obtain status information (uptime, state, recent traffic, etc.) from other peers.

由Peers来获取状态信息(正常运行时间,状态,最近的交通等)来自别的Peers

Peer Resolver Protocol (PRP) — enables peers to send a generic query to one or more peers and receive a response (or multiple responses) to the query. Queries can be directed to all peers in a peer group or to specific peers within the group. Unlike PDP and PIP, which are used to query specific predefined information, this protocol allows peer services to define and exchange any arbitrary information they need.

让Peers发送通用查询到一个或多个Peers和接收一个查询的响应(或多个响应)。它不像PDP和PIP那样,使用了预定义查询信息,这个协议允许Peers服务定义和交换他们所需要的任意信息。

Pipe Binding Protocol (PBP) — used by peers to establish a virtual communication channel, or pipe, between one or more peers. The PBP is used by a peer to bind two or more ends of the connection (pipe endpoints).

管道绑定协议(PBP) - 由Peers在一个或多个Peers间建立一个虚拟的沟通渠道。PBP是利用Peers约束两个或多个连接(管道终端)终点。

Endpoint Routing Protocol (ERP) — used by peers to find routes (paths) to destination ports on other peers. Route information includes an ordered sequence of relay peer IDs that can be used to send a message to the destination. (For example, the message can be delivered by sending it to Peer A which relays it to Peer B which relays it to the final destination.)

端点路由协议(ERP) - 由Peers来寻找其他Peers到目标端口的路由(路径)。路由信息包括交换Peer IDs,可用于将消息发送到目的地的顺序序列。 (例如,该消息可以发送到交付的A Peer 交换他给B Peer到最终目的地。

Rendezvous Protocol (RVP) — used by edge peers to resolve resources, propagate messages, and advertise local resources. used by rendezvous peers to organize with other rendezvous peers, share the distributed hash table address space, and propagate messages in controlled fashion (message walkers).

集合协议(RVP) - 由边缘节点用于分解资源,传播信息和广告本地资源。利用集合Peers去组织与其他集合Peers,共享分布式哈希表的地址空间,在控制方式(message walkers)传播信息。


All of the standard JXTA protocols are asynchronous and are based on a query/response model. A JXTA peer uses one of the protocols to send a query to one or more peers in its peer group.

JXTA协议的标准都是异步的,是基于查询/响应模型。一个JXTA的Peer使用的协议之一将查询发送到一个或更多的一个group中的Peers。

It may receive zero, one, or more responses to its query. For example, a peer may use PDP to send a discovery query asking for all known peers in the default Net Peer Group. In this case, multiple peers will likely reply with discovery responses.

它可能会收到零个,一个或更多的查询响应。例如,一个Peer可能使用PDP向所有已知的在默认的Peer Group网络中的Peers发送一个发现查询。在这种情况下,多个Peers可能会反复发现响应。

In another example, a peer may send a discovery request asking for a specific pipe named “aardvark”. If this pipe isn’t found, then zero discovery responses will be sent in reply。

在另一个例子中,一个可能发送一个发现请求去询问被命名为“aardvark”的特定的管道。如果这个管段没有被发现,在应答中将会有零发现响应。


JXTA peers are not required to implement all six protocols; they only need implement the protocols they will use. JXSE supports all six JXTA protocols. The Java SE API is used to access operations supported by these protocols, such as discovering peers or joining a peer group.

JXTA peers不是必须执行所有的这六个协议:它们只需要执行它们用到的协议。JXSE支持所有六个JXTA协议。在Java SE API用于支持这些协议的访问操作,如发现Peers或加入一个对等组。

For a complete description of the JXTA protocols, please see the JXTA Protocols Specification, available for download from http://jxta-spec.dev.java.net.

(对于JXTA协议的完整说明,请参阅JXTA协议规范,可以从http://jxta-spec.dev.java.net.下载。)

 

Peer Discovery Protocol

Peers发现协议

The Peer Discovery Protocol (PDP) is used to discover any published peer resources. Resources are represented as advertisements. A resource can be a peer, peer group, pipe, service, or any other resource that has an advertisement.

Peers发现协议是用来发现任何公布的peer资源.资源被表示为广告。一个资源可以是一个Peer,对等组,管道,服务,或者任何其他拥有一个广告的资源。

PDP enables a peer to find advertisements on the network. The PDP is the default discovery protocol for all user defined peer groups and the default net peer group. Custom discovery services may choose to leverage the PDP.

PDP使得一个peer能够在网络上找到广告。PDP是为了所有用户定义的对等组和默认的网络对等组的默认的发现协议。

If a peer group does not define an alternate discovery service, the PDP is used to probe the network for advertisements.

一个一个对等组没有定义一个候补发现服务,PDP用来探测网络广告。

There are multiple ways to discover distributed information. The current JXSE implementation uses a combination of IP multicast to the local subnet and the use of a rendezvous network, which is a technique based on a rendezvous maintained DHT (Distributed Hash Table).

有多种方法,发现发布的信息。目前JXSE实现使用的IP组播结合本地子网和集合网络,这是维持分布式哈希表的一个集合为基础的技术的使用。   

Rendezvous nodes provide the mechanism of directing requests into the network to dynamically discover information. A node may be configured with a predefined set of rendezvous nodes.

集合节点提供一个在网络中直接请求的机制为了动态发现信息。一个节点可以配置一个集合节点的预定义集合。

A node may also choose to bootstrap itself by dynamically locating rendezvous nodes or network resources in its local network via multicast messages.

节点也可以选择去启动他自己通过多播信息的方式在它的本地网络动态定位集合节点或网络资源。

Nodes generate discovery query messages to discover advertisements within a peer group. This message is enclosed within a resolver query contains the peer group credential of the probing node and identifies the probing peer to the message recipient. Messages can be sent to any node within a peer group.

节点生成发现查询信息在对等组中发现广告。这个信息被封装在一个解析程序查询中包含对等组关于探测节点的认证和标识信息收件人为探测peer。信息可以发送到任何一个对等组内节点。

A query is not guaranteed to result in any responses, or result in responses matching the requested threshold.

一个查询的结果不能在任何相应中得到保证,或者导致相应匹配请求的门槛。

Peer Information Protocol

Peer 信息协议

Once a node is located, it's capabilities and status may be queried. The Peer Information Protocol (PIP) provides a set of messages to obtain peer status information.

一旦一个节点被定位了,它的功能和状态将会被质疑。PIP提供一个信息集合去获得peer状态信息。

This information can be used for commercial or internal deployment of JXTA applications. For example, in commercial deployments the information can be used to determine the usage of a peer service and bill the service consumers for their use.

这些信息能够被用于商业或者内部部署JXTA应用程序。例如,在商业部署中这个信息能够被用来描述一个peer服务的使用方法并列出服务消费者的使用。

In an internal IT deployment, the information can be used by the IT department to monitor a node’s behavior and reroute network traffic to improve overall performance.

在IT内部部署中,这个信息能够被用来该信息可用于由IT部门监测节点的行为和重路由网络流量以提高整体性能。

These hooks can be extended to enforce the IT department's control of the node in addition to providing status information.

这些钩子能够延长执行IT部门的控制节点除了提供状态信息。

The PIP ping message is sent to a peer to check if the peer is alive and to get information about the peer. The ping message specifies whether a full response (peer advertisement) or a simple acknowledgment (alive and uptime) should be returned.

PIP ping信息被发送到一个peer去检查是否这个peer是活跃的并且得到关于这个peer的信息。这个ping信息指定是否返回一个详细的回应或者是一个简单的答复。

The PeerInfo message is used to send a message in response to a ping message. It contains the credential of the sender, the source peer ID and target peer ID, uptime, and peer advertisement.

PeerInfo消息被用来发送一个消息来应答ping消息。它包含发件人的认证,源peer ID 和 目标peer ID,正常工作时间和peer广告。


Peer Resolver Protocol

Peer解析协议

The Peer Resolver Protocol (PRP) enables peers to send generic query requests to other peers and identify matching responses.

PRP让peer发送通用查询请求其他peer并且找出相应的对策。

Query requests can be sent to a specific peer or can be propagated via the rendezvous services within the scope of a peer group.

查询请求会被发送到一个特殊的peer或者通过集合服务来传播在一个对等组的范围内。

The PRP uses the Rendezvous Service to disseminate a query to multiple peers and uses unicast messages to send queries to specified peers.

PRP使用集合服务来传播查询在多个peer中并且使用单播信息去发送查询到指定的peers。

The PRP is a foundation protocol supporting generic query requests.

PRP是一个基础协议支持通用的查询请求。

Both PIP and PDP are built using PRP and they provide specific query/requests: the PIP is used to query specific status information and PDP is used to discover peer resources.

PIP和PDP都使用PRP建立并且他们提供特定的查询/请求:PIP被用来查询特殊的状态信息,PDP被用来发现peer资源。

The PRP can be used for any generic query that may be needed for an application.

PRP被用于可能被应用程序需要的所有通用查询。

For example, the PRP enables peers to define and exchange queries and to find or search service information (such as the state of the service, the state of a pipe endpoint, etc).

例如,PRP使得peers能够定义和交换查询并且寻找服务信息(例如服务状态,管道端点状态等)。

The resolver query message is used to send a resolver query request to a service running on another member of a peer group.

解析查询信息被用来发送一个解析查询请求到对等组中其他节点的一个运行中的服务。

The resolver query message contains the credential of the sender, a unique query ID, a specific service handler, and the query.

解析查询信息包含发送者的认证,一个独特的查询ID,一个特定的服务处理程序,和这个查询。
Each service can register a handler in the peer group's resolver service to process resolver query requests and generate replies.

每个服务在对等组的解析服务中注册一个处理程序去完成解析查询请求和回复应答。

The resolver response message is used to send a message in response to a resolver query message. The resolver response message contains the credential of the sender, a unique query ID, a specific service handler, and the response.

解析响应信息被用来发送一个响应信息给解析查询信息。解析响应信息包含发信人认证,一个特别的查询ID,一个特定的服务处理程序,和响应。

Multiple resolver query messages may be sent. A peer may receive zero, one, or more responses to a query request.

多个解析查询信息可以被发送。对于一个查询请求一个peer能够接受零个,一个或多个响应。

Peers may also participate in the Shared Resource Distributed Index (SRDI). SRDI provides a generic mechanism enabling JXTA services to utilize a distributed index of shared resources with other peers that are grouped as a set of more capable peers, such as rendezvous peers.

Peers也可能加入到SRDI中,SRDI提供了一个通用的机制,使JXTA的服务利用了与那些为更多的有能力的peers聚集设置分组,如集合peers共享资源分布式索引。

These indexes can be used to forward queries in the direction where the query is most likely to be answered and repropagates the messages to peers interested in those messages.

这些指标可用于在查询的方向为最有可能被回答重新传播的消息给这些消息感兴趣的peer。

The PRP sends a resolver SRDI message to the named handler on one or more peers in the peer group.

PRP发送一个解析SPDI信息到对等组中的一个或多个peers的被命名的处理程序。

The resolver SRDI message is sent to a specific handler and it contains a string that will be interpreted by the targeted handler.

解析SRDI信息发送到一个自定的处理程序并且他包含一个字符串将被目标处理程序解释。


Pipe Binding Protocol

管道连接协议

The Pipe Binding Protocol (PBP) is used by peer group members to bind a pipe advertisement to a pipe endpoint.

管道连接协议被用于对等组成员去把一个管道广告连接到一个管道终点。

The pipe virtual link (or pathway) can be layered upon any number of physical network transport links, such as TCP/IP.

管道虚拟连接(或路径)能够被很多物理网络分层后传输连接,就像TCP/IP。

Each end of the pipe works to maintain the virtual link and to re-establish it, if necessary, by binding or finding the pipe’s currently bound endpoints.

每个管道的结束要维持虚拟联系并重新建立它,如果必要,由连接或寻找管道的当前绑定端点。

A pipe can be viewed as an abstract named message queue, which supports create, open/resolve (bind), close (unbind), delete, send, and receive operations.

管道能够被检查作为一个抽象命名的信息队列,它支持创建,打开/解析(连接),关闭(断开),删除,发送,和接收操作。

Actual pipe implementations may differ, but all compliant implementations use PBP to bind the pipe to an endpoint.

实际管实现可能不同,但所有兼容实现利用PBP连接的管道到一个端点。

During the abstract create operation, a local peer binds a pipe endpoint to a pipe transport.

在抽象的创建传输操作期间,一个本地的peer连接一个管道终结点到一个管道传输。

The PBP query message is sent by a peer pipe endpoint to find a pipe endpoint bound to the same pipe advertisement.

PBP查询信息是被一个peer管道终结点发送的为了找到一个管道终结点绑定到相同的管道广告上。

The query message may ask for information not obtained from the cache. This is used to obtain the most up- to-date information from a peer.

查询消息可能不会从缓存获得的信息。这是用来获得peer的最近信息的。

The query message can also contain an optional peer ID which, if present, indicates that only the specified peer should respond to the query.

查询消息也能够包含一个可选的peer ID(如果存在)指定只有特定的peer应该响应查询。

The PBP answer message is sent back to the requesting peer by each peer bound to the pipe. The message contains the Pipe ID, the peer where a corresponding InputPipe has been created, and a boolean value indicating whether the InputPipe exists on the specified peer.

PBP的回答消息发送回请求peer绑定到每个管道peer。这些消息包含管道ID,一个相应的InputPipe已经被创建的peer。一个布尔值,指示是否在指定的peer上存在InputPipe。


Endpoint Routing Protocol

终结点路由协议

The Endpoint Routing Protocol (ERP) enables JXTA peers to send messages to remote peers without having a direct connection to the destination peer.

终结点路由协议能够使JXTA peers 在与目的地peer间没有直接连接的情况下发送消息到遥远的peers。

The message will be passed through intermediary peers to reach it's final destination. ERP defines a query and response protocol which it uses to discover peer routing information and a message “envelope” that is attached to JXTA Messages describing the route a message should travel from one peer (the source) to another (the destination).

该消息将通过中介peers到达它的最终目的地。ERP定义一个使用路由信息和消息信封来发现peer的查询和响应协议,它依附于JXTA Messages 描述路由一个信息应该通过一个peer(源)到另一个peer(目的地)

To send a message to another peer, the source peer first looks in its local cache to determine if it has a route to the destination peer.

为了发送一个消息到另一个peer,源peer首先看本地缓冲以确定它是否有一个到目的地peer的路由。

If it does not already have a route to the destination peer, it sends a route resolver query request asking for route information to the destination peer.

如果它没有到目的地peer的路由,它发送一个路由解析查询请求以向目的地peer询问路由信息。

Any peer receiving this route query will check to see if knows a route to the requested peer.

所有peer接收这个路由请求将查看是否知道一个到达请求peer的路由。

If the peer does know of a valid route, it will respond to the route query with the route information for the desired destination peer.

如果peer不知道一个有效的路由,它将回答带有预期目的地peer路由信息的路由查询。

Any peer can query for route information and any peer within a peer group may offer route information and/or route messages destined for other peers. Relay peers typically cache route information.

所有节点都可以查询路由信息,对等组内的任何一个peer可以提供路由信息或者是在为别的peers传输路由信息。交换peers通常缓存路由信息。

Route query requests are sent by a peer to request route information for a destination peer.

路由查询请求被一个peer发送去为了目的peer请求路由信息。

Route responses include the peer ID of the responder, the peer ID of the route's destination, and a semi-ordered sequence of peer IDs.

路由响应包括应答者的peer ID,目的路由的peer ID,和 peer ID 的半序序列。

The sequence of peer ID hops may provide a complete or partial route to the destination but at minimum contains one peer ID.

peer ID 数据包消息(hop)序列提供一个模板或部分路由到目的地但是最少包含一个peer ID。

In some cases the sequence may contain several alternative routes to the destination. A route can safely express alternatives because of the way in which routes are used.

在有些情况下这个序列包含若干个可选择的路由到目的地。一个路由可以安全的表示可选的因为路由使用的方式。

The semi-ordered sequence of peer IDs provided in a Route Response provide information as to the path that a message may be forwarded in order to reach a destination peer.

peer ID 的半序序列提供一个路由响应来提供信息作为一个可能会被转发以达到一个目的地peer的路径。

Each peer along the stated path may enhance and/or optimize the route the message takes based upon it's own knowledge.

每个peer采用基于自己知识的消息沿着既定的路径可能会加强或优化路由。

For example, if a peer receives a message containing a ten hop route to a destination peer but it is itself directly connected to the destination peer then it makes sense to forward the message directly rather than sending it along the long route.

例如,如果一个peer接收一个消息包含一个拥有10个数据包消息的路由到一个目的peer但是它本身是直接连接到目的peer的那么它直接转发消息要比发送它通过一段长长的路由要有意义。

Similarly, a peer may shorten a route by using a shorter route it knows between any two hops in the route which is included with a message.

同样的,一个peer可能缩短一个路由通过一个短小的路由,它知道在路由上所有的两个数据包消息包含着一个消息。


The Message routing procedure used by the Endpoint Routing Protocol is roughly as follows;

消息的路由程序,ERP的使用大致如下:

1.If I am originating the Message then check if I have a route to the destination. If I don't have a route to the destination, query for a route and wait for a route to be found. Eventually give up if no route is found.

如果我发出的信息然后检查是否有一个到达目的地的路由。如果我没有一个到达目的地的路由,查询一个路由并等待一个被发现的路由。如果没有找到最终将被放弃。

2.If I am not originating the Message and do not have a route for the destination nor any peer listed in the route attached to the message then send a failure message to the peer from which I received the Message. JXTA peers do not currently generate route queries for messages they do not originate as this is too easily used to create distributed denial of service attacks (DDoS).

如果我没有发出信息A并且没有一个到达目的地的路由和一些被列出的peer在附加路由信息,然后发送一个失败信息到我接受信息A的那个peer。JXTA peers 目前不为消息产生路由查询,他们不发起是因为太容易用于创建DDoS(distributed denial of service attacks分布式拒绝服务攻击)。

3.Remove my peer ID from the message route and all peer IDs which preceded mine in the Message route. Excluding all Peer Ids already in the Message Route, prepend the route I know to the destination peer to the Message route.

从路由消息中移除我的peer ID 和 之前我的消息路由的中所有 peer IDs。拒绝所有在这个消息路由的中的Peer IDs,预先挂起这个我知道的到达目的地peer 的消息路由。

4.Starting at the last peer ID listed in the Message Route, check if I have a direct connection to any of the listed peer Ids. If so, remove all of the peer IDs before that peer in the Message route and forward the message to directly connected peer.

起始于消息路由列表中最后的peer ID,检查是否我有一个到所有被列出的peer IDs的直接连接。如果我有,移除所有在这个消息路由中最后的peer前面的peer IDs并且转发消息到直接连接的peers。

5.If no direct connection exists to any of the peer Ids listed in the Message route then forward the message to the first peer listed in the Message Route.

如果在这个消息路由中不存在直接连接到所有列出的peer IDs,那么把消息转发到消息路由中被列出的第一个peer。


Rendezvous Protocol

集合协议

The Rendezvous Protocol (RVP) is used for propagation of messages within a peer group. The RVP provides mechanisms which enable propagation of messages to be performed in a controlled and efficient way. The RVP is divided into three parts;

集合协议用于在对等组内增殖消息。RVP提供一个能够在受限制和有效的方式下执行消息增殖的机制。RVP 被分为三个部分:

●The protocol used by the Rendezvous Peers to organize themselves, also known as the PeerView protocol.

这个协议被集合peers用来组织它们自己,也被称为是PeerView协议。

●The protocol used by client peers to register interest in receiving propagation messages, a simple lease protocol.

这个协议被客户端peers应用于注册有兴趣的接受信息传播,一个简单的租赁协议。

●The protocol used for propagating messages to the peers which have expressed an interest in the destination address. The message propagation protocol is the only protocol which all participants must implement

这个协议被用于传播消息到已经表示对目的地地址有兴趣的peers。这个消息传播协议是参加者必须执行的唯一协议。

 

本文仅供个人学习所用,英语水平有限,文中必定会出现很多错误,还望各位指正,请联系我bao.renyi@gmail.com

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值