PCE Working Group                                          D. Dhody, Ed.
Internet-Draft                                       Huawei Technologies
Intended status: Standards Track                             J. Hardwick
Expires: April 18, September 25, 2019                                   Metaswitch
                                                               V. Beeram
                                                        Juniper Networks
                                                             J. Tantsura
                                                        October 15, 2018
                                                          March 24, 2019

 A YANG Data Model for Path Computation Element Communications Protocol
                                 (PCEP)
                      draft-ietf-pce-pcep-yang-09
                      draft-ietf-pce-pcep-yang-10

Abstract

   This document defines a YANG data model for the management of Path
   Computation Element communications Protocol (PCEP) for communications
   between a Path Computation Client (PCC) and a Path Computation
   Element (PCE), or between two PCEs.  The data model includes
   configuration data and state data (status information and counters
   for the collection of statistics). data.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on April 18, September 25, 2019.

Copyright Notice

   Copyright (c) 2018 2019 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Requirements Language . . . . . . . . . . . . . . . . . . . .   3
   3.  Terminology and Notation  . . . . . . . . . . . . . . . . . .   3
     3.1.  Tree Diagrams . . . . . . . . . . . . . . . . . . . . . .   4
     3.2.  Prefixes in Data Node Names . . . . . . . . . . . . . . .   4   5
     3.3.  Refrences in the Model  . . . . . . . . . . . . . . . . .   5
   4.  Objectives  . . . . . . . . . . . . . . . . . . . . . . . . .   5   7
   5.  The Design of PCEP Data Model . . . . . . . . . . . . . . . .   6   8
     5.1.  The Overview of PCEP Data Model . . . . . . . . . . . . .   6   8
     5.2.  The Full PCEP Data Model Entity  . . . . . . . . . . . . . . . .   7
     5.3.  The Entity . . . . . . .   9
     5.3.  The Peer Lists  . . . . . . . . . . . . . . . .  22
     5.4.  The Peer Lists . . . . .   9
     5.4.  The Session Lists . . . . . . . . . . . . . . . .  22
     5.5.  The Session Lists . . . .  10
     5.5.  Notifications . . . . . . . . . . . . . . . .  23
     5.6.  Notifications . . . . . .  10
     5.6.  RPC . . . . . . . . . . . . . . . .  23
     5.7.  RPC . . . . . . . . . . .  10
     5.7.  The Full PCEP Data Model  . . . . . . . . . . . . . . . .  23  11
   6.  The Design of PCEP Statistics Data Model  . . . . . . . . . .  23  17
   7.  Advanced PCE Features . . . . . . . . . . . . . . . . . . . .  28  20
     7.1.  Stateful PCE's LSP-DB . . . . . . . . . . . . . . . . . .  28  20
   8.  Open Issues and Next Step . . . . . . . . . . . . . . . . . .  28  21
     8.1.  The PCE-Initiated LSP . . . . . . . . . . . . . . . . . .  29  21
   9.  Other Considerations  . . . . . . . . . . . . . . . . . . . .  29  21
     9.1.  PCEP over TLS (PCEPS) . . . . . . . . . . . . . . . . . .  29  21
   10. PCEP YANG Modules . . . . . . . . . . . . . . . . . . . . . .  29  21
     10.1.  ietf-pcep module . . . . . . . . . . . . . . . . . . . .  29  21
     10.2.  ietf-pcep-stats module . . . . . . . . . . . . . . . . .  86  78
   11. Security Considerations . . . . . . . . . . . . . . . . . . . 106  98
   12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 107  99
   13. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . 107  99
   14. References  . . . . . . . . . . . . . . . . . . . . . . . . . 108  99
     14.1.  Normative References . . . . . . . . . . . . . . . . . . 108  99
     14.2.  Informative References . . . . . . . . . . . . . . . . . 110 103
   Appendix A.  Example  . . . . . . . . . . . . . . . . . . . . . . 111 104
   Appendix B.  Contributor Addresses  . . . . . . . . . . . . . . . 114 107
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . . 115 108

1.  Introduction

   The Path Computation Element (PCE) defined in [RFC4655] is an entity
   that is capable of computing a network path or route based on a
   network graph, and applying computational constraints.  A Path
   Computation Client (PCC) may make requests to a PCE for paths to be
   computed.

   PCEP is the communication protocol between a PCC and PCE and is
   defined in [RFC5440].  PCEP interactions include path computation
   requests and path computation replies as well as notifications of
   specific states related to the use of a PCE in the context of
   Multiprotocol Label Switching (MPLS) and Generalized MPLS (GMPLS)
   Traffic Engineering (TE).  [RFC8231] specifies extensions to PCEP to
   enable stateful control of MPLS TE LSPs.

   This document defines a YANG [RFC7950] data model for the management
   of PCEP speakers.  It is important to establish a common data model
   for how PCEP speakers are identified, configured, and monitored.  The
   data model includes configuration data and state data (status
   information and counters for the collection of statistics). data.

   This document contains a specification of the PCEP YANG module,
   "ietf-pcep" which provides the PCEP [RFC5440] data model.

   The PCEP operational state is included in the same tree as the PCEP
   configuration consistent with Network Management Datastore
   Architecture [RFC8342].  The origin of the data is indicated as per
   the origin metadata annotation.

2.  Requirements Language

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in BCP
   14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

3.  Terminology and Notation

   This document uses the terminology defined in [RFC4655] and
   [RFC5440].  In particular, it uses the following acronyms.

   o  Path Computation Request message (PCReq).

   o  Path Computation Reply message (PCRep).

   o  Notification message (PCNtf).

   o  Error message (PCErr).

   o  Request Parameters object (RP).

   o  Synchronization Vector object (SVEC).

   o  Explicit Route object (ERO).

   This document also uses the following terms defined in [RFC7420]:

   o  PCEP entity: a local PCEP speaker.

   o  PCEP peer: to refer to a remote PCEP speaker.

   o  PCEP speaker: where it is not necessary to distinguish between
      local and remote.

   Further, this document also uses the following terms defined in
   [RFC8231] :

   o  Stateful PCE, Passive Stateful PCE, Active Stateful PCE

   o  Delegation, Revocation, Redelegation

   o  LSP State Report, Path Computation Report message (PCRpt).

   o  LSP State Update, Path Computation Update message (PCUpd).

   [RFC8281] :

   o  PCE-initiated LSP, Path Computation LSP Initiate Message
      (PCInitiate).

   [RFC8408] :

   o  Path Setup Type (PST).

   [I-D.ietf-pce-segment-routing] :

   o  Segment Routing (SR).

   [RFC6241] :

   o  Configuration data.

   o  State data.

3.1.  Tree Diagrams

   A simplified graphical representation of the data model is used in
   this document.  The meaning of the symbols in these diagrams is
   defined in [RFC8340].

3.2.  Prefixes in Data Node Names

   In this document, names of data nodes and other data model objects
   are often used without a prefix, as long as it is clear from the
   context in which YANG module each name is defined.  Otherwise, names
   are prefixed using the standard prefix associated with the
   corresponding YANG module, as shown in Table 1.

   +-----------+-----------------+-------------------------------------+
   | Prefix    | YANG module     | Reference                           |
   +-----------+-----------------+-------------------------------------+
   | yang      | ietf-yang-types | [RFC6991]                           |
   | inet      | ietf-inet-types | [RFC6991]                           |
   | te        | ietf-te         | [I-D.ietf-teas-yang-te]             |
   | te-types  | ietf-te-types   | [I-D.ietf-teas-yang-te]             |
   | key-chain | ietf-key-chain  | [RFC8177]                           |
   | nacm      | ietf-netconf-   | [RFC8341]                           |
   |           | acm             |                                     |
   | tls-      | ietf-tls-server | [I-D.ietf-netconf-tls-client-server |
   | server    |                 | ]                                   |
   | tls-      | ietf-tls-client | [I-D.ietf-netconf-tls-client-server |
   | client    |                 | ]                                   |
   | ospf      | ietf-ospf       | [I-D.ietf-ospf-yang]                |
   | isis      | ietf-isis       | [I-D.ietf-isis-yang-isis-cfg]       |
   +-----------+-----------------+-------------------------------------+

             Table 1: Prefixes and corresponding YANG modules

4.  Objectives

   This section describes some of the design objectives for

3.3.  Refrences in the model:

   o  In case of existing implementations, it needs to map Model

   Following documents are refrenced in the data model defined in this
   document -

   +----------------------------+--------------------------------------+
   | Documents                  | Reference                            |
   +----------------------------+--------------------------------------+
   | RSVP-TE: Extensions to their proprietary native data
      model.  To facilitate such mappings, the data model should be
      simple.

   o  The data model should be suitable     | [RFC3209]                            |
   | RSVP for new implementations to use
      as is.

   o  Mapping to the PCEP MIB Module should be clear.

   o  The data model should allow LSP Tunnels       |                                      |
   | OSPF Protocol Extensions   | [RFC5088]                            |
   | for static configurations of peers.

   o  The data model should include read-only counters in order to
      gather statistics Path Computation       |                                      |
   | Element (PCE) Discovery    |                                      |
   | IS-IS Protocol Extensions  | [RFC5089]                            |
   | for sent and received PCEP messages, received
      messages with errors, and messages that could not be sent due to
      errors.  This could be Path Computation       |                                      |
   | Element (PCE) Discovery    |                                      |
   | Path Computation Element   | [RFC5440]                            |
   | (PCE) Communication        |                                      |
   | Protocol (PCEP)            |                                      |
   | Preserving Topology        | [RFC5520]                            |
   | Confidentiality in Inter-  |                                      |
   | Domain Path Computation    |                                      |
   | Using a separate model which augments the base
      data model.

   o  It should be fairly straightforward to augment the base data model
      for advanced PCE features.

5.  The Design of PCEP Data Model

5.1.  The Overview Path-Key-Based     |                                      |
   | Mechanism                  |                                      |
   | Encoding of PCEP Data Model

   The PCEP YANG module defined Objective      | [RFC5541]                            |
   | Functions in this document has all the common
   building blocks for the PCEP protocol.

   module: ietf-pcep
       +--rw pcep!
          +--rw entity
             +--rw addr                          inet:ip-address
             +--rw enabled?                      boolean
             +--rw role                          pcep-role
             +--rw description?                  string
             +--rw speaker-entity-id?            string Path      |       {stateful-sync-opt}?
             +--rw admin-status?                 pcep-admin-status
             +--ro index?                        uint32
             +--ro oper-status?                  pcep-oper-status
             +--rw domain                                      |  +--rw domain* [domain-type domain]
   |        ...
             +--rw capability Computation Element        |        ...
             +--rw pce-info                                      |  +--rw scope
   | Communication Protocol     |     ...                                      |  +--rw neigh-domains
   | (PCEP)                     |     ...                                      |  +--rw path-key {path-key}?
   |        ...

             +--ro lsp-db {stateful}? Path Computation Element   |  +--ro db-ver?             uint64 [RFC5557]                            |
   |       {stateful-sync-opt}? Communication Protocol     |  +--ro association-list*                                      |
   |       [id source global-source extended-id] (PCEP) Requirements and    |                                      |     ...
   |  +--ro lsp* [plsp-id pcc-id] Protocol Extensions in     |        ...
             +--ro path-keys {path-key}?                                      |  +--ro path-keys* [path-key]
   |        ...
             +--rw peers
                +--rw peer* [addr]

                   +--ro sessions
                      +--ro session* [initiator]
                         ...

     rpcs:
       +---x trigger-resync {stateful,stateful-sync-opt}?
          +---w input
             +---w pcc?   -> /pcep/entity/peers/peer/addr

     notifications:
       +---n pcep-session-up Support of Global          |  ...
       +---n pcep-session-down                                      |  ...
       +---n pcep-session-local-overload
   |  ...
       +---n pcep-session-local-overload-clear Concurrent Optimization    |  ...
       +---n pcep-session-peer-overload                                      |  ...
       +---n pcep-session-peer-overload-clear
          ...

5.2.  The Full PCEP Data
   | Common YANG Data Types     | [RFC6991]                            |
   | YANG Data Model

   The module, "ietf-pcep", defines the basic components of a PCE
   speaker.

module: ietf-pcep
    +--rw pcep!
       +--rw entity
          +--rw addr                          inet:ip-address
          +--rw enabled?                      boolean
          +--rw role                          pcep-role
          +--rw description?                  string
          +--rw speaker-entity-id?            string for Key    |       {stateful-sync-opt}?
          +--rw admin-status?                 pcep-admin-status
          +--ro index?                        uint32
          +--ro oper-status?                  pcep-oper-status
          +--rw domain [RFC8177]                            |  +--rw domain* [domain-type domain]
   |     +--rw domain-type    domain-type Chains                     |     +--rw domain         domain
          +--rw capability                                      |  +--rw gmpls?                 boolean {gmpls}?
   |  +--rw bi-dir?                boolean Path Computation Element   |  +--rw diverse?               boolean [RFC8231]                            |  +--rw load-balance?          boolean
   |  +--rw synchronize?           boolean {svec}? Communication Protocol     |  +--rw objective-function?    boolean {objective-function}?                                      |  +--rw add-path-constraint?   boolean
   |  +--rw prioritization?        boolean (PCEP) Extensions for      |  +--rw multi-request?         boolean                                      |  +--rw gco?                   boolean {gco}?
   |  +--rw p2mp?                  boolean {p2mp}? Stateful PCE               |  +--rw stateful {stateful}?                                      |
   |  +--rw enabled?                boolean Optimizations of Label     | [RFC8232]                            |  +--rw active?                 boolean
   | Switched Path State        |  +--rw pce-initiated?          boolean {pce-initiated}?                                      |
   |  +--rw include-db-ver?         boolean Synchronization Procedures |                                      |
   |       {stateful-sync-opt}? for a Stateful PCE         |                                      |  +--rw trigger-resync?         boolean
   | PCEPS: Usage of TLS to     | [RFC8253]                            |       {stateful-sync-opt}?
   | Provide a Secure Transport |  +--rw trigger-initial-sync?   boolean                                      |
   | for the Path Computation   |       {stateful-sync-opt}?                                      |
   |  +--rw incremental-sync?       boolean Element Communication      |                                      |          {stateful-sync-opt}?
   |  +--rw sr {sr}? Protocol (PCEP)            |     +--rw enabled?     boolean                                      |     +--rw msd?         uint8
   |     +--rw msd-limit?   boolean Path Computation Element   |     +--rw nai?         boolean
          +--rw pce-info [RFC8281]                            |  +--rw scope
   | Communication Protocol     |  +--rw intra-area-scope?           boolean                                      |
   |  +--rw intra-area-pref?            uint8 (PCEP) Extensions for PCE- |                                      |  +--rw inter-area-scope?           boolean
   | Initiated LSP Setup in a   |  +--rw inter-area-scope-default?   boolean                                      |
   |  +--rw inter-area-pref?            uint8 Stateful PCE Model         |                                      |  +--rw inter-as-scope?             boolean
   | Extensions to the Path     |  +--rw inter-as-scope-default?     boolean [RFC8306]                            |
   |  +--rw inter-as-pref?              uint8 Computation Element        |                                      |  +--rw inter-layer-scope?          boolean
   | Communication Protocol     |  +--rw inter-layer-pref?           uint8                                      |  +--rw neigh-domains
   | (PCEP) for Point-to-       |  +--rw domain* [domain-type domain]                                      |
   |     +--rw domain-type    domain-type Multipoint Traffic         |                                      |     +--rw domain         domain
   |  +--rw path-key {path-key}? Engineering Label Switched |     +--rw enabled?         boolean                                      |     +--rw discard-timer?   uint32
   |     +--rw reuse-time?      uint32 Paths                      |     +--rw pce-id?          inet:ip-address
          +--rw connect-timer?                uint32
          +--rw connect-max-retry?            uint32
          +--rw init-backoff-timer?           uint32
          +--rw max-backoff-timer?            uint32
          +--rw open-wait-timer?              uint32
          +--rw keep-wait-timer?              uint32
          +--rw keep-alive-timer?             uint32
          +--rw dead-timer?                   uint32
          +--rw allow-negotiation?            boolean
          +--rw max-keep-alive-timer?         uint32
          +--rw max-dead-timer?               uint32
          +--rw min-keep-alive-timer?         uint32
          +--rw min-dead-timer?               uint32
          +--rw sync-timer?                   uint32 {svec}?
          +--rw request-timer?                uint32
          +--rw max-sessions?                 uint32
          +--rw max-unknown-reqs?             uint32
          +--rw max-unknown-msgs?             uint32
          +--rw pcep-notification-max-rate    uint32
          +--rw stateful-parameter {stateful}?
          |  +--rw state-timeout?          uint32
          |  +--rw redelegation-timeout?   uint32
          |  +--rw rpt-non-pcep-lsp?       boolean
          +--rw of-list {objective-function}?
          |  +--rw objective-function* [of]
          |     +--rw of    identityref
          +--ro lsp-db {stateful}?                                      |  +--ro db-ver?             uint64 {stateful-sync-opt}?
   |  +--ro association-list* Network Configuration      | [RFC8341]                            |       [type id source global-source extended-id]
   | Access Control Model       |       {association}?                                      |
   |  +--ro type             identityref Conveying Path Setup Type  | [RFC8408]                            |  +--ro id               uint16
   | in PCE Communication       |  +--ro source           inet:ip-address                                      |
   |  +--ro global-source    uint32 Protocol (PCEP) Messages   |                                      |  +--ro extended-id      string
   | Traffic Engineering Common |  +--ro lsp* [plsp-id pcc-id] [I-D.ietf-teas-yang-te-types]        |
   |     +--ro plsp-id    -> /pcep/entity/lsp-db/lsp/plsp-id YANG Types                 |                                      |     +--ro pcc-id     -> /pcep/entity/lsp-db/lsp/pcc-id
   |  +--ro lsp* [plsp-id pcc-id] A YANG Data Model for      |     +--ro plsp-id               uint32 [I-D.ietf-teas-yang-te]              |     +--ro pcc-id                inet:ip-address
   |     +--ro lsp-ref Traffic Engineering        |                                      |  +--ro source?
   | Tunnels and Interfaces     |                                      |       -> /te:te/lsps-state/lsp/source
   | YANG Groupings for TLS     |  +--ro destination? [I-D.ietf-netconf-tls-client-server] |
   | Clients and TLS Servers    |       -> /te:te/lsps-state/lsp/destination                                      |
   |  +--ro tunnel-id? PCEP Extensions for        | [I-D.ietf-pce-segment-routing]       |
   |       -> /te:te/lsps-state/lsp/tunnel-id Segment Routing            |                                      |  +--ro lsp-id?
   | PCEP Extensions for        | [I-D.ietf-pce-association-group]     |       -> /te:te/lsps-state/lsp/lsp-id
   | Establishing Relationships |  +--ro extended-tunnel-id?                                      |
   |          -> /te:te/lsps-state/lsp/extended-tunnel-id Between Sets of LSPs       |     +--ro admin-state?          boolean                                      |     +--ro operational-state?    operational-state
   |     +--ro delegated YANG Data Model for OSPF   | [I-D.ietf-ospf-yang]                 |  +--ro enabled?   boolean
   | Protocol                   |  +--ro peer?      -> /pcep/entity/peers/peer/addr                                      |
   |  +--ro srp-id?    uint32 YANG Data Model for IS-IS  |     +--ro initiation {pce-initiated}? [I-D.ietf-isis-yang-isis-cfg]        |
   |  +--ro enabled?   boolean Protocol                   |                                      |  +--ro peer?      -> /pcep/entity/peers/peer/addr
   |     +--ro symbolic-path-name?   string PCEP extensions for GMPLS  |     +--ro last-error?           identityref [I-D.ietf-pce-gmpls-pcep-extensions] |     +--ro pst?                  identityref
   +----------------------------+--------------------------------------+

                  Table 2: Refrences in the YANG modules

4.  Objectives

   This section describes some of the design objectives for the model:

   o  In case of existing implementations, it needs to map the data
      model defined in this document to their proprietary native data
      model.  To facilitate such mappings, the data model should be
      simple.

   o  The data model should be suitable for new implementations to use
      as is.

   o  Mapping to the PCEP MIB Module should be clear.

   o  The data model should allow for static configurations of peers.

   o  The data model should include read-only counters in order to
      gather statistics for sent and received PCEP messages, received
      messages with errors, and messages that could not be sent due to
      errors.  This could be in a separate model which augments the base
      data model.

   o  It should be fairly straightforward to augment the base data model
      for advanced PCE features.

5.  The Design of PCEP Data Model

