Share via


Power Management for Network Devices in Windows 7

Applies To: Windows 7

What is Networking Power Management?

Networking power management refers to the set of features that you can configure to allow the computers in your network to save energy. For example, the most common networking power management feature is Wake on LAN (sometimes referred to as WoL). Wake on LAN allows the computer to be woken up from sleep by desired network traffic. This paper describes the networking power management capabilities of Windows 7, how to use them, and what controls you can use to customize their behavior.

What’s new in the Networking Power Management?

Enhancements in Windows 7 have been made in the areas of Wake on LAN, Wake on Wireless LAN and Low Power on Media Disconnect (sometimes referred to as D3 on disconnect).

  • Wake on LAN and Wake on Wireless LAN . The Wake on LAN patterns in Windows 7 were designed to ensure that the computer wakes when accessed by the network while minimizing spurious wakes. Windows 7 does not wake on directed packets (for example, ping) which have been known to cause frequent and unnecessary wakes.

    In addition to more targeted wake patterns, Windows 7 adds support for Address Resolution Protocol (ARP) and Neighbor Solicitation (NS) offloads. ARP and NS protocols map Internet Protocol (IP) addresses to a MAC address. ARP and NS protocols are commonly used to verify whether a computer is still present on the network, often without actually needing to access the computer. By offloading ARP and NS responses to the network adapter, the computer is no longer woken up merely to maintain network presence. Support for these offloads depends on the network adapter and driver (NDIS 6.20) and may not be available on older hardware.

  • Low Power on Media Disconnect . This is a new Windows 7 feature that enables the computer to save energy by placing the network adapter in the low power state when the LAN cable is unplugged and the computer is running. This feature is only available when supported by the network adapter.

These enhancements in Windows 7 improve the ability of the operating system to stay asleep while still maintaining a network presence. This helps enterprise and home computers to save energy by entering into sleep mode when they are not in use.

Who should use this guide?

Users, IT Professionals, and OEMs that are interested in understanding and configuring the networking power management enhancements in Windows 7.

In this guide

  • Overview of Features

  • Prerequisites

  • Configuring power management using the user interface

  • Configuring Wake on LAN using the command line

  • Configuring power management using keywords

  • Configuring power management using the WMI API

  • Summary

Overview of Features

This section outlines the technical details of the power .management features in Windows 7.

  • Wake Patterns . Wake patterns refer to network packet filters that determine if incoming network traffic should wake the computer. You can enable these patterns on the network adapter. The following wake patterns may be supported by a network adapter:

    • Wake on new incoming TCP connection for IPv4 and IPv6 (TCP SYN IPv4 and TCP SYN IPv6).

    • 802.1x re-authentication packets

  • Bitmapped Patterns . Most network adapters can be programmed with bitmapped pattern filters. Bitmapped patterns are defined by a bitmap mask and a pattern filter. As network packets are received, they are masked using the bitmap mask and then compared to the pattern filter. If there is a match, the network adapter wakes the computer.

  • Magic packet . The magic packet is always supported and does not need or use a pattern. Magic packet is used by some applications including most media sharing applications.

    The patterns that are chosen by default are based on the network adapter’s capabilities and whether the computer is joined to a domain as follows:

Capabilities supported by the network adapter Default for a computer that is joined to a domain Default for a computer that is not joined to a domain

ARP & ND offload

Magic Packet

NETBIOS name query

TCP SYN v4

TCP SYN v6

Magic Packet

NETBIOS name query

TCP SYN v4

TCP SYN v6

ARP offload only

Magic Packet

NETBIOS name query

TCP SYN v4

TCP SYN v6

Magic Packet

NETBIOS name query

TCP SYN v4

TCP SYN v6

NS

No offload

Magic packet

