]> git.proxmox.com Git - mirror_frr.git/blob - doc/user/pathd.rst
doc: fix undefined label warning
[mirror_frr.git] / doc / user / pathd.rst
1 .. _path:
2
3 ****
4 PATH
5 ****
6
7 :abbr:`PATH` is a daemon that handles the installation and deletion
8 of Segment Routing (SR) Policies.
9 Based on MPLS (This means that your OS of choice must support MPLS),
10 SR add a stack of MPLS labels to ingress packets so these
11 packets are egress through the desired path.
12
13 .. image:: images/pathd_general.png
14
15 The SR policies and Segment Lists can be configured either locally by means
16 of vtysh or centralized based on a SDN controller (ODL, Cisco, ...)
17 communicating using the PCEP protocol (:rfc:`5440`).
18
19
20 .. _starting-path:
21
22 Configuration
23 =============
24
25 Explicit Segment Lists
26 ----------------------
27
28 This is the simplest way of configuration, no remote PCE is necessary.
29 In order to create a config that match the graphics used in this documentation,
30 we will create a segment list (SL) called SL1 with an element for each hop and
31 that element will be assigned a MPLS label.
32 Then the SL1 will be used in the policy ``example1``, please note also the
33 preference as in the case of multiple segment list it will be used with the
34 criteria of bigger number more preference.
35 Let see now the final configuration that match the graphics shown above.
36
37
38 .. code-block:: frr
39
40 segment-routing
41 traffic-eng
42 segment-list SL1
43 index 10 mpls label 16001
44 index 20 mpls label 16002
45 !
46 policy color 1 endpoint 192.0.2.4
47 name example1
48 binding-sid 1111
49 candidate-path preference 100 name CP1 explicit segment-list SL1
50
51
52 Explicit Segment Lists and Traffic Engineering Database (TED)
53 -------------------------------------------------------------
54
55 Sometimes is difficult to know the values of MPLS labels
56 (adjacency changes,...).
57 Based on the support of IS-IS or OSPF we can activate TED support what will
58 allow pathd to resolve MPLS based in different types of segments
59 (:rfc: `draft-ietf-spring-segment-routing-policy-07`). The supported types are
60 Type C (prefix and local interface), Type E (prefix and algorithm),
61 Type F (a pair of IP's).
62 So the configuration would change to this
63
64 .. code-block:: frr
65
66 segment-routing
67 traffic-eng
68 mpls-te on
69 mpls-te import ospfv2
70 segment-list SL1
71 index 10 nai prefix 10.1.2.1/32 iface 1
72 index 20 nai adjacency 10.1.20.1 10.1.20.2
73 !
74 policy color 1 endpoint 192.0.2.4
75 name example1
76 binding-sid 1111
77 candidate-path preference 100 name CP1 explicit segment-list SL1
78
79
80 In this case no MPLS are provided but the pathd TED support will resolve the
81 configuration provided to corresponding MPLS labels.
82
83 .. note::
84 Please note the ``mpls-te`` configuration added that activate the TED
85 support and points to ``ospfv2`` so
86 the ospfv2 (:ref:`ospf-traffic-engineering`) daemon must be also
87 running and configure to export TED information.
88
89 .. note::
90 It would be the same for isis (:ref:`isis-traffic-engineering`) but in the
91 moment of writting it's not fully tested.
92
93 Dynamic Segment Lists
94 ---------------------
95
96 One of the useful options to configure is the creation of policies with
97 the dynamic option. In this case based on a given endpoint the SL will be
98 ,first calculated, and then sended by means of PCEP protocol by the configured
99 PCE.
100
101 .. code-block:: frr
102
103 traffic-eng
104 !
105 pcep
106 !
107 pce PCE1
108 address ip 192.0.2.10
109 !
110 pcc
111 peer PCE1 precedence 10
112 !
113 policy color 1 endpoint 192.0.2.4
114 name example
115 binding-sid 1111
116 candidate-path preference 100 name CP2 dynamic
117
118 .. note::
119 Please note the configuration for the remote pce which allows pathd to
120 connect to the given PCE and act as a PCC (PCEP Client)
121
122 .. note::
123 If the TED support feature is active, the data obtained from PCE will
124 be validated, so in a SL from PCEP/PCE the IP and MPLS will be checked
125 against local TED obtained and built from the igp configured in that
126 case.
127
128 .. image:: images/pathd_config.png
129
130 Pce Initiated
131 -------------
132
133 We can step forward in the use of our controller not only by asking to
134 calculate paths to an endpoint but also to create the whole policies in the
135 controller and obtain those by means of the PCEP protocol.
136
137
138 .. code-block:: frr
139
140 traffic-eng
141 !
142 pcep
143 !
144 pce PCE1
145 address ip 192.0.2.10
146 pce-initiated
147 !
148 pce PCE2
149 address ip 192.0.2.9
150 pce-initiated
151 !
152 pcc
153 peer PCE1 precedence 10
154 peer PCE2 precedence 20
155 !
156
157 .. note::
158 Now there is no locally created policies in the config as they will
159 be obtain from the configured pce.
160 Please check command :clicmd:`show sr-te policy` in ``vtysh`` to see
161 the obtained policies.
162
163 .. note::
164 Another interesting command is :clicmd:`show mpls table`
165 to check the installed mpls configuration based in those obtained
166 policies.
167
168 .. note::
169 SR Policies could be a mix of local, remote obtained from PCE and
170 delegated to a PCE (but while testing Pce Initiated with Cisco PCE,
171 happens that controller sends PCE initiated delete commands to delete
172 the locally created configuration related to that PCE).
173
174
175 .. image:: images/pathd_initiated_multi.png
176
177 Starting
178 =============
179
180 Default configuration file for *pathd* is :file:`pathd.conf`. The typical
181 location of :file:`pathd.conf` is |INSTALL_PREFIX_ETC|/pathd.conf.
182
183 If the user is using integrated config, then :file:`pathd.conf` need not be
184 present and the :file:`frr.conf` is read instead.
185
186 .. program:: pathd
187
188 :abbr:`PATH` supports all the common FRR daemon start options which are
189 documented elsewhere.
190
191 PCEP Support
192 ============
193
194 A pceplib is included in the frr source tree and build by default.
195
196
197 To start pathd with pcep support the extra parameter `-M pathd_pcep` should be
198 passed to the pathd daemon.
199
200 An example of command line with pcep module could be this
201
202 .. code-block:: frr
203
204 pathd -u root -g root -f pathd.conf -z /tmp/zebra-demo1.sock --vty_socket=/var/run/demo1.vty -i /tmp/pathd-demo1.pid -M frr/modules/pathd_pcep.so --log file:/tmp/kk.txt
205
206 Pathd Configuration
207 ===================
208
209 Example:
210
211 .. code-block:: frr
212
213 debug pathd pcep basic
214 segment-routing
215 traffic-eng
216 mpls-te on
217 mpls-te import ospfv2
218 segment-list SL1
219 index 10 mpls label 16010
220 index 20 mpls label 16030
221 !
222 segment-list SL2
223 index 10 nai prefix 10.1.2.1/32 iface 1
224 index 20 nai adjacency 10.1.20.1 10.1.20.2
225 index 30 nai prefix 10.10.10.5/32 algorithm 0
226 index 40 mpls label 18001
227 !
228 policy color 1 endpoint 192.0.2.1
229 name default
230 binding-sid 4000
231 candidate-path preference 100 name CP1 explicit segment-list SL1
232 candidate-path preference 200 name CP2 dynamic
233 affinity include-any 0x000000FF
234 bandwidth 100000
235 metric bound msd 16 required
236 metric te 10
237 objective-function mcp required
238 !
239 pcep
240 pce-config GROUP1
241 source-address 192.0.2.1
242 tcp-md5-auth secret
243 timer keep-alive 30
244 !
245 pce PCE1
246 config GROUP1
247 address ip 192.0.2.10
248 !
249 pce PCE2
250 config GROUP1
251 address ip 192.0.2.9
252 !
253 pcc
254 peer PCE1 precedence 10
255 peer PCE2 precedence 20
256 !
257 !
258 !
259 !
260
261
262 .. _path-commands:
263
264 Configuration Commands
265 ----------------------
266
267 .. clicmd:: segment-routing
268
269 Configure segment routing.
270
271 .. clicmd:: traffic-eng
272
273 Configure segment routing traffic engineering.
274
275 .. clicmd:: mpls-te <on|off>
276
277 Activate/Deactivate use of internal Traffic Engineering Database
278
279 .. clicmd:: mpls-te import <ospfv2|ospfv3|isis>
280
281 Load data from the selected igp
282
283 .. clicmd:: segment-list NAME
284
285 Delete or start a segment list definition.
286
287 .. clicmd:: index INDEX mpls label LABEL
288 .. clicmd:: index INDEX nai adjacency A.B.C.D A.B.C.D
289 .. clicmd:: index INDEX nai prefix A.B.C.D/M algorithm <0|1>
290 .. clicmd:: index INDEX nai prefix A.B.C.D/M iface (0-65535)
291
292 Delete or specify a segment in a segment list definition.
293
294
295 .. clicmd:: policy color COLOR endpoint ENDPOINT
296
297 Delete or start a policy definition.
298
299
300 .. clicmd:: name NAME
301
302 Specify the policy name.
303
304
305 .. clicmd:: binding-sid LABEL
306
307 Specify the policy SID.
308
309
310 .. clicmd:: candidate-path preference PREFERENCE name NAME explicit segment-list SEGMENT-LIST-NAME
311
312 Delete or define an explicit candidate path.
313
314
315 .. clicmd:: candidate-path preference PREFERENCE name NAME dynamic
316
317 Delete or start a dynamic candidate path definition.
318
319
320 .. clicmd:: affinity <exclude-any|include-any|include-all> BITPATTERN
321
322 Delete or specify an affinity constraint for a dynamic candidate path.
323
324
325 .. clicmd:: bandwidth BANDWIDTH [required]
326
327 Delete or specify a bandwidth constraint for a dynamic candidate path.
328
329
330 .. clicmd:: metric [bound] METRIC VALUE [required]
331
332 Delete or specify a metric constraint for a dynamic candidate path.
333
334 The possible metrics are:
335 - igp: IGP metric
336 - te: TE metric
337 - hc: Hop Counts
338 - abc: Aggregate bandwidth consumption
339 - mll: Load of the most loaded link
340 - igp: Cumulative IGP cost
341 - cte: Cumulative TE cost
342 - igp: P2MP IGP metric
343 - pte: P2MP TE metric
344 - phc: P2MP hop count metric
345 - msd: Segment-ID (SID) Depth
346 - pd: Path Delay metric
347 - pdv: Path Delay Variation metric
348 - pl: Path Loss metric
349 - ppd: P2MP Path Delay metric
350 - pdv: P2MP Path Delay variation metric
351 - ppl: P2MP Path Loss metric
352 - nap: Number of adaptations on a path
353 - nlp: Number of layers on a path
354 - dc: Domain Count metric
355 - bnc: Border Node Count metric
356
357
358 .. clicmd:: objective-function OBJFUN1 [required]
359
360 Delete or specify a PCEP objective function constraint for a dynamic
361 candidate path.
362
363 The possible functions are:
364 - mcp: Minimum Cost Path [RFC5541]
365 - mlp: Minimum Load Path [RFC5541]
366 - mbp: Maximum residual Bandwidth Path [RFC5541]
367 - mbc: Minimize aggregate Bandwidth Consumption [RFC5541]
368 - mll: Minimize the Load of the most loaded Link [RFC5541]
369 - mcc: Minimize the Cumulative Cost of a set of paths [RFC5541]
370 - spt: Shortest Path Tree [RFC8306]
371 - mct: Minimum Cost Tree [RFC8306]
372 - mplp: Minimum Packet Loss Path [RFC8233]
373 - mup: Maximum Under-Utilized Path [RFC8233]
374 - mrup: Maximum Reserved Under-Utilized Path [RFC8233]
375 - mtd: Minimize the number of Transit Domains [RFC8685]
376 - mbn: Minimize the number of Border Nodes [RFC8685]
377 - mctd: Minimize the number of Common Transit Domains [RFC8685]
378 - msl: Minimize the number of Shared Links [RFC8800]
379 - mss: Minimize the number of Shared SRLGs [RFC8800]
380 - msn: Minimize the number of Shared Nodes [RFC8800]
381
382
383 .. clicmd:: debug pathd pcep [basic|path|message|pceplib]
384
385 Enable or disable debugging for the pcep module:
386
387 - basic: Enable basic PCEP logging
388 - path: Log the path structures
389 - message: Log the PCEP messages
390 - pceplib: Enable pceplib logging
391
392
393 .. clicmd:: pcep
394
395 Configure PCEP support.
396
397
398 .. clicmd:: pce-config NAME
399
400 Define a shared PCE configuration that can be used in multiple PCE
401 declarations.
402
403
404 .. clicmd:: pce NAME
405
406 Define or delete a PCE definition.
407
408
409 .. clicmd:: config WORD
410
411 Select a shared configuration. If not defined, the default
412 configuration will be used.
413
414
415 .. clicmd:: address <ip A.B.C.D | ipv6 X:X::X:X> [port (1024-65535)]
416
417 Define the address and port of the PCE.
418
419 If not specified, the port is the standard PCEP port 4189.
420
421 This should be specified in the PCC peer definition.
422
423
424 .. clicmd:: source-address [ip A.B.C.D | ipv6 X:X::X:X] [port PORT]
425
426 Define the address and/or port of the PCC as seen by the PCE.
427 This can be used in a configuration group or a PCC peer declaration.
428
429 If not specified, the source address will be the router identifier selected
430 by zebra, and the port will be the standard PCEP port 4189.
431
432 This can be specified in either the PCC peer definition or in a
433 configuration group.
434
435
436 .. clicmd:: tcp-md5-auth WORD
437
438 Enable TCP MD5 security with the given secret.
439
440 This can be specified in either the PCC peer definition or in a
441 configuration group.
442
443
444 .. clicmd:: sr-draft07
445
446 Specify if a PCE only support segment routing draft 7, this flag will limit
447 the PCC behavior to this draft.
448
449 This can be specified in either the PCC peer definition or in a
450 configuration group.
451
452
453 .. clicmd:: pce-initiated
454
455 Specify if PCE-initiated LSP should be allowed for this PCE.
456
457 This can be specified in either the PCC peer definition or in a
458 configuration group.
459
460
461 .. clicmd:: timer [keep-alive (1-63)] [min-peer-keep-alive (1-255)] [max-peer-keep-alive (1-255)] [dead-timer (4-255)] [min-peer-dead-timer (4-255)] [max-peer-dead-timer (4-255)] [pcep-request (1-120)] [session-timeout-interval (1-120)] [delegation-timeout (1-60)]
462
463 Specify the PCEP timers.
464
465 This can be specified in either the PCC peer definition or in a
466 configuration group.
467
468
469 .. clicmd:: pcc
470
471 Disable or start the definition of a PCC.
472
473
474 .. clicmd:: msd (1-32)
475
476 Specify the maximum SID depth in a PCC definition.
477
478
479 .. clicmd:: peer WORD [precedence (1-255)]
480
481 Specify a peer and its precedence in a PCC definition.
482
483
484 Introspection Commands
485 ----------------------
486
487 .. clicmd:: show sr-te policy [detail]
488
489 Display the segment routing policies.
490
491 .. code-block:: frr
492
493 router# show sr-te policy
494
495 Endpoint Color Name BSID Status
496 ------------------------------------------
497 192.0.2.1 1 default 4000 Active
498
499
500 .. code-block:: frr
501
502 router# show sr-te policy detail
503
504 Endpoint: 192.0.2.1 Color: 1 Name: LOW_DELAY BSID: 4000 Status: Active
505 Preference: 100 Name: cand1 Type: explicit Segment-List: sl1 Protocol-Origin: Local
506 * Preference: 200 Name: cand1 Type: dynamic Segment-List: 32453452 Protocol-Origin: PCEP
507
508 The asterisk (*) marks the best, e.g. active, candidate path. Note that for segment-lists which are
509 retrieved via PCEP a random number based name is generated.
510
511
512 .. clicmd:: show sr-te pcep counters
513
514 Display the counters from pceplib.
515
516
517 .. clicmd:: show sr-te pcep pce-config [NAME]
518
519 Display a shared configuration. if no name is specified, the default
520 configuration will be displayed.
521
522
523 .. clicmd:: show sr-te pcep pcc
524
525 Display PCC information.
526
527
528 .. clicmd:: show sr-te pcep session [NAME]
529
530 Display the information of a PCEP session, if not name is specified all the
531 sessions will be displayed.
532
533
534 Utility Commands
535 ----------------
536
537 .. clicmd:: clear sr-te pcep session [NAME]
538
539 Reset the pcep session by disconnecting from the PCE and performing the
540 normal reconnection process. No configuration is changed.
541
542
543 Usage with BGP route-maps
544 =========================
545
546 It is possible to steer traffic 'into' a segment routing policy for routes
547 learned through BGP using route-maps:
548
549 .. code-block:: frr
550
551 route-map SET_SR_POLICY permit 10
552 set sr-te color 1
553 !
554 router bgp 1
555 bgp router-id 192.0.2.2
556 neighbor 192.0.2.1 remote-as 1
557 neighbor 192.0.2.1 update-source lo
558 !
559 address-family ipv4 unicast
560 neighbor 192.0.2.1 next-hop-self
561 neighbor 192.0.2.1 route-map SET_SR_POLICY in
562 redistribute static
563 exit-address-family
564 !
565 !
566
567 In this case, the SR Policy with color `1` and endpoint `192.0.2.1` is selected.
568
569
570 Sample configuration
571 ====================
572
573 .. code-block:: frr
574
575 ! Default pathd configuration sample
576 !
577 password frr
578 log stdout
579
580 segment-routing
581 traffic-eng
582 segment-list test1
583 index 10 mpls label 123
584 index 20 mpls label 456
585 !
586 segment-list test2
587 index 10 mpls label 321
588 index 20 mpls label 654
589 !
590 policy color 1 endpoint 192.0.2.1
591 name one
592 binding-sid 100
593 candidate-path preference 100 name test1 explicit segment-list test1
594 candidate-path preference 200 name test2 explicit segment-list test2
595 !
596 policy color 2 endpoint 192.0.2.2
597 name two
598 binding-sid 101
599 candidate-path preference 100 name def explicit segment-list test2
600 candidate-path preference 200 name dyn dynamic
601 bandwidth 12345
602 metric bound abc 16 required
603 metric te 10
604 !
605 !
606 pcep
607 pcc-peer PCE1
608 address ip 127.0.0.1
609 sr-draft07
610 !
611 pcc
612 peer PCE1
613 !
614 !
615 !
616