1. A method comprising: receiving a packet, wherein the packet comprises a segment routing (SR) segment identifier (ID) stack; determining an active segment type associated with an active segment in the SR segment ID stack; 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.