Does your computer go to sleep on it’s own sometimes?

sleep

Computers can be great things, and both manufacturers and Microsoft have created ways to save power by putting our computers to sleep. However, if you put your computer into High Performance mode, it shouldn’t go to sleep unless you press the Sleep button on your keyboard.

Your network

When you connect your computer to the Internet, it sends out a unique code (known as a MAC address) that is set by the manufacturer. The router then assigns an IP address to the computer and (hopefully) off it works on the Internet.

ACPI

Back in 1996, the Advanced Configuration and Power Interface (ACPI) was created. It defined 7 power states:

  • G0 (also called S0) your computer is switched on and working.
  • G1 sleep states S0ix-S4, S3 for example is called sleep or suspend to RAM and S4 is hibernation, also called suspend to disk. A system in S4 will suspend to disk then go to G2.
  • G2 (also called S5) soft off, the power supply is in a low power state only providing power to the motherboard for the user to turn the computer on with the button.
  • G3 – mechanical off. This is the action of unplugging a computer. A tiny battery inside keeps the clock going and preserves the settings.

 

Wake on LAN and Wake on Wireless LAN

Let’s say you have a wireless printer. It goes to S3 sleep and turns off most of it’s features including the screen to save power.

The computer needs to print, so it sends a special magic packet to the printer’s MAC address, and the router sends the packet over the wireless network and this is seen by the printer, and it wakes from sleep and prints the document and after a pre-arranged time, goes back to S3 sleep.

Consider an office full of computers, each one could be woken up from sleep by certain network activity at a set time. Workers turn up at work to find their computers switched on and waiting for them to work.

Sleep on LAN and Sleep on Wireless LAN

Like it’s cousins, Wake on LAN and Wake on Wireless LAN, Sleep on LAN and Sleep on Wireless LAN watch for the same magic packet, except they react when the MAC address is reversed.

A suite of office computers that at the end of the day, automatically go to sleep saving the company money.

The problem and the solution

Sometimes, manufacturers get lazy and set the MAC address to all zeroes and the vendor is supposed to set that in software. When a device receives a Wake on LAN or Wake on Wireless LAN, the MAC address is the same both ways round and may trigger a Sleep on LAN or Sleep on Wireless LAN, and the computer goes to sleep.

Other times, the Sleep on LAN code is poorly implemented, so if the network adapter receives a Wake on LAN it just assumes its a sleep command and tells the computer to go to sleep.

The solution is in the operating system. Disabling the power management option that causes the network card to tell the operating system to sleep cures the problem.

Share this post with your friends