RFC 9838

Group Key Management Using the Internet Key Exchange Protocol Version 2 (IKEv2)

๐Ÿ“… published November 2025, from ietf

RFC 9838: Group Key Management Using the Internet Key Exchange Protocol Version 2 (IKEv2) ๐ŸŽ€

Okay bestie, let's do the title block first ๐Ÿ’… This is RFC 9838, and it's titled Group Key Management Using the Internet Key Exchange Protocol Version 2 (IKEv2). It came out of the Internet Engineering Task Force (IETF), it's a Standards Track document (so it's on the path to being a real Internet Standard ๐Ÿ”ฅ), and it's dated November 2025. The authors are V. Smyslov from ELVIS-PLUS and B. Weis, who's Independent. The ISSN is 2070-1721, and this RFC obsoletes RFC 6407 ๐Ÿ‘‘

Abstract ๐Ÿ“

So this doc adds an extension to IKEv2 for group key management ๐Ÿฆ‹ It follows the Multicast Security (MSEC) Group Key Management architecture, which has two parts: member registration and group rekeying. Both parts are required so a Group Controller/Key Server (GCKS) can hand authorized Group Members (GMs) their IPsec Group Security Associations (GSAs). After that, the GMs swap IP multicast or other group traffic as IPsec packets ๐Ÿ’–

This document obsoletes RFC 6407. ๐ŸŒธ

Status of This Memo ๐ŸŒˆ

This is an Internet Standards Track document. โœจ

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.

Info about the current status of this doc, any errata, and how to send feedback is at https://www.rfc-editor.org/info/rfc9838. ๐Ÿ”—

Copyright (c) 2025 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, since they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions, and they are provided without warranty as described in the Revised BSD License. ๐Ÿ™ˆ

Table of Contents ๐Ÿ—บ๏ธ

1.  Introduction and Overview
  1.1.  Requirements Notation
  1.2.  Terminology
2.  G-IKEv2 Protocol
  2.1.  G-IKEv2 Integration into the IKEv2 Protocol
    2.1.1.  G-IKEv2 Transport and Port
  2.2.  G-IKEv2 Payloads
  2.3.  G-IKEv2 Member Registration and Secure Channel
        Establishment
    2.3.1.  GSA_AUTH Exchange
    2.3.2.  GSA_REGISTRATION Exchange
    2.3.3.  GM Registration Operations
    2.3.4.  GCKS Registration Operations
  2.4.  Group Maintenance Channel
    2.4.1.  GSA_REKEY
    2.4.2.  GSA_INBAND_REKEY Exchange
    2.4.3.  Deletion of SAs
  2.5.  Counter-Based Modes of Operation
    2.5.1.  Allocation of Sender-ID
    2.5.2.  GM Usage of Sender-ID
  2.6.  Replay Protection for Multicast Data-Security SAs
  2.7.  Encryption Transforms with Implicit IV
3.  Group Key Management and Access Control
  3.1.  Key Wrap Keys
    3.1.1.  Default Key Wrap Key
  3.2.  GCKS Key Management Semantics
    3.2.1.  Forward Access Control Requirements
  3.3.  GM Key Management Semantics
  3.4.  SA Keys
4.  Header and Payload Formats
  4.1.  G-IKEv2 Header
  4.2.  Group Identification Payload
  4.3.  Security Association - GM Supported Transforms Payload
  4.4.  Group Security Association Payload
    4.4.1.  Group Policies
    4.4.2.  Group Security Association Policy Substructure
    4.4.3.  Group-Wide Policy Substructure
  4.5.  Key Download Payload
    4.5.1.  Key Bags
    4.5.2.  Group Key Bag Substructure
    4.5.3.  Member Key Bag Substructure
    4.5.4.  Key Wrapping
  4.6.  Delete Payload
  4.7.  Notify Payload
    4.7.1.  INVALID_GROUP_ID Notification
    4.7.2.  AUTHORIZATION_FAILED Notification
    4.7.3.  REGISTRATION_FAILED Notification
    4.7.4.  GROUP_SENDER Notification
  4.8.  Authentication Payload
5.  Using G-IKEv2 Attributes
6.  Interaction with IKEv2 and ESP Extensions
  6.1.  Implicit IV for Counter-Based Ciphers in ESP
  6.2.  Mixing Preshared Keys in IKEv2 for Post-Quantum Security
  6.3.  Aggregation and Fragmentation Mode for ESP
7.  GDOI Protocol Extensions
8.  Security Considerations
  8.1.  GSA Registration and Secure Channel
  8.2.  GSA Maintenance Channel
    8.2.1.  Authentication/Authorization
    8.2.2.  Confidentiality
    8.2.3.  On-Path Attack Protection
    8.2.4.  Replay/Reflection Attack Protection
9.  IANA Considerations
  9.1.  New Registries
    9.1.1.  Guidance for Designated Experts
  9.2.  Changes in the Existing IKEv2 Registries
10. References
  10.1.  Normative References
  10.2.  Informative References
Appendix A.  Use of LKH in G-IKEv2
  A.1.  Notation
  A.2.  Group Creation
  A.3.  Simple Group SA Rekey
  A.4.  Group Member Exclusion
Acknowledgements
Contributors
Authors' Addresses

1. Introduction and Overview ๐ŸŽ€

Okay so this doc is an IKEv2 extension called G-IKEv2, and it's built for group key management ๐Ÿ’– A group key management protocol hands IPsec keys and policy to a bunch of IPsec devices that are allowed to talk to each other using a Group Security Association (GSA), which is defined in the Multicast Group Security Architecture [RFC3740]. The group's data traffic (like IP multicast packets) is protected by a key that the Group Controller/Key Server (GCKS) pushes out to the Group Members (GMs) ๐Ÿฆ‹

G-IKEv2 follows "The Multicast Group Security Architecture" [RFC3740], "Multicast Extensions to the Security Architecture for the Internet Protocol" [RFC5374], and "Multicast Security (MSEC) Group Key Management Architecture" [RFC4046]. It also replaces "The Group Domain of Interpretation" [RFC6407], which defined a similar group key management protocol using IKEv1 [RFC2409] (which IKEv2 has since deprecated). When G-IKEv2 is used, group key management gets the simplicity, extra robustness, and crypto upgrades that come with IKEv2 (see Appendix A of [RFC7296]) ๐Ÿงš

G-IKEv2 has two phases: registration and rekeying ๐ŸŒธ In the registration phase, a GM contacts a GCKS to join a group. It gets the policy and keying material it needs to talk to the other GMs in the group and to the GCKS. In the rekeying phase, the GCKS periodically refreshes the keying material for both GM-to-GM traffic and GM-to-GCKS traffic โœจ

G-IKEv2 has two ways to do registration. When a GM first contacts a GCKS, it uses the GSA_AUTH exchange (Section 2.3.1) to join a group. This happens after the IKE_SA_INIT exchange (kind of like the IKE_AUTH exchange in IKEv2), and it ends with an IKE Security Association (SA) between the GM and the GCKS. During this exchange, the GCKS authenticates and authorizes the GM, then pushes the policy and the keys the group uses to the GM ๐Ÿ” The second new exchange type is GSA_REGISTRATION (Section 2.3.2). A GM can use it inside an IKE SA that's already set up with the GCKS, for example to join another group ๐Ÿ’…

Refreshing the group keys can happen in two ways. One is unicast, using the GSA_INBAND_REKEY exchange (Section 2.4.2) over a specific IKE SA between a GM and a GCKS. The other is multicast, using the GSA_REKEY pseudo-exchange (Section 2.4.1), which is used when new keys go out to all GMs at once ๐ŸŒˆ

Big and small groups can use different mixes of these mechanisms ๐Ÿ“ When a large group of devices is communicating, the GCKS will probably use the GSA_REKEY message because it's more efficient. Figure 1 shows this. Multicast communications are drawn with a double line.

  |  Note: For clarity, IKE_SA_INIT is omitted from Figures 1 and 2.

                     +--------+
      +----IKEv2---->|  GCKS  |<----IKEv2----+
      |              +--------+              |
      |               ||    ^                |
      |               ||    |                |
      |               || GSA_AUTH            |
      |               ||   or                |
      |               || GSA_REGISTRATION    |
      |               ||    |                |
   GSA_AUTH           ||  IKEv2           GSA_AUTH
     or               ||    |               or
GSA_REGISTRATION   GSA_REKEY |         GSA_REGISTRATION
      |               ||    |                |
      |    *==========**================*    |
      |   ||          ||    |           ||   |
      v   \/          \/    v           \/   v
    +-------+        +--------+        +-------+
    |  GM   |  ...   |   GM   |  ...   |  GM   |
    +-------+        +--------+        +-------+
       ||                ||               ||
        *=====ESP/AH=====**=====ESP/AH====*

               Figure 1: G-IKEv2 Used in Large Groups

Or a small group can keep it simple and just use GSA_AUTH or GSA_REGISTRATION as the registration protocols, with the GCKS issuing rekeys through GSA_INBAND_REKEY inside the same IKE SA ๐Ÿ’œ

  GSA_AUTH or GSA_REGISTRATION, GSA_INBAND_REKEY
+--------------------IKEv2----------------------+
|                                               |
|   GSA_AUTH or GSA_REGISTRATION,               |
|         GSA_INBAND_REKEY                      |
|   +-----------IKEv2-------------+             |
|   |                             |             |
|   |GSA_AUTH or GSA_REGISTRATION,|             |
|   |      GSA_INBAND_REKEY       |             |
|   |   +--IKEv2-+                |             |
v   v   v        v                v             v
+---------+    +----+           +----+        +----+
| GCKS/GM |    | GM |           | GM |        | GM |
+---------+    +----+           +----+        +----+
     ||          ||               ||            ||
      *==ESP/AH==**=====ESP/AH====**===ESP/AH===*

               Figure 2: G-IKEv2 Used in Small Groups

You can also mix the two approaches. For example, the GCKS might use the sturdier GSA_INBAND_REKEY to give keys to some GMs (say, the ones acting as senders in the group) and use GSA_REKEY for everyone else ๐Ÿ”ฅ

  |  Note: GCKS may also be a GM (as shown in Figure 2).

IKEv2 message semantics are kept intact, so every communication is a message request-response pair. The one exception is the GSA_REKEY pseudo-exchange, which is a single message that delivers group updates to the GMs ๐ŸŽ€

1.1. Requirements Notation ๐Ÿ’–

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. ๐Ÿซถ

1.2. Terminology

Okay bestie, quick vibe check ๐Ÿ’… you're assumed to already know the IPsec architecture [RFC4301] and its multicast extension [RFC5374] ๐Ÿง . This doc is an extension to IKEv2 [RFC7296], and it skips a LOT of the details ๐Ÿซถ. The notation and conventions from [RFC7296] are used for describing G-IKEv2 payloads and exchanges โœจ.

Here are the key terms we'll be using all over the place (mostly borrowed from [RFC3740], [RFC5374], and [RFC6407]) ๐Ÿฆ‹

Group: A set of IPsec devices that communicate with each other using multicast. ๐ŸŒธ

Group Member (GM): An IPsec device that belongs to a group. A GM is authorized to be a group sender and/or a group receiver. ๐Ÿ’œ

Group Receiver: A GM that is authorized to receive packets sent to a group by a group sender. ๐Ÿ‘‚

Group Sender: A GM that is authorized to send packets to a group. ๐Ÿ“ฃ

Group Key Management (GKM) Protocol: A key management protocol used by a GCKS to distribute IPsec Security Association policy and keying material. A GKM protocol is needed because a group of IPsec devices require the same SAs. For example, when an IPsec SA describes an IP multicast destination, the sender and all receivers need to have the group SA. ๐Ÿ”‘

Group Controller/Key Server (GCKS): A Group Key Management (GKM) protocol server that manages IPsec state for a group. A GCKS authenticates and provides the IPsec SA policy and keying material to GMs. ๐Ÿ‘‘

Data-Security SA: A multicast SA between each multicast sender and the group's receivers. The Data-Security SA protects data between member senders and member receivers. One or more SAs are required for the multicast transmission of data messages from the group sender to other GMs. This specification relies on Encapsulating Security Payload (ESP) and Authentication Header (AH) as protocols for Data-Security SAs. ๐Ÿ›ก๏ธ

Rekey SA: A single multicast SA between the GCKS and all of the GMs. This SA is used for multicast transmission of key management messages from the GCKS to all GMs. ๐Ÿ”

Group SA: A Data-Security SA or Rekey SA that is shared as part of group policy. ๐ŸŽ€

Group Security Association (GSA): A collection of Data-Security SAs and Rekey SAs necessary for a GM to receive key updates. A GSA describes the working policy for a group. Refer to the MSEC Group Key Management Architecture [RFC4046] for additional information. ๐Ÿงฉ

Traffic Encryption Key (TEK): The symmetric cipher key used in a Data-Security SA (e.g., IPsec ESP) to protect traffic. ๐Ÿ”

Key Encryption Key (KEK): The symmetric key (or a set of keys) used in a Rekey SA to protect its messages. The set of keys may include keys for encryption and authentication, as well as keys for key wrapping. ๐Ÿ—๏ธ

Key Wrap Key (KWK): The symmetric cipher key used to protect another key. ๐ŸŽ

Group-Wide (GW) policy: Group policy not related to a particular SA. ๐ŸŒ

Activation Time Delay (ATD): Defines how long group senders should wait after receiving new SAs before sending traffic over them. โณ

Deactivation Time Delay (DTD): Defines how long GMs should wait after receiving a request to delete Data-Security SAs before actually deleting them. โŒ›

Sender-ID: A unique identifier of a group sender in the context of an active GSA used to form the Initialization Vector (IV) in counter-based cipher modes. ๐Ÿ†”

Logical Key Hierarchy (LKH): A group management method defined in Section 5.4 of [RFC2627]. ๐ŸŒณ

2. G-IKEv2 Protocol ๐ŸŽ€

G-IKEv2 is an extension to the IKEv2 protocol [RFC7296] that provides group authorization, secure policy, and keys download from the GCKS to GMs. It's giving main character energy for group key stuff ๐Ÿ’–

2.1. G-IKEv2 Integration into the IKEv2 Protocol

G-IKEv2 is compatible with most IKEv2 extensions defined so far (see Section 6 for details). In particular, it is assumed that, if necessary, the IKE_INTERMEDIATE exchanges [RFC9242] may be utilized while establishing the registration SA. It is also believed that future IKEv2 extensions will be possible to use with G-IKEv2. However, some IKEv2 extensions may require special handling when used with G-IKEv2. โœจ

2.1.1. G-IKEv2 Transport and Port

As an IKEv2 extension, G-IKEv2 SHOULD use the IKEv2 ports (500, 4500). ๐Ÿšช G-IKEv2 MAY use TCP transport for the IKE SA used for registration (which is unicast), as defined in TCP Encapsulation of IKEv2 and IPsec [RFC9329]. G-IKEv2 MAY also use UDP port 848, the same as Group Domain of Interpretation (GDOI) [RFC6407], because they serve a similar function. The version number in the IKE header distinguishes the G-IKEv2 protocol from the GDOI protocol [RFC6407]. ๐Ÿ”ข

Section 2.23 of [RFC7296] describes how IKEv2 supports paths with NATs. ๐ŸŒ The G-IKEv2 registration SA doesn't create any unicast IPsec SAs; thus, if a NAT is present between the GM and the GCKS, there is no unicast ESP traffic to encapsulate in UDP. However, the actions described in this section regarding the IKE SA MUST be honored. The behavior of GMs and GCKS MUST NOT depend on the port used to create the initial IKE SA. For example, if the GM and the GCKS used UDP port 848 for the IKE_SA_INIT exchange, they will operate the same as if they had used UDP port 500. ๐Ÿ™ˆ

Heads up: the port you use for the initial IKE SA does NOT change how GMs and GCKS behave. Same vibes either way ๐Ÿ’…

2.2. G-IKEv2 Payloads

In the following descriptions, the payloads contained in the G-IKEv2 messages are indicated by names as listed below. ๐Ÿ“‹

      +==========+=============================+=============+
      | Notation | Payload                     | Defined in  |
      +==========+=============================+=============+
      | AUTH     | Authentication              | [RFC7296]   |
      +----------+-----------------------------+-------------+
      | CERT     | Certificate                 | [RFC7296]   |
      +----------+-----------------------------+-------------+
      | CERTREQ  | Certificate Request         | [RFC7296]   |
      +----------+-----------------------------+-------------+
      | D        | Delete                      | [RFC7296]   |
      +----------+-----------------------------+-------------+
      | GSA      | Group Security Association  | Section 4.4 |
      +----------+-----------------------------+-------------+
      | HDR      | IKE header (not a payload)  | [RFC7296]   |
      +----------+-----------------------------+-------------+
      | IDg      | Group Identification        | Section 4.2 |
      +----------+-----------------------------+-------------+
      | IDi      | Identification - Initiator  | [RFC7296]   |
      +----------+-----------------------------+-------------+
      | IDr      | Identification - Responder  | [RFC7296]   |
      +----------+-----------------------------+-------------+
      | KD       | Key Download                | Section 4.5 |
      +----------+-----------------------------+-------------+
      | KE       | Key Exchange                | [RFC7296]   |
      +----------+-----------------------------+-------------+
      | Ni, Nr   | Nonce                       | [RFC7296]   |
      +----------+-----------------------------+-------------+
      | N        | Notify                      | [RFC7296]   |
      +----------+-----------------------------+-------------+
      | SA       | Security Association        | [RFC7296]   |
      +----------+-----------------------------+-------------+
      | SAg      | Security Association - GM   | Section 4.3 |
      |          | Supported Transforms        |             |
      +----------+-----------------------------+-------------+
      | SK       | Encrypted and Authenticated | [RFC7296]   |
      |          | (also known as Encrypted)   |             |
      +----------+-----------------------------+-------------+

                    Table 1: Payloads Used in G-IKEv2

Payloads defined as part of other IKEv2 extensions MAY also be included in these messages. Payloads that may optionally appear in G-IKEv2 messages will be shown in brackets, such as [CERTREQ]. ๐Ÿงบ

G-IKEv2 defines several new payloads not used in IKEv2: ๐Ÿ†•

Group Identification (IDg): The GM requests the GCKS for membership into the group by sending its IDg payload. ๐Ÿ™‹โ€โ™€๏ธ

Security Association - GM Supported Transforms (SAg): The GM optionally sends supported transforms so that GCKS may select a policy appropriate for all members of the group (which is not negotiated, unlike SA parameters in IKEv2). ๐Ÿค

Group Security Association (GSA): The GCKS sends the group policy to the GM using this payload. ๐Ÿ“œ

Key Download (KD): The GCKS sends the keys and the security parameters to the GMs using this payload. ๐ŸŽ

The details of the contents of each payload are described in Section 4. ๐Ÿ‘€

