OpenWrt Forum Archive

Topic: Wake on WLAN

The content of this topic has been archived on 31 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello
I am currently using wake on WLAN from a WDR3600 (OpenWrt Attitude Adjustment 12.09) to a laptop  (Asus Rog G751jy/Intel DuaI Band Wireless-ACC 7260 )
I send the magic packet directly on the router using wol.

It almost works (laptop is awaken directly when I send the magic packet through wifi) except that for some reasons the laptop has insomnia every 10 minutes (without magic packet).

I opened a thread on Asus Rog forum as it could be caused by the laptop/system https://rog.asus.com/forum/showthread.p … post488026 but I think it may also be caused by openWRT :
When I put my laptop to sleep after  connecting it to another router (a bbox2), it doesn't wake up every 10 minutes.
And  I also have the same problem with another laptop, a macbook pro MD311LL/A  (BCM4322)

Do you have an idea of what could trigger this wake up ?

I performed a tcpdump on the router and here is what I got when my laptop wakes up:
13:57:00.519756 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
    0.0.0.0 > all-systems.mcast.net: igmp query v2
13:59:05.959755 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
    0.0.0.0 > all-systems.mcast.net: igmp query v2
14:01:11.399757 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
    0.0.0.0 > all-systems.mcast.net: igmp query v2
14:03:16.839756 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
    0.0.0.0 > all-systems.mcast.net: igmp query v2
14:03:46.307340 EAPOL key (3) v2, len 127
14:03:46.808198 EAPOL key (3) v2, len 127
14:03:47.809544 EAPOL key (3) v2, len 127
14:03:48.315020 5c:c5:d4:3b:1b:55 (oui Unknown) > Broadcast Null Unnumbered, xid, Flags [Response], length 6: 01 00
14:03:48.318382 EAPOL key (3) v2, len 95
14:03:48.997104 5c:c5:d4:3b:1b:55 (oui Unknown) > Broadcast Null Unnumbered, xid, Flags [Response], length 6: 01 00
14:03:48.999671 EAPOL key (3) v2, len 95
14:03:49.088878 EAPOL key (3) v1, len 119
14:03:49.090515 EAPOL key (3) v2, len 151
14:03:49.091985 EAPOL key (3) v1, len 95
14:03:49.141487 IP6 (hlim 1, next-header UDP (17) payload length: 92) fe80::8d54:795b:41c5:cff8.dhcpv6-client > ff02::1:2.dhcpv6-server: [udp sum ok] dhcp6 solicit (xid=1e9f2d (elapsed-time 0) (client-ID hwaddr/time type 1 time 475534867 08626653ad4c) (IA_NA IAID:73188820 T1:0 T2:0) (Client-FQDN) (vendor-class) (option-request DNS-search-list DNS-server vendor-specific-info Client-FQDN))
14:03:49.141544 IP6 (hlim 1, next-header UDP (17) payload length: 92) fe80::8d54:795b:41c5:cff8.dhcpv6-client > ff02::1:2.dhcpv6-server: [udp sum ok] dhcp6 solicit (xid=1e9f2d (elapsed-time 0) (client-ID hwaddr/time type 1 time 475534867 08626653ad4c) (IA_NA IAID:73188820 T1:0 T2:0) (Client-FQDN) (vendor-class) (option-request DNS-search-list DNS-server vendor-specific-info Client-FQDN))


The tcpdump correspond with the router logs :
Mar 31 14:03:48 OpenWrt daemon.info hostapd: wlan1: STA 5c:c5:d4:3b:1b:40 IEEE 802.11: authenticated
Mar 31 14:03:48 OpenWrt daemon.info hostapd: wlan1: STA 5c:c5:d4:3b:1b:55 IEEE 802.11: associated (aid 1)
Mar 31 14:03:48 OpenWrt daemon.info hostapd: wlan1: STA 5c:c5:d4:3b:1b:55 IEEE 802.11: authenticated
Mar 31 14:03:48 OpenWrt daemon.info hostapd: wlan1: STA 5c:c5:d4:3b:1b:55 IEEE 802.11: associated (aid 1)
Mar 31 14:03:49 OpenWrt daemon.info hostapd: wlan1: STA 5c:c5:d4:3b:1b:55 WPA: pairwise key handshake completed (RSN)
Mar 31 14:03:52 OpenWrt daemon.info dnsmasq-dhcp[1208]: DHCPREQUEST(br-lan) 192.168.237.226 08:62:66:53:ad:4c
Mar 31 14:03:52 OpenWrt daemon.info dnsmasq-dhcp[1208]: DHCPACK(br-lan) 192.168.237.226 08:62:66:53:ad:4c ASUS

14:03:46.307340 EAPOL key (3) v2, len 127
14:03:46.808198 EAPOL key (3) v2, len 127
14:03:47.809544 EAPOL key (3) v2, len 127

These packets are the first transmitted during the wake up sequence. So they may be the ones that cause this wake up.
Do anybody know what they mean?

Thanks in advance

I have found the cause of these insomnias : WPA group rekeying.
By default, it is set to every 600s on openWRT. I changed it to 3600 and now my wakes up only after 1hour.
So a workaround would be to increase this WPA group rekeying interval. But it also means decreasing security as hackers would have more time to break the generated key before it gets renewed.

to perform this change I edited the file /lib/wifi/mac80211.sh and added the line "wpa_group_rekey=3600" just under "wmm_enabled=$wmm".
So I know have
.....
wmm_enabled=$wmm
wpa_group_rekey=3600
bssid=$macaddr
......

Then I just run the wifi command to apply changes.

But I am quite confused with this wpa_group_rekey as http://wiki.openwrt.org/doc/uci/wireless indicates it only for WPA Enterprise  and not for WPA PSK...

The discussion might have continued from here.