Compressed SID (C-SID) for SRv6 SFC
Internet-Draft draft-lh-spring-srv6-sfc-csid-02
Cheng Li, Ed.
Huawei
China
c.l@huawei.com
Weiqiang Cheng
China Mobile
China
chengweiqiang@chinamobile.com
Hongyi Huang, Ed.
Huawei
China
hongyi.huang@huawei.com
29 February 2024
Routing Area
SPRING Working Group
Service programming
Compression
In SRv6, an SRv6 SID is a 128-bit value. When too many 128-bit SRv6 SIDs are included in an SRH, the introduced overhead will affect the transmission efficiency of payload. In order to address this problem, Compressed SID(C-SID) is proposed. This document defines new behaviors for service segments with REPLACE-C-SID and NEXT-C-SID flavors to enable compressed SRv6 service programming.
Introduction
Segment Routing [RFC8402] is a source routing paradigm to support steering packets through a programmed path at the ingress node. Currently, two data planes are defined for Segment Routing: MPLS and IPv6. When IPv6 data plane is used in Segment Routing, it is called SRv6 [RFC8754] . [RFC8754] defines a new extension header in IPv6, called Segment Routing Header (SRH), to support SRv6. To support SRv6 network programming, [RFC8986] defines a framework to build a network program with topological and service segments carried in a Segment Routing header (SRH) [RFC8754].
A Service Function Chain (SFC) [RFC7665] defines an ordered set of abstract service functions and ordering constraints that must be applied to packets and/or frames and/or flows.
A service function chain can be implemented by SRv6 by using a sequence of SRv6 SIDs including service segments defined in [I-D.ietf-spring-sr-service-programming].
However, when too many 128-bit SRv6 SIDs are included in an SRH, the overhead of the SRH will affect the transmission efficiency of the payload. [I-D.srcompdt-spring-compression-requirement] points out the problem of long SRv6 SID lists reduce payload efficiency. To mitigate such overhead, [I-D.ietf-spring-srv6-srh-compression] defines new flavors for basic SR endpoint behaviors defined in [RFC8986]. Using the new flavored behavior SID, a 128-bit SRv6 SID can be compressed to be an 32-bit or 16-bit Compressed SID (C-SID), which reduces a lot of size of the SRv6 header.
To enable SRv6 SID lists compression for service function chaining (SFC), this document defines new behaviors of service segments with flavors defined in [I-D.ietf-spring-srv6-srh-compression].
Requirements Language
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.
Terminology
This document leverages the terms defined in [RFC8402], [RFC8754], [RFC8986], [I-D.ietf-spring-srv6-srh-compression] and [I-D.ietf-spring-sr-service-programming]. The reader is assumed to be familiar with this terminology. This document does not introduce any new terms.
SR Proxy Behaviors
[I-D.ietf-spring-sr-service-programming] defines several SRv6 endpoint behaviors for service proxy segments. A service proxy segment ID is represented as an 128-bit value just like other SIDs defined in [RFC8986]. This section defines some new behaviors of those service proxy segments by combining the existing service proxy segment behaviors with C-SID flavors, such as REPLACE-C-SID flavor and NEXT-C-SID flavor.
The main difference between behaviors are the forwarding instructions. Therefore, when C-SID compression mechanism applies to SR Proxy behaviors, the pseudo code of the new behaviors can be generated by updating the forwarding instructions of C-SID to SR proxy forwarding instructions. The following sections define the details of the pseudo code of new behaviors.
Static SR Proxy
Static Proxy for Inner Type Ethernet
REPLACE-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 static proxy SID with the REPLACE-C-SID flavor for Ethernet traffic, the procedure described in Section 4.2.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line R10 and R21 that are both replaced as follows.

P01.   If (Upper-layer header type != 143 (Ethernet)) {
P02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
P03.   }
P04.   Perform IPv6 decapsulation.
P05.   Submit the frame to the Ethernet module for transmission via
         interface IFACE-OUT.

A rendering of the complete pseudocode is provided in Appendix A.1.
The upper-layer header processing is unchanged as per Section 6.1.2.1 of [I-D.ietf-spring-sr-service-programming].
When processing an Ethernet frame received on the interface IFACE-IN and with a destination MAC address that is neither a broadcast address nor matches the address of IFACE-IN, as per Section 6.1.2.1 of [I-D.ietf-spring-sr-service-programming].
NEXT-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 static proxy SID with the NEXT-C-SID flavor for Ethernet traffic, the procedure described in Section 4.1.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line N08 of that and line S15 of Section 4.1 of [RFC8986] that are both replaced as follows.

Q01.   If (Upper-layer header type != 143 (Ethernet)) {
Q02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
Q03.   }
Q04.   Perform IPv6 decapsulation.
Q05.   Submit the frame to the Ethernet module for transmission via
         interface IFACE-OUT.

A rendering of the complete pseudocode is provided in Appendix A.2.
The upper-layer header processing is unchanged as per Section 6.1.2.1 of [I-D.ietf-spring-sr-service-programming].
When processing an Ethernet frame received on the interface IFACE-IN and with a destination MAC address that is neither a broadcast address nor matches the address of IFACE-IN, as per Section 6.1.2.1 of [I-D.ietf-spring-sr-service-programming].
Static Proxy for Inner Type IPv4
REPLACE-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 static proxy SID with the REPLACE-C-SID flavor for IPv4 traffic, the procedure described in Section 4.2.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line R10 and R21 that are both replaced as follows.

P01.   If (Upper-layer header type != 4 (IPv4)) {
P02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
P03.   }
P04.   Perform IPv6 decapsulation.
P05.   Submit the packet to the IPv4 module for transmission on
         interface IFACE-OUT via NH-ADDR.

A rendering of the complete pseudocode is provided in Appendix A.3.
The upper-layer header processing is unchanged as per Section 6.1.2.2 of [I-D.ietf-spring-sr-service-programming].
When processing an IPv4 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN, as per Section 6.1.2.2 of [I-D.ietf-spring-sr-service-programming].
NEXT-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 static proxy SID with the NEXT-C-SID flavor for IPv4 traffic, the procedure described in Section 4.1.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line N08 of that and line S15 of Section 4.1 of [RFC8986] that are both replaced as follows.

Q01.   If (Upper-layer header type != 4 (IPv4)) {
Q02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
Q03.   }
Q04.   Perform IPv6 decapsulation.
Q05.   Submit the packet to the IPv4 module for transmission on
         interface IFACE-OUT via NH-ADDR.

