]> git.proxmox.com Git - mirror_frr.git/blob - doc/OSPF-SR.rst
OSPFD: Update Segment Routing following reviews
[mirror_frr.git] / doc / OSPF-SR.rst
1 OSPF Segment Routing
2 ====================
3
4 This is an EXPERIMENTAL support of draft draft-ietf-ospf-segment-routing-extensions-24.
5 DON'T use it for production network.
6
7 Implementation details
8 ----------------------
9 ### Concepts
10
11 Segment Routing used 3 differents OPAQUE LSA in OSPF to carry the various
12 information:
13
14 - Router Information: flood the Segment Routing capabilities of the node.
15 This include the supported algorithms, the Segment Routing Global Block
16 (SRGB) and the Maximum Stack Depth (MSD).
17 - Extended Link: flood the Adjaceny and Lan Adjacency Segment Identifier
18 - Extended Prefix: flood the Prefix Segment Identifier
19
20 The implementation follow previous TE and Router Information code. It used the
21 OPAQUE LSA functions define in ospf_opaque.[c,h] as well as the OSPF API. This
22 latter is mandatory for the implementation as it provides the Callback to
23 Segment Routing functions (see below) when an Extended Link / Prefix or Router
24 Information is received.
25
26 ### Overview
27
28 Following files where modified or added:
29 - ospd_ri.[c,h] have been modified to add the new TLVs for Segment Routing.
30 - ospf_ext.[c,h] implement RFC7684 as base support of Extended Link and Prefix
31 Opaque LSA.
32 - ospf_sr.[c,h] implement the earth of Segment Routing. It adds a new Segment
33 Routing database to manage Segment Identifiers per Link and Prefix and
34 Segment Routing enable node, Callback functions to process incoming LSA and
35 install MPLS FIB entry through Zebra.
36
37 The figure below shows the relation between the various files:
38
39 - ospf_sr.c centralized all the Segment Routing processing. It receives Opaque
40 LSA Router Information (4.0.0.0) from ospf_ri.c and Extended Prefix
41 (7.0.0.X) Link (8.0.0.X) from ospf_ext.c. Once received, it parse TLVs and
42 SubTLVs and store information in SRDB (which is defined in ospf_sr.h). For
43 each received LSA, NHLFE is computed and send to Zebra to add/remove new
44 MPLS labels entries and FEC. New CLI configurations are also centralized in
45 ospf_sr.c. This CLI will trigger the flooding of new LSA Router Information
46 (4.0.0.0), Extended Prefix (7.0.0.X) and Link (8.0.0.X) by ospf_ri.c,
47 respectively ospf_ext.c.
48 - ospf_ri.c send back to ospf_sr.c received Router Information LSA and update
49 Self Router Information LSA with paramters provided by ospf_sr.c i.e. SRGB
50 and MSD. It use ospf_opaque.c functions to send/received these Opaque LSAs.
51 - ospf_ext.c send back to ospf_sr.c received Extended Prefix and Link Opaque
52 LSA and send self Extended Prefix and Link Opaque LSA through ospf_opaque.c
53 functions.
54
55 ::
56
57 +-----------+ +-------+
58 | | | |
59 | ospf_sr.c +-----+ SRDB |
60 +-----------+ +--+ | |
61 | +-^-------^-+ | +-------+
62 | | | | |
63 | | | | |
64 | | | | +--------+
65 | | | | |
66 +---v----------+ | | | +-----v-------+
67 | | | | | | |
68 | ospf_ri.c +--+ | +-------+ ospf_ext.c |
69 | LSA 4.0.0.0 | | | LSA 7.0.0.X |
70 | | | | LSA 8.0.0.X |
71 +---^----------+ | | |
72 | | +-----^-------+
73 | | |
74 | | |
75 | +--------v------------+ |
76 | | | |
77 | | ZEBRA: Labels + FEC | |
78 | | | |
79 | +---------------------+ |
80 | |
81 | |
82 | +---------------+ |
83 | | | |
84 +---------> ospf_opaque.c <---------+
85 | |
86 +---------------+
87
88 Figure1: Overview of Segment Routing interaction
89
90 ### Module interactions
91
92 To process incoming LSA, the code is based on the capability to call `hook()` functions when LSA are inserted or delete to / from the LSDB and the possibility to register particular treatment for Opaque LSA. The first point is provided by the OSPF API feature and the second by the Opaque implementation itself. Indeed, it is possible to register callback function for a given Opaque LSA ID (see `ospf_register_opaque_functab()` function defined in `ospf_opaque.c`). Each time a new LSA is added to the LSDB, the `new_lsa_hook()` function previously register for this LSA type is called. For Opaque LSA it is the `ospf_opaque_lsa_install_hook()`. For deletion, it is `ospf_opaque_lsa_delete_hook()`.
93
94 Note that incoming LSA which is already present in the LSDB will be inserted after the old instance of this LSA remove from the LSDB. Thus, after the first time, each incoming LSA will trigger a `delete` following by an `install`. This is not very helpfull to handle real LSA deletion. In fact, LSA deletion is done by Flushing LSA i.e. flood LSA after seting its age to MAX_AGE. Then, a garbage function has the role to remove all LSA with `age == MAX_AGE` in the LSDB. So, to handle LSA Flush, the best is to look to the LSA age to determine if it is an installation or a future deletion i.e. the flushed LSA is first store in the LSDB with MAX_AGE waiting for the garbage collector function.
95
96 #### Router Information LSAs
97
98 To activate Segment Routing, new CLI command `segment-routing on` has been introduced. When this command is activated, function `ospf_router_info_update_sr()` is called to indicate to Router Information process that Segment Routing TLVs must be flood. Same function is called to modify the Segment Routing Global Block (SRGB) and Maximum Stack Depth (MSD) TLV. Only Shortest Path First (SPF) Algorithm is supported, so no possiblity to modify this TLV is offer by the code.
99
100 When Opaque LSA Tyep 4 i.e. Router Information are stored in LSDB, function `ospf_opaque_lsa_install_hook()` will call the previously registered function `ospf_router_info_lsa_update()`. In turn, the function will simply trigger `ospf_sr_ri_lsa_update()` or `ospf_sr_ri_lsa_delete` in function of the LSA age. Before, it verifies that the LSA Opaque Type is 4 (Router Information). Self Opaque LSA are not send back to the Segment Routing functions as information are already stored.
101
102 #### Extended Link Prefix LSAs
103
104 Like for Router Information, Segment Routing is activate at the Extended Link/Prefix level with new `segment-routing on` command. This trigger automtically the flooding of Extended Link LSA for all ospf interface where adjacency is full. For Extended Prefix LSA, the new CLI command `segment-routing prefix ...` will trigger the flooding of Prefix SID TLV/SubTLVs.
105
106 When Opaque LSA Type 7 i.e. Extended Prefix and Type 8 i.e. Extended Link are store in the LSDB, `ospf_ext_pref_update_lsa()` respectively `ospf_ext_link_update_lsa()` are called like for Router Information LSA. In turn, they respectively trigger `ospf_sr_ext_prefix_lsa_update()` / `ospf_sr_ext_link_lsa_update()` or `ospf_sr_ext_prefix_lsa_delete()` / `ospf_sr_ext_link_lsa_delete()` if the LSA age is equel to MAX_AGE.
107
108 #### Zebra
109
110 When a new MPLS entry of new Forwarding Equivalent Class (FEC) must be add or delete in the data plane, `add_sid_nhlfe()` respectively `del_sid_nhlfe()` are called. Once check the validity of labels, they send to ZEBRA layer a new labels through `ZEBRA_MPLS_LABELS_ADD` command, respectively `ZEBRA_MPLS_LABELS_DELETE` command for deletion. This is completed by a new labelled route through `ZEBRA_ROUTE_ADD` command, respectively `ZEBRA_ROUTE_DELETE` command.
111
112 Configuration
113 -------------
114
115 Here it is a simple example of configuration to enable Segment Routing. Note
116 that ``opaque capability`` must be set to activate Opaque LSA prior to Segment
117 Routing.
118
119 ::
120
121 router ospf
122 ospf router-id 192.168.1.11
123 capability opaque
124 mpls-te on
125 mpls-te router-address 192.168.1.11
126 router-info area 0.0.0.0
127 segment-routing on
128 segment-routing global-block 10000 19999
129 segment-routing node-msd 8
130 segment-routing prefix 192.168.1.11/32 index 1100
131
132 The first segment-routing statement enable it. The Second one set the SRGB,
133 third line the MSD and finally, set the Prefix SID index for tha given prefix.
134 Note that only prefix of Loopback interface could be configured with a Prefix
135 SID.
136
137 Known limitations
138 -----------------
139
140 - Runs only within default VRF
141 - Only single Area is supported. ABR is not yet supported
142 - Only SPF algorithm is supported
143 - Extended Prefix Range is not supported
144 - MPLS table are not flush at startup. Thus, restarting zebra process is mandatory to remove old MPLS entries in the data plane after a crash of ospfd daemon.
145
146 Credits
147 -------
148 * Author: Anselme Sawadogo <anselmesawadogo@gmail.com>
149 * Author: Olivier Dugeon <olivier.dugeon@orange.com>
150 * Copyright (C) 2016 - 2018 Orange Labs http://www.orange.com
151
152 This work has been performed in the framework of the H2020-ICT-2014
153 project 5GEx (Grant Agreement no. 671636), which is partially funded
154 by the European Commission.
155
156