What is a "Magic Packet" for waking a computer?

152

19

My wireless adapter (Intel Dual Band Wireless-N 7260) has two settings in Device Manager which I cannot explain.

Wireless adapter properties

Wake on Magic Packet
Wake on Pattern Match

After a bit of research, I found this Microsoft Technet article which defines the feature as follows:

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

This rather cryptic description is a bit low on details. Can anyone help?

I would prefer that my laptop not be woken up remotely under any circumstances. I've disabled Allow this device to wake the computer on the Power Management tab, but these settings appear to be separate. My assumption is that I can set these two settings to Disabled without negative consequences. Is that right?

AlainD

Posted 2016-04-17T21:29:01.260

Reputation: 3 150

6Note that based on my experience, WoLAN/WoWLAN most likely require a firmware (BIOS/UEFI) option to be enabled in addition to the adaptor setting. For instance, my laptop's wireless adaptor has this option offered by Windows, but no corresponding option exists in the firmware, and I can't seem to use WoWLAN regardless of the adaptor setting. You should check in the firmware, too, and disable it if really unwanted (just to be sure!). – underscore_d – 2016-04-18T12:43:24.950

@underscore_d, good point. I've tried a few times to make this work, but I've never actually seen a computer turn on in response to a network packet. Now that I think about it, you'd also have to make sure the network card is powered when the computer was "off" which might be another setting somewhere. – JPhi1618 – 2016-04-20T17:35:58.600

@JPhi1618 Yeah, there are a lot of variables/dependencies. I should clarify my anecdote, my official firmware doesn't offer this option... I flashed it with a custom version with everything unlocked, mostly for laughs, but obviously not everything is really supported - case in point being the new WoWLAN setting. I've not dug into the details, but since the motherboard, firmware, wireless card, and possibly OS (judging by the existence elsewhere of 'always online' OEM services, etc.) all have to agree - suffice it to say that you need the right combination of pieces! – underscore_d – 2016-04-20T19:23:33.290

This seems odd. Who has enough experience to know what every other property in that list relates to(Fat Channel Intolerant?!?), but doesn't know what Wake on LAN is? – superphonic – 2016-04-22T08:50:28.787

Answers

216

Sam3000's answer is very nice. I'll add some technical details.

Wake on Magic Packet causes the network card to awaken the computer when it receives a magic packet. A packet is considered "magic" when it contains FF FF FF FF FF FF (six instances of the largest possible byte value) followed by sixteen instances of the card's six-byte MAC address. That sequence can appear anywhere within the frame, so the packet can be sent over any higher-level protocol. Usually, UDP is used, but sometimes raw frames with EtherType 0x0842 are used. (Source: Wikipedia.)

Wake on Pattern Match is a superset of the previous. It will cause the card to wake the machine when various things come in, including a magic packet, a NetBIOS name query, a TCP SYN packet (either TCPv4 or TCPv6), etc. Those last ones may require ARP offload to be enabled. (Source: TechNet.)

If you don't want/need your computer to be woken up from anywhere else, you can disable both of those options.

Ben N

Posted 2016-04-17T21:29:01.260

Reputation: 32 973

2" That sequence can appear anywhere within the frame, so the packet can be sent over any higher-level protocol" unless you're unlucky with fragmenting – John Dvorak – 2016-04-18T14:22:27.000

There's also a problem if something in the stack encrypts the magic sequence – John Dvorak – 2016-04-18T14:25:18.273

2@JanDvorak Fortunately, the sequence is so short (only 102 bytes) that the packet should never need to be fragmented. It's virtually always the Layer 3 protocol that does the fragmenting, so there's no danger of the raw frame getting messed up. – Ben N – 2016-04-18T16:16:54.300

Wi-Fi level encryption is still a viable candidate to be screwed up by. – John Dvorak – 2016-04-18T16:19:14.647

6

@JanDvorak That would only apply for Wi-Fi targets. And there you'd use a (subtly) different standard called WoWLAN, which requires the target to remain connected to the network (and therefore have access to the decryption key): http://revolutionwifi.blogspot.com.au/2010/11/wake-on-wireless-lan.html It's also largely useless now with Connected Standby being a thing.

– Bob – 2016-04-19T00:30:34.337

Nice answer Ben – Insane – 2016-04-19T20:01:29.003

Now if you could explain how to actually wake up this computer via WoWLAN if he leaves it enabled, that would be fantastic. That's the part I've never been able to figure out. – user541686 – 2016-04-20T04:20:20.600

@Mehrdad This TechNet article might be helpful if you haven't seen it yet. Note that not all devices and not all drivers support WoWLAN; some say that BIOS/UEFI might need to be in on it. You might need to enable all the WoWLAN-related things in the Device Manager properties of the network adapter too.

– Ben N – 2016-04-20T13:13:42.343

@BenN: Thanks, but the issue is that while it seems my WLAN adapter does support WoWLAN (I see it mentioned in the options) there's no way for me to actually use it. My computer just doesn't remain connected to the WLAN network, and I've never seen a computer that does. I don't know if it's because I need UEFI support for it or something but somehow it seems like this feature is just a joke... – user541686 – 2016-04-20T17:35:06.283

@Mehrdad I'd say you almost certainly need BIOS/UEFI support for it to work. Otherwise, the motherboard will shut down the power rails to the slot in which the Wi-Fi card resides. Furthermore, the motherboard needs to be listening for the wake-up signal from the Wi-Fi NIC. – reirab – 2016-04-21T18:32:06.307

@reirab: Yeah, makes sense. Out of curiosity, have you actually found laptops that can do this? (Wondering if I've just been unlucky.) – user541686 – 2016-04-21T18:49:14.943

Why a laptop ? Because they are dormant so often ? Are you using the laptop as a standby appliance ? One solution is to use a wireless bridge that is "always on". But you should really be using a server or some SOC device. Does it have a modem ? You may be able to wake on ring. – mckenzm – 2016-04-21T20:00:17.467

@Mehrdad Honestly, I've never looked for that feature in a laptop. I'd assume it would be a pretty big battery drain on a laptop that isn't plugged in. – reirab – 2016-04-21T20:42:11.057

@reirab: I mean WoWLAN wouldn't be meant for a desktop would it? That'd be WoLAN... have you seen it on desktops? – user541686 – 2016-04-21T20:49:28.530

126

These two settings form a feature of most modern computers known as "Wake on LAN"; in a nutshell, leaving this setting on allows the network card of your system to receive sufficient power to remain in standby mode, while the rest of the system is powered off. While in standby mode, it may receive a "magic packet" - a small amount of data specific to the mac address of the network card - and will respond to this by turning on the system. Very useful for remote control situations, however you are absolutely right that you may disable these features without any negative consequences - kudos to you for doing some prior research too.

For further information read "How-To Geek Explains: What is Wake-on-LAN and How Do I Enable It?".

Sam3000

Posted 2016-04-17T21:29:01.260

Reputation: 2 730