A rendering of the complete pseudocode is provided in Appendix A.4.
The upper-layer header processing is unchanged as per Section 6.1.2.2 of [I-D.ietf-spring-sr-service-programming].
When processing an IPv4 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN, as per Section 6.1.2.2 of [I-D.ietf-spring-sr-service-programming].
Static Proxy for Inner Type IPv6
REPLACE-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 static proxy SID with the REPLACE-C-SID flavor for IPv6 traffic, the procedure described in Section 4.2.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line R10 and R21 that are both replaced as follows.

P01.   If (Upper-layer header type != 41 (IPv6)) {
P02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
P03.   }
P04.   Perform IPv6 decapsulation.
P05.   Submit the packet to the IPv6 module for transmission on
         interface IFACE-OUT via NH-ADDR.

A rendering of the complete pseudocode is provided in Appendix A.5.
The upper-layer header processing is unchanged as per Section 6.1.2.3 of [I-D.ietf-spring-sr-service-programming].
When processing an IPv6 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN, as per Section 6.1.2.3 of [I-D.ietf-spring-sr-service-programming].
NEXT-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 static proxy SID with the NEXT-C-SID flavor for IPv6 traffic, the procedure described in Section 4.1.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line N08 of that and line S15 of Section 4.1 of [RFC8986] that are both replaced as follows.

Q01.   If (Upper-layer header type != 41 (IPv6)) {
Q02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
Q03.   }
Q04.   Perform IPv6 decapsulation.
Q05.   Submit the packet to the IPv6 module for transmission on
         interface IFACE-OUT via NH-ADDR.

A rendering of the complete pseudocode is provided in Appendix A.6.
The upper-layer header processing is unchanged as per Section 6.1.2.3 of [I-D.ietf-spring-sr-service-programming].
When processing an IPv6 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN, as per Section 6.1.2.3 of [I-D.ietf-spring-sr-service-programming].
Dynamic SR Proxy
Dynamic Proxy for Inner Type Ethernet
REPLACE-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the REPLACE-C-SID flavor for Ethernet traffic, the procedure described in Section 4.2.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line R10 and R21 that are both replaced as follows.

P01.   If (Upper-layer header type != 143 (Ethernet)) {
P02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
P03.   }
P04.   Copy the IPv6 encapsulation in a CACHE entry associated with
            the interface IFACE-IN.
P05.   Perform IPv6 decapsulation.
P06.   Submit the frame to the Ethernet module for transmission via
         interface IFACE-OUT.

A rendering of the complete pseudocode is provided in Appendix A.7.
The upper-layer header processing is unchanged as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
When processing an Ethernet frame received on the interface IFACE-IN and with a destination MAC address that is neither a broadcast address nor matches the address of IFACE-IN, as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
NEXT-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the NEXT-C-SID flavor for Ethernet traffic, the procedure described in Section 4.1.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line N08 of that and line S15 of Section 4.1 of [RFC8986] that are both replaced as follows.

Q01.   If (Upper-layer header type != 143 (Ethernet)) {
Q02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
Q03.   }
Q04.   Copy the IPv6 encapsulation in a CACHE entry associated with
            the interface IFACE-IN.
Q05.   Perform IPv6 decapsulation.
Q06.   Submit the frame to the Ethernet module for transmission via
         interface IFACE-OUT.

A rendering of the complete pseudocode is provided in Appendix A.8.
The upper-layer header processing is unchanged as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
When processing an Ethernet frame received on the interface IFACE-IN and with a destination MAC address that is neither a broadcast address nor matches the address of IFACE-IN, as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
Dynamic Proxy for Inner Type IPv4
REPLACE-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the REPLACE-C-SID flavor for IPv4 traffic, the procedure described in Section 4.2.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line R10 and R21 that are both replaced as follows.

P01.   If (Upper-layer header type != 4 (IPv4)) {
P02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
P03.   }
P04.   Copy the IPv6 encapsulation in a CACHE entry associated with
            the interface IFACE-IN.
P05.   Perform IPv6 decapsulation.
P06.   Submit the frame to the IPv4 module for transmission via
         interface IFACE-OUT via NH-ADDR.

A rendering of the complete pseudocode is provided in Appendix A.9.
The upper-layer header processing is unchanged as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
When processing an IPv4 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN, as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
NEXT-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the NEXT-C-SID flavor for IPv4 traffic, the procedure described in Section 4.1.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line N08 of that and line S15 of Section 4.1 of [RFC8986] that are both replaced as follows.

Q01. If (Upper-layer header type != 4 (IPv4)) {
Q02.   Resubmit the packet to the IPv6 module for transmission to
        the new destination.
Q03. }
Q04. Copy the IPv6 encapsulation in a CACHE entry associated with
        the interface IFACE-IN.
Q05. Perform IPv6 decapsulation.
Q06. Submit the frame to the IPv4 module for transmission via
      interface IFACE-OUT via NH-ADDR.

A rendering of the complete pseudocode is provided in Appendix A.10.
The upper-layer header processing is unchanged as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
When processing an IPv4 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN, as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
Dynamic Proxy for Inner Type IPv6
REPLACE-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the REPLACE-C-SID flavor for IPv6 traffic, the procedure described in Section 4.2.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line R10 and R21 that are both replaced as follows.

P01. If (Upper-layer header type != 41 (IPv6)) {
P02.   Resubmit the packet to the IPv6 module for transmission to
        the new destination.
P03. }
P04. Copy the IPv6 encapsulation in a CACHE entry associated with
        the interface IFACE-IN.
P05. Perform IPv6 decapsulation.
P06. Submit the frame to the IPv6 module for transmission via
      interface IFACE-OUT via NH-ADDR.

A rendering of the complete pseudocode is provided in Appendix A.11.
The upper-layer header processing is unchanged as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
When processing an IPv6 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN, as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
NEXT-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the NEXT-C-SID flavor for IPv6 traffic, the procedure described in Section 4.1.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line N08 of that and line S15 of Section 4.1 of [RFC8986] that are both replaced as follows.

Q01. If (Upper-layer header type != 41 (IPv6)) {
Q02.   Resubmit the packet to the IPv6 module for transmission to
        the new destination.
Q03. }
Q04. Copy the IPv6 encapsulation in a CACHE entry associated with
        the interface IFACE-IN.
Q05. Perform IPv6 decapsulation.
Q06. Submit the frame to the IPv6 module for transmission via
      interface IFACE-OUT via NH-ADDR.

