Update PCEP TCP MD5 passs config
[docs.git] / docs / user-guide / pcep-user-guide.rst
1 .. _pcep-user-guide:
2 PCEP User Guide
3 ===============
4 This guide contains information on how to use the OpenDaylight Path Computation Element Configuration Protocol (PCEP) plugin.
5 The user should learn about PCEP basic concepts, supported capabilities, configuration and operations.
6
7 .. contents:: Contents
8    :depth: 1
9    :local:
10
11 Overview
12 --------
13 This section provides a high-level overview of the PCEP, SDN use-cases and OpenDaylight implementation.
14
15 .. contents:: Contents
16    :depth: 2
17    :local:
18
19 Path Computation Element Communication Protocol
20 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 The Path Computation Element (PCE) Communication Protocol (PCEP) is used for communication between a Path Computation Client (PCC) and a PCE in context of MPLS and GMPLS Traffic Engineering (TE) Label Switched Paths (LSPs).
22 This interaction include path computation requests and computation replies.
23 The PCE operates on a network graph, built from the (Traffic Engineering Database) TED, in order to compute paths based on the path computation request issued by the PCC.
24 The path computation request includes the source and destination of the path and set of constrains to be applied during the computation.
25 The PCE response contains the computed path or the computation failure reason.
26 The PCEP operates on top the TCP, which provides reliable communication.
27
28 .. figure:: ./images/bgpcep/pcep.png
29    :align: center
30    :alt: PCEP
31
32    PCE-based architecture.
33
34 PCEP in SDN
35 ^^^^^^^^^^^
36 The Path Computation Element perfectly fits into the centralized SDN controller architecture.
37 The PCE's knowledge of the availability of network resources (i.e. TED) and active LSPs awareness (LSP-DB) allows to perform automated application-driven network operations:
38
39 * LSP Re-optimization
40 * Resource defragmentation
41 * Link failure restoration
42 * Auto-bandwidth adjustment
43 * Bandwidth scheduling
44 * Shared Risk Link Group (SRLG) diversity maintenance
45
46 OpenDaylight PCEP plugin
47 ^^^^^^^^^^^^^^^^^^^^^^^^
48 The OpenDaylight PCEP plugin provides all basic service units necessary to build-up a PCE-based controller.
49 In addition, it offers LSP management functionality for Active Stateful PCE - the cornerstone for majority of PCE-enabled SDN solutions.
50 It consists of the following components:
51
52 * Protocol library
53 * PCEP session handling
54 * Stateful PCE LSP-DB
55 * Active Stateful PCE LSP Operations
56
57 .. figure:: ./images/bgpcep/pcep-plugin.png
58    :align: center
59    :alt: PCEP plugin
60
61    OpenDaylight PCEP plugin overview.
62
63 .. important:: The PCEP plugin does not provide path computational functionality and does not build TED.
64
65 List of supported capabilities
66 ''''''''''''''''''''''''''''''
67
68 * `RFC5440 <https://tools.ietf.org/html/rfc5440>`_ - Path Computation Element (PCE) Communication Protocol (PCEP)
69 * `RFC5455 <https://tools.ietf.org/html/rfc5455>`_ - Diffserv-Aware Class-Type Object for the Path Computation Element Communication Protocol
70 * `RFC5520 <https://tools.ietf.org/html/rfc5520>`_ - Preserving Topology Confidentiality in Inter-Domain Path Computation Using a Path-Key-Based Mechanism
71 * `RFC5521 <https://tools.ietf.org/html/rfc5521>`_ - Extensions to the Path Computation Element Communication Protocol (PCEP) for Route Exclusions
72 * `RFC5541 <https://tools.ietf.org/html/rfc5541>`_ - Encoding of Objective Functions in the Path Computation Element Communication Protocol (PCEP)
73 * `RFC5557 <https://tools.ietf.org/html/rfc5557>`_ - Path Computation Element Communication Protocol (PCEP) Requirements and Protocol Extensions in Support of Global Concurrent Optimization
74 * `RFC5886 <https://tools.ietf.org/html/rfc5886>`_ - A Set of Monitoring Tools for Path Computation Element (PCE)-Based Architecture
75 * `RFC7470 <https://tools.ietf.org/html/rfc7470>`_ - Conveying Vendor-Specific Constraints in the Path Computation Element Communication Protocol
76 * `RFC7896 <https://tools.ietf.org/html/rfc7896>`_ - Update to the Include Route Object (IRO) Specification in the Path Computation Element Communication Protocol (PCEP)
77 * `draft-ietf-pce-stateful-pce <https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-16>`_ - PCEP Extensions for Stateful PCE
78
79   * `draft-ietf-pce-pce-initiated-lsp <https://tools.ietf.org/html/draft-ietf-pce-pce-initiated-lsp-07>`_ - PCEP Extensions for PCE-initiated LSP Setup in a Stateful PCE Model
80   * `draft-ietf-pce-segment-routing <https://tools.ietf.org/html/draft-ietf-pce-segment-routing-07>`_ - PCEP Extension for segment routing
81   * `draft-ietf-pce-lsp-setup-type <https://tools.ietf.org/html/draft-ietf-pce-lsp-setup-type-03>`_ - PCEP Extension for path setup type
82   * `draft-ietf-pce-stateful-sync-optimizations <https://tools.ietf.org/html/draft-ietf-pce-stateful-sync-optimizations-05>`_ - Optimizations of Label Switched Path State Synchronization Procedures for a Stateful PCE
83   * `draft-sivabalan-pce-binding-label-sid <https://tools.ietf.org/html/draft-sivabalan-pce-binding-label-sid-01>`_ - Carrying Binding Label/Segment-ID in PCE-based Networks
84
85 * `draft-ietf-pce-pceps <https://tools.ietf.org/html/draft-ietf-pce-pceps-10>`_ - Secure Transport for PCEP
86
87 Running PCEP
88 ------------
89 This section explains how to install PCEP plugin.
90
91 1. Install PCEP feature - ``odl-bgpcep-pcep``.
92    Also, for sake of this sample, it is required to install RESTCONF.
93    In the Karaf console, type command:
94
95    .. code-block:: console
96
97       feature:install odl-restconf odl-bgpcep-pcep
98
99 2. The PCEP plugin contains a default configuration, which is applied after the feature starts up.
100    One instance of PCEP plugin is created (named *pcep-topology*), and its presence can be verified via REST:
101
102    **URL:** ``restconf/operational/network-topology:network-topology/topology/pcep-topology``
103
104    **Method:** ``GET``
105
106    **Response Body:**
107
108    .. code-block:: xml
109
110       <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
111           <topology-id>pcep-topology</topology-id>
112           <topology-types>
113               <topology-pcep xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep"></topology-pcep>
114           </topology-types>
115       </topology>
116
117 Active Stateful PCE
118 -------------------
119 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.
120 This requires state synchronization mechanism between PCE and PCC.
121 Moreover, Active Stateful PCE is capable to address LSP parameter changes to the PCC.
122
123 .. contents:: Contents
124    :depth: 2
125    :local:
126
127 Configuration
128 ^^^^^^^^^^^^^
129 This capability is enabled by default. No additional configuration is required.
130
131 MD5 authentication configuration
132 ''''''''''''''''''''''''''''''''
133 The OpenDaylight PCEP implementation supports TCP MD5 for authentication.
134 The sample configuration below shows how to set authentication password for a particular PCC.
135
136 **URL:** ``/restconf/config/network-topology:network-topology/topology/pcep-topology/node/43.43.43.43``
137
138 **Method:** ``PUT``
139
140 **Content-Type:** ``application/xml``
141
142 **Request Body:**
143
144 .. code-block:: xml
145    :linenos:
146    :emphasize-lines: 2,4
147
148
149     <node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
150         <node-id>43.43.43.43</node-id>
151         <session-config xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep:config">
152             <password>topsecret</password>
153         </session-config>
154     </node>
155
156 @line 2: **address** - A PCC IP address.
157
158 @line 4: **password** - MD5 authentication phrase.
159
160 LSP State Database
161 ^^^^^^^^^^^^^^^^^^
162 The *LSP State Database* (LSP-DB) contains an information about all LSPs and their attributes.
163 The LSP state is synchronized between the PCC and PCE.
164 First, initial LSP state synchronization is performed once the session between PCC and PCE is established in order to learn PCC's LPSs.
165 This step is a prerequisite to following LSPs manipulation operations.
166
167
168 .. figure:: ./images/bgpcep/pcep-sync.png
169    :align: center
170    :alt: LSP State synchronization
171
172    LSP State Synchronization.
173
174 LSP-DB API
175 ''''''''''
176
177 .. code-block:: console
178
179    path-computation-client
180       +--ro reported-lsp* [name]
181          +--ro name        string
182          +--ro path* [lsp-id]
183          |  +--ro lsp-id                      rsvp:lsp-id
184          |  +--ro ero
185          |  |  +--ro processing-rule?   boolean
186          |  |  +--ro ignore?            boolean
187          |  |  +--ro subobject*
188          |  |     +--ro loose         boolean
189          |  |     +--ro (subobject-type)?
190          |  |        +--:(as-number-case)
191          |  |        |  +--ro as-number
192          |  |        |     +--ro as-number    inet:as-number
193          |  |        +--:(ip-prefix-case)
194          |  |        |  +--ro ip-prefix
195          |  |        |     +--ro ip-prefix    inet:ip-prefix
196          |  |        +--:(label-case)
197          |  |        |  +--ro label
198          |  |        |     +--ro uni-directional             boolean
199          |  |        |     +--ro (label-type)?
200          |  |        |        +--:(type1-label-case)
201          |  |        |        |  +--ro type1-label
202          |  |        |        |     +--ro type1-label    uint32
203          |  |        |        +--:(generalized-label-case)
204          |  |        |        |  +--ro generalized-label
205          |  |        |        |     +--ro generalized-label    binary
206          |  |        |        +--:(waveband-switching-label-case)
207          |  |        |           +--ro waveband-switching-label
208          |  |        |              +--ro end-label      uint32
209          |  |        |              +--ro start-label    uint32
210          |  |        |              +--ro waveband-id    uint32
211          |  |        +--:(srlg-case)
212          |  |        |  +--ro srlg
213          |  |        |     +--ro srlg-id    srlg-id
214          |  |        +--:(unnumbered-case)
215          |  |        |  +--ro unnumbered
216          |  |        |     +--ro router-id       uint32
217          |  |        |     +--ro interface-id    uint32
218          |  |        +--:(exrs-case)
219          |  |        |  +--ro exrs
220          |  |        |     +--ro exrs*
221          |  |        |        +--ro mandatory?    boolean
222          |  |        |        +--ro attribute     enumeration
223          |  |        |        +--ro (subobject-type)?
224          |  |        |           +--:(as-number-case)
225          |  |        |           |  +--ro as-number
226          |  |        |           |     +--ro as-number    inet:as-number
227          |  |        |           +--:(ip-prefix-case)
228          |  |        |           |  +--ro ip-prefix
229          |  |        |           |     +--ro ip-prefix    inet:ip-prefix
230          |  |        |           +--:(label-case)
231          |  |        |           |  +--ro label
232          |  |        |           |     +--ro uni-directional             boolean
233          |  |        |           |     +--ro (label-type)?
234          |  |        |           |        +--:(type1-label-case)
235          |  |        |           |        |  +--ro type1-label
236          |  |        |           |        |     +--ro type1-label    uint32
237          |  |        |           |        +--:(generalized-label-case)
238          |  |        |           |        |  +--ro generalized-label
239          |  |        |           |        |     +--ro generalized-label    binary
240          |  |        |           |        +--:(waveband-switching-label-case)
241          |  |        |           |           +--ro waveband-switching-label
242          |  |        |           |              +--ro end-label      uint32
243          |  |        |           |              +--ro start-label    uint32
244          |  |        |           |              +--ro waveband-id    uint32
245          |  |        |           +--:(srlg-case)
246          |  |        |           |  +--ro srlg
247          |  |        |           |     +--ro srlg-id    srlg-id
248          |  |        |           +--:(unnumbered-case)
249          |  |        |              +--ro unnumbered
250          |  |        |                 +--ro router-id       uint32
251          |  |        |                 +--ro interface-id    uint32
252          |  |        +--:(path-key-case)
253          |  |           +--ro path-key
254          |  |              +--ro pce-id      pce-id
255          |  |              +--ro path-key    path-key
256          |  +--ro lspa
257          |  |  +--ro processing-rule?            boolean
258          |  |  +--ro ignore?                     boolean
259          |  |  +--ro hold-priority?              uint8
260          |  |  +--ro setup-priority?             uint8
261          |  |  +--ro local-protection-desired?   boolean
262          |  |  +--ro label-recording-desired?    boolean
263          |  |  +--ro se-style-desired?           boolean
264          |  |  +--ro session-name?               string
265          |  |  +--ro include-any?                attribute-filter
266          |  |  +--ro exclude-any?                attribute-filter
267          |  |  +--ro include-all?                attribute-filter
268          |  |  +--ro tlvs
269          |  |     +--ro vendor-information-tlv*
270          |  |        +--ro enterprise-number?   iana:enterprise-number
271          |  |        +--ro (enterprise-specific-information)?
272          |  +--ro bandwidth
273          |  |  +--ro processing-rule?   boolean
274          |  |  +--ro ignore?            boolean
275          |  |  +--ro bandwidth?         netc:bandwidth
276          |  +--ro reoptimization-bandwidth
277          |  |  +--ro processing-rule?   boolean
278          |  |  +--ro ignore?            boolean
279          |  |  +--ro bandwidth?         netc:bandwidth
280          |  +--ro metrics*
281          |  |  +--ro metric
282          |  |     +--ro processing-rule?   boolean
283          |  |     +--ro ignore?            boolean
284          |  |     +--ro metric-type        uint8
285          |  |     +--ro bound?             boolean
286          |  |     +--ro computed?          boolean
287          |  |     +--ro value?             ieee754:float32
288          |  +--ro iro
289          |  |  +--ro processing-rule?   boolean
290          |  |  +--ro ignore?            boolean
291          |  |  +--ro subobject*
292          |  |     +--ro loose         boolean
293          |  |     +--ro (subobject-type)?
294          |  |        +--:(as-number-case)
295          |  |        |  +--ro as-number
296          |  |        |     +--ro as-number    inet:as-number
297          |  |        +--:(ip-prefix-case)
298          |  |        |  +--ro ip-prefix
299          |  |        |     +--ro ip-prefix    inet:ip-prefix
300          |  |        +--:(label-case)
301          |  |        |  +--ro label
302          |  |        |     +--ro uni-directional             boolean
303          |  |        |     +--ro (label-type)?
304          |  |        |        +--:(type1-label-case)
305          |  |        |        |  +--ro type1-label
306          |  |        |        |     +--ro type1-label    uint32
307          |  |        |        +--:(generalized-label-case)
308          |  |        |        |  +--ro generalized-label
309          |  |        |        |     +--ro generalized-label    binary
310          |  |        |        +--:(waveband-switching-label-case)
311          |  |        |           +--ro waveband-switching-label
312          |  |        |              +--ro end-label      uint32
313          |  |        |              +--ro start-label    uint32
314          |  |        |              +--ro waveband-id    uint32
315          |  |        +--:(srlg-case)
316          |  |        |  +--ro srlg
317          |  |        |     +--ro srlg-id    srlg-id
318          |  |        +--:(unnumbered-case)
319          |  |        |  +--ro unnumbered
320          |  |        |     +--ro router-id       uint32
321          |  |        |     +--ro interface-id    uint32
322          |  |        +--:(exrs-case)
323          |  |        |  +--ro exrs
324          |  |        |     +--ro exrs*
325          |  |        |        +--ro mandatory?    boolean
326          |  |        |        +--ro attribute     enumeration
327          |  |        |        +--ro (subobject-type)?
328          |  |        |           +--:(as-number-case)
329          |  |        |           |  +--ro as-number
330          |  |        |           |     +--ro as-number    inet:as-number
331          |  |        |           +--:(ip-prefix-case)
332          |  |        |           |  +--ro ip-prefix
333          |  |        |           |     +--ro ip-prefix    inet:ip-prefix
334          |  |        |           +--:(label-case)
335          |  |        |           |  +--ro label
336          |  |        |           |     +--ro uni-directional             boolean
337          |  |        |           |     +--ro (label-type)?
338          |  |        |           |        +--:(type1-label-case)
339          |  |        |           |        |  +--ro type1-label
340          |  |        |           |        |     +--ro type1-label    uint32
341          |  |        |           |        +--:(generalized-label-case)
342          |  |        |           |        |  +--ro generalized-label
343          |  |        |           |        |     +--ro generalized-label    binary
344          |  |        |           |        +--:(waveband-switching-label-case)
345          |  |        |           |           +--ro waveband-switching-label
346          |  |        |           |              +--ro end-label      uint32
347          |  |        |           |              +--ro start-label    uint32
348          |  |        |           |              +--ro waveband-id    uint32
349          |  |        |           +--:(srlg-case)
350          |  |        |           |  +--ro srlg
351          |  |        |           |     +--ro srlg-id    srlg-id
352          |  |        |           +--:(unnumbered-case)
353          |  |        |              +--ro unnumbered
354          |  |        |                 +--ro router-id       uint32
355          |  |        |                 +--ro interface-id    uint32
356          |  |        +--:(path-key-case)
357          |  |           +--ro path-key
358          |  |              +--ro pce-id      pce-id
359          |  |              +--ro path-key    path-key
360          |  +--ro rro
361          |  |  +--ro processing-rule?   boolean
362          |  |  +--ro ignore?            boolean
363          |  |  +--ro subobject*
364          |  |     +--ro protection-available?   boolean
365          |  |     +--ro protection-in-use?      boolean
366          |  |     +--ro (subobject-type)?
367          |  |        +--:(ip-prefix-case)
368          |  |        |  +--ro ip-prefix
369          |  |        |     +--ro ip-prefix    inet:ip-prefix
370          |  |        +--:(label-case)
371          |  |        |  +--ro label
372          |  |        |     +--ro uni-directional             boolean
373          |  |        |     +--ro (label-type)?
374          |  |        |     |  +--:(type1-label-case)
375          |  |        |     |  |  +--ro type1-label
376          |  |        |     |  |     +--ro type1-label    uint32
377          |  |        |     |  +--:(generalized-label-case)
378          |  |        |     |  |  +--ro generalized-label
379          |  |        |     |  |     +--ro generalized-label    binary
380          |  |        |     |  +--:(waveband-switching-label-case)
381          |  |        |     |     +--ro waveband-switching-label
382          |  |        |     |        +--ro end-label      uint32
383          |  |        |     |        +--ro start-label    uint32
384          |  |        |     |        +--ro waveband-id    uint32
385          |  |        |     +--ro global?                     boolean
386          |  |        +--:(unnumbered-case)
387          |  |        |  +--ro unnumbered
388          |  |        |     +--ro router-id       uint32
389          |  |        |     +--ro interface-id    uint32
390          |  |        +--:(path-key-case)
391          |  |           +--ro path-key
392          |  |              +--ro pce-id      pce-id
393          |  |              +--ro path-key    path-key
394          |  +--ro xro
395          |  |  +--ro processing-rule?   boolean
396          |  |  +--ro ignore?            boolean
397          |  |  +--ro flags              bits
398          |  |  +--ro subobject*
399          |  |     +--ro mandatory?    boolean
400          |  |     +--ro attribute     enumeration
401          |  |     +--ro (subobject-type)?
402          |  |        +--:(as-number-case)
403          |  |        |  +--ro as-number
404          |  |        |     +--ro as-number    inet:as-number
405          |  |        +--:(ip-prefix-case)
406          |  |        |  +--ro ip-prefix
407          |  |        |     +--ro ip-prefix    inet:ip-prefix
408          |  |        +--:(label-case)
409          |  |        |  +--ro label
410          |  |        |     +--ro uni-directional             boolean
411          |  |        |     +--ro (label-type)?
412          |  |        |        +--:(type1-label-case)
413          |  |        |        |  +--ro type1-label
414          |  |        |        |     +--ro type1-label    uint32
415          |  |        |        +--:(generalized-label-case)
416          |  |        |        |  +--ro generalized-label
417          |  |        |        |     +--ro generalized-label    binary
418          |  |        |        +--:(waveband-switching-label-case)
419          |  |        |           +--ro waveband-switching-label
420          |  |        |              +--ro end-label      uint32
421          |  |        |              +--ro start-label    uint32
422          |  |        |              +--ro waveband-id    uint32
423          |  |        +--:(srlg-case)
424          |  |        |  +--ro srlg
425          |  |        |     +--ro srlg-id    srlg-id
426          |  |        +--:(unnumbered-case)
427          |  |           +--ro unnumbered
428          |  |              +--ro router-id       uint32
429          |  |              +--ro interface-id    uint32
430          |  +--ro of
431          |  |  +--ro processing-rule?   boolean
432          |  |  +--ro ignore?            boolean
433          |  |  +--ro code               of-id
434          |  |  +--ro tlvs
435          |  |     +--ro vendor-information-tlv*
436          |  |        +--ro enterprise-number?   iana:enterprise-number
437          |  |        +--ro (enterprise-specific-information)?
438          |  +--ro class-type
439          |     +--ro processing-rule?   boolean
440          |     +--ro ignore?            boolean
441          |     +--ro class-type         class-type
442          +--ro metadata
443          +--ro lsp
444          |  +--ro processing-rule?   boolean
445          |  +--ro ignore?            boolean
446          |  +--ro tlvs
447          |  |  +--ro lsp-error-code
448          |  |  |  +--ro error-code?   uint32
449          |  |  +--ro lsp-identifiers
450          |  |  |  +--ro lsp-id?      rsvp:lsp-id
451          |  |  |  +--ro tunnel-id?   rsvp:tunnel-id
452          |  |  |  +--ro (address-family)?
453          |  |  |     +--:(ipv4-case)
454          |  |  |     |  +--ro ipv4
455          |  |  |     |     +--ro ipv4-tunnel-sender-address      inet:ipv4-address
456          |  |  |     |     +--ro ipv4-extended-tunnel-id         rsvp:ipv4-extended-tunnel-id
457          |  |  |     |     +--ro ipv4-tunnel-endpoint-address    inet:ipv4-address
458          |  |  |     +--:(ipv6-case)
459          |  |  |        +--ro ipv6
460          |  |  |           +--ro ipv6-tunnel-sender-address      inet:ipv6-address
461          |  |  |           +--ro ipv6-extended-tunnel-id         rsvp:ipv6-extended-tunnel-id
462          |  |  |           +--ro ipv6-tunnel-endpoint-address    inet:ipv6-address
463          |  |  +--ro rsvp-error-spec
464          |  |  |  +--ro (error-type)?
465          |  |  |     +--:(rsvp-case)
466          |  |  |     |  +--ro rsvp-error
467          |  |  |     +--:(user-case)
468          |  |  |        +--ro user-error
469          |  |  +--ro symbolic-path-name
470          |  |  |  +--ro path-name?   symbolic-path-name
471          |  |  o--ro vs-tlv
472          |  |  |  +--ro enterprise-number?   iana:enterprise-number
473          |  |  |  +--ro (vendor-payload)?
474          |  |  +--ro vendor-information-tlv*
475          |  |  |  +--ro enterprise-number?   iana:enterprise-number
476          |  |  |  +--ro (enterprise-specific-information)?
477          |  |  +--ro path-binding
478          |  |     x--ro binding-type?      uint8
479          |  |     x--ro binding-value?     binary
480          |  |     +--ro (binding-type-value)?
481          |  |        +--:(mpls-label)
482          |  |        |  +--ro mpls-label?        netc:mpls-label
483          |  |        +--:(mpls-label-entry)
484          |  |           +--ro label?             netc:mpls-label
485          |  |           +--ro traffic-class?     uint8
486          |  |           +--ro bottom-of-stack?   boolean
487          |  |           +--ro time-to-live?      uint8
488          |  +--ro plsp-id?           plsp-id
489          |  +--ro delegate?          boolean
490          |  +--ro sync?              boolean
491          |  +--ro remove?            boolean
492          |  +--ro administrative?    boolean
493          |  +--ro operational?       operational-status
494          +--ro path-setup-type
495             +--ro pst?   uint8
496
497 -----
498
499 The LSP-DB is accessible via RESTCONF.
500 The PCC's LSPs are stored in the ``pcep-topology`` while the session is active.
501 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*).
502
503 **URL:** ``/restconf/operational/network-topology:network-topology/topology/pcep-topology/node/pcc:%2F%2F43.43.43.43``
504
505 **Method:** ``GET``
506
507 **Response Body:**
508
509 .. code-block:: xml
510    :linenos:
511    :emphasize-lines: 2,4,5,8,12,14,15,16,17,18,20,24,25,26,28,29,32,36
512
513    <node>
514       <node-id>pcc://43.43.43.43</node-id>
515       <path-computation-client>
516          <ip-address>43.43.43.43</ip-address>
517          <state-sync>synchronized</state-sync>
518          <stateful-tlv>
519             <stateful>
520                <lsp-update-capability>true</lsp-update-capability>
521             </stateful>
522          </stateful-tlv>
523          <reported-lsp>
524             <name>foo</name>
525             <lsp>
526                <operational>up</operational>
527                <sync>true</sync>
528                <plsp-id>1</plsp-id>
529                <create>false</create>
530                <administrative>true</administrative>
531                <remove>false</remove>
532                <delegate>true</delegate>
533                <tlvs>
534                   <lsp-identifiers>
535                      <ipv4>
536                         <ipv4-tunnel-sender-address>43.43.43.43</ipv4-tunnel-sender-address>
537                         <ipv4-tunnel-endpoint-address>39.39.39.39</ipv4-tunnel-endpoint-address>
538                         <ipv4-extended-tunnel-id>39.39.39.39</ipv4-extended-tunnel-id>
539                      </ipv4>
540                      <tunnel-id>1</tunnel-id>
541                      <lsp-id>1</lsp-id>
542                   </lsp-identifiers>
543                   <symbolic-path-name>
544                      <path-name>Zm9v</path-name>
545                   </symbolic-path-name>
546                </tlvs>
547             </lsp>
548             <ero>
549                <subobject>
550                   <loose>false</loose>
551                   <ip-prefix>
552                      <ip-prefix>201.20.160.40/32</ip-prefix>
553                   </ip-prefix>
554                </subobject>
555                <subobject>
556                   <loose>false</loose>
557                   <ip-prefix>
558                      <ip-prefix>195.20.160.39/32</ip-prefix>
559                   </ip-prefix>
560                </subobject>
561                <subobject>
562                   <loose>false</loose>
563                   <ip-prefix>
564                      <ip-prefix>39.39.39.39/32</ip-prefix>
565                   </ip-prefix>
566                </subobject>
567             </ero>
568          </reported-lsp>
569       </path-computation-client>
570    </node>
571
572 @line 2: **node-id** The PCC identifier.
573
574 @line 4: **ip-address** IP address of the PCC.
575
576 @line 5: **state-sync** Synchronization status of the PCC's LSPs. The *synchronized* indicates the State Synchronization is done.
577
578 @line 8: **lsp-update-capability** - Indicates that PCC allows LSP modifications.
579
580 @line 12: **name** - Textual representation of LPS's name.
581
582 @line 14: **operational** - Represent operational status of the LSP:
583
584    * *down* - not active.
585    * *up* - signaled.
586    * *active* - up and carrying traffic.
587    * *going-down* - LSP is being torn down, resources are being released.
588    * *going-up* - LSP is being signaled.
589
590 @line 15: **sync** - The flag set by PCC during LSPs State Synchronization.
591
592 @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.
593
594 @line 17: **create** - The *false* indicates that LSP is PCC-initiated.
595
596 @line 18: **administrative** - The flag indicates target operational status of the LSP.
597
598 @line 20: **delegate** - The delegate flag indicates that the PCC is delegating the LSP to the PCE.
599
600 @line 24: **ipv4-tunnel-sender-address** - Contains the sender node's IP address.
601
602 @line 25: **ipv4-tunnel-endpoint-address** - Contains the egress node's IP address.
603
604 @line 26: **ipv4-extended-tunnel-id** - The *Extended Tunnel ID* identifier.
605
606 @line 28: **tunnel-id** - The *Tunnel ID* identifier.
607
608 @line 29: **lsp-id** - The *LSP ID* identifier.
609
610 @line 32: **path-name** - The symbolic name for the LSP.
611
612 @line 36: **ero** - The *Explicit Route Object* is encoding the path of the TE LSP through the network.
613
614 LSP Delegation
615 ''''''''''''''
616 The LSP control delegations is an mechanism, where PCC grants to a PCE the temporary right in order to modify LSP attributes.
617 The PCC can revoke the delegation or the PCE may waive the delegation at any time.
618 The LSP control is delegated to at most one PCE at the same time.
619
620 .. figure:: ./images/bgpcep/pcep-delegation-return.png
621    :align: center
622    :alt: Returning a Delegation
623
624    Returning a Delegation.
625
626 -----
627
628 Following RPC example illustrates a request for the LSP delegation give up:
629
630 **URL:** ``/restconf/operations/network-topology-pcep:update-lsp``
631
632 **Method:** ``POST``
633
634 **Content-Type:** ``application/xml``
635
636 **Request Body:**
637
638 .. code-block:: xml
639    :linenos:
640    :emphasize-lines: 2,3,6,10
641
642    <input>
643       <node>pcc://43.43.43.43</node>
644       <name>foo</name>
645       <arguments>
646          <lsp xmlns:stateful="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
647             <delegate>false</delegate>
648             <administrative>true</administrative>
649             <tlvs>
650                <symbolic-path-name>
651                   <path-name>Zm9v</path-name>
652                </symbolic-path-name>
653             </tlvs>
654          </lsp>
655       </arguments>
656       <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>
657    </input>
658
659 @line 2: **node** The PCC identifier.
660
661 @line 3: **name** The name of the LSP.
662
663 @line 6: **delegate** - Delegation flag set *false* in order to return the LSP delegation.
664
665 @line 10: **path-name** - The Symbolic Path Name TLV must be present when sending a request to give up the delegation.
666
667 LSP Update
668 ''''''''''
669 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.
670 In order to update LSP, the PCE must hold a LSP delegation.
671 The LSP update is done in *make-before-break* fashion - first, new LSP is initiated and then the old LSP is torn down.
672
673 .. figure:: ./images/bgpcep/pcep-update.png
674    :align: center
675    :alt: Active Stateful PCE LSP Update
676
677    Active Stateful PCE LSP Update.
678
679 -----
680
681 Following RPC example shows a request for the LSP update:
682
683 **URL:** ``/restconf/operations/network-topology-pcep:update-lsp``
684
685 **Method:** ``POST``
686
687 **Content-Type:** ``application/xml``
688
689 **Request Body:**
690
691 .. code-block:: xml
692    :linenos:
693    :emphasize-lines: 2,3,6,7,9
694
695    <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
696       <node>pcc://43.43.43.43</node>
697       <name>foo</name>
698       <arguments>
699          <lsp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
700             <delegate>true</delegate>
701             <administrative>true</administrative>
702          </lsp>
703          <ero>
704             <subobject>
705                <loose>false</loose>
706                <ip-prefix>
707                   <ip-prefix>200.20.160.41/32</ip-prefix>
708                </ip-prefix>
709             </subobject>
710             <subobject>
711                <loose>false</loose>
712                <ip-prefix>
713                   <ip-prefix>196.20.160.39/32</ip-prefix>
714                </ip-prefix>
715             </subobject>
716             <subobject>
717                <loose>false</loose>
718                <ip-prefix>
719                   <ip-prefix>39.39.39.39/32</ip-prefix>
720                </ip-prefix>
721             </subobject>
722          </ero>
723       </arguments>
724       <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>
725    </input>
726
727 @line 2: **node** The PCC identifier.
728
729 @line 3: **name** The name of the LSP to be updated.
730
731 @line 6: **delegate** - Delegation flag set *true* in order to keep the LSP control.
732
733 @line 7: **administrative** - Desired administrative status of the LSP is active.
734
735 @line 9: **ero** - This LSP attribute is changed.
736
737 PCE-initiated LSP Setup
738 ^^^^^^^^^^^^^^^^^^^^^^^
739 The PCEP Extension for PCE-initiated LSP Setup allows PCE to request a creation and deletion of LSPs.
740
741 Configuration
742 '''''''''''''
743 This capability is enabled by default. No additional configuration is required.
744
745 LSP Instantiation
746 '''''''''''''''''
747 The PCE can request LSP creation.
748 The LSP instantiation is done by sending an LSP Initiate Message to PCC.
749 The PCC assign delegation to PCE which triggered creation.
750 PCE-initiated LSPs are identified by *Create* flag.
751
752 .. figure:: ./images/bgpcep/pcep-initiate.png
753    :align: center
754    :alt: LSP instantiation
755
756    LSP instantiation.
757
758 -----
759
760 Following RPC example shows a request for the LSP initiation:
761
762 **URL:** ``/restconf/operations/network-topology-pcep:add-lsp``
763
764 **Method:** ``POST``
765
766 **Content-Type:** ``application/xml``
767
768 **Request Body:**
769
770 .. code-block:: xml
771    :linenos:
772    :emphasize-lines: 2,3,8,14
773
774    <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
775       <node>pcc://43.43.43.43</node>
776       <name>update-tunel</name>
777          <arguments>
778             <lsp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
779                <delegate>true</delegate>
780                <administrative>true</administrative>
781             </lsp>
782             <endpoints-obj>
783                <ipv4>
784                   <source-ipv4-address>43.43.43.43</source-ipv4-address>
785                   <destination-ipv4-address>39.39.39.39</destination-ipv4-address>
786                </ipv4>
787             </endpoints-obj>
788             <ero>
789                <subobject>
790                   <loose>false</loose>
791                   <ip-prefix>
792                      <ip-prefix>201.20.160.40/32</ip-prefix>
793                   </ip-prefix>
794                </subobject>
795                <subobject>
796                   <loose>false</loose>
797                   <ip-prefix>
798                      <ip-prefix>195.20.160.39/32</ip-prefix>
799                   </ip-prefix>
800                </subobject>
801                <subobject>
802                   <loose>false</loose>
803                   <ip-prefix>
804                      <ip-prefix>39.39.39.39/32</ip-prefix>
805                   </ip-prefix>
806                </subobject>
807             </ero>
808          </arguments>
809       <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>
810    </input>
811
812 @line 2: **node** The PCC identifier.
813
814 @line 3: **name** The name of the LSP to be created.
815
816 @line 8: **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.
817
818 @line 14: **ero** - The *ERO* object is mandatory for LSP initiation request.
819
820 LSP Deletion
821 ''''''''''''
822 The PCE may request a deletion of PCE-initiated LSPs.
823 The PCE must be delegation holder for this particular LSP.
824
825 .. figure:: ./images/bgpcep/pcep-deletion.png
826    :align: center
827    :alt: LSP deletion.
828
829    LSP deletion.
830
831 -----
832
833 Following RPC example shows a request for the LSP deletion:
834
835 **URL:** ``/restconf/operations/network-topology-pcep:remove-lsp``
836
837 **Method:** ``POST``
838
839 **Content-Type:** ``application/xml``
840
841 **Request Body:**
842
843 .. code-block:: xml
844    :linenos:
845    :emphasize-lines: 2,3
846
847    <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
848       <node>pcc://43.43.43.43</node>
849       <name>update-tunel</name>
850       <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>
851    </input>
852
853 @line 2: **node** The PCC identifier.
854
855 @line 3: **name** The name of the LSP to be removed.
856
857 PCE-initiated LSP Delegation
858 ''''''''''''''''''''''''''''
859 The PCE-initiated LSP control is delegated to the PCE which requested the initiation.
860 The PCC cannot revoke delegation of PCE-initiated LSP.
861 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.
862 The PCE may ask for a delegation of the orphan LSP.
863
864 .. figure:: ./images/bgpcep/pcep-revoke-delegation.png
865    :align: center
866    :alt: LSP re-delegation
867
868    Orphan PCE-initiated LSP - control taken by PCE.
869
870 -----
871
872 Following RPC example illustrates a request for the LSP delegation:
873
874 **URL:** ``/restconf/operations/network-topology-pcep:update-lsp``
875
876 **Method:** ``POST``
877
878 **Content-Type:** ``application/xml``
879
880 **Request Body:**
881
882 .. code-block:: xml
883    :linenos:
884    :emphasize-lines: 2,3,6,10
885
886    <input>
887       <node>pcc://43.43.43.43</node>
888       <name>update-tunel</name>
889       <arguments>
890          <lsp xmlns:stateful="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
891             <delegate>true</delegate>
892             <administrative>true</administrative>
893             <tlvs>
894                <symbolic-path-name>
895                   <path-name>dXBkYXRlLXR1bmVs</path-name>
896                </symbolic-path-name>
897             </tlvs>
898          </lsp>
899       </arguments>
900       <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>
901    </input>
902
903 @line 2: **node** The PCC identifier.
904
905 @line 3: **name** The name of the LSP.
906
907 @line 6: **delegate** - *Delegation* flag set *true* in order to take the LSP delegation.
908
909 @line 10: **path-name** - The *Symbolic Path Name* TLV must be present when sending a request to take a delegation.
910
911 Segment Routing
912 ^^^^^^^^^^^^^^^
913 The PCEP Extensions for Segment Routing (SR) allow a stateful PCE to compute and initiate TE paths in SR networks.
914 The SR path is defined as an order list  of *segments*.
915 Segment Routing architecture can be directly applied to the MPLS forwarding plane without changes.
916 Segment Identifier (SID) is encoded as a MPLS label.
917
918 Configuration
919 '''''''''''''
920 This capability is enabled by default. In order to disable it, a configuration should be changed as follows:
921
922 **URL:** ``/restconf/config/pcep-segment-routing-app-config:pcep-segment-routing-app-config``
923
924 **Method:** ``PUT``
925
926 **Content-Type:** ``application/xml``
927
928 **Request Body:**
929
930 .. code-block:: xml
931    :linenos:
932    :emphasize-lines: 2
933
934    <pcep-segment-routing-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:pcep:segment-routing-app-config">
935       <sr-capable>false</sr-capable>
936    </pcep-segment-routing-config>
937
938 @line 2: **sr-capable** - True if capability is supported.
939
940 IANA code points
941 ''''''''''''''''
942
943 In PCEP-SR draft version 6, SR Explicit Route Object/Record Route Object subobjects IANA code points change was proposed.
944 In order to use the latest code points, a configuration should be changed as follows:
945
946 **URL:** ``/restconf/config/pcep-segment-routing-app-config:pcep-segment-routing-config``
947
948 **Method:** ``PUT``
949
950 **Content-Type:** ``application/xml``
951
952 **Request Body:**
953
954 .. code-block:: xml
955    :linenos:
956    :emphasize-lines: 2
957
958    <pcep-segment-routing-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:pcep:segment-routing-app-config">
959       <iana-sr-subobjects-type>true</iana-sr-subobjects-type>
960    </pcep-segment-routing-config>
961
962 @line 2: **iana-sr-subobjects-type** - True if IANA code points should be used.
963
964 LSP Operations for PCEP SR
965 ''''''''''''''''''''''''''
966 The PCEP SR extension defines new ERO subobject - *SR-ERO subobject* capable of carrying a SID.
967
968 .. code-block:: console
969
970    sr-ero-type
971       +---- c-flag?                boolean
972       +---- m-flag?                boolean
973       +---- sid-type?              sid-type
974       +---- sid?                   uint32
975       +---- (nai)?
976          +--:(ip-node-id)
977          |  +---- ip-address             inet:ip-address
978          +--:(ip-adjacency)
979          |  +---- local-ip-address       inet:ip-address
980          |  +---- remote-ip-address      inet:ip-address
981          +--:(unnumbered-adjacency)
982             +---- local-node-id          uint32
983             +---- local-interface-id     uint32
984             +---- remote-node-id         uint32
985             +---- remote-interface-id    uint32
986
987 -----
988
989 Following RPC example illustrates a request for the SR-TE LSP creation:
990
991 **URL:** ``/restconf/operations/network-topology-pcep:add-lsp``
992
993 **Method:** ``POST``
994
995 **Content-Type:** ``application/xml``
996
997 **Request Body:**
998
999 .. code-block:: xml
1000    :linenos:
1001    :emphasize-lines: 16,21,22,23
1002
1003    <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
1004       <node>pcc://43.43.43.43</node>
1005       <name>sr-path</name>
1006       <arguments>
1007          <lsp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
1008             <delegate>true</delegate>
1009             <administrative>true</administrative>
1010          </lsp>
1011          <endpoints-obj>
1012             <ipv4>
1013                <source-ipv4-address>43.43.43.43</source-ipv4-address>
1014                <destination-ipv4-address>39.39.39.39</destination-ipv4-address>
1015             </ipv4>
1016          </endpoints-obj>
1017          <path-setup-type xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
1018             <pst>1</pst>
1019          </path-setup-type>
1020          <ero>
1021             <subobject>
1022                <loose>false</loose>
1023                <sid-type xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">ipv4-node-id</sid-type>
1024                <m-flag xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">true</m-flag>
1025                <sid xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">24001</sid>
1026                <ip-address xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">39.39.39.39</ip-address>
1027            </subobject>
1028          </ero>
1029       </arguments>
1030       <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>
1031    </input>
1032
1033 @line 16: **path-setup-type** - Set *1* for SR-TE LSP
1034
1035 @line 21: **ipv4-node-id** - The SR-ERO subobject represents *IPv4 Node ID* NAI.
1036
1037 @line 22: **m-flag** - The SID value represents an MPLS label.
1038
1039 @line 23: **sid** - The Segment Identifier.
1040
1041 -----
1042
1043 Following RPC example illustrates a request for the SR-TE LSP update including modified path:
1044
1045 **URL:** ``/restconf/operations/network-topology-pcep:update-lsp``
1046
1047 **Method:** ``POST``
1048
1049 **Content-Type:** ``application/xml``
1050
1051 **Request Body:**
1052
1053 .. code-block:: xml
1054    :linenos:
1055
1056    <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
1057       <node>pcc://43.43.43.43</node>
1058       <name>update-tunnel</name>
1059       <arguments>
1060          <lsp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
1061             <delegate>true</delegate>
1062             <administrative>true</administrative>
1063          </lsp>
1064          <path-setup-type xmlns="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
1065             <pst>1</pst>
1066          </path-setup-type>
1067          <ero>
1068             <subobject>
1069                <loose>false</loose>
1070                <sid-type xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">ipv4-node-id</sid-type>
1071                <m-flag xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">true</m-flag>
1072                <sid xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">24002</sid>
1073                <ip-address xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">200.20.160.41</ip-address>
1074             </subobject>
1075             <subobject>
1076                <loose>false</loose>
1077                <sid-type xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">ipv4-node-id</sid-type>
1078                <m-flag xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">true</m-flag>
1079                <sid xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">24001</sid>
1080                <ip-address xmlns="urn:opendaylight:params:xml:ns:yang:pcep:segment:routing">39.39.39.39</ip-address>
1081             </subobject>
1082          </ero>
1083       </arguments>
1084       <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>
1085    </input>
1086
1087 LSP State Synchronization Optimization Procedures
1088 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1089 This extension bring optimizations for state synchronization:
1090
1091 * State Synchronization Avoidance
1092 * Incremental State Synchronization
1093 * PCE-triggered Initial Synchronization
1094 * PCE-triggered Re-synchronization
1095
1096 Configuration
1097 '''''''''''''
1098 This capability is enabled by default. No additional configuration is required.
1099
1100 State Synchronization Avoidance
1101 '''''''''''''''''''''''''''''''
1102 The State Synchronization Avoidance procedure is intended to skip state synchronization if the state has survived and not changed during session restart.
1103
1104 .. figure:: ./images/bgpcep/pcep-sync-skipped.png
1105    :align: center
1106    :alt: Sync skipped
1107
1108    State Synchronization Skipped.
1109
1110 Incremental State Synchronization
1111 '''''''''''''''''''''''''''''''''
1112 The Incremental State Synchronization procedure is intended to do incremental (delta) state synchronization when possible.
1113
1114 .. figure:: ./images/bgpcep/pcep-sync-incremental.png
1115    :align: center
1116    :alt: Sync incremental
1117
1118    Incremental Synchronization Procedure.
1119
1120 PCE-triggered Initial Synchronization
1121 '''''''''''''''''''''''''''''''''''''
1122 The PCE-triggered Initial Synchronization procedure is intended to do let PCE control the timing of the initial state synchronization.
1123
1124 .. figure:: ./images/bgpcep/pcep-sync-initial.png
1125    :align: center
1126    :alt: Initial Sync
1127
1128    PCE-triggered Initial State Synchronization Procedure.
1129
1130 -----
1131
1132 Following RPC example illustrates a request for the initial synchronization:
1133
1134 **URL:** ``/restconf/operations/network-topology-pcep:trigger-sync``
1135
1136 **Method:** ``POST``
1137
1138 **Content-Type:** ``application/xml``
1139
1140 **Request Body:**
1141
1142 .. code-block:: xml
1143    :linenos:
1144
1145    <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
1146       <node>pcc://43.43.43.43</node>
1147       <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>
1148    </input>
1149
1150 PCE-triggered Re-synchronization
1151 ''''''''''''''''''''''''''''''''
1152 The PCE-triggered Re-synchronization: To let PCE re-synchronize the state for sanity check.
1153
1154 .. figure:: ./images/bgpcep/pcep-re-sync.png
1155    :align: center
1156    :alt: Re-sync
1157
1158    PCE-triggered Re-synchronization Procedure.
1159
1160 -----
1161
1162 Following RPC example illustrates a request for the LSP re-synchronization:
1163
1164 **URL:** ``/restconf/operations/network-topology-pcep:trigger-sync``
1165
1166 **Method:** ``POST``
1167
1168 **Content-Type:** ``application/xml``
1169
1170 **Request Body:**
1171
1172 .. code-block:: xml
1173    :linenos:
1174    :emphasize-lines: 3
1175
1176    <input xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep">
1177       <node>pcc://43.43.43.43</node>
1178       <name>update-lsp</name>
1179       <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>
1180    </input>
1181
1182 @line 3: **name** - The LSP name. If this parameter is omitted, re-synchronization is requested for all PCC's LSPs.
1183
1184 Node session statistics
1185 ----------------------------
1186
1187 The PCEP statistics provides information about PCE <-> PCC session and its stateful listener (topology-provider).
1188
1189 Usage
1190 '''''
1191
1192 **URL:** ``/restconf/operational/network-topology:network-topology/topology/pcep-topology/node/pcc:%2F%2F43.43.43.43/pcep-session-state``
1193
1194 **Method:** ``GET``
1195
1196 **Response Body:**
1197
1198 .. code-block:: xml
1199    :linenos:
1200    :emphasize-lines: 3,4,5,6,7,8,9,10,13,14,15,16,19,20,21,22,25,26,27,28,31,32,33,35,36,37
1201
1202    <pcep-session-state xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep:stats">
1203       <messages>
1204          <last-received-rpt-msg-timestamp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">1512640592</last-received-rpt-msg-timestamp>
1205          <sent-upd-msg-count xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">0</sent-upd-msg-count>
1206          <received-rpt-msg-count xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">2</received-rpt-msg-count>
1207          <sent-init-msg-count xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">0</sent-init-msg-count>
1208          <sent-msg-count>0</sent-msg-count>
1209          <last-sent-msg-timestamp>0</last-sent-msg-timestamp>
1210          <unknown-msg-received>0</unknown-msg-received>
1211          <received-msg-count>2</received-msg-count>
1212          <error-messages>
1213             <last-sent-error></last-sent-error>
1214             <received-error-msg-count>0</received-error-msg-count>
1215             <sent-error-msg-count>0</sent-error-msg-count>
1216             <last-received-error></last-received-error>
1217          </error-messages>
1218          <reply-time>
1219             <average-time>0</average-time>
1220             <min-time>0</min-time>
1221             <max-time>0</max-time>
1222          </reply-time>
1223       </messages>
1224       <peer-pref>
1225          <keepalive>30</keepalive>
1226          <deadtimer>120</deadtimer>
1227          <ip-address>127.0.0.1</ip-address>
1228          <session-id>0</session-id>
1229       </peer-pref>
1230       <local-pref>
1231          <keepalive>30</keepalive>
1232          <deadtimer>120</deadtimer>
1233          <ip-address>127.0.0.1</ip-address>
1234          <session-id>0</session-id>
1235       </local-pref>
1236       <peer-capabilities>
1237          <stateful xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">true</stateful>
1238          <instantiation xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">true</instantiation>
1239          <active xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">true</active>
1240       </peer-capabilities>
1241       <session-duration>0:00:00:18</session-duration>
1242       <delegated-lsps-count>1</delegated-lsps-count>
1243       <synchronized>true</synchronized>
1244    </pcep-session-state>
1245
1246 @line 3: **last-received-rpt-msg-timestamp** - The timestamp of last received PCRpt message.
1247
1248 @line 4: **sent-upd-msg-count** - The number of sent PCUpd messages.
1249
1250 @line 5: **received-rpt-msg-count** - The number of received PcRpt messages.
1251
1252 @line 6: **sent-init-msg-count** - The number of sent PCInitiate messages.
1253
1254 @line 7: **sent-msg-count** - Total number of sent PCEP messages.
1255
1256 @line 8: **last-sent-msg-timestamp** - The timestamp of last sent message.
1257
1258 @line 9: **unknown-msg-received** - The number of received unknown messages.
1259
1260 @line 10: **received-msg-count** - Total number of received PCEP messages.
1261
1262 @line 13: **last-sent-error** - Type/value tuple of last sent error.
1263
1264 @line 14: **received-error-msg-count** - Total number of received PCErr messages.
1265
1266 @line 15: **sent-error-msg-count** - Total number of sent PCErr messages.
1267
1268 @line 16: **last-received-error** - Type/value tuple of last sent error.
1269
1270 @line 19: **keepalive** - Advertised keep-alive value.
1271
1272 @line 20: **deadtimer** - Advertised deadtimer value.
1273
1274 @line 21: **ip-address** - Peer's IP address.
1275
1276 @line 22: **session-id** - Peer's session identifier.
1277
1278 @line 25: **keepalive** - Advertised keep-alive value.
1279
1280 @line 26: **deadtimer** - Advertised deadtimer value.
1281
1282 @line 27: **ip-address** - Peer's IP address.
1283
1284 @line 28: **session-id** - Peer's session identifier.
1285
1286 @line 31: **stateful** - Represents peer's stateful/stateless capability.
1287
1288 @line 32: **instantiation** - Represents peer's instantiation capability.
1289
1290 @line 33: **active** - Represents peer's LSP update capability.
1291
1292 @line 35: **session-duration** - Elapsed time (in d:H:m:s) from session-up until last statistic update.
1293
1294 @line 36: **delegated-lsps-count** - The number of delegated LSPs (tunnels) from PCC.
1295
1296 @line 37: **synchronized** - Represents synchronization status.
1297
1298 CLI
1299 ---
1300
1301 PCEP Karaf Console (odl-bgpcep-pcep-cli) provides a CLI feature to read session statistics per node.
1302
1303 .. code-block:: bash
1304    :linenos:
1305
1306    opendaylight-user@root> pcep:node-state -topology-id pcep-topology -node-id pcc://43.43.43.43
1307
1308 Test tools
1309 ----------
1310 PCC Mock
1311 ^^^^^^^^
1312 The PCC Mock is a stand-alone Java application purposed to simulate a PCC(s).
1313 The simulator is capable to report sample LSPs, respond to delegation, LSP management operations and synchronization optimization procedures.
1314 This application is not part of the OpenDaylight Karaf distribution, however it can be downloaded from OpenDaylight's Nexus (use latest release version):
1315
1316 ``https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/bgpcep/pcep-pcc-mock``
1317
1318 Usage
1319 '''''
1320 The application can be run from command line:
1321
1322 .. code-block:: console
1323
1324    java -jar pcep-pcc-mock-*-executable.jar
1325
1326
1327 with optional input parameters:
1328
1329 .. code-block:: console
1330
1331    --local-address <Address:Port> (optional, default 127.0.0.1)
1332       The first PCC IP address. If more PCCs are required, the IP address will be incremented. Port number can be optionally specified.
1333
1334    --remote-address <Address1:Port1,Address2:Port2,Address3:Port3,...> (optional, default 127.0.0.1:4189)
1335       The list of IP address for the PCE servers. Port number can be optionally specified, otherwise default port number 4189 is used.
1336
1337    --pcc <N> (optional, default 1)
1338       Number of mocked PCC instances.
1339
1340    --lsp <N> (optional, default 1)
1341       Number of tunnels (LSPs) reported per PCC, might be zero.
1342
1343    --pcerr (optional flag)
1344       If the flag is present, response with PCErr, otherwise PCUpd.
1345
1346    --log-level <LEVEL> (optional, default INFO)
1347       Set logging level for pcc-mock.
1348
1349    -d, --deadtimer <0..255> (optional, default 120)
1350       DeadTimer value in seconds.
1351
1352    -ka, --keepalive <0.255> (optional, default 30)
1353       KeepAlive timer value in seconds.
1354
1355    --password <password> (optional)
1356       If the password is present, it is used in TCP MD5 signature, otherwise plain TCP is used.
1357
1358    --reconnect <seconds> (optional)
1359       If the argument is present, the value in seconds, is used as a delay before each new reconnect (initial connect or connection re-establishment) attempt.
1360       The number of reconnect attempts is unlimited. If the argument is omitted, pcc-mock is not trying to reconnect.
1361
1362    --redelegation-timeout <seconds> (optional, default 0)
1363       The timeout starts when LSP delegation is returned or PCE fails, stops when LSP is re-delegated to PCE.
1364       When timeout expires, LSP delegation is revoked and held by PCC.
1365
1366    --state-timeout <seconds> (optional, default -1 (disabled))
1367       The timeout starts when LSP delegation is returned or PCE fails, stops when LSP is re-delegated to PCE.
1368       When timeout expires, PCE-initiated LSP is removed.
1369
1370    --state-sync-avoidance <disconnect_after_x_seconds> <reconnect_after_x_seconds> <dbVersion>
1371       Synchronization avoidance capability enabled.
1372          - disconnect_after_x_seconds: seconds that will pass until disconnections is forced. If set to smaller number than 1, disconnection wont be performed.
1373          - reconnect_after_x_seconds: seconds that will pass between disconnection and new connection attempt. Only happens if disconnection has been performed.
1374          - dbVersion: dbVersion used in new Open and must be always equal or bigger than LSP. If equal than LSP skip synchronization will be performed,
1375            if not full synchronization will be performed taking in account new starting dbVersion desired.
1376     --incremental-sync-procedure <disconnect_after_x_seconds> <reconnect_after_x_seconds> <dbVersion>
1377       Incremental synchronization capability enabled.
1378          - dbVersion: dbVersion used in new Open and must be always bigger than LSP. Incremental synchronization will be performed taking in account new starting dbVersion desired.
1379
1380     --triggered-initial-sync
1381       PCE-triggered synchronization capability enabled. Can be combined combined with state-sync-avoidance/incremental-sync-procedure.
1382
1383     --triggered-re-sync
1384       PCE-triggered re-synchronization capability enabled.
1385
1386 Data Change Counter Tool
1387 ^^^^^^^^^^^^^^^^^^^^^^^^
1388
1389 Data Change Counter tool registers a Data Change Listener to a specified topology's subtree.
1390 This will allow us to know the quantity of changes produced under it, with each data change event counter will be incremented.
1391
1392 Installation
1393 ''''''''''''
1394 Installing data change counter tool
1395
1396 .. code-block:: console
1397
1398    feature:install odl-restconf odl-bgpcep-data-change-counter
1399
1400 Configuration
1401 '''''''''''''
1402 Once we set the configuration, a new data change counter will be created and registers to example-linkstate-topology.
1403
1404 .. important:: **Clustering** - Each Counter Identifier should be unique.
1405
1406 **URL:** ``/restconf/config/odl-data-change-counter-config:data-change-counter-config/data-change-counter``
1407
1408 **Method:** ``PUT``
1409
1410 **Content-Type:** ``application/xml``
1411
1412 **Request Body:**
1413
1414 .. code-block:: xml
1415    :linenos:
1416    :emphasize-lines: 2,3
1417
1418    <data-change-counter-config xmlns="urn:opendaylight:params:xml:ns:yang:bgpcep:data-change-counter-config">
1419        <counter-id>data-change-counter</counter-id>
1420        <topology-name>example-linkstate-topology</topology-name>
1421    </data-change-counter-config>
1422
1423 @line 2: **Counter Id** - Unique counter change identifier.
1424
1425 @line 3: **Topology Name** - An identifier for a topology.
1426
1427 Usage
1428 '''''
1429
1430 Counter state for topology
1431
1432 **URL:** ``/restconf/operational/data-change-counter:data-change-counter/counter/data-change-counter``
1433
1434 **Method:** ``GET``
1435
1436 **Response Body:**
1437
1438 .. code-block:: xml
1439    :linenos:
1440    :emphasize-lines: 2,3
1441
1442    <counter xmlns="urn:opendaylight:params:xml:ns:yang:bgp-data-change-counter">
1443        <id>data-change-counter</id>
1444        <count>0</count>
1445    </counter>
1446
1447 @line 2: **Counter Id** - Unique counter change identifier.
1448
1449 @line 3: **Count** - Number of changes under registered topology's subtree.
1450
1451 Troubleshooting
1452 ---------------
1453 This section offers advices in a case OpenDaylight PCEP plugin is not working as expected.
1454
1455 .. contents:: Contents
1456    :depth: 2
1457    :local:
1458
1459 PCEP is not working...
1460 ^^^^^^^^^^^^^^^^^^^^^^
1461 * First of all, ensure that all required features are installed, local PCE and remote PCC configuration is correct.
1462
1463   To list all installed features in OpenDaylight use the following command at the Karaf console:
1464
1465   .. code-block:: console
1466
1467      feature:list -i
1468
1469 * Check OpenDaylight Karaf logs:
1470
1471   From Karaf console:
1472
1473   .. code-block:: console
1474
1475      log:tail
1476
1477   or open log file: ``data/log/karaf.log``
1478
1479   Possibly, a reason/hint for a cause of the problem can be found there.
1480
1481 * Try to minimize effect of other OpenDaylight features, when searching for a reason of the problem.
1482
1483 * Try to set DEBUG severity level for PCEP logger via Karaf console commands, in order to collect more information:
1484
1485   .. code-block:: console
1486
1487      log:set DEBUG org.opendaylight.protocol.pcep
1488
1489   .. code-block:: console
1490
1491      log:set DEBUG org.opendaylight.bgpcep.pcep
1492
1493 Bug reporting
1494 ^^^^^^^^^^^^^
1495 Before you report a bug, check `BGPCEP Bugzilla <https://bugs.opendaylight.org/buglist.cgi?list_id=65849&product=bgpcep&resolution=--->`_ to ensure same/similar bug is not already filed there.
1496
1497 Write an e-mail to bgpcep-users@lists.opendaylight.org and provide following information:
1498
1499 #. State OpenDaylight version
1500
1501 #. Describe your use-case and provide as much details related to PCEP as possible
1502
1503 #. Steps to reproduce
1504
1505 #. Attach Karaf log files, optionally packet captures, REST input/output
1506
1507 References
1508 ----------
1509 * `A Path Computation Element (PCE)-Based Architecture <https://tools.ietf.org/html/rfc4655>`_
1510 * `Path Computation Element (PCE) Communication Protocol Generic Requirements <https://tools.ietf.org/html/rfc4657>`_
1511 * `Unanswered Questions in the Path Computation Element Architecture <https://tools.ietf.org/html/rfc7399>`_
1512 * `A PCE-Based Architecture for Application-Based Network Operations <https://tools.ietf.org/html/rfc7491>`_
1513 * `Framework for PCE-Based Inter-Layer MPLS and GMPLS Traffic Engineering <https://tools.ietf.org/html/rfc5623>`_
1514 * `Applicability of a Stateful Path Computation Element (PCE) <https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-app-07>`_