Motivation:
SOVD deployments in automotive and embedded environments often operate on local networks without centralized service registries. mDNS-SD (DNS-Based Service Discovery over multicast DNS) allows SOVD servers to advertise themselves and discover peers on the local network with zero configuration, making it ideal for workshop tools, prototype setups, and multi-ECU environments.
Proposed Design
A new mdns feature flag (opt-in) in opensovd-providers exposes an MdnsDiscoveryProvider that implements the existing DiscoveryProvider trait. A thin MdnsWrapper owns the underlying mDNS daemon and is shared via Arc between the advertiser and the discovery provider so only one daemon per process is needed.
Service type: _sovd._tcp.local.
TXT records per service:
| Key |
Value |
identification |
VIN or device identifier |
accessurl |
Base HTTP URL, e.g. http://192.168.1.10:7690/sovd |
API
A server registers itself and wires up discovery through ServerBuilder:
// Advertise this server on the local network
let wrapper = Arc::new(MdnsWrapper::new()?);
wrapper.register("my-ecu", "VIN123", "http://192.168.1.10:7690/sovd", ip, port)?;
// Share the same daemon with the discovery provider
let provider = MdnsDiscoveryProvider::from_wrapper(Arc::clone(&wrapper));
let server = Server::builder()
.discovery(Box::new(provider))
// ...
.build()?;
CLI / Gateway Integration
The opensovd-gateway binary gains a --mdns flag group (feature-gated):
| Flag |
Env var |
Description |
--mdns |
— |
Enable mDNS advertisement and discovery |
--mdns-name NAME |
— |
mDNS instance name (default: opensovd) |
--mdns-host IP |
SOVD_MDNS_HOST |
IP to advertise (required when host cannot be inferred from the bind address) |
--mdns-identification ID |
SOVD_MDNS_ID |
VIN / device ID for the TXT record (defaults to --mdns-name) |
Example:
opensovd-gateway --mdns --mdns-host 192.168.1.10
Example
An mdns example under examples/server/mdns/ demonstrates how two instances on the same LAN register themselves and discover each other:
cargo run -p opensovd-examples-server --example mdns --features mdns -- \
--addr 192.168.1.10:7690 --name server-a
cargo run -p opensovd-examples-server --example mdns --features mdns -- \
--addr 192.168.1.10:7691 --name server-b
Note: mDNS requires a routable LAN IP — 127.0.0.1 will not work.
Discovery can be verified independently with:
avahi-browse _sovd._tcp --resolve --terminate
Acceptance Criteria
Motivation:
SOVD deployments in automotive and embedded environments often operate on local networks without centralized service registries. mDNS-SD (DNS-Based Service Discovery over multicast DNS) allows SOVD servers to advertise themselves and discover peers on the local network with zero configuration, making it ideal for workshop tools, prototype setups, and multi-ECU environments.
Proposed Design
A new
mdnsfeature flag (opt-in) inopensovd-providersexposes anMdnsDiscoveryProviderthat implements the existingDiscoveryProvidertrait. A thinMdnsWrapperowns the underlying mDNS daemon and is shared viaArcbetween the advertiser and the discovery provider so only one daemon per process is needed.Service type:
_sovd._tcp.local.TXT records per service:
identificationaccessurlhttp://192.168.1.10:7690/sovdAPI
A server registers itself and wires up discovery through
ServerBuilder:CLI / Gateway Integration
The
opensovd-gatewaybinary gains a--mdnsflag group (feature-gated):--mdns--mdns-name NAMEopensovd)--mdns-host IPSOVD_MDNS_HOST--mdns-identification IDSOVD_MDNS_ID--mdns-name)Example:
Example
An
mdnsexample underexamples/server/mdns/demonstrates how two instances on the same LAN register themselves and discover each other:cargo run -p opensovd-examples-server --example mdns --features mdns -- \ --addr 192.168.1.10:7690 --name server-a cargo run -p opensovd-examples-server --example mdns --features mdns -- \ --addr 192.168.1.10:7691 --name server-bDiscovery can be verified independently with:
Acceptance Criteria
opensovd-providersexposesMdnsWrapperandMdnsDiscoveryProviderbehind amdnsfeature flagMdnsDiscoveryProvidercorrectly implements theDiscoveryProvidertrait and streams discovered SOVD peersidentificationandaccessurlfieldsopensovd-gatewaysupports--mdns,--mdns-name,--mdns-host,--mdns-identificationflags (feature-gated)examples/server/mdns/demonstrates registration and peer discovery on a real LAN interfaceMdnsWrapperdaemon is shared between advertiser and discovery provider per process