Magic Packet

  • Network Presence . Windows 7 adds support for ARP and NS network presence offloads.

    • ARP offload . ARP offload is the ability of the network adapter to respond to an IPv4 ARP request without waking the computer. Both the hardware and the driver must support ARP offload to enable this feature.

    • NS offload . NS offload is the ability of the network adapter to respond to a Neighbor Discovery Neighbor Solicitation request with a Neighbor Advertisement without waking the computer. Both the hardware and the driver must support NS offload to enable this feature.

  • Low Power on Media Disconnect . Lower Power on Media Disconnect is the ability of the network adapter to go to sleep when it is not in use. When Windows detects that media has been disconnected (for example, a cable is unplugged), Windows will put the device into the low power state and disable the LAN. The computer will automatically detect when the cable is plugged in again and return the network adapter to full power. Low Power on Media Disconnect is disabled when the computer goes to sleep.

  • Wake On Wireless LAN . The Wake on Wireless LAN implementation in Windows 7 represents a superset of Wake on LAN. In addition to the features defined for a wired LAN, devices that support Wake on Wireless LAN must be able to maintain a connection to the access point while the computer is in sleep mode. In addition to receiving packets from the wireless access point and filtering them, the wireless network adapter must be able to handle security key updates. GroupWise Transient Key updates are handled by the wireless network adapter while the computer is in sleep state. For Pairwise Transient Key updates or user authentication, the network adapter must wake the computer and allow Windows to handle the request.

    As with wired WoL, while the computer is in the sleep state, the network adapter will apply the packet filters and respond using power management offloads (if applicable). If the connection is lost, the network adapter may re-establish the connection to the same access point. To roam or connect to another access point, the network adapter must wake the computer.

Power management settings are controlled by standard registry keywords. You can modify the standard keywords using the device properties user interface, the netsh command, or Windows Management Instrumentation (WMI). Networking power management is controlled on a per network adapter basis.

Prerequisites

Update hardware and drivers to NDIS 6.20 . Wake on LAN, Wake on Wireless LAN, power management offloads and Low Power on Media Disconnect must be supported by both the network adapter and the driver. Wake on LAN pattern enhancements will function with both Windows 7 and previous driver versions. For previous driver versions, Windows 7 will translate Wake on LAN patterns to match the older power management capabilities of the driver. Support for power management offloads must be enabled by both the hardware and a Windows 7 version of the driver (NDIS 6.20).

Configuring power management using the user interface

To turn power management features on or off

  1. Open Network and Sharing Center (click the Start button, type Network and Sharing in the Start Search box, and press Enter).

  2. Click the Change adapter settings link in the upper left of the navigation pane.

  3. Right click the network connection you want to enable/disable power management support on and click Properties .

  4. Click Configure .

  5. On the Power Management tab, check or clear the Allow the computer to turn off this device to save power check box.

    • When checked, power management is enabled on the network adapter.

    • When cleared, power management is disabled on the network adapter.

  6. You can enable Wake on LAN for all wake methods or just enable magic packet WoL:

    • To enable Wake on LAN for all methods, check the Allow this device to wake the computer check box.

    • To enable Wake on LAN for magic packet only, check the Allow this device to wake the computer check box and then check Only allow a magic packet to wake the computer check box.

Note

For devices that do not support ARP and NS offloads, Windows will default to wake only on magic packet.

  1. Click OK .

Configuring Wake on LAN settings using the command line

You can use the netsh command to force the operating system to wake on ARPs, and NS on a per network adapter basis—but only for computers that are joined to a domain.

To force a network adapter to wake on ARP and NS

  1. Open a command prompt with administrator privileges. (click the Start button, type Command Prompt in the Start Search box, right click Command Prompt , and click Run as Administrator .)

  2. Type netsh interface ipv4 show interfaces . This will list all of the available network interfaces; note the index (labeled Idx ) of the network adapter you want to modify.

Note

You can replace ipv4 with ipv6 for Internet Protocol version 6.

  1. To force the network adapter to wake on ARP and NS type netsh interface ipv4 set interface [index] forcearpndwolpattern=enabled . If successful, OK will be returned.

  2. To revert to system default type netsh interface ipv4 set interface [index] forcearpndwolpattern=disabled . If successful, OK will be returned.

Configuring power management using keywords

You can use keywords to configure which power management features are enabled or disabled. Keyword settings may be modified using either WMI scripts or the advanced properties page of the device properties. Keyword settings influence which patters are programmed on the network adapter. The keywords that a network adapter must support along with their default settings are shown in the following table.

SubkeyName Explanation Default Setting

*WakeOnPattern

Defines if a network adapter is enabled to wake the computer on pattern matches.

0 - Disabled

1 (Default) - Enabled

*WakeOnMagicPacket

Defines if a network adapter is enabled to wake a computer on the magic packet.

