Using Ethernet
- Updated2025-10-10
- 4 minute(s) read
This topic summarizes some of the NI-XNET features specific to the Ethernet protocol.
Hardware Design
Each port has three data paths: XNET monitor, XNET endpoint, and OS stack. All three data paths can be used simultaneously.
Monitor Path
The monitor path reads and inspects all Ethernet frames that are received or transmitted on the port. For Ethernet interfaces, the suffix "/monitor" indicates the use of a monitor path when it is appended to the interface name (e.g., ENET1/monitor). When a port is configured for Direct mode, the monitor path reads frames that are received on the interface as well as frames that are echoed from transmit by the interface. When Tap is enabled, the monitor path reads the Ethernet frames that are received from one Tap partner before being transmitted by the other Tap partner.
Endpoint Path
An Ethernet interface that is configured to use Direct mode functions as an endpoint. An endpoint path is the connection between an endpoint and the channel to which it is connected. The endpoint path transmits and receives Ethernet frames on the port. The endpoint path is typically used if you need it to act as an AVB endpoint. NI-XNET represents an endpoint path as the interface name itself, with no suffix.
OS Stack
The OS stack is the host computer, including operating system, application software, subroutines, and communication protocols. The OS stack path transmits and receives data using standard network sockets via the operating system's network stack. The OS stack is typically used with applications designed to use traditional TCP- or UDP-based protocols for its network communication.
The OS detects a separate network interface for each physical XNET port present on the system. The labeling of these ports is OS-specific, but you can determine which label matches a specific XNET interface by examining the properties reported in MAX, including the name, MAC address, and IP address. For information about configuring IP addressing, refer to your operating system instructions. For NI LabVIEW Real-Time systems, this configuration is exposed in the Network Settings of the target.
The following figure represents a block diagram of a single port, showing all three data paths.
For Ethernet interfaces, only XNET Create Session Frame Input Stream and Frame Output Stream are supported; other Create Session modes are not supported. All other modes, including Conversion Mode, return an invalid mode error, indicating that the selected session mode is not supported by the protocol of the interface.
Port Modes
An Ethernet interface includes ports that can be configured as independent network interfaces. On Automotive Ethernet hardware, these ports can function in either Direct mode or Tap mode. Regardless of mode, traffic on each port can be monitored. When monitoring is enabled, all traffic that is transmitted or received on that port is captured.
Direct Mode
In Direct mode, ports are directly connected and function as endpoints; Ethernet frames received and transmitted on the port have no relationship to any other ports on the device. Input and output sessions are supported in Direct mode. The following diagram shows a design with two ports. In this example, the ports are configured in Direct mode, and each port can run independently.
Tap Mode
In Tap mode, a pair of adjacent ports, called Tap partners, are connected to form a Tap that allows the interface to monitor traffic. For example, on a 4-port device, physical ports 1 and 2 might be Tap partners, while ports 3 and 4 are Tap partners. A frame received on one Tap partner is immediately transmitted out the other Tap partner, to mimic behavior of an Ethernet cable. When you set Tap mode on one port, its Tap partner is automatically set to Tap mode as well.
The following diagram shows a design using a single Tap. As the connected ports are configured in Tap mode, traffic received on one Tap partner is transmitted to the other; monitored frames are also transmitted to the user application at the controller.
When an input session is created using an XNET interface for either Tap partner, and the monitor suffix is used with the XNET interface, the session reads frames going through the Tap partners. Output sessions are not supported in Tap mode.
When Port Mode is set to Tap for the interface, only the monitor names are shown; otherwise, both the monitor and endpoint names are shown.