2.3. G-IKEv2 Member Registration and Secure Channel Establishment

Initial registration is combined with establishing a secure connection between the entity seeking registration and the GCKS. ๐Ÿš€ This process consists of a minimum of two exchanges, IKE_SA_INIT and GSA_AUTH; member registration may have a few more messages exchanged if the Extensible Authentication Protocol (EAP) method, cookie challenge (for DoS protection), negotiation of key exchange method, or IKEv2 extensions based on the IKEv2 Intermediate Exchange [RFC9242] are used. Each exchange consists of request/response pairs. The first exchange, called IKE_SA_INIT, is defined in IKEv2 [RFC7296]. This exchange negotiates cryptographic algorithms, exchanges nonces, and computes a shared key between the GM and the GCKS. In addition to the cryptographic algorithms negotiated for use in IKEv2 SA, a key wrap algorithm is also negotiated in this exchange by means of a new "Key Wrap Algorithm" transform. See Section 4.5.4 for details. ๐Ÿ”‘

The second exchange, called GSA_AUTH, is similar to the IKEv2 IKE_AUTH exchange [RFC7296]. It authenticates the previously exchanged messages and exchanges identities and certificates. The GSA_AUTH messages are encrypted and integrity protected with keys established through the previous exchanges, so the identities are hidden from eavesdroppers and all fields in all the messages are authenticated. ๐Ÿ•ต๏ธโ€โ™€๏ธ The GCKS authorizes GMs to be allowed into the group as part of the GSA_AUTH exchange. Once the GCKS accepts a GM to join a group, it will provide the GM with the data-security keys (TEKs) and/or a group key encrypting key (KEK) as part of the GSA_AUTH response message. ๐ŸŽ‰

The established secure channel between the GM and the GCKS is in fact IKE SA (as defined in [RFC7296]) and is referred to as such throughout this document. However, it is NOT RECOMMENDED to use this IKE SA for the purpose of creating unicast Child SAs between the GM and the GCKS since authentication requirements for group admission and for unicast communication may differ. In addition, the life cycle of this IKE SA is determined by the GCKS and this SA can be deleted at any time. ๐Ÿ™ƒ

2.3.1. GSA_AUTH Exchange โœจ

okay so the GSA_AUTH exchange is how everyone gets to prove who they are and swap identities and certificates, like a full-on verification moment ๐Ÿชช๐Ÿ’…. G-IKEv2 also uses it for GM registration and authorization, so it's doing a lot of work bestie ๐Ÿซถ.

It's giving IKE_AUTH vibes, but with its own glow-up ๐Ÿฆ‹. Its goal is to set up a multicast Data-Security SA(s) and optionally give the GM the keys for a Rekey SA ๐Ÿ”‘. The payloads look a little different because policy isn't negotiated between the GM and the GCKS. Instead, the GCKS just hands the policy to the GM ๐Ÿ“œ. Also, GSA_AUTH has its own exchange type, not the IKE_AUTH one, so it's its own main character ๐Ÿ‘‘.

๐ŸŽ€ Note: Due to the similarities between IKE_AUTH and GSA_AUTH, most IKEv2 extensions to the IKE_AUTH exchange (like secure password authentication [RFC6467]) can also be used with the GSA_AUTH exchange.

Here's the GM sending its request to join ๐Ÿ“จ:

 Initiator (GM)                                  Responder (GCKS)
--------------------                            ------------------
 HDR, SK{IDi, [CERT,] [CERTREQ,] [IDr,]
      AUTH, IDg, [SAg,] [N(GROUP_SENDER),] [N]}   -->

                      Figure 3: GSA_AUTH Request

So a GM starts a GSA_AUTH request to join the group named in the IDg payload ๐ŸŒธ. It may include an SAg payload to say which Transforms it's willing to accept. And if a GM plans to act as a group sender, it MUST include a Notify payload with the status type GROUP_SENDER โœจ. That's how the GCKS knows to add any extra policy group senders need ๐Ÿ’–.

 Initiator (GM)                 Responder (GCKS)
--------------------           ------------------
                          <--   HDR, SK{IDr, [CERT,]
                                     AUTH, GSA, KD, [N]}

                  Figure 4: GSA_AUTH Normal Response

The GCKS replies with IDr, an optional CERT, and AUTH payloads, and they mean the same thing they do in IKE_AUTH ๐Ÿงš. It also tells the GM about the group's cryptographic policies in the GSA payload, plus the key material in the KD payload ๐Ÿ”.

Errors should be handled the way Section 2.21.2 of [RFC7296] says ๐Ÿ™. On top of the usual IKEv2 error stuff, the GCKS can also reject the registration if the IDg is invalid or authorization fails, and so on ๐Ÿ™…โ€โ™€๏ธ. When that happens (see Section 4.7), the GSA_AUTH response won't have the GSA or KD, but it will have a Notify payload explaining what went wrong ๐Ÿšจ. If the GM sent an SAg and the GCKS checks it and finds the GM can't support the group's security policy, the GCKS sends back NO_PROPOSAL_CHOSEN ๐Ÿ’€. Other error notifications can be INVALID_GROUP_ID, AUTHORIZATION_FAILED, or REGISTRATION_FAILED ๐Ÿ˜ญ.

 Initiator (GM)                   Responder (GCKS)
--------------------             ------------------
                          <--   HDR, SK{IDr, [CERT,] AUTH, N}

      Figure 5: GSA_AUTH Error Response for Group-Related Errors

Now, if GSA_AUTH finishes fine but the GM decides the policy from the GCKS is unacceptable, the member SHOULD tell the GCKS by starting a GSA_REGISTRATION exchange with the IDg payload and the NO_PROPOSAL_CHOSEN notification (see Figure 8) ๐Ÿ“ฃ. Tell them, bestie ๐Ÿ’….

2.3.2. GSA_REGISTRATION Exchange โœจ

Once the IKE SA between the GM and the GCKS is up, the GM can keep using it for other registration requests whenever it needs to ๐Ÿ”. That's when it uses the GSA_REGISTRATION exchange ๐Ÿง. Payloads here get generated and processed the same way they are in Section 2.3.1 ๐Ÿ’•.

 Initiator (GM)                   Responder (GCKS)
--------------------             ------------------
 HDR, SK{IDg, [SAg,]
      [N(GROUP_SENDER),] [N]} -->
                            <--  HDR, SK{GSA, KD, [N]}

              Figure 6: GSA_REGISTRATION Normal Exchange

Just like with GSA_AUTH, the GCKS can reject the request if the IDg is invalid, authorization fails, or the GM can't support the group's security policy (the GCKS can figure that out by checking the SAg payload) ๐Ÿ™…โ€โ™€๏ธ. In that case, the GCKS sends back an appropriate error notification, as described in Section 2.3.1 ๐Ÿšฉ.

 Initiator (GM)                    Responder (GCKS)
--------------------              ------------------
 HDR, SK{IDg, [SAg,]
      [N(GROUP_SENDER),] [N]} -->
                            <--    HDR, SK{N}

              Figure 7: GSA_REGISTRATION Error Exchange

This exchange also works if the GM finds the GCKS's policy unacceptable, or if it wants to leave the group for some reason ๐Ÿ‘‹. The GM SHOULD let the GCKS know by sending IDg along with the Notify type NO_PROPOSAL_CHOSEN or REGISTRATION_FAILED, like shown below ๐Ÿ“ฌ. When that happens, the GCKS MUST remove the GM from the group named in IDg ๐Ÿšช. No cap, that's a big deal ๐Ÿ’€.

 Initiator (GM)                     Responder (GCKS)
--------------------               ------------------
 HDR, SK{IDg, N}      -->
                         <--        HDR, SK{}

      Figure 8: GM Reporting Errors in GSA_REGISTRATION Exchange

2.3.3. GM Registration Operations ๐ŸŽ€

Okay so, when a GM wants to register, it starts by reaching out to the GCKS with the IKE_SA_INIT exchange. This one is totally unchanged from IKE_SA_INIT in IKEv2, so no new drama here ๐Ÿ’…. The IKE_SA_INIT exchange may optionally be followed by one or more IKE_INTERMEDIATE exchanges, but only if the GM and the GCKS already agreed to use IKEv2 extensions built on this exchange โœจ.

Next up, the GM sends the GSA_AUTH request. It carries the IKEv2 payloads from IKE_AUTH (minus the SAi2, TSi, and TSr payloads) plus the Group ID, so the GCKS knows which group the GM wants to join ๐Ÿซถ. A GM intending to emit data traffic MUST send a GROUP_SENDER notification. This notification does two jobs at once: it says "hey, I'm a sender," and it lets the GM ask for Sender-ID values in case the Data-Security SA uses a counter-mode cipher. Section 2.5.1 has the guidance on requesting Sender-ID values, so go check that out ๐ŸŒธ.

A GM may be limited in which Transform IDs it can or is willing to use, and it may find it useful to tell the GCKS which Transform IDs it will accept for each security protocol. To do that, it includes the SAg payload in the request. Proposals for the Rekey SA and for the Data-Security SAs (AH [RFC4302] and/or ESP [RFC4303]) may be included in SAg. Proposals for the Rekey SA are identified by a brand-new Security Protocol Identifier, GIKE_UPDATE, with the value 6 ๐Ÿฆ‹. Each Proposal lists the Transforms the GM is able and willing to support for that protocol. Which Transform Types are valid depends on the protocol (AH, ESP, GIKE_UPDATE), and they're all defined in Table 2. Other Transform Types SHOULD NOT be included, because the GCKS will just ignore them. Each Proposal in an SAg has an SPI length of zero, so the SPI field is empty. The GCKS MUST NOT use the SPI length and SPI fields in the SAg payload. Rude, but fair ๐Ÿ˜ค.

Generally, one Proposal per protocol (GIKE_UPDATE, AH/ESP) will be enough. The transforms aren't negotiated here, so the GM is basically just warning the GCKS about any restrictions it has. Quick heads-up: the rule from Section 3.3 of [RFC7296] that AEAD and non-AEAD transforms can't be mixed in one proposal does NOT apply when you're forming the SAg payload ๐Ÿ™ˆ. Hmm, wait, let me be precise on that: the rule doesn't hold in this situation. If the GM has restrictions on how algorithms can be combined, it can express that by sending several proposals instead ๐Ÿ’ก.

Here's a fun one. The Proposal Num field in the Proposal substructure gets special treatment in the SAg payload. It lets a GM say that the algorithms used in the Rekey SA and in the Data-Security (AH and/or ESP) SAs depend on each other ๐Ÿง . Proposals for different protocols that share the same Proposal Num value are treated as a set. So if the GCKS uses transforms from one of those Proposals for one protocol, it MUST only use transforms from one of the Proposals with that same Proposal Num value for the other protocols. For example, a GM might support algorithms X and Y for both Rekey and Data-Security SAs, but with a catch: if X is used for the Rekey SA, then only X can be used for the Data-Security SAs, and the same goes for Y. Matching Proposal Num values mean "these proposals go together." When there are no dependencies between transforms, every Proposal in the SAg payload just gets the same Proposal Num value, and life is simple ๐Ÿ’–.

The SAg payload is optional, but it is RECOMMENDED that the GM include it in the GSA_AUTH request. That way the GCKS can pick an appropriate policy ๐ŸŒˆ.

A GM MAY also show support for IPcomp by including one or more IPCOMP_SUPPORTED notifications along with the SAg payload in the request. The Compression Parameter Index (CPI) in these notifications is set to zero, and the GCKS MUST ignore it ๐Ÿ“.

When the GM gets the GSA_AUTH response, it parses the response from the GCKS and authenticates the exchange using the IKEv2 method. Then it processes the GSA and KD payloads ๐Ÿ”.

The GSA payload holds the security policy and the cryptographic protocols used by the group. It describes zero or more Data-Security SAs (TEK), zero or one Rekey SA (KEK), and zero or one GW policy. At least one TEK or KEK policy MUST be Present, though ๐Ÿ‘‘. If the GM finds the policy in the GSA payload unacceptable, it SHOULD notify the GCKS by starting a GSA_REGISTRATION exchange with a NO_PROPOSAL_CHOSEN Notify payload (see Section 2.3.2). This should normally not happen if the GM included the SAg payload in the GSA_AUTH request and the GCKS actually took it into account ๐Ÿ™ƒ. Last step: the KD payload gets parsed, which provides the keying material for the TEK and/or KEK. The KD payload contains a list of key bags, and each key bag holds the keying material for SAs distributed in the GSA payload. Keying material gets matched by comparing the SPIs in the key bags to the SPIs previously included in the GSA payloads. Once the TEK keys and policy are matched, the GM hands them to the data-security subsystem, and it's ready to send or receive packets that match the TEK policy ๐Ÿš€.

If the GM is not a sender for a received Data-Security SA, it MUST install that SA only in the inbound direction. If the GM is a sender for a received Data-Security SA and it is not going to receive back the data it sends, it MUST install that SA only in the outgoing direction ๐Ÿ“ฅ๐Ÿ“ค.

If the first Message ID the GM should expect to receive is non-zero, the GSA KEK policy includes the attribute GSA_INITIAL_MESSAGE_ID with that expected non-zero value. The GM MUST check the value of this attribute against any Message ID it previously received for this group. If the value is less than the previously received number, it should be considered stale and MUST be ignored. This could happen if two GSA_AUTH exchanges ran in parallel and the Message ID changed ๐Ÿ˜ฌ. This attribute is how the GM guards against GSA_REKEY message replay attacks. The first GSA_REKEY message the GM receives from the GCKS will have a Message ID greater than or equal to the Message ID received in the GSA_INITIAL_MESSAGE_ID attribute ๐Ÿ›ก๏ธ.

GMs MUST install the Rekey SA only in the inbound direction. Period, no exceptions ๐Ÿ™…โ€โ™€๏ธ.

Once a GM successfully registers to the group, it MUST replace any information it has for this group (policy, keys) that came from a previous registration with the new information. Fresh start, bestie โœจ.

Once a GM has received the GIKE_UPDATE policy during a registration, the IKE SA MAY be closed. By convention, the GCKS is the one that closes the IKE SA. The GM SHOULD NOT close it ๐Ÿ™…. The GCKS MAY choose to keep the IKE SA open for inband rekey, especially for small groups. If inband rekey is used, the initial IKE SA can be rekeyed by either side with the standard IKEv2 mechanism described in Section 1.3.2 of [RFC7296]. But if, for some reason, the IKE SA gets closed and no GIKE_UPDATE policy was received during registration, the GM MUST consider itself excluded from the group. To keep participating, the GM needs to re-register ๐Ÿ˜ญ.

2.3.4. GCKS Registration Operations ๐Ÿ’…

A G-IKEv2 GCKS listens for incoming requests from GMs ๐Ÿ‘‚. When the GCKS receives an IKE_SA_INIT request, it selects an IKE proposal and generates a nonce and a Diffie-Hellman (DH) value to include in the IKE_SA_INIT response ๐ŸŒธ.

When the GCKS receives the GSA_AUTH request, it authenticates the GM through the GSA_AUTH exchange. Then it authorizes the GM according to the group policy before getting ready to send the GSA_AUTH response. If the GCKS fails to authorize the GM, it responds with an AUTHORIZATION_FAILED notification. The GCKS may also respond with an INVALID_GROUP_ID notification if the requested group is unknown to it, or with a REGISTRATION_FAILED notification if there's a problem with the requested group (e.g., if the capacity of the group is exceeded) ๐Ÿšซ.

The GSA_AUTH response includes the group policy in the GSA payload and the keys in the KD payload. If the GCKS policy includes a group rekey option and the initial Message ID value the GCKS will use when sending GSA_REKEY messages to the GMs is non-zero, then that value is specified in the GSA_INITIAL_MESSAGE_ID attribute. This Message ID is what stops GSA_REKEY message replay attacks, and it goes up every time a GSA_REKEY message is sent to the group ๐Ÿ“ˆ. The GCKS data traffic policy goes in the GSA TEK, and the keys go in the KD TEK. The GW policy MAY also be included to provide the Activation Time Delay (ATD) and/or Deactivation Time Delay (DTD) (Section 4.4.3.1.1), which specify activation and deactivation delays for SAs generated from the TEKs โฐ. If the GM said it's a sender of data traffic and one or more Data-Security SAs in the GSA payload use a counter mode of operation, the GCKS responds with one or more Sender-ID values (see Section 2.5) ๐Ÿ”ข.

Multicast Extensions to the Security Architecture [RFC5374] defines two modes of operation for multicast Data-Security SAs: transport mode and tunnel mode with address preservation. In the latter case, the outer source and destination addresses are taken from the inner IP packet ๐Ÿฆ‹. Which mode the Data-Security SAs use is determined by whether the USE_TRANSPORT_MODE notification is present in the GCKS's response message of the registration exchange. If it's present, SAs get created in transport mode. If it's not, SAs get created in tunnel mode. If multiple Data-Security SAs are created in a single registration exchange, they all share the same mode of operation ๐ŸŽ€.

If the GCKS receives a GSA_REGISTRATION exchange asking it to register a GM to a group, the GCKS needs to authorize the GM for the new group (IDg) and respond with the matching group policy and keys. If the GCKS fails to authorize the GM, it responds with the AUTHORIZATION_FAILED notification. For the reasons described above, the GCKS may also respond with an INVALID_GROUP_ID or REGISTRATION_FAILED Notify message ๐Ÿ™Œ.

If a GM includes an SAg in its GSA_AUTH or GSA_REGISTRATION request, the GCKS may evaluate it according to an implementation-specific policy ๐Ÿงฉ. The GCKS has a few options:

  • The GCKS could evaluate the list of Transforms and compare it to its current policy for the group. If the GM did not include all of the ESP, AH, or GIKE_UPDATE Transforms that match the current group policy or the capabilities of all other currently active GMs, then the GCKS SHOULD return a NO_PROPOSAL_CHOSEN notification. Alternatively, the GCKS can change the group policy as defined below.
  • The GCKS could store the list of Transforms with the goal of migrating the group policy from the current set of transforms to a different one, once all of the GMs indicate that they can support transforms from the new set ๐Ÿ”„.
  • The GCKS could store the list of Transforms and adjust the current group policy based on the capabilities of the devices, as long as they fall within the acceptable security policy of the GCKS ๐ŸŽฏ.

