MPLS segment routing is disclosed. In one embodiment, a first core router generates a first data structure that maps first portcodes to respective identities of first neighbor routers or respective first links, wherein the first portcodes identify respective first ports of the first core router, and wherein the first ports are coupled to the first neighbor routers, respectively, via the first links, respectively. The first core router generates and transmits a first link-state packet, wherein the first link-state packet comprises an identity of the first core router and the first data structure.