Subject: RE: CSID proposed clarifications

From: Ron Bonica <[email-masked]>
Date: Fri, 22 Oct 2021 16:35:54 +0000

Authors,

Could you update the draft to reflect the new pseudocode, below. It is essential to the 6man review.

                                                                                              Ron

Juniper Business Use Only
From: spring <[email-masked]> On Behalf Of Darren Dukes (ddukes)
Sent: Thursday, October 14, 2021 8:54 AM
To: SPRING WG <[email-masked]>
Subject: [spring] CSID proposed clarifications

[External Email. Be cautious of content]

The NEXT-C-SID and REPLACE-C-SID flavors are functionally very similar.
In both cases the SID in the IPv6 Destination Address (DA) contains an argument,
that argument is used to construct the next SID from the active segment in
the SRH Segment List.

I believe the following pseudocode is a much better description of their
segment endpoint processing. You'll notice there is no manipulation of
the bits in the IPv6 DA.

I propose we replace the pseudocode in the draft with the following,
stand-alone pseudocode, for the NEXT-C-SID and REPLACE-C-SID flavors
of the END behavior (sections 4.1.1 and 4.2.1 respectively).

Equivalent changes can be completed for the NEXT-C-SID and REPLACE-C-SID
flavors of the END.X behavior (sections 4.1.2 and 4.2.2 respectively) and
NEXT-AND-REPLACE-C-SID flavor.

Comments are appreciated.

Thanks
  Darren

4.1.1.  End with NEXT-C-SID

When processing an IPv6 packet that matches a FIB entry locally
instantiated as an End SID with the NEXT-C-SID flavor, the SRH
processing described in Section 4.1 of [RFC8986] is replaced as
follows.

S.01 When an SRH is processed {
S.02  If (IPv6.DA.Argument == 0 and SRH.SegmentsLeft == 0) {
S.03     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.
S.04  }

S.05  If (IPv6.HopLimit <= 1) {
S.06     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.
S.07  }

S.08  # Determine the maximum SRH Last Entry
S.09  Set maxLE to ((SRH.HdrExtLen / 2) - 1)

S.10  Initialize 128-bit buffer memory S to 0.
S.11  Initialize local parameter Argument to the value of IPv6.DA.Argument

S.12  If (Argument == 0) {
S.13    If ((SRH.LastEntry > maxLE) or (SRH.SegmentsLeft > SRH.LastEntry+1)) {
S.14      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.
S.15    }

S.16    Decrement SRH.SegmentsLeft by 1

S.17    Set S to the value of SRH.SegmentList[SRH.SegmentsLeft]
S.18  }
S.19  Else {
S.20    If ((SRH.LastEntry > maxLE) or (SRH.SegmentsLeft > SRH.LastEntry+1)) {
S.21      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.
S.22    }

S.23    Set S[0..B-1] to the value of IPv6.DA[0..B-1] (i.e., the common locator block)

S.24    If (SRH.SegmentsLeft > SRH.LastEntry) {
S.25      Initialize local parameter ActiveSegment to the value of DA
S.26    }
S.27    Else {
S.28      Initialize local parameter ActiveSegment to the value
S.29       of SRH.SegmentList[SRH.SegmentsLeft]
S.30    }

S.31    Initialize local parameter BitLength to (CountTrailingZeros(ActiveSegment) +
                                                  AL - CountTrailingZeros(Argument))
S.32    Initialize local parameter BitIndex to (128 - BitLength)

S.33    Set S[B..B+BitLength-1] to the value of
         ActiveSegment[BitIndex..(BitIndex+BitLength-1)]
S.34  }

S.35  Set IPv6.DA to the value of S

S.36  Decrement IPv6.HopLimit by 1

S.37  Submit the packet to the egress IPv6 FIB lookup for transmission
       to the new destination.
S.38 }

4.1.1.1 Upper layer header processing

The upper-layer header processing described in Section 4.1.1 of
[RFC8986] is replaced as follows.

