<?xml version="1.0" encoding="US-ASCII"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocdepth="2"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>

<rfc number="8052" category="std" submissionType="IETF" consensus="yes" ipr="trust200902">
  <front>
    <title
	abbrev="GDOI Support for IEC 62351">Group&nbsp;Domain&nbsp;of&nbsp;Interpretation&nbsp;(GDOI)&nbsp;Protocol
    Support&nbsp;for&nbsp;IEC&nbsp;62351&nbsp;Security&nbsp;Services</title>

    <author fullname="Brian Weis" initials="B.W." surname="Weis">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>170 W. Tasman Drive</street>

          <city>San Jose</city>

          <code>95134-1706</code>

          <region>California</region>

          <country>United States of America</country>
        </postal>

        <phone>+1 408 526 4796</phone>

        <email>bew@cisco.com</email>
      </address>
    </author>

    <author fullname="Maik Seewald" initials="M.S." surname="Seewald">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>Am Soeldnermoos 17</street>

          <city>D-85399 Hallbergmoos</city>

          <code></code>

          <region></region>

          <country>Germany</country>
        </postal>

        <phone>+49 619 6773 9655</phone>

        <email>maseewal@cisco.com</email>
      </address>
    </author>

    <author fullname="Herb Falk" initials="H.F." surname="Falk">
      <organization>SISCO</organization>

      <address>
        <postal>
          <street>6605 19-1/2 Mile Road</street>

          <city>Sterling Heights</city>

          <code>48314</code>

          <region>MI</region>

          <country>United States of America</country>
        </postal>

        <phone>+1 586 254 0020 x105</phone>

        <email>herb@sisconet.com</email>
      </address>
    </author>

    <date month="June" year="2017" />

    <abstract>
      <t>The IEC 61850 power utility automation family of standards describes
      methods using Ethernet and IP for distributing control and data frames
      within and between substations. The IEC 61850-90-5 and IEC 62351-9
      standards specify the use of the Group Domain of Interpretation (GDOI)
      protocol (RFC 6407) to distribute security transforms for some IEC 61850
      security protocols. This memo defines GDOI payloads to support those
      security protocols.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="INTRO" title="Introduction">
      <t>Power substations use Generic Object Oriented Substation Events
      (GOOSE) protocol <xref target="IEC-61850-8-1"></xref> to distribute
      control information to groups of devices using a multicast strategy.
      Sources within the power substations also distribute IEC 61850-9-2
      sampled values data streams <xref target="IEC-61850-9-2"></xref>. The
      IEC 62351-9 standard <xref target="IEC-62351-9"></xref> describes key
      management methods for the security methods protecting these IEC 61850
      messages, including methods of device authentication and authorization,
      and methods of policy and keying material agreement for IEC 61850
      message encryption and data integrity protection. These key management
      methods include the use of GDOI <xref target="RFC6407"></xref> to
      distribute the security policy and session keying material used to
      protect IEC 61850 messages when the messages are sent to a group of
      devices.</t>

      <t>The protection of the messages is defined in IEC 62351-6 <xref
      target="IEC-62351-6"></xref>, IEC 61850-8-1 <xref
      target="IEC-61850-8-1"></xref>, and IEC 61850-9-2 <xref
      target="IEC-61850-9-2"></xref>. Protected IEC 61850 messages typically
      include the output of a Message Authentication Code (MAC) and may also
      be encrypted using a symmetric cipher such as the Advanced Encryption
      Standard (AES).</t>

      <t>Section 5.5.2 of RFC 6407 specifies that the following information
      needs to be provided in order to fully define a new security
      protocol:</t>

      <t><list style="symbols">
          <t>The Protocol-ID for the particular security protocol</t>

          <t>The SPI Size</t>

          <t>The method of SPI generation</t>

          <t>The transforms, attributes, and keys needed by the security
          protocol</t>
        </list></t>

      <t>This document defines GDOI payloads to distribute policy and keying
      material to protect IEC 61850 messages and defines the necessary
      information to ensure interoperability between IEC 61850
      implementations.</t>

      <t>This memo extends RFC 6407 in order to define extensions needed by
      IEC 62351-9. 
      With the current IANA registry rules set up by RFC 6407,
      this requires "Standards Action" <xref target="RFC5226"></xref> by the
      IETF; this document satisfies that requirement.
      As the relevant IEC specifications are
      not available to the IETF community, it is not possible for this RFC to
      fully describe the security considerations that apply. Therefore,
      implementers need to depend on the security analysis within the IEC
      specifications. As two different Standards Development Organizations are
      involved here, and since group key management is inherently complex, it
      is possible that some security issues have not been identified, so additional
      analysis of the security of the combined set of specifications may be
      advisable.</t>

<!--[rfced] 
Authors,

Please note that RFC 8174 was recently published; it clarifies the use of
capitalized keywords defined in RFC 2119.  We have updated the text as
follows:

Original:
   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
   [RFC2119].

Current:
   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.

Please let us know if you have any concerns. -->

