Control and data interface
I/Q datagram header
Applies to packet format version 1. All fields are big-endian.
Datagram
| Parameter | Value |
|---|---|
| Transport | UDP over IPv4, one datagram per packet |
| FO1 | destination port 10700, channels RX A and RX B |
| FO2 | destination port 10701, channels RX C and RX D |
| UDP payload | 8224 bytes: 32-byte header + 8192 bytes of samples |
| IPv4 packet | 8252 bytes; the host needs jumbo frames, MTU 9000 |
| Samples per datagram | 1024 per channel, two channels |
| Signal per datagram | 8.192 µs at 125 MS/s |
| Datagram rate | 122 070 per second per link |
| Line rate | 8.10 Gb/s per link (8290 bytes per datagram on the wire) |
| Header share | 0.4 % |
Header
The header is four 64-bit words. The samples start at byte 32, 64-bit aligned.
| Offset | Bytes | Field | Value |
|---|---|---|---|
| 0 | 2 | magic | 0x5654 (“VT”) |
| 2 | 1 | version | 1 |
| 3 | 1 | flags | status bits: FIFO full, ADC overrange, SYSREF valid |
| 4 | 1 | stream id | 1 on FO1, 2 on FO2 |
| 5 | 1 | format | 0x0F: complex, 16 bits in 2 bytes |
| 6 | 2 | decimation | fs = 250 MHz / decimation; 2 for 125 MS/s |
| 8 | 8 | sequence number | +1 per datagram of the stream |
| 16 | 8 | timestamp | 250 MHz board clock at the first sample |
| 24 | 8 | clock since SYSREF | 250 MHz ticks from the last SYSREF pulse to the first sample |
magic, version
A version 1 datagram starts with the bytes 56 54 01. A change of the header length or of the meaning of a field comes with a new version number.
flags
| Bit | Name | Meaning |
|---|---|---|
| 7 to 6 | reserved | Sent as 0; a receiver ignores them. |
| 5 | SYSREF valid | The field clock since SYSREF is valid: a SYSREF pulse has been received. |
| 4 | overrange RX D | An ADC sample of RX D clipped within this datagram. Only in datagrams of FO2. |
| 3 | overrange RX C | An ADC sample of RX C clipped within this datagram. Only in datagrams of FO2. |
| 2 | overrange RX B | An ADC sample of RX B clipped within this datagram. Only in datagrams of FO1. |
| 1 | overrange RX A | An ADC sample of RX A clipped within this datagram. Only in datagrams of FO1. |
| 0 | FIFO full | The FIFO of this stream overflowed in the board: samples were lost before this datagram. The sequence number does not show this loss. |
Bit 7 is the most significant bit of the byte. In normal operation the byte is 0x20.
stream id
Number of the stream the datagram belongs to. Sequence numbers are counted per stream.
format
| Bits | Meaning |
|---|---|
| 7 | 0 = complex (I, Q), 1 = real |
| 6 to 5 | bytes per component: 0 = 2 bytes, 1 = 3 bytes, 2 = 4 bytes |
| 4 to 0 | significant bits per component − 1 |
The board sends 0x0F.
decimation
Ticks of the 250 MHz system clock between two consecutive samples. The ADCs sample at 500 MS/s and their digital down-converters decimate by 4: 125 MS/s = 250 MHz / 2.
sequence number
- 64-bit counter per stream, +1 for every datagram sent.
- The first datagram after the stream is switched on has number 0.
- A jump means datagrams lost between the board and the application (fibre, network card, host).
timestamp
- 64-bit counter of the 250 MHz system clock, 4 ns per tick, read at the first sample of the datagram.
- One counter for both links: datagrams of FO1 and FO2 with the same timestamp hold samples of the same instant.
- Step between consecutive datagrams of a stream: 1024 × decimation = 2048 ticks = 8.192 µs.
- timestamp / decimation = index of the first sample.
- The counter restarts when the board is initialized.
clock since SYSREF
- 64-bit counter of the same 250 MHz clock; it restarts at every SYSREF pulse.
- SYSREF aligns the ADCs and, when shared, several boards.
- Without SYSREF pulses, timestamp − clock since SYSREF is constant. A change of the difference marks a pulse.
Samples
1024 sample groups follow the header in time order. One group is one sampling instant of both channels, four signed 16-bit integers:
Q1 I1 Q0 I0 Q1 I1 Q0 I0 ...
| Channel | Words | FO1 | FO2 |
|---|---|---|---|
| 0 | I0, Q0 | RX A | RX C |
| 1 | I1, Q1 | RX B | RX D |
Full scale is 32768. A tone 10 MHz above the NCO frequency appears at +10 MHz.
Captured datagram
First datagram of FO1 after the stream was switched on, captured on the host and opened in Wireshark with the VORTARIAN dissector. FPGA build 35.
The 32 header bytes of this datagram:
56 54 01 20 01 0F 00 02 magic "VT", version 1, flags 0x20, stream 1, format 0x0F, decimation 2
00 00 00 00 00 00 00 00 sequence number 0
00 00 00 00 7F E9 67 3E timestamp 2 146 002 750 ticks = 8.584 s
00 00 00 00 76 8E C9 4D clock since SYSREF 1 989 069 133 ticks = 7.956 s
The next datagram of the stream has sequence number 1; both counters are 2048 larger (…6F 3E, …D1 4D).
Receiver checks
| Check | Meaning when it fails |
|---|---|
Datagram starts with 56 54 01 | not a version 1 datagram: discard |
| Sequence number = previous + 1 | datagrams lost on the way to the application |
| Flag FIFO full (bit 0) = 0 | samples lost in the board |
| Flags overrange (bits 4 to 1) = 0 | input level too high: samples clipped in the ADC |
| Timestamp = previous + 1024 × decimation | discontinuity in the stream |
Pairing of the two links:
- Pair the datagrams of FO1 and FO2 by sequence number.
- When both streams are continuous and the timestamps of a pair differ, the later link started that many samples later. Skip those samples on the earlier link.
- In a few percent of the stream starts FO2 starts one sample after FO1: its timestamps are 2 ticks larger at the same sequence number.
Measured
| Test | Result |
|---|---|
| Simultaneous capture of both links, 125 703 datagram pairs | equal timestamps at equal sequence numbers in all pairs |
| 30 minutes of streaming on both links, 219.7 million datagrams per link | every timestamp step 2048 ticks; no FIFO overflow |
Software
- SoapyVortarian: SoapySDR driver; checks the header and aligns the two links.
- Wireshark dissector: shows the header fields of captured datagrams.
- Background and worked examples: The VORTARIAN I/Q Datagram Header on jse.dev.