by SuperBonBon | ![]() |
UPNPLib

What is UPNP > How did it start > What did we do > Where to go next
What is UPNP
UPNP is a protocol based on SSDP to discover UPNP compliant devices on a network. Specific search can be made to only look for a specific type of device or for all devices available. Once a device is found on the network, the client can retreive the device description ( devices state variables and available operations ) and start to interact with it using XML messages. UPNP devices types capabilities are usually available here. UPNP is born in 1999 and seems to start to find a larger audience since most new Broadband ADSL router modems are UPNP compliant.
How did it start
Everything started when the JAFS project needed to have a mechanism to automatically open server ports on a NAT router so that it become accessible from the internet without needs to go hack the router configuration to manually open the required ports ( when admin is aware the ports needs to be open :o) ). SNMP could have been a technology used for such purpose but unfortunatly there are some pitfalls :
- SNMP is not always implemented on entry level routers.
- SNMP interface to open ports on a router is not standardized which leads to develop specific SNMP routine for each SNMP aware routers vendors.
- No good open source libraries for SNMP available :o)
UPNP was another option that has a big advantage : There is a defined interface in IGD devices (Internet Gateway Device) to do such job which means that all IGD UPNP devices could work with the same piece of code. Almost all new ADSL broadband routers contains the UPNP IGD technology, since we did not found any good Java UPNP libraries so we decided to create our own.
What did we do
We have implemented in UPNPLib all the required mechanics to :
- Discover available devices on the network
- Interact with found devices
- Receive events when an UPNP device state variable changes or when a device joins or leaves the network
The library is currently compatible with all 1.4.x and higher JRE.
Where to go next
The documentation contains some usefull informations to discover, interact and receive events from UPNP devices. Another good document to read to understand the mechanics behind UPNP can be found here. Another interesting link concerning the different technologies used with UPNP is available here.
Finally you can start to look at the API examples to start to play with the library.