Ping and traceroute operate similarly to any data or OAM IPv6 packet when expiring (the value in the hop-limit field is equal to or less than 1) at a transit SRv6 node, whether this node is a SID termination or not.
The data path at the ingress network interface where the packet is received extracts the packet to the CPM.
The CPM originates a TTL expiry ICMP reply message Type: "Time Exceeded", Code: "Time to Live exceeded in Transit".
The CPM sends the reply to the SRv6 router whose address is encoded in the SA field of the outer IPv6 header in the received packet. The source address is set to the system IPv6 address, if configured, or the address of the interface used to forward the packet to the next hop.
When the transport protocol of the traceroute packet is UDP or TCP (as indicated in the traceroute command), the intermediate node copies a portion of the original datagram, up to 1232 bytes, into the reply message payload. This may include the outer IPv6 header and SRH headers. To copy the maximum information from the original datagram, the node must include the configure test-oam icmp ipv6 maximum-original-datagram option.
When the hop-limit field value is higher than 1, the packet is processed in the data path similar to the process of any SRv6 user data packet in the transit router. See the 7750 SR and 7950 XRS Segment Routing and PCE User Guide for more information.