Lately there has been several inquiries about
JXTA's PipeService, and companion utilities (JxtaSocket, JxtaMulticastSocket, and JxtaBiDiPipe) on
JXTA's discussion lists, hence this blog to shed more light on the PipeService and utilities provided, and their inherit features.
The initial goal of the PipeService was to provide primitive (unidirectional, and unreliable) message based communication channels upon which complex and sophisticated communication channels can be built. The PipeService provides three types of pipes described as follows:
JxtaUnicast
- Unidirectional
- Unreliable
- Many to one
- Limited to 64KB messages
JxtaUnicastSecure
- Unidirectional
- Limited reliability (no direct notification of failures other than channel failure)
- Many to one
- Limited to 64KB messages
JxtaPropagate
- Multidirectional (many to many)
- Unreliable
- Limited to 64KB messages in infrastructure mode, and limited by physical transport limitation where applicable
JXTA JSE platform software stack
Unicast pipes (clear, and secure) are bound by the PipeResolver, which provides two modes of bindings, a static (where a set of peers is specified), and a dynamic (no peers specified) binding. Static binding is beneficial in constraining communication to a limited set of peers, while dynamic is beneficial in implementing unconstrained mobile communication channels. Both modes can be utilized in implementing fault tolerant communication channels.
Propagated pipes employ a mechanism similar to that of IGMP, where a creation of an input pipe results in propagated pipe channel join message (a pipe SRDI message to a the peer's rendezvous). In infrastructure mode propagated pipe messages are sent to the rendezvous for propagation to the subscribers of the propagated pipe channel, while in ad-hoc mode messages are propagated over the endpoint (currently only the TCP transport supports such function over multicast). A pipe closure results in a channel resign message (a pipe SRDI message to the rendezvous expiring the previous join). It's worth noting that the PipeResolver plays no part in binding of such pipe type
Pipe Binding An InputPipe creation results in the creation of an endpoint incoming messenger, and an SRDI message with the pipe ID with an infinite expiration time. Once the InputPipe is closed another SRDI message is emitted with the pipe ID, and expiration time of 0, invalidating any reference for the pipe and peer. note: This behavior applies to all pipe types. An output pipe creation results in a PipeResolver query message emitted querying for instances of the pipe. A match results in a PipeResolver response to the querying peer, where an endpoint messenger to responding peer is created. Note that such messenger may not be fully resolved until the EndpointRouter has determined a valid route. During such event few messages maybe queued (3 to be exact) until the messenger has been resolved. In addition, as part of the pipe resolver protocol the pipe resolver periodically reattempts pipe resolutions in the background to validate resolved pipe endpoints. It is through this mechanisms pipes can migrate from one peer to another. note: this behavior is limited to unicast pipe types.
SRDI message path within the
JXTA network
Pipe EndpointA pipe endpoint is composed of a peer, group, and pipe ID, through this definition there are two inherit modes of pipe endpoint migration:
- Peer endpoint migration, an inherit feature of the Endpoint-Router, where a peer may change physical, or virtual addresses.
- Pipe endpoint migration, where a pipe endpoint ceases to exists on a peer, where the PipeResolver, attempts to rebind to the pipe (which I always refer to as a virtual channel)
The first mode is transparent the application, while the second may result in an IOException.
ReliabilityA standalone message and stream based reliability layer over non reliable messengers, is provided in the platform to facilitate reliable communication channels.
Reliability Library
- Ensures message sequencing
- Interfaces to pipes or messengers
- Ensures delivery
- Exposes message, and stream interfaces
- Spawns a single thread to deal with retransmission
- Does not ensure message integrity
Bidirectional communication channelsJxtaServerSocket, and JxtaServerPipe expose a input pipe to process connection requests and negotiate communication parameters, whereby a JxtaSocket, or JxtaBiDipipe bind to respectively to establish private dedicated pipes independent of the connection request pipe. JxtaSocket, and JxtaBiDiPipe utilize a messenger instead of an output pipe for the back channel to reduce connection latency (avoids 4 messages), therefore only peer endpoint migration is inherited, and one should always expect an IOException if a PipeEndpoint migrates, or ceases to exist.
JxtaSocket, JxtaServerSocket
- Subclass java.net.Socket, and java.net.ServerSocket respectively
- Built on top of pipes, endpoint messengers, and the reliability library
- Provides bidirectional and reliable communication channels
- Exposes stream based interface a la Socket
- Provides configurable internal buffering, and message chunking
- Does not implement the Nagels algorithm, therefore streams must be flushed as needed (a common oversight when wrapping object and data streams over the socket stream)
JxtaBiDiPipe, JxtaServerPipe
- Built on top of pipes, endpoint messengers, and the reliability library
- Provides bidirectional and reliable communication channels
- Exposes message based interface
- Requires no heart beat to maintain an open connection
- Provides no message chunking
Multidirectional communication utility JxtaMulticastSocket extends java.net.MutlicastSocket and provides mutlicast functionality over
JXTA propagated pipes.
JxtaMulticastSocket
- Subclass java.net.MulticastSocket
- Built on top of propagated pipes
- Exposes datagram based interface a la MulticastSocket
- Provides unicasting through datagram addressing
Message size and limiting factors
- The JXTA platform imposes a soft MTU of 64KB (which becomes a hard limit under load), messages exceeding MTU are simply dropped. While nodes maybe able to transmit and receive messages larger than 64KB, it is strongly advised this limit is not exceeded in reliable mode, as it will result in failed or broken channels.
- When utilizing relay peers, such limit must not be exceeded in either mode (reliable or otherwise) as the relay nodes are likely to be loaded and/or the fairness message queue size quotas are enforced, thus leading to message loss and consequently failed or broken channels.
Common pitfalls
- Pipe advertisement mismatch. Typically occurs when dynamically creating and discovering pipe advertisements using non unique identifiers, or deterministic method. Normally overcome through hardcoded pipe advertisements (or pipe ID's), encoded pipe ID's.
- Un-synchronized pipe binding. Typically caused by network islands, which are joined at a later point in time. Easily overcome through rendezvous event listener prior to any binding attempt.
- Failed Secure pipe connections. Typically due to failure of establishing NetPeerGroup credentials (TLS resides in the NetPeerGroup, and inherited by all sub-groups), or missing a trusted certificate or certificate chain in PSE. This is overcome by stablishing NetPeerGroup credential, and ensuring the perspective trusted certificate or certificate chain is stored into PSE (See the shell command pse.importcert). jxta JxtaSocket
相关推荐
《藏经阁——深入理解DataFrame与Dataset》 在大数据处理领域,Apache Spark作为一个高效、通用的计算框架,其核心概念之一就是DataFrame和Dataset。这两者是Spark SQL中的关键数据结构,为开发人员提供了强大而...
嵌入式系统中间件是连接硬件层和应用软件层的关键技术,它在现代电子设备中起着至关重要的作用。本文将深入探讨嵌入式系统中间件的概念、功能、类型及其在实际应用中的重要性。 首先,我们要理解什么是“中间件”。...
Now that the Internet has blossomed into the Information Superhighway with its traffic and drivers becoming increasingly diverse, security has emerged as a primary concern. This book offers the reader...
风险平价(Risk Parity)是一种先进的投资组合构建策略,常见于对冲基金等专业投资机构。它通常涉及复杂的数量化方法,使得资产配置比简单的分配策略如60/40(即60%股票,40%债券的传统配置比例)更为复杂。...
# 深入解析Σ-Δ ADCs:理论与应用 本文将深入探讨Σ-Δ(Sigma-Delta)模拟到数字转换器(Analog-to-Digital Converter, ADC)的理论基础,尤其关注过采样(Over-sampling)、噪声整形(Noise Shaping)以及抽取...
Python Deep Learning Projects 9 projects demystifying neural network and deep learning models for building intelligent systems.epub
Microsoft.Press.Software.Estimation.Demystifying.the.Black.Art.Mar.2006.chm 微软估算艺术
Demystifying Internet of Things Security, Break down the misconceptions of the Internet of Things by examining the different security building blocks available in Intel Architecture (IA) based IoT ...
Demystifying the Rx library using Reactive extensions Exploring .Net Core 1.1 and ASP.NET MVC Securing your applications and learning new debugging techniques Designing and building a microservice ...
T4-Shullich-Demystifying Microsoft Extended File System
Jeff Tyree and Art Akerman, Capital One Financial You can make your architecture more transparent and clarify its rationale for all stakeholders by explicitly documenting major architecture ...
### 开关电源揭秘 #### 知识点一:开关电源的基本原理及历史 开关电源(Switching Power Supplies)是现代电子设备中不可或缺的部分,其基本原理是通过将输入电压转换为较高频率的交流电(AC),然后通过变压器...
March 2001Demystifying DAS, SAN, NAS, NAS Gateways, Fibre Channel, and iSCSI. Page 2Contents3 In a Nutshell6 Introducing the Concepts6 Connectivity8 Media9 I/O Protocols10 The Storage Networking ...
us-18-Slowik-Demystifying-PTSD-In-The-Cybersecurity-Environment web安全 自动化 系统安全 安全对抗 网络安全
He outlines the elements of markup--demystifying concepts such as attributes, entities, and namespaces--and provides enough depth and examples to get started. Learning XML is a reliable source for ...
Think oil and gas, utilities, or healthcare. Working on such a massive scale, industrial IoT comes with a certain level of risk—but also vast possibilities for gains in efficiency and productivity. ...
"Demystifying Big Data, Analytics, and Machine Learning in Cyber Security"这一主题深入探讨了如何利用大数据来提升安全架构的安全性,以及如何挖掘潜在的安全漏洞。本文将主要围绕四个关键领域进行详细阐述:...