Radio transport protocols are used to exchange samples (or other items) between host and devices. If one were to sniff Ethernet traffic between a USRP and a PC, the packets would conform to a radio transport protocol.
For USRP devices, two radio transport protocols are relevant: VRT (the VITA Radio Transport protocol) and CHDR (compressed header, an Ettus-specific protocol). Generation-3 devices and the B200 use CHDR, the rest use VRT.
VRT is an open protocol defined by the VITA-49 standard. It was designed for interoperability, and to allow different device types to work with different software stacks.
VRT is a very verbose standard, and only a subset is implemented in UHD/USRPs. The full standard is available from the VITA website: http://www.vita.com .
For the third generation of Ettus devices, a new type transport protocol was designed. It reduces the complexity of the original standard and uses a fixed-length 64-Bit header for everything except the timestamp. Because it is "compressed" into a 64-bit heaer, it was dubbed CHDR (pronounced like the cheese "cheddar").
By compressing all information into a 64-bit line, the header can efficiently be parsed in newer FPGAs, where the common streaming protocol is 64-Bit AXI. The first line in a packet already provides all necessary information to proceed.
Some CHDR-specific functions can be found in: uhd::transport::vrt::chdr.
The form of a CHDR packet is the following:
Address (Bytes) | Length (Bytes) | Payload |
---|---|---|
0 | 8 | Compressed Header (CHDR) |
8 | 8 | Fractional Time (Optional!) |
8/16 | - | Data |
If there is no timestamp present, the data starts at address 8, otherwise, it starts at 16.
The 64 Bits in the compressed header have the following meaning:
Bits | Meaning |
---|---|
63:62 | Packet Type |
61 | Has fractional time stamp (1: Yes) |
60 | End-of-burst or error flag |
59:48 | 12-bit sequence number |
47:32 | Total packet length in Bytes |
31:0 | Stream ID (SID) |
The packet type is determined mainly by the first two bits, although the EOB or error flag are also taken into consideration:
Bit 63 | Bit 62 | Bit 60 | Packet Type |
---|---|---|---|
0 | 0 | 0 | Data |
0 | 0 | 1 | Data (End-of-burst) |
0 | 1 | 0 | Flow Control |
1 | 0 | 0 | Command Packet |
1 | 1 | 0 | Command Response |
1 | 1 | 1 | Command Response (Error) |
For CHDR, we provide a Wireshark dissector under tools/chdr_dissector. It can be used for Ethernet links as well as USB (e.g., for the B210).
Relevant code sections for the radio transport layer are: uhd::transport::vrt - Namespace for radio transport protocol related functions and definitions uhd::transport::vrt::chdr - Sub-namespace specifically for CHDR uhd::sid_t - Datatype to represent SIDs