Set TTL of SSDP discovery

My home setup consists of 2 VLANs (family + business). The HE is connected to family network, and I have 2 Samsung networked speakers on the business network. I have IGMP proxy configured between the subnets, so SSDP discovery should work.

I installed @djgutheinz's DTH, and realized that no speakers were found. Looking at packet captures uncovered the reason: M-SEARCH packets are sent with TTL=1, therefore IGMP proxy does not forward them.

I agree that Protocol.LAN should mean TTL=1 by default (even though "LAN" in my understanding much more refers to broadcast domain, but not necessarily to multicast domain), but for more complex networks it should be adjustable.

I tried to hack @djgutheinz's code, but I found no way to make SSDP discovery work across subnets.

Is there anything I missed?

Until Hubitat itself offers that option, you could look at using iptables' mangle table to increase the TTL of all or specific packets before they get routed. You would need to do this on the router itself, which is probably where you're already running the igmp proxy.

Also note that depending on your firewall rules, the responses to SSDP discoveries might be dropped, since they're not directly related to the outbound packet (src IP of response differs from dest IP of request). As far as I can tell, the hub uses ports 10024-27 for discovery, so adding an appropriate rule should help, but the ports could change at any time.

I tried it already, but unfortunately it's not working, probably because of hardware offloading in Cavium's SOC. :frowning:

So I'm afraid I have to wait for the implementation of this parameter... anyone from HE, @mike.maxwell maybe, could you please tell me if it's on the list?

Thanks,
guyeeba

An update on the case:

The UPnP Device Architecture 1.0 document 1.2.2 Discovery: Search: Request with M-SEARCH section explicitly states that

"The TTL for the IP packet should default to 4 and should be configurable."

And the UPnP Device Architecture 2.0 document 1.3.2 Search request with M-SEARCH section explicitly states that

"The TTL for the IP packet should default to 2 and should be configurable."

According to these documents, Hubitat's solution is not compliant to any of the standards... Anyone from HE...?

TIA

Thanks for the information. In the future, platform specific issues like this, you can tag me. In the next release, default TTL on the discovery messages will be set to 2 and also be configurable.

5 Likes

@chuck.schwer, you're the hero of the day!

But I think you should warn developers that in case of "remote" devices, the value of the mac field in ssdpHandler is null. I'm aware of at least 1 app that uses the mac address for ID for child devices, so changing the default behavior of SSDP discovery might cause app/driver malfunction in some specific cases...

1 Like