1. A method comprising: receiving a packet, wherein the packet comprises a segment routing (SR) segment identifier (ID) stack; determining an active segment type of a plurality of segment types, wherein the active segment type is associated with an active segment in the SR segment ID stack, and the active segment type is one of nodal segment or adjacency segment; selecting an update routine based, at least in part, on the active segment type; and performing the update routine, wherein the performing the update routine comprises modifying the SR segment ID stack.