PXIe-8520 Ethernet Raw Frame Format

The raw frame format for NI-XNET Ethernet interfaces is the form in which NI-XNET stores Ethernet frame data for the NI-XNET Read and NI-XNET Write functions and in TDMS files. Raw frame data comprises one or more frames encoded in a sequence of bytes.

The raw frame format is ideal for log files because you can transfer the data between NI-XNET and the file with very little conversion.

In the following table, byte offset refers to the offset from the beginning of the frame. For example, if the first frame is in raw data bytes 0–127, and the second frame is in bytes 128–255, the source MAC address of the second frame starts at offset 156 (128 + Byte Offset 28).

The following table specifies the overall Ethernet frame format, including header fields that are specific to NI-XNET interfaces, such as timestamps.

Table 4. Overall NI-XNET Raw Frame Format for Ethernet Interfaces
Field Byte Offset
Length 0 to 1
Type 2 to 3
Local Timestamp 4 to 11
Note The PXIe-8520 does not presently support timestamping.
Network Timestamp 12 to 19
Note The PXIe-8520 does not presently support timestamping.
Flags 20 to 23
Frame Data 24 (Length - 5)
FCS
  • Interface used as endpoint (direct mode): Not used
  • Interface used as monitor (tap mode): (Length - 4) to (Length - 1)
Note The PXIe-8520 does not presently support tap mode.

