UPnP Registry Settings
A version of this page is also available for
4/8/2010
registry is used to track the UPnP device-hosting services. The registry keys are set automatically if the UPNPSVC and UPNPHOST modules are included in the OS design.
UPnP also supports using the registry to register UPnP devices. For more information, see UPnP Registry Device Creation.
The HKEY_LOCAL_MACHINE\Services\UPNPSVC registry key loads the UPnP service as a built-in stream driver. The following table shows the named values.
Value : type | Description |
---|---|
Prefix : REG_SZ |
Default setting is to "UPP". |
Dll : REG_SZ |
Default setting is "upnpsvc.dll". |
Index : REG_DWORD |
Default setting is 1. |
Order : REG_DWORD |
Default setting is 5. |
Context : REG_DWORD |
Default setting is 0. |
The HKEY_LOCAL_MACHINE\COMM\HTTPD\VROOTS\/upnp registry key sets the virtual root directory for UPnP. All UPnP files and resources published on the network must be located in this directory or in its subdirectories. The following table shows the named values.
Value : type | Description |
---|---|
@ : REG_SZ |
Default setting is "\\windows\\upnp\\". |
a : REG_SZ |
Default setting is 0. |
The HKEY_LOCAL_MACHINE\COMM\HTTPD\VROOTS\/upnpisapi registry key sets the virtual root directory for UPnP ISAPIs.
Value : type | Description |
---|---|
@ : REG_SZ |
Default setting is "\\windows\\upnpsvc.dll". |
a : REG_SZ |
Default setting is 0. |
The HKEY_CLASSES_ROOT\CLSID\{204810b9-73b2-11d4-bf42-00b0d0118b56} registers the COM coclass for the UPnPRegistrar interface. The following table shows the named values.
Value : type | Description |
---|---|
ProgID : REG_SZ |
Default setting is "UPnP.UPnPRegistrar.1". |
VersionIndependentProgID : REG_SZ |
Default setting is "UPnP.UPnPRegistrar". |
The HKEY_CLASSES_ROOT\CLSID\{204810b9-73b2-11d4-bf42-00b0d0118b56}\InprocServer32 registers the COM coclass for the UPnPRegistrar interface. The following table shows the named values.
Value : type | Description |
---|---|
@ : REG_SZ |
Default setting is "\\Windows\\upnphost.dll". |
ThreadingModel : REG_SZ |
Default setting is "Free". |
The HKEY_CLASSES_ROOT\UPnP.UPnPRegistrar.1 registers COM the coclass for the UPnPRegistrar interface. The following table shows the named values.
Value : type | Description |
---|---|
@ : REG_SZ |
Default setting is "UPnP Registrar Class". |
The HKEY_CLASSES_ROOT\UPnP.UPnPRegistrar.1\CLSID registers the COM coclass for the UPnPRegistrar interface. The following table shows the named values.
Value : type | Description |
---|---|
@ : REG_SZ |
Default setting is "{204810b9-73b2-11d4-bf42-00b0d0118b56}". |
The HKEY_LOCAL_MACHINE\COMM\UPnP\Exclude registry key allows you to enable or disable UPnP on one or more public interfaces (network adapters), where <Interfaces> is the name of the public interface of your gateway.
Note
The network adapter names can be obtained through the GetAdaptersAddresses functions in IP Helper.
Registry key | Settings |
---|---|
Interfaces : MULTI_SZ |
Default is not set in the registry. If the value is not present in the registry, all interfaces enable UPnP. Specifies the names of the network interfaces that should not use UPnP. The following example shows how to exclude specific network adapters.
|
ExcludeAllExceptListed : REG_DWORD |
If this value is present in the registry and set to a non-zero value, then UPnP is disabled on all network interfaces, including the loopback adapters, except those interfaces specified in Interfaces. By default in the SDK, the UPnP service is not listening on any network interfaces in order to make the device as secure as possible. The following example shows how to exclude all network adapters except those specified.
|
The HKEY_LOCAL_MACHINE\COMM\UPnP registry key defines the behavior of the UPnP. The following table shows the named values.
Value : type | Description |
---|---|
DiscoveryTimeToLive : REG_DWORD |
Default setting is 1 in the registry. If the value is not present in the registry, the value defaults to 4. Specifies the maximum number of hops before the multicast message is discarded.
Security Note:
The higher the number of hops, network segments, the farther away the broadcast goes, which increases the surface of exposure to other networks. The lower the number of hops decreases the possibility of exposure to irrelevant networks.
|
DownloadScope : REG_DWORD |
Default not set in the registry. If the value is not present in the registry, UPnP accepts only a URL from the same subnet and private addresses. The following values are valid:
Allows UPnP to verify URLs received from the network before making a request. These restrictions apply to all URLs in UPnP, such as device description, service description, device control, device event subscription, and control point event callback. This setting applies to IPv4 only. |
IPVersionSetting : REG_DWORD |
Default not set in the registry. If the value is not present in the registry, UPnP uses both IPv4 and IPv6 if they are present in the OS design. The following values are valid:
Specifies the IP version to use. This setting applies to devices and control points. The device and control point can interact only if they support at least one common version. |
IPv6SiteScope : REG_DWORD |
Default not set in the registry. If the value is not present in the registry, UPnP supports link-local addresses. The only valid value is 5 and all other values are invalid:
Specifies what addresses UPnP uses for IPv6. UPnP always uses link-local addresses, which allow interaction for devices and control points that are on the same link. UPnP supports link-local scope by default. This registry value is valid only if IPv6 is used as indicated by IPVersionSetting setting to 2 or 3. This setting applies to devices and control points. The device and control point that are on the same site but not on the same link can interact only if IPv6SiteScope is set to 5 for both. |
MaxActionResponse |
Default is 49152 (48 KB). Specifies the maximum size, in bytes, of action or query variable response to download. |
MaxControlPointDelay : REG_DWORD |
Default not set in the registry. If the value is not present in the registry, the value defaults to 3000. Specifies the maximum delay, in milliseconds, before a control point makes a request to a newly discovered device. The control point uses a random delay from 0 to this value before responding to a device advertisement.
Security Note:
To prevent a storm of requests that consumes device resources and causes a denial of service, MaxControlPointDelay spaces out responses over time.
|
MaxDocumentSize |
Default is 204800 (200 KB). Specifies the maximum size, in bytes, of UPnP device or service description document to download. |
MaxSubscribers : REG_DWORD |
Default not set in the registry. If the value is not present in the registry, the value defaults to 30. Sets the subscriber limit per device host and not per UPnP device. All UPnP devices on a given machine share a specified limit of subscribers.
Security Note:
By defining the number of subscribers, you can prevent a denial of service when the device is swamped with too many requests for services. It allows you to control the resources that the device uses as well as the efficiency to respond to requests. UPnP rejects subscriptions when it reaches the maximum number of subscribers and sends an error message–HTTP_STATUS_SERVICE_UNAVAIL (503).
|
NotificationQueueSize : REG_DWORD |
Default setting is 128 (0x80). If the value is not present in the registry, the default value is 0x80. Notifications sent to a control point are stored in a message queue and the control point application removes them from the queue for processing. The size of the queue varies depending on the amount of time the application needs to process a notification, the size of the notification, and the characteristics of the UPnP device. |
Port : REG_DWORD |
Default setting is 5120 (0x1400). Sets TCP port used by UPnP for control and eventing. > [!NOTE] > If you change the default port, you must also change the HKEY_LOCAL_MACHINE\Services\HTTPD\Accept key for the Web server to listen on the new UPnP port. For more information, see Web Server Registry Settings. |
SubDefaultTimeout : REG_DWORD |
Default setting is 1800. Specifies the default value for subscription timeout, in seconds. UPnP uses this value as the actual subscription timeout when the request does not specify a timeout value. |
SubMaxTimeout : REG_DWORD |
Default setting is 3600. Specifies the maximum timeout values, in seconds. UPnP uses this value as an upper bound to determine the actual subscription timeout when it accepts a request. |
SubMinTimeout : REG_DWORD |
Default setting is 1800. Specifies the minimum subscription timeout values, in seconds. UPnP uses this value as a lower bound to determine the actual subscription timeout when it accepts a request. |