SR-MPLS with OSPFv2
I started my part of the Segment Routing workshop @ ITNOG10 exploring SR-MPLS with IS-IS (simple SR-MPLS, dual-stack SR-MPLS, SR-MPLS over unnumbered IPv4 interfaces). Next step: let’s change the routing protocol to OSPF while using the same network topology:
Lab Topology
I had to change two lines in the initial lab topology – I had to tell netlab to use OSPF instead of IS-IS, and to use OSPF as the SR-MPLS routing protocol (by default, the netlab SR-MPLS module expects to use IS-IS). The full lab topology file is here.
module: [ ospf, sr ]sr.protocol: ospfv2
Exploring SR-MPLS Using OSPFv2
After setting up netlab, changing into the 1-intro/5-ospf directory, and executing netlab up, you’ll have an SR-MPLS network using OSPFv2 to transport SR-MPLS opaque LSAs. Let’s do the same checks we did for IS-IS.
How do routers advertise SR-MPLS information in OSPFv2? The lab topology is simple, so we’d expect to see only three router LSAs in the OSPFv2 topology database. However, it contains numerous area-local (type 10) opaque LSAs:
pe1#show ip ospf databaseOSPF Router with ID(10.0.0.1) (Instance ID 1) (VRF default)Router Link States (Area 0.0.0.0)Link ID ADV Router Age Seq# Checksum Link count10.0.0.2 10.0.0.2 13 0x80000006 0xe69b 410.0.0.3 10.0.0.3 14 0x80000005 0x8022 310.0.0.1 10.0.0.1 2 0x80000005 0x9b15 3Opaque Type 10 Link States (Area 0.0.0.0)Link ID ADV Router Age Seq# Checksum7.0.0.0 10.0.0.1 13 0x80000001 0x34158.0.0.0 10.0.0.3 14 0x80000001 0x7d888.0.0.1 10.0.0.2 3 0x80000001 0x2edc8.0.0.0 10.0.0.2 13 0x80000001 0x7f878.0.0.0 10.0.0.1 2 0x80000001 0x41ca4.0.0.0 10.0.0.2 14 0x80000001 0x1d2e4.0.0.0 10.0.0.3 15 0x80000001 0x17334.0.0.0 10.0.0.1 13 0x80000001 0x23297.0.0.1 10.0.0.2 14 0x80000001 0x4cf87.0.0.0 10.0.0.3 15 0x80000001 0x78ca
What is in those LSAs? Let’s inspect the ones originated by PE1:
pe1#show ip ospf database opaque-area adv-router 10.0.0.1OSPF Router with ID(10.0.0.1) (Instance ID 1) (VRF default)Opaque Type 10 Link States (Area 0.0.0.0)LS Age: 762Options: (DC O)LS Type: Opaque Type 10 LinksLink State ID: 7.0.0.0Advertising Router: 10.0.0.1LS Seq Number: 0x80000001Checksum: 0x3415Length: 44Segment Routing Extended Prefix TLVRoute Type: Intra-Area, Prefix: 10.0.0.1/32, AF: IPv4 unicastFlags: [N]Prefix-SID Sub-TLVAlgorithm: Shortest Path FirstFlags: []MT-ID: 0, SID: 1LS Age: 751Options: (DC O)LS Type: Opaque Type 10 LinksLink State ID: 8.0.0.0Advertising Router: 10.0.0.1LS Seq Number: 0x80000001Checksum: 0x41caLength: 48Segment Routing Extended Link TLVLink Type: 1 (Point-to-point)Reserved: 0Link Id: 10.0.0.2Link Data: 10.1.0.2Adj-SID Sub-TLVFlags: [V, L]Reserved: 0Multi-Topology ID: 0SID: 100000LS Age: 762Options: (DC O)LS Type: Opaque Type 10 LinksLink State ID: 4.0.0.0Advertising Router: 10.0.0.1LS Seq Number: 0x80000001Checksum: 0x2329Length: 44Segment Routing Router Information TLVSupported Algorithm: Shortest Path FirstLabel RangeSRGB Base: 900000, Size: 65536
Compared to the concise IS-IS SR-MPLS TLVs, the OSPFv2 data structures seem like a bloatware-generating exercise:
- Each bit of information has its own opaque LSA
- There’s an LSA describing the SR global range, another one mapping the loopback prefix into node SID, and a separate LSA for every adjacency SID.
Regardless of the encoding quirks, the routers have enough information to figure out the SR global blocks and prefix segments of all nodes:
pe1#show ip ospf segment-routing global-blocksOSPF Instance ID: 1SR supported Data-plane: MPLS SR Router ID: 10.0.0.1Number of OSPF segment routing capable nodes excluding self: 2Router ID Base Size--------------- ------------ -----10.0.0.1 900000 6553610.0.0.2 900000 6553610.0.0.3 900000 65536
pe1#show ip ospf segment-routing prefix-segmentsOSPF Instance ID: 1SR supported Data-plane: MPLS SR Router ID: 10.0.0.1Node: 3 Proxy-Node: 0 Prefix: 0 Total Segments: 3Flag Descriptions: NP: No-PHP, M: Mapping Server, E: Explicit-NULL,V: Value, L: LocalSegment status codes: * - Self originated PrefixPrefix SID Type Flags Router ID Protection- ----------- --- ---- -------------------- --------- -----------* 10.0.0.1/32 1 Node NP:0 M:0 E:0 V:0 L:0 10.0.0.1 unprotected10.0.0.2/32 2 Node NP:0 M:0 E:0 V:0 L:0 10.0.0.2 unprotected10.0.0.3/32 3 Node NP:0 M:0 E:0 V:0 L:0 10.0.0.3 unprotected
Not surprisingly, the MPLS forwarding table is identical to the IS-IS SR-MPLS example:
pe2#show mpls route...100000 A[1]via M, 10.0.0.2, popEgressACL: applydirectly connected, Ethernet1ca:f0:00:02:00:01, vlan 1006900002 A[1]via M, 10.0.0.2, popEgressACL: applydirectly connected, Ethernet1ca:f0:00:02:00:01, vlan 1006900003 A[1]via M, 10.0.0.2, swap 900003EgressACL: applydirectly connected, Ethernet1ca:f0:00:02:00:01, vlan 1006
Try It Out
The workshop GitHub repository includes the installation guidelines; you might want to read them first. After that, you can:
- Start a GitHub Codespace
- Import an Arista cEOS container into it (alternate step-by-step instructions)
- Change directory to
1-intro/5-ospf - Execute netlab up
- Have fun