A rendering of the complete pseudocode is provided in Appendix A.12.
The upper-layer header processing is unchanged as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
When processing an IPv6 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN, as per Section 6.2.2 of [I-D.ietf-spring-sr-service-programming].
Shared Memory SR Proxy
This document does not define new flavors for shared proxy behavior as it is just an SR endpoint behavior.
Masquerading SR Proxy
As per [I-D.ietf-spring-sr-service-programming], when forwarding packets to SR-unaware SFs, masquerading SR proxy sets the destination address of the IPv6 header as segment list[0] which is the original final destination address. When receiving the traffic returning from the service, de-masquerading sets the destination address as segment list[Segment Left].
To be consistent with the behavior of masquerading proxy, it's required that any segment list containing one or more masquerading proxy C-SID MUST NOT apply any compression encoding to the last segment (segment list[0]).
Note: The service receiving an IPv6 packet from the proxy uses the destination address (copied from last segment) as final destination and could apply certain actions based on that. In order to process and forward packets correctly, it is required that the last segment not be compressed.
To be consistent with the behavior of masquerading proxy, when processing an IPv6 packet matching a FIB entry locally instantiated as an SRv6 masquerading C-SID, it's required that the updated destination address MUST be cached in the proxy by adding a dynamic caching mechanism similar to the one described in Section 6.2 of [I-D.ietf-spring-sr-service-programming] in case that segment list[Segment Left] is a compressed SID.
When processing an IPv6 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN, the destination address MUST be recovered from CACHE in case that segment list[Segment Left] could be a C-SID container.
SRv6 Masquerading Proxy Pseudocode
REPLACE-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 masquerading proxy SID with the REPLACE-C-SID flavor, the procedure described in Figure 23 from Section 4.2.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line R10 and R21 that are both replaced as follows.

P01. Copy the IPv6 Destination Address in a CACHE entry associated
      with the interface IFACE-IN.
P02. Copy Segment List[0] from the SRH to the Destination Address
      of the IPv6 header.
P03. Submit the packet to the IPv6 module for transmission on
      interface IFACE-OUT via NH-ADDR.

A rendering of the complete pseudocode is provided in Appendix A.13.
De-masquerading: When processing an IPv6 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN, the procedure described in Figure 24 from Section 6.4.1 of [I-D.ietf-spring-sr-service-programming] is executed except for line S10 that is replaced as follows.

D01. Retrieve the CACHE entry associated with IFACE-IN.
D02. If the CACHE entry is not empty {
D03.    Destination Address of the IPv6 header is set to CACHE.
D04. }

A rendering of the complete pseudocode is provided in Appendix A.14.
NEXT-C-SID Flavor
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 masquerading proxy SID with the NEXT-C-SID flavor, the procedure described in Section 4.1.1 of [I-D.ietf-spring-srv6-srh-compression] is executed except for line N08 of that and line S15 of Section 4.1 of [RFC8986] that are both replaced as follows.

Q01. Copy the IPv6 Destination Address in a CACHE entry associated
      with the interface IFACE-IN.
Q02. Copy Segment List[0] from the SRH to the Destination Address
      of the IPv6 header.
Q03. Submit the packet to the IPv6 module for transmission on
      interface IFACE-OUT via NH-ADDR.

A rendering of the complete pseudocode is provided in Appendix A.15}.
De-masquerading: When processing an IPv6 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN, the procedure described in Section 6.4.1 of [I-D.ietf-spring-sr-service-programming] is executed except for line S10 that is replaced as follows.

E01. Retrieve the CACHE entry associated with IFACE-IN.
E02. If the CACHE entry is not empty {
E03.    Destination Address of the IPv6 header is set to CACHE.
E04. }

A rendering of the complete pseudocode is provided in Appendix A.16.
Destination NAT Flavor
REPLACE-C-SID Flavor
The Destination NAT flavor of the SRv6 masquerading proxy with the REPLACE-C-SID is executed except for line S09.1 and S10 in Section 6.4.2 of [I-D.ietf-spring-sr-service-programming] replaced as follows.

P01. Copy the Destination Address of the IPv6 header to the
      Segment List[0] entry of the SRH.
P02. Retrieve the CACHE entry associated with IFACE-IN.
P03. If the CACHE entry is not empty {
P04.    Destination Address of the IPv6 header is set to CACHE.
P05. }

A rendering of the complete pseudocode is provided in Appendix A.17.
NEXT-C-SID Flavor
The Destination NAT flavor of the SRv6 masquerading proxy with the NEXT-C-SID is executed except for line S09.1 and S10 in Section 6.4.2 of [I-D.ietf-spring-sr-service-programming] replaced as follows.

Q01. Copy the Destination Address of the IPv6 header to the
      Segment List[0] entry of the SRH.
Q02. Retrieve the CACHE entry associated with IFACE-IN.
Q03. If the CACHE entry is not empty {
Q04.    Destination Address of the IPv6 header is set to CACHE.
Q05. }

A rendering of the complete pseudocode is provided in Appendix A.18.
Cache Flavor
The caching flavor of the SRv6 masquerading proxy with C-SID is enabled as per Section 6.4.3 of [I-D.ietf-spring-sr-service-programming] without any modification.
Security Considerations
The security requirements and mechanisms described in [RFC8402] and [RFC8754] also apply to this document.
This document does not introduce any new security considerations.
IANA Considerations
TBD
References
Normative References
[RFC2119]

Key words for use in RFCs to Indicate Requirement Levels
S. Bradner
March 1997
BCP 14
RFC 2119
DOI 10.17487/RFC2119
[RFC8174]

Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
B. Leiba
May 2017
BCP 14
RFC 8174
DOI 10.17487/RFC8174
[RFC8402]

Segment Routing Architecture
C. Filsfils, Ed.
S. Previdi, Ed.
L. Ginsberg
B. Decraene
S. Litkowski
R. Shakir
July 2018
RFC 8402
DOI 10.17487/RFC8402
[RFC8754]

IPv6 Segment Routing Header (SRH)
C. Filsfils, Ed.
D. Dukes, Ed.
S. Previdi
J. Leddy
S. Matsushima
D. Voyer
March 2020
RFC 8754
DOI 10.17487/RFC8754
[RFC8986]

Segment Routing over IPv6 (SRv6) Network Programming
C. Filsfils, Ed.
P. Camarillo, Ed.
J. Leddy
D. Voyer
S. Matsushima
Z. Li
February 2021
RFC 8986
DOI 10.17487/RFC8986
[I-D.ietf-spring-srv6-srh-compression]