5.1.  The Overview of PCEP Data Model

   The PCEP YANG module defined in this document has all the common
   building blocks for the PCEP protocol.

   module: ietf-pcep
       +--rw pcep!
          +--rw entity
             +--rw addr                          inet:ip-address
             +--rw enabled?                      boolean
             +--rw role                          pcep-role
             +--rw description?                  string
             +--rw speaker-entity-id?            string
             |       {stateful-sync-opt}?
             +--rw admin-status?                 pcep-admin-status
             +--ro association-list*
          |             [type id source global-source extended-id] index?                        uint32
             +--ro oper-status?                  pcep-oper-status
             +--rw domain
             |             {association}?  +--rw domain* [domain-type domain]
             |        +--ro type        ...
             +--rw capability

             |        ...
             +--rw pce-info
             |       -> /pcep/entity/lsp-db/association-list/type  +--rw scope
             |        +--ro id  |     ...
             |       -> /pcep/entity/lsp-db/association-list/id  +--rw neigh-domains
             |        +--ro source  |     ...
             |       -> /pcep/entity/lsp-db/association-list/source  +--rw path-key {path-key}?
             |        ...

             +--ro global-source    leafref lsp-db {stateful}?
             |  +--ro extended-id      leafref
          +--ro path-keys {path-key}?
          |  +--ro path-keys* [path-key]
          |     +--ro path-key         uint16
          |     +--ro cps
          |     |  +--ro explicit-route-objects* [index]
          |     |     +--ro index            uint32
          |     |     +--ro (type)?
          |     |        +--:(num-unnum-hop)
          |     |        |  +--ro num-unnum-hop
          |     |        |     +--ro node-id?      te-types:te-node-id
          |     |        |     +--ro link-tp-id?   te-types:te-tp-id
          |     |        |     +--ro hop-type?     te-hop-type
          |     |        |     +--ro direction?    te-link-direction
          |     |        +--:(as-number)
          |     |        |  +--ro as-number-hop
          |     |        |     +--ro as-number?   binary
          |     |        |     +--ro hop-type?    te-hop-type
          |     |        +--:(label)
          |     |           +--ro label-hop
          |     |              +--ro te-label
          |     |                 +--ro (technology)?
          |     |                 |  +--:(generic) db-ver?             uint64
             |  |       {stateful-sync-opt}?
             |  +--ro generic?
          |     |                 |             rt-types:generalized-label
          | association-list*
             |                 +--ro direction?   te-label-direction  |     +--ro pcc-original?    -> /pcep/entity/peers/peer/addr       [id source global-source extended-id]
             |     +--ro req-id?          uint32  |     +--ro retrieved?       boolean     ...
             |  +--ro pcc-retrieved?   -> /pcep/entity/peers/peer/addr lsp* [plsp-id pcc-id]
             |        ...
             +--ro creation-time?   yang:timestamp path-keys {path-key}?
             |  +--ro discard-time?    uint32 path-keys* [path-key]
             |     +--ro reuse-time?      uint32        ...
             +--rw peers
                +--rw peer* [addr]
                +--rw addr                    inet:ip-address
                +--rw role                    pcep-role
                +--rw description?            string
                +--rw domain
                |  +--rw domain* [domain-type domain]
                |     +--rw domain-type    domain-type
                |     +--rw domain         domain
                +--rw capability
                |  +--rw gmpls?                 boolean {gmpls}?
                |  +--rw bi-dir?                boolean
                |  +--rw diverse?               boolean
                |  +--rw load-balance?          boolean
                |  +--rw synchronize?           boolean {svec}?
                |  +--rw objective-function?    boolean
                |  |       {objective-function}?
                |  +--rw add-path-constraint?   boolean
                |  +--rw prioritization?        boolean
                |  +--rw multi-request?         boolean
                |  +--rw gco?                   boolean {gco}?
                |  +--rw p2mp?                  boolean {p2mp}?
                |  +--rw stateful {stateful}?
                |  |  +--rw enabled?                boolean
                |  |  +--rw active?                 boolean
                |  |  +--rw pce-initiated?          boolean
                |  |  |       {pce-initiated}?

                   +--ro sessions
                      +--ro session* [initiator]
                         ...

     rpcs:
       +---x trigger-resync {stateful,stateful-sync-opt}?
          +---w input
             +---w pcc?   -> /pcep/entity/peers/peer/addr

     notifications:
       +---n pcep-session-up
       |  ...
       +---n pcep-session-down
       |  +--rw include-db-ver?         boolean
                |  |  |       {stateful-sync-opt}?
                |  |  +--rw trigger-resync?         boolean
                |  |  |       {stateful-sync-opt}?
                |  |  +--rw trigger-initial-sync?   boolean
                |  |  |       {stateful-sync-opt}?
                |  |  +--rw incremental-sync?       boolean
                |  |          {stateful-sync-opt}?
                |  +--rw sr {sr}?
                |     +--rw enabled?     boolean
                |     +--rw msd?         uint8
                |     +--rw msd-limit?   boolean
                |     +--rw nai?         boolean
                +--rw pce-info
                |  +--rw scope
                |  |  +--rw intra-area-scope?           boolean
                |  |  +--rw intra-area-pref?            uint8
                |  |  +--rw inter-area-scope?           boolean
                |  |  +--rw inter-area-scope-default?   boolean
                |  |  +--rw inter-area-pref?            uint8
                |  |  +--rw inter-as-scope?             boolean
                |  |  +--rw inter-as-scope-default?     boolean
                |  |  +--rw inter-as-pref?              uint8
                |  |  +--rw inter-layer-scope?          boolean
                |  |  +--rw inter-layer-pref?           uint8
                |  +--rw neigh-domains
                |     +--rw domain* [domain-type domain]
                |        +--rw domain-type    domain-type
                |        +--rw domain         domain
                +--rw delegation-pref?        uint8 {stateful}?
                +--rw auth
                |  +--rw (auth-type-selection)?
                |     +--:(auth-key-chain)
                |     |  +--rw key-chain?          key-chain:key-chain-ref
                |     +--:(auth-key)
                |     |  +--rw crypto-algorithm    identityref
                |     |  +--rw key?                string
                |     +--:(auth-tls) {tls}?
                |        +--rw (role)?
                |           +--:(server)
                |           |  +--rw tls-server
                |           |     +--rw server-identity
                |           |     |  +--rw (local-or-keystore)
                |           |     |     +--:(local)
                |           |     |     |  +--rw algorithm
                |           |     |     |  |       ct:key-algorithm-ref
                |           |     |     |  +--rw public-key
                |           |     |     |  |       binary
                |           |     |     |  +--rw private-key
                |           |     |     |  |       union
                |           |     |     |  +--rw cert
                |           |     |     |  |       ct:end-entity-cert-cms
                |  ...
       +---n pcep-session-local-overload
       |  ...
       +---n pcep-session-local-overload-clear
       |  ...
       +---n pcep-session-peer-overload
       |  ...
       +---n certificate-expiration
                |           |     |     |     +---- expiration-date?
                |           |     |     |             yang:date-and-time
                |           |     |     +--:(keystore)
                |           |     |              {keystore-implemented}?
                |           |     |        +--rw reference
                |           |     |                ks:asymmetric-key-certificate-ref
                |           |     +--rw client-auth
                |           |     |  +--rw pinned-ca-certs?
                |           |     |  |       ta:pinned-certificates-ref
                |           |     |  +--rw pinned-client-certs?
                |           |     |          ta:pinned-certificates-ref
                |           |     +--rw hello-params
                |           |             {tls-server-hello-params-config}?
                |           |        +--rw tls-versions
                |           |        |  +--rw tls-version*   identityref
                |           |        +--rw cipher-suites
                |           |           +--rw cipher-suite*   identityref
                |           +--:(client)
                |              +--rw tls-client
                |                 +--rw client-identity
                |                 |  +--rw (auth-type)?
                |                 |     +--:(certificate)
                |                 |        +--rw certificate
                |                 |           +--rw (local-or-keystore)
                |                 |              +--:(local)
                |                 |              |  +--rw algorithm
                |                 |              |  |       ct:key-algorithm-ref
                |                 |              |  +--rw public-key
                |                 |              |  |       binary
                |                 |              |  +--rw private-key
                |                 |              |  |       union
                |                 |              |  +--rw cert
                |                 |              |  |       ct:end-entity-cert-cms
                |                 |              |  +---n certificate-expiration
                |                 |              |     +---- expiration-date?
                |                 |              |             yang:date-and-time
                |                 |              +--:(keystore)
                |                 |                       {keystore-implemented}?
                |                 |                 +--rw reference
                |                 |                         ks:asymmetric-key-certificate-ref
                |                 +--rw server-auth
                |                 |  +--rw pinned-ca-certs?
                |                 |  |       ta:pinned-certificates-ref
                |                 |  +--rw pinned-server-certs?
                |                 |          ta:pinned-certificates-ref
                |                 +--rw hello-params
                |                         {tls-client-hello-params-config}?
                |                    +--rw tls-versions
                |                    |  +--rw tls-version*   identityref
                |                    +--rw cipher-suites
                |                       +--rw cipher-suite*   identityref
                +--ro discontinuity-time?     yang:timestamp
                +--ro initiate-session?       boolean
                +--ro session-exists?         boolean
                +--ro session-up-time?        yang:timestamp
                +--ro session-fail-time?      yang:timestamp
                +--ro session-fail-up-time?   yang:timestamp
                +--ro sessions
                   +--ro session* [initiator]
                      +--ro initiator               pcep-initiator
                      +--ro role?                   -> /pcep/entity/role
                      +--ro state-last-change?      yang:timestamp
                      +--ro state?                  pcep-sess-state
                      +--ro session-creation?       yang:timestamp
                      +--ro connect-retry?          yang:counter32
                      +--ro local-id?               uint32
                      +--ro remote-id?              uint32
                      +--ro keepalive-timer?        uint32
                      +--ro peer-keepalive-timer?   uint32
                      +--ro dead-timer?             uint32
                      +--ro peer-dead-timer?        uint32
                      +--ro ka-hold-time-rem?       uint32
                      +--ro overloaded?             boolean
                      +--ro overload-time?          uint32
                      +--ro peer-overloaded?        boolean
                      +--ro peer-overload-time?     uint32
                      +--ro lspdb-sync?             sync-state
                      |       {stateful}?
                      +--ro recv-db-ver?            uint64
                      |       {stateful,stateful-sync-opt}?
                      +--ro of-list {objective-function}?
                      |  +--ro objective-function* [of]
                      |     +--ro of    identityref
                      +--ro pst-list
                      |  +--ro path-setup-type* [pst]
                      |     +--ro pst    identityref
                      +--ro assoc-type-list {association}?
                      |  +--ro assoc-type* [at]
                      |     +--ro at    identityref
                      +--ro speaker-entity-id?      string
                      |       {stateful-sync-opt}?
                      +--ro discontinuity-time?     yang:timestamp

  rpcs:
    +---x trigger-resync {stateful,stateful-sync-opt}?
       +---w input
          +---w pcc?   -> /pcep/entity/peers/peer/addr

  notifications:
    +---n pcep-session-up
    |  +--ro peer-addr?           -> /pcep/entity/peers/peer/addr
    |  +--ro session-initiator?
    |  |       -> /pcep/entity/peers/peer/sessions/session/initiator
    |  +--ro state-last-change?   yang:timestamp
    |  +--ro state?               pcep-sess-state
    +---n pcep-session-down
    |  +--ro peer-addr?           -> /pcep/entity/peers/peer/addr
    |  +--ro session-initiator?   pcep-initiator
    |  +--ro state-last-change?   yang:timestamp
    |  +--ro state?               pcep-sess-state
    +---n pcep-session-local-overload
    |  +--ro peer-addr?           -> /pcep/entity/peers/peer/addr
    |  +--ro session-initiator?
    |  |       -> /pcep/entity/peers/peer/sessions/session/initiator
    |  +--ro overloaded?          boolean
    |  +--ro overload-time?       uint32
    +---n pcep-session-local-overload-clear
    |  +--ro peer-addr?    -> /pcep/entity/peers/peer/addr
    |  +--ro overloaded?   boolean
    +---n pcep-session-peer-overload
    |  +--ro peer-addr?            -> /pcep/entity/peers/peer/addr
    |  +--ro session-initiator?
    |  |       -> /pcep/entity/peers/peer/sessions/session/initiator
    |  +--ro peer-overloaded?      boolean
    |  +--ro peer-overload-time?   uint32
    +---n pcep-session-peer-overload-clear
       +--ro peer-addr?         -> /pcep/entity/peers/peer/addr
       +--ro peer-overloaded?   boolean
  groupings:
  info
      +---- domain
      |  +---- domain* [domain-type domain]
      |     +---- domain-type?   domain-type
      |     +---- domain?        domain
      +---- capability
         +---- gmpls?                 boolean {gmpls}?
         +---- bi-dir?                boolean
         +---- diverse?               boolean
         +---- load-balance?          boolean
         +---- synchronize?           boolean {svec}?
         +---- objective-function?    boolean {objective-function}?
         +---- add-path-constraint?   boolean
         +---- prioritization?        boolean
         +---- multi-request?         boolean
         +---- gco?                   boolean {gco}?
         +---- p2mp?                  boolean {p2mp}?
         +---- stateful {stateful}?
         |  +---- enabled?                boolean
         |  +---- active?                 boolean
         |  +---- pce-initiated?          boolean {pce-initiated}?
         |  +---- include-db-ver?         boolean {stateful-sync-opt}?
         |  +---- trigger-resync?         boolean {stateful-sync-opt}?
         |  +---- trigger-initial-sync?   boolean {stateful-sync-opt}?
         |  +---- incremental-sync?       boolean {stateful-sync-opt}?
         +---- sr {sr}?
            +---- enabled?     boolean
            +---- msd?         uint8
            +---- msd-limit?   boolean
            +---- nai?         boolean

  lsp-state
      +---- plsp-id?              uint32
      +---- pcc-id?               inet:ip-address
      +---- lsp-ref
      |  +---- source?               -> /te:te/lsps-state/lsp/source
      |  +---- destination?          -> /te:te/lsps-state/lsp/destination
      |  +---- tunnel-id?            -> /te:te/lsps-state/lsp/tunnel-id
      |  +---- lsp-id?               -> /te:te/lsps-state/lsp/lsp-id
      |  +---- extended-tunnel-id?
      |          -> /te:te/lsps-state/lsp/extended-tunnel-id
      +---- admin-state?          boolean
      +---- operational-state?    operational-state
      +---- delegated
      |  +---- enabled?   boolean
      |  +---- peer?      -> /pcep/entity/peers/peer/addr
      |  +---- srp-id?    uint32
      +---- initiation {pce-initiated}?
      |  +---- enabled?   boolean
      |  +---- peer?      -> /pcep/entity/peers/peer/addr
      +---- symbolic-path-name?   string
      +---- last-error?           identityref
      +---- pst?                  identityref

  pce-scope
      +---- intra-area-scope?           boolean
      +---- intra-area-pref?            uint8
      +---- inter-area-scope?           boolean
      +---- inter-area-scope-default?   boolean
      +---- inter-area-pref?            uint8
      +---- inter-as-scope?             boolean
      +---- inter-as-scope-default?     boolean
      +---- inter-as-pref?              uint8
      +---- inter-layer-scope?          boolean
      +---- inter-layer-pref?           uint8

  of-list
      +---- objective-function* [of]
         +---- of?   identityref

  pst-list
      +---- path-setup-type* [pst]
         +---- pst?   identityref

  session-grouping
      +--ro sessions
         +--ro session* [initiator]
            +--ro initiator?              pcep-initiator
            +--ro role?                   -> /pcep/entity/role
            +--ro state-last-change?      yang:timestamp
            +--ro state?                  pcep-sess-state
            +--ro session-creation?       yang:timestamp
            +--ro connect-retry?          yang:counter32
            +--ro local-id?               uint32
            +--ro remote-id?              uint32
            +--ro keepalive-timer?        uint32
            +--ro peer-keepalive-timer?   uint32
            +--ro dead-timer?             uint32
            +--ro peer-dead-timer?        uint32
            +--ro ka-hold-time-rem?       uint32
            +--ro overloaded?             boolean
            +--ro overload-time?          uint32
            +--ro peer-overloaded?        boolean
            +--ro peer-overload-time?     uint32
            +--ro lspdb-sync?             sync-state {stateful}?
            +--ro recv-db-ver?            uint64
            |       {stateful,stateful-sync-opt}?
            +--ro of-list {objective-function}?
            |  +--ro objective-function* [of]
            |     +--ro of?   identityref
            +--ro pst-list
            |  +--ro path-setup-type* [pst]
            |     +--ro pst?   identityref
            +--ro assoc-type-list {association}?
            |  +--ro assoc-type* [at]
            |     +--ro at?   identityref
            +--ro speaker-entity-id?      string {stateful-sync-opt}?
            +--ro discontinuity-time?     yang:timestamp

  pcep-entity-info
      +---- connect-timer?          uint32
      +---- connect-max-retry?      uint32
      +---- init-backoff-timer?     uint32
      +---- max-backoff-timer?      uint32
      +---- open-wait-timer?        uint32
      +---- keep-wait-timer?        uint32
      +---- keep-alive-timer?       uint32
      +---- dead-timer?             uint32
      +---- allow-negotiation?      boolean
      +---- max-keep-alive-timer?   uint32
      +---- max-dead-timer?         uint32
      +---- min-keep-alive-timer?   uint32
      +---- min-dead-timer?         uint32
      +---- sync-timer?             uint32 {svec}?
      +---- request-timer?          uint32
      +---- max-sessions?           uint32
      +---- max-unknown-reqs?       uint32
      +---- max-unknown-msgs?       uint32

  path-key
      +---- enabled?         boolean
      +---- discard-timer?   uint32
      +---- reuse-time?      uint32
      +---- pce-id?          inet:ip-address

  capability
      +---- gmpls?                 boolean {gmpls}?
      +---- bi-dir?                boolean
      +---- diverse?               boolean
      +---- load-balance?          boolean
      +---- synchronize?           boolean {svec}?
      +---- objective-function?    boolean {objective-function}?
      +---- add-path-constraint?   boolean
      +---- prioritization?        boolean
      +---- multi-request?         boolean
      +---- gco?                   boolean {gco}?
      +---- p2mp?                  boolean {p2mp}?
      +---- stateful {stateful}?
      |  +---- enabled?                boolean
      |  +---- active?                 boolean
      |  +---- pce-initiated?          boolean {pce-initiated}?
      |  +---- include-db-ver?         boolean {stateful-sync-opt}?
      |  +---- trigger-resync?         boolean {stateful-sync-opt}?
      |  +---- trigger-initial-sync?   boolean {stateful-sync-opt}?
      |  +---- incremental-sync?       boolean {stateful-sync-opt}?
      +---- sr {sr}?
         +---- enabled?     boolean
         +---- msd?         uint8
         +---- msd-limit?   boolean
         +---- nai?         boolean

  path-key-state
      +---- path-keys* [path-key]
         +---- path-key?        uint16
         +---- cps
         |  +---- explicit-route-objects* [index]
         |     +---- index?           uint32
         |     +---- (type)?
         |        +--:(num-unnum-hop)
         |        |  +---- num-unnum-hop
         |        |     +---- node-id?      te-types:te-node-id
         |        |     +---- link-tp-id?   te-types:te-tp-id
         |        |     +---- hop-type?     te-hop-type
         |        |     +---- direction?    te-link-direction
         |        +--:(as-number)
         |        |  +---- as-number-hop
         |        |     +---- as-number?   binary
         |        |     +---- hop-type?    te-hop-type
         |        +--:(label)
         |           +---- label-hop
         |              +---- te-label
         |                 +---- (technology)?
         |                 |  +--:(generic)
         |                 |     +---- generic?
         |                 |             rt-types:generalized-label
         |                 +---- direction?   te-label-direction
         +---- pcc-original?    -> /pcep/entity/peers/peer/addr
         +---- req-id?          uint32
         +---- retrieved?       boolean
         +---- pcc-retrieved?   -> /pcep/entity/peers/peer/addr
         +---- creation-time?   yang:timestamp
         +---- discard-time?    uint32
         +---- reuse-time?      uint32

  authentication
      +---- auth
         +---- (auth-type-selection)?
            +--:(auth-key-chain)
            |  +---- key-chain?          key-chain:key-chain-ref
            +--:(auth-key)
            |  +---- crypto-algorithm    identityref
            |  +---- key?                string
            +--:(auth-tls) {tls}?
               +---- (role)?
                  +--:(server)
                  |  +---- tls-server
                  |     +---- server-identity
                  |     |  +---- (local-or-keystore)
                  |     |     +--:(local)
                  |     |     |  +---- algorithm
                  |     |     |  |       ct:key-algorithm-ref
                  |     |     |  +---- public-key                binary
                  |     |     |  +---- private-key               union
                  |     |     |  +---- cert
                  |     |     |  |       ct:end-entity-cert-cms
                  |     |     |  +---n certificate-expiration
                  |     |     |     +---- expiration-date?
                  |     |     |             yang:date-and-time
                  |     |     +--:(keystore) {keystore-implemented}?
                  |     |        +---- reference
                  |     |                ks:asymmetric-key-certificate-ref
                  |     +---- client-auth
                  |     |  +---- pinned-ca-certs?
                  |     |  |       ta:pinned-certificates-ref
                  |     |  +---- pinned-client-certs?
                  |     |          ta:pinned-certificates-ref
                  |     +---- hello-params
                  |             {tls-server-hello-params-config}?
                  |        +---- tls-versions
                  |        |  +---- tls-version*   identityref
                  |        +---- cipher-suites
                  |           +---- cipher-suite*   identityref
                  +--:(client)
                     +---- tls-client
                        +---- client-identity
                        |  +---- (auth-type)?
                        |     +--:(certificate)
                        |        +---- certificate
                        |           +---- (local-or-keystore)
                        |              +--:(local)
                        |              |  +---- algorithm
                        |              |  |       ct:key-algorithm-ref
                        |              |  +---- public-key
                        |              |  |       binary
                        |              |  +---- private-key
                        |              |  |       union
                        |              |  +---- cert
                        |              |  |       ct:end-entity-cert-cms
                        |              |  +---n certificate-expiration
                        |              |     +---- expiration-date?
                        |              |             yang:date-and-time
                        |              +--:(keystore)
                        |                       {keystore-implemented}?
                        |                 +---- reference
                        |                         ks:asymmetric-key-certificate-ref
                        +---- server-auth
                        |  +---- pinned-ca-certs?
                        |  |       ta:pinned-certificates-ref
                        |  +---- pinned-server-certs?
                        |          ta:pinned-certificates-ref
                        +---- hello-params
                                {tls-client-hello-params-config}?

                           +---- tls-versions
                           |  +---- tls-version*   identityref
                           +---- cipher-suites
                              +---- cipher-suite*   identityref

  notification-session-hdr
      +---- session-initiator?
              -> /pcep/entity/peers/peer/sessions/session/initiator

  assoc-type-list
      +---- assoc-type* [at]
         +---- at?   identityref

  association
      +---- type?            identityref
      +---- id?              uint16
      +---- source?          inet:ip-address
      +---- global-source?   uint32
      +---- extended-id?     string

  domain
      +---- domain-type?   domain-type
      +---- domain?        domain

  association-ref
      +---- type?            -> /pcep/entity/lsp-db/association-list/type
      +---- id?              -> /pcep/entity/lsp-db/association-list/id
      +---- source?          -> /pcep/entity/lsp-db/association-list/source
      +---- global-source?
      |       -> /pcep/entity/lsp-db/association-list/global-source
      +---- extended-id?
              -> /pcep/entity/lsp-db/association-list/extended-id

  notification-instance-hdr
      +---- peer-addr?   -> /pcep/entity/peers/peer/addr

  pce-info
      +---- scope
      |  +---- intra-area-scope?           boolean
      |  +---- intra-area-pref?            uint8
      |  +---- inter-area-scope?           boolean
      |  +---- inter-area-scope-default?   boolean
      |  +---- inter-area-pref?            uint8
      |  +---- inter-as-scope?             boolean
      |  +---- inter-as-scope-default?     boolean
      |  +---- inter-as-pref?              uint8
      |  +---- inter-layer-scope?          boolean
      |  +---- inter-layer-pref?           uint8
      +---- neigh-domains
         +---- domain* [domain-type domain]
            +---- domain-type?   domain-type
            +---- domain?        domain

  stateful-pce-parameter
      +---- state-timeout?          uint32
      +---- redelegation-timeout?   uint32
      +---- rpt-non-pcep-lsp?       boolean

5.3. pcep-session-peer-overload-clear
          ...

5.2.  The Entity

   The PCEP yang module may contain status information for the local
   PCEP entity.

   The entity has an IP address (using ietf-inet-types [RFC6991]) and a
   "role" leaf (the local entity PCEP role) as mandatory.

   Note that, the PCEP MIB module [RFC7420] uses an entity list and a
   system generated entity index as a primary index to the read only
   entity table.  If the device implements the PCEP MIB, the "index"
   leaf MUST contain the value of the corresponding pcePcepEntityIndex
   and only one entity is assumed.

5.4.

