Okay, that makes sense, thanks.
Notes added in bold below following further information from sa2000
I’m tagging @sa2000 into this thread as I think what comes below may be relevant to the other work I’ve been doing with him.
Firstly, SSDP doesn’t broadcast, it uses a site-local multicast group, one specifically reserved for UPnP/SSDP: 239.255.255.250
I’d add a little more logic at step 1 or 3:
- the M-SEARCH packets PMS is sending out every 10 seconds (it’s definitely PMS, btw, more on that below) are asking for “ST: upnp:rootdevice”, which should cause all UPnP capable devices on the LAN to respond, not the specific kind it could be looking for. Asking only for the devices it’s interested in would be more efficient and potentially lower the risk of receiving malformed responses that cause undesirable behaviour
- If we’re not going to be selective at step 1, we have to accept all replies
- If we’re accepting all replies, let’s be selective at this point instead and only query the schema for devices we’re interested in, rather than everything that responds (so, for example, let’s query a TV but not a Hue Bridge, if that’s what PMS is searching for)
FYI, what comes below was all carried out with UPnP disabled on my router:
This brings me on to my other point, I still don’t know what PMS is doing with SSDP and what it’s looking for, I feel like I’m trying to reverse engineer it, here. Is it purely for finding an IGD (if you set it to automatically port-forward with UPnP for remote access) or is it doing other stuff like looking for TVs and speakers? FWIW, I’ve set my PMS to “Manually specify public port” and have “Enable local network discovery (GDM)” unticked but PMS still sends out M-SEARCH packets and gets responses. This occurs every 10 seconds, which seems little excessive to me.
This is expected behaviour as PMS uses GDM and SSDP seperately
The option for “GDM” is in the PMS Network settings page, and this appears to be a proprietary protocol that Plex has developed to search for “other servers and players”. There’s no documentation available for this although this provides some information. This may not be 100% factual: although it states that GDM multicasts on 239.255.255.255 I can’t see any traffic on this group with GDM enabled but there’s plenty on 239.255.255.250.
GDM doesn’t multicast at all but broadcasts every 5 seconds on whatever your LAN broadcast address is (192.168.1.255 in my case), confirmed with Wireshark.
GDM seems to be a modified version of SSDP, for all intents and purposes. Why SSDP wasn’t good enough for Plex, I don’t know. Why is Plex doing SSDP and GDM? I don’t know. I have a sneaky suspicion that Plex isn’t exactly doing SSDP at all, and that the traffic I’m seeing in my Wireshark sessions is GDM identified as SSDP as it’s so similar.
Above paragraph is entirely incorrect following sa2000’s information
To test this I stopped PMS entirely on my server and did a tcpdump: the “M-SEARCH” SSDP packets stopped being sent out from the server and the “HTTP/1.1 200 OK” responses from devices on my LAN stopped coming back. There were still periodic NOTIFYs from other devices on the LAN, but overall SSDP traffic was much lower with PMS stopped entirely.
I think:
- a lot of the of the SSDP traffic we’re seeing in our packet dumps is actually Plex’s own “GDM” traffic nope, definitely not the case
- turning off “Enable local network discovery (GDM)” doesn’t stop it, as I still see M-SEARCH packets this is expected behaviour as it’s confirmed that PMS is doing SSDP and GDM separately, however, GDM does not stop sending out packets on 32412 and 32414 if GDM is disabled in the PMS web interface (confirmed with Wireshark)
- GDM is not only communicating with other Plex clients and servers, it’s eliciting responses from any UPnP enabled devices on the LAN as it’s using a standard multicast group address not the case, confirmed separate broadcast UDP traffic on ports 32414 and 32412
Is some GDM process in PMS getting upset when it tries to parse a response from miniupnpd with UPnP enabled? Remember, miniupnpd is still running, I’ve just turned off the UPnP functionality and it’s doing NAT-PMP only.
Nope, it’s not GDM, it’s SSDP
So, with GDM off and manual port forwarding specified, why is PMS still searching for UPnP devices and parsing their responses? Why, specifically, is it parsing a response from an IGD (miniupnpd) and getting into a loop over it?
See sa2000’s response below for more info on what PMS is doing over SSDP