Compressed SRv6 Segment List Encoding
Weiqiang Cheng
China Mobile
Clarence Filsfils
Cisco Systems, Inc.
Zhenbin Li
Huawei Technologies
Bruno Decraene
Orange
Francois Clad
Cisco Systems, Inc.
14 February 2024
Internet-Draft draft-ietf-spring-srv6-srh-compression-12
[I-D.ietf-spring-sr-service-programming]

Service Programming with Segment Routing
Francois Clad
Cisco Systems, Inc.
Xiaohu Xu
China Mobile
Clarence Filsfils
Cisco Systems, Inc.
Daniel Bernier
Bell Canada
Cheng Li
Huawei
Bruno Decraene
Orange
Shaowen Ma
Mellanox
Chaitanya Yadlapalli
AT&T
Wim Henderickx
Nokia
Stefano Salsano
Universita di Roma "Tor Vergata"
20 February 2024
Internet-Draft draft-ietf-spring-sr-service-programming-09
Informative References
[RFC7665]

Service Function Chaining (SFC) Architecture
J. Halpern, Ed.
C. Pignataro, Ed.
October 2015
RFC 7665
DOI 10.17487/RFC7665
[I-D.srcompdt-spring-compression-requirement]

Compressed SRv6 SID List Requirements
Weiqiang Cheng
China Mobile
Chongfeng Xie
China Telecom
Ron Bonica
Juniper
Darren Dukes
Cisco Systems
Cheng Li
Huawei
Shaofu Peng
ZTE
Wim Henderickx
Nokia
11 July 2021
Internet-Draft draft-srcompdt-spring-compression-requirement-07
Complete Pseudocodes
REPLACE-C-SID Flavor for Static Proxy for Inner Type Ethernet
When processing the SRH of a packet matching a FIB entry locally instantiated as an SRv6 static proxy SID with the REPLACE-C-SID flavor for Ethernet traffic:

S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 0)) {
S03.     Stop processing the SRH, and proceed to process the next
           header in the packet, whose type is identified by
           the Next Header field in the routing header.
S04.   }
S05.   If (IPv6 Hop Limit <= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry > max_LE) or (Segments Left > Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
P01.       If (Upper-layer header type != 143 (Ethernet)) {
P02.         Resubmit the packet to the IPv6 module for
                transmission to the new destination.
P03.       }
P04.       Perform IPv6 decapsulation.
P05.       Submit the frame to the Ethernet module for transmission
             via interface IFACE-OUT.
R11.     }
R12.   } Else {
R13.     If((Last Entry > max_LE) or (Segments Left > Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
P01.   If (Upper-layer header type != 143 (Ethernet)) {
P02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
P03.   }
P04.   Perform IPv6 decapsulation.
P05.   Submit the frame to the Ethernet module for transmission via
         interface IFACE-OUT.
S16. }

NEXT-C-SID Flavor for Static Proxy for Inner Type Ethernet
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 static proxy SID with the NEXT-C-SID flavor for Ethernet traffic:

N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit <= 1) {
N03.     Send an ICMP Time Exceeded message to the Source Address
           with Code 0 (Hop limit exceeded in transit),
           interrupt packet processing, and discard the packet.
N04.   }
N05.   Copy the value of DA.Argument into the bits [LBL..(LBL+AL-1)]
         of the Destination Address.
N06.   Set the bits [(LBL+AL)..127] of the Destination Address to
         zero.
N07.   Decrement IPv6 Hop Limit by 1.
Q01.   If (Upper-layer header type != 143 (Ethernet)) {
Q02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
Q03.   }
Q04.   Perform IPv6 decapsulation.
Q05.   Submit the frame to the Ethernet module for transmission via
           interface IFACE-OUT.
N09. }
S02. If (Segments Left == 0) {
S03.   Stop processing the SRH, and proceed to process the next
         header in the packet, whose type is identified by
         the Next Header field in the routing header.
S04. }
S05. If (IPv6 Hop Limit <= 1) {
S06.   Send an ICMP Time Exceeded message to the Source Address
         with Code 0 (Hop limit exceeded in transit),
         interrupt packet processing, and discard the packet.
S07. }
S08. max_LE = (Hdr Ext Len / 2) - 1
S09. If ((Last Entry > max_LE) or (Segments Left > Last Entry+1)) {
S10.   Send an ICMP Parameter Problem to the Source Address
         with Code 0 (Erroneous header field encountered)
         and Pointer set to the Segments Left field,
         interrupt packet processing, and discard the packet.
S11. }
S12. Decrement IPv6 Hop Limit by 1.
S13. Decrement Segments Left by 1.
S14. Update IPv6 DA with Segment List[Segments Left].
Q01. If (Upper-layer header type != 143 (Ethernet)) {
Q02.   Resubmit the packet to the IPv6 module for transmission to
         the new destination.
Q03. }
Q04. Perform IPv6 decapsulation.
Q05. Submit the frame to the Ethernet module for transmission via
        interface IFACE-OUT.

REPLACE-C-SID Flavor for Static Proxy for Inner Type IPv4
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 static proxy SID with the REPLACE-C-SID flavor for IPv4 traffic:

S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 0)) {
S03.     Stop processing the SRH, and proceed to process the next
           header in the packet, whose type is identified by
           the Next Header field in the routing header.
S04.   }
S05.   If (IPv6 Hop Limit <= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry > max_LE) or (Segments Left > Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
P01.       If (Upper-layer header type != 4 (IPv4)) {
P02.         Resubmit the packet to the IPv6 module for transmission
               to the new destination.
P03.       }
P04.       Perform IPv6 decapsulation.
P05.       Submit the packet to the IPv4 module for transmission on
             interface IFACE-OUT via NH-ADDR.
R11.     }
R12.   } Else {
R13.     If((Last Entry > max_LE) or (Segments Left > Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
P01.   If (Upper-layer header type != 4 (IPv4)) {
P02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
P03.   }
P04.   Perform IPv6 decapsulation.
P05.   Submit the packet to the IPv4 module for transmission on
         interface IFACE-OUT via NH-ADDR.
S16. }

NEXT-C-SID Flavor for Static Proxy for Inner Type IPv4
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 static proxy SID with the NEXT-C-SID flavor for IPv4 traffic:

N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit <= 1) {
N03.     Send an ICMP Time Exceeded message to the Source Address
           with Code 0 (Hop limit exceeded in transit),
           interrupt packet processing, and discard the packet.
N04.   }
N05.   Copy the value of DA.Argument into the bits [LBL..(LBL+AL-1)]
         of the Destination Address.
N06.   Set the bits [(LBL+AL)..127] of the Destination Address to
         zero.
N07.   Decrement IPv6 Hop Limit by 1.
Q01.   If (Upper-layer header type != 4 (IPv4)) {
Q02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
Q03.   }
Q04.   Perform IPv6 decapsulation.
Q05.   Submit the packet to the IPv4 module for transmission on
         interface IFACE-OUT via NH-ADDR.
N09. }
S02. If (Segments Left == 0) {
S03.   Stop processing the SRH, and proceed to process the next
         header in the packet, whose type is identified by
         the Next Header field in the routing header.
S04. }
S05. If (IPv6 Hop Limit <= 1) {
S06.   Send an ICMP Time Exceeded message to the Source Address
         with Code 0 (Hop limit exceeded in transit),
         interrupt packet processing, and discard the packet.
S07. }
S08. max_LE = (Hdr Ext Len / 2) - 1
S09. If ((Last Entry > max_LE) or (Segments Left > Last Entry+1)) {
S10.   Send an ICMP Parameter Problem to the Source Address
         with Code 0 (Erroneous header field encountered)
         and Pointer set to the Segments Left field,
         interrupt packet processing, and discard the packet.
S11. }
S12. Decrement IPv6 Hop Limit by 1.
S13. Decrement Segments Left by 1.
S14. Update IPv6 DA with Segment List[Segments Left].
Q01. If (Upper-layer header type != 4 (IPv4)) {
Q02.   Resubmit the packet to the IPv6 module for transmission to
         the new destination.
Q03. }
Q04. Perform IPv6 decapsulation.
Q05. Submit the packet to the IPv4 module for transmission on
       interface IFACE-OUT via NH-ADDR.

