> **Sokil documentation pack**
> Language: English
> Station software: 20261126_usb_cameras
> UI build: c6b2dc620
> Generated: 2026-11-26
> Generated by the Sokil ground station UI from the documentation it ships. Download it again after every software update - the pack describes the version it was generated from.

<a id="ip-error-correction"></a>

# Error correction over IP links

**Summary:** How the FEC tunnel keeps video whole over ZeroTier, Starlink, cellular and wired links - what it adds, what it costs on the uplink, what setup picks per link, and how to read loss before and after correction on Status.

**Audience:** field integrators

Open in the UI: http://10.1.1.30/help/guides/ip-error-correction

A radio link is not the only one that loses packets. **Starlink, a cellular modem and a
ZeroTier path across the public internet** all drop packets too, often in bursts, and a video
stream that loses packets shows it at once: smears, frozen blocks, a picture that waits for the
next keyframe. Sokil carries video and telemetry over every IP link inside the **FEC tunnel**,
which adds parity packets so that the station can rebuild what the network lost.

This page is the general explanation. The kit pages
([Starlink / ZeroTier camera](camera-starlink-zerotier.md#camera-starlink-zerotier),
[Ethernet or fiber camera](camera-ethernet-fiber.md#camera-ethernet-fiber),
[Starlink repeater](repeater-starlink.md#repeater-starlink)) say what setup writes on each kit and link
here for the why.

<a id="ip-error-correction--what-the-tunnel-adds-on-an-ip-link"></a>

### What the tunnel adds on an IP link

The camera hands its video to the tunnel, the tunnel groups the packets, adds parity packets to
each group and sends the lot to the station over plain UDP. The station's end of the tunnel puts
the original packets back together, rebuilding any that went missing, and hands the video on to
the viewer. Telemetry rides two more streams of the same tunnel, in both directions.

This is **a separate layer from the error correction of the radio**. Over the WiFi radio the same
tunnel protects packets in the air; over IP it protects them across whatever the network is -
Ethernet, ZeroTier, Starlink, a mobile modem. You do not turn it on by hand: setup switches
**Over IP** (parameter `vtx_ufec_udp`) on for the camera and **Over IP** (parameter `vrx_ufec_udp`) for the
station (VTX / VRX settings > Connection > Link transport) on every Ethernet and ZeroTier link,
and the tunnel runs from there. A camera bound over WiFi only has the radio tunnel as its ground station address, so Over IP has nowhere to go and the settings page warns about it: bind it from a station that receives over Ethernet or ZeroTier.

<a id="ip-error-correction--the-ratio-k-m-and-what-it-costs"></a>

### The ratio, K:M, and what it costs

Each stream's protection is a ratio written `K:M`: **K** data packets, then **M** parity packets,
in a group of K + M. The station can rebuild the whole group from **any K** of those packets, so a
group survives up to M lost packets, wherever in the group they fall. Losing more than M in one
group leaves holes no parity can fill.

Parity is paid for on the wire. Every group sends K + M packets to carry K, so the stream costs
(K + M) / K times its bitrate:

| Ratio | Where Sokil uses it | On the wire | Survives, per group |
| --- | --- | --- | --- |
| passthrough (no ratio) | the video on an Ethernet or fiber camera | 1x, plus a small header per packet | nothing - loss is counted, not rebuilt |
| `10:2` | the video on a wired camera, kept for when parity is turned back on | 1.2x | 2 of every 12 |
| `4:1` | both MAVLink streams on a wired camera and its station, kept for when parity is turned back on | 1.25x | 1 of every 5 |
| `8:4` | the video on a ZeroTier / Starlink / LTE camera, and the device's own default video ratio | 1.5x | 4 of every 12, a third |
| `6:3` | for comparison | 1.5x | 3 of every 9, a third |
| `4:2` | both MAVLink streams on ZeroTier (and over the radio) | 1.5x | 2 of every 6, a third |
| `6:6` | for comparison | 2x | half |

A ratio with the same share of parity - `8:4` and `6:3` - costs the same and absorbs the same
share of loss. The bigger group still differs where bursts are concerned: four packets lost in a
row inside one group are rebuilt at `8:4` and not at `6:3`. A device updated from an older release that still holds `6:3` on a video stream moves to `8:4` once.

**Parity is paid on the uplink you have.** On a ZeroTier or Starlink camera at `8:4`, a 2048 kbps
rung puts about 3072 kbps on the wire, a 2560 rung 3840, a 3072 rung 4608 and a 3584 rung 5376 -
before telemetry and the network's own overhead. That is why setup keeps the top of the _Resilient_
ladder at 2048 kbps and of _Normal_ at 2560, under 4 Mbps on the wire: a ZeroTier path usually carries
4 to 8 Mbps outbound, parity included.

<a id="ip-error-correction--what-setup-picks-per-link"></a>

### What setup picks per link

The ratio branches by link, so setup writes it on every link rather than leaving the device's
default in place.

**ZeroTier, Starlink or LTE camera.** Setup writes `8:4` to **Video FEC** (parameter `vtx_ufec_fec`) and
**Second video FEC** (parameter `vtx_ufec2_fec`) on the camera's **UFEC streams** card, puts both video
streams in **Instant delivery** mode (parameters `vtx_ufec_mode`, `vtx_ufec2_mode`), and gives both MAVLink
streams `4:2` in **Low latency** mode (parameters `vtx_ufec3_fec`, `vtx_ufec4_fec`, `vtx_ufec3_mode`, `vtx_ufec4_mode`).
With **Compatibility** selected for the camera in setup, both video streams use **Normal** instead.
The station writes the same `4:2` / **Low latency** on its own MAVLink streams (parameters `vrx_ufec3_fec`, `vrx_ufec4_fec`, `vrx_ufec3_mode`, `vrx_ufec4_mode`),
because the return path - RC and the uplink - is encoded with the station's settings. Every rung of
the ZeroTier ladder carries `8:4` too, but over IP a preset's FEC does not reach the wire: presets
set the tunnel's ratio only while the radio carries the link, so over IP the tunnel runs on
**Video FEC**, and that is the value that counts.

**Ethernet or fiber camera.** A cable loses nothing parity could bring back, and a packet a fiber
does lose is a fault to see, not a gap to paper over. So setup puts both video streams and both
MAVLink streams, at both ends, in **Passthrough (no FEC)**: every packet goes out as it is,
wrapped in the tunnel's header, and the station counts a missing one as loss. The fiber carries
the video bitrate itself - 32 Mbps on a 32768 kbps rung, where `10:2` would make it 39. The `10:2`
video ratio (`4:1` on the MAVLink streams) is still written, so that turning parity back on for a cable you doubt costs the least.

**Starlink repeater.** The leg out to the station is a ZeroTier link like a camera's: `8:4` on the
relayed video, `4:2` in **Low latency** on both MAVLink streams, on both legs. The
[Starlink repeater](repeater-starlink.md#repeater-starlink) guide has the whole table.

**Keyframes over IP.** Parity repairs scattered loss; a lost keyframe is a different problem, because
every picture after it depends on it. Two things handle it, and both live on the camera's **Over IP**
group on **[VTX settings](http://10.1.1.30/cam/vtx-settings) > Connection > Link transport**. When the station could not rebuild
a lost piece of the video it asks the camera for a fresh keyframe, and **Keyframe request gap** (parameters `vtx_ufec_kf_req_ms`, `vtx_ufec2_kf_req_ms`)
is the shortest time the camera lets pass between keyframes it is asked for - 300 ms by default, stretching
while requests keep coming and the keyframes it sends do not reach the station whole; a request inside the gap gets its keyframe when the gap ends. `0` makes the camera ignore the
requests. The camera's own radio asks for nothing when it has to drop a picture, so the gap applies only to the
station's requests, also on a camera that carries both radio and IP. And **Keyframe pacing** (parameters `vtx_ufec_ip_pace`, `vtx_ufec2_ip_pace`) stops
a keyframe leaving in one burst that a Starlink or cellular queue can drop: with it on, the IP leg sends no
faster than a set multiple of the live bitrate (`1.0` to `8.0`), so the keyframe goes out over a few frames.
Setup writes `0` (off) on Ethernet, `2` on a ZeroTier / Starlink camera and `1.5` on an LTE one, and leaves the request
gap alone. The radio leg is never paced. A camera on older software has neither row and does neither. Both rows are
shown to an expert only: the setup values are the ones to keep.

**Re-sending lost packets over IP.** Parity cannot always rebuild a piece of the video, so on an IP link the station can also notice a lost packet and ask the camera, which sends it again. The switch is **Re-send lost video packets** (parameter `vtx_ufec_retx`) on the camera and (parameter `vrx_ufec_retx`) on the station, in the **Over IP** group of **Connection > Link transport** (admin), and it is on by default. Both ends must have it on, on a release that has it; a device on older software shows no switch. It acts only on a video stream that runs FEC over UDP - not on the radio, not in passthrough. With no loss it adds no delay; on a loss the frames behind the lost packet wait about one round trip, at most 150 ms, after which the video skips and asks for a keyframe as before. Re-sends are limited to a quarter of the stream's bitrate.

**Over the WiFi radio** the video's parity works differently: the selected preset sets it on every
switch, as [Range, bitrate and error correction](range-and-bitrate.md#range-and-bitrate) describes.

<a id="ip-error-correction--the-mode-and-why-only-the-sender-s-counts"></a>

### The mode, and why only the sender's counts

The mode decides **when the sender lets packets go**. The five, as the rows name them:

| Mode | What the sender does |
| --- | --- |
| **Normal** | collects a whole group, then sends it with its parity - the most efficient and the slowest |
| **Low latency** | sends each packet as it arrives, parity at the end of the group |
| **Early delivery** | the same, and the receiver passes packets on without waiting for the group |
| **Instant delivery** | sends each packet the moment it arrives, parity once the group fills; keeps the camera's own pacing - the right mode for video |
| **Passthrough (no FEC)** | no groups and no parity; loss is counted at the receiver but not recovered |

**The receiver decodes whatever arrives**, whatever ratio and mode it was sent with. So the mode and the ratio are each sender's own choice: the camera's describe what the
camera sends, the station's what the station sends back, and the two ends never have to match.
What must match is the transport - **Over IP** on at both ends.

**Normal** buffers data before sending, adding delay that depends on incoming packets and the
flush settings. A packet is not a video frame, so frame rate alone does not determine that delay.
Setup normally selects **Instant delivery** for video over ZeroTier, but selects **Normal** when
the camera's **Compatibility** option is on. Keep the mode selected for your kit.
With **Instant delivery**, packets can be sent as they arrive; recovery of a lost packet can still
wait for parity. On the station, **In-order delivery** holds an out-of-order
packet for at most the reorder wait (70 ms by default) (parameters `vrx_ufec_ordered`, `vrx_ufec_ordered_hold_ms`)
before skipping ahead.

The network adds its own delay on top: **Starlink adds about 60 to 100 ms on each side of the link, and
a 4G modem more.** Error correction cannot remove that; it only keeps a lost packet from costing a
keyframe's wait.

<a id="ip-error-correction--beside-presets-and-adaptive-link"></a>

### Beside presets and Adaptive Link

- **The preset ladder** sets the bitrate over IP; **Video FEC** sets the parity. A
  preset step changes the picture and its bitrate, never the ratio.
- **Adaptive Link** (on by default after setup on a ZeroTier or Starlink camera) starts from the
  tunnel's ratio and can raise the parity and trim the bitrate in flight as loss rises, then put
  them back. While it manages the video, the ratio on the wire (parameter `vtx_ufec_feca`) can differ
  from the one you set. See [Adaptive Link](adaptive-link.md#adaptive-link).
- **Telemetry is never managed** by Adaptive Link: the MAVLink streams keep the ratio they were
  given.

<a id="ip-error-correction--reading-it-on-status"></a>

### Reading it on Status

The honest test is the station's own count of what arrived. Open the ground station's
**[Status](http://10.1.1.30/gs/status)** page, tap the **Video** stream to unfold it, and read the **UFEC Video**
card (parameter `vrx_ufec_rx_pkts`):

| Counter | What it counts | When it colors |
| --- | --- | --- |
| **d+FEC** | every packet that arrived, data and parity | - |
| **data** | the video packets handed on, rebuilt ones included | - |
| **wire lost** | packets the network lost, **before** correction (the WiFi card has no such cell: its **unrec** is the same as this card's **unrec**) | amber at 2% of the traffic, red at 5% |
| **recov** | lost packets the parity rebuilt | amber above 10 in one report, red above 25 - work done, not damage |
| **unrec** | packets the parity could not rebuild - what the pilot actually misses | amber at 1%, red at 3% of delivered plus unrecoverable packets |

**wire lost** and **unrec** change color only when that counter itself reaches at least three
packets; with one or two the counter stays green. The separate **JAMMED** flag needs at least
three unrecoverable packets making up 5% of delivered plus unrecoverable packets, while
packets still arrive: 4.9% does not set it; 5.0% does.

With current station software, the OSD link error count follows the same UFEC loss
colors (clean with fewer than three unrecoverable packets, amber from 1%, red from 3%). A station or
OSD with software from before 2026-10-10 still shows the earlier rule: amber from one missing
packet and red from 1%, and before 2026-10-09 red after a single missing packet. Update the station and the software displaying the OSD together.

How to read the pair:

- **High wire lost, unrec at zero** is the tunnel doing its job: the network is dropping packets and
  the picture is whole.
- **unrec climbing** means the loss is beyond what the ratio covers - bursts longer than M, or
  more loss than a third of the traffic at `8:4`. Look at the uplink first (the dish's view of the
  sky, the modem's signal, what else shares the path), then raise the parity one step on the camera's **Video FEC**.
- **wire lost with no recov on a wired kit** is expected: passthrough counts loss and cannot rebuild it,
  so any number there is the cable or the switch.

On the **camera's** [Status](http://10.1.1.30/cam/status) page the same card (parameter `vtx_ufec_tx_pkts`) shows the
sending side, with the ratio actually on the wire as its **FEC** badge. **dropped** and **trunc**
there mean the camera could not get the packets out at all - the outbound path cannot carry the
bitrate plus parity - and no parity helps with that: lower the bitrate.

<a id="ip-error-correction--who-can-change-it"></a>

### Who can change it

The **ratio** and the **mode** are both expert settings, and an admin does not see them: the ratio is traded per airframe and per link,
and the mode is what turns parity back on for a wired link that setup left in passthrough. A mode moved
by hand changes how the link behaves under loss, so keep what setup wrote unless you mean it. A pilot
or an admin does not see the UFEC streams card at all; the one way an admin changes the video ratio is the Link test's **Apply**.

- An expert finds the ratios on the camera's **[VTX settings](http://10.1.1.30/cam/vtx-settings) > Connection >
  UFEC streams** card: **Video FEC** (parameter `vtx_ufec_fec`), **Second video FEC** (parameter `vtx_ufec2_fec`),
  **MAVLink FEC** and **Second MAVLink FEC** (parameters `vtx_ufec3_fec`, `vtx_ufec4_fec`). On the station's
  **[VRX settings](http://10.1.1.30/gs/vrx-settings) > Connection > UFEC streams** the two MAVLink ratios (parameters `vrx_ufec3_fec`, `vrx_ufec4_fec`)
  protect what the station sends back. The station only decodes the video, so it has no video ratio
  to set: that belongs to the camera. Each stream's **Mode** row sits above that
  stream's FEC row and carries the mode's warning, for example that in passthrough a loss is detected
  but not recovered. Over IP the ratio dropdown offers `11:1`, `10:2`, `9:3`, `8:4`, `7:5`, `6:6` for
  video and `4:1`, `4:2`, `4:3`, `4:4`, `4:6` for MAVLink, then **Other**; a saved value that is not
  on the list shows as **Other** with its value.
- The card is one section per stream (**Video**, **Second video**, **MAVLink**,
  **Second MAVLink**), each with its **FEC** and **Mode** rows (parameters `vtx_ufec_mode`, `vtx_ufec2_mode`, `vtx_ufec3_mode`, `vtx_ufec4_mode`, `vrx_ufec3_mode`, `vrx_ufec4_mode`),
  plus the shaping rows.

Change one end at a time and watch **unrec** and the uplink rate after each step: more parity
buys recovery with bitrate the uplink may not have.

<a id="ip-error-correction--related-guides"></a>

### Related guides

- [Starlink / ZeroTier camera](camera-starlink-zerotier.md#camera-starlink-zerotier) - the kit, its ladder and
  what each rung asks of the uplink
- [Ethernet or fiber camera](camera-ethernet-fiber.md#camera-ethernet-fiber) - the wired kit in passthrough
- [Starlink repeater](repeater-starlink.md#repeater-starlink) - the tunnel on the repeater's outbound leg
- [Adaptive Link](adaptive-link.md#adaptive-link) - the loop that moves bitrate and parity in flight
- [Range, bitrate and error correction](range-and-bitrate.md#range-and-bitrate) - the same idea over the
  WiFi radio, where the preset carries the ratio
- [Status and diagnostics](status-and-diagnostics.md#status-and-diagnostics) - the flow board the counters live
  in
