How to find the IP address of UPnP devices

Feb 15, 2012 at 6:28 AM


Could you please anyone tell me how can I get the IP address of UPnP devices. I could able to list all UPnP devices but how to get the IP address of these devices?

Without parsing the UPnP "SEARCH: or "NOTIFY" header , is it possible to get the IP address of all the UPnP devices in the network?

Thanks in advance.




Feb 15, 2012 at 11:40 AM
Edited Feb 15, 2012 at 11:41 AM

First of all, just to be clear, you want the IP address of the actual devices, not the IP address of the internet connection on a Gateway or Router device?

Also, be aware that each UPnP device does NOT necessarily translate to a physical device with its own IP address, I would question why you want this information and would consider that maybe you are going about this the wrong way, however, read on for how to get the IP address.

The only way is to send a broadcast M-SEARCH query, get the results and then you would need to resolve the IP address of the root description XML documents domain name. I guess you could also do it by looking at the source IP address of the data that comes back from the result of the M-SEARCH query. It should be noted that UPnP does NOT have a built in way of getting the IP addresses of devices, however because UPnP is built upon the IP protocol, there is no reason why you shouldnt be able to use the IP protocols data to determine the source IP address of the devices.

So your answer is NO, although devices can auto broadcast themselves every now and then, this is not necessarily a requirement of all device types, and therefore the only way to get a response from devices is to try to connect to them or do an M-SEARCH broadcast query, like I stated above, however, I would question the usefulness of getting the IP address, as you cant do anything [useful] with it?