<section title="Requirements Language">
<t>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 <xref target="RFC2119"/> <xref target="RFC8174"/>                                        when, and only when, they appear in all capitals, as shown here.</t>
</section>

      <section title="Terminology">
        <t>The following key terms are used throughout this document:</t>

        <t><list hangIndent="6" style="hanging">
            <t hangText="Generic Object Oriented Substation Events:">Power
            substation control model defined as per IEC 61850.</t>

            <t hangText="IEC 61850 message:">A message in the IEC 61850 family
            of protocols carrying control or data frames between substation
            devices.</t>
          </list></t>
      </section>

      <section title="Acronyms">
        <t>The following acronyms are used throughout this
        document:<list hangIndent="8" style="hanging">
            <t hangText="AES">Advanced Encryption Standard</t>

            <t hangText="GCKS">Group Controller/Key Server</t>

            <t hangText="GDOI">Group Domain of Interpretation</t>

            <t hangText="GM">Group Member</t>

            <t hangText="GOOSE">Generic Object Oriented Substation Events</t>

            <t hangText="KD">Key Download</t>

            <t hangText="KEK">Key Encryption Key</t>

            <t hangText="MAC">Message Authentication Code</t>

            <t hangText="SA">Security Association</t>

            <t hangText="SPI">Security Parameter Index</t>

            <t hangText="TEK">Traffic Encryption Key</t>
          </list></t>
      </section>
    </section>

    <section title="IEC 61850 Protocol Information">
      <t>The following subsections describe the GDOI payload extensions that are
      needed in order to distribute security policy and keying material for
      the IEC 62351 Security Services. The Identification (ID) Payload is used
      to describe an IEC 62351 GDOI group. The Security Association (SA)
      Traffic Encryption Key (TEK) payload is used to describe the policy
      defined by a Group Controller/Key Server (GCKS) for a particular IEC
      62351 traffic selector. No changes are required to the Key Download (KD)
      Payload, but a mapping of IEC 62351 keys to the KD payload key types is
      included.</t>

      <t>All multi-octet fields are in network byte order.</t>

      <section title="ID Payload">
        <t>The ID payload in a GDOI GROUPKEY-PULL exchange allows the Group
        Member (GM) to declare the group it would like to join. A group is
        defined by an ID payload as defined in GDOI <xref
        target="RFC6407"></xref> and reproduced in <xref
        target="gdoi-id"></xref>.</t>

        <t><figure anchor="gdoi-id" title="RFC 6407 Identification Payload">
            <preamble></preamble>

            <artwork align="center"><![CDATA[
 0                   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  !   RESERVED    !         Payload Length        !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!    ID Type    !      DOI-Specific ID Data = 0                 !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
~                       Identification Data                     ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
]]></artwork>

            <postamble></postamble>
          </figure></t>

        <t>An ID Type name of ID_OID (value 13) is defined in this memo to
        specify an Object Identifier (OID) <xref target="ITU-T-X.683"></xref>
        encoded using Distinguished Encoding Rules (DER) <xref
        target="ITU-T-X.690"></xref>. Associated with the OID may be an
	OID-Specific Payload DER encoded as further defining the group. Several
        OIDs are specified in <xref target="IEC-62351-9"> </xref> for use with
        IEC 61850. Each OID represents a GOOSE or Sampled Value protocol, and
        in some cases IEC 61850 also specifies a particular multicast
        destination address to be described in the OID-Specific Payload field.
        The format of the ID_OID Identification Data is specified as shown in
        <xref target="id_oid"></xref>.</t>

        <t><figure anchor="id_oid" title="ID_OID Identification Data">
            <preamble></preamble>

            <artwork align="center"><![CDATA[
 0                   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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!  OID Length   !                       OID                     ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!  OID-Specific Payload Length  !     OID-Specific Payload      ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
]]></artwork>

            <postamble></postamble>
          </figure>The ID_OID Identification Data fields are defined as
        follows:</t>

        <t><list style="symbols">
            <t>OID Length (1 octet) -- Length of the OID field.</t>

            <t>OID (variable) -- An ASN.1 ObjectIdentifier encoded using DER
            <xref target="ITU-T-X.690"></xref>.</t>

            <t>OID-Specific Payload Length (2 octets) -- Length of the OID-Specific payload. Set to zero if the OID does not require an OID-Specific payload.</t>

            <t>OID-Specific Payload (variable) -- OID-specific selector
            encoded in DER. If OID-Specific Payload Length is set to zero, this
            field does not appear in the ID payload.</t>
          </list></t>
      </section>

      <section anchor="TEK-Payload" title="SA TEK Payload">
        <t>The SA TEK payload contains security attributes for a single set of
        policy associated with a group TEK. The type of policy to be used with
        the TEK is described by a Protocol-ID field included in the SA TEK. As
        shown in <xref target="sa-tek"></xref> reproduced from RFC 6407, each
        Protocol-ID describes a particular TEK Protocol-Specific Payload
        definition.<figure anchor="sa-tek" height=""
            title="RFC 6407 SA TEK Payload">
            <preamble></preamble>

            <artwork align="center"><![CDATA[
 0                   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  !   RESERVED    !         Payload Length        !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! Protocol-ID   !       TEK Protocol-Specific Payload           ~
+-+-+-+-+-+-+-+-+                                               ~
~                                                               ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
]]></artwork>

            <postamble></postamble>
          </figure></t>

        <t>The Protocol-ID name of GDOI_PROTO_IEC_61850 (value 3) is
        defined in this memo for the purposes of distributing IEC 61850
        policy. A GDOI_PROTO_IEC_61850 SA TEK includes an OID and (optionally)
        an OID-Specific payload that together define the selectors for the
        network traffic. The selector fields are followed by security policy
        fields indicating how the specified traffic is to be protected. The
        GDOI_PROTO_IEC_61850 TEK Protocol-Specific Payload is defined as shown
        in <xref target="iec-sa-tek"></xref>.</t>

        <t><figure anchor="iec-sa-tek" title="IEC 61850 SA TEK Payload">
            <preamble></preamble>

            <artwork align="center"><![CDATA[
 0                   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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!  OID Length   !                       OID                     ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!  OID-Specific Payload Length  !     OID-Specific Payload      ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                              SPI                              !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!           Auth Alg            !            Enc Alg            !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                    Remaining Lifetime Value                   !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                      SA Data Attributes                       ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
]]></artwork>

            <postamble></postamble>
          </figure>The GDOI_PROTO_IEC_61850 SA TEK payload fields are defined
        as follows:<list style="symbols">
            <t>OID Length (1 octet) -- Length of the OID field.</t>

            <t>OID (variable) -- An ASN.1 ObjectIdentifier encoded using DER.
            OIDs defined in IEC 61850 declare the type of IEC 61850 message to
            be protected, as defined by <xref
            target="IEC-62351-9"></xref>.</t>

            <t>OID-Specific Payload Length (2 octets) -- Length of the OID-Specific payload. This field is set to zero if the policy does not
            include an OID-Specific payload.</t>

            <t>OID-Specific Payload (variable) -- The traffic selector (e.g.,
            multicast address) specific to the OID encoded using DER. Some OID
            policy settings do not require the use of an OID-Specific payload,
            in which case this field is not included in the TEK and the OID-Specific Payload Length is set to zero.</t>

            <t>SPI (4 octets) -- Identifier for the Current Key. This field
            represents an SPI.</t>

            <t>Auth Alg (2 octets) -- Authentication Algorithm ID. Valid
            values are defined in <xref target="AuthAlg"></xref>.</t>

            <t>Enc Alg (2 octets) -- Confidentiality Algorithm ID. Valid
            values are defined in <xref target="KeyAlg"></xref>.</t>

            <t>Remaining Lifetime value (4 octets) -- The number of seconds
            remaining before this TEK expires. A value of zero (0) shall
            indicate that the TEK does not have an expire time.</t>

            <t>SA Data Attributes (variable length) -- Contains zero or more
            attributes associated with this SA. <xref
            target="tek-attributes"></xref> defines attributes.</t>
          </list></t>

        <section title="Selectors">

   <t>The OID and (optionally) an OID-Specific payload together define
   the selectors for the network traffic. While they may match
          the OID and OID-Specific payload that the GM had previously
          requested in the ID payload, there is no guarantee that this will be
          the case. Including selectors in the SA TEK is important for at
          least the following reasons:<list style="symbols">
              <t>The Key Server (KS) policy may direct the KS to return multiple TEKs, each
              representing different traffic selectors, and it is important that every GM receiving the set of TEKs explicitly identify the
              traffic selectors associated with the TEK.</t>

              <t>The KS policy may include the use of a GDOI GROUPKEY-PUSH
              message, which distributes new or replacement TEKs to group
              members. Since the GROUPKEY-PUSH message does not contain an ID
              payload, the TEK definition must include the traffic
              selectors.</t>
            </list></t>
        </section>

        <section anchor="AuthAlg" title="Authentication Algorithms">
          <t>This memo defines the following authentication algorithms for use
          with this TEK. These algorithms are defined in <xref
          target="IEC-TR-61850-90-5"></xref>, including requirements on one or
          more algorithms defined as mandatory to implement.</t>

          <t><list style="symbols">
              <t>NONE. Specifies that an authentication algorithm is not
              required, or when the accompanying confidentiality algorithm
              includes authentication (e.g., AES-GCM-128). See <xref
              target="Security"></xref> for cautionary notes regarding using
              this value without any confidentiality algorithm.</t>

              <t>HMAC-SHA256-128. Specifies the use of SHA-256 <xref
              target="FIPS180-4"></xref> combined with HMAC <xref
              target="RFC2104"></xref>. The output is truncated to 128 bits,
              as per <xref target="RFC2104"></xref>. The key size is the size
              of the hash value produced by SHA-256 (256 bits).</t>

              <t>HMAC-SHA256. Specifies the use of SHA-256 <xref
              target="FIPS180-4"></xref> combined with HMAC <xref
              target="RFC2104"></xref>. The key size is the size of the hash
              value produced by SHA-256 (256 bits).</t>

              <t>AES-GMAC-128. Specifies the use of AES <xref
              target="FIPS197"></xref> in the Galois Message Authentication
              Code (GMAC) mode <xref target="SP.800-38D"></xref> with a 128-bit key size.</t>

              <t>AES-GMAC-256. Specifies the use of AES <xref
              target="FIPS197"></xref> in the Galois Message Authentication
              Code (GMAC) mode <xref target="SP.800-38D"></xref> with a 256-bit key size.</t>
            </list></t>
        </section>

        <section anchor="KeyAlg" title="Confidentiality Algorithms">
          <t>This memo defines the following confidentiality algorithms for
          use with this TEK. These algorithms are defined in <xref
          target="IEC-TR-61850-90-5"></xref>, including requirements on one or
          more algorithms defined as mandatory to implement.</t>

          <t><list style="symbols">
              <t>NONE. Specifies that confidentiality is not required. Note:
              See <xref target="Security"></xref> for guidance on cautionary
              notes regarding using this value.</t>

              <t>AES-CBC-128. Specifies the use of AES <xref
              target="FIPS197"></xref> in the Cipher Block Chaining (CBC) mode
              <xref target="SP.800-38A"></xref> with a 128-bit key size. This
              encryption algorithm does not provide authentication and MUST
              NOT be used with the NONE authentication algorithm.</t>

              <t>AES-CBC-256. Specifies the use of AES <xref
              target="FIPS197"></xref> in the Cipher Block Chaining (CBC) mode
              <xref target="SP.800-38A"></xref> with a 256-bit key size. This
              encryption algorithm does not provide authentication and MUST
              NOT be used with the NONE authentication algorithm.</t>

              <t>AES-GCM-128. Specifies the use of AES <xref
              target="FIPS197"></xref> in the Galois/Counter Mode (GCM) mode
              <xref target="SP.800-38D"></xref> with a 128-bit key size. This
              encryption algorithm provides authentication and is used with a
              NONE authentication algorithm.</t>

              <t>AES-GCM-256. Specifies the use of AES <xref
              target="FIPS197"></xref> in the Galois/Counter Mode (GCM) mode
              <xref target="SP.800-38D"></xref> with a 256-bit key size. This
              encryption algorithm provides authentication and is used with a
              NONE authentication algorithm.</t>
            </list></t>
        </section>

        <section anchor="tek-attributes" title="SA Attributes">
          <t>The following attributes may be present in an SA TEK. The
          attributes must follow the format described in <xref
          target="isakmp-attributes"></xref>).</t>

          <section title="SA Time Activation Delay (SA_ATD)">
            <t>A GCKS will sometimes distribute an SA TEK in advance of when
            it is expected to be used. This is communicated to group members
            using the SA Activation Time Delay (SA_ATD) attribute. When a GM
            receives an SA_TEK with this attribute, it waits for the number of
            seconds contained within the attribute before installing it for
            either transmitting or receiving.</t>

            <t>This Activation Time Delay attribute applies only this SA, and
            MAY be used in either a GROUPKEY-PULL or GROUPKEY-PUSH exchange.
            RFC 6407 also describes an ACTIVATION_TIME_DELAY attribute for the
            Group Associated Policy (GAP) payload, which is applied to all
            Security Associations and is restricted to use in a GROUPKEY-PUSH
            message. If both attributes are included in a GROUPKEY-PUSH
            payload, the value contained in SA_ATD will be used.</t>
          </section>

          <section title="Key Delivery Assurance (SA_KDA)">
            <t>Group policy can include notifying a multicast source
            ("Publisher") of an indication of whether multicast receivers
            ("Subscribers") have previously received the SA TEK. This
            notification allows a Publisher to set a policy as to whether to
            activate the new SA TEK or not based on the percentage of
            Subscribers that are able to receive packets protected by the SA
            TEK. The attribute value is a number between 0 and 100
            (inclusive).</t>
          </section>
        </section>

        <section title="SPI Discussion">
          <t>As noted in <xref target="INTRO"></xref>, RFC 6407 requires that
          characteristics of an SPI must be defined. An SPI in a
          GDOI_PROTO_IEC_61850 SA TEK is represented as a Key Identifier
          (KeyID). The SPI size is 4 octets. The SPI is unilaterally chosen by
          the GCKS using any method chosen by the implementation. However, an
          implementation needs to take care not to duplicate an SPI value that
          is currently in use for a particular group.</t>
        </section>
      </section>

      <section anchor="KD-Payload" title="KD Payload">
        <t>The KD payload contains group keys for the policy specified in the
        SA Payload. It is comprised of a set of Key Packets, each of which
        hold the keying material associated with an SPI (i.e., an IEC 61850 Key
        Identifier). The RFC 6407 KD payload format is reproduced in <xref
        target="kd"></xref>.</t>

        <t><figure anchor="kd" title="KD Payload">
            <preamble></preamble>

            <artwork align="center"><![CDATA[
 0                   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  !   RESERVED    !         Payload Length        !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! Number of Key Packets         !            RESERVED2          !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
~                    Key Packets                                ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
]]></artwork>

            <postamble></postamble>
          </figure></t>

        <t>Each Key Packet holds the keying material associated with a
        particular IEC 61850 Key Identifier, although GDOI refers to it as an
        SPI. The keying material is described in a set of attributes
        indicating an encryption key, integrity key, etc., in accordance with
        the security policy of the group as defined by the associated SA
        Payload. Each Key Packet has the following format, reproduced in <xref
        target="key-packet"></xref>.<figure anchor="key-packet"
            suppress-title="false" title="Key Packet">
            <preamble></preamble>

            <artwork align="center"><![CDATA[
 0                   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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!   KD Type     !   RESERVED    !       Key Packet Length       !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!    SPI Size   !                   SPI (variable)              ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
~                    Key Packet Attributes                      ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
]]></artwork>

            <postamble></postamble>
          </figure>No changes are needed to GDOI in order to distribute IEC
        61850 keying material, but the keys MUST be distributed as defined in
        Section 5.6 of RFC 6407. The KD Type MUST be TEK (1).</t>

        <t>A key associated with an IEC 61850 authentication algorithm
        (distributed in the Auth Alg field) MUST be distributed as a
        TEK_INTEGRITY_KEY attribute. The value of the attribute is interpreted
        according to the type of key distributed in the SA TEK:</t>

        <t><list style="symbols">
            <t>HMAC-SHA256-128, HMAC-SHA256. The value is 32 octets.</t>

            <t>AES-GMAC-128. The value is 20 octets. The first 16 octets are
            the 128-bit AES key, and the remaining four octets are used as the
            salt value in the nonce.</t>

            <t>AES-GMAC-256. The value is 36 octets. The first 32 octets are
            the 256-bit AES key, and the remaining four octets are used as the
            salt value in the nonce.</t>
          </list>A key associated with an IEC 61850 confidentiality algorithm
        (distributed in the Enc Alg SA TEK field) MUST be distributed as a
        TEK_ALGORITHM_KEY attribute. The value of the attribute is interpreted
        according to the type of key distributed in the SA TEK:</t>

        <t><list style="symbols">
            <t>AES-CBC-128. The value is 16 octets.</t>

            <t>AES-CBC-256. The value is 32 octets.</t>

            <t>AES-GCM-128. The value is 20 octets. The first 16 octets are
            the 128-bit AES key, and the remaining four octets are used as the
            salt value in the nonce.</t>

            <t>AES-GCM-256. The value is 36 octets. The first 32 octets are
            the 256-bit AES key, and the remaining four octets are used as the
            salt value in the nonce.</t>
          </list></t>
      </section>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>GDOI is a Security Association (SA) management protocol for groups of
      senders and receivers. This protocol performs authentication of
      communicating protocol participants (Group Member, Group Controller/Key
      Server). GDOI provides confidentiality of key management messages, and
      it provides source authentication of those messages. GDOI includes
      defenses against man-in-middle, connection-hijacking, replay,
      reflection, and denial-of-service (DOS) attacks on unsecured networks.
      GDOI assumes that the network is not secure and may be under the complete
      control of an attacker. The Security Considerations described in RFC
      6407 are relevant to the distribution of GOOSE and sampled values policy
      as defined in this memo.</t>

      <t>Message Authentication is an optional property for IEC 62351 Security
      Services; however, when encryption is used, authentication MUST also be
      provided by using an authenticated encryption algorithm such as
      AES-GCM-128 or by using a specific authentication algorithm such as
      HMAC-SHA-256.

 Setting the authentication algorithm to NONE but setting
      the confidentiality algorithm to an algorithm that does not include
      authentication (i.e., is marked with an N in the "Authenticated
      Encryption" column of the "IEC 62351-9 Confidentiality Values"
      registry) is not safe and MUST NOT be done.</t>

      <t>When Message Authentication is used, a common practice is to truncate
      the output of a MAC and include some of the bits in the integrity
      protection field of the data security transform. Current guidance in
      <xref target="RFC2104"></xref> is to truncate no less than half of the
      length of the hash output. The authentication algorithm HMAC-SHA256-128
      defined in this memo truncates the output to exactly half of the output,
      which follows this guidance.</t>

      <t>Confidentiality is an optional security property for IEC 62351
      Security Services. Confidentiality Algorithm IDs SHOULD be included in
      the IEC 61850 SA TEK payload if the IEC 61850 messages are expected to
      traverse public network links and are not protected by another level of
      encryption (e.g., an encrypted Virtual Private Network). Current
      cryptographic advice indicates that the use of AES-CBC-128 for
      confidentiality is sufficient for the foreseeable future <xref
      target="SP.800-131A"></xref>, but some security policies may require the
      use of AES-CBC-256.</t>

      <t>IEC 62351 Security Services describe a variety of policy choices for
      protecting network traffic, including the option of specifying no
      protection at all. This is enabled with the use of NONE as an
      authentication algorithm and/or confidentiality algorithm. The following
      guidance is given regarding the use of NONE.</t>

      <t><list style="symbols">
          <t>Setting both the authentication algorithm and confidentiality
          algorithm to NONE is possible but NOT RECOMMENDED. Setting such a
          policy is sometimes necessary during a migration period, when
          traffic is being protected incrementally and some traffic has not
          yet been scheduled for protection. Alternatively, site security
          policy for some packet flows requires inspection of packet data on
          the private network followed by network-layer encryption before
          delivery to a public network.</t>

          <t>Setting the confidentiality algorithm to NONE but setting the
          authentication algorithm to a MAC can be an acceptable policy in the
          following conditions: the disclosed information in the data packets
          is comprised of raw data values and the disclosure of the data
          files is believed to be of no more value to an observer than traffic
          analysis on the frequency and size of packets protected for
          confidentiality. Alternatively, site security policy for some packet
          flows requires inspection of packet data on the private network
          followed by network-layer encryption before delivery to a public
          network.</t>

          <t>Setting the authentication algorithm to NONE but setting the
          confidentiality algorithm to an algorithm that does not include
          authentication is not safe and MUST NOT be done.</t>
        </list></t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>The "Group Domain of
      Interpretation (GDOI) Payloads" registry <xref
      target="GDOI-REG"></xref> has been updated as described below. The terms "Expert Review", "Reserved", and "Private 
      Use" are used as defined in <xref target="RFC5226"/>.