REPLACE-C-SID Flavor for Static Proxy for Inner Type IPv6
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 static proxy SID with the REPLACE-C-SID flavor for IPv6 traffic:

S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 0)) {
S03.     Stop processing the SRH, and proceed to process the next
           header in the packet, whose type is identified by
           the Next Header field in the routing header.
S04.   }
S05.   If (IPv6 Hop Limit <= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry > max_LE) or (Segments Left > Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
P01.     If (Upper-layer header type != 41 (IPv6)) {
P02.       Resubmit the packet to the IPv6 module for transmission to
             the new destination.
P03.     }
P04.     Perform IPv6 decapsulation.
P05.     Submit the packet to the IPv6 module for transmission on
         interface IFACE-OUT via NH-ADDR.
R11.     }
R12.   } Else {
R13.     If((Last Entry > max_LE) or (Segments Left > Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
P01.   If (Upper-layer header type != 41 (IPv6)) {
P02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
P03.   }
P04.   Perform IPv6 decapsulation.
P05.   Submit the packet to the IPv6 module for transmission on
         interface IFACE-OUT via NH-ADDR.
S16. }

NEXT-C-SID Flavor for Static Proxy for Inner Type IPv6
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 static proxy SID with the NEXT-C-SID flavor for IPv6 traffic:

N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit <= 1) {
N03.     Send an ICMP Time Exceeded message to the Source Address
           with Code 0 (Hop limit exceeded in transit),
           interrupt packet processing, and discard the packet.
N04.   }
N05.   Copy the value of DA.Argument into the bits [LBL..(LBL+AL-1)]
         of the Destination Address.
N06.   Set the bits [(LBL+AL)..127] of the Destination Address to
         zero.
N07.   Decrement IPv6 Hop Limit by 1.
Q01.   If (Upper-layer header type != 41 (IPv6)) {
Q02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
Q03.   }
Q04.   Perform IPv6 decapsulation.
Q05.   Submit the packet to the IPv6 module for transmission on
         interface IFACE-OUT via NH-ADDR.
N09. }
S02. If (Segments Left == 0) {
S03.   Stop processing the SRH, and proceed to process the next
         header in the packet, whose type is identified by
         the Next Header field in the routing header.
S04. }
S05. If (IPv6 Hop Limit <= 1) {
S06.   Send an ICMP Time Exceeded message to the Source Address
         with Code 0 (Hop limit exceeded in transit),
         interrupt packet processing, and discard the packet.
S07. }
S08. max_LE = (Hdr Ext Len / 2) - 1
S09. If ((Last Entry > max_LE) or (Segments Left > Last Entry+1)) {
S10.   Send an ICMP Parameter Problem to the Source Address
         with Code 0 (Erroneous header field encountered)
         and Pointer set to the Segments Left field,
         interrupt packet processing, and discard the packet.
S11. }
S12. Decrement IPv6 Hop Limit by 1.
S13. Decrement Segments Left by 1.
S14. Update IPv6 DA with Segment List[Segments Left].
Q01. If (Upper-layer header type != 41 (IPv6)) {
Q02.   Resubmit the packet to the IPv6 module for transmission to
        the new destination.
Q03. }
Q04. Perform IPv6 decapsulation.
Q05. Submit the packet to the IPv6 module for transmission on
       interface IFACE-OUT via NH-ADDR.

REPLACE-C-SID Flavor for Dynamic Proxy for Inner Type Ethernet
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the REPLACE-C-SID flavor for Ethernet traffic:

