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.
13 .. image:: images/pathd_general.png
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`).
25 Explicit Segment Lists
26 ----------------------
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.
43 index 10 mpls label 16001
44 index 20 mpls label 16002
46 policy color 1 endpoint 192.0.2.4
49 candidate-path preference 100 name CP1 explicit segment-list SL1
52 Explicit Segment Lists and Traffic Engineering Database (TED)
53 -------------------------------------------------------------
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
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
74 policy color 1 endpoint 192.0.2.4
77 candidate-path preference 100 name CP1 explicit segment-list SL1
80 In this case no MPLS are provided but the pathd TED support will resolve the
81 configuration provided to corresponding MPLS labels.
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.
90 It would be the same for isis (:ref:`isis-traffic-engineering`) but in the
91 moment of writting it's not fully tested.
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
108 address ip 192.0.2.10
111 peer PCE1 precedence 10
113 policy color 1 endpoint 192.0.2.4
116 candidate-path preference 100 name CP2 dynamic
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)
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
128 .. image:: images/pathd_config.png
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.
145 address ip 192.0.2.10
153 peer PCE1 precedence 10
154 peer PCE2 precedence 20
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.
164 Another interesting command is :clicmd:`show mpls table`
165 to check the installed mpls configuration based in those obtained
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).
175 .. image:: images/pathd_initiated_multi.png
180 Default configuration file for *pathd* is :file:`pathd.conf`. The typical
181 location of :file:`pathd.conf` is |INSTALL_PREFIX_ETC|/pathd.conf.
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.
188 :abbr:`PATH` supports all the common FRR daemon start options which are
189 documented elsewhere.
194 A pceplib is included in the frr source tree and build by default.
197 To start pathd with pcep support the extra parameter `-M pathd_pcep` should be
198 passed to the pathd daemon.
200 An example of command line with pcep module could be this
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
213 debug pathd pcep basic
217 mpls-te import ospfv2
219 index 10 mpls label 16010
220 index 20 mpls label 16030
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
228 policy color 1 endpoint 192.0.2.1
231 candidate-path preference 100 name CP1 explicit segment-list SL1
232 candidate-path preference 200 name CP2 dynamic
233 affinity include-any 0x000000FF
235 metric bound msd 16 required
237 objective-function mcp required
241 source-address 192.0.2.1
247 address ip 192.0.2.10
254 peer PCE1 precedence 10
255 peer PCE2 precedence 20
264 Configuration Commands
265 ----------------------
267 .. clicmd:: segment-routing
269 Configure segment routing.
271 .. clicmd:: traffic-eng
273 Configure segment routing traffic engineering.
275 .. clicmd:: mpls-te <on|off>
277 Activate/Deactivate use of internal Traffic Engineering Database
279 .. clicmd:: mpls-te import <ospfv2|ospfv3|isis>
281 Load data from the selected igp
283 .. clicmd:: segment-list NAME
285 Delete or start a segment list definition.
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)
292 Delete or specify a segment in a segment list definition.
295 .. clicmd:: policy color COLOR endpoint ENDPOINT
297 Delete or start a policy definition.
300 .. clicmd:: name NAME
302 Specify the policy name.
305 .. clicmd:: binding-sid LABEL
307 Specify the policy SID.
310 .. clicmd:: candidate-path preference PREFERENCE name NAME explicit segment-list SEGMENT-LIST-NAME
312 Delete or define an explicit candidate path.
315 .. clicmd:: candidate-path preference PREFERENCE name NAME dynamic
317 Delete or start a dynamic candidate path definition.
320 .. clicmd:: affinity <exclude-any|include-any|include-all> BITPATTERN
322 Delete or specify an affinity constraint for a dynamic candidate path.
325 .. clicmd:: bandwidth BANDWIDTH [required]
327 Delete or specify a bandwidth constraint for a dynamic candidate path.
330 .. clicmd:: metric [bound] METRIC VALUE [required]
332 Delete or specify a metric constraint for a dynamic candidate path.
334 The possible metrics are:
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
358 .. clicmd:: objective-function OBJFUN1 [required]
360 Delete or specify a PCEP objective function constraint for a dynamic
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]
383 .. clicmd:: debug pathd pcep [basic|path|message|pceplib]
385 Enable or disable debugging for the pcep module:
387 - basic: Enable basic PCEP logging
388 - path: Log the path structures
389 - message: Log the PCEP messages
390 - pceplib: Enable pceplib logging
395 Configure PCEP support.
398 .. clicmd:: pce-config NAME
400 Define a shared PCE configuration that can be used in multiple PCE
406 Define or delete a PCE definition.
409 .. clicmd:: config WORD
411 Select a shared configuration. If not defined, the default
412 configuration will be used.
415 .. clicmd:: address <ip A.B.C.D | ipv6 X:X::X:X> [port (1024-65535)]
417 Define the address and port of the PCE.
419 If not specified, the port is the standard PCEP port 4189.
421 This should be specified in the PCC peer definition.
424 .. clicmd:: source-address [ip A.B.C.D | ipv6 X:X::X:X] [port PORT]
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.
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.
432 This can be specified in either the PCC peer definition or in a
436 .. clicmd:: tcp-md5-auth WORD
438 Enable TCP MD5 security with the given secret.
440 This can be specified in either the PCC peer definition or in a
444 .. clicmd:: sr-draft07
446 Specify if a PCE only support segment routing draft 7, this flag will limit
447 the PCC behavior to this draft.
449 This can be specified in either the PCC peer definition or in a
453 .. clicmd:: pce-initiated
455 Specify if PCE-initiated LSP should be allowed for this PCE.
457 This can be specified in either the PCC peer definition or in a
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)]
463 Specify the PCEP timers.
465 This can be specified in either the PCC peer definition or in a
471 Disable or start the definition of a PCC.
474 .. clicmd:: msd (1-32)
476 Specify the maximum SID depth in a PCC definition.
479 .. clicmd:: peer WORD [precedence (1-255)]
481 Specify a peer and its precedence in a PCC definition.
484 Introspection Commands
485 ----------------------
487 .. clicmd:: show sr-te policy [detail]
489 Display the segment routing policies.
493 router# show sr-te policy
495 Endpoint Color Name BSID Status
496 ------------------------------------------
497 192.0.2.1 1 default 4000 Active
502 router# show sr-te policy detail
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
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.
512 .. clicmd:: show sr-te pcep counters
514 Display the counters from pceplib.
517 .. clicmd:: show sr-te pcep pce-config [NAME]
519 Display a shared configuration. if no name is specified, the default
520 configuration will be displayed.
523 .. clicmd:: show sr-te pcep pcc
525 Display PCC information.
528 .. clicmd:: show sr-te pcep session [NAME]
530 Display the information of a PCEP session, if not name is specified all the
531 sessions will be displayed.
537 .. clicmd:: clear sr-te pcep session [NAME]
539 Reset the pcep session by disconnecting from the PCE and performing the
540 normal reconnection process. No configuration is changed.
543 Usage with BGP route-maps
544 =========================
546 It is possible to steer traffic 'into' a segment routing policy for routes
547 learned through BGP using route-maps:
551 route-map SET_SR_POLICY permit 10
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
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
567 In this case, the SR Policy with color `1` and endpoint `192.0.2.1` is selected.
575 ! Default pathd configuration sample
583 index 10 mpls label 123
584 index 20 mpls label 456
587 index 10 mpls label 321
588 index 20 mpls label 654
590 policy color 1 endpoint 192.0.2.1
593 candidate-path preference 100 name test1 explicit segment-list test1
594 candidate-path preference 200 name test2 explicit segment-list test2
596 policy color 2 endpoint 192.0.2.2
599 candidate-path preference 100 name def explicit segment-list test2
600 candidate-path preference 200 name dyn dynamic
602 metric bound abc 16 required