skip to content

On a WPA2 network, why is the GTK shared by every client, and what decides when the access point rotates it with the group key handshake?

level: seniorimportance: nice to knowfreq 14%

answer

  1. one frame, many receivers
  2. delivered under each client's KEK
  3. two-message group key handshake
  4. a daily timer by default
  5. rekey when a member leaves

basics

~20 s

Broadcast and multicast frames must be readable by every client, so they share one GTK. The AP rotates it with a two-message group key handshake on a timer, daily by default in hostapd, and optionally whenever a holder leaves.

solid answer

~40 s

A broadcast or multicast frame is sent once and received by every station, so it cannot be encrypted with each client's own TK; the AP uses one **GTK** for all of them. It generates the GTK itself and hands it to each client in message 3 of the four-way handshake, wrapped with that client's KEK. To rotate it, the AP runs the two-message **group key handshake** with every associated client. In hostapd, `wpa_group_rekey` sets the interval, 86400 seconds by default with a CCMP group cipher, and `wpa_strict_rekey=1` adds a rekey whenever a station holding the current GTK leaves. With Protected Management Frames, the **IGTK** follows the same delivery path to protect group-addressed management frames.

go deeper

for a junior

Recall that broadcast and multicast frames use a shared group key, separate from each client's own unicast key.

for a middle

Explain how the GTK is delivered in message 3 and refreshed by the two-message group key handshake, and where the IGTK fits.

for a senior

Show operational judgment: rekey interval and strict rekeying, reason 16 disconnects from sleeping clients, and what a shared group key cannot protect.

for a principal

Weigh rekey policy as a trade-off between how long a departed member's key stays useful and the churn cost imposed on every remaining client.

## Why a shared key at all Unicast frames between an AP and one client are encrypted with that client's **Temporal Key (TK)**, a slice of its own PTK. A broadcast or multicast frame, such as an ARP request or a multicast stream, is transmitted once and received by every station in the BSS. It cannot be encrypted under thirty different TKs at once, so WPA2 adds a **Group Temporal Key (GTK)** that every associated client holds. The GTK is the AP's key: it generates it, from a Group Master Key in the design NIST describes and at random in hostapd, and it is not derived from any client's PTK. The consequence for a defender: the GTK protects group traffic from outsiders, not from other members, because every associated client holds the same key. That is one reason the GTK is rotated, and rotated when members leave. ## How the GTK reaches each client 1. **At join time**, message 3 of the four-way handshake carries the current GTK, encrypted with that client's **KEK** using AES key wrap and protected by the AP's MIC, together with the key's starting sequence counter. 2. **At rotation time**, the AP runs the **group key handshake** with each associated client: 1. AP -> client: group message 1/2, the new GTK wrapped with the client's KEK, the key index, the sequence counter, and a MIC keyed with the client's KCK. 2. Client -> AP: group message 2/2, a MIC-protected acknowledgement. 3. **During the change-over**, the new GTK goes into the other key index (hostapd alternates between index 1 and 2), so frames sent under the old key can still be decrypted until every client has the new one. ## The IGTK The **Integrity Group Temporal Key (IGTK)** came with Protected Management Frames (802.11w-2009). It does not encrypt; it lets clients check the integrity of group-addressed management frames through BIP, whose default in hostapd's `group_mgmt_cipher` is AES-128-CMAC. It travels exactly like the GTK, in message 3 and in group key updates, but only when PMF has been negotiated. When PMF is optional or required, and what it protects, is covered with transition mode and PMF. ## What decides when the GTK rotates | hostapd setting | Default | Effect | |---|---|---| | `wpa_group_rekey` | 86400 s with a CCMP or GCMP group cipher | Periodic GTK rotation; 600 s applied to the retired TKIP group cipher | | `wpa_strict_rekey` | Not enabled unless set to 1 | Rotates the GTK whenever a station that holds the current one leaves the BSS | | `wpa_gmk_rekey` | 86400 s | Renews the master value from which GTKs are generated | | `wpa_group_update_count` | 4 | How many times group message 1/2 is retried per attempt | These are hostapd's knobs, the open-source reference implementation; other access points expose the same ideas under their own names. ## Operating it - **Failure looks like a disconnect.** If a client never answers group message 1/2 within the retries, hostapd logs `group key handshake failed (RSN) after 4 tries` and deauthenticates it with **reason code 16**, group key handshake timeout. - **Power-saving clients are the usual victims.** A device that sleeps through every retry fails the update; hostapd's own configuration note suggests raising `wpa_group_update_count` only when stations are repeatedly dropped during GTK rekeying. - **Strict rekeying has a cost.** On an SSID with constant churn, rekeying on every departure means a group key handshake with every remaining client each time someone leaves; weigh it against how much trust the network places in departed members. - **Rotation does not replace pairwise keys.** The group key handshake changes only the GTK (and IGTK); each client's PTK is unaffected. ## Checking what is in force - hostapd's settings map to the standard's management variables, which its configuration notes name: `wpa_group_rekey` is `dot11RSNAConfigGroupRekeyTime`, `wpa_strict_rekey` is `dot11RSNAConfigGroupRekeyStrict`, and `wpa_group_update_count` is `dot11RSNAConfigGroupUpdateCount`. - The group cipher suite advertised in the RSN element of the beacon shows which cipher the GTK uses. CCMP there means hostapd's daily default applies unless `wpa_group_rekey` was overridden; TKIP there marks a legacy configuration that the comparison of security generations deals with. - A burst of reason code 16 disconnects at the same moment every day can line up with the rekey timer, which points at clients that miss the group update rather than at the radio.

  • Why does strict rekeying on departure matter more on a shared-passphrase network than the periodic timer suggests?
    A client that leaves still knows the GTK it was given, and a group key is the same for every member. Rotating it when a holder leaves limits how long a departed device's copy remains useful for reading group traffic; the periodic timer alone could leave it valid for up to a day with hostapd's defaults.
  • What happens to a client that sleeps through a GTK rotation?
    The AP retries group message 1/2 up to `wpa_group_update_count` times; if the client never answers, hostapd logs a group key handshake failure and deauthenticates it with reason code 16. The client then reconnects and gets the current GTK in message 3 of a fresh four-way handshake.

  • Each client has its own GTK derived from its PTK.
  • Rotating the GTK requires every client to repeat the four-way handshake.
  • The GTK keeps other clients on the same network from reading group traffic.
  • The IGTK encrypts broadcast data frames alongside the GTK.
  • The GTK is sent in the clear because all clients need it.