Add and run some linters via tox and pre-commit
[bgpcep.git] / docs / pcep / pcep-user-guide-active-stateful-pce.rst
1 .. _pcep-user-guide-active-stateful-pce:
2
3 Active Stateful PCE
4 ===================
5 The PCEP extension for Stateful PCE brings a visibility of active LSPs to PCE, in order to optimize path computation, while considering individual LSPs and their interactions.
6 This requires state synchronization mechanism between PCE and PCC.
7 Moreover, Active Stateful PCE is capable to address LSP parameter changes to the PCC.
8
9 .. contents:: Contents
10    :depth: 2
11    :local:
12
13 Configuration
14 ^^^^^^^^^^^^^
15 This capability is enabled by default. No additional configuration is required.
16
17 Speaker Entity identifier
18 '''''''''''''''''''''''''
19 The Speaker Entity Identifier is an optional
20 TLV that may be included in the OPEN Object when a PCEP speaker
21 wishes to determine if state synchronization can be skipped when a
22 PCEP session is restarted.
23
24 **URL:** ``/restconf/config/network-topology:network-topology/topology/pcep-topology/node/43.43.43.43``
25
26 **RFC8040 URL:** ``/rests/data/network-topology:network-topology/topology=pcep-topology/node=43.43.43.43``
27
28 **Method:** ``PUT``
29
30 .. tabs::
31
32    .. tab:: XML
33
34       **Content-Type:** ``application/xml``
35
36       **Request Body:**
37
38       .. code-block:: xml
39          :linenos:
40          :emphasize-lines: 2,4
41
42          <node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
43              <node-id>43.43.43.43</node-id>
44              <session-config xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep:config">
45                  <speaker-entity-id-value xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep:sync:optimizations:config">AQIDBA==</speaker-entity-id-value>
46              </session-config>
47          </node>
48
49       @line 2: **address** - A PCC IP address.
50
51       @line 4: **Speaker Entity Identifier** - The Speaker Entity identifier assigned to PCEP Node.
52
53    .. tab:: JSON
54
55       **Content-Type:** ``application/json``
56
57       **Request Body:**
58
59       .. code-block:: json
60          :linenos:
61          :emphasize-lines: 3,5
62
63          {
64              "node": {
65                  "node-id": "43.43.43.43",
66                  "topology:pcep:config:session-config": {
67                      "topology:pcep:sync:optimizations:config:speaker-entity-id-value": "AQIDBA=="
68                  }
69              }
70          }
71
72       @line 3: **address** - A PCC IP address.
73
74       @line 5: **Speaker Entity Identifier** - The Speaker Entity identifier assigned to PCEP Node.
75
76 MD5 authentication configuration
77 ''''''''''''''''''''''''''''''''
78 The OpenDaylight PCEP implementation supports TCP MD5 for authentication.
79 The sample configuration below shows how to set authentication password for a particular PCC.
80
81 **URL:** ``/restconf/config/network-topology:network-topology/topology/pcep-topology/node/43.43.43.43``
82
83 **RFC8040 URL:** ``/rests/data/network-topology:network-topology/topology=pcep-topology/node=43.43.43.43``
84
85 **Method:** ``PUT``
86
87 .. tabs::
88
89    .. tab:: XML
90
91       **Content-Type:** ``application/xml``
92
93       **Request Body:**
94
95       .. code-block:: xml
96          :linenos:
97          :emphasize-lines: 2,4
98
99          <node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
100              <node-id>43.43.43.43</node-id>
101              <session-config xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep:config">
102                  <password>topsecret</password>
103              </session-config>
104          </node>
105
106       @line 2: **address** - A PCC IP address.
107
108       @line 4: **password** - MD5 authentication phrase.
109
110    .. tab:: JSON
111
112       **Content-Type:** ``application/json``
113
114       **Request Body:**
115
116       .. code-block:: json
117          :linenos:
118          :emphasize-lines: 3,5
119
120          {
121              "node": {
122                  "node-id": "43.43.43.43",
123                  "topology:pcep:config:session-config": {
124                      "password": "topsecret"
125                  }
126              }
127          }
128
129       @line 3: **address** - A PCC IP address.
130
131       @line 5: **password** - MD5 authentication phrase.
132
133 LSP State Database
134 ^^^^^^^^^^^^^^^^^^
135 The *LSP State Database* (LSP-DB) contains an information about all LSPs and their attributes.
136 The LSP state is synchronized between the PCC and PCE.
137 First, initial LSP state synchronization is performed once the session between PCC and PCE is established in order to learn PCC's LPSs.
138 This step is a prerequisite to following LSPs manipulation operations.
139
140
141 .. figure:: ./images/pcep-sync.png
142    :align: center
143    :alt: LSP State synchronization
144
145    LSP State Synchronization.
146
147 LSP-DB API
148 ''''''''''
149
150 .. code-block:: console
151
152    path-computation-client
153       +--ro reported-lsp* [name]
154          +--ro name        string
155          +--ro path* [lsp-id]
156          |  +--ro lsp-id                      rsvp:lsp-id
157          |  +--ro ero
158          |  |  +--ro processing-rule?   boolean
159          |  |  +--ro ignore?            boolean
160          |  |  +--ro subobject*
161          |  |     +--ro loose         boolean
162          |  |     +--ro (subobject-type)?
163          |  |        +--:(as-number-case)
164          |  |        |  +--ro as-number
165          |  |        |     +--ro as-number    inet:as-number
166          |  |        +--:(ip-prefix-case)
167          |  |        |  +--ro ip-prefix
168          |  |        |     +--ro ip-prefix    inet:ip-prefix
169          |  |        +--:(label-case)
170          |  |        |  +--ro label
171          |  |        |     +--ro uni-directional             boolean
172          |  |        |     +--ro (label-type)?
173          |  |        |        +--:(type1-label-case)
174          |  |        |        |  +--ro type1-label
175          |  |        |        |     +--ro type1-label    uint32
176          |  |        |        +--:(generalized-label-case)
177          |  |        |        |  +--ro generalized-label
178          |  |        |        |     +--ro generalized-label    binary
179          |  |        |        +--:(waveband-switching-label-case)
180          |  |        |           +--ro waveband-switching-label
181          |  |        |              +--ro end-label      uint32
182          |  |        |              +--ro start-label    uint32
183          |  |        |              +--ro waveband-id    uint32
184          |  |        +--:(srlg-case)
185          |  |        |  +--ro srlg
186          |  |        |     +--ro srlg-id    srlg-id
187          |  |        +--:(unnumbered-case)
188          |  |        |  +--ro unnumbered
189          |  |        |     +--ro router-id       uint32
190          |  |        |     +--ro interface-id    uint32
191          |  |        +--:(exrs-case)
192          |  |        |  +--ro exrs
193          |  |        |     +--ro exrs*
194          |  |        |        +--ro mandatory?    boolean
195          |  |        |        +--ro attribute     enumeration
196          |  |        |        +--ro (subobject-type)?
197          |  |        |           +--:(as-number-case)
198          |  |        |           |  +--ro as-number
199          |  |        |           |     +--ro as-number    inet:as-number
200          |  |        |           +--:(ip-prefix-case)
201          |  |        |           |  +--ro ip-prefix
202          |  |        |           |     +--ro ip-prefix    inet:ip-prefix
203          |  |        |           +--:(label-case)
204          |  |        |           |  +--ro label
205          |  |        |           |     +--ro uni-directional             boolean
206          |  |        |           |     +--ro (label-type)?
207          |  |        |           |        +--:(type1-label-case)
208          |  |        |           |        |  +--ro type1-label
209          |  |        |           |        |     +--ro type1-label    uint32
210          |  |        |           |        +--:(generalized-label-case)
211          |  |        |           |        |  +--ro generalized-label
212          |  |        |           |        |     +--ro generalized-label    binary
213          |  |        |           |        +--:(waveband-switching-label-case)
214          |  |        |           |           +--ro waveband-switching-label
215          |  |        |           |              +--ro end-label      uint32
216          |  |        |           |              +--ro start-label    uint32
217          |  |        |           |              +--ro waveband-id    uint32
218          |  |        |           +--:(srlg-case)
219          |  |        |           |  +--ro srlg
220          |  |        |           |     +--ro srlg-id    srlg-id
221          |  |        |           +--:(unnumbered-case)
222          |  |        |              +--ro unnumbered
223          |  |        |                 +--ro router-id       uint32
224          |  |        |                 +--ro interface-id    uint32
225          |  |        +--:(path-key-case)
226          |  |           +--ro path-key
227          |  |              +--ro pce-id      pce-id
228          |  |              +--ro path-key    path-key
229          |  +--ro lspa
230          |  |  +--ro processing-rule?            boolean
231          |  |  +--ro ignore?                     boolean
232          |  |  +--ro hold-priority?              uint8
233          |  |  +--ro setup-priority?             uint8
234          |  |  +--ro local-protection-desired?   boolean
235          |  |  +--ro label-recording-desired?    boolean
236          |  |  +--ro se-style-desired?           boolean
237          |  |  +--ro session-name?               string
238          |  |  +--ro include-any?                attribute-filter
239          |  |  +--ro exclude-any?                attribute-filter
240          |  |  +--ro include-all?                attribute-filter
241          |  |  +--ro tlvs
242          |  |     +--ro vendor-information-tlv*
243          |  |        +--ro enterprise-number?   iana:enterprise-number
244          |  |        +--ro (enterprise-specific-information)?
245          |  +--ro bandwidth
246          |  |  +--ro processing-rule?   boolean
247          |  |  +--ro ignore?            boolean
248          |  |  +--ro bandwidth?         netc:bandwidth
249          |  +--ro reoptimization-bandwidth
250          |  |  +--ro processing-rule?   boolean
251          |  |  +--ro ignore?            boolean
252          |  |  +--ro bandwidth?         netc:bandwidth
253          |  +--ro metrics*
254          |  |  +--ro metric
255          |  |     +--ro processing-rule?   boolean
256          |  |     +--ro ignore?            boolean
257          |  |     +--ro metric-type        uint8
258          |  |     +--ro bound?             boolean
259          |  |     +--ro computed?          boolean
260          |  |     +--ro value?             ieee754:float32
261          |  +--ro iro
262          |  |  +--ro processing-rule?   boolean
263          |  |  +--ro ignore?            boolean
264          |  |  +--ro subobject*
265          |  |     +--ro loose         boolean
266          |  |     +--ro (subobject-type)?
267          |  |        +--:(as-number-case)
268          |  |        |  +--ro as-number
269          |  |        |     +--ro as-number    inet:as-number
270          |  |        +--:(ip-prefix-case)
271          |  |        |  +--ro ip-prefix
272          |  |        |     +--ro ip-prefix    inet:ip-prefix
273          |  |        +--:(label-case)
274          |  |        |  +--ro label
275          |  |        |     +--ro uni-directional             boolean
276          |  |        |     +--ro (label-type)?
277          |  |        |        +--:(type1-label-case)
278          |  |        |        |  +--ro type1-label
279          |  |        |        |     +--ro type1-label    uint32
280          |  |        |        +--:(generalized-label-case)
281          |  |        |        |  +--ro generalized-label
282          |  |        |        |     +--ro generalized-label    binary
283          |  |        |        +--:(waveband-switching-label-case)
284          |  |        |           +--ro waveband-switching-label
285          |  |        |              +--ro end-label      uint32
286          |  |        |              +--ro start-label    uint32
287          |  |        |              +--ro waveband-id    uint32
288          |  |        +--:(srlg-case)
289          |  |        |  +--ro srlg
290          |  |        |     +--ro srlg-id    srlg-id
291          |  |        +--:(unnumbered-case)
292          |  |        |  +--ro unnumbered
293          |  |        |     +--ro router-id       uint32
294          |  |        |     +--ro interface-id    uint32
295          |  |        +--:(exrs-case)
296          |  |        |  +--ro exrs
297          |  |        |     +--ro exrs*
298          |  |        |        +--ro mandatory?    boolean
299          |  |        |        +--ro attribute     enumeration
300          |  |        |        +--ro (subobject-type)?
301          |  |        |           +--:(as-number-case)
302          |  |        |           |  +--ro as-number
303          |  |        |           |     +--ro as-number    inet:as-number
304          |  |        |           +--:(ip-prefix-case)
305          |  |        |           |  +--ro ip-prefix
306          |  |        |           |     +--ro ip-prefix    inet:ip-prefix
307          |  |        |           +--:(label-case)
308          |  |        |           |  +--ro label
309          |  |        |           |     +--ro uni-directional             boolean
310          |  |        |           |     +--ro (label-type)?
311          |  |        |           |        +--:(type1-label-case)
312          |  |        |           |        |  +--ro type1-label
313          |  |        |           |        |     +--ro type1-label    uint32
314          |  |        |           |        +--:(generalized-label-case)
315          |  |        |           |        |  +--ro generalized-label
316          |  |        |           |        |     +--ro generalized-label    binary
317          |  |        |           |        +--:(waveband-switching-label-case)
318          |  |        |           |           +--ro waveband-switching-label
319          |  |        |           |              +--ro end-label      uint32
320          |  |        |           |              +--ro start-label    uint32
321          |  |        |           |              +--ro waveband-id    uint32
322          |  |        |           +--:(srlg-case)
323          |  |        |           |  +--ro srlg
324          |  |        |           |     +--ro srlg-id    srlg-id
325          |  |        |           +--:(unnumbered-case)
326          |  |        |              +--ro unnumbered
327          |  |        |                 +--ro router-id       uint32
328          |  |        |                 +--ro interface-id    uint32
329          |  |        +--:(path-key-case)
330          |  |           +--ro path-key
331          |  |              +--ro pce-id      pce-id
332          |  |              +--ro path-key    path-key
333          |  +--ro rro
334          |  |  +--ro processing-rule?   boolean
335          |  |  +--ro ignore?            boolean
336          |  |  +--ro subobject*
337          |  |     +--ro protection-available?   boolean
338          |  |     +--ro protection-in-use?      boolean
339          |  |     +--ro (subobject-type)?
340          |  |        +--:(ip-prefix-case)
341          |  |        |  +--ro ip-prefix
342          |  |        |     +--ro ip-prefix    inet:ip-prefix
343          |  |        +--:(label-case)
344          |  |        |  +--ro label
345          |  |        |     +--ro uni-directional             boolean
346          |  |        |     +--ro (label-type)?
347          |  |        |     |  +--:(type1-label-case)
348          |  |        |     |  |  +--ro type1-label
349          |  |        |     |  |     +--ro type1-label    uint32
350          |  |        |     |  +--:(generalized-label-case)
351          |  |        |     |  |  +--ro generalized-label
352          |  |        |     |  |     +--ro generalized-label    binary
353          |  |        |     |  +--:(waveband-switching-label-case)
354          |  |        |     |     +--ro waveband-switching-label
355          |  |        |     |        +--ro end-label      uint32
356          |  |        |     |        +--ro start-label    uint32
357          |  |        |     |        +--ro waveband-id    uint32
358          |  |        |     +--ro global?                     boolean
359          |  |        +--:(unnumbered-case)
360          |  |        |  +--ro unnumbered
361          |  |        |     +--ro router-id       uint32
362          |  |        |     +--ro interface-id    uint32
363          |  |        +--:(path-key-case)
364          |  |           +--ro path-key
365          |  |              +--ro pce-id      pce-id
366          |  |              +--ro path-key    path-key
367          |  +--ro xro
368          |  |  +--ro processing-rule?   boolean
369          |  |  +--ro ignore?            boolean
370          |  |  +--ro flags              bits
371          |  |  +--ro subobject*
372          |  |     +--ro mandatory?    boolean
373          |  |     +--ro attribute     enumeration
374          |  |     +--ro (subobject-type)?
375          |  |        +--:(as-number-case)
376          |  |        |  +--ro as-number
377          |  |        |     +--ro as-number    inet:as-number
378          |  |        +--:(ip-prefix-case)
379          |  |        |  +--ro ip-prefix
380          |  |        |     +--ro ip-prefix    inet:ip-prefix
381          |  |        +--:(label-case)
382          |  |        |  +--ro label
383          |  |        |     +--ro uni-directional             boolean
384          |  |        |     +--ro (label-type)?
385          |  |        |        +--:(type1-label-case)
386          |  |        |        |  +--ro type1-label
387          |  |        |        |     +--ro type1-label    uint32
388          |  |        |        +--:(generalized-label-case)
389          |  |        |        |  +--ro generalized-label
390          |  |        |        |     +--ro generalized-label    binary
391          |  |        |        +--:(waveband-switching-label-case)
392          |  |        |           +--ro waveband-switching-label
393          |  |        |              +--ro end-label      uint32
394          |  |        |              +--ro start-label    uint32
395          |  |        |              +--ro waveband-id    uint32
396          |  |        +--:(srlg-case)
397          |  |        |  +--ro srlg
398          |  |        |     +--ro srlg-id    srlg-id
399          |  |        +--:(unnumbered-case)
400          |  |           +--ro unnumbered
401          |  |              +--ro router-id       uint32
402          |  |              +--ro interface-id    uint32
403          |  +--ro of
404          |  |  +--ro processing-rule?   boolean
405          |  |  +--ro ignore?            boolean
406          |  |  +--ro code               of-id
407          |  |  +--ro tlvs
408          |  |     +--ro vendor-information-tlv*
409          |  |        +--ro enterprise-number?   iana:enterprise-number
410          |  |        +--ro (enterprise-specific-information)?
411          |  +--ro class-type
412          |     +--ro processing-rule?   boolean
413          |     +--ro ignore?            boolean
414          |     +--ro class-type         class-type
415          +--ro metadata
416          +--ro lsp
417          |  +--ro processing-rule?   boolean
418          |  +--ro ignore?            boolean
419          |  +--ro tlvs
420          |  |  +--ro lsp-error-code
421          |  |  |  +--ro error-code?   uint32
422          |  |  +--ro lsp-identifiers
423          |  |  |  +--ro lsp-id?      rsvp:lsp-id
424          |  |  |  +--ro tunnel-id?   rsvp:tunnel-id
425          |  |  |  +--ro (address-family)?
426          |  |  |     +--:(ipv4-case)
427          |  |  |     |  +--ro ipv4
428          |  |  |     |     +--ro ipv4-tunnel-sender-address      inet:ipv4-address
429          |  |  |     |     +--ro ipv4-extended-tunnel-id         rsvp:ipv4-extended-tunnel-id
430          |  |  |     |     +--ro ipv4-tunnel-endpoint-address    inet:ipv4-address
431          |  |  |     +--:(ipv6-case)
432          |  |  |        +--ro ipv6
433          |  |  |           +--ro ipv6-tunnel-sender-address      inet:ipv6-address
434          |  |  |           +--ro ipv6-extended-tunnel-id         rsvp:ipv6-extended-tunnel-id
435          |  |  |           +--ro ipv6-tunnel-endpoint-address    inet:ipv6-address
436          |  |  +--ro rsvp-error-spec
437          |  |  |  +--ro (error-type)?
438          |  |  |     +--:(rsvp-case)
439          |  |  |     |  +--ro rsvp-error
440          |  |  |     +--:(user-case)
441          |  |  |        +--ro user-error
442          |  |  +--ro symbolic-path-name
443          |  |  |  +--ro path-name?   symbolic-path-name
444          |  |  o--ro vs-tlv
445          |  |  |  +--ro enterprise-number?   iana:enterprise-number
446          |  |  |  +--ro (vendor-payload)?
447          |  |  +--ro vendor-information-tlv*
448          |  |  |  +--ro enterprise-number?   iana:enterprise-number
449          |  |  |  +--ro (enterprise-specific-information)?
450          |  |  +--ro path-binding
451          |  |     x--ro binding-type?      uint8
452          |  |     x--ro binding-value?     binary
453          |  |     +--ro (binding-type-value)?
454          |  |        +--:(mpls-label)
455          |  |        |  +--ro mpls-label?        netc:mpls-label
456          |  |        +--:(mpls-label-entry)
457          |  |           +--ro label?             netc:mpls-label
458          |  |           +--ro traffic-class?     uint8
459          |  |           +--ro bottom-of-stack?   boolean
460          |  |           +--ro time-to-live?      uint8
461          |  +--ro plsp-id?           plsp-id
462          |  +--ro delegate?          boolean
463          |  +--ro sync?              boolean
464          |  +--ro remove?            boolean
465          |  +--ro administrative?    boolean
466          |  +--ro operational?       operational-status
467          +--ro path-setup-type
468             +--ro pst?   uint8
469
470 -----
471
472 The LSP-DB is accessible via RESTCONF.
473 The PCC's LSPs are stored in the ``pcep-topology`` while the session is active.
474 In a next example, there is one PCEP session with PCC identified by its IP address (*43.43.43.43*) and one reported LSP (*foo*).
475
476 **URL:** ``/restconf/operational/network-topology:network-topology/topology/pcep-topology/node/pcc:%2F%2F43.43.43.43``
477
478 **RFC8040 URL:** ``/rests/data/network-topology:network-topology/topology=pcep-topology/node=pcc%3A%2F%2F43.43.43.43``
479
480 **Method:** ``GET``
481
482 .. tabs::
483
484    .. tab:: XML
485
486       **Response Body:**
487
488       .. code-block:: xml
489          :linenos:
490          :emphasize-lines: 2,4,5,8,12,14,15,16,17,18,20,24,25,26,28,29,32,36
491
492          <node>
493             <node-id>pcc://43.43.43.43</node-id>
494             <path-computation-client>
495                <ip-address>43.43.43.43</ip-address>
496                <state-sync>synchronized</state-sync>
497                <stateful-tlv>
498                   <stateful>
499                      <lsp-update-capability>true</lsp-update-capability>
500                   </stateful>
501                </stateful-tlv>
502                <reported-lsp>
503                   <name>foo</name>
504                   <lsp>
505                      <operational>up</operational>
506                      <sync>true</sync>
507                      <plsp-id>1</plsp-id>
508                      <create>false</create>
509                      <administrative>true</administrative>
510                      <remove>false</remove>
511                      <delegate>true</delegate>
512                      <tlvs>
513                         <lsp-identifiers>
514                            <ipv4>
515                               <ipv4-tunnel-sender-address>43.43.43.43</ipv4-tunnel-sender-address>
516                               <ipv4-tunnel-endpoint-address>39.39.39.39</ipv4-tunnel-endpoint-address>
517                               <ipv4-extended-tunnel-id>39.39.39.39</ipv4-extended-tunnel-id>
518                            </ipv4>
519                            <tunnel-id>1</tunnel-id>
520                            <lsp-id>1</lsp-id>
521                         </lsp-identifiers>
522                         <symbolic-path-name>
523                            <path-name>Zm9v</path-name>
524                         </symbolic-path-name>
525                      </tlvs>
526                   </lsp>
527                   <ero>
528                      <subobject>
529                         <loose>false</loose>
530                         <ip-prefix>
531                            <ip-prefix>201.20.160.40/32</ip-prefix>
532                         </ip-prefix>
533                      </subobject>
534                      <subobject>
535                         <loose>false</loose>
536                         <ip-prefix>
537                            <ip-prefix>195.20.160.39/32</ip-prefix>
538                         </ip-prefix>
539                      </subobject>
540                      <subobject>
541                         <loose>false</loose>
542                         <ip-prefix>
543                            <ip-prefix>39.39.39.39/32</ip-prefix>
544                         </ip-prefix>
545                      </subobject>
546                   </ero>
547                </reported-lsp>
548             </path-computation-client>
549          </node>
550
551       @line 2: **node-id** The PCC identifier.
552
553       @line 4: **ip-address** IP address of the PCC.
554
555       @line 5: **state-sync** Synchronization status of the PCC's LSPs. The *synchronized* indicates the State Synchronization is done.
556
557       @line 8: **lsp-update-capability** - Indicates that PCC allows LSP modifications.
558
559       @line 12: **name** - Textual representation of LPS's name.
560
561       @line 14: **operational** - Represent operational status of the LSP:
562
563          * *down* - not active.
564          * *up* - signaled.
565          * *active* - up and carrying traffic.
566          * *going-down* - LSP is being torn down, resources are being released.
567          * *going-up* - LSP is being signaled.
568
569       @line 15: **sync** - The flag set by PCC during LSPs State Synchronization.
570
571       @line 16: **plsp-id** - A PCEP-specific identifier for the LSP. It is assigned by PCC and it is constant for a lifetime of a PCEP session.
572
573       @line 17: **create** - The *false* indicates that LSP is PCC-initiated.
574
575       @line 18: **administrative** - The flag indicates target operational status of the LSP.
576
577       @line 20: **delegate** - The delegate flag indicates that the PCC is delegating the LSP to the PCE.
578
579       @line 24: **ipv4-tunnel-sender-address** - Contains the sender node's IP address.
580
581       @line 25: **ipv4-tunnel-endpoint-address** - Contains the egress node's IP address.
582
583       @line 26: **ipv4-extended-tunnel-id** - The *Extended Tunnel ID* identifier.
584
585       @line 28: **tunnel-id** - The *Tunnel ID* identifier.
586
587       @line 29: **lsp-id** - The *LSP ID* identifier.
588
589       @line 32: **path-name** - The symbolic name for the LSP.
590
591       @line 36: **ero** - The *Explicit Route Object* is encoding the path of the TE LSP through the network.
592
593    .. tab:: JSON
594
595       **Response Body:**
596
597       .. code-block:: json
598          :linenos:
599          :emphasize-lines: 3,5,6,9,13,15,16,17,18,19,21,25,26,27,29,30,33,37
600
601          {
602              "node": {
603                  "node-id": "pcc://43.43.43.43",
604                  "path-computation-client": {
605                      "ip-address": "43.43.43.43",
606                      "state-sync": "synchronized",
607                      "stateful-tlv": {
608                          "stateful": {
609                              "lsp-update-capability": true
610                          }
611                      },
612                      "reported-lsp": {
613                          "name": "foo",
614                          "lsp": {
615                              "operational": "up",
616                              "sync": true,
617                              "plsp-id": 1,
618                              "create": false,
619                              "administrative": true,
620                              "remove": false,
621                              "delegate": true,
622                              "tlvs": {
623                                  "lsp-identifiers": {
624                                      "ipv4": {
625                                          "ipv4-tunnel-sender-address": "43.43.43.43",
626                                          "ipv4-tunnel-endpoint-address": "39.39.39.39",
627                                          "ipv4-extended-tunnel-id": "39.39.39.39"
628                                      },
629                                      "tunnel-id": 1,
630                                      "lsp-id": 1
631                                  },
632                                  "symbolic-path-name": {
633                                      "path-name": "Zm9v"
634                                  }
635                              }
636                          },
637                          "ero": [
638                              {
639                                  "loose": false,
640                                  "ip-prefix": {
641                                      "ip-prefix": "201.20.160.40/32"
642                                  }
643                              },
644                              {
645                                  "loose": false,
646                                  "ip-prefix": {
647                                      "ip-prefix": "195.20.160.39/32"
648                                  }
649                              },
650                              {
651                                  "loose": false,
652                                  "ip-prefix": {
653                                      "ip-prefix": "39.39.39.39/32"
654                                  }
655                              }
656                          ]
657                      }
658                  }
659              }
660          }
661
662       @line 3: **node-id** The PCC identifier.
663
664       @line 5: **ip-address** IP address of the PCC.
665
666       @line 6: **state-sync** Synchronization status of the PCC's LSPs. The *synchronized* indicates the State Synchronization is done.
667
668       @line 9: **lsp-update-capability** - Indicates that PCC allows LSP modifications.
669
670       @line 13: **name** - Textual representation of LPS's name.
671
672       @line 15: **operational** - Represent operational status of the LSP:
673
674          * *down* - not active.
675          * *up* - signaled.
676          * *active* - up and carrying traffic.
677          * *going-down* - LSP is being torn down, resources are being released.
678          * *going-up* - LSP is being signaled.
679
680       @line 16: **sync** - The flag set by PCC during LSPs State Synchronization.
681
682       @line 17: **plsp-id** - A PCEP-specific identifier for the LSP. It is assigned by PCC and it is constant for a lifetime of a PCEP session.
683
684       @line 18: **create** - The *false* indicates that LSP is PCC-initiated.
685
686       @line 19: **administrative** - The flag indicates target operational status of the LSP.
687
688       @line 21: **delegate** - The delegate flag indicates that the PCC is delegating the LSP to the PCE.
689
690       @line 25: **ipv4-tunnel-sender-address** - Contains the sender node's IP address.
691
692       @line 26: **ipv4-tunnel-endpoint-address** - Contains the egress node's IP address.
693
694       @line 27: **ipv4-extended-tunnel-id** - The *Extended Tunnel ID* identifier.
695
696       @line 29: **tunnel-id** - The *Tunnel ID* identifier.
697
698       @line 30: **lsp-id** - The *LSP ID* identifier.
699
700       @line 33: **path-name** - The symbolic name for the LSP.
701
702       @line 37: **ero** - The *Explicit Route Object* is encoding the path of the TE LSP through the network.
703
704 LSP Delegation
705 ''''''''''''''
706 The LSP control delegations is an mechanism, where PCC grants to a PCE the temporary right in order to modify LSP attributes.
707 The PCC can revoke the delegation or the PCE may waive the delegation at any time.
708 The LSP control is delegated to at most one PCE at the same time.
709
710 .. figure:: ./images/pcep-delegation-return.png
711    :align: center
712    :alt: Returning a Delegation
713
714    Returning a Delegation.
715
716 -----
717
718 Following RPC example illustrates a request for the LSP delegation give up:
719
720 **URL:** ``/restconf/operations/network-topology-pcep:update-lsp``
721
722 **RFC8040 URL:** ``/rests/operations/network-topology-pcep:update-lsp``
723
724 **Method:** ``POST``
725
726 .. tabs::
727
728    .. tab:: XML
729
730       **Content-Type:** ``application/xml``
731
732       **Request Body:**
733
734       .. code-block:: xml
735          :linenos:
736          :emphasize-lines: 2,3,6,10
737
738          <input>
739             <node>pcc://43.43.43.43</node>
740             <name>foo</name>
741             <arguments>
742                <lsp xmlns:stateful="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
743                   <delegate>false</delegate>
744                   <administrative>true</administrative>
745                   <tlvs>
746                      <symbolic-path-name>
747                         <path-name>Zm9v</path-name>
748                      </symbolic-path-name>
749                   </tlvs>
750                </lsp>
751             </arguments>
752             <network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>
753          </input>
754
755       @line 2: **node** The PCC identifier.
756
757       @line 3: **name** The name of the LSP.
758
759       @line 6: **delegate** - Delegation flag set *false* in order to return the LSP delegation.
760
761       @line 10: **path-name** - The Symbolic Path Name TLV must be present when sending a request to give up the delegation.
762
763    .. tab:: JSON
764
765       **Content-Type:** ``application/json``
766
767       **Request Body:**
768
769       .. code-block:: json
770          :linenos:
771          :emphasize-lines: 3,4,7,11
772
773          {
774              "input": {
775                  "node": "pcc://43.43.43.43",
776                  "name": "foo",
777                  "arguments": {
778                      "lsp": {
779                          "delegate": false,
780                          "administrative": true,
781                          "tlvs": {
782                              "symbolic-path-name": {
783                                  "path-name": "Zm9v"
784                              }
785                          }
786                      }
787                  },
788                 "network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]"
789              }
790          }
791
792       @line 3: **node** The PCC identifier.
793
794       @line 4: **name** The name of the LSP.
795
796       @line 7: **delegate** - Delegation flag set *false* in order to return the LSP delegation.
797
798       @line 11: **path-name** - The Symbolic Path Name TLV must be present when sending a request to give up the delegation.
799
800 LSP Update
801 ''''''''''
802 The LSP Update Request is an operation where a PCE requests a PCC to update attributes of an LSP and to rebuild the LSP with updated attributes.
803 In order to update LSP, the PCE must hold a LSP delegation.
804 The LSP update is done in *make-before-break* fashion - first, new LSP is initiated and then the old LSP is torn down.
805
806 .. figure:: ./images/pcep-update.png
807    :align: center
808    :alt: Active Stateful PCE LSP Update
809
810    Active Stateful PCE LSP Update.
811
812 -----
813
814 Following RPC example shows a request for the LSP update:
815
816 **URL:** ``/restconf/operations/network-topology-pcep:update-lsp``
817
818 **RFC8040 URL:** ``/rests/operations/network-topology-pcep:update-lsp``
819
820 **Method:** ``POST``
821
822 .. tabs::
823
824    .. tab:: XML
825
826       **Content-Type:** ``application/xml``
827
828       **Request Body:**
829
830       .. code-block:: xml
831          :linenos:
832          :emphasize-lines: 2,3,6,7,9
833
834          <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
835             <node>pcc://43.43.43.43</node>
836             <name>foo</name>
837             <arguments>
838                <lsp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
839                   <delegate>true</delegate>
840                   <administrative>true</administrative>
841                </lsp>
842                <ero>
843                   <subobject>
844                      <loose>false</loose>
845                      <ip-prefix>
846                         <ip-prefix>200.20.160.41/32</ip-prefix>
847                      </ip-prefix>
848                   </subobject>
849                   <subobject>
850                      <loose>false</loose>
851                      <ip-prefix>
852                         <ip-prefix>196.20.160.39/32</ip-prefix>
853                      </ip-prefix>
854                   </subobject>
855                   <subobject>
856                      <loose>false</loose>
857                      <ip-prefix>
858                         <ip-prefix>39.39.39.39/32</ip-prefix>
859                      </ip-prefix>
860                   </subobject>
861                </ero>
862             </arguments>
863             <network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>
864          </input>
865
866       @line 2: **node** The PCC identifier.
867
868       @line 3: **name** The name of the LSP to be updated.
869
870       @line 6: **delegate** - Delegation flag set *true* in order to keep the LSP control.
871
872       @line 7: **administrative** - Desired administrative status of the LSP is active.
873
874       @line 9: **ero** - This LSP attribute is changed.
875
876    .. tab:: JSON
877
878       **Content-Type:** ``application/json``
879
880       **Request Body:**
881
882       .. code-block:: json
883          :linenos:
884          :emphasize-lines: 3,4,7,8,10
885
886          {
887              "input": {
888                  "node": "pcc://43.43.43.43",
889                  "name": "foo",
890                  "arguments": {
891                      "lsp": {
892                          "delegate": true,
893                          "administrative": true
894                      },
895                      "ero": {
896                          "subobject": [
897                              {
898                                  "loose": false,
899                                  "ip-prefix": {
900                                      "ip-prefix": "200.20.160.41/32"
901                                  }
902                              },
903                              {
904                                  "loose": false,
905                                  "ip-prefix": {
906                                      "ip-prefix": "196.20.160.39/32"
907                                  }
908                              },
909                              {
910                                  "loose": false,
911                                  "ip-prefix": {
912                                      "ip-prefix": "39.39.39.39/32"
913                                  }
914                              }
915                          ]
916                      }
917                  },
918                  "network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]"
919              }
920          }
921
922       @line 3: **node** The PCC identifier.
923
924       @line 4: **name** The name of the LSP to be updated.
925
926       @line 7: **delegate** - Delegation flag set *true* in order to keep the LSP control.
927
928       @line 8: **administrative** - Desired administrative status of the LSP is active.
929
930       @line 10: **ero** - This LSP attribute is changed.
931
932 PCE-initiated LSP Setup
933 ^^^^^^^^^^^^^^^^^^^^^^^
934 The PCEP Extension for PCE-initiated LSP Setup allows PCE to request a creation and deletion of LSPs.
935
936 Configuration
937 '''''''''''''
938 This capability is enabled by default. No additional configuration is required.
939
940 LSP Instantiation
941 '''''''''''''''''
942 The PCE can request LSP creation.
943 The LSP instantiation is done by sending an LSP Initiate Message to PCC.
944 The PCC assign delegation to PCE which triggered creation.
945 PCE-initiated LSPs are identified by *Create* flag.
946
947 .. figure:: ./images/pcep-initiate.png
948    :align: center
949    :alt: LSP instantiation
950
951    LSP instantiation.
952
953 -----
954
955 Following RPC example shows a request for the LSP initiation:
956
957 **URL:** ``/restconf/operations/network-topology-pcep:add-lsp``
958
959 **RFC8040 URL:** ``/rests/operations/network-topology-pcep:add-lsp``
960
961 **Method:** ``POST``
962
963 .. tabs::
964
965    .. tab:: XML
966
967       **Content-Type:** ``application/xml``
968
969       **Request Body:**
970
971       .. code-block:: xml
972          :linenos:
973          :emphasize-lines: 2,3,9,15
974
975          <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
976             <node>pcc://43.43.43.43</node>
977             <name>update-tunel</name>
978             <arguments>
979                <lsp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
980                   <delegate>true</delegate>
981                   <administrative>true</administrative>
982                </lsp>
983                <endpoints-obj>
984                   <ipv4>
985                      <source-ipv4-address>43.43.43.43</source-ipv4-address>
986                      <destination-ipv4-address>39.39.39.39</destination-ipv4-address>
987                   </ipv4>
988                </endpoints-obj>
989                <ero>
990                   <subobject>
991                      <loose>false</loose>
992                      <ip-prefix>
993                         <ip-prefix>201.20.160.40/32</ip-prefix>
994                      </ip-prefix>
995                   </subobject>
996                   <subobject>
997                      <loose>false</loose>
998                      <ip-prefix>
999                         <ip-prefix>195.20.160.39/32</ip-prefix>
1000                      </ip-prefix>
1001                   </subobject>
1002                   <subobject>
1003                      <loose>false</loose>
1004                      <ip-prefix>
1005                         <ip-prefix>39.39.39.39/32</ip-prefix>
1006                      </ip-prefix>
1007                   </subobject>
1008                </ero>
1009             </arguments>
1010             <network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>
1011          </input>
1012
1013       @line 2: **node** The PCC identifier.
1014
1015       @line 3: **name** The name of the LSP to be created.
1016
1017       @line 9: **endpoints-obj** - The *END-POINT* Object is mandatory for an instantiation request of an RSVP-signaled LSP. It contains source and destination addresses for provisioning the LSP.
1018
1019       @line 15: **ero** - The *ERO* object is mandatory for LSP initiation request.
1020
1021    .. tab:: JSON
1022
1023       **Content-Type:** ``application/json``
1024
1025       **Request Body:**
1026
1027       .. code-block:: json
1028          :linenos:
1029          :emphasize-lines: 3,4,10,16
1030
1031          {
1032              "input": {
1033                  "node": "pcc://43.43.43.43",
1034                  "name": "update-tunel",
1035                  "arguments": {
1036                      "lsp": {
1037                          "delegate": true,
1038                          "administrative": true
1039                      },
1040                      "endpoints-obj": {
1041                          "ipv4": {
1042                              "source-ipv4-address": "43.43.43.43",
1043                              "destination-ipv4-address": "39.39.39.39"
1044                          }
1045                      },
1046                      "ero": {
1047                          "subobject": [
1048                              {
1049                                  "loose": false,
1050                                  "ip-prefix": {
1051                                      "ip-prefix": "201.20.160.40/32"
1052                                  }
1053                              },
1054                              {
1055                                  "loose": false,
1056                                  "ip-prefix": {
1057                                      "ip-prefix": "195.20.160.39/32"
1058                                  }
1059                              },
1060                              {
1061                                  "loose": false,
1062                                  "ip-prefix": {
1063                                      "ip-prefix": "39.39.39.39/32"
1064                                  }
1065                              }
1066                          ]
1067                      }
1068                  },
1069                  "network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]"
1070              }
1071          }
1072
1073       @line 3: **node** The PCC identifier.
1074
1075       @line 4: **name** The name of the LSP to be created.
1076
1077       @line 10: **endpoints-obj** - The *END-POINT* Object is mandatory for an instantiation request of an RSVP-signaled LSP. It contains source and destination addresses for provisioning the LSP.
1078
1079       @line 16: **ero** - The *ERO* object is mandatory for LSP initiation request.
1080
1081 LSP Deletion
1082 ''''''''''''
1083 The PCE may request a deletion of PCE-initiated LSPs.
1084 The PCE must be delegation holder for this particular LSP.
1085
1086 .. figure:: ./images/pcep-deletion.png
1087    :align: center
1088    :alt: LSP deletion.
1089
1090    LSP deletion.
1091
1092 -----
1093
1094 Following RPC example shows a request for the LSP deletion:
1095
1096 **URL:** ``/restconf/operations/network-topology-pcep:remove-lsp``
1097
1098 **RFC8040 URL:** ``/rests/operations/network-topology-pcep:remove-lsp``
1099
1100 **Method:** ``POST``
1101
1102 .. tabs::
1103
1104    .. tab:: XML
1105
1106       **Content-Type:** ``application/xml``
1107
1108       **Request Body:**
1109
1110       .. code-block:: xml
1111          :linenos:
1112          :emphasize-lines: 2,3
1113
1114          <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
1115             <node>pcc://43.43.43.43</node>
1116             <name>update-tunel</name>
1117             <network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>
1118          </input>
1119
1120       @line 2: **node** The PCC identifier.
1121
1122       @line 3: **name** The name of the LSP to be removed.
1123
1124    .. tab:: JSON
1125
1126       **Content-Type:** ``application/json``
1127
1128       **Request Body:**
1129
1130       .. code-block:: json
1131          :linenos:
1132          :emphasize-lines: 3,4
1133
1134          {
1135              "input": {
1136                  "node": "pcc://43.43.43.43",
1137                  "name": "update-tunel",
1138                  "network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]"
1139              }
1140          }
1141
1142       @line 3: **node** The PCC identifier.
1143
1144       @line 4: **name** The name of the LSP to be removed.
1145
1146 PCE-initiated LSP Delegation
1147 ''''''''''''''''''''''''''''
1148 The PCE-initiated LSP control is delegated to the PCE which requested the initiation.
1149 The PCC cannot revoke delegation of PCE-initiated LSP.
1150 When PCE returns delegation for such LSP or PCE fails, then the LSP become orphan and can be removed by a PCC after some time.
1151 The PCE may ask for a delegation of the orphan LSP.
1152
1153 .. figure:: ./images/pcep-revoke-delegation.png
1154    :align: center
1155    :alt: LSP re-delegation
1156
1157    Orphan PCE-initiated LSP - control taken by PCE.
1158
1159 -----
1160
1161 Following RPC example illustrates a request for the LSP delegation:
1162
1163 **URL:** ``/restconf/operations/network-topology-pcep:update-lsp``
1164
1165 **RFC8040 URL:** ``/rests/operations/network-topology-pcep:update-lsp``
1166
1167 **Method:** ``POST``
1168
1169 .. tabs::
1170
1171    .. tab:: XML
1172
1173       **Content-Type:** ``application/xml``
1174
1175       **Request Body:**
1176
1177       .. code-block:: xml
1178          :linenos:
1179          :emphasize-lines: 2,3,6,10
1180
1181          <input>
1182             <node>pcc://43.43.43.43</node>
1183             <name>update-tunel</name>
1184             <arguments>
1185                <lsp xmlns:stateful="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
1186                   <delegate>true</delegate>
1187                   <administrative>true</administrative>
1188                   <tlvs>
1189                      <symbolic-path-name>
1190                         <path-name>dXBkYXRlLXR1bmVs</path-name>
1191                      </symbolic-path-name>
1192                   </tlvs>
1193                </lsp>
1194             </arguments>
1195             <network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>
1196          </input>
1197
1198       @line 2: **node** The PCC identifier.
1199
1200       @line 3: **name** The name of the LSP.
1201
1202       @line 6: **delegate** - *Delegation* flag set *true* in order to take the LSP delegation.
1203
1204       @line 10: **path-name** - The *Symbolic Path Name* TLV must be present when sending a request to take a delegation.
1205
1206    .. tab:: JSON
1207
1208       **Content-Type:** ``application/json``
1209
1210       **Request Body:**
1211
1212       .. code-block:: json
1213          :linenos:
1214          :emphasize-lines: 3,4,7,11
1215
1216          {
1217              "input": {
1218                  "node": "pcc://43.43.43.43",
1219                  "name": "update-tunel",
1220                  "arguments": {
1221                      "lsp": {
1222                          "delegate": true,
1223                          "administrative": true,
1224                          "tlvs": {
1225                              "symbolic-path-name": {
1226                                  "path-name": "dXBkYXRlLXR1bmVs"
1227                              }
1228                          }
1229                      }
1230                  },
1231                  "network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]"
1232              }
1233          }
1234
1235       @line 3: **node** The PCC identifier.
1236
1237       @line 4: **name** The name of the LSP.
1238
1239       @line 7: **delegate** - *Delegation* flag set *true* in order to take the LSP delegation.
1240
1241       @line 11: **path-name** - The *Symbolic Path Name* TLV must be present when sending a request to take a delegation.
1242
1243 Segment Routing
1244 ^^^^^^^^^^^^^^^
1245 The PCEP Extensions for Segment Routing (SR) allow a stateful PCE to compute and initiate TE paths in SR networks.
1246 The SR path is defined as an order list  of *segments*.
1247 Segment Routing architecture can be directly applied to the MPLS forwarding plane without changes.
1248 Segment Identifier (SID) is encoded as a MPLS label.
1249
1250 Configuration
1251 '''''''''''''
1252 This capability is enabled by default. In order to disable it, a configuration should be changed as follows:
1253
1254 **URL:** ``/restconf/config/pcep-segment-routing-app-config:pcep-segment-routing-app-config``
1255
1256 **RFC8040 URL:** ``/rests/data/pcep-segment-routing-app-config:pcep-segment-routing-app-config``
1257
1258 **Method:** ``PUT``
1259
1260 .. tabs::
1261
1262    .. tab:: XML
1263
1264       **Content-Type:** ``application/xml``
1265
1266       **Request Body:**
1267
1268       .. code-block:: xml
1269          :linenos:
1270          :emphasize-lines: 2
1271
1272          <pcep-segment-routing-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:pcep:segment-routing-app-config">
1273             <sr-capable>false</sr-capable>
1274          </pcep-segment-routing-config>
1275
1276       @line 2: **sr-capable** - True if capability is supported.
1277
1278    .. tab:: JSON
1279
1280       **Content-Type:** ``application/json``
1281
1282       **Request Body:**
1283
1284       .. code-block:: json
1285          :linenos:
1286          :emphasize-lines: 3
1287
1288          {
1289              "pcep-segment-routing-app-config:pcep-segment-routing-config": {
1290                  "sr-capable": false
1291              }
1292          }
1293
1294       @line 3: **sr-capable** - True if capability is supported.
1295
1296 IANA code points
1297 ''''''''''''''''
1298
1299 In PCEP-SR draft version 6, SR Explicit Route Object/Record Route Object subobjects IANA code points change was proposed.
1300 In order to use the latest code points, a configuration should be changed as follows:
1301
1302 **URL:** ``/restconf/config/pcep-segment-routing-app-config:pcep-segment-routing-config``
1303
1304 **RFC8040 URL:** ``/rests/data/pcep-segment-routing-app-config:pcep-segment-routing-config``
1305
1306 **Method:** ``PUT``
1307
1308 .. tabs::
1309
1310    .. tab:: XML
1311
1312       **Content-Type:** ``application/xml``
1313
1314       **Request Body:**
1315
1316       .. code-block:: xml
1317          :linenos:
1318          :emphasize-lines: 2
1319
1320          <pcep-segment-routing-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:pcep:segment-routing-app-config">
1321             <iana-sr-subobjects-type>true</iana-sr-subobjects-type>
1322          </pcep-segment-routing-config>
1323
1324       @line 2: **iana-sr-subobjects-type** - True if IANA code points should be used.
1325
1326    .. tab:: JSON
1327
1328       **Content-Type:** ``application/json``
1329
1330       **Request Body:**
1331
1332       .. code-block:: json
1333          :linenos:
1334          :emphasize-lines: 3
1335
1336          {
1337              "pcep-segment-routing-app-config:pcep-segment-routing-config": {
1338                  "iana-sr-subobjects-type": true
1339              }
1340          }
1341
1342       @line 3: **iana-sr-subobjects-type** - True if IANA code points should be used.
1343
1344 LSP Operations for PCEP SR
1345 ''''''''''''''''''''''''''
1346 The PCEP SR extension defines new ERO subobject - *SR-ERO subobject* capable of carrying a SID.
1347
1348 .. code-block:: console
1349
1350    sr-ero-type
1351       +---- c-flag?                boolean
1352       +---- m-flag?                boolean
1353       +---- sid-type?              sid-type
1354       +---- sid?                   uint32
1355       +---- (nai)?
1356          +--:(ip-node-id)
1357          |  +---- ip-address             inet:ip-address
1358          +--:(ip-adjacency)
1359          |  +---- local-ip-address       inet:ip-address
1360          |  +---- remote-ip-address      inet:ip-address
1361          +--:(unnumbered-adjacency)
1362             +---- local-node-id          uint32
1363             +---- local-interface-id     uint32
1364             +---- remote-node-id         uint32
1365             +---- remote-interface-id    uint32
1366
1367 -----
1368
1369 Following RPC example illustrates a request for the SR-TE LSP creation:
1370
1371 **URL:** ``/restconf/operations/network-topology-pcep:add-lsp``
1372
1373 **RFC8040 URL:** ``/rests/operations/network-topology-pcep:add-lsp``
1374
1375 **Method:** ``POST``
1376
1377 .. tabs::
1378
1379    .. tab:: XML
1380
1381       **Content-Type:** ``application/xml``
1382
1383       **Request Body:**
1384
1385       .. code-block:: xml
1386          :linenos:
1387          :emphasize-lines: 16,21,22,23
1388
1389          <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
1390             <node>pcc://43.43.43.43</node>
1391             <name>sr-path</name>
1392             <arguments>
1393                <lsp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
1394                   <delegate>true</delegate>
1395                   <administrative>true</administrative>
1396                </lsp>
1397                <endpoints-obj>
1398                   <ipv4>
1399                      <source-ipv4-address>43.43.43.43</source-ipv4-address>
1400                      <destination-ipv4-address>39.39.39.39</destination-ipv4-address>
1401                   </ipv4>
1402                </endpoints-obj>
1403                <path-setup-type xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
1404                   <pst>1</pst>
1405                </path-setup-type>
1406                <ero>
1407                   <subobject>
1408                      <loose>false</loose>
1409                      <sid-type xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">ipv4-node-id</sid-type>
1410                      <m-flag xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">true</m-flag>
1411                      <sid xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">24001</sid>
1412                      <ip-address xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">39.39.39.39</ip-address>
1413                   </subobject>
1414                </ero>
1415             </arguments>
1416             <network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>
1417          </input>
1418
1419       @line 16: **path-setup-type** - Set *1* for SR-TE LSP
1420
1421       @line 21: **ipv4-node-id** - The SR-ERO subobject represents *IPv4 Node ID* NAI.
1422
1423       @line 22: **m-flag** - The SID value represents an MPLS label.
1424
1425       @line 23: **sid** - The Segment Identifier.
1426
1427    .. tab:: JSON
1428
1429       **Content-Type:** ``application/json``
1430
1431       **Request Body:**
1432
1433       .. code-block:: json
1434          :linenos:
1435          :emphasize-lines: 17,22,23,24
1436
1437          {
1438              "input": {
1439                  "node": "pcc://43.43.43.43",
1440                  "name": "sr-path",
1441                  "arguments": {
1442                      "lsp": {
1443                          "delegate": true,
1444                          "administrative": true
1445                      },
1446                      "endpoints-obj": {
1447                          "ipv4": {
1448                              "source-ipv4-address": "43.43.43.43",
1449                              "destination-ipv4-address": "39.39.39.39"
1450                          }
1451                      },
1452                      "path-setup-type": {
1453                          "pst": 1
1454                      },
1455                      "ero": {
1456                          "subobject": {
1457                              "loose": false,
1458                              "sid-type": "ipv4-node-id",
1459                              "m-flag": true,
1460                              "sid": 24001,
1461                              "ip-address": "39.39.39.39"
1462                          }
1463                      }
1464                  },
1465                  "network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]"
1466              }
1467          }
1468
1469 @line 17: **path-setup-type** - Set *1* for SR-TE LSP
1470
1471 @line 22: **ipv4-node-id** - The SR-ERO subobject represents *IPv4 Node ID* NAI.
1472
1473 @line 23: **m-flag** - The SID value represents an MPLS label.
1474
1475 @line 24: **sid** - The Segment Identifier.
1476
1477 -----
1478
1479 Following RPC example illustrates a request for the SR-TE LSP update including modified path:
1480
1481 **URL:** ``/restconf/operations/network-topology-pcep:update-lsp``
1482
1483 **RFC8040 URL:** ``/rests/operations/network-topology-pcep:update-lsp``
1484
1485 **Method:** ``POST``
1486
1487 .. tabs::
1488
1489    .. tab:: XML
1490
1491       **Content-Type:** ``application/xml``
1492
1493       **Request Body:**
1494
1495       .. code-block:: xml
1496          :linenos:
1497
1498          <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
1499             <node>pcc://43.43.43.43</node>
1500             <name>update-tunnel</name>
1501             <arguments>
1502                <lsp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
1503                   <delegate>true</delegate>
1504                   <administrative>true</administrative>
1505                </lsp>
1506                <path-setup-type xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
1507                   <pst>1</pst>
1508                </path-setup-type>
1509                <ero>
1510                   <subobject>
1511                      <loose>false</loose>
1512                      <sid-type xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">ipv4-node-id</sid-type>
1513                      <m-flag xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">true</m-flag>
1514                      <sid xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">24002</sid>
1515                      <ip-address xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">200.20.160.41</ip-address>
1516                   </subobject>
1517                   <subobject>
1518                      <loose>false</loose>
1519                      <sid-type xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">ipv4-node-id</sid-type>
1520                      <m-flag xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">true</m-flag>
1521                      <sid xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">24001</sid>
1522                      <ip-address xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">39.39.39.39</ip-address>
1523                   </subobject>
1524                </ero>
1525             </arguments>
1526             <network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>
1527          </input>
1528
1529    .. tab:: JSON
1530
1531       **Content-Type:** ``application/json``
1532
1533       **Request Body:**
1534
1535       .. code-block:: json
1536          :linenos:
1537
1538          {
1539              "input": {
1540                  "node": "pcc://43.43.43.43",
1541                  "name": "foo",
1542                  "arguments": {
1543                      "lsp": {
1544                          "delegate": true,
1545                          "administrative": true
1546                      },
1547                      "path-setup-type": {
1548                          "pst": 1
1549                      },
1550                      "ero": {
1551                          "subobject": [
1552                              {
1553                                  "loose": false,
1554                                  "sid-type": "ipv4-node-id",
1555                                  "m-flag" : true,
1556                                  "sid": 24002,
1557                                  "ip-address": "200.20.160.41"
1558                              },
1559                              {
1560                                  "loose": false,
1561                                  "sid-type": "ipv4-node-id",
1562                                  "m-flag" : true,
1563                                  "sid": 24001,
1564                                  "ip-address": "39.39.39.39"
1565                              }
1566                          ]
1567                      }
1568                  },
1569                  "network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]"
1570              }
1571          }
1572
1573 LSP State Synchronization Optimization Procedures
1574 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1575 This extension bring optimizations for state synchronization:
1576
1577 * State Synchronization Avoidance
1578 * Incremental State Synchronization
1579 * PCE-triggered Initial Synchronization
1580 * PCE-triggered Re-synchronization
1581
1582 Configuration
1583 '''''''''''''
1584 This capability is enabled by default. No additional configuration is required.
1585
1586 State Synchronization Avoidance
1587 '''''''''''''''''''''''''''''''
1588 The State Synchronization Avoidance procedure is intended to skip state synchronization if the state has survived and not changed during session restart.
1589
1590 .. figure:: ./images/pcep-sync-skipped.png
1591    :align: center
1592    :alt: Sync skipped
1593
1594    State Synchronization Skipped.
1595
1596 Incremental State Synchronization
1597 '''''''''''''''''''''''''''''''''
1598 The Incremental State Synchronization procedure is intended to do incremental (delta) state synchronization when possible.
1599
1600 .. figure:: ./images/pcep-sync-incremental.png
1601    :align: center
1602    :alt: Sync incremental
1603
1604    Incremental Synchronization Procedure.
1605
1606 PCE-triggered Initial Synchronization
1607 '''''''''''''''''''''''''''''''''''''
1608 The PCE-triggered Initial Synchronization procedure is intended to do let PCE control the timing of the initial state synchronization.
1609
1610 .. figure:: ./images/pcep-sync-initial.png
1611    :align: center
1612    :alt: Initial Sync
1613
1614    PCE-triggered Initial State Synchronization Procedure.
1615
1616 -----
1617
1618 Following RPC example illustrates a request for the initial synchronization:
1619
1620 **URL:** ``/restconf/operations/network-topology-pcep:trigger-sync``
1621
1622 **RFC8040 URL:** ``/rests/operations/network-topology-pcep:trigger-sync``
1623
1624 **Method:** ``POST``
1625
1626 .. tabs::
1627
1628    .. tab:: XML
1629
1630       **Content-Type:** ``application/xml``
1631
1632       **Request Body:**
1633
1634       .. code-block:: xml
1635          :linenos:
1636
1637          <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
1638             <node>pcc://43.43.43.43</node>
1639             <network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>
1640          </input>
1641
1642    .. tab:: JSON
1643
1644       **Content-Type:** ``application/json``
1645
1646       **Request Body:**
1647
1648       .. code-block:: json
1649          :linenos:
1650
1651          {
1652              "input": {
1653                  "node": "pcc://43.43.43.43",
1654                  "network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]"
1655              }
1656          }
1657
1658 PCE-triggered Re-synchronization
1659 ''''''''''''''''''''''''''''''''
1660 The PCE-triggered Re-synchronization: To let PCE re-synchronize the state for sanity check.
1661
1662 .. figure:: ./images/pcep-re-sync.png
1663    :align: center
1664    :alt: Re-sync
1665
1666    PCE-triggered Re-synchronization Procedure.
1667
1668 -----
1669
1670 Following RPC example illustrates a request for the LSP re-synchronization:
1671
1672 **URL:** ``/restconf/operations/network-topology-pcep:trigger-sync``
1673
1674 **RFC8040 URL:** ``/rests/operations/network-topology-pcep:trigger-sync``
1675
1676 **Method:** ``POST``
1677
1678 .. tabs::
1679
1680    .. tab:: XML
1681
1682       **Content-Type:** ``application/xml``
1683
1684       **Request Body:**
1685
1686       .. code-block:: xml
1687          :linenos:
1688          :emphasize-lines: 3
1689
1690          <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
1691             <node>pcc://43.43.43.43</node>
1692             <name>update-lsp</name>
1693             <network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>
1694          </input>
1695
1696       @line 3: **name** - The LSP name. If this parameter is omitted, re-synchronization is requested for all PCC's LSPs.
1697
1698    .. tab:: JSON
1699
1700       **Content-Type:** ``application/json``
1701
1702       **Request Body:**
1703
1704       .. code-block:: json
1705          :linenos:
1706          :emphasize-lines: 4
1707
1708          {
1709              "input": {
1710                  "node": "pcc://43.43.43.43",
1711                  "name": "update-lsp",
1712                  "network-topology-ref": "/network-topology:network-topology/network-topology:topology[network-topology:topology-id=\"pcep-topology\"]"
1713              }
1714          }
1715
1716       @line 4: **name** - The LSP name. If this parameter is omitted, re-synchronization is requested for all PCC's LSPs.