S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 0)) {
S03.     Stop processing the SRH, and proceed to process the next
           header in the packet, whose type is identified by
           the Next Header field in the routing header.
S04.   }
S05.   If (IPv6 Hop Limit <= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry > max_LE) or (Segments Left > Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
P01.       If (Upper-layer header type != 143 (Ethernet)) {
P02.         Resubmit the packet to the IPv6 module for transmission to
               the new destination.
P03.       }
P04.       Copy the IPv6 encapsulation in a CACHE entry associated with
                the interface IFACE-IN.
P05.       Perform IPv6 decapsulation.
P06.       Submit the frame to the Ethernet module for transmission via
         interface IFACE-OUT.
R11.     }
R12.   } Else {
R13.     If((Last Entry > max_LE) or (Segments Left > Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
P01.   If (Upper-layer header type != 143 (Ethernet)) {
P02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
P03.   }
P04.   Copy the IPv6 encapsulation in a CACHE entry associated with
            the interface IFACE-IN.
P05.   Perform IPv6 decapsulation.
P06.   Submit the frame to the Ethernet module for transmission via
         interface IFACE-OUT.
S16. }

NEXT-C-SID Flavor for Dynamic Proxy for Inner Type Ethernet
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the NEXT-C-SID flavor for Ethernet traffic:

N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit <= 1) {
N03.     Send an ICMP Time Exceeded message to the Source Address
           with Code 0 (Hop limit exceeded in transit),
           interrupt packet processing, and discard the packet.
N04.   }
N05.   Copy the value of DA.Argument into the bits [LBL..(LBL+AL-1)]
         of the Destination Address.
N06.   Set the bits [(LBL+AL)..127] of the Destination Address to
         zero.
N07.   Decrement IPv6 Hop Limit by 1.
Q01.   If (Upper-layer header type != 143 (Ethernet)) {
Q02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
Q03.   }
Q04.   Copy the IPv6 encapsulation in a CACHE entry associated with
            the interface IFACE-IN.
Q05.   Perform IPv6 decapsulation.
Q06.   Submit the frame to the Ethernet module for transmission via
         interface IFACE-OUT.
N09. }
S02. If (Segments Left == 0) {
S03.   Stop processing the SRH, and proceed to process the next
         header in the packet, whose type is identified by
         the Next Header field in the routing header.
S04. }
S05. If (IPv6 Hop Limit <= 1) {
S06.   Send an ICMP Time Exceeded message to the Source Address
         with Code 0 (Hop limit exceeded in transit),
         interrupt packet processing, and discard the packet.
S07. }
S08. max_LE = (Hdr Ext Len / 2) - 1
S09. If ((Last Entry > max_LE) or (Segments Left > Last Entry+1)) {
S10.   Send an ICMP Parameter Problem to the Source Address
         with Code 0 (Erroneous header field encountered)
         and Pointer set to the Segments Left field,
         interrupt packet processing, and discard the packet.
S11. }
S12. Decrement IPv6 Hop Limit by 1.
S13. Decrement Segments Left by 1.
S14. Update IPv6 DA with Segment List[Segments Left].
Q01. If (Upper-layer header type != 143 (Ethernet)) {
Q02.   Resubmit the packet to the IPv6 module for transmission to
        the new destination.
Q03. }
Q04. Copy the IPv6 encapsulation in a CACHE entry associated with
        the interface IFACE-IN.
Q05. Perform IPv6 decapsulation.
Q06. Submit the frame to the Ethernet module for transmission via
       interface IFACE-OUT.

REPLACE-C-SID Flavor for Dynamic Proxy for Inner Type IPv4
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the REPLACE-C-SID flavor for IPv4 traffic:

S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 0)) {
S03.     Stop processing the SRH, and proceed to process the next
           header in the packet, whose type is identified by
           the Next Header field in the routing header.
S04.   }
S05.   If (IPv6 Hop Limit <= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry > max_LE) or (Segments Left > Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
P01.       If (Upper-layer header type != 4 (IPv4)) {
P02.        Resubmit the packet to the IPv6 module for transmission to
               the new destination.
P03.       }
P04.       Copy the IPv6 encapsulation in a CACHE entry associated with
                the interface IFACE-IN.
P05.       Perform IPv6 decapsulation.
P06.       Submit the frame to the IPv4 module for transmission via
             interface IFACE-OUT via NH-ADDR.
R11.     }
R12.   } Else {
R13.     If((Last Entry > max_LE) or (Segments Left > Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
P01.   If (Upper-layer header type != 4 (IPv4)) {
P02.     Resubmit the packet to the IPv6 module for transmission to
           the new destination.
P03.   }
P04.   Copy the IPv6 encapsulation in a CACHE entry associated with
            the interface IFACE-IN.
P05.   Perform IPv6 decapsulation.
P06.   Submit the frame to the IPv4 module for transmission via
         interface IFACE-OUT via NH-ADDR.
S16. }

NEXT-C-SID Flavor for Dynamic Proxy for Inner Type IPv4
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the NEXT-C-SID flavor for IPv4 traffic:

N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit <= 1) {
N03.     Send an ICMP Time Exceeded message to the Source Address
           with Code 0 (Hop limit exceeded in transit),
           interrupt packet processing, and discard the packet.
N04.   }
N05.   Copy the value of DA.Argument into the bits [LBL..(LBL+AL-1)]
         of the Destination Address.
N06.   Set the bits [(LBL+AL)..127] of the Destination Address to
         zero.
N07.   Decrement IPv6 Hop Limit by 1.
Q01.   If (Upper-layer header type != 4 (IPv4)) {
Q02.     Resubmit the packet to the IPv6 module for transmission to
          the new destination.
Q03.   }
Q04.   Copy the IPv6 encapsulation in a CACHE entry associated with
          the interface IFACE-IN.
Q05.   Perform IPv6 decapsulation.
Q06.   Submit the frame to the IPv4 module for transmission via
          interface IFACE-OUT via NH-ADDR.
N09. }
S02. If (Segments Left == 0) {
S03.   Stop processing the SRH, and proceed to process the next
         header in the packet, whose type is identified by
         the Next Header field in the routing header.
S04. }
S05. If (IPv6 Hop Limit <= 1) {
S06.   Send an ICMP Time Exceeded message to the Source Address
         with Code 0 (Hop limit exceeded in transit),
         interrupt packet processing, and discard the packet.
S07. }
S08. max_LE = (Hdr Ext Len / 2) - 1
S09. If ((Last Entry > max_LE) or (Segments Left > Last Entry+1)) {
S10.   Send an ICMP Parameter Problem to the Source Address
         with Code 0 (Erroneous header field encountered)
         and Pointer set to the Segments Left field,
         interrupt packet processing, and discard the packet.
S11. }
S12. Decrement IPv6 Hop Limit by 1.
S13. Decrement Segments Left by 1.
S14. Update IPv6 DA with Segment List[Segments Left].
Q01. If (Upper-layer header type != 4 (IPv4)) {
Q02.   Resubmit the packet to the IPv6 module for transmission to
        the new destination.
Q03. }
Q04. Copy the IPv6 encapsulation in a CACHE entry associated with
        the interface IFACE-IN.
Q05. Perform IPv6 decapsulation.
Q06. Submit the frame to the IPv4 module for transmission via
      interface IFACE-OUT via NH-ADDR.

REPLACE-C-SID Flavor for Dynamic Proxy for Inner Type IPv6
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the REPLACE-C-SID flavor for IPv6 traffic:

