<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="info" docName="draft-du-spring-srv6-function-encryption-00"
     ipr="trust200902">
  <front>
    <title abbrev="Encryption of SRv6 Function ">Encryption of SRv6 Function
    in SRv6 Network</title>

    <author fullname="Zongpeng Du" initials="Z." surname="Du">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street>No.32 XuanWuMen West Street</street>

          <city>Beijing</city>

          <code>100053</code>

          <country>China</country>
        </postal>

        <email>duzongpeng@foxmail.com</email>
      </address>
    </author>

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

    <area>Routing Area</area>

    <workgroup>Spring Working Group</workgroup>

    <keyword>SRH</keyword>

    <abstract>
      <t>This document describes an encryption mechanism for the SRv6 function
      in the SRv6 nodes.</t>
    </abstract>

    <note title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119">RFC 2119</xref>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t/>

      <t>In <xref target="I-D.jliu-tpp-srv6"/>, a trusted network path
      mechanism based on SRv6 is proposed to enable the path verification. To
      protect the path information, when forwarding a packet with an encrypted
      SRH header, each intermediate router needs to replace the source and
      destination filed of IPv6 Header with itself IPv6 address and its
      downstream router's IPv6 address and then forward it.</t>

      <t>However, it is more straightforward that we still maintain the IPv6
      header as usual, and just encrypt the function part of each SID. Thus,
      the attacker will only know where the packet would be forwarded to, and
      will not know what function would be executed in the next
      destination.</t>

      <t>This document proposes an encryption mechanism for the SRH header to
      enhance the SRv6 security and protect the personal privacy in an SRv6
      network.</t>
    </section>

    <section anchor="EncryptingSRv6Function" title="Encrypting SRv6 Function">
      <t>According to <xref target="RFC8986"/>, an SRv6 SID can contain LOC,
      FUNCT, and ARG parts, where a locator (LOC) is routeable in the network,
      and the function (FUNCT) and arguments (ARG) will trigger the specific
      behavior on the corresponding node. The ARG can also be regarded as part
      of the FUNCT, which may or maynot appear in an SRv6 SID.</t>

      <t>In this document, we suggest that we can encrypt the FUNCT part, and
      the ARG part if included. In the scenario, every node that supports the
      additional security of the function in the segment list, should have a
      key for the encryption. The encrypted SIDs should be marked, so that the
      node can decrypt the FUNCT part, and trigger the proper behavior.</t>

      <t>A general procedure called option 1 in this document is described as
      follows:</t>

      <t><list style="numbers">
          <t>The network element that makes up the SID list, for example the
          controller or the Headend node, should have the keys of the nodes
          along the path. When scheduling the SID list, the network element
          can encrypt the FUNCT part of an SID by using the key of the node
          related to the SID. Hence, the LOC part in the SID list is
          plaintext&#65292;and the FUNCT part is ciphertext. If the FUNCT part
          is encrypted, a flag should also be marked for it.</t>

          <t>The Headend node sends out the packet containing the encrypted
          SID and the flag.</t>

          <t>When an intermediate router receives the packet and the LOC part
          in the DA can be matched, it will see the flag and decrypt the FUNCT
          part. After that, the SID will be looked up in the SID table. The
          key should be the same as the one that is used to make up the
          SID.</t>

          <t>The intermediate router executes the function, and if the current
          SID is not the last one, the intermediate router forwards the packet
          to the next destination.</t>
        </list></t>

      <t>Alternatively, we can also encrypt the LOC part of the next SID, so
      as to protect the path information. Another procedure called option 2 in
      this docuanment is described as follows:</t>

      <t><list style="numbers">
          <t>The network element that makes up the SID list, for example the
          controller or the Headend node, should have the keys of the nodes
          along the path. When scheduling the SID list, the network element
          can encrypt the FUNCT part of an SID and the LOC part of the next
          SID if present by using the key of the node related to the current
          SID. Hence, the LOC part of the first SID is plaintext, the LOC part
          of the other SID is ciphertext, and the FUNCT part of all SIDs is
          ciphertext. If the FUNCT part is encrypted, a flag should be marked
          for it.</t>

          <t>The Headend node sends out the packet containing the encrypted
          SID and the flag.</t>

          <t>When an intermediate router receives the packet and the LOC part
          in the DA can be matched, it will see the flag and decrypt the FUNCT
          part, and the LOC part of the next SID if present. After that, the
          decrypted SID will be looked up in the SID table. The key used for
          the decryption should be the same as the the one that is used to
          make up the SID.</t>

          <t>The intermediate router executes the function, and if the current
          SID is not the last one, the intermediate router forwards the packet
          to the next destination.</t>
        </list>For the traditional mechanism, option 1, and option 2, three
      figures are shown as below.</t>

      <t/>

      <t><figure anchor="fig-traditional" title="Traditional SRv6 Forwarding">
          <artwork><![CDATA[
  +----------+       +----------+       +----------+       +----------+
  |  Ingress |       |  P1 Node |       |  P2 Node |       |  Egress  |
  |    PE    |<----->|    P     |<----->|    P     |<----->|    PE    |
  +----------+       +----------+       +----------+       +----------+

  Traditional:     
     underlayIP<SA,DA>     underlayIP<SA,DA>     underlayIP<SA,DA>
    =<IngressIP,P1::F1>   =<IngressIP,P2::F2>   =<IngressIP,Egress::F3>
      with SRH=(             with SRH=(            with SRH=( 
          Egress::F3,            Egress::F3,           Egress::F3,
          P2::F2,                P2::F2,               P2::F2,
          P1::F1,                P1::F1,               P1::F1,
          SL=2                   SL=1                  SL=0
      )                      )                     )

    overlayIP<SA,DA>      overlayIP<SA,DA>      overlayIP<SA,DA> 
    =<clientIP,serverIP>  =<clientIP,serverIP>  =<clientIP,serverIP>

]]></artwork>
        </figure>In Figure 1, the packet from a client enters the provider
      network, and is encapsulated with another IP header with an SRH
      containing three SIDs. The Ingress PE is the Headend node, and the P1
      and P2 nodes are the intermediate routers.</t>

      <figure anchor="fig-option1"
              title="Encrypting SRv6 Function in Option 1 ">
        <artwork><![CDATA[
  +----------+       +----------+       +----------+       +----------+
  |  Ingress |       |  P1 Node |       |  P2 Node |       |  Egress  |
  |    PE    |<----->|    P     |<----->|    P     |<----->|    PE    |
  +----------+       +----------+       +----------+       +----------+
 
  Option1:     
     underlayIP<SA,DA>     underlayIP<SA,DA>     underlayIP<SA,DA>
    =<IngressIP,P1::EF1>  =<IngressIP,P2::EF2>  =<IngressIP,Egress::EF3>
      with SRH=(             with SRH=(            with SRH=( 
          Egress::EF3,           Egress::EF3,          Egress::EF3,
          P2::EF2,               P2::EF2,              P2::EF2,
          P1::EF1,               P1::EF1,              P1::EF1,
          SL=2                   SL=1                  SL=0
      )                      )                     )

    overlayIP<SA,DA>      overlayIP<SA,DA>      overlayIP<SA,DA> 
    =<clientIP,serverIP>  =<clientIP,serverIP>  =<clientIP,serverIP>

]]></artwork>
      </figure>

      <t>In Figure 2, the format of the packet is similar to the traditional
      one, but the function part is encrypted. For example, after the P1 node
      receives the EF1, it will be decrypted to F1, and then trigger the
      proper function.</t>

      <figure anchor="fig-option2"
              title="Encrypting SRv6 Function in Option 2">
        <artwork><![CDATA[
  +----------+       +----------+       +----------+       +----------+
  |  Ingress |       |  P1 Node |       |  P2 Node |       |  Egress  |
  |    PE    |<----->|    P     |<----->|    P     |<----->|    PE    |
  +----------+       +----------+       +----------+       +----------+

  Option2:     
     underlayIP<SA,DA>     underlayIP<SA,DA>     underlayIP<SA,DA>
    =<IngressIP,P1::EF1>  =<IngressIP,P2::EF2>  =<IngressIP,Egress::EF3>
      with SRH=(             with SRH=(            with SRH=( 
          EEgress::EF3,          EEgress::EF3,         EEgress::EF3,
          EP2::EF2,              EP2::EF2,             EP2::EF2,
          P1::EF1,               P1::EF1,              P1::EF1,
          SL=2                   SL=1                  SL=0
      )                      )                     )

    overlayIP<SA,DA>      overlayIP<SA,DA>      overlayIP<SA,DA> 
    =<clientIP,serverIP>  =<clientIP,serverIP>  =<clientIP,serverIP>

]]></artwork>
      </figure>

      <t>In Figure 3, the format of the packet is similar to the option 1.
      Additionally, the LOC part is also encrypted except the first SID. After
      the P1 node receives the EF1, it will be decrypted to F1, and then
      trigger the proper function. Meanwhile, the P1 node will also decrypt
      the EP2 to P2, so as to make up the next DA as P2::EF2, which is
      routeable, instead of the EP2::EF2.</t>

      <t/>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>TBD.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>TBD.</t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>TBD.</t>
    </section>
  </middle>

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

    <references title="Informative References">
      <?rfc include="reference.RFC.8986"?>

      <?rfc include="reference.I-D.jliu-tpp-srv6"?>
    </references>
  </back>
</rfc>