5.3.  The Peer Lists

   The peer list contains peer(s) that the local PCEP entity knows
   about.  A PCEP speaker is identified by its IP address.  If there is
   a PCEP speaker in the network that uses multiple IP addresses then it
   looks like multiple distinct peers to the other PCEP speakers in the
   network.

   Since PCEP sessions can be ephemeral, the peer list tracks a peer
   even when no PCEP session currently exists to that peer.  The
   statistics contained are an aggregate of the statistics for all
   successive sessions to that peer.

   To limit the quantity of information that is stored, an
   implementation MAY choose to discard this information if and only if
   no PCEP session exists to the corresponding peer.

   The data model for PCEP peer presented in this document uses a flat
   list of peers.  Each peer in the list is identified by its IP address
   (addr-type, addr).

   There is a list for static peer configuration and operational state
   of all peers (i.e.static as well as discovered)("/pcep/entity/
   peers").  The list is used to enable remote PCE configuration at PCC
   (or PCE) and has the operational state of these peers as well as the
   remote PCE peer which were discovered and PCC peers that have
   initiated session.

5.5.

5.4.  The Session Lists

   The session list contains PCEP session that the PCEP entity (PCE or
   PCC) is currently participating in.  The statistics in session are
   semantically different from those in peer since the former applies to
   the current session only, whereas the latter is the aggregate for all
   sessions that have existed to that peer.

   Although [RFC5440] forbids more than one active PCEP session between
   a given pair of PCEP entities at any given time, there is a window
   during session establishment where two sessions may exist for a given
   pair, one representing a session initiated by the local PCEP entity
   and the other representing a session initiated by the peer.  If
   either of these sessions reaches active state first, then the other
   is discarded.

   The data model for PCEP session presented in this document uses a
   flat list of sessions.  Each session in the list is identified by its
   initiator.  This sessions.  Each session in the list is identified by its
   initiator.  This index allows two sessions to exist transiently for a
   given peer, as discussed above.

5.5.  Notifications

   This YANG model defines a list of notifications to inform client of
   important events detected during the protocol operation.  The
   notifications defined cover the PCEP MIB notifications.

5.6.  RPC

   This YANG model defines a RPC to trigger state resynchronization to a
   particular PCEP peer.

5.7.  The Full PCEP Data Model

   The module, "ietf-pcep", defines the basic components of a PCE
   speaker.  The tree depth in the tree is set to 10.

module: ietf-pcep
    +--rw pcep!
       +--rw entity
          +--rw addr                          inet:ip-address
          +--rw enabled?                      boolean
          +--rw role                          pcep-role
          +--rw description?                  string
          +--rw speaker-entity-id?            string {sync-opt}?
          +--rw admin-status?                 boolean
          +--ro index?                        uint32
          +--ro oper-status?                  pcep-oper-status
          +--rw domain
          |  +--rw domain* [domain-type domain]
          |     +--rw domain-type    domain-type
          |     +--rw domain         domain
          +--rw capability
          |  +--rw capability?             bits
          |  +--rw pce-initiated?          boolean {pce-initiated}?
          |  +--rw include-db-ver?         boolean
          |  |       {stateful,sync-opt}?
          |  +--rw trigger-resync?         boolean
          |  |       {stateful,sync-opt}?
          |  +--rw trigger-initial-sync?   boolean
          |  |       {stateful,sync-opt}?
          |  +--rw incremental-sync?       boolean
          |  |       {stateful,sync-opt}?
          |  +--rw sr {sr}?
          |     +--rw enabled?     boolean
          |     +--rw msd-limit?   boolean
          |     +--rw nai?         boolean
          +--rw msd?                          uint8 {sr}?
          +--rw pce-info
          |  +--rw scope
          |  |  +--rw path-scope?         bits
          |  |  +--rw intra-area-pref?    uint8
          |  |  +--rw inter-area-pref?    uint8
          |  |  +--rw inter-as-pref?      uint8
          |  |  +--rw inter-layer-pref?   uint8
          |  +--rw neigh-domains
          |  |  +--rw domain* [domain-type domain]
          |  |     +--rw domain-type    domain-type
          |  |     +--rw domain         domain
          |  +--rw path-key {path-key}?
          |     +--rw enabled?         boolean
          |     +--rw discard-timer?   uint32
          |     +--rw reuse-time?      uint32
          |     +--rw pce-id?          inet:ip-address
          +--rw connect-timer?                uint16
          +--rw connect-max-retry?            uint32
          +--rw init-backoff-timer?           uint16
          +--rw max-backoff-timer?            uint32
          +--rw open-wait-timer?              uint16
          +--rw keep-wait-timer?              uint16
          +--rw keep-alive-timer?             uint8
          +--rw dead-timer?                   uint8
          +--rw allow-negotiation?            boolean
          +--rw max-keep-alive-timer?         uint8
          +--rw max-dead-timer?               uint8
          +--rw min-keep-alive-timer?         uint8
          +--rw min-dead-timer?               uint8
          +--rw sync-timer?                   uint16 {svec}?
          +--rw request-timer?                uint16
          +--rw max-sessions?                 uint32
          +--rw max-unknown-reqs?             uint32
          +--rw max-unknown-msgs?             uint32
          +--rw pcep-notification-max-rate    uint32
          +--rw stateful-parameter {stateful}?
          |  +--rw state-timeout?          uint32
          |  +--rw redelegation-timeout?   uint32
          |  +--rw rpt-non-pcep-lsp?       boolean
          +--rw of-list {objective-function}?
          |  +--rw objective-function* [of]
          |     +--rw of    identityref
          +--ro lsp-db {stateful}?
          |  +--ro db-ver?             uint64 {sync-opt}?
          |  +--ro association-list*
          |  |       [type id source global-source extended-id]
          |  |       {association}?
          |  |  +--ro type             identityref
          |  |  +--ro id               uint16
          |  |  +--ro source           inet:ip-address
          |  |  +--ro global-source    uint32
          |  |  +--ro extended-id      string
          |  |  +--ro lsp* [plsp-id pcc-id]
          |  |     +--ro plsp-id    -> /pcep/entity/lsp-db/lsp/plsp-id
          |  |     +--ro pcc-id     -> /pcep/entity/lsp-db/lsp/pcc-id
          |  +--ro lsp* [plsp-id pcc-id]
          |     +--ro plsp-id               uint32
          |     +--ro pcc-id                inet:ip-address
          |     +--ro lsp-ref
          |     |  +--ro source?
          |     |  |       -> /te:te/lsps-state/lsp/source
          |     |  +--ro destination?
          |     |  |       -> /te:te/lsps-state/lsp/destination
          |     |  +--ro tunnel-id?
          |     |  |       -> /te:te/lsps-state/lsp/tunnel-id
          |     |  +--ro lsp-id?
          |     |  |       -> /te:te/lsps-state/lsp/lsp-id
          |     |  +--ro extended-tunnel-id?   leafref
          |     +--ro admin-state?          boolean
          |     +--ro operational-state?    operational-state
          |     +--ro delegated
          |     |  +--ro enabled?   boolean
          |     |  +--ro peer?      -> /pcep/entity/peers/peer/addr
          |     |  +--ro srp-id?    uint32
          |     +--ro initiation {pce-initiated}?
          |     |  +--ro enabled?   boolean
          |     |  +--ro peer?      -> /pcep/entity/peers/peer/addr
          |     +--ro symbolic-path-name?   string
          |     +--ro last-error?           identityref
          |     +--ro pst?                  identityref
          |     +--ro association-list*
          |             [type id source global-source extended-id]
          |             {association}?
          |        +--ro type             leafref
          |        +--ro id
          |        |       -> /pcep/entity/lsp-db/association-list/id
          |        +--ro source           leafref
          |        +--ro global-source    leafref
          |        +--ro extended-id      leafref
          +--ro path-keys {path-key}?
          |  +--ro path-keys* [path-key]
          |     +--ro path-key         uint16
          |     +--ro cps
          |     |  +--ro explicit-route-objects* [index]
          |     |     +--ro index allows two                  uint32
          |     |     +--ro (type)?
          |     |        +--:(numbered-node-hop)
          |     |        |  +--ro numbered-node-hop
          |     |        |     +--ro node-id     te-node-id
          |     |        |     +--ro hop-type?   te-hop-type
          |     |        +--:(numbered-link-hop)
          |     |        |  +--ro numbered-link-hop
          |     |        |     +--ro link-tp-id    te-tp-id
          |     |        |     +--ro hop-type?     te-hop-type
          |     |        |     +--ro direction?    te-link-direction
          |     |        +--:(unnumbered-link-hop)
          |     |        |  +--ro unnumbered-link-hop
          |     |        |     +--ro link-tp-id    te-tp-id
          |     |        |     +--ro node-id       te-node-id
          |     |        |     +--ro hop-type?     te-hop-type
          |     |        |     +--ro direction?    te-link-direction
          |     |        +--:(as-number)
          |     |        |  +--ro as-number-hop
          |     |        |     +--ro as-number    inet:as-number
          |     |        |     +--ro hop-type?    te-hop-type
          |     |        +--:(label)
          |     |           +--ro label-hop
          |     |              +--ro te-label
          |     |                    ...
          |     +--ro pcc-original?    -> /pcep/entity/peers/peer/addr
          |     +--ro req-id?          uint32
          |     +--ro retrieved?       boolean
          |     +--ro pcc-retrieved?   -> /pcep/entity/peers/peer/addr
          |     +--ro creation-time?   yang:timestamp
          |     +--ro discard-time?    uint32
          |     +--ro reuse-time?      uint32
          +--rw peers
             +--rw peer* [addr]
                +--rw addr                    inet:ip-address
                +--rw role                    pcep-role
                +--rw description?            string
                +--rw domain
                |  +--rw domain* [domain-type domain]
                |     +--rw domain-type    domain-type
                |     +--rw domain         domain
                +--rw capability
                |  +--rw capability?             bits
                |  +--rw pce-initiated?          boolean
                |  |       {pce-initiated}?
                |  +--rw include-db-ver?         boolean
                |  |       {stateful,sync-opt}?
                |  +--rw trigger-resync?         boolean
                |  |       {stateful,sync-opt}?
                |  +--rw trigger-initial-sync?   boolean
                |  |       {stateful,sync-opt}?
                |  +--rw incremental-sync?       boolean
                |  |       {stateful,sync-opt}?
                |  +--rw sr {sr}?
                |     +--rw enabled?     boolean
                |     +--rw msd-limit?   boolean
                |     +--rw nai?         boolean
                +--rw msd?                    uint8 {sr}?
                +--rw pce-info
                |  +--rw scope
                |  |  +--rw path-scope?         bits
                |  |  +--rw intra-area-pref?    uint8
                |  |  +--rw inter-area-pref?    uint8
                |  |  +--rw inter-as-pref?      uint8
                |  |  +--rw inter-layer-pref?   uint8
                |  +--rw neigh-domains
                |     +--rw domain* [domain-type domain]
                |        +--rw domain-type    domain-type
                |        +--rw domain         domain
                +--rw delegation-pref?        uint8 {stateful}?
                +--rw auth
                |  +--rw (auth-type-selection)?
                |     +--:(auth-key-chain)
                |     |  +--rw key-chain?            kc:key-chain-ref
                |     +--:(auth-key)
                |     |  +--rw crypto-algorithm      identityref
                |     |  +--rw (key-string-style)?
                |     |     +--:(keystring)
                |     |     |  +--rw keystring?            string
                |     |     +--:(hexadecimal) {kc:hex-key-string}?
                |     |        +--rw hexadecimal-string?
                |     |                yang:hex-string
                |     +--:(auth-tls) {tls}?
                |        +--rw (role)?
                |           +--:(server)
                |           |  +--rw tls-server
                |           |        ...
                |           +--:(client)
                |              +--rw tls-client
                |                    ...
                +--ro discontinuity-time?     yang:timestamp
                +--ro initiate-session?       boolean
                +--ro session-exists?         boolean
                +--ro session-up-time?        yang:timestamp
                +--ro session-fail-time?      yang:timestamp
                +--ro session-fail-up-time?   yang:timestamp
                +--ro sessions to exist transiently for a
   given peer, as discussed above.

5.6.  Notifications

   This YANG model defines a list of notifications to inform client
                   +--ro session* [initiator]
                      +--ro initiator               pcep-initiator
                      +--ro role?                   -> /pcep/entity/role
                      +--ro state-last-change?      yang:timestamp
                      +--ro state?                  pcep-sess-state
                      +--ro session-creation?       yang:timestamp
                      +--ro connect-retry?          yang:counter32
                      +--ro local-id?               uint8
                      +--ro remote-id?              uint8
                      +--ro keepalive-timer?        uint8
                      +--ro peer-keepalive-timer?   uint8
                      +--ro dead-timer?             uint8
                      +--ro peer-dead-timer?        uint8
                      +--ro ka-hold-time-rem?       uint8
                      +--ro overloaded?             boolean
                      +--ro overload-time?          uint32
                      +--ro peer-overloaded?        boolean
                      +--ro peer-overload-time?     uint32
                      +--ro lspdb-sync?             sync-state
                      |       {stateful}?
                      +--ro recv-db-ver?            uint64
                      |       {stateful,sync-opt}?
                      +--ro of-list {objective-function}?
                      |  +--ro objective-function* [of]
                      |     +--ro of
   important events detected during the protocol operation.  The
   notifications defined cover the PCEP MIB notifications.

5.7.  RPC

   This YANG model defines a RPC to trigger state resynchronization to a
   particular PCEP peer.    identityref
                      +--ro pst-list
                      |  +--ro path-setup-type* [pst]
                      |     +--ro pst    identityref
                      +--ro assoc-type-list {association}?
                      |  +--ro assoc-type* [at]
                      |     +--ro at    identityref
                      +--ro speaker-entity-id?      string
                      |       {sync-opt}?
                      +--ro discontinuity-time?     yang:timestamp

  rpcs:
    +---x trigger-resync {stateful,sync-opt}?
       +---w input
          +---w pcc?   -> /pcep/entity/peers/peer/addr

  notifications:
    +---n pcep-session-up
    |  +--ro peer-addr?           -> /pcep/entity/peers/peer/addr
    |  +--ro session-initiator?
    |  |       -> /pcep/entity/peers/peer/sessions/session/initiator
    |  +--ro state-last-change?   yang:timestamp
    |  +--ro state?               pcep-sess-state
    +---n pcep-session-down
    |  +--ro peer-addr?           -> /pcep/entity/peers/peer/addr
    |  +--ro session-initiator?   pcep-initiator
    |  +--ro state-last-change?   yang:timestamp
    |  +--ro state?               pcep-sess-state
    +---n pcep-session-local-overload
    |  +--ro peer-addr?           -> /pcep/entity/peers/peer/addr
    |  +--ro session-initiator?
    |  |       -> /pcep/entity/peers/peer/sessions/session/initiator
    |  +--ro overloaded?          boolean
    |  +--ro overload-time?       uint32
    +---n pcep-session-local-overload-clear
    |  +--ro peer-addr?    -> /pcep/entity/peers/peer/addr
    |  +--ro overloaded?   boolean
    +---n pcep-session-peer-overload
    |  +--ro peer-addr?            -> /pcep/entity/peers/peer/addr
    |  +--ro session-initiator?
    |  |       -> /pcep/entity/peers/peer/sessions/session/initiator
    |  +--ro peer-overloaded?      boolean
    |  +--ro peer-overload-time?   uint32
    +---n pcep-session-peer-overload-clear
       +--ro peer-addr?         -> /pcep/entity/peers/peer/addr
       +--ro peer-overloaded?   boolean

6.  The Design of PCEP Statistics Data Model

   The module, "ietf-pcep-stats", augments the ietf-pcep module to
   include statistics at the PCEP peer and session level.

   module: ietf-pcep-stats
     augment /p:pcep/p:entity/p:peers/p:peer:
       +--ro num-sess-setup-ok?     yang:counter32
       +--ro num-sess-setup-fail?   yang:counter32
       +--ro pcep-stats
          +--ro avg-rsp-time?               uint32
          +--ro lwm-rsp-time?               uint32
          +--ro hwm-rsp-time?               uint32
          +--ro num-pcreq-sent?             yang:counter32
          +--ro num-pcreq-rcvd?             yang:counter32
          +--ro num-pcrep-sent?             yang:counter32
          +--ro num-pcrep-rcvd?             yang:counter32
          +--ro num-pcerr-sent?             yang:counter32
          +--ro num-pcerr-rcvd?             yang:counter32
          +--ro num-pcntf-sent?             yang:counter32
          +--ro num-pcntf-rcvd?             yang:counter32
          +--ro num-keepalive-sent?         yang:counter32
          +--ro num-keepalive-rcvd?         yang:counter32
          +--ro num-unknown-rcvd?           yang:counter32
          +--ro num-corrupt-rcvd?           yang:counter32
          +--ro num-req-sent?               yang:counter32
          +--ro num-req-sent-pend-rep?      yang:counter32
          +--ro num-req-sent-ero-rcvd?      yang:counter32
          +--ro num-req-sent-nopath-rcvd?   yang:counter32
          +--ro num-req-sent-cancel-rcvd?   yang:counter32
          +--ro num-req-sent-error-rcvd?    yang:counter32
          +--ro num-req-sent-timeout?       yang:counter32
          +--ro num-req-sent-cancel-sent?   yang:counter32
          +--ro num-req-rcvd?               yang:counter32
          +--ro num-req-rcvd-pend-rep?      yang:counter32
          +--ro num-req-rcvd-ero-sent?      yang:counter32
          +--ro num-req-rcvd-nopath-sent?   yang:counter32
          +--ro num-req-rcvd-cancel-sent?   yang:counter32
          +--ro num-req-rcvd-error-sent?    yang:counter32
          +--ro num-req-rcvd-cancel-rcvd?   yang:counter32
          +--ro num-rep-rcvd-unknown?       yang:counter32
          +--ro num-req-rcvd-unknown?       yang:counter32
          +--ro svec {p:svec}?
          |  +--ro num-svec-sent?       yang:counter32
          |  +--ro num-svec-req-sent?   yang:counter32
          |  +--ro num-svec-rcvd?       yang:counter32
          |  +--ro num-svec-req-rcvd?   yang:counter32
          +--ro stateful {p:stateful}?
          |  +--ro num-pcrpt-sent?             yang:counter32
          |  +--ro num-pcrpt-rcvd?             yang:counter32
          |  +--ro num-pcupd-sent?             yang:counter32
          |  +--ro num-pcupd-rcvd?             yang:counter32
          |  +--ro num-rpt-sent?               yang:counter32
          |  +--ro num-rpt-rcvd?               yang:counter32
          |  +--ro num-rpt-rcvd-error-sent?    yang:counter32
          |  +--ro num-upd-sent?               yang:counter32
          |  +--ro num-upd-rcvd?               yang:counter32
          |  +--ro num-upd-rcvd-unknown?       yang:counter32
          |  +--ro num-upd-rcvd-undelegated?   yang:counter32
          |  +--ro num-upd-rcvd-error-sent?    yang:counter32
          |  +--ro initiation {p:pce-initiated}?
          |     +--ro num-pcinitiate-sent?            yang:counter32
          |     +--ro num-pcinitiate-rcvd?            yang:counter32
          |     +--ro num-initiate-sent?              yang:counter32
          |     +--ro num-initiate-rcvd?              yang:counter32
          |     +--ro num-initiate-rcvd-error-sent?   yang:counter32
          +--ro path-key {p:path-key}?
          |  +--ro num-unknown-path-key?      yang:counter32
          |  +--ro num-exp-path-key?          yang:counter32
          |  +--ro num-dup-path-key?          yang:counter32
          |  +--ro num-path-key-no-attempt?   yang:counter32
          +--ro num-req-sent-closed?        yang:counter32
          +--ro num-req-rcvd-closed?        yang:counter32
     augment /p:pcep/p:entity/p:peers/p:peer/p:sessions/p:session:
       +--ro pcep-stats
          +--ro avg-rsp-time?               uint32
          +--ro lwm-rsp-time?               uint32
          +--ro hwm-rsp-time?               uint32
          +--ro num-pcreq-sent?             yang:counter32
          +--ro num-pcreq-rcvd?             yang:counter32
          +--ro num-pcrep-sent?             yang:counter32
          +--ro num-pcrep-rcvd?             yang:counter32
          +--ro num-pcerr-sent?             yang:counter32
          +--ro num-pcerr-rcvd?             yang:counter32
          +--ro num-pcntf-sent?             yang:counter32
          +--ro num-pcntf-rcvd?             yang:counter32
          +--ro num-keepalive-sent?         yang:counter32
          +--ro num-keepalive-rcvd?         yang:counter32
          +--ro num-unknown-rcvd?           yang:counter32
          +--ro num-corrupt-rcvd?           yang:counter32
          +--ro num-req-sent?               yang:counter32
          +--ro num-req-sent-pend-rep?      yang:counter32
          +--ro num-req-sent-ero-rcvd?      yang:counter32
          +--ro num-req-sent-nopath-rcvd?   yang:counter32
          +--ro num-req-sent-cancel-rcvd?   yang:counter32
          +--ro num-req-sent-error-rcvd?    yang:counter32
          +--ro num-req-sent-timeout?       yang:counter32
          +--ro num-req-sent-cancel-sent?   yang:counter32
          +--ro num-req-rcvd?               yang:counter32
          +--ro num-req-rcvd-pend-rep?      yang:counter32
          +--ro num-req-rcvd-ero-sent?      yang:counter32
          +--ro num-req-rcvd-nopath-sent?   yang:counter32
          +--ro num-req-rcvd-cancel-sent?   yang:counter32
          +--ro num-req-rcvd-error-sent?    yang:counter32
          +--ro num-req-rcvd-cancel-rcvd?   yang:counter32
          +--ro num-rep-rcvd-unknown?       yang:counter32
          +--ro num-req-rcvd-unknown?       yang:counter32
          +--ro svec {p:svec}?
          |  +--ro num-svec-sent?       yang:counter32
          |  +--ro num-svec-req-sent?   yang:counter32
          |  +--ro num-svec-rcvd?       yang:counter32
          |  +--ro num-svec-req-rcvd?   yang:counter32
          +--ro stateful {p:stateful}?
          |  +--ro num-pcrpt-sent?             yang:counter32
          |  +--ro num-pcrpt-rcvd?             yang:counter32
          |  +--ro num-pcupd-sent?             yang:counter32
          |  +--ro num-pcupd-rcvd?             yang:counter32
          |  +--ro num-rpt-sent?               yang:counter32
          |  +--ro num-rpt-rcvd?               yang:counter32
          |  +--ro num-rpt-rcvd-error-sent?    yang:counter32
          |  +--ro num-upd-sent?               yang:counter32
          |  +--ro num-upd-rcvd?               yang:counter32
          |  +--ro num-upd-rcvd-unknown?       yang:counter32
          |  +--ro num-upd-rcvd-undelegated?   yang:counter32
          |  +--ro num-upd-rcvd-error-sent?    yang:counter32
          |  +--ro initiation {p:pce-initiated}?
          |     +--ro num-pcinitiate-sent?            yang:counter32
          |     +--ro num-pcinitiate-rcvd?            yang:counter32
          |     +--ro num-initiate-sent?              yang:counter32
          |     +--ro num-initiate-rcvd?              yang:counter32
          |     +--ro num-initiate-rcvd-error-sent?   yang:counter32
          +--ro path-key {p:path-key}?
             +--ro num-unknown-path-key?      yang:counter32
             +--ro num-exp-path-key?          yang:counter32
             +--ro num-dup-path-key?          yang:counter32
             +--ro num-path-key-no-attempt?   yang:counter32
     groupings:
     pcep-stats
         +---- avg-rsp-time?               uint32
         +---- lwm-rsp-time?               uint32
         +---- hwm-rsp-time?               uint32
         +---- num-pcreq-sent?             yang:counter32
         +---- num-pcreq-rcvd?             yang:counter32
         +---- num-pcrep-sent?             yang:counter32
         +---- num-pcrep-rcvd?             yang:counter32
         +---- num-pcerr-sent?             yang:counter32
         +---- num-pcerr-rcvd?             yang:counter32
         +---- num-pcntf-sent?             yang:counter32
         +---- num-pcntf-rcvd?             yang:counter32
         +---- num-keepalive-sent?         yang:counter32
         +---- num-keepalive-rcvd?         yang:counter32
         +---- num-unknown-rcvd?           yang:counter32
         +---- num-corrupt-rcvd?           yang:counter32
         +---- num-req-sent?               yang:counter32
         +---- num-req-sent-pend-rep?      yang:counter32
         +---- num-req-sent-ero-rcvd?      yang:counter32
         +---- num-req-sent-nopath-rcvd?   yang:counter32
         +---- num-req-sent-cancel-rcvd?   yang:counter32
         +---- num-req-sent-error-rcvd?    yang:counter32
         +---- num-req-sent-timeout?       yang:counter32
         +---- num-req-sent-cancel-sent?   yang:counter32
         +---- num-req-rcvd?               yang:counter32
         +---- num-req-rcvd-pend-rep?      yang:counter32
         +---- num-req-rcvd-ero-sent?      yang:counter32
         +---- num-req-rcvd-nopath-sent?   yang:counter32
         +---- num-req-rcvd-cancel-sent?   yang:counter32
         +---- num-req-rcvd-error-sent?    yang:counter32
         +---- num-req-rcvd-cancel-rcvd?   yang:counter32
         +---- num-rep-rcvd-unknown?       yang:counter32
         +---- num-req-rcvd-unknown?       yang:counter32
         +---- svec {p:svec}?
         |  +---- num-svec-sent?       yang:counter32
         |  +---- num-svec-req-sent?   yang:counter32
         |  +---- num-svec-rcvd?       yang:counter32
         |  +---- num-svec-req-rcvd?   yang:counter32
         +---- stateful {p:stateful}?
         |  +---- num-pcrpt-sent?             yang:counter32
         |  +---- num-pcrpt-rcvd?             yang:counter32
         |  +---- num-pcupd-sent?             yang:counter32
         |  +---- num-pcupd-rcvd?             yang:counter32
         |  +---- num-rpt-sent?               yang:counter32
         |  +---- num-rpt-rcvd?               yang:counter32
         |  +----  +--ro num-rpt-rcvd-error-sent?    yang:counter32
          |  +----  +--ro num-upd-sent?               yang:counter32
          |  +----  +--ro num-upd-rcvd?               yang:counter32
          |  +----  +--ro num-upd-rcvd-unknown?       yang:counter32
          |  +----  +--ro num-upd-rcvd-undelegated?   yang:counter32
          |  +----  +--ro num-upd-rcvd-error-sent?    yang:counter32
          |  +----  +--ro initiation {p:pce-initiated}?
          |     +----     +--ro num-pcinitiate-sent?            yang:counter32
          |     +----     +--ro num-pcinitiate-rcvd?            yang:counter32
          |     +----     +--ro num-initiate-sent?              yang:counter32
          |     +----     +--ro num-initiate-rcvd?              yang:counter32
          |     +----     +--ro num-initiate-rcvd-error-sent?   yang:counter32
         +----
          +--ro path-key {p:path-key}?
            +----
             +--ro num-unknown-path-key?      yang:counter32
            +----
             +--ro num-exp-path-key?          yang:counter32
            +----
             +--ro num-dup-path-key?          yang:counter32
            +----
             +--ro num-path-key-no-attempt?   yang:counter32

7.  Advanced PCE Features

   This document contains a specification of the base PCEP YANG module,
   "ietf-pcep" which provides the basic PCEP [RFC5440] data model.

   This document further handles advanced PCE features like -

   o  Capability and Scope

   o  Domain information (local/neighbour)

   o  Path-Key

   o  OF

   o  GCO

   o  P2MP

   o  GMPLS

   o  Inter-Layer

   o  Stateful PCE

   o  Segement Routing

   o  Authentication including PCEPS (TLS)

7.1.  Stateful PCE's LSP-DB

   In the operational state of PCEP which supports stateful PCE mode,
   the list of LSP state are maintained in LSP-DB.  The key is the PLSP-
   ID and the PCC IP address.

   The PCEP data model contains the operational state of LSPs
   (/pcep/entity/lsp-db/lsp/) with PCEP specific attributes.  The
   generic TE attributes of the LSP are defined in
   [I-D.ietf-teas-yang-te].  A reference to LSP state in TE model is
   maintained.

8.  Open Issues and Next Step

   This section is added so that open issues can be tracked.  This
   section would be removed when the document is ready for publication.

8.1.  The PCE-Initiated LSP

   The TE Model at [I-D.ietf-teas-yang-te] should support creating of
   tunnels at the controller (PCE) and marking them as PCE-Initiated.
   The LSP-DB in the PCEP Yang (/pcep/entity/lsp-db/lsp/initiation) also
   marks the LSPs which are PCE-initiated.

9.  Other Considerations

9.1.  PCEP over TLS (PCEPS)

   [RFC8253] describe the use of TLS in PCEP.  The peer acting as the
   PCEP client MUST act as the TLS client.  The TLS client actively
   opens the TLS connection and the TLS server passively listens for the
   incoming TLS connections.  The well-known TCP port number 4189 is
   used by PCEP servers to listen for TCP connections established by
   PCEP over TLS clients.  The TLS client MUST send the TLS ClientHello
   message to begin the TLS handshake.  The TLS server MUST send a
   CertificateRequest in order to request a certificate from the TLS
   client.  Once the TLS handshake has finished, the client and the
   server MAY begin to exchange PCEP messages.  Client and server
   identity verification is done before the PCEP open message is sent.
   This means that the identity verification is completed before the
   PCEP session is started..

10.  PCEP YANG Modules

10.1.  ietf-pcep module

   RFC Ed.: In this section, replace all occurrences of 'XXXX' with the
   actual RFC number and all occurrences of the revision date below with
   the date of RFC publication (and remove this note).

 <CODE BEGINS> file "ietf-pcep@2018-10-15.yang" "ietf-pcep@2019-03-24.yang"
 module ietf-pcep {

   yang-version 1.1;

   namespace "urn:ietf:params:xml:ns:yang:ietf-pcep";
   prefix pcep; p;

   import ietf-inet-types {
     prefix "inet";
     reference
       "RFC 6991"; 6991: Common YANG Data Types";
   }

   import ietf-yang-types {
     prefix "yang";
     reference
       "RFC 6991"; 6991: Common YANG Data Types";
   }

   import ietf-te {
     prefix "te";
     reference "RFC XXXX";
       "I-D.ietf-teas-yang-te: A YANG Data Model for Traffic
       Engineering Tunnels and Interfaces";
   }

   import ietf-te-types {
     prefix "te-types";
     reference "RFC XXXX";
       "I-D.ietf-teas-yang-te-types: Traffic Engineering Common YANG
       Types";
   }

   import ietf-key-chain {
     prefix "key-chain"; "kc";
     reference
       "RFC 8177"; 8177: YANG Data Model for Key Chains";
   }

   import ietf-netconf-acm {
     prefix "nacm";
     reference
       "RFC 6536"; 8341: Network Configuration Protocol (NETCONF) Access
       Control Model";
    }

   import ietf-tls-server {
     prefix "tls-server"; "ts";
     reference "RFC XXXX";
       "I-D.ietf-netconf-tls-client-server: YANG Groupings for TLS
       Clients and TLS Servers";
    }

   import ietf-tls-client {
      prefix "tls-client"; "tc";
      reference "RFC XXXX";
         "I-D.ietf-netconf-tls-client-server: YANG Groupings for TLS
         Clients and TLS Servers";
   }

   import ietf-ospf {
     prefix "ospf";
     reference
       "I-D.ietf-ospf-yang: YANG Data Model for OSPF Protocol";
   }

   import ietf-isis {
     prefix "isis";
     reference
       "I-D.ietf-isis-yang-isis-cfg: YANG Data Model for IS-IS
       Protocol";
   }

   organization
     "IETF PCE (Path Computation Element) Working Group";

   contact
     "WG Web:  <http://tools.ietf.org/wg/pce/>
     WG List:  <mailto:pce@ietf.org>
     Editor:   Dhruv Dhody
               <mailto:dhruv.ietf@gmail.com>";

   description
     "The YANG module defines a generic configuration and
     operational model for PCEP common across all of the
        vendor implementations. PCEP.

     Copyright (c) 2018 2019 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Simplified BSD License
     set forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (http://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX; see the
     RFC itself for full legal notices.";

   revision 2018-10-15 2019-03-24 {
     description "Initial revision.";
     reference
       "RFC XXXX:  A YANG Data Model for Path Computation
       Element Communications Protocol (PCEP)";

   }

   /*
    * Identities
     */

    identity pcep {
        description "Identity for the PCEP protocol.";
        reference "RFC 5440";
    }

    /*
     * Typedefs
    */
   typedef pcep-role {
     type enumeration {
       enum unknown {
         value "0";
         description
           "An unknown role";
       }
       enum pcc {
         value "1";
         description
           "The role of a Path Computation Client";
       }
       enum pce {
         value "2";
         description
           "The role of Path Computation Element";
       }
       enum pcc-and-pce {
         value "3";
         description
           "The role of both Path Computation Client and
           Path Computation Element";
       }
     }
     description
       "The role of a PCEP speaker.
       Takes one of the following values
       - unknown(0): the role is not known.
       - pcc(1): the role is of a Path Computation
         Client (PCC).
       - pce(2): the role is of a Path Computation
         Server (PCE).
       - pccAndPce(3): the role is of both a PCC and
         a PCE.";
   }

   typedef pcep-admin-status {
        type enumeration {
                enum admin-status-up {
                value "1";
                description
                "Admin Status is Up";
            }
            enum admin-status-down {
                value "2";
                description
                "Admin Status is Down";
            }
        }

        description
        "The Admin Status of the PCEP entity.
         Takes one of the following values
             - admin-status-up(1): Admin Status is Up.
             - admin-status-down(2): Admin Status is Down";
    }

    typedef pcep-oper-status {
     type enumeration {
       enum oper-status-up {
         value "1";
         description
           "The PCEP entity is active";
       }
       enum oper-status-down {
         value "2";
         description
           "The PCEP entity is inactive";
       }
         enum oper-status-going-up {
         value "3";
         description
           "The PCEP entity is activating";
       }
       enum oper-status-going-down {
         value "4";
         description
           "The PCEP entity is deactivating";
       }
       enum oper-status-failed {
         value "5";
         description
           "The PCEP entity has failed and will recover
           when possible.";
       }
       enum oper-status-failed-perm {
         value "6";
         description
           "The PCEP entity has failed and will not recover
           without operator intervention";
       }
     }
     description
       "The operational status of the PCEP entity.
       Takes one of the following values
       - oper-status-up(1): Active
       - oper-status-down(2): Inactive
       - oper-status-going-up(3): Activating
       - oper-status-going-down(4): Deactivating
       - oper-status-failed(5): Failed
       - oper-status-failed-perm(6): Failed Permanantly";
     reference
       "RFC 5440: Path Computation Element (PCE) Communication
       Protocol (PCEP)";
   }

   typedef pcep-initiator {
     type enumeration {
       enum local {
         value "1";
         description
           "The local PCEP entity initiated the session";

       }
       enum remote {
         value "2";
         description
           "The remote PCEP peer initiated the session";
       }
     }
     description
       "The initiator of the session, that is, whether the TCP
       connection was initiated by the local PCEP entity or
       the remote peer.
       Takes one of the following values
       - local(1): Initiated locally
       - remote(2): Initiated remotely";
   }

   typedef pcep-sess-state {
     type enumeration {
       enum tcp-pending {
         value "1";
         description
           "The tcp-pending state of PCEP session.";
       }
       enum open-wait {
         value "2";
         description
           "The open-wait state of PCEP session.";
       }
       enum keep-wait {
         value "3";
         description
           "The keep-wait state of PCEP session.";
       }
       enum session-up {
         value "4";
         description
           "The session-up state of PCEP session.";
       }
     }
     description
       "The current state of the session.
       The set of possible states excludes the idle state
       since entries do not exist in the idle state.
       Takes one of the following values
       - tcp-pending(1): PCEP TCP Pending state
       - open-wait(2): PCEP Open Wait state
       - keep-wait(3): PCEP Keep Wait state
       - session-up(4): PCEP Session Up state";

     reference
       "RFC 5440"; 5440: Path Computation Element (PCE) Communication
       Protocol (PCEP)";
   }

   typedef domain-type {
     type enumeration {
       enum ospf-area {
         value "1";
         description
           "The OSPF area.";
       }
       enum isis-area {
         value "2";
         description
           "The IS-IS area.";
       }
       enum as {
         value "3";
         description
           "The Autonomous System (AS).";
       }
     }
     description
       "The PCE Domain Type";
   }

   typedef domain-ospf-area {
     type union {
            type uint32;
            type yang:dotted-quad;
       } ospf:area-id-type;
     description
       "OSPF Area ID.";
     reference
       "I-D.ietf-ospf-yang: YANG Data Model for OSPF Protocol";
   }

   typedef domain-isis-area {
     type string {
            pattern '[0-9A-Fa-f]{2}\.([0-9A-Fa-f]{4}\.){0,3}';
        } isis:area-address;
     description
       "IS-IS Area ID.";
     reference
       "I-D.ietf-isis-yang-isis-cfg: YANG Data Model for IS-IS
       Protocol";
   }

   typedef domain-as {
     type uint32; inet:as-number;
     description
       "Autonomous System number.";

   }

   typedef domain {
     type union {
       type domain-ospf-area;
       type domain-isis-area;
       type domain-as;
     }
     description
       "The Domain Information";
   }

   typedef operational-state {
     type enumeration {
       enum down {
         value "0";
         description
           "not active.";
       }
       enum up {
         value "1";
         description
           "signalled.";
       }
       enum active {
         value "2";
         description
           "up and carrying traffic.";
       }
       enum going-down {
         value "3";
         description
           "LSP is being torn down, resources are
           being released.";
       }
       enum going-up {
         value "4";
         description
           "LSP is being signalled.";
       }
     }
     description
       "The operational status of the LSP";
     reference
       "RFC 8231: Path Computation Element Communication Protocol
       (PCEP) Extensions for Stateful PCE";
   }
   typedef sync-state {
     type enumeration {
       enum pending {
         value "0";
         description
           "The state synchronization
           has not started.";
       }
       enum ongoing {
         value "1";
         description
           "The state synchronization
           is ongoing.";
       }
       enum finished {
         value "2";
         description
           "The state synchronization
           is finished.";
       }
     }
     description
       "The LSP-DB state synchronization operational
       status.";
     reference
       "RFC 8231: Path Computation Element Communication Protocol
       (PCEP) Extensions for Stateful PCE";
   }

   /*
    * Features
    */

   feature svec {
     description
       "Support synchronized path computation.";
     reference
       "RFC 5440"; 5440: Path Computation Element (PCE) Communication
       Protocol (PCEP)";
   }

   feature gmpls {
     description
       "Support GMPLS.";
     reference
       "I-D.ietf-pce-gmpls-pcep-extensions: PCEP extensions for
       GMPLS";
   }
   feature objective-function {
     description
       "Support OF as per RFC 5541.";
     reference
       "RFC 5541"; 5541: Encoding of Objective Functions in the Path
       Computation Element Communication Protocol (PCEP)";
   }

   feature gco global-concurrent {
     description
       "Support GCO as per RFC 5557.";
     reference
       "RFC 5557"; 5557: Path Computation Element Communication Protocol
       (PCEP) Requirements and Protocol Extensions in Support of
       Global Concurrent Optimization";
   }

   feature path-key {
     description
       "Support path-key as per RFC 5520.";
     reference
       "RFC 5520"; 5520: Preserving Topology Confidentiality in Inter-
       Domain Path Computation Using a Path-Key-Based Mechanism";
   }

   feature p2mp {
     description
       "Support P2MP as per RFC 8306.";
     reference
       "RFC 8306"; 8306: Extensions to the Path Computation Element
       Communication Protocol (PCEP) for Point-to-Multipoint
       Traffic Engineering Label Switched Paths";
   }

   feature stateful {
     description
       "Support stateful PCE as per RFC 8231.";
     reference
       "RFC 8231"; 8231: Path Computation Element Communication Protocol
       (PCEP) Extensions for Stateful PCE";
   }

   feature stateful-sync-opt sync-opt {
     description
       "Support stateful sync optimization
       as per RFC 8232";
     reference
       "RFC 8232"; 8232: Optimizations of Label Switched Path State
       Synchronization Procedures for a Stateful PCE";
   }

   feature pce-initiated {
     description
       "Support PCE-Initiated LSP as per
       RFC 8281.";
     reference
       "RFC 8281"; 8281: Path Computation Element Communication Protocol
       (PCEP) Extensions for PCE-Initiated LSP Setup in a Stateful
       PCE Model";
   }

   feature tls {
     description
       "Support PCEP over TLS as per
       RFC 8253.";
     reference
       "RFC 8253"; 8253: PCEPS: Usage of TLS to Provide a Secure Transport
       for the Path Computation Element Communication Protocol
       (PCEP)";
   }

   feature sr {
     description
       "Support Segment Routing for PCE.";
     reference
       "I-D.ietf-pce-segment-routing: PCEP Extensions for Segment
       Routing";
   }

   feature association {
     description
       "Support Association in PCEP.";
     reference
       "I-D.ietf-pce-association-group: PCEP Extensions for
       Establishing Relationships Between Sets of LSPs";
   }

   /*
   * Identities
   */

   identity lsp-error {
     if-feature stateful;
     description
       "Base LSP error";
     reference "RFC8231";
       "RFC 8231: Path Computation Element Communication Protocol
       (PCEP) Extensions for Stateful PCE";
   }

   identity no-error-lsp-error {
     base lsp-error;
     if-feature stateful;
     description
       "No error, LSP is fine.";
     reference "RFC8231";
    }

    identity unknown-lsp-error {
        base lsp-error;
        if-feature stateful;
        description
            "Unknown reason.";
        reference "RFC8231";
    }

    identity limit-lsp-error {
        base lsp-error;
        if-feature stateful;
        description
            "Limit reached for PCE-controlled LSPs.";
        reference "RFC8231";
    }

    identity pending-lsp-error {
        base lsp-error;
        if-feature stateful;
        description
            "Too many pending LSP update requests.";
        reference "RFC8231";
    }

    identity unacceptable-lsp-error {
        base lsp-error;
        if-feature stateful;
        description
            "Unacceptable parameters.";
        reference "RFC8231";
    }

    identity internal-lsp-error {
        base lsp-error;
        if-feature stateful;
        description
            "Internal error.";
        reference "RFC8231";
    }

    identity admin-lsp-error {
        base lsp-error;
        if-feature stateful;
        description
            "LSP administratively brought down.";
        reference "RFC8231";
    }

    identity preempted-lsp-error {
        base lsp-error;
        if-feature stateful;
        description
            "LSP preempted.";
        reference "RFC8231";
    }

    identity rsvp-lsp-error {
        base lsp-error;
        if-feature stateful;
        description
            "RSVP signaling error.";
        reference "RFC8231";
    }

    /*
     * Groupings
     */
    grouping pcep-entity-info{
        description
            "This grouping defines the attributes
       "RFC 8231: Path Computation Element Communication Protocol
       (PCEP) Extensions for PCEP entity.";
        leaf connect-timer {
            type uint32 {
                range "1..65535";
            }
            units "seconds";
            default 60;
            description
                "The time in seconds that the PCEP entity will wait
                 to establish a TCP connection with a peer.  If a
                 TCP connection is not established within this time
                 then PCEP aborts the session setup attempt."; Stateful PCE";
   }

   identity unknown-lsp-error {
     base lsp-error;
     if-feature stateful;
     description
       "Unknown reason.";
     reference
       "RFC 5440: 8231: Path Computation Element (PCE) Communication Protocol (PCEP)";
       (PCEP) Extensions for Stateful PCE";
   }

        leaf connect-max-retry

   identity limit-lsp-error {
            type uint32;
            default 5;
     base lsp-error;
     if-feature stateful;
     description
                "The maximum number of times the system tries to
                 establish a TCP connection to a peer before the
                 session with the peer transitions to the idle
                 state.";
       "Limit reached for PCE-controlled LSPs.";
     reference
       "RFC 5440: 8231: Path Computation Element (PCE) Communication Protocol (PCEP)";
        }

        leaf init-backoff-timer {
            type uint32 {
                range "1..65535";
            }
            units "seconds";
            description
               "The initial back-off time in seconds for retrying
                a failed session setup attempt to a peer.
                The back-off time increases
       (PCEP) Extensions for each failed
                session setup attempt, until a maximum back-off
                time is reached.  The maximum back-off time is
                max-backoff-timer."; Stateful PCE";
   }

        leaf max-backoff-timer

   identity pending-lsp-error {
            type uint32;
            units "seconds";
     base lsp-error;
     if-feature stateful;
     description
               "The maximum back-off time in seconds for retrying
                a failed session setup attempt to a peer.
                The back-off time increases
       "Too many pending LSP update requests.";
     reference
       "RFC 8231: Path Computation Element Communication Protocol
       (PCEP) Extensions for each failed session
                setup attempt, until this maximum value is reached.
                Session setup attempts then repeat periodically
                without any further increase in back-off time.";
        }

        leaf open-wait-timer {
            type uint32 {
                range "1..65535"; Stateful PCE";
   }
            units "seconds";
            default 60;
            description
               "The time in seconds that the PCEP entity will wait
                to receive an Open message from a peer after the
                TCP connection has come up.
                If no Open message is received within this time then
                PCEP terminates the TCP connection and deletes the
                associated sessions.";

   identity unacceptable-lsp-error {
     base lsp-error;
     if-feature stateful;
     description
       "Unacceptable parameters.";
     reference
       "RFC 5440: 8231: Path Computation Element (PCE) Communication Protocol (PCEP)";
       (PCEP) Extensions for Stateful PCE";
   }

        leaf keep-wait-timer {
            type uint32

   identity internal-lsp-error {
                range "1..65535";
            }
            units "seconds";
            default 60;
     base lsp-error;
     if-feature stateful;
     description
                "The time in seconds that the PCEP entity will wait
                 to receive a Keepalive or PCErr message from a peer
                 during session initialization after receiving an
                 Open message.  If no Keepalive or PCErr message is
                 received within this time then PCEP terminates the
                 TCP connection and deletes the associated
                 sessions.";
       "Internal error.";
     reference
       "RFC 5440: 8231: Path Computation Element (PCE) Communication Protocol (PCEP)";
       (PCEP) Extensions for Stateful PCE";
   }

        leaf keep-alive-timer {
            type uint32

   identity admin-lsp-error {
                range "0..255";
            }
            units "seconds";
            default 30;
     base lsp-error;
     if-feature stateful;
     description
                "The keep alive transmission timer that this PCEP
                 entity will propose in the initial OPEN message of
                 each session it is involved in.  This is the
                 maximum time between two consecutive messages sent
                 to a peer. Zero means that the PCEP entity prefers
                 not to send Keepalives at all.
                 Note that the actual Keepalive transmission
                 intervals, in either direction of an active PCEP
                 session, are determined by negotiation between the
                 peers as specified by RFC 5440, and so may differ
                 from this configured value.";
       "LSP administratively brought down.";
     reference
       "RFC 5440: 8231: Path Computation Element (PCE) Communication Protocol (PCEP)";
       (PCEP) Extensions for Stateful PCE";
   }

        leaf dead-timer {
            type uint32

   identity preempted-lsp-error {
                range "0..255";
     base lsp-error;
     if-feature stateful;
     description
       "LSP preempted.";
     reference
       "RFC 8231: Path Computation Element Communication Protocol
       (PCEP) Extensions for Stateful PCE";
   }
            units "seconds";
            must "(. > ../keep-alive-timer)" {
                error-message "The dead timer must be "
                       + "larger than the keep alive timer";

   identity rsvp-lsp-error {
     base lsp-error;
     if-feature stateful;
     description
                    "This value MUST be greater than
                     keep-alive-timer.";
       "RSVP signaling error.";
     reference
       "RFC 8231: Path Computation Element Communication Protocol
       (PCEP) Extensions for Stateful PCE";
   }
            default 120;

   /*
    * Groupings
    */

   grouping pce-scope{
     description
                "The dead timer that this PCEP entity will propose
                 in the initial OPEN message of each session it is
                 involved in. This is the time after
       "This grouping defines PCE path computation scope
       information which a peer
                 should declare a session down if it does not
                 receive any PCEP messages. Zero suggests that the
                 peer does not run a dead timer at all." ; maybe relevant to PCE selection.
       This information corresponds to PCE auto-discovery
       information.";
     reference
       "RFC 5440: 5088: OSPF Protocol Extensions for Path
       Computation Element (PCE)
                           Communication Discovery
       RFC 5089: IS-IS Protocol (PCEP)";
        } Extensions for Path
       Computation Element (PCE) Discovery";
     leaf allow-negotiation{ path-scope{
       type boolean; bits{
         bit intra-area-scope{
           description
                "Whether the PCEP entity will permit negotiation of
                 session parameters.";
             "PCE can compute intra-area paths.";
         }

        leaf max-keep-alive-timer{
            type uint32 {
                range "0..255";
         bit inter-area-scope{
           description
             "PCE can compute inter-area paths.";
         }
            units "seconds";
         bit inter-area-scope-default{
           description
                "In PCEP session parameter negotiation in seconds,
                 the maximum value that this PCEP entity will
                 accept from
             "PCE can act as a peer default PCE for the interval between
                 Keepalive transmissions. Zero means that the PCEP
                 entity will allow no Keepalive transmission at
                 all." ; inter-area
             path computation.";
         }

        leaf max-dead-timer{
            type uint32 {
                range "0..255";
         bit inter-as-scope{
           description
             "PCE can compute inter-AS paths.";
         }
            units "seconds";
         bit inter-as-scope-default{
           description
                "In PCEP session parameter negotiation in seconds,
                 the maximum value that this PCEP entity will accept
                 from a peer for the Dead timer.  Zero means that
                 the PCEP entity will allow not running
             "PCE can act as a Dead
                 timer."; default PCE for inter-AS
             path computation.";
         }
         bit inter-layer-scope{
           description
             "PCE can compute inter-layer paths.";
         }

        leaf min-keep-alive-timer{
            type uint32 {
                range "0..255";
       }
            units "seconds";
       description
                "In PCEP session parameter negotiation in seconds,
                 the minimum value that this PCEP entity will
                 accept for the interval between Keepalive
                 transmissions. Zero means that
         "The field corresponding to the PCEP entity
                 insists on no Keepalive transmission at all."; path scope bits";
     }

     leaf min-dead-timer{ intra-area-pref{
       type uint32 { uint8{
         range "0..255"; "0..7";
       }
            units "seconds";
       description
                 "In PCEP session parameter negotiation in
                  seconds, the minimum value that this PCEP entity
                  will accept
         "The PCE's preference for the Dead timer.  Zero means that
                  the PCEP entity insists on not running a Dead
                  timer."; intra-area TE LSP
         computation.";
     }

     leaf sync-timer{
            if-feature svec; inter-area-pref{
       type uint32 { uint8{
         range "0..65535";
            }
            units "seconds";
            default 60;
            description
                "The value of SyncTimer in seconds is used in the
                 case of synchronized path computation request
                 using the SVEC object. Consider the case where a
                 PCReq message is received by a PCE that contains
                 the SVEC object referring to M synchronized path
                 computation requests.  If after the expiration of
                 the SyncTimer all the M path computation requests
                 have not been, received a protocol error is
                 triggered and the PCE MUST cancel the whole set
                 of path computation requests.
                 The aim of the SyncTimer is to avoid the storage
                 of unused synchronized requests should one of
                 them get lost for some reasons (for example, a
                 misbehaving PCC).
                 Zero means that the PCEP entity does not use the
                 SyncTimer.";
            reference
                "RFC 5440: Path Computation Element (PCE)
                           Communication Protocol (PCEP)"; "0..7";
       }
       description
         "The PCE's preference for inter-area TE LSP
         computation.";
     }

     leaf request-timer{ inter-as-pref{
       type uint32 { uint8{
         range "1..65535"; "0..7";
       }
            units "seconds";
       description
         "The maximum time that the PCEP entity will wait PCE's preference for a response to a PCReq message."; inter-AS TE LSP
         computation.";
     }

     leaf max-sessions{ inter-layer-pref{
       type uint32; uint8{
       range "0..7";
       }
       description
               "Maximum number of sessions involving this PCEP
                entity that can exist at any time.";
         "The PCE's preference for inter-layer TE LSP
         computation.";
     }
   }//pce-scope

   grouping domain{
     description
       "This grouping specifies a Domain where the
       PCEP speaker has topology visibility.";
     leaf max-unknown-reqs{ domain-type{
       type uint32;
            default 5; domain-type;
       description
         "The maximum number of unrecognized requests and
               replies that any session on this PCEP entity is
               willing to accept per minute before terminating
               the session.
               A PCRep message contains an unrecognized reply
               if it contains an RP object whose request ID
               does not correspond to any in-progress request
               sent by this PCEP entity.
               A PCReq message contains an unrecognized request
               if it contains an RP object whose request ID is
               zero.";
            reference
                "RFC 5440: Path Computation Element (PCE)
                           Communication Protocol (PCEP)"; domain type.";
     }
     leaf max-unknown-msgs{ domain{
       type uint32;
            default 5; domain;
       description
         "The maximum number of unknown messages that any
              session on this PCEP entity is willing domain Information.";
     }
   }//domain

   grouping info{
     description
       "This grouping specifies all information which
       maybe relevant to accept
              per minute before terminating both PCC and PCE.
       This information corresponds to PCE auto-discovery
       information.";
     container domain{
       description
         "The local domain for the session.";
            reference
                "RFC 5440: Path Computation Element (PCE)
                           Communication Protocol (PCEP)"; PCEP entity";
       list domain{
         key "domain-type domain";
         description
           "The local domain.";
         uses domain{
           description
             "The local domain for the PCEP entity.";
         }

    }//pcep-entity-info

    grouping pce-scope{
       }
     }
     container capability{
       description
            "This grouping defines PCE path computation scope
         "The PCEP entity capability information which of local
         PCEP entity. This maybe relevant to PCE selection. selection
         as well. This information corresponds to PCE auto-discovery auto-
         discovery information.";
       reference
         "RFC 5088: OSPF Protocol Extensions for Path
         Computation Element (PCE) Discovery
         RFC 5089: IS-IS Protocol Extensions for Path
         Computation Element (PCE) Discovery";
       leaf intra-area-scope{ capability{
         type boolean;
            default true; bits{
           bit gmpls{
             if-feature gmpls;
             description
                "PCE can compute intra-area paths.";
               "Path computation with GMPLS link
               constraints.";
           }
           bit bi-dir{
             description
               "Bidirectional path computation.";
           }
           bit diverse{
             description
               "Diverse path computation.";
           }
           bit load-balance{
             description
               "Load-balanced path computation.";
           }
           bit synchronize{
             if-feature svec;
             description
               "Synchronized paths computation.";
           }
           bit objective-function{
             if-feature objective-function;
             description
               "Support for multiple objective functions.";
           }
           bit add-path-constraint{
             description
               "Support for additive path constraints (max
               hop count, etc.).";
           }
           bit prioritization{
             description
               "Support for request prioritization.";
           }
           bit multi-request{
             description
               "Support for multiple requests per message.";
           }
           bit global-concurrent{
             if-feature global-concurrent;
             description
               "Support for Global Concurrent Optimization
               (GCO).";
           }
           bit p2mp{
             if-feature p2mp;
             description
               "Support for P2MP path computation.";
           }
           bit active{
             if-feature stateful;
             description
               "Support for active stateful PCE.";
           }
           bit passive{
             if-feature stateful;
             description
               "Support for passive stateful PCE.";
           }
           bit p2mp-active{
             if-feature stateful;
             if-feature p2mp;
             description
               "Support for active stateful PCE for P2MP.";
           }
           bit p2mp-passive{
             if-feature stateful;
             if-feature p2mp;
             description
               "Support for passive stateful PCE for P2MP.";
           }
           bit p2mp-pce-initiated{
             if-feature stateful;
             if-feature pce-initiated;
             if-feature p2mp;
             description
               "Support for PCE-initiated LSP for P2MP.";
           }
         }
         description
           "The bits string indicating the capabiliies";
         reference
           "RFC 5088: OSPF Protocol Extensions for Path
           Computation Element (PCE) Discovery
           RFC 5089: IS-IS Protocol Extensions for Path
           Computation Element (PCE) Discovery";
       }
       leaf intra-area-pref{ pce-initiated{
         if-feature pce-initiated;
         type uint8{
                range "0..7"; boolean;
         description
           "Set to true if PCE-initiated LSP capability is
           enabled.";
         reference
           "RFC 8281: Path Computation Element Communication
           Protocol (PCEP) Extensions for PCE-Initiated LSP
           Setup in a Stateful PCE Model";
       }
       leaf include-db-ver{
         if-feature stateful;
         if-feature sync-opt;
         type boolean;
         description
              "The PCE's preference for intra-area TE
           "Support inclusion of LSP-DB-VERSION
           in LSP
              computation."; object";
         reference
           "RFC 8232: Optimizations of Label Switched Path State
           Synchronization Procedures for a Stateful PCE";
       }
       leaf inter-area-scope{ trigger-resync{
         if-feature stateful;
         if-feature sync-opt;
         type boolean;
            default false;
         description
                "PCE can compute inter-area paths.";
           "Support PCE triggered re-synchronization";
         reference
           "RFC 8232: Optimizations of Label Switched Path State
           Synchronization Procedures for a Stateful PCE";
       }
       leaf inter-area-scope-default{ trigger-initial-sync{
         if-feature stateful;
         if-feature sync-opt;
         type boolean;
            default false;
         description
           "PCE can act as a default PCE triggered initial synchronization";
         reference
           "RFC 8232: Optimizations of Label Switched Path State
           Synchronization Procedures for inter-area
                 path computation."; a Stateful PCE";
       }
       leaf inter-area-pref{ incremental-sync{
         if-feature stateful;
         if-feature sync-opt;
         type uint8{
                range "0..7";

            } boolean;
         description
              "The PCE's preference
           "Support incremental (delta) sync";
         reference
           "RFC 8232: Optimizations of Label Switched Path State
           Synchronization Procedures for inter-area TE LSP
              computation."; a Stateful PCE";
       }
       container sr{
         if-feature sr;
         description
           "If segment routing is supported";
         reference
           "I-D.ietf-pce-segment-routing: PCEP Extensions for Segment
           Routing";
         leaf inter-as-scope{ enabled{
           type boolean;
            default false;
           description
                "PCE can compute inter-AS paths.";
             "Set to true if SR is enabled";
         }
         leaf inter-as-scope-default{ msd-limit{
           type boolean;
           default false;
           description
                "PCE can act as a default PCE for inter-AS
                 path computation.";
        }
             "True indicates no limit on MSD, the
             leaf inter-as-pref{
            type uint8{
                range "0..7";
            }
            description
              "The PCE's preference for inter-AS TE LSP
              computation."; msd is ignored";
         }
         leaf inter-layer-scope{ nai{
           type boolean;
           default false;
           description
                "PCE can compute inter-layer paths.";
             "True indicates capability to resolve NAI
             to SID";
         }
       }//sr
     }//capability
     leaf inter-layer-pref{ msd{
       if-feature sr;
       type uint8{
                range "0..7";
            } uint8;
       description
              "The PCE's preference
         "Maximum SID Depth for inter-layer TE LSP
              computation.";
        }
    }//pce-scope

    grouping domain{
        description
            "This grouping specifies a Domain where the SR";
       reference
         "I-D.ietf-pce-segment-routing: PCEP speaker has topology visibility.";
        leaf domain-type{
            type domain-type;
            description
              "The domain type.";
        }
        leaf domain{
            type domain;
            description
              "The domain Information."; Extensions for Segment
         Routing";
     }
    }//domain
   }//info

   grouping capability{ pce-info{
     description
       "This grouping specifies a capability all PCE information of local PCEP entity. This
       which maybe relevant to the PCE selection as well. selection.
       This information corresponds to PCE auto-discovery
       information.";
        reference
            "RFC 5088: OSPF Protocol Extensions for Path
                       Computation Element (PCE)
                       Discovery
             RFC 5089: IS-IS Protocol Extensions for Path
                       Computation Element (PCE)
                       Discovery";
        leaf gmpls{
            if-feature gmpls;
            type boolean;
     container scope{
       description
              "Path
         "The path computation with GMPLS link
               constraints."; scope";
       uses pce-scope;
     }
        leaf bi-dir{
            type boolean;

     container neigh-domains{
       description
              "Bidirectional path computation.";
         "The list of neighbour PCE-Domain
         toward which a PCE can compute
         paths";
       list domain{
           key "domain-type domain";
           description
             "The neighbour domain.";

           uses domain{
             description
               "The PCE neighbour domain.";
           }
       }
     }
   }//pce-info

   grouping notification-instance-hdr {
     description
       "This group describes common instance specific data
       for notifications.";

     leaf diverse{ peer-addr {
       type boolean;
            description
              "Diverse leafref {
         path computation."; "/pcep/entity/peers/peer/addr";
       }
        leaf load-balance{
            type boolean;
       description
              "Load-balanced path computation.";
         "Reference to peer address";
     }
   }// notification-instance-hdr

   grouping notification-session-hdr {
     description
       "This group describes common session instance specific
       data for notifications.";

     leaf synchronize{
            if-feature svec; session-initiator {
       type boolean; leafref {
         path "/pcep/entity/peers/peer/sessions/" +
              "session/initiator";
       }
       description
              "Synchronized paths computation.";
         "Reference to pcep session initiator leaf";
     }
        leaf
   }// notification-session-hdr

   grouping of-list {
     description
       "List of OF";
     reference
       "RFC 5541: Encoding of Objective Functions in the Path
       Computation Element Communication Protocol (PCEP)";
     list objective-function{
            if-feature objective-function;
       key "of";
       description
         "The list of authorized OF";
       leaf of {
         type boolean; identityref{
           base te-types:objective-function-type;
         }
         description
              "Support for multiple objective functions.";
           "The OF authorized";
       }
     }
   }

   /*
    * Configuration data nodes
    */
   container pcep{

     presence
       "The PCEP is enabled";

     description
       "Parameters for list of configured PCEP entities
       on the device.";

     container entity {
       description
         "The configured PCEP entity on the device.";

       leaf add-path-constraint{ addr {
         type boolean; inet:ip-address;
         mandatory true;
         description
              "Support
           "The local Internet address of this PCEP entity.
           If operating as a PCE server, the PCEP entity
           listens on this address. If operating as a PCC,
           the PCEP entity binds outgoing TCP connections
           to this address. It is possible for additive path constraints (max
               hop count, etc.)."; the PCEP entity
           to operate both as a PCC and a PCE Server, in which
           case it uses this address both to listen for incoming
           TCP connections and to bind outgoing TCP connections.";
       }

       leaf prioritization{ enabled {
         type boolean;
         default true;
         description
              "Support for request prioritization.";
           "The administrative status of this PCEP
           Entity.";
       }

       leaf multi-request{ role {
         type boolean; pcep-role;
         mandatory true;
         description
              "Support for multiple requests per message.";
           "The role that this entity can play.
           Takes one of the following values.
           - unknown(0): this PCEP Entity role is not
           known.
           - pcc(1): this PCEP Entity is a PCC.
           - pce(2): this PCEP Entity is a PCE.
           - pcc-and-pce(3): this PCEP Entity is both
           a PCC and a PCE.";
       }

       leaf gco{
            if-feature gco; description {
         type boolean; string;
         description
              "Support for Global Concurrent Optimization
               (GCO).";
           "Description of the PCEP entity configured
           by the user";
       }

       leaf p2mp{ speaker-entity-id{
         if-feature p2mp; sync-opt;
         type boolean; string;
         description
              "Support
           "The Speaker Entity Identifier";
         reference
           "RFC 8232: Optimizations of Label Switched
           Path State  Synchronization Procedures for P2MP path computation.";
        }

        container stateful{
            if-feature stateful;
            description
                "If stateful PCE feature is present";
            leaf enabled{
                type boolean;
                description
                    "Enabled or Disabled";
           a Stateful PCE";
       }

       leaf active{ admin-status {
         type boolean;
         default true;
         description
                  "Support for active stateful PCE.";
           "The administrative status of this PCEP Entity.
           The value true represents admin status as up.
           This is the desired operational status as
           currently set by an operator or by default in
           the implementation. The value of oper-status
           represents the current status of an attempt to
           reach this desired status.";
       }

       leaf pce-initiated{
                if-feature pce-initiated; index{
         type boolean; uint32;
         config "false";
         description
                  "Support for PCE-initiated LSP.";
           "The index of the operational PECP entity";
       }

       leaf include-db-ver{
                if-feature stateful-sync-opt; oper-status {
         type boolean; pcep-oper-status;
         config "false";
         description
                    "Support inclusion
           "The operational status of LSP-DB-VERSION
                    in LSP object"; the PCEP entity.
           Takes one of the following values.
           - oper-status-up(1): the PCEP entity is active.
           - oper-status-down(2): the PCEP entity is inactive.
           - oper-status-going-up(3): the PCEP entity is
           activating.
           - oper-status-going-down(4): the PCEP entity is
           deactivating.
           - oper-status-failed(5): the PCEP entity has
           failed and will recover when possible.
           - oper-status-failed-perm(6): the PCEP entity
           has failed and will not recover without
           operator intervention.";
       }
            leaf trigger-resync{
                if-feature stateful-sync-opt;
                type boolean;

       uses info {
         description
                    "Support PCE triggered re-synchronization";
           "Local PCEP entity information";
       }
            leaf trigger-initial-sync{
                if-feature stateful-sync-opt;
                type boolean;

       container pce-info {
         when "../role = 'pce'" +
              "or " +
              "../role = 'pcc-and-pce'"
         {
           description
                    "PCE triggered initial synchronization";
             "These fields are applicable when the role is PCE.";
         }
            leaf incremental-sync{
                if-feature stateful-sync-opt;
                type boolean;
         description
                    "Support incremental (delta) sync";
            }
           "The Local PCE Entity PCE information";
         uses pce-info {
           description
             "Local PCE information";
         }
         container sr{ path-key {
           if-feature sr; path-key;
           description
                "If segment routing is supported";
             "Path-Key Configuration";
           reference
             "RFC 5520: Preserving Topology Confidentiality in Inter-
             Domain Path Computation Using a Path-Key-Based Mechanism";

           leaf enabled{ enabled {
             type boolean;
             description
               "Enabled or Disabled";
           }
           leaf msd{ discard-timer {
             type uint8; uint32;
             units "minutes";
             default 10;
             description
                    "Maximum SID Depth";
               "A timer to discard unwanted path-keys";
           }
           leaf msd-limit{ reuse-time {
             type boolean; uint32;
             units "minutes";
             default false; 30;
             description
                    "True indicates no limit on MSD,
               "A time after which the
                    leaf msd is ignored"; path-keys could be reused";
           }
           leaf nai{ pce-id {
             type boolean;
                default false; inet:ip-address;
             description
                    "True indicates capability to resolve NAI
               "PCE Address to SID";
            } be used in each Path-Key Subobject
               (PKS)";
           }
    }//capability

    grouping info{
        description
            "This grouping specifies all information which
             maybe relevant to both PCC and PCE.
             This information corresponds to PCE auto-discovery
             information.";
        container domain{
            description
                "The local domain for the PCEP entity";
            list domain{
                key "domain-type domain";
                description
                    "The local domain.";
                uses domain{
                    description
                        "The local domain for the PCEP entity.";
         }
       }
       leaf connect-timer {
         type uint16 {
           range "1..65535";
         }
        container capability{
         units "seconds";
         default 60;
         description
           "The time in seconds that the PCEP entity capability";
            uses capability{
                description
                    "The will wait
           to establish a TCP connection with a peer.  If a
           TCP connection is not established within this time
           then PCEP entity supported
                    capabilities.";

            } aborts the session setup attempt.";
         reference
           "RFC 5440: Path Computation Element (PCE) Communication
           Protocol (PCEP)";
       }

    }//info

    grouping pce-info{
       leaf connect-max-retry {
         type uint32;
         default 5;
         description
            "This grouping specifies all PCE information
             which maybe relevant
           "The maximum number of times the system tries to
           establish a TCP connection to a peer before the PCE selection.
             This information corresponds
           session with the peer transitions to PCE auto-discovery
             information.";
        container scope{ the idle
           state.";
         reference
           "RFC 5440: Path Computation Element (PCE) Communication
           Protocol (PCEP)";
       }

       leaf init-backoff-timer {
         type uint16 {
           range "1..65535";
         }
         units "seconds";
         description
           "The path computation scope";
            uses pce-scope; initial back-off time in seconds for retrying
           a failed session setup attempt to a peer.
           The back-off time increases for each failed
           session setup attempt, until a maximum back-off
           time is reached.  The maximum back-off time is
           max-backoff-timer.";
         reference
           "RFC 5440: Path Computation Element (PCE) Communication
           Protocol (PCEP)";
       }

        container neigh-domains{

       leaf max-backoff-timer {
         type uint32;
           units "seconds";
         description
           "The list of neighbour PCE-Domain
                 toward which maximum back-off time in seconds for retrying
           a PCE can compute
                 paths";
            list domain{
                key "domain-type domain";

                description
                    "The neighbour domain.";
                uses domain{
                    description
                        "The PCE neighbour domain.";
                } failed session setup attempt to a peer.
           The back-off time increases for each failed session
           setup attempt, until this maximum value is reached.
           Session setup attempts then repeat periodically
           without any further increase in back-off time.";
         reference
           "RFC 5440: Path Computation Element (PCE) Communication
           Protocol (PCEP)";
       }

       leaf open-wait-timer {
         type uint16 {
           range "1..65535";
         }
    }//pce-info

    grouping lsp-state{
         units "seconds";
         default 60;
         description
            "This grouping defines the attributes for LSP
           "The time in LSP-DB.
             These are seconds that the attributes specifically PCEP entity will wait
           to receive an Open message from a peer after the
           TCP connection has come up.
           If no Open message is received within this time then
           PCEP
             perspective"; terminates the TCP connection and deletes the
           associated sessions.";
         reference
           "RFC 5440: Path Computation Element (PCE) Communication
           Protocol (PCEP)";
       }

       leaf plsp-id{ keep-wait-timer {
         type uint32{ uint16 {
           range "1..1048575"; "1..65535";
         }
         units "seconds";
         default 60;
         description
                "A PCEP-specific identifier for the LSP.  A PCC
                 creates a unique PLSP-ID for each LSP
           "The time in seconds that is
                 constant for the lifetime of a PCEP session.

                 PLSP-ID entity will wait
           to receive a Keepalive or PCErr message from a peer
           during session initialization after receiving an
           Open message.  If no Keepalive or PCErr message is 20 bits with 0
           received within this time then PCEP terminates the
           TCP connection and 0xFFFFF are
                 reserved"; deletes the associated
           sessions.";
         reference
           "RFC 5440: Path Computation Element (PCE) Communication
           Protocol (PCEP)";
       }

       leaf pcc-id{ keep-alive-timer {
         type inet:ip-address; uint8;
         units "seconds";
         default 30;
         description
           "The local internet address keep alive transmission timer that this PCEP
           entity will propose in the initial OPEN message of
           each session it is involved in.  This is the PCC,
           maximum time between two consecutive messages sent
           to a peer. Zero means that
                 generated the PLSP-ID.";
        }

        container lsp-ref{
            description
                "reference PCEP entity prefers
           not to ietf-te lsp state";

            leaf source {
                type leafref {
                    path "/te:te/te:lsps-state/te:lsp/te:source";
                }
                description
                  "Tunnel sender address extracted send Keepalives at all.
           Note that the actual Keepalive transmission
           intervals, in either direction of an active PCEP
           session, are determined by negotiation between the
           peers as specified by RFC 5440, and so may differ
           from
                  SENDER_TEMPLATE  object"; this configured value.";
         reference "RFC3209";
           "RFC 5440: Path Computation Element (PCE) Communication
           Protocol (PCEP)";
       }
       leaf destination dead-timer {
         type leafref uint8;
         units "seconds";
         must "(. > ../keep-alive-timer)" {
                    path "/te:te/te:lsps-state/te:lsp/te:"
           error-message "The dead timer must be "
              + "destination"; "larger than the keep alive timer";
         }
         default 120;
         description
                    "Tunnel endpoint address extracted from
                    SESSION object";
           "The dead timer that this PCEP entity will propose
           in the initial OPEN message of each session it is
           involved in. This is the time after which a peer
           should declare a session down if it does not
           receive any PCEP messages. Zero suggests that the
           peer does not run a dead timer at all.";
         reference "RFC3209";
           "RFC 5440: Path Computation Element (PCE) Communication
           Protocol (PCEP)";
       }

       leaf allow-negotiation{
         type boolean;
         description
           "Whether the PCEP entity will permit negotiation of
           session parameters.";
       }

       leaf tunnel-id { max-keep-alive-timer{
         type leafref {
                    path "/te:te/te:lsps-state/te:lsp/te:tunnel-id";
                } uint8;
         units "seconds";
         description
                    "Tunnel identifier used
           "In PCEP session parameter negotiation in seconds,
           the SESSION maximum value that remains constant over this PCEP entity will
           accept from a peer for the life
                    of interval between
           Keepalive transmissions. Zero means that the tunnel.";
                reference "RFC3209"; PCEP
           entity will allow no Keepalive transmission at
           all.";
       }

       leaf lsp-id { max-dead-timer{
         type leafref {
                    path "/te:te/te:lsps-state/te:lsp/te:lsp-id";
                } uint8;
         units "seconds";
         description
                    "Identifier used
           "In PCEP session parameter negotiation in seconds,
           the SENDER_TEMPLATE
                    and the FILTER_SPEC maximum value that can be changed
                    to allow this PCEP entity will accept
           from a sender to share resources with
                    itself.";
                reference "RFC3209";
            }
            leaf extended-tunnel-id {
                type leafref {
                    path "/te:te/te:lsps-state/te:lsp/te:"
                    + "extended-tunnel-id";
                }
                description
                    "Extended Tunnel ID of peer for the LSP.";
                reference "RFC3209";
            }
        }

        leaf admin-state{
            type boolean;
            description
                "The desired operational state";
        }
        leaf operational-state{
            type operational-state;
            description
                "The operational status of Dead timer.  Zero means that
           the LSP";
        }
        container delegated{
            description
                "The delegation related parameters";
            leaf enabled{
                type boolean;
                description
                    "LSP is delegated or not"; PCEP entity will allow not running a Dead
           timer.";

       }

       leaf peer{ min-keep-alive-timer{
         type leafref {
                    path "/pcep/entity/peers/peer/addr";
                }
                must "(../enabled = true())"
                {
                    error-message
                        "The LSP must be delegated";
                    description
                        "When LSP is a delegated LSP";
                } uint8;
         units "seconds";
         description
                    "At the PCC, the reference to the
           "In PCEP peer to
                    which LSP is delegated; At session parameter negotiation in seconds,
           the PCE, minimum value that this PCEP entity will
           accept for the
                    reference to interval between Keepalive
           transmissions. Zero means that the PCEP peer which delegated this
                    LSP"; entity
           insists on no Keepalive transmission at all.";
       }

       leaf srp-id{ min-dead-timer{
         type uint32; uint8;
         units "seconds";
         description
                    "The last SRP-ID-number associated with
           "In PCEP session parameter negotiation in
           seconds, the minimum value that this
                    LSP.";
            } PCEP entity
           will accept for the Dead timer.  Zero means that
           the PCEP entity insists on not running a Dead
           timer.";
       }
        container initiation {
            if-feature pce-initiated;
            description
                "The PCE initiation related parameters";

       leaf enabled{ sync-timer{
         if-feature svec;
         type boolean; uint16;
         units "seconds";
         default 60;
         description
                    "LSP
           "The value of SyncTimer in seconds is PCE-initiated or not";
            }
            leaf peer{
                type leafref { used in the
           case of synchronized path "/pcep/entity/peers/peer/addr";
                }
                must "(../enabled = true())"
                {
                    error-message
                        "The LSP must be PCE-Initiated";
                    description
                        "When computation request
           using the LSP must be PCE-Initiated";
                }
                description
                    "At SVEC object. Consider the PCC, case where a
           PCReq message is received by a PCE that contains
           the reference SVEC object referring to M synchronized path
           computation requests.  If after the PCEP peer
                    that initiated this LSP; At expiration of
           the PCE, SyncTimer all the
                    reference M path computation requests
           have not been, received a protocol error is
           triggered and the PCE MUST cancel the whole set
           of path computation requests.
           The aim of the SyncTimer is to avoid the storage
           of unused synchronized requests should one of
           them get lost for some reasons (for example, a
           misbehaving PCC).
           Zero means that the PCEP peer where entity does not use the LSP
                    is initiated";
            }
           SyncTimer.";
         reference
           "RFC 5440: Path Computation Element (PCE)
           Communication Protocol (PCEP)";
       }

       leaf symbolic-path-name{ request-timer{
         type string; uint16 {
           range "1..65535";
         }
         units "seconds";
         description
           "The symbolic path name associated with maximum time that the LSP."; PCEP entity will wait
           for a response to a PCReq message.";
       }

       leaf last-error{ max-sessions{
         type identityref {
                base lsp-error;
            } uint32;
         description
                "The last error for the LSP.";
           "Maximum number of sessions involving this PCEP
           entity that can exist at any time.";
       }

       leaf pst{ max-unknown-reqs{
         type identityref{
                base te-types:path-signaling-type;
            } uint32;
         default "te-types:path-setup-rsvp"; 5;
         description
           "The maximum number of unrecognized requests and
           replies that any session on this PCEP entity is
           willing to accept per minute before terminating
           the session.
           A PCRep message contains an unrecognized reply
           if it contains an RP object whose request ID
           does not correspond to any in-progress request
           sent by this PCEP entity.
           A PCReq message contains an unrecognized request
           if it contains an RP object whose request ID is
           zero.";
           reference
           "RFC 5440: Path Setup Type"; Computation Element (PCE)
           Communication Protocol (PCEP)";
       }

    }//lsp-state

    grouping notification-instance-hdr {
        description
            "This group describes common instance specific data
             for notifications.";

       leaf peer-addr { max-unknown-msgs{
         type leafref {
                path "/pcep/entity/peers/peer/addr";
            } uint32;
         default 5;
         description
                "Reference
           "The maximum number of unknown messages that any
           session on this PCEP entity is willing to peer address"; accept
           per minute before terminating the session.";
         reference
           "RFC 5440: Path Computation Element (PCE)
           Communication Protocol (PCEP)";
       }

    }// notification-instance-hdr

    grouping notification-session-hdr {
        description
        "This group describes common session instance specific
         data for notifications.";

       leaf session-initiator pcep-notification-max-rate {
         type leafref {
            path "/pcep/entity/peers/peer/sessions/" +
                 "session/initiator";
            } uint32;
         mandatory true;
         description
                "Reference
           "This variable indicates the maximum number of
           notifications issued per second. If events
           occur more rapidly, the implementation may
           simply fail to pcep session initiator leaf"; emit these notifications during
           that period, or may queue them until an
           appropriate time. A value of 0 means no
           notifications are emitted and all should be
           discarded (that is, not queued).";
       }
    }// notification-session-hdr

    grouping stateful-pce-parameter {
       container stateful-parameter{
         if-feature stateful;
         description
        "This group describes
           "The configured stateful PCE specific
         parameters."; parameters";
         leaf state-timeout{
           type uint32;
           units "seconds";
           description
             "When a PCEP session is terminated, a PCC
             waits for this time period before flushing
             LSP state associated with that PCEP session
             and reverting to operator-defined default
             parameters or behaviours.";
         }
         leaf redelegation-timeout{
           when "../../role = 'pcc'" +
                "or " +
                "../../role = 'pcc-and-pce'"
           {
             description
                    "Valid at
               "This field is applicable when the role is
               PCC";
           }
           type uint32;
           units "seconds";
           description
             "When a PCEP session is terminated, a PCC
             waits for this time period before revoking
             LSP delegation to a PCE and attempting to
             redelegate LSPs associated with the
             terminated PCEP session to an alternate
             PCE.";
         }
         leaf rpt-non-pcep-lsp{
           when "../../role = 'pcc'" +
                "or " +
                "../../role = 'pcc-and-pce'"
           {
             description
                    "Valid at
               "This field is applicable when the role is
               PCC";
           }
           type boolean;
           default true;
           description
             "If set, a PCC reports LSPs that are not
             controlled by any PCE (for example, LSPs
             that are statically configured at the
             PCC). ";
           }
           reference
             "RFC 8231: Path Computation Element Communication Protocol
             (PCEP) Extensions for Stateful PCE";
         }

    grouping authentication {
        description "Authentication Information";
         container auth of-list{
           when "../role = 'pce'" +
                "or " +
                "../role = 'pcc-and-pce'"
           {
             description
                "The Authentication options";
            choice auth-type-selection {
               "These field are applicable when the role is
               PCE";
           }
           if-feature objective-function;

           uses of-list;

           description
                    "Options
             "The authorized OF-List at PCE for expressing authentication setting.";
                case auth-key-chain { all peers";
         }
         container lsp-db{
           if-feature stateful;
           config false;
           description
             "The LSP-DB";
           leaf key-chain db-ver{
             when "../../role = 'pcc'" +
                  "or " +
                  "../../role = 'pcc-and-pce'"

             {
                        type key-chain:key-chain-ref;
               description
                            "key-chain name.";
                 "This field is applicable when the role is
                 PCC";
             }
             if-feature sync-opt;
             type uint64;
             description
               "The LSP State Database Version Number";
           }
                case auth-key
           list association-list {
             if-feature association;
             key "type id source global-source extended-id";
             description
               "List of all PCEP associations";
             reference
               "I-D.ietf-pce-association-group: PCEP
               Extensions for Establishing Relationships
               Between Sets of LSPs";
             leaf crypto-algorithm type {
               type identityref {
                 base key-chain:crypto-algorithm; te-types:association-type;
               }
                     mandatory true;
               description
                       "Cryptographic algorithm associated with key.";
                 "The PCEP association type";
             }
             leaf key id {
                     nacm:default-deny-all;
               type string; uint16;
               description
                       "This
                 "PCEP Association ID";
             }
             leaf specifies the authentication key."; source {
               type inet:ip-address;
               description
                 "PCEP Association Source.";
             }
             leaf global-source {
               type uint32;
               description
                 "PCEP Association Global Source.";
             }
                case auth-tls
             leaf extended-id{
               type string;
               description
                 "Additional information to support unique
                 identification.";
             }
             list lsp {
                    if-feature tls;
                    choice role{
               key "plsp-id pcc-id";
               description
                            "The role
                 "List of the local entity";
                        case server {
                            container tls-server all LSP in this association";
               leaf plsp-id {
                                uses tls-server:tls-server-grouping
                 type leafref {
                                description
                                    "Server TLS information.";
                   path "/pcep/entity/lsp-db/"
                        + "lsp/plsp-id";
                 }
                 description
                                    "TLS related information";
                            }
                   "Reference to PLSP-ID in LSP-DB";
               }
                        case client{
                            container tls-client
               leaf pcc-id {
                                uses tls-client:tls-client-grouping
                 type leafref {
                                description
                                    "Client TLS information.";
                   path "/pcep/entity/lsp-db/"
                        + "lsp/pcc-id";
                 }
                 description
                                    "TLS related information";
                            }
                        }
                    }
                }
                   "Reference to PCC-ID in LSP-DB";
               }
             }
           }

    grouping path-key
           list lsp {
             key "plsp-id pcc-id";
             description "Path-key related information";
               "List of all LSPs in LSP-DB";
             leaf enabled{ plsp-id{
               type boolean;
            description
                "Enabled or Disabled"; uint32{
                 range "1..1048575";
               }
        leaf discard-timer {
            type uint32;
            units "minutes";
            default 10;
               description
                 "A timer to discard unwanted path-keys"; PCEP-specific identifier for the LSP.  A PCC
                 creates a unique PLSP-ID for each LSP that is
                 constant for the lifetime of a PCEP session.
                 PLSP-ID is 20 bits with 0 and 0xFFFFF are
                 reserved";
             }
             leaf reuse-time { pcc-id{
               type uint32;
            units "minutes";
            default 30; inet:ip-address;
               description
                "A time after which
                 "The local internet address of the path-keys could be reused"; PCC, that
                 generated the PLSP-ID.";
             }
             container lsp-ref{
               description
                 "reference to ietf-te lsp state";

               leaf pce-id source {
                 type inet:ip-address; leafref {
                   path "/te:te/te:lsps-state/te:lsp/te:source";
                 }
                 description
                "PCE Address
                   "Tunnel sender address extracted from
                   SENDER_TEMPLATE object";
                 reference
                   "RFC 3209: RSVP-TE: Extensions to be used in each Path-Key Subobject
                (PKS)";
        } RSVP for
                   LSP Tunnels";
               }

    grouping path-key-state
               leaf destination {
                 type leafref {
                   path "/te:te/te:lsps-state/te:lsp/te:"
                        + "destination";
                 }
                 description "Table
                   "Tunnel endpoint address extracted from
                   SESSION object";
                 reference
                   "RFC 3209: RSVP-TE: Extensions to allow inspection of path-keys";
        list path-keys{
            key "path-key";

            description
                "The list of path-keys generated by the PCE"; RSVP for
                   LSP Tunnels";
               }
               leaf path-key tunnel-id {
                 type uint16; leafref {
                   path "/te:te/te:lsps-state/te:lsp/te:tunnel-id";
                 }
                 description
                    "The identifier, or token
                   "Tunnel identifier used to represent in the Confidential Path Segment (CPS) within SESSION
                   that remains constant over the context life
                   of the PCE"; tunnel.";
                 reference
                   "RFC 3209: RSVP-TE: Extensions to RSVP for
                   LSP Tunnels";
               }
            container cps {
                description
                    "The Confidential Path Segment (CPS)";
                list explicit-route-objects {
                    key "index";
                    description
                        "List of explicit route objects";
               leaf index lsp-id {
                 type uint32;
                        description
                          "ERO subobject index";
                    }
                    uses te-types:explicit-route-hop; leafref {
                   path "/te:te/te:lsps-state/te:lsp/te:lsp-id";
                 }
                 description
                   "Identifier used in the SENDER_TEMPLATE
                   and the FILTER_SPEC that can be changed
                   to allow a sender to share resources with
                   itself.";
                 reference
                   "RFC 3209: RSVP-TE: Extensions to RSVP for
                   LSP Tunnels";
               }
               leaf pcc-original extended-tunnel-id {
                 type leafref {
                   path "/pcep/entity/peers/peer/addr"; "/te:te/te:lsps-state/te:lsp/te:"
                        + "extended-tunnel-id";
                 }
                 description
                    "Reference to PCC peer address
                   "Extended Tunnel ID of the original request"; LSP.";
                 reference
                   "RFC 3209: RSVP-TE: Extensions to RSVP for
                   LSP Tunnels";
               }
             }

             leaf req-id { admin-state{
               type uint32; boolean;
               description
                 "The request ID desired operational state";
             }
             leaf operational-state{
               type operational-state;
               description
                 "The operational status of the original PCReq."; LSP";
             }
             container delegated{
               description
                 "The delegation related parameters";
               leaf retrieved  { enabled{
                 type boolean;
                 description
                    "If path-key has been retrieved yet";
                   "LSP is delegated or not";
               }
               leaf pcc-retrieved { peer{
                 type leafref {
                   path "/pcep/entity/peers/peer/addr";
                 }
                 must "(../retrieved "(../enabled = true())"
                 {
                   error-message
                     "The Path-key should LSP must be retreived";
                    description
                        "When Path-Key has been retreived"; delegated";
                 }
                 description
                    "Reference
                   "At the PCC, the reference to PCC the PCEP peer address to
                   which
                    retreived LSP is delegated; At the path-key";
            }
            leaf creation-time {
                type yang:timestamp;
                description
                    "The timestamp value at PCE, the time this Path-Key
                    was created.";
            }
            leaf discard-time {
                type uint32;
                units "minutes";
                description
                    "A time after which this path-keys will be
                    discarded";
            }
            leaf reuse-time {
                type uint32;
                units "minutes";
                description
                    "A time after
                   reference to the PCEP peer which this path-keys could be
                    reused";
            }
        }
    }

    grouping of-list {
        description "List of OF";
        list objective-function{
            key "of";

            description
                "The list of authorized OF"; delegated this
                   LSP";
               }
               leaf of { srp-id{
                 type identityref{
                    base te-types:objective-function-type;
                } uint32;
                 description
                   "The OF authorized";
            } last SRP-ID-number associated with this
                   LSP.";
               }
             }

    grouping pst-list
             container initiation {
        description "List of PST";
        list path-setup-type{
            key "pst";
               if-feature pce-initiated;
               description
                 "The list of authorized PST"; PCE initiation related parameters";
               reference
                 "RFC 8281: Path Computation Element Communication
                 Protocol (PCEP) Extensions for PCE-Initiated LSP
                 Setup in a Stateful PCE Model";
               leaf pst { enabled{
                 type identityref{
                    base te-types:path-signaling-type;
                } boolean;
                 description
                    "The PST authorized";
            }
        }
                   "Set to true if this LSP is initiated by a PCE";
               }

    grouping assoc-type-list {
        description "List of Association Type";
        list assoc-type{
            key "at";

            description
                "The list of authorized association
                types";
               leaf at { peer{
                 type identityref leafref {
                    base te-types:association-type;
                   path "/pcep/entity/peers/peer/addr";
                 }
                description
                 must "(../enabled = true())"
                 {
                   error-message
                     "The association type authorized"; LSP must be PCE-Initiated";
                 }
                 description
                   "At the PCC, the reference to the PCEP peer
                   that initiated this LSP; At the PCE, the
                   reference to the PCEP peer where the LSP
                   is initiated";
               }
             }

    grouping association {
        description
            "Generic Association parameters";
             leaf symbolic-path-name{
               type {
            type identityref {
                base te-types:association-type;
            } string;
               description
                 "The PCEP association type"; symbolic path name associated with the LSP.";
               reference
                 "RFC 8231: Path Computation Element Communication
                 Protocol (PCEP) Extensions for Stateful PCE";
             }
             leaf id { last-error{
               type uint16;
            description
                "PCEP Association ID";
        }
        leaf source identityref {
          type inet:ip-address;
          description
                "PCEP Association Source.";
                 base lsp-error;
               }
        leaf global-source {
          type uint32;
               description
                "PCEP Association Global
                Source.";
                 "The last error for the LSP.";
             }
             leaf extended-id{ pst{
               type string;
            description
                "Additional information to
                support unique identification."; identityref{
                 base te-types:path-signaling-type;
               }
               default "te-types:path-setup-rsvp";
               description
                 "The Path Setup Type";
               reference
                 "RFC 8408: Conveying Path Setup Type in PCE
                 Communication Protocol (PCEP) Messages";
             }
    grouping association-ref
             list association-list {
               if-feature association;
               key "type id source global-source extended-id";
               description
            "Generic Association parameters";
                 "List of all PCEP associations";
               leaf type {
                 type leafref {
                 path "/pcep/entity/lsp-db/"
                      + "association-list/type";
                 }
                 description
                   "PCEP Association Type";
               }
               leaf id {
                 type leafref {
                 path "/pcep/entity/lsp-db/"
                      + "association-list/id";
                 }
                 description
                   "PCEP Association ID";
               }
               leaf source {
                 type leafref {
                 path "/pcep/entity/lsp-db/"
                      + "association-list/source";
                 }
                 description
                   "PCEP Association Source.";
               }
               leaf global-source {
                 type leafref {
                   path "/pcep/entity/lsp-db/"
                        + "association-list/global-source";
                 }
                 description
                   "PCEP Association Global Source.";
               }
               leaf extended-id{
                 type leafref {
                   path "/pcep/entity/lsp-db/"
                        + "association-list/extended-id";
                 }
                 description
                   "Additional information to
                   support unique identification.";
               }
               reference
                 "I-D.ietf-pce-association-group: PCEP
                 Extensions for Establishing Relationships
                 Between Sets of LSPs";
             }
           }
         }

    grouping session-grouping {
        description
                "Session grouping";
         container sessions path-keys {
           when "../role = 'pce' or ../role = 'pcc-and-pce'" {
             description
               "These fields are applicable when the role is
               PCE";
           }
           if-feature path-key;
           config false;
           description
                "This entry represents a single PCEP
                 session in which the local PCEP entity participates.
                 This entry exists only if the corresponding PCEP
                 session has been initialized
             "The path-keys generated by some event, such as
                 manual user configuration, auto-discovery of the PCE";
           reference
             "RFC 5520: Preserving Topology Confidentiality
             in Inter-Domain Path Computation Using a peer,
                 or an incoming TCP connection."; Path-
             Key-Based Mechanism";
           list session { path-keys{
             key "initiator"; "path-key";
             description
               "The list of sessions, note that
                     for a time being two sessions
                     may exist for a peer";

                leaf initiator {
                    type pcep-initiator;
                    description
                        "The initiator of the session,that is, whether
                         the TCP connection was initiated by the local
                         PCEP entity or the peer.
                         There is a window during session
                         initialization where two sessions can exist
                         between a pair of PCEP speakers, each
                         initiated by one of the speakers. One of
                         these sessions is always discarded before it
                         leaves OpenWait state. However, before it is
                         discarded, two sessions to the given peer
                         appear transiently in this yang module. The
                         sessions are distinguished path-keys generated by who initiated
                         them, and so this field is the key.";
                } PCE";
             leaf role path-key {
               type leafref {
                        path "/pcep/entity/role";
                    } uint16;
               description
                 "The reference identifier, or token used to peer role .";
                }

                leaf state-last-change {
                    type yang:timestamp;
                    description
                        "The timestamp value at represent
                 the time this
                         session entered its current state as
                         denoted by Confidential Path Segment (CPS) within
                 the state leaf."; context of the PCE";
             }

                leaf state
             container cps {
                    type pcep-sess-state;
               description
                 "The current state of the session.
                         The set Confidential Path Segment (CPS)";
               list explicit-route-objects {
                 key "index";
                 description
                   "List of possible states excludes the
                         idle state since entries do not exist
                         in the idle state.";
                } explicit route objects";
                 leaf session-creation index {
                   type yang:timestamp; uint32;
                   description
                        "The timestamp value at the time this
                         session was created.";
                     "ERO subobject index";
                 }
                 uses te-types:explicit-route-hop;
               }
             }
             leaf connect-retry pcc-original {
               type yang:counter32; leafref {
                 path "/pcep/entity/peers/peer/addr";
               }
               description
                        "The number
                 "Reference to PCC peer address of times that
                 the local PCEP
                         entity has attempted to establish a TCP
                         connection for this session without
                         success. The PCEP entity gives up when
                         this reaches connect-max-retry."; original request";
             }
             leaf local-id req-id {
               type uint32 {
                        range "0..255";
                    } uint32;
               description
                 "The value of the PCEP session ID used by
                         the local PCEP entity in the Open message
                         for this session. If state is tcp-pending
                         then this is the session ID that will be
                         used in the Open message. Otherwise, this
                         is the session request ID that was sent in of the
                         Open message."; original PCReq.";
             }
             leaf remote-id retrieved  {
               type uint32 {
                        range "0..255";
                    }
                    must "((../state != 'tcp-pending'" +
                         "and " +
                         "../state != 'open-wait' )" +
                         "or " +
                         "((../state = 'tcp-pending'" +
                         " or " +
                         "../state = 'open-wait' )" +
                         "and (. = 0)))" {
                           error-message
                               "Invalid remote-id"; boolean;
               description
                 "If state is tcp-
                                pending or open-wait
                                then this leaf is not
                                used and MUST be set
                                to zero.";
                         }
                    description
                        "The value of the PCEP session
                         ID used by the peer in its
                         Open message for this
                         session."; path-key has been retrieved yet";
             }
             leaf keepalive-timer pcc-retrieved {
               type uint32 leafref {
                        range "0..255";
                 path "/pcep/entity/peers/peer/addr";
               }
                    units "seconds";
               must "(../state = 'session-up'" +
                         "or " +
                         "(../state != 'session-up'" +
                         "and (. "(../retrieved = 0)))" true())"
               {
                 error-message
                                "Invalid keepalive
                                 timer";
                            description
                                "This field is used if
                                 and only if state is
                                 session-up. Otherwise,
                                 it is not used and
                                 MUST
                   "The Path-key should be set retreived";
               }
               description
                 "Reference to
                                 zero."; PCC peer address which
                 retreived the path-key";
             }
             leaf creation-time {
               type yang:timestamp;
               description
                 "The agreed maximum interval timestamp value at
                         which the local PCEP entity
                         transmits PCEP messages on
                         this PCEP session.  Zero means
                         that the local PCEP entity
                         never sends Keepalives on time this
                         session."; Path-Key
                 was created.";
             }
             leaf peer-keepalive-timer discard-time {
               type uint32 {
                        range "0..255";
                   } uint32;
               units "seconds";
                   must "(../state = 'session-up'" +
                        "or "   +
                        "(../state != 'session-up'" +
                        "and " +
                        "(. = 0)))" "minutes";
               description
                 "A time after which this path-keys will be
                 discarded";
             }
             leaf reuse-time {
                        error-message
                            "Invalid Peer keepalive
                             timer";
               type uint32;
               units "minutes";
               description
                            "This field is used if
                                and only if state is
                                session-up. Otherwise,
                                it is not used and MUST
                 "A time after which this path-keys could be set to zero.";
                 reused";
             }
           }
         }
         container peers{
           description
             "The agreed maximum interval at
                        which list of configured peers for the
             entity (remote PCE)";
           list peer{
             key "addr";
             description
               "The peer transmits configured for the entity.
               (remote PCE)";

             leaf addr {
               type inet:ip-address;
               description
                 "The local Internet address of this
                 PCEP peer.";
             }
             leaf role {
               type pcep-role;
               mandatory true;
               description
                 "The role of the PCEP Peer.
                 Takes one of the following values.
                 - unknown(0): this PCEP peer role is not
                 known.
                 - pcc(1): this PCEP
                        messages on peer is a PCC.
                 - pce(2): this PCEP session.
                        Zero means that the peer never
                        sends Keepalives on is a PCE.
                 - pcc-and-pce(3): this
                        session."; PCEP peer
                 is both a PCC and a PCE.";
             }

             leaf dead-timer description {
               type uint32 string;
               description
                 "Description of the PCEP peer
                 configured by the user";
             }
             uses info {
                        range "0..255";
               description
                 "PCE Peer information";
             }

             container pce-info {
               uses pce-info {
               description
                 "PCE Peer information";
               }
                    units "seconds";
               description
                 "The dead timer interval for
                         this PCEP session."; PCE Peer information";
             }

             leaf peer-dead-timer { delegation-pref{
               if-feature stateful;
               type uint32 { uint8{
                 range "0..255"; "0..7";
               }
                    units "seconds";
                    must "((../state != 'tcp-pending'" +
                         "and " +
                         "../state != 'open-wait' )" +
                         "or " +
                         "((../state = 'tcp-pending'" +
                         " or " +
                         "../state = 'open-wait' )" +
                         "and " +
                         "(. = 0)))" {
                            error-message
                               "Invalid Peer Dead
                                timer";
               description
                                "If state is tcp-
                                 pending or open-wait
                                 then this leaf is not
                                 used and MUST be set to
                                 zero.";
                 "The PCE peer delegation preference.";
             }
             container auth {
               description
                 "The peer's dead-timer interval Authentication options";
               choice auth-type-selection {
                 description
                   "Options for this PCEP session.";

                } expressing authentication
                   setting.";
                 case auth-key-chain {
                   leaf ka-hold-time-rem key-chain {
                     type uint32 {
                        range "0..255"; kc:key-chain-ref;
                     description
                       "key-chain name.";
                   }
                    units "seconds";
                    must "((../state != 'tcp-pending'" +
                         "and " +
                         "../state != 'open-wait' ) " +
                         "or " +
                         "((../state = 'tcp-pending'" +
                         "or " +
                         "../state = 'open-wait' )" +
                         "and " +
                         "(. = 0)))"
                 }
                 case auth-key {
                            error-message
                                "Invalid Keepalive hold
                                 time remaining";
                            description
                                "If state is tcp-pending
                                 or open-wait then this
                                 field is not used and
                                 MUST be set to zero.";
                   leaf crypto-algorithm {
                     type identityref {
                       base kc:crypto-algorithm;
                     }
                     mandatory true;
                     description
                        "The keep alive hold time
                         remaining for this session.";
                       "Cryptographic algorithm associated
                       with key.";
                   }
                   choice key-string-style {
                     description
                       "Key string styles";
                     case keystring {
                       leaf overloaded keystring {
                         nacm:default-deny-all;
                         type boolean; string;
                         description
                        "If the local PCEP entity has
                         informed the peer that it is
                         currently overloaded, then
                         this is set to true.
                         Otherwise, it is set to
                         false.";
                           "Key string in ASCII format.";
                       }
                     }
                     case hexadecimal {
                       if-feature "kc:hex-key-string";
                       leaf overload-time hexadecimal-string {
                         nacm:default-deny-all;
                         type uint32;
                    units "seconds";
                    must "((../overloaded = true()) " +
                         "or ((../overloaded != true()) " +
                         "and (. = 0)))" {
                                error-message
                                    "Invalid overload-time"; yang:hex-string;
                         description
                                    "This field is only used
                                     if overloaded is set
                           "Key in hexadecimal string format. When
                           compared to
                                     true. Otherwise, ASCII, specification in
                           hexadecimal affords greater key entropy
                           with the same number of internal
                           key-string octets.  Additionally, it is
                                     not used and MUST be
                                     set to zero.";
                           discourages usage of well-known words or
                           numbers.";
                       }
                     }
                   }
                 }
                 case auth-tls {
                   if-feature tls;
                   choice role{
                     description
                       "The interval role of time that is
                          remaining until the local PCEP
                          entity will cease to be
                          overloaded on this session.";
                }
                leaf peer-overloaded entity";
                   case server {
                    type boolean;
                    description
                        "If the peer has informed the
                         local PCEP entity that it is
                         currently overloaded, then
                         this is set to true.
                         Otherwise, it is set to
                         false.";
                }

                leaf peer-overload-time
                     container tls-server {
                    type uint32;
                    units "seconds";
                    must "((../peer-overloaded = " +
                         "true()) or " +
                         "((../peer-overloaded !=" +
                         "true())" +
                         " and " +
                         "(. = 0)))"
                       uses ts:tls-server-grouping {
                            error-message
                                "Invalid peer overload
                                 time";
                     description
                                "This field is only used
                                 if peer-overloaded is
                                 set to true. Otherwise,
                                 it is not used and MUST
                                 be set to zero.";
                       "Server TLS information.";
                     }
                     description
                       "TLS related information";
                     }
                   }
                   case client{
                     container tls-client {
                       uses tc:tls-client-grouping {
                       description
                         "Client TLS information.";
                       }
                       description
                         "TLS related information";
                     }
                   }
                 }
               }
             }
           }

           leaf discontinuity-time {
             type yang:timestamp;
             config false;
             description
               "The interval timestamp of the time that is
                         remaining until when the peer will
                         cease information and
               statistics were last reset.";
           }

           leaf initiate-session {
             type boolean;
             config false;
             description
               "Indicates whether the local PCEP entity initiates
               sessions to be overloaded.  If it
                         is not known how long this peer, or waits for the peer
                         will stay in overloaded state,
                         this leaf is set to zero.";
               initiate a session.";
           }

           leaf lspdb-sync {
                    if-feature stateful; session-exists{
             type sync-state; boolean;
             config false;
             description
               "Indicates whether a session with
               this peer currently exists.";
           }

           leaf session-up-time{
             type yang:timestamp;
             config false;
             description
               "The LSP-DB state
                         synchronization status."; timestamp value of the last time a
               session with this peer was successfully
               established.";
           }

           leaf recv-db-ver{
                    when "../role = 'pcc'" +
                         "or " +
                         "../role = 'pcc-and-pce'"
                    { session-fail-time{
             type yang:timestamp;
             config false;
             description
                            "Valid for PCEP Peer as
                             PCC";
               "The timestamp value of the last time a
               session with this peer failed to be
               established.";
           }

                    if-feature stateful;
                    if-feature stateful-sync-opt;

           leaf session-fail-up-time{
             type uint64; yang:timestamp;
             config false;
             description
               "The timestamp value of the last received LSP State
                         Database Version Number"; time a
               session with this peer failed from
               active.";
           }

           container of-list{
                    when "../role = 'pce'" +
                         "or " +
                         "../role = 'pcc-and-pce'" sessions {
             config false;
             description
                            "Valid for
               "This entry represents a single PCEP Peer
               session in which the local PCEP entity participates.
               This entry exists only if the corresponding PCEP
               session has been initialized by some event, such as
                             PCE";
                    }
                    if-feature objective-function;

                    uses of-list;
               manual user configuration, auto-discovery of a peer,
               or an incoming TCP connection.";

             list session {
               key "initiator";
               description
                        "Indicate the
                 "The list of supported
                         OF on this session";
                }
                container pst-list{
                    when "../role = 'pce'" +
                         "or " +
                         "../role = 'pcc-and-pce'" sessions, note that for a time being
                 two sessions may exist for a peer";

               leaf initiator {
                 type pcep-initiator;
                 description
                            "Valid for
                   "The initiator of the session,that is, whether
                   the TCP connection was initiated by the local
                   PCEP Peer as
                             PCE";
                    }

                    uses pst-list;

                    description
                        "Indicate entity or the list peer.
                   There is a window during session
                   initialization where two sessions can exist
                   between a pair of PCEP speakers, each
                   initiated by one of supported
                         PST on this session";
                }

                container assoc-type-list{
                    if-feature association;

                    uses assoc-type-list;

                    description
                        "Indicate the list speakers. One of supported
                         association types on
                   these sessions is always discarded before it
                   leaves OpenWait state. However, before it is
                   discarded, two sessions to the given peer
                   appear transiently in this session"; yang module. The
                   sessions are distinguished by who initiated
                   them, and so this field is the key.";
               }

               leaf speaker-entity-id{
                    if-feature stateful-sync-opt; role {
                 type string; leafref {
                   path "/pcep/entity/role";
                 }
                 description
                   "The Speaker Entity Identifier"; reference to peer role .";
               }

               leaf discontinuity-time state-last-change {
                 type yang:timestamp;
                 description
                   "The timestamp value of at the time when the statistics were
                          last reset.";
                }
            } // this
                   session entered its current state as
                   denoted by the state leaf.";
               } // sessions
    }
    /*
     * Configuration data nodes
     */

    container pcep{

        presence
            "The PCEP is enabled";

               leaf state {
                 type pcep-sess-state;
                 description
            "Parameters for list
                   "The current state of configured PCEP entities
             on the device.";

        container entity session.
                   The set of possible states excludes the
                   idle state since entries do not exist
                   in the idle state.";
               }

               leaf session-creation {
                 type yang:timestamp;
                 description
                   "The configured PCEP entity on timestamp value at the device."; time this
                   session was created.";
               }

               leaf addr connect-retry {
                 type inet:ip-address;
                mandatory true; yang:counter32;
                 description
                   "The local Internet address number of this PCEP
                    entity.
                    If operating as a PCE server, times that the local PCEP
                   entity listens on this address.
                    If operating as has attempted to establish a PCC, the PCEP entity
                    binds outgoing TCP connections to this
                    address.
                    It is possible
                   connection for the this session without
                   success. The PCEP entity to
                    operate both as a PCC and a PCE Server, in
                    which case it uses gives up when
                   this address both to
                    listen for incoming TCP connections and to
                    bind outgoing TCP connections."; reaches connect-max-retry.";
               }

               leaf enabled local-id {
                 type boolean;
                default true; uint8;
                 description
                   "The administrative status value of this the PCEP session ID used by
                   the local PCEP
                     Entity.";
            }

            leaf role {
                type pcep-role;
                mandatory true;
                description
                    "The role that this entity can play.
                     Takes one of in the following values.
                     - unknown(0): Open message
                   for this PCEP Entity role session. If state is not
                       known.

                     - pcc(1): tcp-pending
                   then this PCEP Entity is a PCC.
                     - pce(2): the session ID that will be
                   used in the Open message. Otherwise, this PCEP Entity
                   is a PCE.
                     - pcc-and-pce(3): the session ID that was sent in the
                   Open message.";
                 reference
                   "RFC 5440: Path Computation Element (PCE)
                   Communication Protocol (PCEP)";
               }

               leaf remote-id {
                 type uint8;
                 must "((../state != 'tcp-pending'" +
                      "and " +
                      "../state != 'open-wait' )" +
                      "or " +
                      "((../state = 'tcp-pending'" +
                      " or " +
                      "../state = 'open-wait' )" +
                      "and (. = 0)))" {
                   error-message
                     "Invalid remote-id";
                   description
                     "If state is tcp-pending or open-wait then
                     this PCEP Entity leaf is both
                       a PCC not used and a PCE."; MUST be set to
                     zero.";
                 }

            leaf description {
                type string;
                 description
                    "Description
                   "The value of the PCEP entity configured session ID used by the user";
            }

            leaf speaker-entity-id{
                if-feature stateful-sync-opt;
                type string;
                description
                    "The Speaker Entity Identifier";
                   peer in its Open message for this session.";
                 reference
                   "RFC 5440: Path Computation Element (PCE)
                   Communication Protocol (PCEP)";
               }

               leaf admin-status keepalive-timer {
                 type pcep-admin-status; uint8;
                 units "seconds";
                 must "(../state = 'session-up'" +
                      "or " +
                      "(../state != 'session-up'" +
                      "and (. = 0)))" {
                   error-message
                     "Invalid keepalive timer";
                   description
                    "The administrative status of this PCEP Entity.
                     This
                   "This field is the desired operational status as
                     currently used if and only if state is
                   session-up. Otherwise, it is not used and
                   MUST be set by an operator or by default in
                     the implementation.  The value of enabled
                     represents the current status of an attempt to reach this desired status.";
            }

            leaf index{
                type uint32;
                config "false";
                description
                     "The index of the operational PECP entity"; zero.";
                 }

            leaf oper-status {
                type pcep-oper-status;
                config "false";
                 description
                   "The operational status of the PCEP entity.
                     Takes one of the following values.
                     - oper-status-up(1): the PCEP entity is active.
                     - oper-status-down(2): the PCEP entity is inactive.
                     - oper-status-going-up(3): agreed maximum interval at which the local
                   PCEP entity is
                       activating.

                     - oper-status-going-down(4): the transmits PCEP entity is
                       deactivating.
                     - oper-status-failed(5): the messages on this PCEP entity has
                       failed and will recover when possible.
                     - oper-status-failed-perm(6):
                   session.  Zero means that the local PCEP entity
                       has failed and will not recover without
                       operator intervention.";
            }

            uses info {
                description
                    "Local PCEP entity information";
                   never sends Keepalives on this session.";
                 reference
                   "RFC 5440: Path Computation Element (PCE)
                   Communication Protocol (PCEP)";
               }

            container pce-info

               leaf peer-keepalive-timer {
                when "../role
                 type uint8;
                 units "seconds";
                 must "(../state = 'pce'" 'session-up'" +
                      "or "   +
                     "../role
                      "(../state != 'session-up'" +
                      "and " +
                      "(. = 'pcc-and-pce'"
                {
                    description
                        "Valid at PCE";
                }
                uses pce-info {
                    description
                        "Local PCE information";
                }
                container path-key {
                    if-feature path-key;
                    uses path-key 0)))" {
                   error-message
                     "Invalid Peer keepalive timer";
                   description
                            "Path-Key Configuration";
                    }
                    description
                        "Path-Key Configuration";
                     "This field is used if and only if state is
                     session-up. Otherwise, it is not used and MUST
                     be set to zero.";
                 }
                 description
                   "The Local PCE Entity PCE information"; agreed maximum interval at which the peer
                   transmits PCEP messages on this PCEP session.
                   Zero means that the peer never sends Keepalives
                   on this session.";
                 reference
                   "RFC 5440: Path Computation Element (PCE)
                   Communication Protocol (PCEP)";
               }

            uses pcep-entity-info

               leaf dead-timer {
                 type uint8;
                 units "seconds";
                 description
                   "The configuration related to the dead timer interval for this PCEP
                     entity."; session.";
                 reference
                   "RFC 5440: Path Computation Element (PCE)
                   Communication Protocol (PCEP)";
               }

               leaf pcep-notification-max-rate peer-dead-timer {
                 type uint32;
                mandatory true;
                description
                    "This variable indicates the maximum number of
                     notifications issued per second. If events
                     occur more rapidly, the implementation may
                     simply fail to emit these notifications during
                     that period, or may queue them until an
                     appropriate time. A value of 0 means no
                     notifications are emitted and all should be
                     discarded (that is, not queued).";
            }

            container stateful-parameter{
                if-feature stateful; uint8;
                 units "seconds";
                 must "(/pcep/entity/capability/stateful/enabled" "((../state != 'tcp-pending'" +
                      "and " +
                      "../state != 'open-wait' )" +
                      "or " +
                      "((../state = true())" 'tcp-pending'" +
                      " or " +
                      "../state = 'open-wait' )" +
                      "and " +
                      "(. = 0)))" {
                   error-message
                        "The Stateful PCE must be enabled";
                     "Invalid Peer Dead timer";
                   description
                        "When PCEP entity
                   "If state is stateful
                         enabled"; tcp-pending or open-wait then this
                   leaf is not used and MUST be set to zero.";
                 }
                uses stateful-pce-parameter;
                 description
                   "The configured stateful parameters"; peer's dead-timer interval
                   for this PCEP session.";
                 reference
                   "RFC 5440: Path Computation Element (PCE)
                   Communication Protocol (PCEP)";
               }
            container of-list{
                when "../role

               leaf ka-hold-time-rem {
                 type uint8;
                 units "seconds";
                 must "((../state != 'tcp-pending'" +
                      "and " +
                      "../state != 'open-wait' ) " +
                      "or " +
                      "((../state = 'pce'" 'tcp-pending'" +
                      "or " +
                         "../role
                      "../state = 'pcc-and-pce'" 'open-wait' )" +
                      "and " +
                      "(. = 0)))" {
                   error-message
                     "Invalid Keepalive hold time remaining";
                   description
                            "Valid at PCE";
                     "If state is tcp-pending or open-wait then this
                     field is not used and MUST be set to zero.";
                 }
                if-feature objective-function;

                uses of-list;
                 description
                   "The authorized OF-List at PCE keep alive hold time remaining for all peers"; this
                   session.";
               }

            container lsp-db{
                if-feature stateful;
                config false;
               leaf overloaded {
                 type boolean;
                 description
                    "The LSP-DB";
                   "If the local PCEP entity has informed the peer that
                   it is currently overloaded, then this is set to true.

                   Otherwise, it is set to false.";
                 reference
                   "RFC 5440: Path Computation Element (PCE)
                   Communication Protocol (PCEP)";
               }
               leaf db-ver{
                    when "../../role overload-time {
                 type uint32;
                 units "seconds";
                 must "((../overloaded = 'pcc'" true()) " +
                      "or ((../overloaded != true()) " +
                         "../../role
                      "and (. = 'pcc-and-pce'"
                    {
                        description
                            "Valid at PCC";
                    }
                    if-feature stateful-sync-opt;
                    type uint64;
                    description
                        "The LSP State Database Version Number";
                }
                list association-list {
                    if-feature association;
                    key "type id source global-source extended-id";
                    description
                        "List of all PCEP associations";
                    uses association 0)))" {
                   error-message
                     "Invalid overload-time";
                   description
                            "The Association attributes";
                     "This field is only used if overloaded is set to
                     true. Otherwise, it is not used and MUST be set
                     to zero.";
                 }
                    list lsp {
                        key "plsp-id pcc-id";
                 description
                            "List
                   "The interval of all LSP in time that is remaining until the
                   local PCEP entity will cease to be overloaded on
                   this association"; session.";
                 reference
                   "RFC 5440: Path Computation Element (PCE)
                   Communication Protocol (PCEP)";
               }
               leaf plsp-id peer-overloaded {
                 type leafref {
                                path "/pcep/entity/lsp-db/"
                                + "lsp/plsp-id";
                            } boolean;
                 description
                                "Reference
                   "If the peer has informed the local PCEP entity
                   that it is currently overloaded, then this is
                   set to PLSP-ID in LSP-DB"; true. Otherwise, it is set to false.";
                 reference
                   "RFC 5440: Path Computation Element (PCE)
                   Communication Protocol (PCEP)";
               }

               leaf pcc-id peer-overload-time {
                 type leafref {
                                path "/pcep/entity/lsp-db/" uint32;
                 units "seconds";
                 must "((../peer-overloaded = " + "lsp/pcc-id";
                            }
                      "true()) or " +
                      "((../peer-overloaded !=" +
                      "true())" +
                      " and " +
                      "(. = 0)))" {
                   error-message
                     "Invalid peer overload time";
                     description
                                "Reference
                       "This field is only used if peer-overloaded
                       is set to PCC-ID in LSP-DB";
                        }
                    } true. Otherwise, it is not used
                       and MUST be set to zero.";
                 }
                list lsp {
                    key "plsp-id pcc-id";
                    description
                        "List of all LSPs in LSP-DB";
                    uses lsp-state {
                 description
                   "The PCEP specific attributes for
                             LSP-DB.";
                    }
                    list association-list {
                        if-feature association;
                        key "type id source global-source extended-id";
                        description
                            "List interval of all PCEP associations";
                        uses association-ref {
                            description
                                "Reference time that is remaining until
                   the peer will cease to be overloaded.  If it
                   is not known how long the Association
                                 attributes";
                        }
                    }

                } peer will stay in
                   overloaded state, this leaf is set to zero.";
                 reference
                   "RFC 5440: Path Computation Element (PCE)
                   Communication Protocol (PCEP)";
               }

            container path-keys
               leaf lspdb-sync {
                 if-feature stateful;
                 type sync-state;
                 description
                   "The LSP-DB state synchronization status.";
                 reference
                   "RFC 8231: Path Computation Element Communication
                   Protocol (PCEP) Extensions for Stateful PCE";
               }

               leaf recv-db-ver{
                 when "../role = 'pce' or ../role 'pcc'" +
                      "or " +
                      "../role = 'pcc-and-pce'"
                 {
                   description
                         "Valid at PCE";
                     "This field is applicable when the role is
                     PCC";
                 }

                 if-feature path-key;
                 config false;
                 uses path-key-state; stateful;
                 if-feature sync-opt;

                 type uint64;

                 description
                   "The path-keys generated by the last received LSP State Database Version
                   Number";
                 reference
                   "RFC 8231: Path Computation Element Communication
                   Protocol (PCEP) Extensions for Stateful PCE";
               }
               container peers{
                description
                    "The list of configured peers for the
                     entity (remote PCE)";
                list peer{
                    key "addr";

                    description
                        "The peer configured for the entity.
                         (remote PCE)";

                    leaf addr {
                        type inet:ip-address;
                        description
                            "The local Internet address of this
                             PCEP peer.";
                    }

                    leaf role of-list{
                 when "../role = 'pce'" +
                      "or " +
                      "../role = 'pcc-and-pce'"
                 {
                        type pcep-role;
                        mandatory true;
                   description
                            "The role of the PCEP Peer.
                             Takes one of
                     "These fields are applicable when the following values.
                               - unknown(0): this PCEP peer role is not
                                 known.
                               - pcc(1): this PCEP peer is a PCC.
                               - pce(2): this PCEP peer is a PCE.
                               - pcc-and-pce(3): this PCEP peer
                                 is both a PCC and a PCE.";
                     PCE";
                 }

                    leaf description {
                        type string;
                 if-feature objective-function;

                 uses of-list;

                 description
                            "Description of
                   "Indicate the PCEP peer
                             configured by list of supported OF on this
                   session";
                 reference
                   "RFC 5541: Encoding of Objective Functions in
                   the user";
                    }
                    uses info {
                        description
                            "PCE Peer information"; Path  Computation Element Communication
                   Protocol (PCEP)";

               }

               container pce-info {
                        uses pce-info {
                            description
                                "PCE Peer information";
                        }
                        description
                            "The PCE Peer information";
                    }

                    leaf delegation-pref{
                        if-feature stateful;
                        type uint8{
                            range "0..7";
                        }
                        must "(/pcep/entity/capability/stateful" pst-list{
                 when "../role = 'pce'" +
                             "/active
                      "or " +
                      "../role = true())" 'pcc-and-pce'"
                 {
                            error-message
                                "The Active Stateful PCE must be
                                 enabled";
                   description
                                "When PCEP entity
                     "These fields are applicable when the role is active stateful
                                 enabled";
                     PCE";
                 }
                 description
                            "The
                   "Indicate the list of supported
                   PST on this session";
                 reference
                   "RFC 8408: Conveying Path Setup Type in PCE peer delegation preference.";
                    }
                    uses authentication {
                   Communication Protocol (PCEP) Messages";

                 list path-setup-type{
                   key "pst";

                   description
                            "PCE Peer authentication";
                    }
                     "The list of authorized PST";

                   leaf discontinuity-time pst {
                     type yang:timestamp;
                         config false; identityref{
                       base te-types:path-signaling-type;
                     }
                     description
                       "The timestamp of the time when the
                             information and statistics were last
                             reset."; PST authorized";
                   }

                    leaf initiate-session {
                         type boolean;
                         config false;
                 }
               }
               container assoc-type-list{
                 if-feature association;
                 description
                             "Indicates whether
                   "Indicate the local PCEP
                             entity initiates sessions to list of supported association types
                   on this peer,
                             or waits session";
                 reference
                   "I-D.ietf-pce-association-group: PCEP
                   Extensions for the peer to initiate a
                             session.";
                    }

                    leaf session-exists{
                         type boolean;
                         config false; Establishing Relationships
                   Between Sets of LSPs";

                 list assoc-type{
                   key "at";

                   description
                             "Indicates whether a session with
                              this peer currently exists.";
                    }
                     "The list of authorized association types";

                   leaf session-up-time{ at {
                     type yang:timestamp;
                         config false; identityref {
                       base te-types:association-type;
                     }
                     description
                       "The timestamp value of the last time a
                             session with this peer was successfully
                             established."; association type authorized";
                   }
                 }
               }
               leaf session-fail-time{ speaker-entity-id{
                 if-feature sync-opt;
                 type yang:timestamp;
                          config false; string;
                 description
                   "The timestamp value Speaker Entity Identifier";
                 reference
                   "RFC 8232: Optimizations of the last time Label Switched
                   Path State  Synchronization Procedures for
                   a
                               session with this peer failed to be
                               established."; Stateful PCE";
               }

               leaf session-fail-up-time{ discontinuity-time {
                 type yang:timestamp;
                         config false;
                 description
                   "The timestamp value of the last time a
                              session with this peer failed from
                              active."; when the
                   statistics were last reset.";
               }

                    uses session-grouping {
                        description
                            "session information";
             } // session
           } // sessions

         }//peer
       }//peers
     }//entity
   }//pcep

   /*
   * Notifications
   */
   notification pcep-session-up {
     description
       "This notification is sent when the value of
       '/pcep/peers/peer/sessions/session/state'
       enters the 'session-up' state.";

     uses notification-instance-hdr;

     uses notification-session-hdr;

     leaf state-last-change {
       type yang:timestamp;
       description
         "The timestamp value at the time this session
         entered its current state as denoted by the state
         leaf.";
     }

     leaf state {
       type pcep-sess-state;
       description
         "The current state of the session.
         The set of possible states excludes the idle state
         since entries do not exist in the idle state.";
       }
       reference
         "RFC 5440: Path Computation Element (PCE) Communication
         Protocol (PCEP)";
   } //notification

   notification pcep-session-down {
     description
       "This notification is sent when the value of
       '/pcep/peers/peer/sessions/session/state'
       leaves the 'session-up' state.";

     uses notification-instance-hdr;

     leaf session-initiator {
       type pcep-initiator;
       description
         "The initiator of the session.";
     }

     leaf state-last-change {
       type yang:timestamp;
       description
         "The timestamp value at the time this session
         entered its current state as denoted by the state
         leaf.";
     }

     leaf state {
     type pcep-sess-state;
     description
       "The current state of the session.
       The set of possible states excludes the idle state
       since entries do not exist in the idle state.";
     }
     reference
       "RFC 5440: Path Computation Element (PCE) Communication
       Protocol (PCEP)";
   } //notification

   notification pcep-session-local-overload {
     description
       "This notification is sent when the local PCEP entity
       enters overload state for a peer.";

     uses notification-instance-hdr;

     uses notification-session-hdr;

     leaf overloaded {
       type boolean;
       description
         "If the local PCEP entity has informed the peer
         that it is currently overloaded, then this is set
         to true. Otherwise, it is set to false.";
     }

     leaf overload-time {
     type uint32;
     units "seconds";
     description
       "The interval of time that is remaining until the
       local PCEP entity will cease to be overloaded on
       this session.";

     }
     reference
       "RFC 5440: Path Computation Element (PCE) Communication
       Protocol (PCEP)";
   } //notification

   notification pcep-session-local-overload-clear {
     description
       "This notification is sent when the local PCEP entity
       leaves overload state for a peer.";

     uses notification-instance-hdr;

     leaf overloaded {
       type boolean;
       description
         "If the local PCEP entity has informed the peer
         that it is currently overloaded, then this is set
         to true.  Otherwise, it is set to false.";
       }
     reference
       "RFC 5440: Path Computation Element (PCE) Communication
       Protocol (PCEP)";
   } //notification

   notification pcep-session-peer-overload {
     description
       "This notification is sent when a peer enters overload
       state.";

     uses notification-instance-hdr;

     uses notification-session-hdr;

     leaf peer-overloaded {
       type boolean;
       description
         "If the peer has informed the local PCEP entity that
         it is currently overloaded, then this is set to
         true. Otherwise, it is set to false.";
     }

     leaf peer-overload-time {
       type uint32;
       units "seconds";
       description
         "The interval of time that is remaining until the
         peer will cease to be overloaded.  If it is not
         known how long the peer will stay in overloaded
         state, this leaf is set to zero.";
     }
     reference
       "RFC 5440: Path Computation Element (PCE) Communication
       Protocol (PCEP)";
   } //notification

   notification pcep-session-peer-overload-clear {
     description
       "This notification is sent when a peer leaves overload
       state.";

     uses notification-instance-hdr;

     leaf peer-overloaded {
       type boolean;
       description
         "If the peer has informed the local PCEP entity that
         it is currently overloaded, then this is set to
         true. Otherwise, it is set to false.";
       }
       reference
         "RFC 5440: Path Computation Element (PCE) Communication
         Protocol (PCEP)";
   } //notification

   /*
    * RPC
    */

   rpc trigger-resync {
     if-feature stateful;
     if-feature stateful-sync-opt; sync-opt;
     description
       "Trigger the resyncrinization at the PCE";
     reference
       "RFC 8232: Optimizations of Label Switched Path State
       Synchronization Procedures for a Stateful PCE";
     input {
       leaf pcc {
         type leafref {
           path "/pcep/entity/peers/peer/addr";
         }
         description
           "The IP address to identify the PCC. The state
           syncronization is re-triggered for all LSPs from
           the PCC. The rpc on the PCC will be ignored.";

       }

        }
     }//input
   }//rpc

 }//module
 <CODE ENDS>

10.2.  ietf-pcep-stats module

   <CODE BEGINS> file "ietf-pcep-stats@2018-10-15.yang" "ietf-pcep-stats@2019-03-24.yang"
   module ietf-pcep-stats {

     yang-version 1.1;

     namespace "urn:ietf:params:xml:ns:yang:ietf-pcep-stats";

     prefix ps;

     import ietf-pcep {
       prefix p;
       reference
         "RFC XXXX"; XXXX: A YANG Data Model for Path Computation
         Element Communications Protocol (PCEP)";
     }

     import ietf-yang-types {
       prefix "yang";
       reference
         "RFC 6991"; 6991: Common YANG Data Types";
     }

     organization
       "IETF PCE (Path Computation Element) Working Group";

     contact
       "WG Web:  <http://tools.ietf.org/wg/pce/>
       WG List:  <mailto:pce@ietf.org>
       Editor:   Dhruv Dhody
                 <mailto:dhruv.ietf@gmail.com>";

     description
       "The YANG module augments the PCEP yang operational
       model with statistics, counters and telemetry data.

       Copyright (c) 2018 2019 IETF Trust and the persons identified as
       authors of the code.  All rights reserved.

       Redistribution and use in source and binary forms, with or
       without modification, is permitted pursuant to, and subject
       to the license terms contained in, the Simplified BSD License
       set forth in Section 4.c of the IETF Trust's Legal Provisions
       Relating to IETF Documents
       (http://trustee.ietf.org/license-info).

       This version of this YANG module is part of RFC XXXX; see the
       RFC itself for full legal notices.";

     revision 2018-10-15 2019-03-24 {
       description "Initial revision.";
       reference
         "RFC XXXX:  A YANG Data Model for Path Computation
         Element Communications Protocol (PCEP)";
     }

     /*
      * Groupings
      */

     grouping pcep-stats{
       description
         "This grouping defines statistics for PCEP. It is used
         for both peer and current session.";
       leaf avg-rsp-time{
         when "../../p:role = 'pce'" +
              "or " +
              "../../p:role = 'pcc-and-pce'"
         {
           description
             "Valid for PCEP Peer as PCE";
         }
         type uint32;
         units "milliseconds";

         description
           "The average response time. If an average response time
           has not been calculated then this leaf has the value
           zero.";
       }

       leaf lwm-rsp-time{
         when "../../p:role = 'pce'" +
              "or " +
              "../../p:role = 'pcc-and-pce'"
         {
           description
             "Valid for PCEP Peer as PCE";
         }
         type uint32;
         units "milliseconds";

         description
           "The smallest (low-water mark) response time seen.
           If no responses have been received then this leaf has
           the value zero.";
       }

       leaf hwm-rsp-time{
         when "../../p:role = 'pce'" +
              "or " +
              "../../p:role = 'pcc-and-pce'"
         {
           description
             "Valid for PCEP Peer as PCE";
         }
         type uint32;
         units "milliseconds";

         description
           "The greatest (high-water mark) response time seen.
           If no responses have been received then this object
           has the value zero.";
       }

       leaf num-pcreq-sent{
           when "../../p:role = 'pce'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
              "Valid for PCEP Peer as PCE";
           }
           type yang:counter32;
           description
            "The number of PCReq messages sent.";
       }

       leaf num-pcreq-rcvd{
         when "../../p:role = 'pcc'" +
              "or " +
              "../../p:role = 'pcc-and-pce'"
         {
           description
             "Valid for PCEP Peer as PCC";

         }
         type yang:counter32;
         description
           "The number of PCReq messages received.";
       }

       leaf num-pcrep-sent{
         when "../../p:role = 'pcc'" +
              "or " +
              "../../p:role = 'pcc-and-pce'"
         {
           description
             "Valid for PCEP Peer as PCC";
         }

         type yang:counter32;
         description
           "The number of PCRep messages sent.";
         }

         leaf num-pcrep-rcvd{
           when "../../p:role = 'pce'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCE";
           }

           type yang:counter32;
           description
             "The number of PCRep messages received.";
         }

         leaf num-pcerr-sent{
           type yang:counter32;
           description
             "The number of PCErr messages sent.";
         }

         leaf num-pcerr-rcvd{
           type yang:counter32;
           description
             "The number of PCErr messages received.";
         }

         leaf num-pcntf-sent{
           type yang:counter32;
           description
             "The number of PCNtf messages sent.";
         }

         leaf num-pcntf-rcvd{
           type yang:counter32;
           description
             "The number of PCNtf messages received.";
         }

         leaf num-keepalive-sent{
           type yang:counter32;
           description
             "The number of Keepalive messages sent.";
         }

         leaf num-keepalive-rcvd{
           type yang:counter32;
           description
             "The number of Keepalive messages received.";
         }

         leaf num-unknown-rcvd{
           type yang:counter32;
           description
           "The number of unknown messages received.";
         }

         leaf num-corrupt-rcvd{
           type yang:counter32;
           description
             "The number of corrupted PCEP message received.";
         }

         leaf num-req-sent{
           when "../../p:role = 'pce'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCE";
           }
           type yang:counter32;
           description
             "The number of requests sent.  A request corresponds
             1:1 with an RP object in a PCReq message. This might
             be greater than num-pcreq-sent because multiple
             requests can be batched into a single PCReq
             message.";
         }

         leaf num-req-sent-pend-rep{
           when "../../p:role = 'pce'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCE";
           }
           type yang:counter32;
           description
             "The number of requests that have been sent for
             which a response is still pending.";
         }

         leaf num-req-sent-ero-rcvd{
           when "../../p:role = 'pce'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCE";
           }
           type yang:counter32;
           description
             "The number of requests that have been sent for
             which a response with an ERO object was received.
             Such responses indicate that a path was
             successfully computed by the peer.";
         }

         leaf num-req-sent-nopath-rcvd{
           when "../../p:role = 'pce'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCE";
           }
           type yang:counter32;
           description
             "The number of requests that have been sent for
             which a response with a NO-PATH object was
             received. Such responses indicate that the peer
             could not find a path to satisfy the
             request.";

         }

         leaf num-req-sent-cancel-rcvd{
           when "../../p:role = 'pce'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCE";
           }
           type yang:counter32;
           description
             "The number of requests that were cancelled with
             a PCNtf message. This might be different than
             num-pcntf-rcvd because not all PCNtf messages are
             used to cancel requests, and a single PCNtf message
             can cancel multiple requests.";
         }

         leaf num-req-sent-error-rcvd{
           when "../../p:role = 'pce'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCE";
           }
           type yang:counter32;
           description
             "The number of requests that were rejected with a
             PCErr message. This might be different than
             num-pcerr-rcvd because not all PCErr messages are
             used to reject requests, and a single PCErr message
             can reject multiple requests.";
         }

         leaf num-req-sent-timeout{
           when "../../p:role = 'pce'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCE";
           }
           type yang:counter32;
           description
             "The number of requests that have been sent to a peer
             and have been abandoned because the peer has taken too
             long to respond to them.";
         }

         leaf num-req-sent-cancel-sent{
           when "../../p:role = 'pce'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCE";
           }
           type yang:counter32;
           description
             "The number of requests that were sent to the peer and
             explicitly cancelled by the local PCEP entity sending
             a PCNtf.";
         }

         leaf num-req-rcvd{
           when "../../p:role = 'pcc'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCC";
           }
           type yang:counter32;
           description
             "The number of requests received.  A request
             corresponds 1:1 with an RP object in a PCReq
             message.
             This might be greater than num-pcreq-rcvd because
             multiple requests can be batched into a single
             PCReq message.";
         }

         leaf num-req-rcvd-pend-rep{
           when "../../p:role = 'pcc'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCC";
           }
           type yang:counter32;
           description
             "The number of requests that have been received for
             which a response is still pending.";

         }

         leaf num-req-rcvd-ero-sent{
           when "../../p:role = 'pcc'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCC";
           }
           type yang:counter32;
           description
             "The number of requests that have been received for
             which a response with an ERO object was sent.  Such
             responses indicate that a path was successfully
             computed by the local PCEP entity.";
         }

         leaf num-req-rcvd-nopath-sent{
           when "../../p:role = 'pcc'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCC";
           }
           type yang:counter32;
           description
             "The number of requests that have been received for
             which a response with a NO-PATH object was sent. Such
             responses indicate that the local PCEP entity could
             not find a path to satisfy the request.";
         }

         leaf num-req-rcvd-cancel-sent{
           when "../../p:role = 'pcc'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCC";
           }
           type yang:counter32;
           description
             "The number of requests received that were cancelled
             by the local PCEP entity sending a PCNtf message.
             This might be different than num-pcntf-sent because
             not all PCNtf messages are used to cancel requests,
             and a single PCNtf message can cancel multiple
             requests.";
         }

         leaf num-req-rcvd-error-sent{
           when "../../p:role = 'pcc'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCC";
           }
           type yang:counter32;
           description
             "The number of requests received that were cancelled
             by the local PCEP entity sending a PCErr message.
             This might be different than num-pcerr-sent because
             not all PCErr messages are used to cancel requests,
             and a single PCErr message can cancel multiple
             requests.";
         }

         leaf num-req-rcvd-cancel-rcvd{
           when "../../p:role = 'pcc'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCC";
           }
           type yang:counter32;
           description
             "The number of requests that were received from the
             peer and explicitly cancelled by the peer sending
             a PCNtf.";
         }
         leaf num-rep-rcvd-unknown{
           when "../../p:role = 'pce'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCE";
           }
           type yang:counter32;
           description
             "The number of responses to unknown requests
             received. A response to an unknown request is a
             response whose RP object does not contain the
             request ID of any request that is currently
             outstanding on the session.";
         }

         leaf num-req-rcvd-unknown{
           when "../../p:role = 'pcc'" +
                "or " +
                "../../p:role = 'pcc-and-pce'"
           {
             description
               "Valid for PCEP Peer as PCC";
           }
           type yang:counter32;
           description
             "The number of unknown requests that have been
             received. An unknown request is a request
             whose RP object contains a request ID of zero.";
         }

         container svec{
           if-feature p:svec;
           description
             "If synchronized path computation is supported";
           leaf num-svec-sent{
             when "../../../p:role = 'pce'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of SVEC objects sent in PCReq messages.
               An SVEC object represents a set of synchronized
               requests.";
           }
           leaf num-svec-req-sent{
             when "../../../p:role = 'pce'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of requests sent that appeared in one
               or more SVEC objects.";
           }

           leaf num-svec-rcvd{
             when "../../../p:role = 'pcc'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCC";
             }
             type yang:counter32;
             description
               "The number of SVEC objects received in PCReq
               messages. An SVEC object represents a set of
               synchronized requests.";
           }

           leaf num-svec-req-rcvd{
             when "../../../p:role = 'pcc'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCC";
             }
             type yang:counter32;
             description
               "The number of requests received that appeared
               in one or more SVEC objects.";
           }
           }
         }//svec
         container stateful{
           if-feature p:stateful;
           description
             "Stateful PCE related statistics";
           leaf num-pcrpt-sent{
             when "../../../p:role = 'pce'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of PCRpt messages sent.";

           }

           leaf num-pcrpt-rcvd{
             when "../../../p:role = 'pcc'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCC";
             }
             type yang:counter32;
             description
               "The number of PCRpt messages received.";
           }

           leaf num-pcupd-sent{
             when "../../../p:role = 'pcc'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCC";
             }
             type yang:counter32;
             description
               "The number of PCUpd messages sent.";
           }

           leaf num-pcupd-rcvd{
             when "../../../p:role = 'pce'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of PCUpd messages received.";
           }

           leaf num-rpt-sent{
             when "../../../p:role = 'pce'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";

             }
             type yang:counter32;
             description
               "The number of LSP Reports sent.  A LSP report
               corresponds 1:1 with an LSP object in a PCRpt
               message. This might be greater than
               num-pcrpt-sent because multiple reports can
               be batched into a single PCRpt message.";
           }

           leaf num-rpt-rcvd{
             when "../../../p:role = 'pcc'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCC";
             }
             type yang:counter32;
             description
               "The number of LSP Reports received.  A LSP report
               corresponds 1:1 with an LSP object in a PCRpt
               message.
               This might be greater than num-pcrpt-rcvd because
               multiple reports can be batched into a single
               PCRpt message.";
           }

           leaf num-rpt-rcvd-error-sent{
             when "../../../p:role = 'pcc'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCC";
             }
             type yang:counter32;
             description
               "The number of reports of LSPs received that were
               responded by the local PCEP entity by sending a
               PCErr message.";
           }

           leaf num-upd-sent{
             when "../../../p:role = 'pcc'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCC";
             }
             type yang:counter32;
             description
               "The number of LSP updates sent.  A LSP update
               corresponds 1:1 with an LSP object in a PCUpd
               message. This might be greater than
               num-pcupd-sent because multiple updates can
               be batched into a single PCUpd message.";
           }

           leaf num-upd-rcvd{
             when "../../../p:role = 'pce'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of LSP Updates received.  A LSP update
               corresponds 1:1 with an LSP object in a PCUpd
               message.
               This might be greater than num-pcupd-rcvd because
               multiple updates can be batched into a single
               PCUpd message.";
           }

           leaf num-upd-rcvd-unknown{
             when "../../../p:role = 'pce'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of updates to unknown LSPs
               received. An update to an unknown LSP is a
               update whose LSP object does not contain the
               PLSP-ID of any LSP that is currently
               present.";
           }

           leaf num-upd-rcvd-undelegated{
             when "../../../p:role = 'pce'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of updates to not delegated LSPs
               received. An update to an undelegated LSP is a
               update whose LSP object does not contain the
               PLSP-ID of any LSP that is currently
               delegated to current PCEP session.";
           }

           leaf num-upd-rcvd-error-sent{
             when "../../../p:role = 'pce'" +
                  "or " +
                  "../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of updates to LSPs received that were
               responded by the local PCEP entity by sending a
               PCErr message.";
          }

         container initiation {
           if-feature p:pce-initiated;
           description
             "PCE-Initiated related statistics";
           leaf num-pcinitiate-sent{
             when "../../../../p:role = 'pcc'" +
                  "or " +
                  "../../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCC";
             }
             type yang:counter32;
             description
               "The number of PCInitiate messages sent.";
           }
           leaf num-pcinitiate-rcvd{
             when "../../../../p:role = 'pce'" +
                  "or " +
                  "../../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of PCInitiate messages received.";
           }

           leaf num-initiate-sent{
             when "../../../../p:role = 'pcc'" +
                  "or " +
                  "../../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCC";
             }
             type yang:counter32;
             description
               "The number of LSP Initiation sent via PCE.
               A LSP initiation corresponds 1:1 with an LSP
               object in a PCInitiate message. This might be
               greater than num-pcinitiate-sent because
               multiple initiations can be batched into a
               single PCInitiate message.";
           }

           leaf num-initiate-rcvd{
             when "../../../../p:role = 'pce'" +
                  "or " +
                  "../../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of LSP Initiation received from
               PCE.  A LSP initiation corresponds 1:1 with
               an LSP object in a PCInitiate message. This
               might be greater than num-pcinitiate-rcvd
               because multiple initiations can be batched
               into a single PCInitiate message.";
           }
           leaf num-initiate-rcvd-error-sent{
             when "../../../../p:role = 'pce'" +
                  "or " +
                  "../../../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of initiations of LSPs received
               that were responded by the local PCEP entity
               by sending a PCErr message.";
           }
               }
           }
         }//initiation
       }//stateful

       container path-key {
         when "../../p:role = 'pcc'" +
              "or " +
              "../../p:role = 'pcc-and-pce'"
         {
           description
             "Valid for PCEP Peer as PCC";
         }
         if-feature p:path-key;
         description
           "If Path-Key is supported";
         leaf num-unknown-path-key{
           type yang:counter32;
           description
             "The number of attempts to expand an unknown
             path-key.";
         }
         leaf num-exp-path-key{
           type yang:counter32;
           description
             "The number of attempts to expand an expired
             path-key.";
         }
         leaf num-dup-path-key{
           type yang:counter32;
           description
             "The number of duplicate attempts to expand same
             path-key.";
         }
         leaf num-path-key-no-attempt{
           type yang:counter32;
           description
             "The number of expired path-keys with no attempt to
             expand it.";
         }
           }
       }//path-key
     }//pcep-stats

     /*
      * Augment modules to add statistics
      */

     augment "/p:pcep/p:entity/p:peers/p:peer" {
       description
         "Augmenting the statistics";

         leaf num-sess-setup-ok{
           type yang:counter32;
           config false;
           description
             "The number of PCEP sessions successfully
                    successfully established with
             the peer, including any current session.  This counter is
             incremented each time a session with this peer is
             successfully established.";
         }

         leaf num-sess-setup-fail{
             type yang:counter32;
             config false;
             description
                "The number of PCEP sessions with the peer
                 that have been attempted but failed
                 before being fully established. This
                 counter is incremented each time a
                 session retry to this peer fails.";
         }

         container pcep-stats {
           config false;
           description
             "The container for all statistics at peer level.";
           uses pcep-stats{
             description
             "Since PCEP sessions can be ephemeral, the peer statistics
             tracks a peer even when no PCEP session currently exists
             to that peer. The statistics contained are an aggregate of
             the statistics for all successive sessions to that peer.";
           }
           leaf num-req-sent-closed{
             when "../../p:role = 'pce'" +
                  "or " +
                  "../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCE";
             }
             type yang:counter32;
             description
               "The number of requests that were sent to the peer and
               implicitly cancelled when the session they were sent
               over was closed.";
           }

           leaf num-req-rcvd-closed{
             when "../../p:role = 'pcc'" +
                  "or " +
                  "../../p:role = 'pcc-and-pce'"
             {
               description
                 "Valid for PCEP Peer as PCC";
             }
             type yang:counter32;
             description
               "The number of requests that were received from the peer
               and implicitly cancelled when the session they were
               received over was closed.";
           }
         }//pcep-stats
     }//augment

     augment "/p:pcep/p:entity/p:peers/p:peer/" +
             "p:sessions/p:session" {
       description
         "Augmenting the statistics";

       container pcep-stats {
         description
           "The container for all statistics at session level.";
         uses pcep-stats{
         description
           "The statistics contained are for the current sessions to
           that peer. These are lost when the session goes down.
                        "; down.";
         }
       }//pcep-stats
     }//augment
   }//module
   <CODE ENDS>

11.  Security Considerations

   The YANG module defined in this document is designed to be accessed
   via network management protocol such as NETCONF [RFC6241] or RESTCONF
   [RFC8040].  The lowest NETCONF layer is the secure transport layer
   and the mandatory-to-implement secure transport is SSH [RFC6242].
   The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement
   secure transport is TLS [RFC8446]

   The NETCONF access control model [RFC8341] provides the means to
   restrict access for particular NETCONF or RESTCONF users to a pre-
   configured subset of all available NETCONF or RESTCONF protocol
   operations and content.

   There are a number of data nodes defined in the YANG module which are
   writable/creatable/deletable (i.e., config true, which is the
   default).  These data nodes may be considered sensitive or vulnerable
   in some network environments.  Write operations (e.g., <edit-config>)
   to these data nodes without proper protection can have a negative
   effect on network operations.  These are the subtrees and data nodes
   and their sensitivity/vulnerability:

      /pcep/entity/ - configure local parameters, capabilities etc.

      /pcep/entity/peers - configure remote peers to setup PCEP session.

   Unauthorized access to above list can adversely affect the PCEP
   session between the local entity and the peers.  This may lead to
   inability to compute new paths, stateful operations on the delegated
   as well as PCE-initiated LSPs.

   Some of the readable data nodes in this YANG module may be considered
   sensitive or vulnerable in some network environments.  It is thus
   important to control read access (e.g., via get, get-config, or
   notification) to these data nodes.  These are the subtrees and data
   nodes and their sensitivity/vulnerability:

      /pcep/lsp-db - All the LSPs in the network.  Unauthorized access
      to this could provide the all path and network usage information.

      /pcep/path-keys/ - The Confidential Path Segments (CPS) are hidden
      using path-keys.  Unauthorized access to this could leak
      confidential path information.

   Some of the RPC operations in this YANG module may be considered
   sensitive or vulnerable in some network environments.  It is thus
   important to control access to these operations.  These are the
   operations and their sensitivity/vulnerability:

      trigger-resync - trigger resynchronization with the PCE.
      Unauthorized access to this could force a PCEP session into
      continuous state synchronization.

12.  IANA Considerations

   This document registers a URI in the "IETF XML Registry" [RFC3688].
   Following the format in RFC 3688, the following registration has been
   made.

   URI:  urn:ietf:params:xml:ns:yang:ietf-pcep

   Registrant Contact:  The PCE WG of the IETF.

   XML:  N/A; the requested URI is an XML namespace.

   This document registers a YANG module in the "YANG Module Names"
   registry [RFC6020].

       Name:         ietf-pcep
       Namespace:    urn:ietf:params:xml:ns:yang:ietf-pcep
       Prefix:       pcep
       Reference:    This I-D

13.  Acknowledgements

   The initial document is based on the PCEP MIB [RFC7420].  We would
   like to thank the authors of aforementioned documents.

14.  References

14.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC3209]  Awduche, D., Berger, L., Gan, D., Li, T., Srinivasan, V.,
              and G. Swallow, "RSVP-TE: Extensions to RSVP for LSP
              Tunnels", RFC 3209, DOI 10.17487/RFC3209, December 2001,
              <https://www.rfc-editor.org/info/rfc3209>.

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              DOI 10.17487/RFC3688, January 2004,
              <https://www.rfc-editor.org/info/rfc3688>.

   [RFC5088]  Le Roux, JL., Ed., Vasseur, JP., Ed., Ikejiri, Y., and R.
              Zhang, "OSPF Protocol Extensions for Path Computation
              Element (PCE) Discovery", RFC 5088, DOI 10.17487/RFC5088,
              January 2008, <https://www.rfc-editor.org/info/rfc5088>.

   [RFC5089]  Le Roux, JL., Ed., Vasseur, JP., Ed., Ikejiri, Y., and R.
              Zhang, "IS-IS Protocol Extensions for Path Computation
              Element (PCE) Discovery", RFC 5089, DOI 10.17487/RFC5089,
              January 2008, <https://www.rfc-editor.org/info/rfc5089>.

   [RFC5440]  Vasseur, JP., Ed. and JL. Le Roux, Ed., "Path Computation
              Element (PCE) Communication Protocol (PCEP)", RFC 5440,
              DOI 10.17487/RFC5440, March 2009,
              <https://www.rfc-editor.org/info/rfc5440>.

   [RFC5520]  Bradford, R., Ed., Vasseur, JP., and A. Farrel,
              "Preserving Topology Confidentiality in Inter-Domain Path
              Computation Using a Path-Key-Based Mechanism", RFC 5520,
              DOI 10.17487/RFC5520, April 2009,
              <https://www.rfc-editor.org/info/rfc5520>.

   [RFC5541]  Le Roux, JL., Vasseur, JP., and Y. Lee, "Encoding of
              Objective Functions in the Path Computation Element
              Communication Protocol (PCEP)", RFC 5541,
              DOI 10.17487/RFC5541, June 2009,
              <https://www.rfc-editor.org/info/rfc5541>.

   [RFC5557]  Lee, Y., Le Roux, JL., King, D., and E. Oki, "Path
              Computation Element Communication Protocol (PCEP)
              Requirements and Protocol Extensions in Support of Global
              Concurrent Optimization", RFC 5557, DOI 10.17487/RFC5557,
              July 2009, <https://www.rfc-editor.org/info/rfc5557>.

   [RFC6020]  Bjorklund, M., Ed., "YANG - A Data Modeling Language for
              the Network Configuration Protocol (NETCONF)", RFC 6020,
              DOI 10.17487/RFC6020, October 2010,
              <https://www.rfc-editor.org/info/rfc6020>.

   [RFC6241]  Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
              and A. Bierman, Ed., "Network Configuration Protocol
              (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
              <https://www.rfc-editor.org/info/rfc6241>.

   [RFC6242]  Wasserman, M., "Using the NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
              <https://www.rfc-editor.org/info/rfc6242>.

   [RFC6991]  Schoenwaelder, J., Ed., "Common YANG Data Types",
              RFC 6991, DOI 10.17487/RFC6991, July 2013,
              <https://www.rfc-editor.org/info/rfc6991>.

   [RFC7950]  Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
              RFC 7950, DOI 10.17487/RFC7950, August 2016,
              <https://www.rfc-editor.org/info/rfc7950>.

   [RFC8177]  Lindem, A., Ed., Qu, Y., Yeung, D., Chen, I., and J.
              Zhang, "YANG Data Model for Key Chains", RFC 8177,
              DOI 10.17487/RFC8177, June 2017,
              <https://www.rfc-editor.org/info/rfc8177>.

   [RFC8040]  Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
              <https://www.rfc-editor.org/info/rfc8040>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8231]  Crabbe, E., Minei, I., Medved, J., and R. Varga, "Path
              Computation Element Communication Protocol (PCEP)
              Extensions for Stateful PCE", RFC 8231,
              DOI 10.17487/RFC8231, September 2017,
              <https://www.rfc-editor.org/info/rfc8231>.

   [RFC8232]  Crabbe, E., Minei, I., Medved, J., Varga, R., Zhang, X.,
              and D. Dhody, "Optimizations of Label Switched Path State
              Synchronization Procedures for a Stateful PCE", RFC 8232,
              DOI 10.17487/RFC8174,
              May 10.17487/RFC8232, September 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8231]  Crabbe, E., Minei, I., Medved, J.,
              <https://www.rfc-editor.org/info/rfc8232>.

   [RFC8253]  Lopez, D., Gonzalez de Dios, O., Wu, Q., and R. Varga, "Path D. Dhody,
              "PCEPS: Usage of TLS to Provide a Secure Transport for the
              Path Computation Element Communication Protocol (PCEP)
              Extensions for Stateful PCE", (PCEP)",
              RFC 8231, 8253, DOI 10.17487/RFC8231, September 10.17487/RFC8253, October 2017,
              <https://www.rfc-editor.org/info/rfc8231>.
              <https://www.rfc-editor.org/info/rfc8253>.

   [RFC8281]  Crabbe, E., Minei, I., Sivabalan, S., and R. Varga, "Path
              Computation Element Communication Protocol (PCEP)
              Extensions for PCE-Initiated LSP Setup in a Stateful PCE
              Model", RFC 8281, DOI 10.17487/RFC8281, December 2017,
              <https://www.rfc-editor.org/info/rfc8281>.

   [RFC8306]  Zhao, Q., Dhody, D., Ed., Palleti, R., and D. King,
              "Extensions to the Path Computation Element Communication
              Protocol (PCEP) for Point-to-Multipoint Traffic
              Engineering Label Switched Paths", RFC 8306,
              DOI 10.17487/RFC8306, November 2017,
              <https://www.rfc-editor.org/info/rfc8306>.

   [RFC8340]  Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams",
              BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018,
              <https://www.rfc-editor.org/info/rfc8340>.

   [RFC8341]  Bierman, A. and M. Bjorklund, "Network Configuration
              Access Control Model", STD 91, RFC 8341,
              DOI 10.17487/RFC8341, March 2018,
              <https://www.rfc-editor.org/info/rfc8341>.

   [RFC8408]  Sivabalan, S., Tantsura, J., Minei, I., Varga, R., and J.
              Hardwick, "Conveying Path Setup Type in PCE Communication
              Protocol (PCEP) Messages", RFC 8408, DOI 10.17487/RFC8408,
              July 2018, <https://www.rfc-editor.org/info/rfc8408>.

   [RFC8446]  Rescorla, E., "The Transport Layer Security (TLS) Protocol
              Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
              <https://www.rfc-editor.org/info/rfc8446>.

   [I-D.ietf-pce-segment-routing]
              Sivabalan, S., Filsfils, C., Tantsura, J., Henderickx, W.,
              and J. Hardwick, "PCEP Extensions for Segment Routing",
              draft-ietf-pce-segment-routing-14 (work in progress),
              October 2018.

   [I-D.ietf-teas-yang-te]
              Saad, T., Gandhi, R., Liu, X., Beeram, V., Shah, H., and I. Bryskin,
              "A YANG Data Model for Traffic Engineering Tunnels and
              Interfaces", draft-ietf-teas-yang-te-16 draft-ietf-teas-yang-te-19 (work in
              progress), July 2018. February 2019.

   [I-D.ietf-teas-yang-te-types]
              Saad, T., Gandhi, R., Liu, X., Beeram, V., and I. Bryskin,
              "Traffic Engineering Common YANG Types", draft-ietf-teas-
              yang-te-types-06 (work in progress), February 2019.

   [I-D.ietf-netconf-tls-client-server]
              Watsen, K. and G. K., Wu, G., and L. Xia, "YANG Groupings for TLS
              Clients and TLS Servers", draft-ietf-netconf-tls-client-server-07 draft-ietf-netconf-tls-client-
              server-10 (work in progress), September 2018. March 2019.

   [I-D.ietf-pce-association-group]
              Minei, I., Crabbe, E., Sivabalan, S., Ananthakrishnan, H.,
              Dhody, D., and Y. Tanaka, "PCEP Extensions for
              Establishing Relationships Between Sets of LSPs", draft-
              ietf-pce-association-group-08 (work in progress), March
              2019.

   [I-D.ietf-pce-segment-routing]
              Sivabalan, S., Filsfils, C., Tantsura, J., Henderickx, W.,
              and J. Hardwick, "PCEP Extensions for Segment Routing",
              draft-ietf-pce-segment-routing-16 (work in progress),
              March 2019.

   [I-D.ietf-isis-yang-isis-cfg]
              Litkowski, S., Yeung, D., Lindem, A., Zhang, Z., and L.
              Lhotka, "YANG Data Model for IS-IS Protocol", draft-ietf-
              isis-yang-isis-cfg-35 (work in progress), March 2019.

   [I-D.ietf-ospf-yang]
              Yeung, D., Qu, Y., Zhang, Z., Chen, I., and A. Lindem,
              "YANG Data Model for OSPF Protocol", draft-ietf-ospf-
              yang-21 (work in progress), January 2019.

   [I-D.ietf-pce-gmpls-pcep-extensions]
              Margaria, C., Dios, O., and F. Zhang, "PCEP extensions for
              GMPLS", draft-ietf-pce-gmpls-pcep-extensions-13 (work in
              progress), January 2019.

14.2.  Informative References

   [RFC4655]  Farrel, A., Vasseur, J., and J. Ash, "A Path Computation
              Element (PCE)-Based Architecture", RFC 4655,
              DOI 10.17487/RFC4655, August 2006,
              <https://www.rfc-editor.org/info/rfc4655>.

   [RFC7420]  Koushik, A., Stephan, E., Zhao, Q., King, D., and J.
              Hardwick, "Path Computation Element Communication Protocol
              (PCEP) Management Information Base (MIB) Module",
              RFC 7420, DOI 10.17487/RFC7420, December 2014,
              <https://www.rfc-editor.org/info/rfc7420>.

   [RFC8253]  Lopez, D., Gonzalez de Dios, O., Wu, Q., and D. Dhody,
              "PCEPS: Usage of TLS to Provide a Secure Transport for the
              Path Computation Element Communication Protocol (PCEP)",
              RFC 8253, DOI 10.17487/RFC8253, October 2017,
              <https://www.rfc-editor.org/info/rfc8253>.

   [RFC8342]  Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
              and R. Wilton, "Network Management Datastore Architecture
              (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018,
              <https://www.rfc-editor.org/info/rfc8342>.

Appendix A.  Example

   The example below provide an overview of PCEP peer session
   informations and LSP-DB in the Yang Module.

          +-------+                  +-------+
          |       |                  |       |
          | PCC1  |<---------------->|       |
          |       |                  |       |
          +-------+                  |       |
         IP:192.0.2.1                |       |
                                     |  PCE  |
                                     |       |
          +-------+                  |       |
          |       |                  |       |
          | PCC2  |<---------------->|       |
          |       |                  |       |
          +-------+                  |       |
         IP:192.0.2.2                |       |
                                     |       |
                                     |       |
          +-------+                  |       |
          |       |                  |       |
          | PCC4  |<---------------->|       |
          |       |                  |       |
          +-------+                  |       |
         IP:2001:DB8::4              |       |
                                     +-------+
                                   IP:192.0.2.3
                                      2001:DB8::3

   at PCE:
   {
      "entity": [
      {
           "addr": "192.0.2.3",
           "oper-status": "oper-status-up",
           "role":"pce",
           "capability" : {
               "stateful": {
                    "enabled": true
               }
           }
           "lsp-db" : [
              "lsp" : {
                   "plsp-id": 3,
                   "pcc-id" :"192.0.2.1",
                   "lsp-ref" : {
                     "source": "192.0.2.1",
                     "destination": "192.0.2.4"
                     "tunnel-id": 16,
                     "lsp-id": 3,
                     "extended-tunnel-id": 0
                   },
                   "oper-status": "oper-status-up",
                   "delegated": true,
                   "symbolic-path-name": "iewauh",
                   },
              "lsp" : {
                   "plsp-id": 4,
                   "pcc-id" :"192.0.2.2",
                   "lsp-ref" : {
                     "source": "192.0.2.2",
                     "destination": "192.0.2.5"
                     "tunnel-id": 17,
                     "lsp-id": 4
                     "extended-tunnel-id": 0
                   },
                   "oper-status": "oper-status-up",
                   "delegated": true,
                   "symbolic-path-name": "iewauhiewauh",
                   "extended-tunnel-id": 0
                   }
           ]
           "peers":[
               {
                   "peer": {
                        "addr":"192.0.2.1",
                        "role": "pcc",

                        "capability": {
                            "stateful" : {
                                 "enabled": true,
                                 "active": yes,
                            }
                        }
                        "sessions": [
                            {
                                "session": {
                                    "initiator": "remote",
                                    "role": "pcc",
                                }
                            }
                        ]

                    }
               },
               {
                   "peer": {
                        "addr":"192.0.2.2",
                        "role": "pcc",

                        "capability": {
                            "stateful" : {
                                 "enabled": true,
                                 "active": true,
                            }
                        }
                        "sessions": [
                            {
                                "session": {
                                    "initiator": "remote",
                                    "role": "pcc",
                                }
                            }
                        ]
                    }
               }
           ]
       },

      {
           "addr": "2001:DB8::3",
           "oper-status": "oper-status-up",
           "role":"pce",
           "peers":[
               {
                   "peer": {
                        "addr":"2001:DB8::4",
                        "role": "pcc",
                        "sessions": [
                            {
                                "session": {
                                    "initiator": "remote",
                                    "role": "pcc",
                                }
                            }
                        ]
                    }
               }
           ]
       }
   }

Appendix B.  Contributor Addresses

   Rohit Pobbathi
   Huawei Technologies
   Divyashree Techno Park, Whitefield
   Bangalore, Karnataka  560066
   India

   EMail: rohit.pobbathi@huawei.com

   Vinod KumarS
   Huawei Technologies
   Divyashree Techno Park, Whitefield
   Bangalore, Karnataka  560066
   India

   EMail: vinods.kumar@huawei.com

   Zafar Ali
   Cisco Systems
   Canada

   EMail: zali@cisco.com

   Xufeng Liu
   Jabil
   8281 Greensboro Drive, Suite 200
   McLean  VA 22102
   USA

   EMail: Xufeng_Liu@jabil.com

   Young Lee
   Huawei Technologies
   5340 Legacy Drive, Building 3
   Plano, TX 75023, USA

   Phone: (469) 277-5838
   EMail: leeyoung@huawei.com

   Udayasree Palle
   Huawei Technologies
   Divyashree Techno Park, Whitefield
   Bangalore, Karnataka  560066
   India

   EMail: udayasreereddy@gmail.com
   Xian Zhang
   Huawei Technologies
   Bantian, Longgang District
   Shenzhen  518129
   P.R.China

   EMail: zhang.xian@huawei.com

   Avantika
   Huawei Technologies
   Divyashree Techno Park, Whitefield
   Bangalore, Karnataka  560066
   India

   EMail: s.avantika.avantika@gmail.com

   Shashikanth
   Huawei Technologies
   Divyashree Techno Park, Whitefield
   Bangalore, Karnataka  560066
   India

   EMail: shashikanth.vh@huawei.com

Authors' Addresses

   Dhruv Dhody (editor)
   Huawei Technologies
   Divyashree Techno Park, Whitefield
   Bangalore, Karnataka  560066
   India

   EMail: dhruv.ietf@gmail.com

   Jonathan Hardwick
   Metaswitch
   100 Church Street
   Enfield  EN2 6BQ
   UK

   EMail: jonathan.hardwick@metaswitch.com
   Vishnu Pavan Beeram
   Juniper Networks
   USA

   EMail: vbeeram@juniper.net

   Jeff Tantsura
   USA

   EMail: jefftant@gmail.com