0 - Disabled

1 (Default) - Enabled

*DeviceSleepOnDisconnect

Defines if a network adapter is allowed to go to low power when media is disconnected and wake when media is connected again.

0 - Disabled

1 (Default) - Enabled

*PMARPOffload

Defines if a network adapter is enabled to offload ARP when the computer goes to sleep state.

0- Disabled

1 (Default) - Enabled

*PMNSOffload

Defines if a network adapter is enabled to offload NS when the computer goes to sleep state.

0 - Disabled

1 (Default) - Enabled

*PMWiFiRekeyOffload

Defines if a network adapter is enabled to offload GTK rekeying for WoWLAN when the computer goes to sleep state.

0- Disabled

1 (Default) - Enabled

Configuring Power Management using the WMI API

WMI is a programmatic means by which an application or administrator can control power management settings. Example scenarios for controlling power management capabilities using WMI scripting include:

  • Applications may not allow a computer to sleep unless specific Wake on LAN capabilities are supported and enabled. For example, Media Center or Media Center extenders.

  • An OEM, shipping computers with multiple network adapter cards, can enable WoL for selected network adapters. Management utilities can display and allow you to modify the power management capabilities for a network adapter using WMI scripts. These utilities will be able to read hardware capabilities and allow custom configuration.

The following WMI methods allow you to query and control Wake on LAN:

  • GUID_NDIS_PM_ADMIN_CONFIG is used to query and set keyword switches.

  • GUID_NDIS_PM_CAPABILITIES is used to query both the hardware capabilities and the state of current capabilities.

GUID_NDIS_PM_ADMIN_CONFIG

The GUID_NDIS_PM_ADMIN_CONFIG method is called to query or to set keyword values and parameters. Each keyword may be one is the following three values:

  • Unspecified . In a query, it means the keyword does not exist. In a set, it means the user does not want to change the keyword’s current value.

  • Disabled . In a query, it means the keyword is currently disabled. In a set, it means to disable the keyword.

    Enabled . In a query, it means the keyword is currently disabled. In a set, it means to enable the keyword.

    The keywords used in GUID_NDIS_PM_ADMIN_CONFIG are composed in the following struct:

    struct _NDIS_WMI_PM_ADMIN_CONFIG
    { NDIS_PM_ADMIN_CONFIG_STATE WakeOnPattern;
     NDIS_PM_ADMIN_CONFIG_STATE WakeOnMagicPacket;
     NDIS_PM_ADMIN_CONFIG_STATE DeviceSleepOnDisconnect;
     NDIS_PM_ADMIN_CONFIG_STATE PMARPOffload;
     NDIS_PM_ADMIN_CONFIG_STATE PMNSOffload;
     NDIS_PM_ADMIN_CONFIG_STATE PMWiFiRekeyOffload; 
    }
    

GUID_NDIS_PM_ACTIVE_CAPABILITIES

The GUID_NDIS_PM_ACTIVE_CAPABILITIES method will query and return the current capabilities. Each capability will be reported in one of three enumerated values as follows:

  • Unsupported . Means the hardware does not support this capability.

  • Inactive . Means the hardware supports the capability, but a keyword or other logic has this capability disabled.

  • Active . Means the hardware supports the capability and it is actively enabled.

The capabilities returned in GUID_NDIS_PM_ACTIVE_CAPABILITIES are composed in the following struct:

struct _NDIS_WMI_PM_ACTIVE_CAPABILITIES
{ NDIS_PM_CAPABILITY_STATE WakeOnPattern;
 NDIS_PM_CAPABILITY_STATE WakeOnMagicPacket;
 NDIS_PM_CAPABILITY_STATE DeviceSleepOnDisconnect;
 NDIS_PM_CAPABILITY_STATE PMARPOffload;
 NDIS_PM_CAPABILITY_STATE PMNSOffload;
 NDIS_PM_CAPABILITY_STATE PMWiFiRekeyOffload; 
}

Summary

The enhancements made to Windows 7 for managing power settings for network adapters greatly reduces the number of spurious wakes, allowing computers to sleep for longer periods of time when idle. Furthermore, you can configure the power management settings to meet the needs of your users through device properties, standard registry keywords, or WMI. The result is energy savings and a more environment friendly computer.