Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
The ISO/IEC 29341-26-1 standard defines the WANDevice:1 template, which serves as the root device for Universal Plug and Play (UPnP) wide-area network (WAN) connectivity in residential and small-office gateways. This template is the foundation of the Internet Gateway Device (IGD) specification, providing a standardized way for UPnP control points to discover and interact with the WAN-facing capabilities of a broadband router or modem.
As a root device, WANDevice encapsulates all WAN-related services and acts as a container for sub-devices such as WANConnectionDevice. The template defines a uniform device description document (in XML) that advertises the device type, friendly name, manufacturer details, model information, and the list of embedded services. The standardised device type URN for this template is urn:schemas-upnp-org:device:WANDevice:1.
The WANDevice:1 template defines a service hierarchy that models the physical and logical layers of a broadband WAN connection. At the top level, the WANDevice contains a required WANCommonInterfaceConfig service, which exposes state variables for the physical-layer interface status, link speed, and error counters. Below this, the device may host one or more WANConnectionDevice sub-devices, each representing a distinct WAN connection context (e.g., an IPv4 PPPoE session and a separate IPv6 tunnel).
| Service | Service ID | Required | Description |
|---|---|---|---|
| WANCommonInterfaceConfig | urn:upnp-org:serviceId:WANCommonIFC1 | Yes | Physical interface status, bit rates, and link properties |
| WANConnectionDevice (sub) | urn:upnp-org:device:WANConnectionDevice:1 | Recommended | Logical connection management (PPP, IP, Bridging) |
| WANEthernetLinkConfig | urn:upnp-org:serviceId:WANEthLinkC1 | Optional | Ethernet-specific link configuration parameters |
The service layer of the WANDevice uses state variables to report real-time connection metrics. For instance, PhysicalLinkStatus is a string variable that can take values “Up”, “Down”, or “Initializing”, allowing control points to monitor link health. The TotalBytesSent and TotalBytesReceived counters provide cumulative traffic statistics, which are especially useful for bandwidth monitoring applications.
Implementing the WANDevice:1 template requires careful attention to several design patterns. First, the Observer pattern is implicit in the UPnP eventing architecture: control points subscribe to service state variables via the GENA (General Event Notification Architecture) protocol, and the device must push notifications when variables change. For the WANDevice, the PhysicalLinkStatus variable should generate events on state transitions to allow control points (such as a router’s web UI) to update status displays in real time.
Second, the Composite pattern is evident in the WANDevice/WANConnectionDevice relationship. The root WANDevice acts as a composite container, while each WANConnectionDevice is a leaf that implements specific connection protocols. This hierarchy maps naturally to object-oriented implementations where the root device maintains a list of connection device instances.
GetStatusInfo action on WANCommonInterfaceConfig. Some implementations return stale connection status because they poll the physical interface driver at too low a frequency. The standard recommends a polling interval no longer than 30 seconds, but many production gateways poll every 60-120 seconds to reduce CPU overhead. This tradeoff between responsiveness and resource utilisation must be carefully balanced.From a security standpoint, the WANDevice:1 template exposes several state variables that can reveal information about the WAN interface. While UPnP control is generally limited to the internal LAN, the device description XML itself should not leak sensitive data such as the external IP address or DNS server information. Production implementations should filter the ExternalIPAddress variable when queried from non-LAN interfaces.
libupnp or pupnp open-source libraries. These libraries provide complete SOAP control point and device stacks, allowing engineers to focus on device-specific logic rather than low-level HTTPMU and HTTPU handling.