S.01  Initialize local parameter Argument to the value of IPv6.DA.Argument
S.02  If (Argument != 0) {
        # In this case, the SRH was not added by source
        # The source compressed it into the active segment in IPv6.DA
        # Build a pseudo header from the active segment in the IPv6.DA for use
      # during processing.
S.03    Initialize a 24-byte local SRH in memory to 0's for use below
S.04    Set SRH.MaxHdrLen to 3
S.05    Set SRH.RoutingType to 4
S.06    Set SRH.SegmentsLeft to 0
S.07    Set SRH.SegmentList[0] to the value of IPv6.DA

S.08    Process the SRH as per section 4.1.1,
S.09     noting such processing is limited to the pseudo SRH
S.10     since Argument is not 0.
S.11  }

S.12  If (Upper-Layer header type is allowed by local configuration) {
S.13    Proceed to process the Upper-Layer header
S.14  } Else {
S.15    Send an ICMP Parameter Problem to the Source Address
         with Code 4 (SR Upper-layer Header Error)
         and Pointer set to the offset of the Upper-Layer header,
         interrupt packet processing, and discard the packet.
S.16  }

4.2.1.  End with REPLACE-C-SID

When processing an IPv6 packet that matches a FIB entry locally
instantiated as an End SID with the REPLACE-C-SID flavor, the SRH
processing described in Section 4.1 of [RFC8986] is replaced as
follows.

S.01 When an SRH is processed {
S.02  If (IPv6.DA.Argument == 0 and SRH.SegmentsLeft == 0) {
S.03    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.
S.04  }

S.05  If (IPv6.HopLimit <= 1) {
S.06    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.
S.07  }

S.08  # Determine the maximum SRH Last Entry
S.09  Set maxLE to ((SRH.HdrExtLen / 2) - 1)

S.10  Initialize 128-bit buffer memory S to 0.
S.11  Initialize local parameter Argument to the value of IPv6.DA.Argument
S.12  Initialize local parameter ActiveSegment to SRH.SegmentList[SRH.SegmentsLeft]

S.13  If (Argument == 0) {
S.14    If ((SRH.LastEntry > maxLE) or (SRH.SegmentsLeft > SRH.LastEntry+1)) {
S.15      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.
S.16    }

S.17    Set S[0..B-1] to the value of IPv6.DA[0..B-1] (i.e., the common locator block)

S.18    Decrement SRH.SegmentsLeft by 1

S.19    Set Argument to (128 / NF - 1)
S.20  }
S.21  Else {
S.22    If ((SRH.LastEntry > maxLE) or (SRH.SegmentsLeft > SRH.LastEntry)) {
S.23      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.
S.24    }

S.25    Set S[0..B-1] to the value of IPv6.DA[0..B-1] (i.e., the common locator block)

S.26    Decrement Argument by 1
S.27  }

S.28  Initialize local parameter BitLength to the value of NF
S.29  Initialize local parameter BitIndex to (Argument * NF)

S.30  Set S[B..B+BitLength-1] to the value of
       ActiveSegment[BitIndex..(BitIndex+BitLength-1)]
S.32  Set S[B+BitLength..B+BitLength+A-1] to the value of Argument

S.33  Set IPv6.DA to the value of S

S.34  Decrement IPv6.HopLimit by 1

S.35  Submit the packet to the egress IPv6 FIB lookup for transmission
S.36   to the new destination.
S.37 }

4.2.1.1.  Upper layer header processing

The upper-layer header processing described in Section 4.1.1 of [RFC8986] is unchanged and reproduced below.

S.01  If (Upper-Layer header type is allowed by local configuration) {
S.02    Proceed to process the Upper-Layer header
S.03  } Else {
S.04    Send an ICMP Parameter Problem to the Source Address
        with Code 4 (SR Upper-layer Header Error)
        and Pointer set to the offset of the Upper-Layer header,
        interrupt packet processing, and discard the packet.
S.05  }