<list style="symbols">
      <t>GDOI_PROTO_IEC_61850 (value 3) has been added to the "SA TEK Payload
      Values - Protocol-ID" registry.
</t>

      <t>A new "IEC 62351-9 Authentication Values" registry has been
      created. This registry defines Auth Alg values.
      Initial values for the registry are given below; future assignments
      are to be made through "Expert Review" <xref target="RFC5226"/>.

      <figure>
        <artwork align="left"><![CDATA[
   Name                         Value
   ----                         -----
   Reserved                       0
   NONE                           1
   HMAC-SHA256-128                2
   HMAC-SHA256                    3
   AES-GMAC-128                   4
   AES-GMAC-256                   5
   Unassigned                  6-61439
   Reserved for Private Use  61440-65535
 ]]></artwork></figure></t>


      <t>A new "IEC 62351-9 Confidentiality Values" registry has been
      created. This registry defines Enc Alg values.
      Initial values for the registry are given below; future assignments
      are to be made through "Expert Review" <xref target="RFC5226"/>.

      <figure>
          <artwork align="left"><![CDATA[
   Name                         Value     Authenticated Encryption
   ----                         -----     ------------------------
   Reserved                       0
   NONE                           1 
   AES-CBC-128                    2                 N
   AES-CBC-256                    3                 N
   AES-GCM-128                    4                 Y
   AES-GCM-256                    5                 Y
   Unassigned                  6-61439
   Reserved for Private Use  61440-65535
 ]]></artwork></figure></t>

      <t>A new "GDOI SA TEK Attributes" registry has been created. This
      registry defines SA TEK attributes.
      Initial values for the registry are given below; future assignments
      are to be made through "Expert Review" <xref target="RFC5226"/>.
      In the table, attributes that are defined as Type/Value (TV) are marked as Basic (B);
      attributes that are defined as Type/Length/Value (TLV) are marked as Variable (V).

      <figure>
          <artwork align="left"><![CDATA[
   Attribute                    Value           Type
   ---------                    -----           ----
   Reserved                       0
   SA_ATD                         1               V
   SA_KDA                         2               B
   Unassigned                  3-28671
   Reserved for Private Use   28672-32767]]></artwork></figure></t>

      <t>A new "ID Types" registry has been created for the Identification Payload
      when the DOI is GDOI. This registry is taken from the "IPSEC Identification Type"