S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 0)) {
S03.     Stop processing the SRH, and proceed to process the next
           header in the packet, whose type is identified by
           the Next Header field in the routing header.
S04.   }
S05.   If (IPv6 Hop Limit <= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry > max_LE) or (Segments Left > Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
P01.       If (Upper-layer header type != 41 (IPv6)) {
P02.       Resubmit the packet to the IPv6 module for transmission to
           the new destination.
P03.       }
P04.     Copy the IPv6 encapsulation in a CACHE entry associated with
            the interface IFACE-IN.
P05.     Perform IPv6 decapsulation.
P06.     Submit the frame to the IPv6 module for transmission via
           interface IFACE-OUT via NH-ADDR.
R11.     }
R12.   } Else {
R13.     If((Last Entry > max_LE) or (Segments Left > Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
P01.   If (Upper-layer header type != 41 (IPv6)) {
P02.     Resubmit the packet to the IPv6 module for transmission to
          the new destination.
P03.   }
P04.   Copy the IPv6 encapsulation in a CACHE entry associated with
          the interface IFACE-IN.
P05.   Perform IPv6 decapsulation.
P06.   Submit the frame to the IPv6 module for transmission via
          interface IFACE-OUT via NH-ADDR.
S16. }

NEXT-C-SID Flavor for Dynamic Proxy for Inner Type IPv6
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 dynamic proxy SID with the NEXT-C-SID flavor for IPv6 traffic:

N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit <= 1) {
N03.     Send an ICMP Time Exceeded message to the Source Address
           with Code 0 (Hop limit exceeded in transit),
           interrupt packet processing, and discard the packet.
N04.   }
N05.   Copy the value of DA.Argument into the bits [LBL..(LBL+AL-1)]
         of the Destination Address.
N06.   Set the bits [(LBL+AL)..127] of the Destination Address to
         zero.
N07.   Decrement IPv6 Hop Limit by 1.
Q01.   If (Upper-layer header type != 41 (IPv6)) {
Q02.     Resubmit the packet to the IPv6 module for transmission to
          the new destination.
Q03.   }
Q04.   Copy the IPv6 encapsulation in a CACHE entry associated with
          the interface IFACE-IN.
Q05.   Perform IPv6 decapsulation.
Q06.   Submit the frame to the IPv6 module for transmission via
         interface IFACE-OUT via NH-ADDR.
N09. }
S02. If (Segments Left == 0) {
S03.   Stop processing the SRH, and proceed to process the next
         header in the packet, whose type is identified by
         the Next Header field in the routing header.
S04. }
S05. If (IPv6 Hop Limit <= 1) {
S06.   Send an ICMP Time Exceeded message to the Source Address
         with Code 0 (Hop limit exceeded in transit),
         interrupt packet processing, and discard the packet.
S07. }
S08. max_LE = (Hdr Ext Len / 2) - 1
S09. If ((Last Entry > max_LE) or (Segments Left > Last Entry+1)) {
S10.   Send an ICMP Parameter Problem to the Source Address
         with Code 0 (Erroneous header field encountered)
         and Pointer set to the Segments Left field,
         interrupt packet processing, and discard the packet.
S11. }
S12. Decrement IPv6 Hop Limit by 1.
S13. Decrement Segments Left by 1.
S14. Update IPv6 DA with Segment List[Segments Left].
Q01. If (Upper-layer header type != 41 (IPv6)) {
Q02.   Resubmit the packet to the IPv6 module for transmission to
        the new destination.
Q03. }
Q04. Copy the IPv6 encapsulation in a CACHE entry associated with
        the interface IFACE-IN.
Q05. Perform IPv6 decapsulation.
Q06. Submit the frame to the IPv6 module for transmission via
      interface IFACE-OUT via NH-ADDR.

REPLACE-C-SID Flavor for SRv6 Masquerading Proxy
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 masquerading proxy SID with the REPLACE-C-SID flavor:

S01. When an SRH is processed {
S02.   If (Segments Left == 0 and (DA.Arg.Index == 0 or
           Segment List[0][DA.Arg.Index-1] == 0)) {
S03.     Stop processing the SRH, and proceed to process the next
           header in the packet, whose type is identified by
           the Next Header field in the routing header.
S04.   }
S05.   If (IPv6 Hop Limit <= 1) {
S06.     Send an ICMP Time Exceeded message to the Source Address,
           Code 0 (Hop limit exceeded in transit),
           interrupt packet processing and discard the packet.
S07.   }
S08.   max_LE = (Hdr Ext Len / 2) - 1
R01.   If (DA.Arg.Index != 0) {
R02.     If ((Last Entry > max_LE) or (Segments Left > Last Entry)) {
R03.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R04.     }
R05.     Decrement DA.Arg.Index by 1.
R06.     If (Segment List[Segments Left][DA.Arg.Index] == 0) {
R07.       Decrement Segments Left by 1.
R08.       Decrement IPv6 Hop Limit by 1.
R09.       Update IPv6 DA with Segment List[Segments Left]
P01.       Copy the IPv6 Destination Address in a CACHE entry associated
           with the interface IFACE-IN.
P02.       Copy Segment List[0] from the SRH to the Destination Address
             of the IPv6 header.
P03.       Submit the packet to the IPv6 module for transmission on
             interface IFACE-OUT via NH-ADDR.
R11.     }
R12.   } Else {
R13.     If((Last Entry > max_LE) or (Segments Left > Last Entry+1)){
R14.       Send an ICMP Parameter Problem to the Source Address,
             Code 0 (Erroneous header field encountered),
             Pointer set to the Segments Left field,
             interrupt packet processing and discard the packet.
R15.     }
R16.     Decrement Segments Left by 1.
R17.     Set DA.Arg.Index to (128/LNFL - 1).
R18.   }
R19.   Decrement IPv6 Hop Limit by 1.
R20.   Write Segment List[Segments Left][DA.Arg.Index] into the bits
         [LBL..LBL+LNFL-1] of the Destination Address of the IPv6
         header.
P01.   Copy the IPv6 Destination Address in a CACHE entry associated
        with the interface IFACE-IN.
P02.   Copy Segment List[0] from the SRH to the Destination Address
        of the IPv6 header.
P03.   Submit the packet to the IPv6 module for transmission on
        interface IFACE-OUT via NH-ADDR.
S16. }

REPLACE-C-SID Flavor for SRv6 De-masquerading Proxy
When processing an IPv6 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN:

S01. When an SRH is processed {
S02.   If (IPv6 Hop Limit <= 1) {
S03.     Send an ICMP Time Exceeded message to the Source Address,
         Code 0 (hop limit exceeded in transit),
         Interrupt packet processing and discard the packet.
S04.   }
S05.   If (Segments Left != 0) {
S06.     max_last_entry = (Hdr Ext Len / 2) - 1
S07.     If ((Last Entry > max_last_entry) or
             (Segments Left > Last Entry)) {
S08.       Send an ICMP Parameter Problem message to the Source Address,
           Code 0 (Erroneous header field encountered),
           Pointer set to the Segments Left field,
           Interrupt packet processing and discard the packet.
S09.     }
D01.     Retrieve the CACHE entry associated with IFACE-IN.
D02.     If the CACHE entry is not empty {
D03.        Destination Address of the IPv6 header is set to CACHE.
D04.     }
S11.   }
S12.   Decrement Hop Limit by 1.
S13.   Submit the packet to the IPv6 module for transmission to the
       next destination.
S14. }

