-
Notifications
You must be signed in to change notification settings - Fork 0
Secure UDP and nmea sproxy
UDPSEC is AISMixer's authenticated encrypted UDP transport for station-to-mixer traffic. It is not an external standardized protocol.
nmea_sproxy is the station-side proxy. One process represents one relation:
one local input -> one AISMixer output
Run separate processes or systemd template instances for separate local inputs or separate AISMixer destinations.
nmea_sproxy extracts both !AIVDM and !AIVDO from supported local inputs before sending them to UDPSEC or explicitly configured plain UDP output.
Current local input modes:
- legacy local UDP input with
listen_ipandlisten_port; - physical serial or USB virtual COM input with
input.type: serial.
Current output modes:
- UDPSEC output, using legacy
remote_host/remote_portor explicitoutput.type: udpsec; - explicitly configured plain UDP output with
output.type: udpfor trusted LAN or VPN environments.
Plain UDP output is explicit compatibility behavior. It has no UDPSEC authentication, encryption, replay protection, or liveness protocol.
UDPSEC provides:
- ECDSA station authentication;
- AISMixer public-key verification by the station;
- session derivation from ECDH and signatures;
- AES-GCM protected data packets;
- encrypted ping/pong liveness;
- peer timeout and reconnect;
- optional session refresh;
-
NOSESSIONreconnect hints; - remote address and port pinning.
NOSESSION is an unauthenticated reconnect hint, accepted only from the configured remote address and port.
A source-IP or source-port change requires a new handshake. UDP remains an unreliable transport, so packet loss is still possible.
UDPSEC protects packets in transit. It does not prove the semantic truth or physical origin of AIS data.
nmea_sproxy selects configuration in this order:
-
--config PATH; -
NMEA_SPROXY_CONFIG; -
/etc/nmea_sproxy/config.yaml; -
config.yamlnext tonmea_sproxy.py; - built-in defaults.
An explicitly selected --config or NMEA_SPROXY_CONFIG path must exist.
Relative station_private_key, remote_public_key, and legacy aismixer_public_key paths are resolved relative to the selected config file.
Standard installed station key paths:
/etc/nmea_sproxy/keys/station_private.pem
/etc/nmea_sproxy/keys/station_public.pem
/etc/nmea_sproxy/keys/aismixer_public.pem
station_private.pem stays on the station. AISMixer stores authorized station public keys, normally in /etc/aismixer/authorized_keys.yaml. The station stores the trusted AISMixer public key so it can verify the server handshake.
Plain UDP output does not load or require the UDPSEC station private key or AISMixer public key.
Legacy UDP input:
listen_ip: "::"
listen_port: 50000
allow_from:
- 192.0.2.15Serial input:
input:
type: serial
port: /dev/serial/by-id/usb-SRT_Marine_Technology_Ltd._AIS_Virtual_COM_Port_<device-id>-if00
baudrate: 38400
bytesize: 8
parity: N
stopbits: 1
read_timeout: 1.0
reconnect_delay: 5
max_line_bytes: 4096Windows serial port strings such as COM4 are also accepted in manual mode.
Legacy UDPSEC output:
remote_host: mixer.example.net
remote_port: 19999
source_ip: 192.0.2.20Explicit UDPSEC output:
output:
type: udpsec
host: mixer.example.net
port: 19999
source_ip: 192.0.2.20Explicit plain UDP output:
output:
type: udp
host: 192.168.10.20
port: 17777
source_ip: 192.168.10.15Installed singleton layout:
/etc/nmea_sproxy/config.yaml
/etc/systemd/system/nmea_sproxy.service
Template instance configs live under:
/etc/nmea_sproxy/instances/<operator-name>.yaml
/etc/systemd/system/nmea_sproxy@.service
The installer creates the config, instance, key, runtime, and unit layout, preserves existing configs and keys, enables only the singleton service, and starts no services automatically.
The update script refreshes runtime and unit files but does not modify /etc/nmea_sproxy configs or keys and does not restart singleton or template instances automatically.
The uninstall script preserves /etc/nmea_sproxy by default. Use --purge-config only when operator configs and keys should also be removed.
nmea_sproxy does not deduplicate, assemble multipart AIS, route streams, rewrite TAG metadata, or fan out to multiple destinations. AISMixer performs those jobs.