registry for the IPsec DOI <xref target="IPSEC-DOI-REG"/>.  Values
1-12 are defined identically to the equivalent values in the "IPSEC
Identification Type" registry. Value 13 (ID_OID) is defined in this memo. Initial values for the registry are given below; future assignments
    are to be made through "Expert Review" <xref target="RFC5226"/>.

      <figure>
          <artwork align="left"><![CDATA[
   Name                          Value
   ----                          -----
   Reserved                        0
   ID_IPV4_ADDR                    1
   ID_FQDN                         2
   ID_USER_FQDN                    3
   ID_IPV4_ADDR_SUBNET             4
   ID_IPV6_ADDR                    5
   ID_IPV6_ADDR_SUBNET             6
   ID_IPV4_ADDR_RANGE              7
   ID_IPV6_ADDR_RANGE              8
   ID_DER_ASN1_DN                  9
   ID_DER_ASN1_GN                  10
   ID_KEY_ID                       11
   ID_LIST                         12
   ID_OID                          13
   Unassigned                   14-61439
   Reserved for Private Use   61440-65535
 ]]></artwork></figure></t>
	</list></t>
    </section>

  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>

      <?rfc include='reference.RFC.5226'?>

      <?rfc include='reference.RFC.6407'?>
      <?rfc include='reference.RFC.8174'?>


      <reference anchor="IEC-62351-9">
        <front>
          <title>Power systems management and associated information exchange
	  - Data and communications security - Part 9: Cyber security key management for
	  power system equipment</title>

          <author>
            <organization>International Electrotechnical
            Commission</organization>
          </author>

          <date month="May" year="2017" />
        </front>

        <seriesInfo name="IEC" value="62351-9:2017" />
      </reference>
    </references>

    <references title="Informative References">
      <reference anchor="IEC-61850-9-2" target="">
        <front>
          <title>Communication networks and systems for power utility
          automation - Part 9-2: Specific communication service mapping (SCSM)
          - Sampled values over ISO/IEC 8802-3</title>

          <author>
            <organization>International Electrotechnical
            Commission</organization>
          </author>

          <date day="22" month="September" year="2011" />
        </front>

        <seriesInfo name="IEC" value="61850-2" />
      </reference>

      <reference anchor="IEC-62351-6" target="">
        <front>
          <title>Power systems management and associated information exchange
          &ndash; Data and communications security &ndash; Part 6: Security
          for IEC 61850</title>

          <author>
            <organization>International Electrotechnical
            Commission</organization>
          </author>

          <date day="" month="June" year="2007" />
        </front>

        <seriesInfo name="IEC" value="62351-6" />
      </reference>

      <reference anchor="IEC-TR-61850-90-5" target="">
        <front>
          <title>Communication networks and systems for power utility
          automation - Part 90-5: Use of IEC 61850 to transmit synchrophasor
          information according to IEEE C37.118</title>

          <author>
            <organization>International Electrotechnical
            Commission</organization>
          </author>

          <date day="6" month="May" year="2012" />
        </front>

        <seriesInfo name="IEC TR" value="62351-90-5" />
      </reference>

