A method of forwarding packets based on source routing where the routing path is encoded in the packet header as an ordered list of segments. This means traffic can be forwarded selecting any routing path and not just the Interior Gateway Protocol (IGP) shortest path. It also supports automatic traffic protection for node and link failures by Topology-Independent Loop-Free Alternates (TI-LFA).