Waking a Sleeping Machine
Wake on LAN lets you power on a computer that is off or asleep by sending it a special network packet. The network card stays partly powered, listening for that signal even while the rest of the machine is down.
The Magic Packet
The trigger is called a magic packet. It contains a fixed prefix of six bytes followed by the target's MAC address repeated sixteen times. The listening network card recognizes its own address in that pattern and tells the motherboard to power up.
- It is usually broadcast on the local network so it reaches the sleeping host.
- It carries no real payload, only the recognizable pattern.
- It works at layer 2, so routing it across networks needs extra configuration.
Key idea
Wake on LAN powers on a sleeping host using a magic packet that repeats the target MAC address, which the always listening network card recognizes to boot the machine.