<reference anchor="IPSEC-DOI-REG" target="http://www.iana.org/assignments/isakmp-registry">
<front><title>&apos;Magic Numbers&apos; for ISAKMP Protocol</title>
<author><organization>IANA</organization></author>
<date/></front>
</reference>

      <reference anchor="ITU-T-X.683" target="https://www.itu.int/rec/T-REC-X.683-201508-I/en">
        <front>
          <title>Information technology - Abstract Syntax Notation One
          (ASN.1): Parameterization of ASN.1 specifications</title>

          <author>
            <organization>International Telecommunications Union</organization>
          </author>

          <date month="August" year="2015" />
        </front>

        <seriesInfo name="ITU-T"
                    value="Recommendation X.683" />
      </reference>


      <reference anchor="ITU-T-X.690" target="https://www.itu.int/rec/T-REC-X.690-201508-I/en">
        <front>
          <title>Information technology - ASN.1 encoding rules: Specification of
          Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and
          Distinguished Encoding Rules (DER)</title>

          <author>
            <organization>International Telecommunications Union</organization>
          </author>

          <date month="August" year="2015" />
        </front>

        <seriesInfo name="ITU-T"
                    value="Recommendation X.690" />
      </reference>

      <?rfc include='reference.RFC.2104'?>

      <reference anchor="IEC-61850-8-1">
        <front>
          <title>Communication networks and systems for power utility
          automation - Part 8-1: Specific communication service mapping (SCSM)
          - Mappings to MMS (ISO 9506-1 and ISO 9506-2) and to ISO/IEC
          8802-3</title>

          <author>
            <organization>International Electrotechnical
            Commission</organization>
          </author>

          <date day="" month="June" year="2011" />
        </front>

        <seriesInfo name="IEC" value="61850-8-1" />
      </reference>

      <reference anchor="GDOI-REG"
                 target="http://www.iana.org/assignments/gdoi-payloads">
        <front>
          <title>Group Domain of Interpretation (GDOI) Payloads</title>

          <author>
            <organization>IANA</organization>
          </author>

          <date />
        </front>
      </reference>

      <reference anchor="FIPS180-4" target="http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf">

        <front>
          <title>Secure Hash Standard</title>

          <author>
            <organization>National Institute of Standards and
            Technology</organization>
          </author>

          <date month="August" year="2015" />
        </front>

        <seriesInfo name="FIPS" value="PUB 180-4" />
