Network and upload — RIST and SRT without losses, the line protected
Updated 11 Oct 2026Push outputs (RIST, SRT, RTMP, UDP) and viewers all use the same upload line. From Castreon 1.4.0, the server manages it by itself: it does not let the line fill up, and it gives RIST and SRT outputs room to recover lost packets. Everything is configured in Settings → Network and upload (all plans).
Why it matters
RIST and SRT resend the packets that get lost on the way. After a short line drop (a second or two), every output has to resend everything that was lost at once — for a few moments, several times its bitrate.
- Without any protection, when all outputs do this together, the line fills up. The queue builds up in the router, which drops packets from every stream; the receivers ask for even more retransmissions, and some routers stop responding altogether.
- With a tight limit on each output, the line no longer fills up, but the retransmissions after a drop no longer fit: the receiver is left with packets lost for good, and viewers see a broken picture.
Castreon solves both problems with a shaper on the server: the server never sends more than the line can carry, and the bandwidth is shared fairly between streams. Retransmissions after a drop use the free bandwidth without harming the others, so the limit of each output can stay wide.
The settings
| Setting | What it means |
|---|---|
| Line upload (Mbit/s) | the line's upload speed, from the contract. If you are not sure, measure it at night over a cable and enter a slightly lower value |
| Line shaper | On (recommended) keeps all server traffic below the line |
| Card to the internet | usually Automatic — the card of the default route |
| Shaper at (% of upload) | 95 % by default — leaves room for PPPoE / VLAN headers and for line variations |
| RIST / SRT retransmission limit | Automatic (recommended), Manual or No limit — see below |
The shaper applies as soon as you save. If the value you entered would sit below what the server is sending at that moment (for example 100 instead of 1000), the panel asks you to confirm before saving.
The retransmission limit
| Mode | Limit of each RIST output | SRT |
|---|---|---|
| Automatic, with the shaper active | bitrate × 4 + 2 Mbit/s — full recovery after short drops; the line is protected by the shaper | resends at most once more the bitrate (maxbw=0&oheadbw=100) |
| Automatic, without the shaper (upload not set) | bitrate × 3 + 1.5 Mbit/s — a compromise | as above |
| Manual | bitrate × the chosen factor (1.5–10) + 1 Mbit/s | as above; below ×2, less |
| No limit | the RIST default (100 Mbit/s per stream), as up to Castreon 1.3.6 | nothing set by Castreon |
The bitrate comes from the profile when the channel is transcoded and from the measured peak when the picture is copied (on the first start of a new channel, while it is being measured, the limit is provisional).
The limit applies when the channel starts. After changing the upload, the shaper or the limit, press Apply now: the channels with RIST / SRT outputs restart one at a time, 3 seconds apart, and get the new limit. Otherwise they get it at their next restart.
A limit you write yourself in the output address is kept: RIST bandwidth=… in kbps, SRT maxbw=… in bytes per second. Never set the RIST limit below the channel bitrate — recovery would stop completely.
What you see in the panel
- Settings → Network and upload: how much the server is sending now and what percentage of the line, the shaper's state (card, type, rate), the packets dropped by the shaper (when the line was full) and the policy that channels get when they start.
- On each RIST output, on the channel page: the retransmissions requested by the receiver and Refused by the limit — the retransmissions the limit did not let go out.
- Alerts: RIST limit cuts recovery (retransmissions refused in the last minute — the receiver may lose packets) and the line is almost full (upload above 90 % of the line for a whole minute). The channel alert also reaches notifications, in the Push outputs family.
- The channel log shows at every start the applied policy and the limit of each RIST and SRT output.
The RIST buffer — the same at both ends
Buffer / latency is the time RIST has to recover a packet. Each end has its own buffer: the sender keeps the packets it has sent only as long as its own buffer says. Set the same value at the sender and at the receiver. A larger buffer (for example 4000–8000 ms) leaves more time for recovery — the retransmissions after a drop spread over several seconds and need less bandwidth at once —, at the cost of a longer delay on that stream.
Technical requirements
- The shaper uses Linux traffic control: CAKE (recommended; included in Linux kernels 4.19 and newer, for example Ubuntu 20.04, 22.04, 24.04) or, if it is missing, HTB with fq_codel. The
tccommand comes from theiproute2package. - The Castreon service must be allowed to configure the network card. The standard installation runs as root, so it works right away. If you run Castreon with a dedicated user, add the
CAP_NET_ADMINcapability:
sudo mkdir -p /etc/systemd/system/castreon.service.d
printf '[Service]\nAmbientCapabilities=CAP_NET_ADMIN\n' | sudo tee /etc/systemd/system/castreon.service.d/net-admin.conf
sudo systemctl daemon-reload && sudo systemctl restart castreon
- Castreon never touches a traffic configuration someone else has put on the same card — the panel then tells you why the shaper is not active. If the card is restarted (for example by the network), Castreon puts the shaper back within seconds. When you turn the shaper off, the card goes back to the system's configuration.