Implement TR-10-9 Section 15 DNS-SD browse strategy#484
Implement TR-10-9 Section 15 DNS-SD browse strategy#484lo-simon merged 4 commits intosony:masterfrom
Conversation
fb842e3 to
8a965c6
Compare
TR-10-9 Section 15 requires IPMX devices to:
- Support both mDNS and unicast DNS for DNS-SD browse operations
- Default to using both methods
- Provide user mechanisms to limit browsing to unicast or mDNS only
- When using both: try unicast DNS first, fall back to mDNS only
if unicast is unsuccessful (no service discovered)
- When multiple results are returned: select by best priority,
failing over to next-best if unresponsive
- Once a service is selected and responsive: perform no further
browse operations for that service type
- If the selected service becomes unresponsive: perform a new
DNS-SD browse and restart selection
Add dns_sd_browse_mode setting ("both"/"unicast"/"mdns") to implement
the required dual-discovery strategy. In "both" mode (default), unicast
DNS is tried first with half the timeout budget; if no records are
found, mDNS fallback gets the remaining half. "unicast" and "mdns"
modes restrict to a single method.
Also filters browse results by domain class to prevent mDNS results
leaking into unicast DNS queries and vice versa.
Signed-off-by: Semyon Barenboym <simonbaren@gmail.com>
8a965c6 to
cc1dab4
Compare
|
Thank you, @simonbaren, for your PR, we will look into it shortly. |
|
Hi @lo-simon, kindly reminder. |
|
Hi @simonbaren So sorry for the late reply. I am happy with your PR. There are a few points I would like to address and offer suggestions on.
|
- Use string_enum for dns_sd_browse_mode (nmos::dns_sd_browse_modes::{both,unicast,mdns})
- Add dns_sd_browse_mode example + behaviour table to nmos-cpp-node config.json
- Add expected-behaviour table to settings.h
- Mark unused URI-returning resolve_service overload as deprecated (comment)
- Refresh resolve_service / resolve_service_ doc comments in mdns.h/.cpp
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Hi @lo-simon, thanks for the review. Pushed a commit addressing items 1–4 and 6:
Let me know if anything needs adjusting. |
|
@lo-simon @simonbaren on 5. I agree with @lo-simon that I would expect the primary service timeout to remain unchanged, even when there is a fallback service. My expectation would therefore be that the timeout applied per service (i.e. don't halve it). |
Per maintainer review (jonathan-r-thorpe, lo-simon): the primary service timeout should remain unchanged when a fallback is in play, with the same timeout applied per service rather than halved across them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks @jonathan-r-thorpe. Done in the latest commit - primary and fallback now both use the full |
lo-simon
left a comment
There was a problem hiding this comment.
Use an enum rather than a string for the dns_sd_browse_mode to reduce the risk of typos.
| // "both" (default) = unicast DNS first, mDNS fallback if unsuccessful | ||
| // "unicast" = unicast DNS only | ||
| // "mdns" = mDNS only |
There was a problem hiding this comment.
| // "both" (default) = unicast DNS first, mDNS fallback if unsuccessful | |
| // "unicast" = unicast DNS only | |
| // "mdns" = mDNS only | |
| // both(0) (default) = unicast DNS first, mDNS fallback if unsuccessful | |
| // unicast(1) = unicast DNS only | |
| // mdns(2) = mDNS only |
| // unicast | local. | mdns | ||
| // mdns | example.com | mdns | ||
| // mdns | local. | mdns | ||
| //"dns_sd_browse_mode": "both", |
There was a problem hiding this comment.
| //"dns_sd_browse_mode": "both", | |
| //"dns_sd_browse_mode": 0, |
| #ifndef NMOS_DNS_SD_BROWSE_MODE_H | ||
| #define NMOS_DNS_SD_BROWSE_MODE_H | ||
|
|
||
| #include "nmos/string_enum.h" |
There was a problem hiding this comment.
| #include "nmos/string_enum.h" |
| DEFINE_STRING_ENUM(dns_sd_browse_mode) | ||
| namespace dns_sd_browse_modes | ||
| { | ||
| const dns_sd_browse_mode both{ U("both") }; // unicast DNS first, mDNS fallback if unsuccessful | ||
| const dns_sd_browse_mode unicast{ U("unicast") }; // unicast DNS only | ||
| const dns_sd_browse_mode mdns{ U("mdns") }; // mDNS only | ||
| } |
There was a problem hiding this comment.
| DEFINE_STRING_ENUM(dns_sd_browse_mode) | |
| namespace dns_sd_browse_modes | |
| { | |
| const dns_sd_browse_mode both{ U("both") }; // unicast DNS first, mDNS fallback if unsuccessful | |
| const dns_sd_browse_mode unicast{ U("unicast") }; // unicast DNS only | |
| const dns_sd_browse_mode mdns{ U("mdns") }; // mDNS only | |
| } | |
| enum dns_sd_browse_mode | |
| { | |
| both = 0, // unicast DNS first, mDNS fallback if unsuccessful | |
| unicast = 1, // unicast DNS only | |
| mdns = 2 // mDNS only | |
| }; |
| // - "both" (default): unicast DNS first, mDNS fallback if unsuccessful | ||
| // - "unicast" : unicast DNS only | ||
| // - "mdns" : mDNS only |
There was a problem hiding this comment.
| // - "both" (default): unicast DNS first, mDNS fallback if unsuccessful | |
| // - "unicast" : unicast DNS only | |
| // - "mdns" : mDNS only | |
| // - both (default): unicast DNS first, mDNS fallback if unsuccessful | |
| // - unicast : unicast DNS only | |
| // - mdns : mDNS only |
| // - "both" (default): unicast DNS first, mDNS fallback if unsuccessful | ||
| // - "unicast" : unicast DNS only | ||
| // - "mdns" : mDNS only |
There was a problem hiding this comment.
| // - "both" (default): unicast DNS first, mDNS fallback if unsuccessful | |
| // - "unicast" : unicast DNS only | |
| // - "mdns" : mDNS only | |
| // - both (default): unicast DNS first, mDNS fallback if unsuccessful | |
| // - unicast : unicast DNS only | |
| // - mdns : mDNS only |
| // "both" (default) = unicast DNS first, mDNS fallback if unsuccessful | ||
| // "unicast" = unicast DNS only | ||
| // "mdns" = mDNS only |
There was a problem hiding this comment.
| // "both" (default) = unicast DNS first, mDNS fallback if unsuccessful | |
| // "unicast" = unicast DNS only | |
| // "mdns" = mDNS only | |
| // both(0) (default) = unicast DNS first, mDNS fallback if unsuccessful | |
| // unicast(1) = unicast DNS only | |
| // mdns(2) = mDNS only |
| // unicast | local. | mdns | ||
| // mdns | example.com | mdns | ||
| // mdns | local. | mdns | ||
| const web::json::field_as_string_or dns_sd_browse_mode{ U("dns_sd_browse_mode"), U("both") }; |
There was a problem hiding this comment.
| const web::json::field_as_string_or dns_sd_browse_mode{ U("dns_sd_browse_mode"), U("both") }; | |
| const web::json::field_as_integer_or dns_sd_browse_mode{ U("dns_sd_browse_mode"), 0 }; |
There was a problem hiding this comment.
Use an enum rather than a string for the dns_sd_browse_mode to reduce the risk of typos.
Per lo-simon's review: use a typed enum (compile-checked) rather than a
string to reduce typo risk in user configurations.
- enum dns_sd_browse_mode { dns_sd_browse_mode_both = 0, _unicast = 1,
_mdns = 2 } defined file-local in mdns.cpp under nmos::experimental,
mirroring how href_mode lives in settings.cpp
- field becomes field_as_integer_or with default 0
- example config.json now shows //"dns_sd_browse_mode": 0,
- doc comments updated; dns_sd_browse_mode.h header removed
Used dns_sd_browse_mode_* prefix on the enumerators (rather than the bare
both/unicast/mdns suggested in the review) to avoid polluting nmos:: with
generic identifiers, matching the href_mode_* convention.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28d14db to
09df043
Compare
|
Hi @lo-simon, thanks for the detailed review. Switched to a typed integer enum.
All other inline suggestions applied verbatim:
|
Summary
Implements the DNS-SD browse strategy required by TR-10-9 Section 15 for IPMX device service discovery.
Changes
dns_sd_browse_modesetting ("both"/"unicast"/"mdns") to control DNS-SD browse method"both"(default): try unicast DNS first with half the timeout budget; fall back to mDNS if no services found"unicast": unicast DNS only"mdns": mDNS onlyresolve_serviceto delegate toresolve_service_with the dual-discovery logicMotivation
TR-10-9 Section 15 requires IPMX devices to support both mDNS and unicast DNS for DNS-SD browse operations, defaulting to using both methods. When using both, unicast DNS must be attempted first, with mDNS as a fallback only if unicast is unsuccessful.
Files changed
Development/nmos/settings.h— newdns_sd_browse_modefieldDevelopment/nmos/mdns.cpp— dual-browse logic and domain class filteringhttps://static.vsf.tv/download/technical_recommendations/VSF_TR-10-9_v2_2025-05-13.pdf