NEXT-C-SID Flavor for SRv6 Masquerading Proxy
When processing an IPv6 packet that matches a FIB entry locally instantiated as an SRv6 masquerading proxy SID with the NEXT-C-SID flavor:

N01. If (DA.Argument != 0) {
N02.   If (IPv6 Hop Limit <= 1) {
N03.     Send an ICMP Time Exceeded message to the Source Address
           with Code 0 (Hop limit exceeded in transit),
           interrupt packet processing, and discard the packet.
N04.   }
N05.   Copy the value of DA.Argument into the bits [LBL..(LBL+AL-1)]
         of the Destination Address.
N06.   Set the bits [(LBL+AL)..127] of the Destination Address to
         zero.
N07.   Decrement IPv6 Hop Limit by 1.
Q01.    Copy the IPv6 Destination Address in a CACHE entry associated
         with the interface IFACE-IN.
Q02.    Copy Segment List[0] from the SRH to the Destination Address
         of the IPv6 header.
Q03.    Submit the packet to the IPv6 module for transmission on
         interface IFACE-OUT via NH-ADDR.
N09. }
S02. If (Segments Left == 0) {
S03.   Stop processing the SRH, and proceed to process the next
         header in the packet, whose type is identified by
         the Next Header field in the routing header.
S04. }
S05. If (IPv6 Hop Limit <= 1) {
S06.   Send an ICMP Time Exceeded message to the Source Address
         with Code 0 (Hop limit exceeded in transit),
         interrupt packet processing, and discard the packet.
S07. }
S08. max_LE = (Hdr Ext Len / 2) - 1
S09. If ((Last Entry > max_LE) or (Segments Left > Last Entry+1)) {
S10.   Send an ICMP Parameter Problem to the Source Address
         with Code 0 (Erroneous header field encountered)
         and Pointer set to the Segments Left field,
         interrupt packet processing, and discard the packet.
S11. }
S12. Decrement IPv6 Hop Limit by 1.
S13. Decrement Segments Left by 1.
S14. Update IPv6 DA with Segment List[Segments Left].
Q01. Copy the IPv6 Destination Address in a CACHE entry associated
      with the interface IFACE-IN.
Q02. Copy Segment List[0] from the SRH to the Destination Address
      of the IPv6 header.
Q03. Submit the packet to the IPv6 module for transmission on
      interface IFACE-OUT via NH-ADDR.

NEXT-C-SID Flavor for SRv6 De-masquerading Proxy
When processing an IPv6 packet received on the interface IFACE-IN and with a destination address that does not match any address of IFACE-IN:

S01. When an SRH is processed {
S02.   If (IPv6 Hop Limit <= 1) {
S03.     Send an ICMP Time Exceeded message to the Source Address,
         Code 0 (hop limit exceeded in transit),
         Interrupt packet processing and discard the packet.
S04.   }
S05.   If (Segments Left != 0) {
S06.     max_last_entry = (Hdr Ext Len / 2) - 1
S07.     If ((Last Entry > max_last_entry) or
             (Segments Left > Last Entry)) {
S08.       Send an ICMP Parameter Problem message to the Source Address,
           Code 0 (Erroneous header field encountered),
           Pointer set to the Segments Left field,
           Interrupt packet processing and discard the packet.
S09.     }
E01.     Retrieve the CACHE entry associated with IFACE-IN.
E02.     If the CACHE entry is not empty {
E03.        Destination Address of the IPv6 header is set to CACHE.
E04.     }
S11.   }
S12.   Decrement Hop Limit by 1.
S13.   Submit the packet to the IPv6 module for transmission to the
       next destination.
S14. }

REPLACE-C-SID Flavor for Destination NAT Flavor
The Destination NAT flavor of the SRv6 masquerading proxy with the REPLACE-C-SID is executed:

S01. When an SRH is processed {
S02.   If (IPv6 Hop Limit <= 1) {
S03.     Send an ICMP Time Exceeded message to the Source Address,
         Code 0 (hop limit exceeded in transit),
         Interrupt packet processing and discard the packet.
S04.   }
S05.   If (Segments Left != 0) {
S06.     max_last_entry = (Hdr Ext Len / 2) - 1
S07.     If ((Last Entry > max_last_entry) or
             (Segments Left > Last Entry)) {
S08.       Send an ICMP Parameter Problem message to the Source Address,
           Code 0 (Erroneous header field encountered),
           Pointer set to the Segments Left field,
           Interrupt packet processing and discard the packet.
S09.     }
P01.      Copy the Destination Address of the IPv6 header to the
           Segment List[0] entry of the SRH.
P02.      Retrieve the CACHE entry associated with IFACE-IN.
P03.      If the CACHE entry is not empty {
P04.         Destination Address of the IPv6 header is set to CACHE.
P05.      }
S11.   }
S12.   Decrement Hop Limit by 1.
S13.   Submit the packet to the IPv6 module for transmission to the
       next destination.
S14. }

NEXT-C-SID Flavor for Destination NAT Flavor
The Destination NAT flavor of the SRv6 masquerading proxy with the NEXT-C-SID is executed:

S01. When an SRH is processed {
S02.   If (IPv6 Hop Limit <= 1) {
S03.     Send an ICMP Time Exceeded message to the Source Address,
         Code 0 (hop limit exceeded in transit),
         Interrupt packet processing and discard the packet.
S04.   }
S05.   If (Segments Left != 0) {
S06.     max_last_entry = (Hdr Ext Len / 2) - 1
S07.     If ((Last Entry > max_last_entry) or
             (Segments Left > Last Entry)) {
S08.       Send an ICMP Parameter Problem message to the Source Address,
           Code 0 (Erroneous header field encountered),
           Pointer set to the Segments Left field,
           Interrupt packet processing and discard the packet.
S09.     }
Q01.      Copy the Destination Address of the IPv6 header to the
           Segment List[0] entry of the SRH.
Q02.      Retrieve the CACHE entry associated with IFACE-IN.
Q03.      If the CACHE entry is not empty {
Q04.         Destination Address of the IPv6 header is set to CACHE.
Q05.      }
S11.   }
S12.   Decrement Hop Limit by 1.
S13.   Submit the packet to the IPv6 module for transmission to the
       next destination.
S14. }

Acknowledgements
TBD.