Depending on its policy, the GCKS may have no further need for the IKE SA (for example, if it doesn't plan to start a GSA_INBAND_REKEY exchange). If the GM doesn't start another registration exchange or Notify (e.g., NO_PROPOSAL_CHOSEN) and the GCKS isn't planning to use the SA, then the GCKS SHOULD close the IKE SA after a short period of time to save resources ๐Ÿงนโœจ.

2.4. Group Maintenance Channel โœจ

okay so bestie, the GCKS is the one in charge of rekeying the secure group, following whatever the group policy says ๐Ÿ” rekeying is basically when the GCKS hands out replacement TEK(s) and/or KEK, deletes TEK(s), and/or kicks out GMs ๐Ÿ’… the GCKS can kick off a rekey message if group membership and/or policy has changed or if the keys are about to expire โฐ G-IKEv2 gives us two forms of group maintenance channels to push new policy down to GMs ๐ŸŽ€

GSA_REKEY: The GSA_REKEY is a pseudo-exchange, which is literally just one-way IKEv2 message sent by the GCKS, with the rekey policy delivered to GMs using IP multicast as the transport ๐Ÿ“ก this is so valuable for large and dynamic groups where policy changes a lot and you need a scalable rekey method ๐Ÿฆ‹ when GSA_REKEY is used, the IKE SA protecting the member registration exchanges is usually terminated, and GMs just wait for policy changes from the GCKS via the GSA_REKEY messages ๐ŸŒธ

GSA_INBAND_REKEY: The GSA_INBAND_REKEY is a normal IKEv2 exchange that runs over the IKE SA set up to protect the member registration exchange ๐Ÿ’œ it lets the GCKS rekey without needing a separate GSA_REKEY pseudo-exchange ๐Ÿ™Œ it gives reliable policy delivery and is super useful when G-IKEv2 is used with a small group of cooperating devices ๐Ÿซถ

Depending on its policy, the GCKS MAY combine these two methods ๐Ÿ“ for example, the GCKS may use GSA_INBAND_REKEY to deliver a key to the GMs acting as senders (since that gives reliable key delivery), and GSA_REKEY for the rest of the GMs ๐Ÿงš


2.4.1. GSA_REKEY โœจ

okay so the GCKS starts the G-IKEv2 rekey by sending a protected message to the GMs, usually over IP multicast ๐Ÿ“ก the Rekey messages don't need responses and go out to multiple GMs, so the windowing mechanism from Section 2.3 of [RFC7296] MUST NOT be used for the Rekey messages ๐Ÿ™ˆ the GCKS rekey message replaces the current rekey GSA KEK or KEK array (like with LKH) and/or creates new Data-Security SAs ๐Ÿ”ฅ the GM_SENDER_ID attribute in the Key Download payload (defined in Section 4.5.3.3) MUST NOT be part of the Rekey Exchange, because it's sender-specific info and the Rekey Exchange is group specific ๐Ÿ’€ the GCKS kicks off the GSA_REKEY pseudo-exchange like this:

 GMs (Receivers)              GCKS (Sender)
-----------------            ---------------
                        <--  HDR, SK{GSA, KD, [N,] [AUTH]}

                 Figure 9: GSA_REKEY Pseudo-Exchange

HDR is defined in Section 4.1 ๐ŸŽ€ GSA_REKEY reuses the IKEv2 header, but the "IKE SA Initiator's SPI" and the "IKE SA Responder's SPI" fields are treated as a single field that's 16 octets long and holds the SPI of a Rekey SA ๐Ÿฆ‹ the GCKS provides the value for this field in the GSA payload (see Section 4.4.2) ๐Ÿ’… the Message ID in this message starts at whatever the GCKS sent to the GMs in the GSA_INITIAL_MESSAGE_ID attribute, or from zero if that attribute wasn't sent ๐ŸŒˆ then the Message ID goes up by one every time a new GSA_REKEY message is sent to the GMs โญ

the GSA payload has the current policy for rekey and Data-Security SAs ๐ŸŒธ the GSA may contain a new Rekey SA and/or new Data-Security SA(s) (Section 4.4) ๐Ÿ’œ

the KD payload holds the keys for the policy included in the GSA ๐Ÿ”‘ if one or more Data-Security SAs are being refreshed in this rekey message, the IPsec keys get updated in the KD, and/or if the Rekey SA is being refreshed, the rekey Key or the LKH KEK array (like with LKH) gets updated in the KD payload ๐Ÿ“

a Delete payload MAY be included to tell the GM to delete existing SAs ๐Ÿ—‘๏ธ check out Section 4.6 for more detail ๐Ÿซถ

the AUTH payload MUST be included to authenticate the GSA_REKEY message if the authentication method is based on public key signatures, and MUST NOT be included if authentication is implicit ๐Ÿ” in the implicit case, a GM can decrypt the GSA_REKEY message and verify its Integrity Check Value (ICV), which proves the sender knows the current KEK, so the sender gets authenticated as a member of the group ๐Ÿงš but heads up: implicit authentication doesn't give you source origin authentication ๐Ÿ˜ญ so using implicit authentication for GSA_REKEY is NOT RECOMMENDED unless source origin authentication isn't required (for example, in a small group of highly trusted GMs) โš ๏ธ more on authentication methods in Section 4.4.2.1.1 ๐Ÿ‘‘

during GM registration, the GCKS sends the authentication key in the KD payload, in the AUTH_KEY attribute, which the GM uses to authenticate the key server ๐Ÿ—๏ธ before the current authentication key expires, the GCKS will send a new AUTH_KEY to the GMs in a GSA_REKEY message ๐Ÿฆ‹ the authentication key sent in the rekey message may not be the same one sent during GM registration ๐ŸŒธ if implicit authentication is used, then AUTH_KEY MUST NOT be sent to GMs ๐Ÿ™…โ€โ™€๏ธ


2.4.1.1. GSA_REKEY Message Authentication โœจ

okay so the content of the AUTH payload generally depends on the authentication method from the Group Controller Authentication Method (GCAUTH) transform (Section 4.4.2.1.1) ๐Ÿ’– this spec only defines one authentication method, Digital Signature, and the AUTH payload holds a digital signature calculated over the content of the not-yet-encrypted GSA_REKEY message โœ๏ธ

the digital signing is applied to the concatenation of two chunks: A and P ๐Ÿงฉ chunk A starts with the first octet of the G-IKEv2 header (not counting the four octets of zeros prepended if port 4500 is used) and runs through the last octet of the Encrypted Payload header ๐ŸŽ€ chunk P is the not-yet-encrypted content of the Encrypted payload, excluding the Initialization Vector, the Padding, the Pad Length, and the Integrity Checksum Data fields (see Section 3.14 of [RFC7296] for the Encrypted payload description) ๐ŸŒˆ basically chunk P is the inner payloads in plaintext form ๐Ÿ’… Figure 10 shows the layout of chunks P and A in the GSA_REKEY message ๐Ÿ‘€

before the AUTH payload gets calculated, the inner payloads of the Encrypted payload must be fully formed and ready for encryption, except for the content of the AUTH payload ๐Ÿง the AUTH payload MUST have correct values in the Payload header, the Auth Method, and the RESERVED fields ๐Ÿ™Œ the Authentication Data field is zeroed, but the ASN.1 Length and the AlgorithmIdentifier fields must be properly filled in (see Signature Authentication in [RFC7427]) ๐Ÿ“

for the AUTH payload calculation, the Length field in the IKE header and the Payload Length field in the Encrypted Payload header are adjusted so they don't count the lengths of the Initialization Vector, Integrity Checksum Data, and Padding (along with the Pad Length field) ๐Ÿซง so the Length field in the IKE header (AdjustedLen in Figure 10) gets set to the sum of the lengths of A and P, and the Payload Length field in the Encrypted Payload header (AdjustedPldLen in Figure 10) gets set to the length of P plus the size of the Payload header (four octets) ๐Ÿ’ซ

the input to the digital signature algorithm that computes the AUTH payload content can be described like this:

DataToAuthenticate = A | P
GsaRekeyMessage = GenIKEHDR | EncPayload
GenIKEHDR = [ four octets 0 if using port 4500 ] | AdjustedIKEHDR
AdjustedIKEHDR =  SPIi | SPIr |  . . . | AdjustedLen
EncPayload = AdjustedEncPldHdr | IV | InnerPlds | Pad | PadLen | ICV
AdjustedEncPldHdr = NextPld | C | RESERVED | AdjustedPldLen
A = AdjustedIKEHDR | AdjustedEncPldHdr
P = InnerPlds
                     1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ^ ^
|                       IKE SA Initiator's SPI                  | | |
|                                                               | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ I |
|                       IKE SA Responder's SPI                  | K |
|                                                               | E |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |
|  Next Payload | MjVer | MnVer | Exchange Type |     Flags     | h A
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ d |
|                           Message ID                          | r |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
|                          AdjustedLen                          | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ x |
| Next Payload  |C|  RESERVED   |         AdjustedPldLen        | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | v
|                                                               | |
~                     Initialization Vector                     ~ E
|                                                               | n
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ c ^
|                                                               | r |
~             Inner Payloads (not yet encrypted)                ~   P
|                                                               | P |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ l v
~              Padding (0-255 octets)           |  Pad Length   | d
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
|                                                               | |
~                    Integrity Checksum Data                    ~ |
|                                                               | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ v

      Figure 10: Data to Authenticate in the GSA_REKEY Messages

the authentication data gets calculated using the authentication algorithm from the Group Controller Authentication Method transform (Section 4.4.2.1.1) and the current authentication key given in the AUTH_KEY attribute (Section 4.5.3.2) ๐Ÿ” then the calculated authentication data goes into the AUTH payload, the Length fields in the IKE header and the Encryption Payload header get restored, the content of the Encrypted payload is encrypted, and the ICV is computed using the current KEK ๐ŸŽ€ slay ๐Ÿ’–

2.4.1.2. IKE Fragmentation โœจ

Okay so, IKEv2 fragmentation [RFC7383] can be used to chop up big GSA_REKEY messages ๐Ÿงฉ, BUT there's a catch bestie. When the GSA_REKEY message goes out as an IP multicast packet, the GMs don't really send anything back ๐Ÿ™ˆ. That causes a few things, and they're kind of a big deal ๐Ÿ’€

  • Policy about IKE fragmentation is implicit. If a GCKS sees that every GM has negotiated support for IKE fragmentation in IKE_SA_INIT, then it MAY use IKE fragmentation on big GSA_REKEY messages ๐ŸŽ€.
  • The GCKS has to ALWAYS fragment based on a preconfigured threshold. It can't just send unfragmented messages and wait to see if anyone complains, because nobody responds ๐Ÿ˜ญ. Section 2.5.1 of [RFC7383] has recommendations for picking that threshold ๐ŸŒธ.
  • PMTU can't be used. The Path MTU (PMTU) mechanism, defined in Section 2.5.2 of [RFC7383], is a no-go here because there are no GSA_REKEY response messages to work with ๐Ÿ’….

Now, the authentication data calculation MUST be applied to whole messages only, and that happens before any IKE Fragmentation ๐Ÿ”. If a message came in fragmented, it SHOULD be put back together before its authenticity gets checked, just like it arrived unfragmented โœจ. The RESERVED field in the rebuilt Encrypted Payload header MUST be set to the value of the RESERVED field in the Encrypted Fragment payload header from the first fragment (the one with Fragment Number equal to 1) ๐Ÿฆ‹.

2.4.1.3. GSA_REKEY GCKS Operations ๐Ÿ‘‘

The GCKS builds the rekey message with a Message ID that is one greater than the one in the previous rekey message ๐Ÿ”ข. The first message sent over a new Rekey SA MUST use a Message ID of 0 ๐ŸŒˆ. The GSA, KD, and N payloads follow, with the same characteristics as in the GSA Registration exchange ๐Ÿ’œ. The AUTH payload (if present) is created as defined in Section 2.4.1.1 ๐Ÿซถ.

Here's the tea: GSA_REKEY messages are never acknowledged, and the network could totally drop them ๐Ÿ˜ฌ. So some GMs might miss the new policy entirely ๐Ÿ’€. To help with that, during a rekey event the GCKS MAY send several copies of an encrypted GSA_REKEY message with the new policy ๐Ÿ“. The retransmitted copies MUST be bitwise identical, and they SHOULD go out within a short time window (a few seconds) ๐Ÿงš. That keeps the SA lifetime math from getting messed up for GMs who would otherwise receive different copies โฑ๏ธ.

The GCKS MAY also include one or several GSA_NEXT_SPI attributes, which specify SPIs for the upcoming rekeys ๐Ÿ”ฎ. That way listening GMs can notice when a rekey message got lost and recover from it ๐Ÿ’–. See Section 4.4.2.2.3 for more detail ๐Ÿ“–.

2.4.1.4. GSA_REKEY GM Operations ๐ŸŽ€

When a GM gets the rekey message from the GCKS, it decrypts it and checks its integrity using the current KEK ๐Ÿ”“. If the AUTH payload is in the decrypted message, the GM validates authenticity using the key it got in an earlier G-IKEv2 exchange โœ…. Then it checks the Message ID and processes the GSA and KD payloads ๐Ÿ’…. After that, it installs the new Data-Security SA(s) and/or a new Rekey SA ๐Ÿฆ‹. Parsing the payloads is identical to what happens in the registration exchange, so no new drama there ๐ŸŒธ.

Replay protection works like this: a GM REJECTS any GSA_REKEY message whose Message ID is smaller than the current Message ID it's expecting ๐Ÿšซ. For the first GSA_REKEY message it gets, the GM expects a Message ID equal to or greater than the one it received in the GSA_INITIAL_MESSAGE_ID attribute ๐Ÿ‘‘. If the GSA_INITIAL_MESSAGE_ID attribute wasn't received for the Rekey SA, the GM MUST assume zero as the first expected Message ID ๐Ÿ”ข. For later GSA_REKEY messages, the GM expects a Message ID greater than the last valid GSA_REKEY message ID it received ๐Ÿ’œ.

This spec assumes that GSA_REKEY messages go out at intervals way bigger than normal network packet reordering intervals ๐ŸŒŠ.

If the GSA payload includes a Data-Security SA using a counter-mode cipher, and the receiving GM is a sender for that SA, the GM uses its current Sender-ID value with the Data-Security SAs to build counter-mode nonces ๐Ÿ”. If it's a sender and doesn't have a current Sender-ID value (for example, when no counter-mode is used for other Data-Security SAs), it MUST NOT install the Data-Security SAs ๐Ÿ™…โ€โ™€๏ธ. It MUST start a re-registration with the GCKS to get a Sender-ID value (along with the current group policy) ๐Ÿ”.

Once a new Rekey SA is installed because of a GSA_REKEY message, the current Rekey SA (the one the message came in on) MUST be silently deleted after waiting the DEACTIVATION_TIME_DELAY interval, no matter when it would have expired โณ. If the message has a Delete payload for an existing Data-Security SA, then after installing the new Data-Security SA, the old one (identified by the Protocol and SPI fields in the Delete payload) MUST be silently deleted after waiting the DEACTIVATION_TIME_DELAY interval, regardless of its expiration time ๐Ÿ—‘๏ธ.

If a Data-Security SA hasn't been rekeyed yet and is about to expire (a "soft lifetime" expiration, described in Section 4.4.2.1 of [RFC4301]), the GM SHOULD start a registration with the GCKS ๐Ÿš€. That registration acts as a request for current SAs and will download replacement SAs, assuming the GCKS policy created them ๐ŸŽ. A GM SHOULD also start a registration request if a Rekey SA is about to expire and hasn't been replaced yet โฐ.

2.4.2. GSA_INBAND_REKEY Exchange ๐Ÿ’Œ

When the IKE SA protecting the member registration exchange is still up while a GM is in the group, the GCKS can use the GSA_INBAND_REKEY exchange to send policy updates to that GM one-on-one ๐Ÿซถ.

 GM (Responder)               GCKS (Initiator)
----------------             ------------------
                     <--    HDR, SK{GSA, KD, [N]}
HDR, SK{}            -->

                Figure 11: GSA_INBAND_REKEY Exchange

Since this is a normal IKEv2 exchange, the HDR is treated as defined in IKEv2 [RFC7296] ๐Ÿ“š.

2.4.2.1. GSA_INBAND_REKEY GCKS Operations ๐Ÿ› ๏ธ

The GSA, KD, and N payloads are built the same way as in a registration exchange ๐Ÿ’….

2.4.2.2. GSA_INBAND_REKEY GM Operations ๐Ÿง 

The GM processes the GSA, KD, and N payloads the same way it would if they came in a registration exchange ๐ŸŒธ.

2.4.3. Deletion of SAs ๐Ÿ—‘๏ธ

Sometimes the GCKS wants to tell GMs to delete policy, like when the application sending data traffic is done or when group policy has changed ๐Ÿ™ˆ. Deleting SAs is done by sending the Delete Payload described in Section 3.11 of [RFC7296] as part of the GSA_REKEY pseudo-exchange, like this ๐Ÿ‘‡.

 GMs (Receivers)            GCKS (Sender)
----------------          ---------------
                    <--   HDR, SK{D, [N,] [AUTH]}

                 Figure 12: SA Deletion in GSA_REKEY

If the GCKS has a unicast SA with a GM, it can use the GSA_INBAND_REKEY exchange to delete SAs ๐Ÿ’Œ.

 GM (Responder)                GCKS (Initiator)
---------------              ------------------
                      <--    HDR, SK{D, [N]}
HDR, SK{}            -->

              Figure 13: SA Deletion in GSA_INBAND_REKEY

Sometimes the GCKS wants to start over with a clean slate, for example if it runs out of available Sender-IDs ๐Ÿงน. It can signal deletion of ALL the Data-Security SAs by sending a Delete payload with an SPI value of zero ๐Ÿ’ฅ. So if the GCKS wants to remove the Rekey SA and all the Data-Security SAs, it sends a Delete payload with an SPI of zero and a Protocol ID of AH or ESP, followed by another Delete payload with an SPI of zero and a Protocol ID of GIKE_UPDATE ๐Ÿซฃ.

If a GM gets a Delete payload with zero SPI and a Protocol ID of GIKE_UPDATE, that means the GM has been excluded from the group ๐Ÿ˜ฑ. That Delete payload can show up in either the GSA_REKEY pseudo-exchange or the GSA_INBAND_REKEY exchange ๐Ÿ™…โ€โ™€๏ธ. In this situation the GM MUST re-register if it wants to keep participating in the group ๐Ÿ”. The registration works as described in Section 2.3 ๐Ÿ“. It is RECOMMENDED that a GM waits a randomly chosen amount of time before starting a registration request in this situation, so the GCKS doesn't get overloaded ๐ŸŒŠ. This document doesn't specify the maximum delay (it's implementation-dependent), but it's believed that a delay on the order of seconds suits most situations โณ. If the unicast SA between the GM and the GCKS exists, the GM may use the GSA_REGISTRATION exchange to re-register ๐Ÿ’œ. However, after excluding a GM from the group, the GCKS MAY immediately delete the unicast SA with that GM (if there is one) if that GM's credentials have been revoked ๐Ÿšซ.

2.5. Counter-Based Modes of Operation ๐Ÿ”ข

Several counter-based modes of operation have been specified for ESP (e.g., AES-CTR [RFC3686], AES-GCM [RFC4106], AES-CCM [RFC4309], ChaCha20-Poly1305 [RFC7634], and AES-GMAC [RFC4543]) and for AH (e.g., AES-GMAC [RFC4543]) ๐ŸŽ€. These counter-based modes require that no two senders in the group EVER send a packet with the same IV using the same cipher key and mode ๐Ÿ˜ณ. This requirement is met in G-IKEv2 when the following measures are taken ๐Ÿซถ:

  • The GCKS distributes a unique key for each Data-Security SA. ๐Ÿ”‘
  • The GCKS uses the method described in [RFC6054], which gives each sender a portion of the IV space by provisioning each sender with one or more unique Sender-ID values. ๐Ÿฆ‹

2.5.1. Allocation of Sender-ID ๐Ÿฆ‹

When at least one Data-Security SA included in the group policy includes a counter-based mode of operation, the GCKS automatically allocates and distributes one Sender-ID to each GM acting in the role of sender on the Data-Security SA. ๐Ÿ’– The Sender-ID value is used exclusively by the group sender to which it was allocated. The group sender uses the same Sender-ID for each Data-Security SA specifying the use of a counter-based mode of operation. A GCKS MUST distribute unique keys for each Data-Security SA, including a counter-based mode of operation in order to maintain unique key and nonce usage. โœจ Okay, that last bit is literally the whole point, bestie ๐Ÿ”ฅ

During registration, the group sender can choose to request one or more Sender-ID values. Requesting a value of 1 is not necessary since the GCKS will automatically allocate exactly one to the group sender. ๐Ÿ’… A group sender MUST request as many Sender-ID values matching the number of encryption modules in which it will be installing the TEKs in the outbound direction. Alternatively, a group sender MAY request more than one Sender-ID and use them serially. This could be useful when it is anticipated that the group sender will exhaust their range of Data-Security SA nonces using a single Sender-ID too quickly (e.g., before the time-based policy in the TEK expires). ๐ŸŒธ Basically, if your nonces are gonna run out before your TEK expires, grab extra IDs. Lowkey smart.

When the group policy includes a counter-based mode of operation, a GCKS should use the following method to allocate Sender-ID values, which ensures that each Sender-ID will be allocated to just one group sender. ๐Ÿงš

  1. A GCKS maintains a Sender-ID counter, which records the Sender-IDs that have been allocated. Sender-IDs are allocated sequentially with zero as the first allocated value.
  2. Each time a Sender-ID is allocated, the current value of the counter is saved and allocated to the group sender. The Sender-ID counter is then incremented in preparation for the next allocation.
  3. When the GCKS specifies a counter-based mode of operation in the Data-Security SA, a group sender may request a count of Sender-IDs during registration in a Notify payload information of type SENDER. When the GCKS receives this request, it increments the Sender-ID counter once for each requested Sender-ID and distributes each Sender-ID value to the group sender. The GCKS should have a policy-defined upper bound for the number of Sender-ID values that it will return irrespective of the number requested by the GM. ๐Ÿ“ So the server gets to cap it, no matter how greedy the GM is. Iconic.
  4. A GCKS allocates new Sender-ID values for each registration operation by a group sender, regardless of whether the group sender had previously contacted the GCKS. In this way, the GCKS is not required to maintain a record of which Sender-ID values it had previously allocated to each group sender. More importantly, since the GCKS cannot reliably detect whether the group sender had sent data on the current group Data-Security SAs, it does not know what Data-Security counter-mode nonce values that a group sender has used. By distributing new Sender-ID values, the key server ensures that each time a conforming group sender installs a Data-Security SA, it will use a unique set of counter-based mode nonces. ๐Ÿซถ The vibe: new registration, new ID, fresh nonces. No drama.
  5. When the Sender-ID counter maintained by the GCKS reaches its final Sender-ID value, no more Sender-ID values can be distributed. Before distributing any new Sender-ID values, the GCKS MUST exclude all GMs from the group as described in Section 2.4.3. This will result in the GMs performing re-registration, during which they will receive new Data-Security SAs and group senders will additionally receive new Sender-ID values. The new Sender-ID values can safely be used because they are only used with the new Data-Security SAs. ๐Ÿ˜ญ The GCKS has to kick everyone out to reset the whole thing. Big energy, but it's safe ๐Ÿ’€

2.5.2. GM Usage of Sender-ID ๐Ÿ’œ

A GM applies the Sender-ID to Data-Security SAs as follows:

  • The most significant bits of the IV indicated in the GWP_SENDER_ID_BITS attribute (Section 4.4.3.1.2) are taken to be the Sender-ID field of the IV.
  • The Sender-ID is placed in the least significant bits of the Sender-ID field, where any unused most significant bits are set to zero. If the Sender-ID value doesn't fit into the number of bits from the GWP_SENDER_ID_BITS attributes, then the GM MUST treat this as a fatal error and re-register to the group. ๐Ÿ™ˆ Not fitting = fatal, no cap.

2.6. Replay Protection for Multicast Data-Security SAs ๐ŸŒˆ

IPsec provides anti-replay service as part of its security services. With multicast extensions for IPsec, replay protection is not always possible to achieve (see Section 6.1 of [RFC3740]). In particular, if there are many group senders for a Data-Security SA, then each of them will independently increment the Sequence Number field in the ESP header (see Section 2.2 of [RFC4303] and Section 2.5 of [RFC4302]), thus making it impossible for the group receivers to filter out replayed packets. However, if there is only one group sender for a Data-Security SA, then it is possible to achieve replay protection with some restrictions (see Section 4.4.2.1.3). The GCKS MAY create several Data-Security SAs with the same traffic selectors allowing only a single group sender in each SA if it is desirable to get replay protection with multiple (but still a limited number) of group senders. โญ

IPsec architecture assumes that whether anti-replay service is enabled or not is a local matter for an IPsec receiver. In other words, an IPsec sender always increments the Sequence Number field in the ESP/AH header and a receiver decides whether to check for replayed packets or not. Since it is known in some cases that the replay protection is not possible (like in an SA with many group senders), a new Transform ID "32-bit Unspecified Numbers" is defined for the Sequence Numbers (SNs) Transform Type. Using this Transform ID, the GCKS can inform GMs that the uniqueness of sequence numbers for a given SA is not guaranteed. The decision of whether to enable anti-replay service is still a local matter of a GM (in accordance with IPsec architecture). ๐ŸŽ€

The GCKS MUST include the Sequence Numbers transform in the GSA payload for every Data-Security SA. See Section 4.4.2.1.3 for more details.

When a Data-Security SA has a single sender, the GCKS MUST be configured to rekey the SA frequently enough so that the 32-bit sequence numbers do not wrap. ๐Ÿ‘‘

2.7. Encryption Transforms with Implicit IV ๐Ÿฆ‹

The "Transform Type 1 - Encryption Algorithm Transform IDs" IANA registry [IKEV2-IANA] defines several transforms with implicit IV. These transforms rely on ESP Sequence Numbers for constructing IV (see [RFC8750] for details). It requires anti-replay service to be enabled for an ESP SA using these encryption transforms. Unless the properties of sequence numbers for a multicast ESP SA include their uniqueness (see Section 2.6), encryption transforms that rely on Sequence Numbers for IV construction MUST NOT be used. In any case, such transforms MUST NOT be used for any G-IKEv2 SA (both unicast and multicast). ๐Ÿ™…โ€โ™€๏ธ

Two MUST NOTs in one paragraph, so this is a hard no. Don't even think about it ๐Ÿ˜ค

3. Group Key Management and Access Control ๐ŸŽ€

Through the G-IKEv2 rekey, G-IKEv2 supports algorithms such as Logical Key Hierarchy (LKH) that have the property of denying access to a new group key by a member removed from the group (forward access control) and to an old group key by a member added to the group (backward access control). This is unrelated to the Perfect Forward Secrecy (PFS) property as defined in Section 2.12 of [RFC7296]. ๐Ÿ” Different thing, don't mix them up!

Group management algorithms providing forward and backward access control other than LKH have also been proposed, for example, OFT [OFT] and Subset Difference [NNL]. These algorithms could be used with G-IKEv2 but are not specified as a part of this document. ๐ŸŒธ

This specification assumes that all group keys, that are sent to the GMs by the GCKS, are encrypted with some other keys, called Key Wrap Keys (KWKs). The Key Wrap Algorithm transform defines the algorithm used for key wrapping in the context of an SA. ๐Ÿ“

3.1. Key Wrap Keys ๐Ÿ’–

Every GM always knows at least one KWK -- the KWK that is associated with the IKE SA or multicast Rekey SA over which wrapped keys are sent. In this document, it is called default KWK and is denoted as "GSK_w". ๐Ÿงš

For the purpose of forward access control, the GCKS may provide each GM with its personal KWK at the time of registration. Additionally, several intermediate KWKs that form a key hierarchy and are shared among several GMs may be provided by the GCKS. โœจ

Each KWK is associated with a key wrap algorithm specified in the Key Wrap Algorithm transform. The size of these KWKs is determined by the key wrap algorithm used, but it SHOULD NOT be less than the size of the key for the Encryption Algorithm transform for the Rekey SA and for all Data-Security SAs in the group (taking the Key Length attribute into consideration if it is present). ๐Ÿ™ƒ Don't go smaller than the keys they're protecting, okay?

3.1.1. Default Key Wrap Key ๐ŸŒท

The default KWK (GSK_w) is only used in the context of a single IKE SA. Every IKE SA (unicast IKE SA or multicast Rekey SA) will have its own GSK_w. ๐Ÿ’œ

For the unicast IKE SA (used for the GM registration and for GSA_INBAND_REKEY exchanges if they appear), the GSK_w is computed as follows:

GSK_w = prf+(SK_d, "Key Wrap for G-IKEv2")

where the string "Key Wrap for G-IKEv2" is 20 ASCII characters without null termination. ๐Ÿ”ข

For the multicast Rekey SA, the GSK_w is provided along with other SA keys as defined in Section 3.4. ๐ŸŒˆ

3.2. GCKS Key Management Semantics ๐Ÿ‘‘

The Wrapped Key Download method allows the GCKS to employ various key management methods. ๐ŸŽ€

  • A simple key management method: The GCKS always sends group SA keys encrypted with the GSK_w.
  • An LKH key management method: The GCKS provides each GM with an individual key at the time of the GM registration (encrypted with GSK_w). Then, the GCKS forms a hierarchy of keys so that the group SA keys are encrypted with other keys that are encrypted with other keys and so on, tracing back to the keys for each GM. ๐ŸŒณ
  • Other key policies may also be employed by the GCKS. ๐Ÿฆ„

3.2.1. Forward Access Control Requirements โœจ

Okay so, when group membership changes through a group management algorithm, you usually also need new Data-Security SAs and their keys ๐Ÿ”‘. Fresh SAs and keys are what make sure members who got denied access can't keep participating in the group ๐Ÿšซ.

If forward access control is something the group wants, then a new TEK policy and its associated keys MUST NOT be included in a G-IKEv2 rekey message that changes group membership ๐Ÿ™…โ€โ™€๏ธ. The reason is that the GSA TEK policy and its keys aren't protected with the new KEK. A second G-IKEv2 rekey message can deliver the new GSA TEK policies and their keys, though ๐Ÿ’…. It's protected with the new KEK, so the members who were denied access won't be able to see it at all ๐Ÿ‘€.

If the group's forward access control policy includes keeping group policy changes away from denied members, then the GCKS MUST send two sequential G-IKEv2 rekey messages that change the group KEK ๐ŸŽ€. The first one makes a brand-new KEK for the group. Denied GMs can't get into that new KEK, but they can still see the group policy, because that message is protected under the current KEK ๐Ÿ˜ฌ. The next rekey message carries the changed group policy and changes the KEK again, and that's what gives you complete forward access control ๐Ÿ™Œ. Oh, and a G-IKEv2 rekey message MUST NOT change the policy without creating a new KEK. Non-negotiable ๐Ÿ’€.

If other LKH methods or other group management algorithms get added to G-IKEv2, those methods MAY drop the restrictions above that require multiple rekey messages ๐Ÿฆ‹. They just have to spell out how the forward access control policy stays maintained within a single G-IKEv2 rekey message ๐Ÿงš.


3.3. GM Key Management Semantics

The GM Key Management semantics are written so they don't depend on which key management method the GCKS uses ๐Ÿง . All the complicated key stuff lives in the GCKS, which is free to do things like sending group SA keys directly or using some kind of key hierarchy (e.g., LKH) ๐ŸŒณ. The GM behaves the same way no matter which of these policies is in play ๐Ÿ’œ.

All keys in G-IKEv2 are sent in encrypted form, as described in Section 4.5.4 ๐Ÿ”. That format has a 32-bit Key ID (the ID of the key being encrypted) and a 32-bit KWK ID (the ID of the key that was used to encrypt it) โœจ. Keys can be encrypted with the default KWK (GSK_w) or with other keys that the GM got in the WRAP_KEY attributes ๐ŸŽ. If a key was encrypted with GSK_w, the KWK ID field is set to zero. Otherwise, the KWK ID field tells you which key was used for the encryption ๐Ÿ—๏ธ. A zero Key ID always identifies the key that the keys for protecting Data-Security SAs and Rekey SA are taken from ๐Ÿ‘‘.

When a GM gets a message from the GCKS that installs a new Data-Security or Rekey SA, it has a KD payload with an SA_KEY attribute holding the keying material for that SA ๐Ÿ“ฆ. For a Data-Security SA, there's exactly one SA_KEY attribute, and both its Key ID and KWK ID fields are set to zero. So the default KWK (GSK_w) should be used to pull out this keying material ๐Ÿซถ.

For a multicast Rekey SA, there might be multiple SA_KEY attributes, depending on the key management method the GCKS is using ๐ŸŒˆ. If there are multiple SA_KEY attributes, then all of them MUST contain the same keying material, just encrypted with different KWKs ๐Ÿ“. The GM doesn't usually know which key management method the GCKS picked, so it can always follow the same procedure to get the keys ๐Ÿ™Œ. The GM tries to decrypt at least one SA_KEY attribute using either GSK_w or the keys from the WRAP_KEY attributes that are in the same message or came in earlier messages ๐Ÿ”“.

We'll use the term "Key Path" for an ordered sequence of keys where each key after the first was used to encrypt the one before it ๐Ÿงฉ. The GM keeps its own Key Path (called Working Key Path) in the memory tied to each group it's registered to, and it updates that path when needed ๐Ÿ’พ. When a GSA_REKEY message arrives, the GM goes through the received SA_KEY attributes one at a time and tries to build a new key path. That path starts at one of these attributes and ends with any key in the Working Key Path or with the default KWK (GSK_w) ๐Ÿ›ค๏ธ.

In the simplest case, the SA_KEY attribute is encrypted with GSK_w, so the new Key Path is empty ๐Ÿ˜Œ. With fancier key management methods, a Key Path holds intermediate keys from the WRAP_KEY attributes the GM has received so far, starting from when it registered to the group ๐Ÿชœ. If the GM can build a new Key Path using the intermediate keys it has, then it can decrypt the SA_KEY attribute and use what's inside to make new SA keys ๐Ÿฅณ. If it can't build a new Key Path, that means the GM has been excluded from the group ๐Ÿšช.

Depending on the new Key Path, the GM should take these steps to get ready for future key updates ๐ŸŒธ:

  • If the new Key Path is empty, then no actions are needed. This can happen if no WRAP_KEY attributes from the received message were used.
  • If the new Key Path is non-empty and it ends with the default KWK (GSK_w), then the GM stores the whole new Key Path as its Working Key Path. This only happens when the GM is registering to the group, because that's when the GCKS hands over the GM's personal key and the other keys from the key tree it needs. Those keys make up the GM's first Working Key Path ๐ŸŒŸ.
  • In all other cases, the new Key Path ends at some intermediate key from the GM's current Working Key Path. Here, the new Key Path is built by replacing part of the GM's current Working Key Path, starting from the beginning and going up to (but not including) the key the GM used to decrypt the last key in the new Key Path ๐Ÿ”„.

Appendix A has an example of how this algorithm works with the LKH key management method ๐Ÿ“–.


3.4. SA Keys

The keys used for Data-Security SAs or a Rekey SA (called SA keys here) get downloaded to GMs as keying material ๐Ÿ“ฅ. From that material, a set of keys is deterministically extracted, according to policy ๐ŸŽฏ.

For a Data-Security SA, the keys are taken according to the third bullet in Section 2.17 of [RFC7296] ๐Ÿ’–. Specifically, for the ESP and AH SAs, the encryption key (if there is one) MUST be taken from the leftmost bits of the keying material, and the integrity key (if there is one) MUST be taken from the remaining bits ๐Ÿช„.

For a Rekey SA, these keys are taken from the keying material ๐Ÿ”‘:

GSK_e | GSK_a | GSK_w = KEYMAT

Here, GSK_e and GSK_a are the keys used for the Encryption Algorithm and Integrity Algorithm transforms, respectively, for the corresponding SA, and GSK_w is a default KWK for this SA ๐Ÿ’œ. Note that GSK_w gets used with the key wrap algorithm specified in the Key Wrap Algorithm transform ๐ŸŽ€. If an AEAD algorithm is used for encryption, then GSK_a won't be used at all. (A GM can use the formula above, assuming the length of GSK_a is zero) ๐Ÿ™ˆ.


4. Header and Payload Formats โœจ

G-IKEv2 is an IKEv2 extension, so it inherits IKEv2's wire format for data structures ๐Ÿง. The processing of some payloads is different, though. Several new payloads are defined: Group Identification (IDg) (Section 4.2), Security Association - GM Supported Transforms (SAg) (Section 4.3), Group Security Association (GSA) (Section 4.4), and Key Download (KD) (Section 4.5) ๐ŸŒท. The G-IKEv2 header (Section 4.1), the IDg payload, and the SAg payload reuse the IKEv2 formats for the IKEv2 header, the IDi/IDr payloads, and the SA payload, respectively ๐Ÿ”. New exchange types GSA_AUTH, GSA_REGISTRATION, GSA_REKEY, and GSA_INBAND_REKEY get added too ๐Ÿ†•.

This section covers the new payloads and how existing IKEv2 payloads are processed differently ๐Ÿฆ‹.

4.1. G-IKEv2 Header

G-IKEv2 uses the same IKE header format as specified in Section 3.1 of [RFC7296] ๐Ÿ“. The Major Version is 2 and the Minor Version is 0, same as IKEv2. The IKE SA Initiator's SPI, IKE SA Responder's SPI, Flags, Message ID, and Length are all as specified in [RFC7296] โœ….

4.2. Group Identification Payload

The Group Identification (IDg) payload lets the GM say which group it wants to join ๐Ÿซง. It's built using the IKEv2 Identification Payload (Section 3.5 of [RFC7296]) ๐Ÿงธ. The ID type ID_KEY_ID MUST be supported ๐Ÿ”‘. The ID types ID_IPV4_ADDR, ID_FQDN, ID_RFC822_ADDR, and ID_IPV6_ADDR SHOULD be supported ๐ŸŒ. The ID types ID_DER_ASN1_DN and ID_DER_ASN1_GN aren't expected to be used ๐Ÿ™…โ€โ™€๏ธ. The Payload Type for the IDg payload is fifty (50) ๐Ÿ”ข.

4.3. Security Association - GM Supported Transforms Payload

The Security Association - GM Supported Transforms (SAg) payload declares which Transforms a GM is willing to accept ๐Ÿ’…. It's built using the format of the IKEv2 Security Association payload (Section 3.3 of [RFC7296]) ๐Ÿงฉ. The Payload Type for SAg payloads is thirty-three (33), which is the same as the SA Payload Type ๐ŸŒˆ.

4.4. Group Security Association Payload

The GSA payload is how the GCKS asserts security attributes for both Rekey and Data-Security SAs ๐Ÿ‘‘. The Payload Type for the GSA payload is fifty-one (51) ๐ŸŽ€.

                        1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Next Payload  |C|   RESERVED  |         Payload Length        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   ~                       <Group Policies>                        ~
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Figure 14: GSA Payload Format

The GSA payload fields are defined like this ๐Ÿ“:

  • Next Payload, C, RESERVED, and Payload Length fields: These make up the IKEv2 generic payload header and are defined in Section 3.2 of [RFC7296] ๐Ÿงพ.
  • Group Policies (variable): A set of group policies for the group ๐Ÿ’œ.

4.4.1. Group Policies โœจ

okay so group policies come in two flavors ๐Ÿ“: group SA policy and group-wide (GW) policy. Group SA policy sets the parameters for the group's Security Association. Depending on the security protocol, that can be a Rekey SA (GSA KEK) policy or a Data-Security (GSA TEK) SA policy. A GSA payload can carry zero or one GSA KEK policy, zero or more GSA TEK policies, and zero or one GW policy. One thing is locked in: either one GSA KEK or one GSA TEK policy MUST be present. ๐Ÿ”’

the flexibility here is so good ๐Ÿฅน For example, if the group policy doesn't need a Rekey SA, the GCKS doesn't have to send a GSA KEK policy to the group member, because every SA update can go through the GSA_INBAND_REKEY exchange over the unicast IKE SA. Or the group policy might use a Rekey SA but only hand a KEK to the GM as part of the unicast IKE SA. In that case the GSA KEK policy isn't needed in the GSA_REKEY message. ๐Ÿ’…

multiple GSA TEKs are giving multi-stream energy ๐ŸŽ€. You can tie several related data streams (video, audio, and text) to one session, but each one still gets its own individual Security Association. ๐Ÿฆ‹

a GW policy is where the group-wide rules live, like instructions for when to activate and deactivate SAs. ๐ŸŒธ

policies are shipped as substructures inside the GSA payload. The group SA substructure format is in Section 4.4.2, and the GW policy format is in Section 4.4.3. The first octet of a substructure tells you exactly what type it is: it's zero for GW policy, and non-zero (technically it holds a Security Protocol Identifier) for group SA policies. no confusion, no drama โœจ

4.4.2. Group Security Association Policy Substructure

this substructure holds the parameters for one SA used with this group ๐Ÿงš. Depending on the security protocol, that SA is either a Rekey SA or a Data-Security SA (ESP and AH). The GCKS MUST NOT distribute both ESP and AH policies for the same set of Traffic Selectors. ๐Ÿšซ absolutely not, bestie ๐Ÿ’€

                     1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Protocol   |   SPI Size    |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                              SPI                              ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                  Source Traffic Selector                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                Destination Traffic Selector                   ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                    <Group SA Transforms>                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                    <Group SA Attributes>                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Figure 15: Group SA Policy Substructure Format

here's the rundown on each field ๐Ÿซถ

  • Protocol (1 octet): says which security protocol this group SA belongs to. The values come from the "IKEv2 Security Protocol Identifiers" registry in [IKEV2-IANA]. The valid values are 6 (GIKE_UPDATE) for a Rekey SA, and 2 (AH) or 3 (ESP) for Data-Security SAs. โœจ
  • SPI Size (1 octet): the size of the SPI for the SA, which depends on the SA protocol. It's 16 octets for GIKE_UPDATE and 4 octets for AH and ESP. ๐Ÿ”ข
  • Length (2 octets, unsigned integer): the length of this substructure, header included. ๐Ÿ“
  • SPI (variable): the Security Parameter Index for the group SA. Its size is set by the SPI Size field. As mentioned above, the GCKS assigns these. For GIKE_UPDATE, the SPI is the IKEv2 header SPI pair. The first 8 octets become the "IKE SA Initiator's SPI" field in the G-IKEv2 rekey message IKEv2 HDR, and the second 8 octets become the "IKE SA Responder's SPI" in that same HDR. ๐Ÿฆ‹
  • Source & Destination Traffic Selectors (variable): substructures describing the source and destination of the network identities. Their format is defined in IKEv2 (Section 3.13.1 of [RFC7296]). ๐ŸŽฏ
    • For the Rekey SA (with the GIKE_UPDATE protocol), the destination traffic selectors MUST define a single multicast IP address, an IP protocol (assumed to be UDP), and a single port that the GSA_REKEY messages will be destined to. In this case, the source traffic selector SHOULD define a single IP address, an IP protocol (assumed to be UDP), and a single port that the GSA_REKEY messages will be originated from. The source traffic selector MAY define a wildcard IP address and/or wildcard port. ๐ŸŒˆ
    • For the Data-Security (AH and ESP) SAs, the destination traffic selectors will usually define a single multicast IP address. The source traffic selector in this case will usually define a single IP address or be a wildcard selector. An IP protocol and ports define the characteristics of the traffic protected by this Data-Security SA. ๐Ÿ’œ
    • If the Data-Security SAs are created in tunnel mode, then it MUST be tunnel mode with address preservation (see Multicast Extensions to the Security Architecture [RFC5374]. UDP encapsulation of ESP packets [RFC3948] cannot be specified in G-IKEv2, so it isn't used for the multicast Data-Security SAs. ๐Ÿ™…โ€โ™€๏ธ
  • Group SA Transforms (variable): a list of Transform Substructures that specifies the policy information for the SA. Their format is defined in IKEv2 (Section 3.3.2 of [RFC7296]). The "Last Substruc" field in each Transform Substructure is set to 3, except in the last one, where it's set to 0. Section 4.4.2.1 explains how to use IKEv2 transforms in the group SA policy substructure. ๐Ÿงฉ
  • Group SA Attributes (variable): policy attributes tied to the group SA. The following sections describe the possible attributes. Any or all of them may be optional, depending on the protocol and the group policy. Section 4.4.2.2 defines the attributes used in the group SA policy substructure. ๐Ÿฐ

4.4.2.1. Group SA Transforms

group SA policy is defined using transforms ๐Ÿ”ง. The transforms from [RFC7296] are used here. G-IKEv2 also adds two new Transform Types: Group Controller Authentication Method (GCAUTH) and Key Wrap Algorithm (KWA). See Section 9 for those. ๐Ÿ‘‘

which Transform Types are valid depends on the SA protocol, and the table below sums it up. Exactly one instance of each mandatory Transform Type, and at most one instance of each optional Transform Type, MUST be present in the group SA policy substructure. Same energy as a perfectly planned outfit ๐Ÿ’…

      +=============+=============================+================+
      | Protocol    | Mandatory Types             | Optional Types |
      +=============+=============================+================+
      | GIKE_UPDATE | ENCR, INTEG*, GCAUTH**, KWA |                |
      +-------------+-----------------------------+----------------+
      | ESP         | ENCR, SN                    | INTEG          |
      +-------------+-----------------------------+----------------+
      | AH          | INTEG, SN                   |                |
      +-------------+-----------------------------+----------------+

Table 2: Valid Transform Types

notes time ๐Ÿ“

  • (*): If the AEAD encryption algorithm is used, then the INTEG transform either MUST NOT be specified or MUST contain the value NONE. Otherwise, it MUST be specified and MUST contain a value other than NONE. โš ๏ธ
  • (**): this one only shows up when a GM is registering, during the GSA_AUTH and GSA_REGISTRATION exchanges. ๐Ÿ™ˆ

4.4.2.1.1. Group Controller Authentication Method Transform ๐Ÿ”

okay so this transform is all about how the GCKS proves to the GMs that its GSA_REKEY messages are legit, bestie ๐Ÿ’… it's giving security checkpoint โœจ

The Group Controller Authentication Method (GCAUTH) transform is used to convey information on how the GCKS will authenticate the GSA_REKEY messages. ๐Ÿซถ

This document creates a new IKEv2 IANA registry for Transform IDs of this Transform Type, which has been initially populated as described in Section 9. In particular, the following entries have been added:

+=======+========================================+
| Value | Group Controller Authentication Method |
+=======+========================================+
| 0     | Reserved                               |
+-------+----------------------------------------+
| 1     | Implicit                               |
+-------+----------------------------------------+
| 2     | Digital Signature                      |
+-------+----------------------------------------+

Table 3: Group Controller Authentication Method Transform IDs ๐ŸŒธ

These Transform IDs are defined as follows:

Implicit ๐Ÿฆ‹ No authentication of the GSA_REKEY messages will be provided by the GCKS besides the ability for the GMs to correctly decrypt them and verify their ICV. In this case, the GCKS MUST NOT include the AUTH_KEY attribute into the KD payload. Additionally, the AUTH payload MUST NOT be included in the GIKE_UPDATE messages.

Digital Signature ๐Ÿ’– Digital signatures will be used by the GCKS to authenticate the GSA_REKEY messages. In this case, the GCKS MUST include the AUTH_KEY attribute containing the public key into the KD payload at the time the GM is registered to the group. To specify the details of the signature algorithm, a new attribute Signature Algorithm Identifier (value 18) is defined. This attribute contains DER-encoded ASN.1 object AlgorithmIdentifier, which specifies the signature algorithm and the hash function that the GCKS will use for authentication. The AlgorithmIdentifier object is defined in Section 4.1.1.2 of [RFC5280]. Also, see [RFC7427] for the list of common AlgorithmIdentifier values used in IKEv2. ๐Ÿงš

In the case of the Digital Signature Transform ID, the GCKS MUST include the Signature Algorithm Identifier attribute in the Group Controller Authentication Method transform. In this case, the AUTH payload in the GIKE_UPDATE messages MUST contain the Digital Signature authentication method (value 14) and be formatted as defined in Section 3 of [RFC7427]. The AlgorithmIdentifier ASN.1 object in the AUTH payload MUST match the content of the Signature Algorithm Identifier attribute in the Group Controller Authentication Method transform. The Signature Algorithm Identifier attribute is only meaningful for the Digital Signature Transform ID and MUST NOT be used with other Transform IDs. ๐Ÿ“

More authentication methods may be defined in the future. โœจ

The authentication method MUST NOT change as a result of rekey operations. This means that the Group Controller Authentication Method transform MUST NOT appear in the rekey messages; it may only appear in the registration exchange (either GSA_AUTH or GSA_REGISTRATION). ๐Ÿ‘‘

The type of the Group Controller Authentication Method transform is 14.


4.4.2.1.2. Key Wrap Algorithm Transform ๐ŸŽ€

The Key Wrap Algorithm (KWA) transform is used to convey information about an algorithm that is used for key wrapping in G-IKEv2. See Section 4.5.4 for details. ๐Ÿฆ‹

This document creates a new IKEv2 IANA registry for the key wrap algorithms, which has been initially populated as described in Section 9. In particular, the following entries have been added:

+=======+====================+
| Value | Key Wrap Algorithm |
+=======+====================+
| 0     | Reserved           |
+-------+--------------------+
| 1     | KW_5649_128        |
+-------+--------------------+
| 2     | KW_5649_192        |
+-------+--------------------+
| 3     | KW_5649_256        |
+-------+--------------------+
| 4     | KW_ARX             |
+-------+--------------------+

Table 4: Key Wrap Algorithm Transform IDs ๐ŸŒˆ

These algorithms are defined as follows:

KW_5649_128, KW_5649_192, KW_5649_256 ๐Ÿ’œ The key wrap algorithm defined in [RFC5649] with a 128-bit, 192-bit, and 256-bit key, respectively. This key wrap algorithm is designed for use with AES block cipher.

KW_ARX ๐ŸŒธ The ARX-KW-8-2-4-GX key wrap algorithm defined in [ARX-KW]. This key wrap algorithm is designed for use with Chacha20 stream cipher.

More key wrap algorithms may be defined in the future. The requirement is that these algorithms must be able to wrap key material of size up to 256 bytes. โญ

The type of the Key Wrap Algorithm transform is 13. ๐Ÿซถ


4.4.2.1.3. Sequence Numbers Transform ๐Ÿ”ฅ

The Sequence Numbers (SNs) Transform Type is defined in [RFC9827]. This transform describes the properties of sequence numbers of IPsec packets. There are currently two Transform IDs defined for this Transform Type: "32-bit Sequential Numbers" and "Partially Transmitted 64-bit Sequential Numbers" that correspond to non-ESN and ESN cases from AH [RFC4302] and ESP [RFC4303] specifications. ๐Ÿงš

Transform ID "32-bit Sequential Numbers" SHOULD be used by the GCKS for single-sender multicast Data-Security SAs utilizing protocols ESP or AH. ๐Ÿ’…

Since both AH [RFC4302] and ESP [RFC4303] are defined in such a way that high-order 32 bits of extended sequence numbers are never transmitted, it makes using ESN in multicast Data-Security SAs problematic because GMs that join the group long after it is created will have to somehow learn the current high-order 32 bits of ESN for each sender in the group. The algorithm for doing this described in AH [RFC4302] and ESP [RFC4303] is resource-consuming and is only suitable when a receiver is able to guess the high-order 32 bits close enough to its real value, which is not the case for multicast SAs. For this reason, the "Partially Transmitted 64-bit Sequential Numbers" Transform ID MUST NOT be used for multicast Data-Security SAs utilizing protocols ESP or AH. ๐Ÿ™ˆ

This document defines a new Transform ID for this Transform Type: "32-bit Unspecified Numbers" (2). This Transform ID defines the following properties:

  • Sequence numbers are 32 bits in size and are transmitted in the Sequence Number field of AH and ESP packets.
  • The value of sequence numbers is not guaranteed to be unique for the duration of an SA, thus they are not suitable for replay protection.

This Transform ID MUST be used by the GCKS in case of multi-sender multicast Data-Security SAs utilizing protocols ESP or AH to inform the GMs that the replay protection is not expected to be possible. The GCKS MAY also use this Transform ID for single-sender multicast Data-Security SAs if replay protection is not needed (e.g., it is done on the application level). ๐Ÿฆ‹


4.4.2.2. Group SA Attributes ๐ŸŒท

Group SA attributes are generally used to provide GMs with additional parameters for the group SA policy. Unlike security parameters distributed via transforms, which are expected not to change over time (unless the policy changes), the parameters distributed via group SA attributes may depend on the time the provision takes place, on the existence of other group SAs, or on other conditions. ๐Ÿ’–

This document creates a new IKEv2 IANA registry for the types of group SA attributes, which has been initially populated as described in Section 9. In particular, the following attributes have been added:

+=====+========================+======+============+==============+
|Value| Group SA Attributes    |Format|Multi-Valued| Used in      |
|     |                        |      |            | Protocol     |
+=====+========================+======+============+==============+
|0    | Reserved               |                                  |
+-----+------------------------+------+------------+--------------+
|1    | GSA_KEY_LIFETIME       |TLV   |NO          | GIKE_UPDATE, |
|     |                        |      |            | AH, ESP      |
+-----+------------------------+------+------------+--------------+
|2    | GSA_INITIAL_MESSAGE_ID |TLV   |NO          | GIKE_UPDATE  |
+-----+------------------------+------+------------+--------------+
|3    | GSA_NEXT_SPI           |TLV   |YES         | GIKE_UPDATE, |
|     |                        |      |            | AH, ESP      |
+-----+------------------------+------+------------+--------------+

Table 5: Group SA Attributes ๐Ÿ“

The attributes follow the format defined in IKEv2 (Section 3.3.5 of [RFC7296]). The "Format" column defines what attribute format is allowed: Type/Length/Value (TLV) or Type/Value (TV). The "Multi-Valued" column defines whether multiple instances of the attribute can appear. The "Used in Protocol" column lists the security protocols, for which the attribute can be used. โœจ


4.4.2.2.1. GSA_KEY_LIFETIME Attribute โณ

The GSA_KEY_LIFETIME attribute (1) specifies the maximum time for which the SA is valid. The value is a 4-octet unsigned integer in network byte order, specifying a valid time period in seconds. When the lifetime expires, the group SA and all associated keys MUST be deleted. The GCKS may delete the SA at any time before the end of the validity period. ๐Ÿ”ฅ

A single attribute of this type MUST be included into any group SA policy substructure if multicast rekey is employed by the GCKS. This attribute SHOULD NOT be used if inband rekey (via the GSA_INBAND_REKEY exchange) is employed by the GCKS for the GM. ๐Ÿ™ˆ


4.4.2.2.2. GSA_INITIAL_MESSAGE_ID Attribute ๐Ÿงš

The GSA_INITIAL_MESSAGE_ID attribute (2) defines the initial Message ID to be used by the GCKS in the GSA_REKEY messages. The Message ID is a 4-octet unsigned integer in network byte order. ๐Ÿ’œ

A single attribute of this type is included into the GSA KEK policy substructure if the initial Message ID of the Rekey SA is non-zero. Note that it is always true if a GM joins the group after some multicast rekey operations have already taken place in this group. In this case, this attribute will be included into the group SA policy when the GM is registered. ๐ŸŒธ

This attribute MUST NOT be used if inband rekey (via the GSA_INBAND_REKEY exchange) is employed by the GCKS for the GM. ๐Ÿ’…

4.4.2.2.3. GSA_NEXT_SPI Attribute ๐Ÿฆ‹

okay so the optional GSA_NEXT_SPI attribute (3) carries the SPI that the GCKS reserved for the next Rekey SA or Data-Security SAs that will replace the current ones ๐Ÿ”ฎ. The length of the attribute data comes from the SPI Size field in the group SA policy substructure this attribute lives in (see Section 4.4.2), and the attribute data holds the SPI exactly as it would appear on the network ๐ŸŒธ. Multiple attributes of this type MAY be included, which means any of the supplied SPIs can be used in the replacement group SA ๐Ÿ’–.

The GM MAY store these values. Later on, if the GM starts getting messages with one of these SPIs without having seen a rekey message over the current Rekey SA, then that can be a sign the rekey message got lost on its way to this GM ๐Ÿ‘€. In that case, the GM SHOULD re-register to the group ๐Ÿ”.

Note that this way of spotting lost rekey messages can only be used by group receivers ๐ŸŽง. There's also no point in including this attribute in GSA_INBAND_REKEY messages, since those use reliable transport โœจ. Also, the GCKS is totally free to forget its promises and not use the SPIs it sent in earlier GSA_NEXT_SPI attributes (like if the GCKS gets rebooted ๐Ÿ’€), so the GM must only treat this information as a "best effort" made by the GCKS to prepare for future rekeys ๐Ÿซถ.

This attribute MUST NOT be used if inband rekey (via the GSA_INBAND_REKEY exchange) is employed by the GCKS for the GM ๐Ÿšซ.

4.4.3. Group-Wide Policy Substructure ๐ŸŒˆ

Group-specific policy that doesn't belong to any SA policy can be distributed to all GMs using the GW policy substructure ๐Ÿ“ฃ.

The GW policy substructure is defined as follows:

                     1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Protocol   |   RESERVED    |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                      <GW Policy Attributes>                   ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Figure 16: GW Policy Substructure Format

The GW policy substructure fields are defined as follows:

Protocol (1 octet): MUST be zero 0๏ธโƒฃ. This value is reserved (see Section 9) and is never used for any security protocol, so it's used here to show that this substructure contains policy that isn't related to any specific protocol ๐Ÿงš.

RESERVED (1 octet): MUST be zero on transmission and MUST be ignored on receipt ๐Ÿ™ˆ.

Length (2 octets, unsigned integer): Length of this substructure, including the header ๐Ÿ“.

GW Policy Attributes (variable): Contains policy attributes associated with no specific SA. The following sections describe possible attributes. Any or all attributes may be optional depending on the group policy ๐Ÿ’….

4.4.3.1. GW Policy Attributes ๐ŸŽ€

This document creates a new IKEv2 IANA registry for the types of group-wide policy attributes, which has been initially populated as described in Section 9. In particular, the following attributes have been added ๐Ÿ“‹:

      +=======+======================+========+==============+
      | Value | GW Policy Attributes | Format | Multi-Valued |
      +=======+======================+========+==============+
      | 0     | Reserved             |                       |
      +-------+----------------------+--------+--------------+
      | 1     | GWP_ATD              | TV     | NO           |
      +-------+----------------------+--------+--------------+
      | 2     | GWP_DTD              | TV     | NO           |
      +-------+----------------------+--------+--------------+
      | 3     | GWP_SENDER_ID_BITS   | TV     | NO           |
      +-------+----------------------+--------+--------------+

Table 6: GW Policy Attributes

The attributes follow the format defined in the IKEv2 (Section 3.3.5 of [RFC7296]) ๐Ÿงฉ. The "Format" column defines what attribute format is allowed: Type/Length/Value (TLV) or Type/Value (TV). The "Multi-Valued" column defines whether multiple instances of the attribute can appear ๐Ÿ”ข.

4.4.3.1.1. GWP_ATD and GWP_DTD Attributes โณ

Section 4.2.1 of [RFC5374] specifies a key rollover method that requires two values to be provided to GMs: Activation Time Delay (ATD) and Deactivation Time Delay (DTD) ๐Ÿ”„.

The GWP_ATD attribute (1) lets a GCKS set the Activation Time Delay for Data-Security SAs of the group ๐Ÿš€. The ATD defines how long active members of the group (those who send traffic) should wait after receiving new SAs before sending traffic over them โฑ๏ธ. Note that to get a smooth rollover, passive members of the group should activate the SAs immediately once they receive them ๐ŸŒŠ.

The GWP_DTD attribute (2) lets the GCKS set the DTD for previously distributed SAs ๐Ÿ—‘๏ธ. The DTD defines how long passive GMs should wait, after receiving a request to delete Data-Security SAs, before actually deleting them โŒ›. Note that active members of the group should stop sending traffic over these old SAs once new replacement SAs are activated (after the time specified in the GWP_ATD attribute) ๐Ÿซ .

The GWP_ATD and GWP_DTD attributes contain a 16-bit unsigned integer in network byte order, specifying the delay in seconds ๐Ÿ”ข. These attributes are OPTIONAL ๐ŸŒท. If one of them or both are not sent by the GCKS, then no corresponding delay should be employed ๐Ÿคทโ€โ™€๏ธ.

4.4.3.1.2. GWP_SENDER_ID_BITS Attribute ๐Ÿ”

The GWP_SENDER_ID_BITS attribute (3) declares how many bits of the cipher nonce are taken to represent a Sender-ID value ๐Ÿง . The bits are applied as the most significant bits of the IV, as shown in Figure 1 of Using Counter Modes with ESP and AH to Protect Group Traffic [RFC6054] and as specified in Section 2.5.2. Guidance for a GCKS choosing the value is provided in Section 3 of [RFC6054]. This value is applied to each Sender-ID value distributed in the KD payload ๐ŸŽฏ.

The GCKS MUST include this attribute if there is more than one sender in the group and any of the Data-Security SAs use a counter-based cipher mode ๐Ÿšจ. The number of Sender-ID bits is represented as a 16-bit unsigned integer in network byte order ๐Ÿ’œ.

4.5. Key Download Payload ๐Ÿ—๏ธ

The Key Download (KD) payload contains the group keys for the SAs specified in the GSA payload ๐Ÿ”‘. The Payload Type for the Key Download payload is fifty-two (52) ๐ŸŽซ.

                     1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Payload  |C|  RESERVED   |        Payload Length         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                           <Key Bags>                          ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Figure 17: Key Download Payload Format

The Key Download payload fields are defined as follows:

Next Payload, C, RESERVED, and Payload Length fields: These comprise the IKEv2 generic payload header and are defined in Section 3.2 of [RFC7296] ๐Ÿงพ.

Key Bags (variable): A set of key bag substructures ๐Ÿ›๏ธ.

4.5.1. Key Bags ๐Ÿ‘œ

Keys are distributed in substructures called key bags ๐ŸŽ’. Each key bag contains one or more keys that are logically related. These are keys for either a single SA (Data-Security SA or Rekey SA) or a single GM. In the latter case, besides keys, the key bag may also contain security parameters for this GM ๐Ÿง.

For this reason, two types of key bags are defined: Group Key Bag and Member Key Bag. The type is unambiguously determined by the first byte of the key bag substructure. For a Member Key Bag, it is zero, and for a Group Key Bag, it contains a Security Protocol Identifier, which is always non-zero ๐Ÿ”. For a Group Key Bag, the Protocol along with the SPI (see Figure 18) identifies the SA that is associated with the keys in this bag ๐ŸŒŸ.

4.5.2. Group Key Bag Substructure ๐Ÿ”‘โœจ

okay so the Group Key Bag substructure is where the SA key info lives ๐Ÿ’– It's tied to group SAs, either Data-Security SAs or a group Rekey SA, so it's literally the main event ๐Ÿ‘‘

                     1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Protocol   |   SPI Size    |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                              SPI                              ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                  <Group Key Bag Attributes>                   ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Figure 18: Group Key Bag Substructure Format ๐ŸŽ€

Here's the field breakdown, bestie ๐Ÿซถ

  • Protocol (1 octet): identifies the security protocol for this key bag. The values live in the "IKEv2 Security Protocol Identifiers" registry in [IKEV2-IANA]. The valid values are 6 (GIKE_UPDATE) for a KEK Key packet, and 2 (AH) or 3 (ESP) for a TEK key bag. ๐Ÿ’…
  • SPI Size (1 octet): the size of the SPI for the corresponding SA. It depends on the security protocol: 16 octets for GIKE_UPDATE, and 4 octets for AH and ESP. ๐Ÿงš
  • Length (2 octets, unsigned integer): the length of this substructure, header included. ๐Ÿ“
  • SPI (variable): the Security Parameter Index for the corresponding SA. Its size is set by the SPI Size field. For GIKE_UPDATE, the SPI is the IKEv2 header SPI pair: the first 8 octets become the "IKE SA Initiator's SPI" field in the G-IKEv2 rekey message IKEv2 HDR, and the second 8 octets become the "IKE SA Responder's SPI" in that same HDR. It's giving header-within-a-header energy ๐ŸŒˆ
  • Group Key Bag Attributes (variable): contains the key information for the corresponding SA. ๐Ÿ”ฅ

This document makes a brand-new IKEv2 IANA registry for the types of Group Key Bag attributes. It's initially populated as described in Section 9, and these attributes got added ๐Ÿฆ‹

+=======+===============+========+==============+=============+
| Value | Group Key Bag | Format | Multi-Valued | Used in     |
|       | Attributes    |        |              | Protocol    |
+=======+===============+========+==============+=============+
| 0     | Reserved      |                                     |
+-------+---------------+--------+--------------+-------------+
| 1     | SA_KEY        | TLV    | YES*         | GIKE_UPDATE |
|       |               |        | NO           | AH, ESP     |
+-------+---------------+--------+--------------+-------------+

Table 7: Group Key Bag Attributes ๐ŸŒธ

Notes

  • (*): multiple SA_KEY attributes may only show up for the GIKE_UPDATE protocol in the GSA_REKEY pseudo-exchange, and only if the GCKS uses a group key management method that lets it exclude GMs from the group (like LKH). Main-character-only behaviour ๐Ÿ‘‘

The attributes follow the format defined in IKEv2 (Section 3.3.5 of [RFC7296]). The "Format" column says which attribute format is allowed: Type/Length/Value (TLV) or Type/Value (TV). The "Multi-Valued" column says whether multiple instances of the attribute can appear. The "Used in Protocol" column lists the security protocols that can use the attribute. ๐Ÿซถ

4.5.2.1. SA_KEY Attribute ๐Ÿ—๏ธ

The SA_KEY attribute (1) carries keying material for the corresponding SA. Its content is formatted according to Section 4.5.4, with a precondition that the Key ID field MUST always be zero. The size of the keying material MUST be equal to the total size of the keys that need to be taken from this keying material (see Section 3.4) for the corresponding SA. Lowkey strict, but that's what keeps it correct ๐Ÿ’€

If the key bag is for a Data-Security SA (AH or ESP protocols), then exactly one SA_KEY attribute MUST be present, with both the Key ID and KWK ID fields set to zero. ๐Ÿ”

If the key bag is for a Rekey SA (GIKE_UPDATE protocol), then exactly one SA_KEY attribute MUST be present in the GSA_AUTH, GSA_REGISTRATION, and GSA_INBAND_REKEY exchanges. In the GSA_REKEY pseudo-exchange, at least one SA_KEY attribute MUST be present, and more attributes MAY be present, depending on the key management method the GCKS uses. โœจ

4.5.3. Member Key Bag Substructure ๐Ÿงธ

The Member Key Bag substructure carries keys and other parameters that are specific to one member of the group and aren't tied to any particular group SA. It's the personal stuff ๐Ÿฉท

                     1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Protocol   |   RESERVED    |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                  <Member Key Bag Attributes>                  ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Figure 19: Member Key Bag Substructure Format ๐Ÿ“

The Member Key Bag substructure fields work like this:

  • Protocol (1 octet): MUST be zero. This value is reserved (see Section 9) and is never used for any security protocol, so it signals that this key bag isn't tied to any particular SA. ๐Ÿ™ˆ
  • RESERVED ( octet): MUST be zero on transmission and MUST be ignored on receipt. ๐ŸŒ™
  • Length (2 octets, unsigned integer): the length of this substructure, header included. ๐Ÿ“
  • Member Key Bag Attributes (variable): contains key information and other parameters exclusively for one particular member of the group. ๐Ÿ’œ

The Member Key Bag substructure holds sensitive information for a single GM. That's why it MUST NOT be sent in GSA_REKEY messages, and it MUST only be sent via unicast SA at the moment the GM registers to the group (in either the GSA_AUTH or GSA_REGISTRATION exchanges). Private stuff stays private ๐Ÿคซ๐Ÿ”’

This document makes a new IKEv2 IANA registry for the types of Member Key Bag attributes. It's initially populated as described in Section 9, and these attributes got added:

    +=======+===========================+========+==============+
    | Value | Member Key Bag Attributes | Format | Multi-Valued |
    +=======+===========================+========+==============+
    | 0     | Reserved                                          |
    +-------+---------------------------+--------+--------------+
    | 1     | WRAP_KEY                  | TLV    | YES          |
    +-------+---------------------------+--------+--------------+
    | 2     | AUTH_KEY                  | TLV    | NO           |
    +-------+---------------------------+--------+--------------+
    | 3     | GM_SENDER_ID              | TLV    | YES          |
    +-------+---------------------------+--------+--------------+

Table 8: Member Key Bag Attributes ๐Ÿฆ‹

The attributes follow the format defined in IKEv2 (Section 3.3.5 of [RFC7296]). The "Format" column says which attribute format is allowed: Type/Length/Value (TLV) or Type/Value (TV). The "Multi-Valued" column says whether multiple instances of the attribute can appear. ๐ŸŽ€

4.5.3.1. WRAP_KEY Attribute ๐Ÿ”‘

The WRAP_KEY attribute (1) carries a key that's used to encrypt other keys. One or more of these attributes are sent to GMs if the GCKS key management method relies on a key hierarchy (e.g., LKH). This attribute MUST NOT be used if the GCKS uses inband rekey (via the GSA_INBAND_REKEY exchange) for the GM. Key-within-a-key vibes ๐Ÿช†

The content of the attribute has a format defined in Section 4.5.4, with a precondition that the Key ID field MUST NOT be zero. The algorithm associated with the key is defined by the Key Wrap Algorithm transform for the SA that the WRAP_KEY attributes were sent in. The size of the attribute data MUST be equal to the key size for this key wrap algorithm. ๐Ÿ’…

Multiple instances of the WRAP_KEY attributes MAY be present in the key bag. โœจ

4.5.3.2. AUTH_KEY Attribute ๐Ÿ›ก๏ธ

The AUTH_KEY attribute (2) carries the key that's used to authenticate the GSA_REKEY messages. Its content depends on the authentication method the GCKS specified in the Group Controller Authentication Method transform in the GSA payload. ๐ŸŒˆ

  • If digital signatures are used for GSA_REKEY message authentication, then the content of the AUTH_KEY attribute is a public key used for digital signature authentication. The public key MUST be represented as the DER-encoded ASN.1 object SubjectPublicKeyInfo, defined in Section 4.1.2.7 of [RFC5280]. The algorithm field inside the SubjectPublicKeyInfo object MUST match the content of the Signature Algorithm Identifier attribute in the Group Controller Authentication Method transform. When the id-RSASSA-PSS object identifier appears in the algorithm field of the SubjectPublicKeyInfo object, then the parameters field MUST include the RSASSA-PSS-params structure. ๐Ÿ”
  • In case of implicit authentication, the AUTH_KEY Attribute isn't used and MUST be absent (see Section 2.4.1). ๐Ÿซฅ

Multiple instances of the AUTH_KEY attributes MUST NOT be sent. One is the loneliest number and also the only allowed number ๐ŸŒŸ

4.5.3.3. GM_SENDER_ID Attribute ๐Ÿชช

The GM_SENDER_ID attribute (3) is used to download one or more Sender-ID values for the exclusive use of a GM. One or more of these attributes MUST be sent by the GCKS if the GM told the GCKS it would be a sender (by including the GROUP_SENDER notification in the request) and at least one of the Data-Security SAs included in the GSA payload uses a counter-based mode of encryption. Sender-IDs, but make them personal ๐Ÿ“

If the GMs have requested multiple Sender-ID values in the GROUP_SENDER notification, then the GCKS SHOULD provide the requested number of Sender-IDs by sending multiple instances of the GM_SENDER_ID attribute. The GCKS MAY send fewer values than the GM requested (e.g., if it's running out of Sender-IDs), but it MUST NOT send more than requested. Taking only what you asked for is a whole mood ๐Ÿฅน

This attribute MUST NOT appear in rekey operations (in the GSA_REKEY pseudo-exchange or in the GSA_INBAND_REKEY exchange). No re-gifting in rekey season ๐ŸŽ

4.5.4. Key Wrapping ๐ŸŽ€

Okay bestie, so symmetric keys in G-IKEv2 are never sent in the clear inside G-IKEv2 messages ๐Ÿ”’. They're always wrapped up in other symmetric keys, and that's called key wrapping. Ngl it's giving bodyguard energy ๐Ÿ’…. Wrap algorithms are usually built on generic encryption algorithms, but their mode of operation is tuned for protecting short, high-entropy data with minimal extra overhead โœจ. They can be generic in general, but in practice they're often tied to the encryption algorithm underneath. For example, AES Key Wrap with Padding Algorithm [RFC5649] defines key wrapping using AES, and Key Wrapping Constructions using SipHash and ChaCha [ARX-KW] define key wrapping using Chacha20 ๐Ÿฆ‹.

So in G-IKEv2, the key wrap algorithm MUST be negotiated in the IKE_SA_INIT exchange ๐Ÿค. That way the GCKS can slide encrypted keys over to the GM in the GSA_AUTH exchange ๐Ÿ’Œ. If the GCKS plans to use the multicast Rekey SA for group rekey, then it MUST specify the key wrap algorithm in the group SA policy for the Rekey SA inside the GSA payload ๐Ÿ“œ. Heads up that the key wrap algorithms for these two cases MAY be different ๐Ÿ™ˆ. For the unicast SA, the GM and the GCKS negotiate the algorithm between themselves. For the multicast Rekey SA, the GCKS hands the algorithm to the GMs as part of the group policy ๐ŸŽ. If an SAg payload is included in the GSA_AUTH request, then it MUST indicate which key wrap algorithms the GM supports ๐Ÿ’œ. In every one of these cases, the key wrap algorithm gets specified in a Key Wrap Algorithm transform (see Section 4.4.2.1.2) ๐ŸŒธ.

Here's how the wrapped key is laid out, Figure 20 ๐Ÿ’–:

                        1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                              Key ID                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                              KWK ID                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   ~                          Encrypted Key                        ~
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Figure 20: Wrapped Key Format

Now the fields, one by one ๐Ÿง:

  • Key ID (4 octets): the ID of the encrypted key. The value zero means the encrypted key holds SA keys (in the form of keying material; see Section 3.4). Otherwise, it holds some intermediate key ๐Ÿ”‘.
  • KWK ID (4 octets): the ID of the key that was used to encrypt the key with the specified Key ID. The value zero means the default KWK was used to do the encrypting. Otherwise, some intermediate key did the job ๐ŸŒˆ.
  • Encrypted Key (variable): the encrypted key bits. These bits are either one encrypted key or the result of encrypting a concatenation of keys (key material) for several algorithms. How this field is formatted depends on the key wrap algorithm for the SA the wrapped key gets sent over ๐Ÿฆ‹.

4.6. Delete Payload ๐Ÿ—‘๏ธ

The Delete payload is used in G-IKEv2 when the GCKS wants to delete Data-Security and Rekey SAs ๐Ÿ’…. The Protocol field in the Delete payload has an extended meaning: a zero protocol means "delete the whole Group SA" (aka all the Data-Security SAs and the Rekey SA) ๐Ÿ’€. See Section 2.4.3 for the deets โœจ.

4.7. Notify Payload ๐Ÿ“ฃ

G-IKEv2 uses the same Notify payload as specified in Section 3.10 of [RFC7296] ๐Ÿซถ. G-IKEv2 also brings in some extra Notify message types to communicate error conditions and status. Those live in Section 9 ๐ŸŒธ.

4.7.1. INVALID_GROUP_ID Notification ๐Ÿšซ

INVALID_GROUP_ID (45) is a brand-new error notification ๐Ÿ™…โ€โ™€๏ธ. It says the IDg payload sent during registration points at an invalid group. The Protocol ID and SPI Size fields in the Notify payload MUST be zero ๐Ÿ“. There's no data attached to this one, and the content of the Notification Data field MUST be ignored on receipt ๐Ÿ™ˆ.

4.7.2. AUTHORIZATION_FAILED Notification ๐Ÿ”

AUTHORIZATION_FAILED (46) is another new error notification. It gets sent in response to a GSA_AUTH or GSA_REGISTRATION message when authorization failed ๐Ÿ˜ญ. The Protocol ID and SPI Size fields in the Notify payload MUST be zero ๐Ÿ“. There's no data with this notification either, and the content of the Notification Data field MUST be ignored on receipt ๐Ÿ™ˆ.

4.7.3. REGISTRATION_FAILED Notification โ›”

REGISTRATION_FAILED (49) is a new error notification that the GCKS sends when a GM's registration request can't be satisfied for reasons that have nothing to do with that particular GM. Think: the group is at capacity, e.g., the group's capacity is exceeded ๐Ÿซ . The Protocol ID and SPI Size fields in the Notify payload MUST be zero ๐Ÿ“. No data here, and the content of the Notification Data field MUST be ignored on receipt ๐Ÿ™ˆ.

4.7.4. GROUP_SENDER Notification ๐Ÿ“ก

GROUP_SENDER (16429) is a new status notification ๐ŸŒŸ. It gets sent in the GSA_AUTH or GSA_REGISTRATION exchanges to say that the GM intends to be a sender of data traffic ๐ŸŽค. The data includes a count of how many Sender-ID values the GM wants. The count MUST be 4 octets long and contain the big-endian representation of the number of requested Sender-IDs ๐Ÿ”ข. And the Protocol ID and SPI Size fields in the Notify payload MUST be zero ๐Ÿ“.

4.8. Authentication Payload ๐Ÿชช

G-IKEv2 uses the same Authentication payload as specified in Section 3.8 of [RFC7296] to authenticate the rekey message โœ…. Plot twist: if it's used in the GSA_REKEY messages, the content of the payload gets computed differently, as described in Section 2.4.1.1 ๐Ÿง .

5. Using G-IKEv2 Attributes โœจ

okay so G-IKEv2 has a whole bunch of attributes the GCKS uses to send info down to GMs ๐Ÿ“ฆ but they can't just show up anywhere, bestie. There are rules about where and when each one is allowed, and those rules get spelled out right when each attribute is introduced. To make life easier, the rules are summarized in Table 9 (for multicast rekey operations) and Table 10 (for inband rekey operations) ๐Ÿ’–

Here's the notation we're using:

  • S A single attribute of this type MUST be present.
  • M Multiple attributes of this type MAY be present.
  • [] Attribute is OPTIONAL.
  • - Attribute MUST NOT be present.

Quick heads up ๐Ÿ‘€ the restrictions are defined per substructure, the one that has its own attributes, and NOT per whole G-IKEv2 message. so don't look at a message and think "the whole thing is restricted," it's the individual substructures that matter ๐Ÿ™ˆ

     +========================+==================+===========+=======+
     | Attributes             | GSA_AUTH         | GSA_REKEY | Notes |
     |                        | GSA_REGISTRATION |           |       |
     +========================+==================+===========+=======+
     | Group SA Attributes (Section 4.4.2.2)                         |
     +========================+==================+===========+=======+
     | GSA_KEY_LIFETIME       | S                | S         |       |
     +------------------------+------------------+-----------+-------+
     | GSA_INITIAL_MESSAGE_ID | [S]              | [S]       |       |
     +------------------------+------------------+-----------+-------+
     | GSA_NEXT_SPI           | [M]              | [M]       |       |
     +========================+==================+===========+=======+
     | GW Policy Attributes (Section 4.4.3.1)                        |
     +========================+==================+===========+=======+
     | GWP_ATD                | [S]              | [S]       |       |
     +------------------------+------------------+-----------+-------+
     | GWP_DTD                | [S]              | [S]       |       |
     +------------------------+------------------+-----------+-------+
     | GWP_SENDER_ID_BITS     | S                | -         | 1     |
     +========================+==================+===========+=======+
     | Key Bag Attributes (Section 4.5.1)                            |
     +========================+==================+===========+=======+
     | SA_KEY                 | S                | S[M]      | 2     |
     +------------------------+------------------+-----------+-------+
     | WRAP_KEY               | [M]              | [M]       | 3     |
     +------------------------+------------------+-----------+-------+
     | AUTH_KEY               | S                | [S]       | 4     |
     +------------------------+------------------+-----------+-------+
     | GM_SENDER_ID           | S[M]             | -         | 1     |
     +------------------------+------------------+-----------+-------+

       Table 9: Attributes in G-IKEv2 Exchanges with Multicast Rekey
                                 Operations

Notes for Table 9 ๐Ÿง 

(1): okay this one is the big one ๐Ÿ”ฅ GWP_SENDER_ID_BITS MUST be present if the GCKS policy includes at least one cipher in counter mode of operation AND the GM included the GROUP_SENDER notify in the registration request. Otherwise it MUST NOT be present. In the first case, at least one GM_SENDER_ID attribute MUST be present (and more MAY be present if the GM asked for more Sender-IDs), and in the latter case it MUST NOT be present. so basically: counter mode plus GROUP_SENDER means you need the bits and the IDs, and otherwise they're a hard no ๐Ÿ™…โ€โ™€๏ธ

(2): for a Data-Security SA, exactly one SA_KEY attribute MUST be present. For a Rekey SA, exactly one SA_KEY attribute MUST be present in the GSA_AUTH and GSA_REGISTRATION exchange. In the GSA_REKEY pseudo-exchange, at least one SA_KEY attribute MUST be present, and more of these attributes MAY be present. the rekey pseudo-exchange is the one that gets to be extra ๐Ÿ’…

(3): the WRAP_KEY attribute MUST be present if the GCKS uses a key management method that relies on a key tree (like LKH) ๐ŸŒณ

(4): the AUTH_KEY attribute MUST be present in the GSA_AUTH and GSA_REGISTRATION exchanges if the GCKS uses an authentication method for rekey operations based on digital signatures, and it MUST NOT be present if implicit authentication is used. It MUST also be present in the GSA_REKEY pseudo-exchange if the GCKS uses digital signatures and wants to change the public key for the multicast rekey operations that follow โœ๏ธ

Now for the inband version ๐Ÿฆ‹

   +========================+================+==================+=====+
   | Attributes             |GSA_AUTH        | GSA_INBAND_REKEY |Notes|
   |                        |GSA_REGISTRATION|                  |     |
   +========================+================+==================+=====+
   | Group SA Attributes (Section 4.4.2.2)                            |
   +========================+================+==================+=====+
   | GSA_KEY_LIFETIME       |[S]             | [S]              |     |
   +------------------------+----------------+------------------+-----+
   | GSA_INITIAL_MESSAGE_ID |-               | -                |     |
   +------------------------+----------------+------------------+-----+
   | GSA_NEXT_SPI           |-               | -                |     |
   +========================+================+==================+=====+
   | GW Policy Attributes (Section 4.4.3.1)                           |
   +========================+================+==================+=====+
   | GWP_ATD                |[S]             | [S]              |     |
   +------------------------+----------------+------------------+-----+
   | GWP_DTD                |[S]             | [S]              |     |
   +------------------------+----------------+------------------+-----+
   | GWP_SENDER_ID_BITS     |S               | -                |1    |
   +========================+================+==================+=====+
   | Key Bag Attributes (Section 4.5.1)                               |
   +========================+================+==================+=====+
   | SA_KEY                 |S               | S                |     |
   +------------------------+----------------+------------------+-----+
   | WRAP_KEY               |-               | -                |     |
   +------------------------+----------------+------------------+-----+
   | AUTH_KEY               |-               | -                |     |
   +------------------------+----------------+------------------+-----+
   | GM_SENDER_ID           |S[M]            | -                |1    |
   +------------------------+----------------+------------------+-----+

       Table 10: Attributes in G-IKEv2 Exchanges with Inband Rekey
                                Operations

Notes for Table 10 ๐ŸŒธ

(1): same drill as the multicast one โœจ GWP_SENDER_ID_BITS MUST be present if the GCKS policy includes at least one cipher in counter mode of operation AND the GM included the GROUP_SENDER notify in the registration request. Otherwise it MUST NOT be present. At least one GM_SENDER_ID attribute MUST be present in the first case (and more MAY be present if the GM requested more Sender-IDs), and it MUST NOT be present in the second case.

6. Interaction with IKEv2 and ESP Extensions ๐Ÿงš

okay so there are a bunch of IKEv2 and ESP extensions out there that add extra powers ๐Ÿ’ช and G-IKEv2 plays nicely with most of them, lowkey iconic ๐Ÿซถ EAP authentication from [RFC7296] can be used to set up the registration IKE SA ๐Ÿ” and the same goes for EAP-only authentication [RFC5998] and secure password authentication [RFC6467]. G-IKEv2 is compatible with the IKEv2 Redirect Mechanism [RFC5685] and can use it, and it's also compatible with IKEv2 Session Resumption [RFC5723]. And it works with Multiple Key Exchanges in the IKEv2 framework too, as defined in [RFC9370] ๐Ÿฆ‹

This list is NOT the whole list of compatible extensions, though. Some IKEv2 extensions do need special handling when they're used in G-IKEv2, so keep an eye out for those ๐Ÿ‘€

6.1. Implicit IV for Counter-Based Ciphers in ESP ๐ŸŽ€

Using an implicit IV for counter-based encryption modes in ESP is defined in [RFC8750]. This one relies on ESP sequence numbers being unique, so it can't be used for multi-sender multicast SAs ๐Ÿ™…โ€โ™€๏ธ BUT it IS possible to use the implicit IV extension for a single-sender multicast ESP SA โœ… Also, while implicit IVs can work with ESN, using ESN is prohibited in multicast SAs (see Section 4.4.2.1.3) ๐Ÿšซ

6.2. Mixing Preshared Keys in IKEv2 for Post-Quantum Security ๐Ÿ›ก๏ธ

G-IKEv2 can take advantage of the protection that Post-quantum Preshared Keys (PPKs) for IKEv2 give you [RFC8784] ๐Ÿ’œ However, using PPKs still leaves the initial IKE SA open to quantum computer (QC) attacks. The group SA keys are protected with the default KWK (GSK_w), which is derived from SK_d, so they can't be broken even by an attacker with a QC ๐Ÿ”’ But other data sent over the initial IKE SA might be vulnerable to an attacker with a QC of sufficient size. That attacker could store all the traffic until they get a QC big enough, then decrypt it. That's the Store Now Decrypt Later attack, and it's terrifying ๐Ÿ˜ญ See Section 6 of [RFC8784] for the details.

While the group keys are protected by the PPK and are therefore immune to QCs, GCKS implementations that care about the other data sent over the initial IKE SA MUST rely on IKEv2 extensions that protect even the initial IKE SA against QCs (like [RFC9867]) ๐Ÿซก

6.3. Aggregation and Fragmentation Mode for ESP ๐ŸŒˆ

Aggregation and fragmentation mode for ESP is defined in [RFC9347]. This mode lets IP packets get split across several ESP packets, or lets several IP packets get bundled into a single ESP packet ๐Ÿ“ฆ It can only be used with ESP tunnel mode, and it relies on monotonically increasing sequence numbers in the incoming packets. So yeah, it's impossible to use this mode for multi-sender multicast SAs ๐Ÿ’€ And since multicast Data-Security SAs are unidirectional, the congestion control feature of aggregation and fragmentation mode can't be used either.

It IS possible to use aggregation and fragmentation mode without congestion control for a single-sender multicast ESP SA that was created in tunnel mode โœจ GMs that support this mode can send the USE_AGGFRAG notification in the registration request, along with the SAg payload. If the Data-Security SA(s) to be installed on the GMs use aggregation and fragmentation mode, the GCKS signals that by including the USE_AGGFRAG notification along with the GSA payload in its response ๐Ÿ’Œ

7. GDOI Protocol Extensions ๐ŸŒท

A few extensions were defined for the GDOI protocol [RFC6407], like GDOI Support for IEC 62351 Security Services [RFC8052] or the GDOI GROUPKEY-PUSH Acknowledgement Message [RFC8263] ๐Ÿ“ It's expected that these extensions will be redefined for G-IKEv2 in separate documents, if needed. Not our problem rn, but good to know ๐Ÿ™ˆ

8. Security Considerations ๐Ÿ”

โš ๏ธ okay bestie, this section is SERIOUS. Read it like your group chat's life depends on it ๐Ÿ˜ญ

When an entity joins the group and becomes a GM, it has to trust that the GCKS only authorized entities that are admitted to the group. It also has to trust that other GMs won't leak the information shared within the group. No pressure ๐Ÿฅบ

8.1. GSA Registration and Secure Channel ๐Ÿ›ก๏ธ

The G-IKEv2 registration procedure uses IKEv2 initial exchanges, which means it inherits all the security considerations documented in Section 5 of [RFC7296]. That includes authentication, confidentiality, on-path attack protection, protection against replay and reflection attacks, and denial-of-service protection ๐Ÿซถ The GSA_REGISTRATION exchange also takes advantage of those protections. On top of all that, G-IKEv2 brings in the ability to authorize a particular GM regardless of whether they have IKEv2 credentials ๐Ÿ‘‘

8.2. GSA Maintenance Channel ๐Ÿ”’โœจ

Okay bestie, the GSA maintenance channel is locked down tight. It's cryptographically and integrity protected using the cryptographic algorithm and key negotiated in the GSA member registration exchange ๐Ÿ’…๐Ÿ”

8.2.1. Authentication/Authorization ๐Ÿ›ก๏ธ

So the authentication key gets handed out during GM registration, and the receiver of the rekey message uses that key to check the message really came from the authorized GCKS ๐Ÿ”‘ Iconic verification energy.

There's also implicit authentication ๐Ÿ‘€ Here, the GM's ability to decrypt and verify the ICV of incoming messages counts as proof that the sender knows the group keys and is therefore a member of the group. BUT ngl, implicit authentication doesn't give source origin authentication, so the GM can't be sure the message came from the GCKS ๐Ÿ˜ญ That's why using implicit authentication is NOT RECOMMENDED, unless it's used with a small group of trusted parties ๐Ÿซถ

8.2.2. Confidentiality ๐Ÿคซ

Confidentiality is handled by distributing a confidentiality key as part of the GSA member registration exchange ๐Ÿ—๏ธ Secret keeper era.

8.2.3. On-Path Attack Protection ๐Ÿšง

The GSA maintenance channel is integrity protected by using a digital signature โœ๏ธ๐Ÿ’œ

8.2.4. Replay/Reflection Attack Protection ๐Ÿ”

The GSA_REKEY message includes a monotonically increasing sequence number ๐Ÿ“ˆ which is how it protects against replay and reflection attacks. A GM spots a replayed message by comparing the Message ID number to that of the last rekey message it received ๐Ÿ‘€ Any rekey message with a Message ID number less than or equal to the last received value MUST be discarded ๐Ÿ—‘๏ธ Also, implementations should keep a record of recently received GSA rekey messages for this comparison ๐Ÿ“’

The super strict role separation between the GCKS and the GMs is a big deal here ๐ŸŒธ As a consequence, a Rekey SA is limited to outbound/inbound only, and that helps prevent reflection attacks ๐Ÿชž Main character defense, honestly.


9. IANA Considerations ๐Ÿ“‹๐Ÿ’–

9.1. New Registries ๐Ÿ—‚๏ธ

Per this document, new registries have been created for G-IKEv2 under the "Internet Key Exchange Version 2 (IKEv2) Parameters" registry group [IKEV2-IANA]. The terms Reserved, Expert Review, and Private Use are as defined in [RFC8126] ๐ŸŽ€

  1. IANA has created the "Transform Type 13 - Key Wrap Algorithm Transform IDs" registry. The registration policy for this registry is Expert Review [RFC8126]. The initial values of the registry are as follows:
                   +============+==========================+
                   | Value      | Key Wrap Algorithm       |
                   +============+==========================+
                   | 0          | Reserved                 |
                   +------------+--------------------------+
                   | 1          | KW_5649_128              |
                   +------------+--------------------------+
                   | 2          | KW_5649_192              |
                   +------------+--------------------------+
                   | 3          | KW_5649_256              |
                   +------------+--------------------------+
                   | 4          | KW_ARX                   |
                   +------------+--------------------------+
                   | 5-1023     | Unassigned               |
                   +------------+--------------------------+
                   | 1024-65535 | Reserved for Private Use |
                   +------------+--------------------------+

Table 11

  1. IANA has created the "Transform Type 14 - Group Controller Authentication Method Transform IDs" registry. The registration policy for this registry is Expert Review [RFC8126]. The initial values of the registry are as follows:
            +============+========================================+
            | Value      | Group Controller Authentication Method |
            +============+========================================+
            | 0          | Reserved                               |
            +------------+----------------------------------------+
            | 1          | Implicit                               |
            +------------+----------------------------------------+
            | 2          | Digital Signature                      |
            +------------+----------------------------------------+
            | 3-1023     | Unassigned                             |
            +------------+----------------------------------------+
            | 1024-65535 | Reserved for Private Use               |
            +------------+----------------------------------------+

Table 12

  1. IANA has created the "Group SA Attributes" registry. The registration policy for this registry is Expert Review [RFC8126]. The initial values of the registry are as follows:
        +===========+======================+======+======+============+
        |Value      |Group SA Attributes   |Format|Multi-|Used in     |
        |           |                      |      |Valued|Protocol    |
        +===========+======================+======+======+============+
        |0          |Reserved              |                          |
        +-----------+----------------------+------+------+------------+
        |1          |GSA_KEY_LIFETIME      |TLV   |NO    |GIKE_UPDATE,|
        |           |                      |      |      |AH, ESP     |
        +-----------+----------------------+------+------+------------+
        |2          |GSA_INITIAL_MESSAGE_ID|TLV   |NO    |GIKE_UPDATE |
        +-----------+----------------------+------+------+------------+
        |3          |GSA_NEXT_SPI          |TLV   |YES   |GIKE_UPDATE,|
        |           |                      |      |      |AH, ESP     |
        +-----------+----------------------+------+------+------------+
        |4-16383    |Unassigned            |                          |
        +-----------+----------------------+--------------------------+
        |16384-32767|Reserved for Private  |                          |
        |           |Use                   |                          |
        +-----------+----------------------+--------------------------+

Table 13

  1. IANA has created the "Group-Wide Policy Attributes" registry. The registration policy for this registry is Expert Review [RFC8126]. The initial values of the registry are as follows:
        +=============+======================+========+==============+
        | Value       | GW Policy Attributes | Format | Multi-Valued |
        +=============+======================+========+==============+
        | 0           | Reserved             |                       |
        +-------------+----------------------+--------+--------------+
        | 1           | GWP_ATD              | TV     | NO           |
        +-------------+----------------------+--------+--------------+
        | 2           | GWP_DTD              | TV     | NO           |
        +-------------+----------------------+--------+--------------+
        | 3           | GWP_SENDER_ID_BITS   | TV     | NO           |
        +-------------+----------------------+--------+--------------+
        | 4-16383     | Unassigned           |                       |
        +-------------+----------------------+-----------------------+
        | 16384-32767 | Reserved for Private |                       |
        |             | Use                  |                       |
        +-------------+----------------------+-----------------------+

Table 14

  1. IANA has created the "Group Key Bag Attributes" registry. The registration policy for this registry is Expert Review [RFC8126]. The initial values of the registry are as follows:
       +=============+=============+======+==============+=============+
       | Value       | Group Key   |Format| Multi-Valued | Used in     |
       |             | Bag         |      |              | Protocol    |
       |             | Attributes  |      |              |             |
       +=============+=============+======+==============+=============+
       | 0           | Reserved    |                                   |
       +-------------+-------------+------+--------------+-------------+
       | 1           | SA_KEY      |TLV   | YES          | GIKE_UPDATE |
       |             |             |      | NO           | AH, ESP     |
       +-------------+-------------+------+--------------+-------------+
       | 2-16383     | Unassigned  |                                   |
       +-------------+-------------+-----------------------------------+
       | 16384-32767 | Reserved    |                                   |
       |             | for         |                                   |
       |             | Private     |                                   |
       |             | Use         |                                   |
       +-------------+-------------+-----------------------------------+

Table 15

  1. IANA has created the "Member Key Bag Attributes" registry. The registration policy for this registry is Expert Review [RFC8126]. The initial values of the registry are as follows:
           +=============+================+========+==============+
           | Value       | Member Key Bag | Format | Multi-Valued |
           |             | Attributes     |        |              |
           +=============+================+========+==============+
           | 0           | Reserved       |                       |
           +-------------+----------------+--------+--------------+
           | 1           | WRAP_KEY       | TLV    | YES          |
           +-------------+----------------+--------+--------------+
           | 2           | AUTH_KEY       | TLV    | NO           |
           +-------------+----------------+--------+--------------+
           | 3           | GM_SENDER_ID   | TLV    | YES          |
           +-------------+----------------+--------+--------------+
           | 4-16383     | Unassigned     |                       |
           +-------------+----------------+-----------------------+
           | 16384-32767 | Reserved for   |                       |
           |             | Private Use    |                       |
           +-------------+----------------+-----------------------+

Table 16

9.1.1. Guidance for Designated Experts ๐Ÿง‘โ€โš–๏ธ

In all cases of Expert Review described in this section, the designated expert (DE) is expected to make sure suitable documentation (a specification) exists, as described in [RFC8126], and to check that it's permanently and publicly available ๐Ÿ“š The DE is also expected to check the clarity of purpose and use of the requested code points โœจ Lastly, the DE must verify that any specification produced outside the IETF doesn't conflict with work that's active or already published within the IETF ๐Ÿซถ Keeping the vibes clean and the registries drama-free ๐Ÿ’…๐ŸŒˆ

9.2. Changes in the Existing IKEv2 Registries ๐Ÿ’…

Okay, the registry updates are where things get really satisfying ๐Ÿฆ‹ Here's exactly what IANA changed.

  1. In the "IKEv2 Exchange Types" registry, IANA updated the references for the following entries so they point to this document, and registered "GSA_INBAND_REKEY" ๐ŸŒธ
                 +=======+==================+
                 | Value | Exchange Type    |
                 +=======+==================+
                 | 39    | GSA_AUTH         |
                 +-------+------------------+
                 | 40    | GSA_REGISTRATION |
                 +-------+------------------+
                 | 41    | GSA_REKEY        |
                 +-------+------------------+
                 | 42    | GSA_INBAND_REKEY |
                 +-------+------------------+

                           Table 17
  1. In the "IKEv2 Payload Types" registry, IANA listed this document as a reference for the following entries ๐Ÿงš
       +=======+============================+==========+
       | Value | Next Payload Type          | Notation |
       +=======+============================+==========+
       | 50    | Group Identification       | IDg      |
       +-------+----------------------------+----------+
       | 51    | Group Security Association | GSA      |
       +-------+----------------------------+----------+
       | 52    | Key Download               | KD       |
       +-------+----------------------------+----------+

                            Table 18
  1. Also in the "IKEv2 Payload Types" registry, IANA updated the definition of Payload Type 33 and added a reference to this document ๐ŸŽ€
  +=======+=========================+==========+===========+
  | Value | Next Payload Type       | Notation | Reference |
  +=======+=========================+==========+===========+
  | 33    | Security Association    | SA       | [RFC7296] |
  |       +-------------------------+----------+-----------+
  |       | Security Association -  | SAg      | RFC 9838  |
  |       | GM Supported Transforms |          |           |
  +-------+-------------------------+----------+-----------+

                           Table 19
  1. In the "Transform Type Values" registry, IANA made these changes โœจ
    • Registered "Key Wrap Algorithm (KWA)" and "Group Controller Authentication Method (GCAUTH)".
    • Updated the "Used In" column for values 1 and 3 and listed this document as an additional reference.
+======+================================+======================+
| Type | Description                    | Used In              |
+======+================================+======================+
| 1    | Encryption Algorithm (ENCR)    | (IKE, GIKE_UPDATE,   |
|      |                                | ESP)                 |
+------+--------------------------------+----------------------+
| 3    | Integrity Algorithm (INTEG)    | (IKE, GIKE_UPDATE,   |
|      |                                | AH, optional in ESP) |
+------+--------------------------------+----------------------+
| 13   | Key Wrap Algorithm (KWA)       | (IKE, GIKE_UPDATE)   |
+------+--------------------------------+----------------------+
| 14   | Group Controller               | (GIKE_UPDATE)        |
|      | Authentication Method (GCAUTH) |                      |
+------+--------------------------------+----------------------+

                           Table 20
  1. In the "IKEv2 Transform Attribute Types" registry, IANA added the following entry ๐Ÿฆ‹
       +=======+================================+========+
       | Value | Attribute Type                 | Format |
       +=======+================================+========+
       | 18    | Signature Algorithm Identifier | TLV    |
       +-------+--------------------------------+--------+

                            Table 21
  1. In the "Transform Type 5 - Sequence Numbers Transform IDs" registry, IANA added the following entry ๐Ÿ’œ
            +========+============================+
            | Number | Name                       |
            +========+============================+
            | 2      | 32-bit Unspecified Numbers |
            +--------+----------------------------+

                            Table 22
  1. In the "IKEv2 Notify Message Error Types" registry, IANA made these changes ๐Ÿ”ฅ
    • Registered "REGISTRATION_FAILED".
    • Updated the references for "INVALID_GROUP_ID" and "AUTHORIZATION_FAILED" to point to this document.
             +=======+===========================+
             | Value | Notify Message Error Type |
             +=======+===========================+
             | 45    | INVALID_GROUP_ID          |
             +-------+---------------------------+
             | 46    | AUTHORIZATION_FAILED      |
             +-------+---------------------------+
             | 49    | REGISTRATION_FAILED       |
             +-------+---------------------------+

                            Table 23
  1. An earlier draft of this document [G-IKEV2] registered Notify type 16429 in the "IKEv2 Notify Message Status Types" registry under the name SENDER_REQUEST_ID. Per this document, IANA renamed it as follows ๐Ÿ™ˆ
            +=======+============================+
            | Value | Notify Message Status Type |
            +=======+============================+
            | 16429 | GROUP_SENDER               |
            +-------+----------------------------+

                           Table 24
  1. In the "IKEv2 Security Protocol Identifiers" registry, IANA added the following entry ๐ŸŒˆ
                 +=============+=============+
                 | Protocol ID | Protocol    |
                 +=============+=============+
                 | 6           | GIKE_UPDATE |
                 +-------------+-------------+

                            Table 25

10. References ๐Ÿ“š

10.1. Normative References

[RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
           Requirement Levels", BCP 14, RFC 2119,
           DOI 10.17487/RFC2119, March 1997,
           <https://www.rfc-editor.org/info/rfc2119>.

[RFC4301]  Kent, S. and K. Seo, "Security Architecture for the
           Internet Protocol", RFC 4301, DOI 10.17487/RFC4301,
           December 2005, <https://www.rfc-editor.org/info/rfc4301>.

[RFC4302]  Kent, S., "IP Authentication Header", RFC 4302,
           DOI 10.17487/RFC4302, December 2005,
           <https://www.rfc-editor.org/info/rfc4302>.

[RFC4303]  Kent, S., "IP Encapsulating Security Payload (ESP)",
           RFC 4303, DOI 10.17487/RFC4303, December 2005,
           <https://www.rfc-editor.org/info/rfc4303>.

[RFC5280]  Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
           Housley, R., and W. Polk, "Internet X.509 Public Key
           Infrastructure Certificate and Certificate Revocation List
           (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008,
           <https://www.rfc-editor.org/info/rfc5280>.

[RFC6054]  McGrew, D. and B. Weis, "Using Counter Modes with
           Encapsulating Security Payload (ESP) and Authentication
           Header (AH) to Protect Group Traffic", RFC 6054,
           DOI 10.17487/RFC6054, November 2010,
           <https://www.rfc-editor.org/info/rfc6054>.

[RFC7296]  Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T.
           Kivinen, "Internet Key Exchange Protocol Version 2
           (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October
           2014, <https://www.rfc-editor.org/info/rfc7296>.

[RFC7427]  Kivinen, T. and J. Snyder, "Signature Authentication in
           the Internet Key Exchange Version 2 (IKEv2)", RFC 7427,
           DOI 10.17487/RFC7427, January 2015,
           <https://www.rfc-editor.org/info/rfc7427>.

[RFC8126]  Cotton, M., Leiba, B., and T. Narten, "Guidelines for
           Writing an IANA Considerations Section in RFCs", BCP 26,
           RFC 8126, DOI 10.17487/RFC8126, June 2017,
           <https://www.rfc-editor.org/info/rfc8126>.

[RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
           2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
           May 2017, <https://www.rfc-editor.org/info/rfc8174>.

[RFC9827]  Smyslov, V., "Renaming the Extended Sequence Numbers (ESN)
           Transform Type in the Internet Key Exchange Protocol
           Version 2 (IKEv2)", RFC 9827, DOI 10.17487/RFC9827,
           November 2025, <https://www.rfc-editor.org/info/rfc9827>.

Okay bestie, picking up right where we left off. Here's the rest of the references and the appendix, so buckle up ๐ŸŽ€โœจ

10.2. Informative References

Appendix A. Use of LKH in G-IKEv2 ๐Ÿ”‘

Okay so this appendix is giving "how do you kick someone out of a group without rebuilding the whole thing" energy, and I'm obsessed ๐Ÿ˜ญ๐Ÿ’–. Section 5.4 of [RFC2627] describes the LKH architecture and how a GCKS uses LKH to exclude GMs. This section clarifies how the LKH architecture is used with G-IKEv2. ๐ŸŒธ

A.1. Notation

In this section, we will use the notation X{Y}, where a key with ID Y is encrypted with the key with ID X. The notation GSK_w{Y} means that the default wrap key GSK_w (with zero KWK ID)is used to encrypt key Y, and the notation X{K_sa} means key X is used to encrypt the SA key K_sa (which always has a Key ID of zero). Note that GSK_w{K_sa} means that the SA key is encrypted with the default wrap key, in which case, both KWK ID and Key ID are zero. โœจ

The content of the KD payload will be shown as a sequence of key bags. The Group Key Bag substructure will be denoted as GP(SAn)() when n is an SPI for the SA and the Member Key Bag substructure will be denoted as MP(). The content of the key bags is shown as SA_KEY and WRAP_KEY attributes with the notation described above. For simplicity, the type of the attribute will not be shown because it is implicitly defined by the type of key bag. ๐Ÿงš

Below is the example of a KD payload:

KD(GP(SA1)(X{K_sa}),MP(Y{X},Z{Y},GSK_w{Z})

Figure 21: Example of a KD Payload ๐ŸŽ€

For simplicity, any other attributes in the KD payload are omitted. ๐Ÿ’…

We will also use the notation X->Y->Z to describe the Key Path. In this case, key Y is needed to decrypt key X and key Z is needed to decrypt key Y. In the example above, the keys had the following relation: K_sa->X->Y->Z->GSK_w. ๐Ÿ‘‘

A.2. Group Creation ๐ŸŒณ

Okay so when a GCKS forms a group, it creates a key tree, as shown in Figure 22. The tree has logical keys (shown as the values of their Key IDs in the figure) and a private key shared with only one single GM. In the figure, the GMs are letters followed by their key ID in parentheses. The root holds the multicast Rekey SA key, written as SAn(K_san). The figure assumes the Key IDs are assigned sequentially, but that's not a requirement, it's just there to make things easier to picture. The GCKS can make a complete tree like this one, or a partial tree that gets built on demand as members join. โœจ

                         SA1(K_sa1)
            +------------------------------+
            1                              2
    +---------------+              +---------------+
    3               4              5               6
+-------+       +-------+      +--------+      +--------+
A(7)    B(8)    C(9)   D(10)  E(11)    F(12)  G(13)    H(14)

Figure 22: Initial LKH Tree

When GM A joins the group, the GCKS gives it the keys in the KD payload of the GSA_AUTH or GSA_REGISTRATION exchange. Using the tree from the figure above, the KD payload will be:

KD(GP(SA1)(1{K_sa1}),MP(3{1},7{3},GSK_w{7})

Figure 23: KD Payload for the Group Member A

From these attributes, GM A builds the Key Path K_sa1->1->3->7->GSK_w. Since it ends up with GSK_w, it uses all the WRAP_KEY attributes in the path as its Working Key Path, which is 1->3->7. ๐Ÿ’…

Other GMs get their keys the same way when they join, so their Working Key Paths look like this:

A: 1->3->7      B: 1->3->8      C: 1->4->9,     D: 1->4->10
E: 2->5->11     F: 2->5->12     G: 2->6->13     H: 2->6->14

Figure 24: Key Paths for all GMs

A.3. Simple Group SA Rekey ๐Ÿ”

If the GCKS does a simple SA rekey without changing group membership, it only sends a Group Key Bag in the KD payload. That bag has a new SA key, encrypted with the default KWK. Easy. ๐Ÿฆ‹

KD(GP(SA2)(GSK_w{K_sa2}))

Figure 25: KD Payload for the Simple Group SA Rekey

All the GMs can decrypt it, and nothing changes in their Working Key Paths. ๐Ÿซถ

A.4. Group Member Exclusion ๐Ÿšซ

If the GCKS has reason to believe a GM should be excluded, it can do that by sending a GSA_REKEY message with a set of GM_KEY attributes. That lets every GM except the excluded one get a new SA key. Iconic behavior, honestly. ๐Ÿ‘‘

In this example, the GCKS excludes GM F. To do that, it changes the key tree by replacing key 2 with key 15 and key 5 with key 16. It also generates a new SA key for a new SA3. ๐ŸŒˆ

                         SA3(K_sa3)
            +------------------------------+
            1                             15
    +---------------+              +---------------+
    3               4             16               6
+-------+       +-------+      +----           +--------+
A(7)    B(8)    C(9)   D(10)  E(11)    F(12)  G(13)    H(14)

Figure 26: LKH Tree after F Has Been Excluded

Then it sends this KD payload for the new Rekey SA3:

KD(GP(SA3)(1{K_sa3},15{K_sa3}),MP(6{15},16{15},11{16})

Figure 27: KD Payload for the Group Member F

Here's what happens when they process it:

  • GMs A, B, C, and D can decrypt the SA_KEY attribute 1{K_sa3} using the "1" key from their key path. Since there are no new GM_KEY attributes in the new Key Path, they don't update their Working Key Paths.
  • GMs G and H construct the new Key Path 15->6 and can decrypt the intermediate key 15 using key 6 from their Working Key Paths. So they update their Working Key Paths by replacing everything up to key 6 with the new Key Path, which swaps key 2 for key 15.
  • GM E constructs the new Key Path 16->15->11 and can decrypt the intermediate key 16 using key 11 from its Working Key Path. So it updates its Working Key Path by replacing everything up to key 11 with the new Key Path, which swaps key 2 for key 15 and key 5 for key 16.
  • GM F can't construct any Key Path that leads to a key it holds, so it can't decrypt the new SA key for SA3. That means it gets excluded from the group once SA3 is used. ๐Ÿฅ€

In the end, the GMs have these Working Key Paths:

A: 1->3->7      B: 1->3->8      C: 1->4->9,     D: 1->4->10
E: 15->16->11   F: excluded     G: 15->6->13    H: 15->6->14

Figure 28: Key Paths for all GMs after Exclusion of a GM

Acknowledgements ๐Ÿ’–

The authors thank Lakshminath Dondeti and Jing Xiang for first exploring the use of IKEv2 for group key management and for providing the basis behind the protocol. Mike Sullenberger and Amjad Inamdar were instrumental in helping resolve many issues in several draft versions of the document. ๐Ÿ™Œ

The authors are grateful to Tero Kivinen, Daniel Migault, Gorry Fairhurst, Robert Sparks, Russ Housley, and Paul Wouters for their careful reviews and valuable proposals for improving the document quality. ๐ŸŽ€

Contributors ๐Ÿงš

The following individuals made substantial contributions to earlier draft versions of this document.

Sheela Rowles

Cisco Systems

Aldous Yeung

Cisco Systems

Email: cyyeung@cisco.com

Paulina Tran

Cisco Systems

Yoav Nir

Dell EMC

Email: ynir.ietf@gmail.com

Authors' Addresses โœ๏ธ

Valery Smyslov

ELVIS-PLUS

Russian Federation

Email: svan@elvis.ru

Brian Weis

Independent

United States of America

Email: bew.stds@gmail.com

๐Ÿ“ฆ where this page comes from