<seriesInfo name="DOI" value="10.6028/NIST.FIPS.180-4" />
      </reference>

      <reference anchor="SP.800-131A" target="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar1.pdf">

        <front>
<title>Transitions: Recommendation for Transitioning the Use of Cryptographic
Algorithms and Key Lengths</title>
          
          <author fullname="Elaine Barker" initials="E." surname="Barker">
          </author>

          <author fullname="Allen Roginsky" initials="A." surname="Roginsky">
          </author>

          <date month="November" year="2015" />
        </front>

        <seriesInfo name="NIST Special Publication"
                    value="800-131A" />
<seriesInfo name="DOI" value="10.6028/NIST.SP.800-131Ar1" />
      </reference>

      <reference anchor="SP.800-38A" 
target="http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf">
        <front>
          <title>Recommendation for Block Cipher Modes of Operation: Methods
	  and Techniques</title>

          <author fullname="Morris Dworkin" initials="M." surname="Dworkin">
          </author>

          <date month="December" year="2001" />
        </front>

        <seriesInfo name="NIST Special Publication"
                    value="800-38A" />
<seriesInfo name="DOI" value="10.6028/NIST.SP.800-38A" />
      
</reference>


<reference anchor="SP.800-38D"
	   target="http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf">
<front>
<title>Recommendation for Block Cipher Modes of Operation:                                         
          Galois/Counter Mode (GCM) and GMAC</title>
