Windows Media Connect can’t find my Digital Media Receiver

Well so far you brought your Digital Media Receiver (DMR) home, hooked it up, and checked basic network connectivity.  Then you went to the PC and installed Windows Media Connect (WMC) and got folder sharing started.  Unfortunately, that is as far as you’ve gotten. You’re sitting at your computer with the WMC configuration user interface (UI) and your DMR isn’t visible.  This is a problem.  Your DMR won’t be allowed to access any of the content on your PC until it is authorized in WMC.  However, WMC can’t authorize what it can’t see. You are not going to get any further until you authorize your DMR.

Let’s spend some time exploring how discovery works.  WMC is a UPnP Content Directory Service.  So, that means it conforms to the UPnP specification, which is free for the download at https://www.upnp.org.  In the documents section of the UPnP website is a document call UPnP Device Architecture.  Section One of this document explains in great technical detail how discovery works.  The entire discovery process is called the Simple Service Discovery Protocol or just SDDP. Here’s the summary, straight from the specification:

When a new device is added to the network, it multicasts a number of discovery messages advertising its embedded devices and services. Any interested control point can listen to the standard multicast address for notifications that new capabilities are available.

Similarly, when a new control point is added to the network, it multicasts a discovery message searching for interesting devices, services, or both. All devices must listen to the standard multicast address for these messages and must respond if any of their embedded devices or services match the search criteria in the discovery message.

To reiterate, a control point may learn of a device of interest because that device sent discovery messages advertising itself or because the device responded to a discovery message searching for devices. In either case, if a control point is interested in a device and wants to learn more about it, the control point must use the information in the discovery message to send a description query message. The section on Description explains description messages in detail.

What that means is that when a UPnP devices is present on the network every few minutes it will send out an advertisement to a multi-cast address.  Any interested party can listen for the advertisements.  Additionally, if you don’t want to wait for the advertisements, you can send out a multicast search message and then every matching device will respond with an advertisement.  The multicast address used is 239.255.255.250:1900. And now we get the magic port number: 1900.  The whole list of ports that WMC uses can be found here (https://www.microsoft.com/windows/windowsmedia/devices/wmconnect/faq.aspx#4_4), but it is specifically port 1900 that is used for discovery.

The SSDP advertisement isn’t the only step that is required for you to see your DMR in WMC.  WMC uses the UPnP API’s that are part of the Windows operating system.  It is actually the SSDP service that takes care of listening to these announcements and keeping track of the UPnP devices on the network.  One of the required pieces of data in the SSDP advertisement is the URL of the device document.  Before the SSDP service will tell WMC about the device, the SSDP service retrieves the device document.  If it can’t get the device document, it doesn’t notify WMC about the service.

Notice that I didn’t indicate what port this happens on.  I did that for two reasons. The first reason is that I don’t know what port. The device document could be on ANY port that the device chooses.  The second reason is that it doesn’t matter.  You don’t need to open this port in your firewall anyway.  Firewalls typically work by blocking incoming traffic, not outgoing traffic.  For example, that means that you need to open port 1900 in your firewall so that the SSDP announcement from your Xbox can get to the PC, but you don’t need to open any ports for the SSDP announcement from your PC to get to your Xbox.  Also, you don’t need to open any ports in your firewall for your PC to be able to retrieve the device document from your Xbox, since that is an outgoing request from the PC.

DMRs also discover PC’s the exact same way.  They listen for the SSDP announcements that are made by WMC (via the SSDP service) and when they hear the announcement they retrieve WMCs device document.  Here, I can tell you what port it happens on. It is port 2869.  Again, you can find the whole list of ports used by WMC at the link above. This port (2869) is the port that UPnP uses for everything other than SSDP announcements.  All incoming UPnP requests come through this port, including the request for the device document.  Your DMR may be able to see WMC without opening this port, but you can’t get any further than that. There are still quite a few more ports listed in the FAQ’s, but for UPnP functionality you only need those two. The rest are used for streaming the content and for digital rights management.

I’ve got one final word about firewalls before I’m finished with this post.  The firewall I’ve talked about here in this article is the software firewall on your PC, not the firewall that is built into your router.  These ports must be open on the PC firewall for WMC to work.  Under no circumstances should you open ports on your router's firewall to get WMC to work.  The firewall on your router sits between the WAN port and the LAN ports.  It does not sit between two computers plugged into the LAN ports.  That means that the traffic between two devices on the LAN side shouldn’t be interfered with by the router.  If you do have to open router ports to get WMC to work, then in my opinion your router has a fatal security flaw and you should seriously reconsider if you want to trust the security of your network to that router.

Tomorrow I’ll move from theory to practice on tracking down discovery problems.