These fields have the following definitions:

  • Length—Unsigned 16-bit integer that provides the length of the entire frame, including two bytes for the length field itself.

    You can compute the length of Frame Data (IEEE Std 802.3 frame data) by Length - 28, to account for the fields that are specific to NI (and the FCS).

    For writing a frame, this field uses big-endian byte order (most significant byte first; also known as network order).

    For reading a frame, this field uses host-byte order.

  • Type—Unsigned 16-bit integer that provides the type of the Ethernet frame.

    The type is an enumerated value that characterizes the frame as either a standard Ethernet frame that is transmitted or received or as a special frame.

    The upper three bits of this element specify the protocol. The valid values in decimal are:

  • 0—Ethernet
  • 7—Special
  • The lower 5 bits of this element contain the specific type.

    Special values specify features that are not related to the protocol or bus traffic. Special values designate the frame as a special frame.

    Note The PXIe-8520 does not presently support special frames.
  • Local Timestamp—64-bit timestamp using NI-XNET local time.
    Note The PXIe-8520 does not presently support timestamping for frames.
  • Network Timestamp—64-bit timestamp using network time (clock of the network's time synchronization protocol, such as IEEE Std 802.1AS).
    Note The PXIe-8520 does not presently support timestamping for frames.
  • Flags—32-bit field that provides Boolean flags that qualify the frame. Bit 0 corresponds to the lowest bit (i.e., hex 00000001).
    • Transmit (bit 31): Whether the frame occurred due to transmit (True) or not (False).

      For NI-XNET Read on the endpoint path, this flag is always False.

    • Receive (bit 30): Whether the frame occurred due to receive (True) or not (False).

      For NI-XNET Read on the endpoint path, this flag is always True.

    • Network Synced (bit 23): Relevant to synchronization.
      Note The PXIe-8520 does not presently support synchronization.
    • Error (bit 16): Whether an error occurred during reception or transmission of the frame (False = good frame, True = bad frame).

    All unused bits are 0.

    NI-XNET Write ignores this field.

  • Frame Data—Data of the IEEE Std 802.3 frame. Frame Data begins with the destination MAC address and ends with the frame's last byte of MSDU.

    The maximum length of this array is provided in the Payload Length Maximum property.

    This field uses big-endian byte order.

  • FCSIEEE Std 802.3 Frame Check Sequence (FCS) that was received with the Frame Data.

    This field uses big-endian byte order. NI-XNET Write ignores this field.

  • The following tables provide examples of the two most commonly used formats for frame data on Ethernet, as specified in IEEE Std 802.3 and IEEE Std 802.1Q. Unless otherwise indicated, fields in the following tables all use big-endian byte order.

    NI-XNET Ethernet Raw Frame Data for Untagged Frames

    The following table shows frame data for an untagged frame. An untagged frame uses the default Priority 0, default Drop Eligible false, and the default VLAN Identifier (VID) 1.

    Field Byte Offset
    Destination MAC Address 24 to 29
    Source MAC Address 30 to 35
    EtherType 36 to 37
    MSDU 38 to (Length - 5)

    These fields are defined as follows:

  • Destination MAC Address—Destination MAC address as specified in IEEE Std 802 and IEEE Std 802.3. The MAC address comprises six bytes.
  • Source MAC Address—Source MAC address as specified in IEEE Std 802 and IEEE Std 802.3. The MAC address comprises six bytes.

    For Write, you can use Source MAC Address Auto? to automatically populate this field.

  • EtherType—16-bit unsigned integer that specifies the protocol used to encode and decode bytes in the MAC service data unit (MSDU).

    In other words, the EtherType determines what the frame contains.

    EtherType values are assigned by the IEEE Registration Authority (IEEE-RA). Examples include hex 0800 for Internet Protocol version 4 (IPv4), hex 08DD for Internet Protocol version 6 (IPv6), and hex 22F0 for IEEE Std 1722.

  • MSDU—Payload of the frame, which IEEE 802 standards refer to as the MAC service data unit (MSDU).

    IEEE Std 802.3 specifies the minimum length of the MSDU as 46 bytes (padded as necessary).

    The maximum length of the MSDU, sometimes called the maximum transmission unit (MTU), is 1,500 bytes.

  • NI-XNET Ethernet Raw Frame Data for VLAN Frames

    The following table shows frame data for a frame with a VLAN tag.

    Table 5. Ethernet Raw Frame Data for VLAN Frames
    Field Byte Offset
    Destination MAC Address 24 to 29
    Source MAC Address 30 to 35
    Tag Protocol ID 36 to 37
    Tag Control Info 38 to 39
    EtherType 40 to 41
    MSDU 42 to (Length - 5)

    These fields are defined as follows:

  • Destination MAC Address—Destination MAC address as specified in IEEE Std 802 and IEEE Std 802.3. The MAC address comprises six bytes.
  • Source MAC Address—Source MAC address as specified in IEEE Std 802 and IEEE Std 802.3. The MAC address comprises six bytes.

    For Write, you can use Source MAC Address Auto? to automatically populate this field.

  • Tag Protocol ID—Optional range specified by IEEE Std 802.1Q that adds information to the frame without changing its content (i.e., EtherType or MSDU).

    If a frame contains a tag, this tag protocol identification (TPID) field specifies the encoding of the tag's information (tag control info). TPID of hex 8100 is the Customer VLAN Tag (C-TAG), which is the general-purpose tag format commonly known as a VLAN tag.

  • Tag Control InfoIEEE Std 802.1Q specifies the 16-bit tag control info for a C-TAG as follows:
    • Bits 13–15 (upper three bits): priority code point (PCP). This field is commonly known as the priority of the frame. Priority is mapped to a traffic class, and the traffic class determines the timing and importance of the frame as it egresses from a queue at each port in the switched Ethernet network. In other words, priority determines how the frame travels through queues.
    • Bit 12: drop eligibility indicator, or drop eligible indicator (DEI): If drop eligible is true, the frame can be discarded by metering algorithms in preference to frames in which drop eligible is false.
    • Bits 0-11 (lower 12 bits): VLAN identifier (VID): Specifies where the frame travels through the network (i.e., on which ports of a switch it egresses). Within a frame, VID value 0 indicates a null VID, meaning that the tag contains only priority information (commonly known as priority tag). The default VID value for all ports is 1, and therefore both untagged and priority-tagged frames use the default VID of 1.
  • EtherType—16-bit unsigned integer that specifies the protocol used to encode and decode bytes in the MAC service data unit (MSDU).

    In other words, the EtherType determines what the frame contains.

    EtherType values are assigned by the IEEE Registration Authority (IEEE RA). Examples include hex 0800 for Internet Protocol version 4 (IPv4), hex 08DD for Internet Protocol version 6 (IPv6), and hex 22F0 for IEEE Std 1722.

  • MSDU—Payload of the frame, which IEEE 802 standards refer to as the MAC service data unit (MSDU).

    IEEE Std 802.3 specifies the minimum length of the MSDU as 46 bytes (padded as necessary).

    The maximum length of the MSDU, sometimes called the maximum transmission unit (MTU), is 1,500 bytes.