<author fullname="Dworkin" initials="M." surname="Dworkin">

</author>
<date month="November" year="2007" />
</front>
<seriesInfo name="NIST Special Publication" value="800-38D"/>
<seriesInfo name="DOI" value="10.6028/NIST.SP.800-38D"/>
</reference>


      <reference anchor="FIPS197" target="http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf">
        <front>
          <title>Advanced Encryption Standard (AES)</title>

          <author fullname="" surname="">
             <organization>National Institute of Standards and                                                
            Technology</organization>

          </author>

          <date month="November" year="2001" />
        </front>

        <seriesInfo name="FIPS PUB"
                    value="197" />
      </reference>
    </references>

    <section title="Example ID, SA TEK, and KD Payloads for IEC 61850">
      <t>An Intelligent Electronic Device (IED) begins a GROUPKEY-PULL exchange and requests keys and security
      policy for 61850_UDP_ADDR_GOOSE (OID = 1.2.840.10070.61850.8.1.2 as
      defined in <xref target="IEC-61850-9-2"></xref>) and IP multicast
      address 233.252.0.1 encoded as specified in <xref
      target="IEC-61850-9-2"></xref>.</t>

      <t>OID and OID-Specific Payload protocol fields are variable-length
      fields. To improve readability, their representations in Figures <xref
      target="sample-id" format="counter"></xref> and <xref target="sample-sa"
      format="counter"></xref> are
      "compressed", as indicated by a trailing "~" for these
      fields. Implementations should be aware that because these fields are
      variably sized, some payload fields may not be conveniently aligned on
      an even octet.</t>

      <t>Note: The actual DER for the OID-Specific Payload field is defined
      in <xref target="IEC-62351-6"></xref>.</t>

      <t><figure anchor="sample-id" title="Sample Identification Payload">
          <preamble></preamble>

          <artwork align="center"><![CDATA[
 0                   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  !   RESERVED    !         Payload Length        !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! ID Type=13    !     DOI-Specific ID Data = 0                  !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! OID Len=13    ! OID=<06 0B 2A 86 48 CE 56 83 E3 1A 08 01 02>  ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! OID-Specific Payload Len      ! OID SP=<DER for 233.252.0.1>  ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!]]></artwork>

          <postamble></postamble>
        </figure></t>

      <t>The Key Server responds with the following SA TEK payload including
      two GDOI_PROTO_IEC_61850 Protocol-Specific TEK payloads in the second
      GROUPKEY-PULL message. The first one is to be activated immediately and
      has a lifetime of 3600 seconds (0x0E10) remaining. The second has a
      lifetime of 12 hours (0xA8C0) and should be activated in 3300 seconds
      (0x0CE4), which gives a 5-minute (300-second) overlap of the two
      SAs.</t>

      <t><figure anchor="sample-sa" title="Sample IEC 61850 SA  Payload">
          <preamble></preamble>

          <artwork align="center"><![CDATA[
 0                   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  !   RESERVED    !         Payload Length        !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                             DOI = 2                           !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                         Situation = 0                         !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! SA Attr NP=16 (SA TEK)        !          RESERVED2            !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! NP=16 (SA TEK)!   RESERVED    !         Payload Length        !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! Prot-ID=3     !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! OID Len=13    ! OID=<06 0B 2A 86 48 CE 56 83 E3 1A 08 01 02>  ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! OID-Specific Payload Len      !OID SP=<DER for 233.252.0.1>   ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                            SPI=1                              !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!  AuthAlg=1 (HMAC-SHA256-128)  !    EncAlg=2  (AES-CBC-128)    !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!              Remaining Lifetime=0x0E01                        !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! SA Attr NP=16 (SA TEK)        !          RESERVED2            !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! NP=0          !   RESERVED    !         Payload Length        !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! Prot-ID=3     !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! OID Len=13    ! OID=<06 0B 2A 86 48 CE 56 83 E3 1A 08 01 02>  ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! OID-Specific Payload Len      !OID SP=<DER for 233.252.0.1>   ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                            SPI=2                              !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!       AuthAlg=0 (NONE)        !    EncAlg=4 (AES-GCM-128)     !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!              Remaining Lifetime=0xA8C0                        !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!       Type=1 (SA_ATD)         !           Length=4            !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                        Value=0x0CE4                           !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
]]></artwork>

          <postamble></postamble>
        </figure></t>

      <t>The IED acknowledges that it is capable and willing to use this
      policy in the third GROUPKEY-PULL message. In response, the KS sends a KD
      payload to the requesting IED. This concludes the GROUPKEY-PULL
      exchange.</t>

      <figure anchor="sample-kd" title="Sample KD Payload">
        <preamble></preamble>

        <artwork align="center"><![CDATA[ 0                   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  !   RESERVED    !         Payload Length        !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! Number of Key Packets=2       !            RESERVED2          !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!   KD Type=1   !   RESERVED    !        Key Packet Length      !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!   SPI Size=4  !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                            SPI=1                              !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! TYPE=TEK_INTEGRITY_KEY (2)    ! LENGTH=32 (256-bit key)       !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                                                               !
!                                                               !
!                                                               !
!                        HMAC-SHA256 Key                        !
!                                                               !
!                                                               !
!                                                               !
!                                                               !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! TYPE=TEK_ALGORITHM_KEY (1)    ! LENGTH=16                     !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                                                               !
!                        AES-CBC-128 Key                        !
!                                                               !
!                                                               !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!   KD Type=1   !   RESERVED    !        Key Packet Length      !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!   SPI Size=4  !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                            SPI=2                              !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
! TYPE=TEK_ALGORITHM_KEY (1)    ! LENGTH=20                     !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
!                                                               !
!                    AES-GCM-128 Key & Salt                     !
!                                                               !
!                                                               !
!                                                               !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-!
]]></artwork>

        <postamble></postamble>
      </figure>

      <t></t>
    </section>

    <section title="Implementation Considerations">
      <t>Several topics have been suggested as useful for implementers.</t>

      <section title="DER Length Fields">
        <t>The ID and SA TEK payloads defined in this memo include explicit
        lengths for fields formatted as DER. This includes the OID Length and
        OID-Specific Payload Length fields shown in Figures <xref
        target="id_oid" format="counter"></xref> and <xref target="iec-sa-tek"
	format="counter"></xref>.
        Strictly speaking, these lengths are redundant since the length of the
        DER value is also encoded within the DER fields. It would be possible
        to determine the lengths of the fields from those encoded values.
        However, many implementations will find the explicit length fields
        convenient when constructing and sanity checking the GDOI messages
        including these payloads. Implementations will thus be spared from
        manipulating the DER itself when performing activities that do not
        otherwise require parsing in order to obtain values therein.</t>
      </section>

      <section title="Groups with Multiple Senders">
        <t>GCKS policy may specify more than one protected type of IEC 61850
        message within a GDOI group. This is represented within a GDOI SA
        Payload by the presence of an SA TEK payload for each multicast group
        that is protected as part of group policy. The OID contained in each
        of the SA TEK payloads may be identical, but the value of each OID- Specific Payload would be unique. Typically, the OID-Specific payload
        defines a destination address, and there is typically a single sender
        to that destination address.</t>
      </section>
    </section>

    <section anchor="isakmp-attributes" title="Data Attribute Format">
      <t>Data attributes attached to an SA TEK following the data attribute
      format are described in this section. Data attributes can be in Type/Value
      (TV) format (useful when a value is defined to be less than two octets
      in size) or in Type/Length/Value (TLV) form.</t>

      <t><figure align="center" anchor="attributes" title="Data Attributes">
          <artwork><![CDATA[                     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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!A!       Attribute Type        !    AF=0  Attribute Length     !
!F!                             !    AF=1  Attribute Value      !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
.                   AF=0  Attribute Value                       .
.                   AF=1  Not Transmitted                       .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
        </figure>The Data Attributes fields are defined as follows:</t>

      <t><list style="symbols">
          <t>Attribute Type (2 octets) -- Unique identifier for each type of
          attribute. These attributes are defined as part of the DOI-specific
          information. The most significant bit, or Attribute Format (AF),
          indicates whether the data attributes follow the Type/Length/Value
          (TLV) format or a shortened Type/Value (TV) format. If the AF bit is
          a zero (0), then the data attributes are of the Type/Length/Value
          (TLV) form. If the AF bit is a one (1), then the data attributes are
          of the Type/Value form.</t>

          <t>Attribute Length (2 octets) -- Length in octets of the Attribute
          Value. When the AF bit is a one (1), the Attribute Value is only 2
          octets, and the Attribute Length field is not present.</t>

          <t>Attribute Value (variable length) -- Value of the attribute
          associated with the DOI-specific Attribute Type. If the AF bit is a
          zero (0), this field has a variable length defined by the Attribute
          Length field. If the AF bit is a one (1), the Attribute Value has a
          length of 2 octets.</t>
        </list></t>
    </section>
    <section anchor="Acknowledgements" title="Acknowledgements" numbered="no">
      <t>The authors thank Sean Turner, Steffen Fries, Yoav Nir, Vincent
      Roca, Dennis Bourget, and David Boose for their thoughtful reviews, each
      of which resulted in substantial improvements to this memo. Joe Salowey
      provided valuable guidance as document shepherd during the publication
      process. The authors are indebted to Kathleen Moriarty for her agreement
      to sponsor the publication of the document.</t>
    </section>

  </back>
</rfc>
