OSPF Extensions for Segment Routing

Segment Routing (SR) allows a flexible definition of end-to-end paths within IGP topologies by encoding paths as sequences of topological subpaths called Segments.  These segments are advertised by the link-state routing protocols (IS-IS and OSPF). Prefix segments represent an ECMP-aware shortest path to a prefix (or a node), as per the state of the IGP topology.  Adjacency segments represent a hop over a specific adjacency between two nodes in the IGP.  A prefix segment is typically a multi-hop path while an adjacency segment, in most cases, is a one-hop path.  SR's control plane can be applied to both IPv6 and MPLS data planes, and it does not require any additional signaling (other than IGP extensions).  The IPv6 data plane is out of the scope of this specification; it is not applicable to OSPFv2, which only supports the IPv4 address family.  When used in MPLS networks, SR paths do not require any LDP or RSVP-TE signaling. However, SR can interoperate in the presence of LSPs established with RSVP or LDP. This article describes the OSPFv2 extensions required for Segment Routing.

Segment Routing Identifiers:

Segment Routing defines various types of Segment Identifiers (SIDs):
  • Prefix-SID
  • Adjacency SID
  • LAN Adjacency SID
  • Binding SID.
The SID/Label Sub-TLV appears in multiple TLVs or sub-TLVs.   It is used to advertise the SID or label associated with a prefix or adjacency.  The SID/Label Sub-TLV has the following format:

If the length is set to 3, then the 20 rightmost bits represent a label.  If the length is set to 4, then the value represents a 32-bit SID.


Segment Routing Capabilities:

Segment Routing requires some additional router capabilities to be advertised to other routers in the area. These SR capabilities are advertised in the Router Information Opaque LSA. The TLVs defined below are applicable to both OSPFv2 and OSPFv3.
  • SR-Algorithm TLV (8)
  • SID/Label Range TLV (9)
The SR-Algorithm TLV is a top-level TLV of the Router Information Opaque LSA. The SR-Algorithm TLV is optional.  It SHOULD only be advertised once in the Router Information Opaque LSA.  If the SR-Algorithm TLV is not advertised by the node, such a node is considered as not being Segment Routing capable.An SR Router can use various algorithms when calculating reachability to OSPF routers or prefixes in an OSPF area.  Examples of these algorithms are metric-based Shortest Path First (SPF), various flavors of Constrained SPF, etc.  The SR-Algorithm TLV allows a router to advertise the algorithms currently used by the router to other routers in an OSPF area.
    
The SID/Label Range TLV is used to advertise such SID/Label space. The SID/Label Range TLV is a top-level TLV of the Router Information opaque LSA.
   
OSPF also defines new Opaque LSAs to advertise the SIDs:
  • OSPFv2 Extended Prefix Opaque LSA (type 7)
                 OSPFv2 Extended Prefix TLV (1)
                        Prefix SID Sub-TLV (2)
  • OSPFv2 Extended Link Opaque LSA (type 8)
                    OSPFv2 Extended Link TLV (1)
                          Adj-SID Sub-TLV (2)
                          LAN Adj-SID Sub-TLV (3)
  

OSPF SR configuration:
  
router ospf 1 
 segment-routing mpls
 segment-routing forwarding mpls
 interface TenGigabitEthernet0/1/0/0