Skip to content

IQ streaming and network priority

RF Sentry serves UI/API/control on PORT (default 8443) and IQ on a dedicated external STREAM_PORT (default 8444). Both listeners are in the same unprivileged gateway process, with the same TLS certificate. There is no extra SDR connection, processing pipeline, or proxy on this appliance. The IQ listener does not serve the application, API, downloads, or receiver controls.

Connections and security

After control authentication, stream.endpoint supplies the configured streaming port, scheme, path, and protocol. Each receiver lane's ingress worker opens its own wss://<current-appliance-host>:<STREAM_PORT>/ws/iq connection and binds its existing session token. All active adapters share the listener, not one TCP stream. Their leases, queues, sample counters, worker paths, and independent release behavior remain unchanged.

The browser retains its current validated hostname and normal certificate checks. Both listeners require an exact UI origin from ALLOWED_ORIGINS. The application's existing connect-src wss: policy permits the discovered secure endpoint; TLS/security checks are not disabled. An IQ connection to the API port is rejected, with no fallback. Local HTTP tests are allowed only on explicit loopback deployments.

AUTH_ENABLED=yes requires operator authentication before endpoint/session commands. In the existing explicit local-first AUTH_ENABLED=no mode, operator authentication remains disabled; IQ still requires the random session-binding token and an authorized origin. This change does not silently change the operator's authentication policy.

If adding a TLS reverse proxy later, give IQ a dedicated external port, forward only /ws/iq, retain origin/token validation, and align the advertised endpoint and nftables scope with that external connection. The current direct listener advertises its own STREAM_PORT. It does not implement a separately hosted proxy or claim internal backend separation provides network QoS.

Choose priority: one command

Profile DSCP Expected Wi-Fi category
Best Effort CS0 / 0 AC_BE
Video (default) AF41 / 34 AC_VI
Voice EF / 46 AC_VO
sudo rfsentry-qos profile voice
sudo rfsentry-qos profile video
sudo rfsentry-qos profile best-effort

Each command persists and enables the choice in /etc/rfsentry/qos.conf, then atomically applies it to established streams. It does not restart acquisition, disconnect clients, or change receiver settings. Kernel-queued packets already past the marking hook may retain their old codepoint briefly. Voice requests more aggressive airtime access and can affect other latency-sensitive traffic. It neither reserves bandwidth nor creates capacity.

Alternatively set PROFILE=Video and reload rfsentry-qos.service. The prior numeric DSCP setting remains supported; remove it when using PROFILE unless both specify the same codepoint.

Settings, installation, and persistence

Public listener settings belong in /etc/rfsentry/appliance.conf:

API_PORT=8443
STREAM_PORT=8444

These are examples, not fixed endpoints. rfsentry-config apply derives PORT, STREAM_PORT, allowed origins and TLS policy in api.conf; do not edit those generated fields as a second authority. Follow identity activation for the deliberate gateway restart/reconnect required by a port change, then reload QoS to replace the old port match. Interface/profile-only changes need only QoS reload. Upgrades preserve unrelated API settings and explicit QoS choices while regenerating identity-owned fields.

/etc/rfsentry/qos.conf:

ENABLED=yes
PROFILE=Video
API_CONFIG=/etc/rfsentry/api.conf
SERVICE_USER=rfsentry
INTERFACES=AUTO
HEALTH_CONFIG=/etc/sdr-health.conf

AUTO inherits an explicitly configured wireless health interface, otherwise discovers WLANs through Linux sysfs, including IPv6-only WLANs. Explicit names also support Ethernet. No appliance/client IP, MAC, or ephemeral port is fixed. The implementation is independent of Pi model/RAM and works unchanged on Pi 5.

The normal installer provisions both listeners and the enabled QoS boot oneshot. Once the dedicated gateway is installed, this updates QoS alone:

sudo ./install.sh --install --qos-only
sudo rfsentry-qos check
sudo systemctl reload rfsentry-qos.service

The two nftables rules require the gateway socket UID, dedicated TCP source port, and selected egress interface. They preserve ECN. TCP handshake and rejection responses on the IQ listener are included; primary API/control, exports, and bulk downloads are not, regardless of the configured API port. Other services, forwarded/container traffic, upstream HTTPS, and loopback RTL-TCP remain outside the scope.

Only ownership-checked inet rfsentry_qos is replaced. Stale broad API-port rules are removed atomically; rules never accumulate. Failure preserves the previous installed rules, and failed profile commands restore the saved preference. Successful apply resets counters and invalidates old capture evidence. No global firewall/NAT/qdisc flush or priority override is performed.

The enabled oneshot runs after nftables at boot and before the gateway, with no resident daemon or polling. QoS failure does not prevent reception. Do not enable the stock nftables service just for this feature: its default file may flush the entire ruleset. After an external firewall flush or WLAN hotplug, reload the QoS service.

Observe configured, applied, and verified state

sudo rfsentry-qos status
sudo rfsentry-qos verify --seconds 3
journalctl -t rfsentry-qos --since '10 minutes ago'
sudo nft list table inet rfsentry_qos

Status separately reports configured intent, actual rule scopes and counters, configuration agreement, and explicit timestamped capture evidence. It does not infer packet verification from configuration or counters alone. verify uses a bounded, outbound, header-only capture on configured interfaces; it needs an active stream and tcpdump. Verification is tied to the installed policy, volatile across reboot, and invalidated on application/changes.

Structured qos.applied, qos.changed, qos.disabled, and qos.failed events include previous/requested profile, DSCP name/number, streaming port/interface scope, success, and expected WMM category. No tokens or per-packet logs.

With ECN zero, Video is tos 0x88 and Voice tos 0xb8. The inspected brcmfmac driver uses Linux DSCP classification at default packet priority: AF41 maps to UP4/AC_VI; EF maps to UP6/AC_VO. Driver, firmware and AP policies can differ. IP captures do not establish over-the-air WMM behavior.

Rollback

Set ENABLED=no and reload:

sudo systemctl reload rfsentry-qos.service

For immediate removal even with broken configuration:

sudo rfsentry-qos remove

Only RF Sentry's table is removed. Set ENABLED=no too to prevent return at boot/reload. Removing priority does not undo listener separation or interrupt streams. Simply disabling the unit is insufficient because the gateway wants it. Returning to the previous single-listener binary requires a deliberate gateway/client rollback, not a silent transport fallback.