Wake-on-WAN
Benjamin Benz, Johannes Endres
Switching on computers over the Internet via Wake-on-LAN
A computer that has to be reachable at all times does not necessarily have to be on all the time. Rather, if it is put into the energy-saving sleep mode, it can be brought back to life with a Wake-on-LAN packet anytime, even across the internet.
Getting a file from your computer at home should not be a problem, especially with a broadband flat rate – pity your PC is switched off, though. Fortunately, many modern PCs support Wake-on-LAN, allowing them to be switched on remotely. In this process, at least one router has to be constantly running in your local network to take the wake-up call and pass it on to the slumbering PC. It does not matter whether the router is a hardware DSL router or a Linux firewall.
Vegetative state
A network card and mainboard that support Wake-on-LAN are all you need to get started. Current PC mainboards provide standby voltage to PCI components even when they are switched off. This voltage suffices to allow networked chips constantly to monitor the LAN and wait for a magic packet, which contains the command to switch on the PC. All higher protocol layers, such as TCP/IP are neither available nor needed in sleep mode.
The wake-up call consists of a prefix and 16 repetitions of the sleeping computer's MAC address. It can therefore be sent in UDP packets.
AMD defines how magic packets have to look in its White Paper: they consist of a single Ethernet frame that contains a prefix of six bytes (always 0xff) followed 16 times by the hardware address (MAC) of the computer to be woken up. The LAN chip only reacts to this part of the packet, ignoring all address fields in the Ethernet packet.
Programs that transmit magic packets are available to download from the internet for all major operating systems. However, most of them assume that the computer that needs to be woken up is within the same LAN. Sending the magic packet across the internet is a bit trickier.
Some routers, such as a few home devices made by Buffalo and Draytek, can send a magic packet into the LAN via a click from the configuration site. The process works well, but it requires access to configuration via the internet – in other words, remote configuration has to be enabled. Generally, you would not want to do this because it leaves your router wide open to attackers who may have figured out the password or eavesdropped it. It's therefore safer to set the router so that it passes on a magic packet it receives from the Internet to the sleeping computer in the LAN.