NI Peer-to-Peer Streaming

Content Type
Programming Language
Current manual
Product DocumentationNI Peer-to-Peer Streaming...NI Peer-to-Peer Streaming HelpUnderstanding the Peer-to-Peer Data Streaming ArchitectureCurrent page
Table of Contents

Understanding the Peer-to-Peer Data Streaming Architecture

Understanding the Peer-to-Peer Data Streaming Architecture

From a system-level perspective, three components work together to ensure proper operation of a peer-to-peer data stream: the writer, the reader, and the host.

Note  Although the previous figure shows a host application creating a single stream, a host application can manage multiple streams.

Writers and Readers

The writer and reader are the origin and terminus of the unidirectional data stream, respectively. The writer is the device resource that writes data to the stream. The reader is the device resource that reads data from the stream. Hardware devices that are capable of peer-to-peer data streaming can participate in multiple streams by using different resources as the writer and reader. Because the peer-to-peer data streaming architecture is unidirectional, each device resource can either write data to a stream or read data from the stream, but the same device resource cannot be both a writer and reader. Only hardware resource availability limits the number of streams that a device resource can support.

Hosts and Host Applications

A peer-to-peer data stream cannot exist without the presence of a host computer, such as a PXI system, running a host application. The host links the writer and reader together and maintains the stream. The host must continue to run the host application to maintain the stream, but the host processor does not participate in the actual transfer of data between the writer and reader. In addition, the host does not have access to data in the stream, the writer, or the reader. The host provides the following services:

  • Provides a unified software API for stream status and control between different types of devices
  • Programmatically creates streams at run time
  • Manipulates stream connectivity during run time
  • Increases system-level robustness and fault tolerance

You can write host applications to handle errors or faults that occur in the writer or reader. For example, the host application can manipulate the state of the reader while the stream is actively transmitting data to prevent the reader from receiving stream data if the writer encounters a problem. In this situation, the host application can shut down the stream attached to the reader in a safe and controlled way.

Streaming Data between Different Platforms

The peer-to-peer data streaming architecture uses hardware resources to connect the writer directly to the reader. Therefore, you can implement the writer and reader on different platforms, even though different hardware platforms use different interfaces to send and receive data and driver software varies from device to device. For example, you can implement the writer on a digitizer using the NI-SCOPE instrument driver and implement the reader on an NI FlexRIO device using LabVIEW with the LabVIEW FPGA Module.

To create a peer-to-peer application you must use the platform-specific hardware API to configure the I/O and processing algorithms for the device.

Note  Not all hardware supports peer-to-peer data streaming. Refer to the hardware documentation to determine if the hardware is capable of peer-to-peer streaming.

After you implement the writer and reader using the platform-specific API, you use the Peer To Peer Streaming VIs on the host to create and control the stream.

The hardware API is usually similar between devices on the same platform. Refer to the hardware API documentation for information about writing or reading data using the peer-to-peer data streaming architecture.

Examples of Peer-to-Peer Topology

The following topologies are high-level examples of data flow using the peer-to-peer data streaming architecture.

Was this information helpful?