Clarify and update the ordering in which decapsulation and encapsulation happens in NH AFT entry state
in NH AFT entry state, we have:
decapsulate-header path : /network-instances/network-instance/afts/next-hops/next-hop/state/decapsulate-header
leaf decapsulate-header { type oc-aftt:encapsulation-header-type; description "When forwarding a packet to the specified next-hop, the local system performs a decapsulation of the packet - removing the specified header type. In the case that no next-hop is specified, the packet header is removed, and a subsequent forwarding lookup is performed on the packet encapsulated within the header, matched within the relevant AFT within the specified network-instance."; }
encap-headers path: /network-instances/network-instance/afts/next-hops/next-hop/encap-headers/
container encap-headers { description "Container for packet encapsulation headers. When leaves in this container are populated, it indicates encapsulation of the packet matching the next-hop is performed using a stack of one or more headers defined in the list encap-header.
Each entry in the list must indicate an encapsulation type and populate a container with the parameters for that encapsulation header."; list encap-header { description "A list of headers added on top of a packet ordered by the index value. The inner-most header is the 0th value and is adjacent to the original packet. Additional headers may be added in index order. For example, in an encapsulation stack for MPLS in UDPv4, the first index in the list is the MPLS header and the second index is a UDPv4 header.";
encapsulate-header path: /network-instances/network-instance/afts/next-hops/next-hop/state/encapsulate-header => marked for deprecation
leaf encapsulate-header { type oc-aftt:encapsulation-header-type; description "When forwarding a packet to the specified next-hop the local system performs an encapsulation of the packet - adding the specified header type.
This node must be supported in addition to the encap-headers/encap-header tree. A future release of OpenConfig will deprecate this node in favor of the encap-headers/encap-header subtree."; }
It is not documented in which order this operations a performed this NH if both the decap and encap leafs are specified. My understanding is its implicit that decap happens first and then encap. We need to clarify and tighten the documentation.