LSR Working Group                                                  Y. Qu
Internet-Draft                                               U. Chunduri
Intended status: Standards Track                               Futurewei
Expires: January 8, 2020                                     J. Tantsura
                                                                  Apstra
                                                            July 7, 2019


               YANG Data Model for Preferred Path Routing
                       draft-qct-lsr-ppr-yang-02

Abstract

   This document defines YANG data modules for preferred path routing
   ([I-D.chunduri-lsr-isis-preferred-path-routing],
   [I-D.chunduri-lsr-ospf-preferred-path-routing]) configuration and
   operation.  The YANG modules are intended to be used on network
   elements to manage the configurations and operations of preferred
   path routing.

Requirements Language

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in [RFC2119].

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 January 8, 2020.

Copyright Notice

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




Qu, et al.               Expires January 8, 2020                [Page 1]


Internet-Draft                  ppr-yang                       July 2019


   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
     1.1.  Tree diagram  . . . . . . . . . . . . . . . . . . . . . .   2
   2.  PPR YANG Module . . . . . . . . . . . . . . . . . . . . . . .   2
   3.  ISIS PPR YANG Module  . . . . . . . . . . . . . . . . . . . .  11
   4.  OSPF PPR YANG Module  . . . . . . . . . . . . . . . . . . . .  22
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .  57
   6.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .  58
   7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  58
   8.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  58
     8.1.  Normative References  . . . . . . . . . . . . . . . . . .  58
     8.2.  Informative References  . . . . . . . . . . . . . . . . .  59
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  59

1.  Introduction

   This document defines YANG data modules ([RFC6020], [RFC7950]) for
   preferred path routing configuration and operation.

   There are three YANG modules defined in this document.  Module ietf-
   ppr.yang defined the protocol independent part of configuration and
   operations.  Two IGP modules are defined as ietf-isis-ppr.yang and
   ietf-ospf-ppr.yang.

1.1.  Tree diagram

   Tree diagrams used in this document follow the notation defined in
   [I-D.ietf-netmod-yang-tree-diagrams].

2.  PPR YANG Module

   This YANG module defines protocol independent part of configuration
   and operation of preferred path routing (PPR) as defined in
   ([I-D.chunduri-lsr-isis-preferred-path-routing]).

   module: ietf-ppr
     augment /rt:routing:



Qu, et al.               Expires January 8, 2020                [Page 2]


Internet-Draft                  ppr-yang                       July 2019


       +--rw preferred-path-routing
          +--rw preferred-path-lists* [name]
             +--rw name                   string
             +--rw preferred-path-mpls* [ppr-id]
             |  +--rw ppr-prefix?   inet:ip-prefix
             |  +--rw ppr-id        uint32
             |  +--rw algo?         uint8
             |  +--rw ppr-pde* [pde-id]
             |  |  +--rw pde-id         uint32
             |  |  +--rw pde-id-type?   ppr-pde-id-type
             |  |  +--rw loose?         boolean
             |  |  +--rw pde-type?      ppr-pde-type
             |  +--rw attributes
             |     +--rw count-packets?   boolean
             |     +--rw count-bytes?     boolean
             |     +--rw ppr-metric?      uint32
             +--rw preferred-path-ipv4* [ppr-id]
             |  +--rw ppr-prefix?   inet:ipv4-prefix
             |  +--rw ppr-id        inet:ipv4-prefix
             |  +--rw algo?         uint8
             |  +--rw ppr-pde* [pde-id]
             |  |  +--rw pde-id         inet:ipv4-address
             |  |  +--rw pde-id-type?   ppr-pde-id-type
             |  |  +--rw loose?         boolean
             |  |  +--rw pde-type?      ppr-pde-type
             |  +--rw attributes
             |     +--rw count-packets?   boolean
             |     +--rw count-bytes?     boolean
             |     +--rw ppr-metric?      uint32
             +--rw preferred-path-ipv6* [ppr-id]
             |  +--rw ppr-id        inet:ipv6-prefix
             |  +--rw algo?         uint8
             |  +--rw ppr-prefix?   inet:ipv6-prefix
             |  +--rw ppr-pde* [pde-id]
             |  |  +--rw pde-id         inet:ipv6-prefix
             |  |  +--rw pde-id-type?   ppr-pde-id-type
             |  |  +--rw loose?         boolean
             |  |  +--rw pde-type?      ppr-pde-type
             |  +--rw attributes
             |     +--rw count-packets?   boolean
             |     +--rw count-bytes?     boolean
             |     +--rw ppr-metric?      uint32
             +--rw preferred-path-srv6* [ppr-id]
                +--rw ppr-id         inet:ipv6-prefix
                +--rw algo?          uint8
                +--rw ppr-pde* [pde-id]
                |  +--rw pde-id    inet:ipv6-address
                +--rw pde-id-type?   ppr-pde-id-type



Qu, et al.               Expires January 8, 2020                [Page 3]


Internet-Draft                  ppr-yang                       July 2019


                +--rw loose?         boolean
                +--rw pde-type?      ppr-pde-type
                +--rw attributes
                   +--rw count-packets?   boolean
                   +--rw count-bytes?     boolean
                   +--rw ppr-metric?      uint32

   <CODE BEGINS> file "ietf-ppr@2019-07-07.yang"
   module ietf-ppr {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-ppr";

     prefix ppr;

     import ietf-inet-types {
       prefix inet;
     }

     import ietf-routing {
       prefix rt;
     }

     organization
         "IETF LSR - Link State Routing Working Group";

     contact
       "WG Web:   <http://datatracker.ietf.org/group/lsr/>
        WG List:  <mailto:lsr@ietf.org>

        Author:   Yingzhen Qu
                  <mailto:yingzhen.qu@feturewei.com>
                  Uma Chunduri
                  <mailto:uma.chunduri@futurewei.com>";
     description
       "This Yang module defines the configuration and operational
        state for Preferred Path Routing common to all vendor
        implementations.

        This YANG model conforms to the Network Management
        Datastore Architecture (NDMA) as described in RFC XXXX.

        Copyright (c) 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



Qu, et al.               Expires January 8, 2020                [Page 4]


Internet-Draft                  ppr-yang                       July 2019


        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.";

     reference "RFC XXXX";

     revision 2019-07-07 {
       description
         "Initial revision.";
       reference
         "RFC XXXX: A YANG Data Model for PPR.";
     }

     typedef ppr-pde-type {
       type enumeration {
         enum topological {
           value "1";
           description "Topological PPR PDE.";
         }
         enum non-topological {
           value "2";
           description "Non-Topological PPR PED.";
         }
       }
       description
         "PPR PDE type.";
     }

     typedef ppr-pde-id-type {
       type enumeration {
         enum sidlabel {
         value "1";
         description
           "PPR ID in mpls label format.";
         }
         enum prefix-sid {
           value "2";
           description
             "SR-MPLS prefix SID.";
         }
         enum adj-sid {
           value "3";
           description
             "SR-MPLS adjacency SID.";
         }
         enum ipv4-node {



Qu, et al.               Expires January 8, 2020                [Page 5]


Internet-Draft                  ppr-yang                       July 2019


           value "4";
           description
             "IPv4 node address.";
         }
         enum ipv4-p2p {
           value "5";
           description
             "IPv5 P2P interface address.";
         }
         enum ipv4-lan {
           value "6";
           description
             "IPv4 Lan interface address.";
         }
         enum ipv6-node {
           value "7";
           description
             "IPv6 node address.";
         }
         enum ipv6-p2p {
           value "8";
           description
             "IPv6 P2P interface address.";
         }
         enum ipv6-lan {
           value "9";
           description
             "IPv6 LAN interface address.";
         }
         enum srv6-node-sid {
           value "10";
           description
             "PDE ID in SRv6 node SID format.";
         }
         enum srv6-adj-sid {
           value "11";
           description
             "PDE ID in SRv6 node SID format.";
         }
       }
       description "Type of PPR ID.";
     }

     /* Groupings*/
     grouping ppr-attributes {
       leaf count-packets {
         type boolean;
         description



Qu, et al.               Expires January 8, 2020                [Page 6]


Internet-Draft                  ppr-yang                       July 2019


           "create a counter to count number of packets
            forwarded on this PPR-ID on each node in the
            path description.";
       }
       leaf count-bytes {
         type boolean;
         description
           "create a conter to count number of bytes.";
       }
       leaf ppr-metric {
         type uint32;
         description
           "Metric of the path prepsented by the PPR-ID.";
       }
       description
         "Groupings for PPR attributes.";
     }

     grouping pde-attributes {
       leaf pde-id-type {
         type ppr-pde-id-type;
         description
           "PDE forwarding identifier type.";
       }
       leaf loose {
         type boolean;
         default "true";
         description
           "If set, the next topological PDE is loose.";
       }
       leaf pde-type {
         type ppr-pde-type;
         description "PPR PDE type.";
       }
       description
         "Groupings for PDE attributes.";
     }

     augment "/rt:routing" {
       description
         "This module augments routing-instace configuration
          with preferred path routing.";
       container preferred-path-routing {
         description
           "preferred path routing configuration.";

         list preferred-path-lists {
           key "name";



Qu, et al.               Expires January 8, 2020                [Page 7]


Internet-Draft                  ppr-yang                       July 2019


           description
             "Preferred path lists.";

           leaf name {
             type string;
             description "PPR path list ID.";
           }

         list preferred-path-mpls {
           key "ppr-id";
           description
             "List of preferred path using MPLS data plane.";
           leaf ppr-prefix {
             type inet:ip-prefix;
             description
               "PPR Prefix representing the destination of the path.";
           }
           leaf ppr-id {
             type uint32;
             description
               "PPR ID, A 20 bit label or 32 bit SID.";
           }
           leaf algo {
             type uint8;
             description
               "SPF algorithm.";
           }
           list ppr-pde {
             key "pde-id";
             leaf pde-id {
               type uint32;
               description
                 "PDE identifiler.";
             }
             uses pde-attributes;
             description
               "List of PPR Path Description Element (PDE).";
           }
           container attributes {
             uses ppr-attributes;
             description "PPR attributes.";
           }
         }

         list preferred-path-ipv4 {
           key "ppr-id";
           description
             "List of preferred path using IPv4 data plane.";



Qu, et al.               Expires January 8, 2020                [Page 8]


Internet-Draft                  ppr-yang                       July 2019


           leaf ppr-prefix {
             type inet:ipv4-prefix;
             description
               "PPR Prefix representing the destination of the path.";
           }
           leaf ppr-id {
             type inet:ipv4-prefix;
             description
               "PPR ID, IPv4 address format.";
           }
           leaf algo {
             type uint8;
             description
               "SPF algorithm.";
           }
           list ppr-pde {
             key "pde-id";
             leaf pde-id {
               type inet:ipv4-address;
               description
                 "PDE identifier.";
             }
             uses pde-attributes;
             description
               "List of PPR Path Description Element (PDE).";
           }
           container attributes {
             uses ppr-attributes;
             description "PPR attributes.";
           }
         }

         list preferred-path-ipv6 {
           key "ppr-id";
           description
             "List of preferred path using IPv6 data plane.";
           leaf ppr-id {
             type inet:ipv6-prefix;
             description
               "PPR ID, IPv6 address format.";
           }
           leaf algo {
             type uint8;
             description
               "SPF algorithm.";
           }
           leaf ppr-prefix {
             type inet:ipv6-prefix;



Qu, et al.               Expires January 8, 2020                [Page 9]


Internet-Draft                  ppr-yang                       July 2019


             description
               "The prefix at the tail-end of the advertised PPR.";
           }

           list ppr-pde {
             key "pde-id";
             leaf pde-id {
               type inet:ipv6-prefix;
               description
                 "PDE identifier.";
             }
             uses pde-attributes;
             description
               "List of PPR Path Description Element (PDE).";
           }
           container attributes {
             uses ppr-attributes;
             description "PPR attributes.";
           }
         }

         list preferred-path-srv6 {
           key "ppr-id";
           description
             "List of preferred path using SRv6 data plane.";
           leaf ppr-id {
             type inet:ipv6-prefix;
             description
               "PPR ID, SRv6 SID format.";
           }
           leaf algo {
             type uint8;
             description
               "SPF algorithm.";
           }
           list ppr-pde {
             key "pde-id";
             leaf pde-id {
               type inet:ipv6-address;
               description
                 "PDE identifier.";
             }
             description
               "List of PPR Path Description Element (PDE).";
           }
           uses pde-attributes;
           container attributes {
             uses ppr-attributes;



Qu, et al.               Expires January 8, 2020               [Page 10]


Internet-Draft                  ppr-yang                       July 2019


             description "PPR attributes.";
           }

         }

         }

       }
     }
   }
   <CODE ENDS>

3.  ISIS PPR YANG Module

   This YANG module defines ISIS configuration and operation of
   preferred path routing (PPR) as defined in
   ([I-D.chunduri-lsr-isis-preferred-path-routing]).  It augments base
   ISIS module defined in [I-D.ietf-isis-yang-isis-cfg].

   module: ietf-isis-ppr
     augment /rt:routing/rt:control-plane-protocols
             /rt:control-plane-protocol/isis:isis:
       +--rw ppr
          +--rw ppr-enable* [name]
             +--rw enable?   boolean
             +--rw name      -> /rt:routing/ppr:preferred-path-routing
                                /preferred-path-lists/name
     augment /rt:routing/rt:control-plane-protocols
             /rt:control-plane-protocol/isis:isis/isis:database
             /isis:levels/isis:lsp:
       +--ro ppr-tlvs
          +--ro ppr-tlv*
             +--ro flags?                   bits
             +--ro fragment-id?             uint8
             +--ro mt-id?                   uint16
             +--ro algorithm?               uint8
             +--ro ppr-prefix-sub-tlv
             |  +--ro prefix-len?                uint8
             |  +--ro mask-len?                  uint8
             |  +--ro isis-prefix?               inet:ip-address
             |  +--ro ppr-prefix-sub-sub-tlvs
             |     +--ro unknown-tlv*
             |        +--ro type?     uint8
             |        +--ro length?   uint8
             |        +--ro value?    yang:hex-string
             +--ro ppr-id-sub-tlv
             |  +--ro ppr-id-type?       enumeration
             |  +--ro ppr-id-len?        uint8



Qu, et al.               Expires January 8, 2020               [Page 11]


Internet-Draft                  ppr-yang                       July 2019


             |  +--ro ppr-id-mask-len?   uint8
             |  +--ro (ppr-id)?
             |     +--:(mpls-id)
             |     |  +--ro mpls-id?           uint32
             |     +--:(ipv4-id)
             |     |  +--ro ipv4-id?           inet:ipv4-prefix
             |     +--:(srv6-ipv6-id)
             |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
             +--ro ppr-pde-sub-tlvs*
             |  +--ro pde-type?               enumeration
             |  +--ro ppr-pde-flags?          bits
             |  +--ro pde-id-type?            ppr:ppr-pde-id-type
             |  +--ro pde-id-len?             uint8
             |  +--ro (pde-id)?
             |  |  +--:(mpls-id)
             |  |  |  +--ro mpls-id?                uint32
             |  |  +--:(ipv4-id)
             |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
             |  |  +--:(srv6-ipv6-id)
             |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
             |  +--ro sub-tlv-length?         uint8
             |  +--ro ppr-pde-sub-sub-tlvs
             |     +--ro unknown-tlv*
             |        +--ro type?     uint8
             |        +--ro length?   uint8
             |        +--ro value?    yang:hex-string
             +--ro ppr-attribute-sub-tlv
                +--ro traffic-accounting-sub-tlv
                |  +--ro type?   uint8
                +--ro traffic-statis-sub-tlv
                |  +--ro type?   uint8
                +--ro ipv4-routerid-sub-tlv
                |  +--ro type?     uint8
                |  +--ro length?   uint8
                |  +--ro value?    inet:ipv4-address
                +--ro ipv6-routerid-sub-tlv
                |  +--ro type?     uint8
                |  +--ro length?   uint8
                |  +--ro value?    inet:ipv6-address
                +--ro ppr-metric-sub-tlv
                   +--ro type?     uint8
                   +--ro length?   uint8
                   +--ro value?    uint32

<CODE BEGINS> file "ietf-isis-ppr@2019-07-07.yang"
module ietf-isis-ppr {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-isis-ppr";



Qu, et al.               Expires January 8, 2020               [Page 12]


Internet-Draft                  ppr-yang                       July 2019


  prefix isis-ppr;

  import ietf-inet-types {
    prefix inet;
  }

  import ietf-yang-types {
    prefix "yang";
  }

  import ietf-routing {
    prefix rt;
  }


  import ietf-isis {
    prefix "isis";
  }

  import ietf-ppr {
    prefix "ppr";
  }

  organization
      "IETF LSR - Link State Routing Working Group";

  contact
    "WG Web:   <http://datatracker.ietf.org/group/lsr/>
     WG List:  <mailto:lsr@ietf.org>

     Author:   Yingzhen Qu
               <mailto:yingzhen.qu@futurewei.com>
               Uma Chunduri
               <mailto:uma.chunduri@futurewei.com>";
  description
    "This Yang module defines the configuration and operational
     state for Preferred Path Routing common to all vendor
     implementations.

     This YANG model conforms to the Network Management
     Datastore Architecture (NDMA) as described in RFC XXXX.

     Copyright (c) 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



Qu, et al.               Expires January 8, 2020               [Page 13]


Internet-Draft                  ppr-yang                       July 2019


     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.";

  reference "RFC XXXX";

  revision 2019-07-07 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: A YANG Data Model for ISIS PPR.";
  }

   /* Groupings */
  grouping tlv {
    description
      "TLV";
    leaf type {
      type uint8;
      description "TLV type.";
    }
    leaf length {
      type uint8;
      description "TLV length (octets).";
    }
    leaf value {
      type yang:hex-string;
      description "TLV value.";
    }
  }

  grouping general-tlvs {
    description
      "Unknown TLVs grouping - Used for unknown TLVs or
       unknown sub-TLVs.";

      list unknown-tlv {
        description "General TLV.";
        uses tlv;
      }
  }

  grouping ppr-prefix-sub-tlv {
    description "ISIS destination prefix.";




Qu, et al.               Expires January 8, 2020               [Page 14]


Internet-Draft                  ppr-yang                       July 2019


    container ppr-prefix-sub-tlv {
      leaf prefix-len {
        type uint8;
        description "The length of the profix in bytes.";
      }
      leaf mask-len {
        type uint8;
        description "The length of the profix in bits.";
      }
      leaf isis-prefix {
        type inet:ip-address;
        description "FEC Prefix.";
      }
      container ppr-prefix-sub-sub-tlvs {
        uses general-tlvs;
        description "PPR Prefix sub sub-tlvs.";
      }
      description
        "PPR Prefix sub-tlv.";
    }
  }

  grouping ppr-id-sub-tlv {
    description
      "PPR ID: the actual data plane identifier in the packet header.";

    container ppr-id-sub-tlv {
      leaf ppr-id-type {
        type enumeration {
            enum mpls {
              value 1;
              description
                "PPR ID in mpls label format.";
            }
            enum ipv4 {
              value 2;
              description
                "PPR ID in IPv4 address format.";
            }
            enum ipv6 {
              value 3;
              description
                "PPR ID in ipv6 address format.";
            }
            enum srv6 {
              value 4;
              description
                "PPR ID in SRv6 SID format.";



Qu, et al.               Expires January 8, 2020               [Page 15]


Internet-Draft                  ppr-yang                       July 2019


            }
        }
        description "Type of PPR ID.";
      }
      leaf ppr-id-len {
        type uint8;
        description
          "Length of the PPR ID.";
      }
      leaf ppr-id-mask-len {
        type uint8;
        description "The length of the profix in bits.";
      }
      choice ppr-id {
        leaf mpls-id {
          type uint32;
          description "MPLS Label format.";
        }
        leaf ipv4-id {
          type inet:ipv4-prefix;
          description "IPv4 format.";
        }
        leaf srv6-ipv6-id {
          type inet:ipv6-prefix;
          description "SRv6 or IPv6 format.";
        }
          description "Preferred Path ID.";
      }
      description "PPR ID sub tlv.";
    }

  }

  grouping ppr-pde-sub-tlv {
    description
      "This sub-tlv represents the PPR Path Description Element (PDE).";

    list ppr-pde-sub-tlvs {
      description "PPR PDE sub tlvs.";
      leaf pde-type {
        type enumeration {
          enum topological {
           value 1;
           description
             "Topological PDE.";
          }
          enum non-topological {
            value 2;



Qu, et al.               Expires January 8, 2020               [Page 16]


Internet-Draft                  ppr-yang                       July 2019


            description
              "Non-topological PDE.";
          }
        }
        description "Type of PDE.";
      }
      leaf ppr-pde-flags {
        type bits {
          bit L {
            position 0;
            description
              "If set, the PPR path is a Loose-PPR.";
          }
          bit N {
            position 1;
            description
              "If set, the PDE is topological and this PDE represents
               the node PPR-prfix";
          }
          bit E {
            position 2;
            description
              "Egress Bit. By default this bit MUST be unset.";
          }
        }
        description "Flags.";
      }
      leaf pde-id-type {
        type ppr:ppr-pde-id-type;
        description "Type of PPR PDE ID.";
      }
      leaf pde-id-len {
        type uint8;
        description
          "Length of the PDE ID.";
      }
      choice pde-id {
        leaf mpls-id {
          type uint32;
          description "MPLS Label format.";
        }
        leaf ipv4-id {
          type inet:ipv4-prefix;
          description "IPv4 format.";
        }
        leaf srv6-ipv6-id {
          type inet:ipv6-prefix;
          description "SRv6 or IPv6 format.";



Qu, et al.               Expires January 8, 2020               [Page 17]


Internet-Draft                  ppr-yang                       July 2019


        }
          description "Preferred Path ID.";
      }
      leaf sub-tlv-length{
        type uint8;
        description
          "Length of all sub-TLVs followed.";
      }
      container ppr-pde-sub-sub-tlvs {
        uses general-tlvs;
        description "PPR PDE sub sub-tlvs.";
      }
    }
  }

  grouping ppr-attribute-sub-tlv {
    description "Grouping for PPR attribute sub-tlvs.";

    container ppr-attribute-sub-tlv {
      description "PPR attribute sub-tlv.";

    container traffic-accounting-sub-tlv {
      description
        "packet traffic acccounting sub-tlv. Specifies to create
         a counter to count number of packets forwarded to this
         PPR-ID on each node in the path description.";
      leaf type {
        type uint8;
        default 1;
        description "Type 1 sub-tlv.";
      }
    }
    container traffic-statis-sub-tlv {
      description
        "Specifies to create a counter to count number of bytes
        forwarded on this PPR-ID specified in the network header
        (e.g.  IPv4, IPv6) on each node in the path description.";
      leaf type {
        type uint8;
        default 2;
        description "Traffic statistics in bytes sub-tlv.";
      }
    }
    container ipv4-routerid-sub-tlv {
      description "PPR-prefix originating node's IPv4 router ID.";
      leaf type {
        type uint8;
        default 3;



Qu, et al.               Expires January 8, 2020               [Page 18]


Internet-Draft                  ppr-yang                       July 2019


        description "PPR-prefix originating node's IPv4 router ID.";
      }
      leaf length {
        type uint8;
        default 4;
        description "Lenght is 4 bytes.";
      }
      leaf value {
        type inet:ipv4-address;
        description "IPv4 router ID.";
      }
    }
    container ipv6-routerid-sub-tlv {
      description "PPR-prefix originating node's IPv6 router ID.";
      leaf type {
        type uint8;
        default 4;
        description "PPR-prefix originating node's IPv6 router ID.";
      }
      leaf length {
        type uint8;
        default 16;
        description "Length is 16 bytes.";
      }
      leaf value {
        type inet:ipv6-address;
        description "IPv6 router ID.";
      }
    }
    container ppr-metric-sub-tlv {
      description
        "The metric of this path represented through the PPR-ID.";
      leaf type {
        type uint8;
        default 5;
        description "Metric sub-tlv.";
      }
      leaf length {
        type uint8;
        default 4;
        description "4 bytes.";
      }
      leaf value {
        type uint32;
        description "Metirc of the PPR-ID.";
      }
    }
    }



Qu, et al.               Expires January 8, 2020               [Page 19]


Internet-Draft                  ppr-yang                       July 2019


  }

  grouping ppr-tlvs {
    description "PPR TLV encodings.";

    container ppr-tlvs {
      description "List of PPR TLVs.";
      list ppr-tlv {
        description "List of PPR TLVs.";
        leaf flags {
          type bits {
            bit F {
              position 0;
              description
                "If set, the PPR TLV must be flooded across
                 the entire routing domain.";
            }
            bit D {
              position 1;
              description
                "If set, the PPR TLV is leaked from ISIS level-2
                 to level-1.";
            }
            bit A {
              position 2;
              description
                "If set, it is to signal that the prefixes and PPR IDs
                 advertised in this TLV are directly connected to
                 their originators.";
            }
            bit U {
               position 3;
               description
                 "U bit MUST be set if a path has only one fragment or
                  if it is the last Fragment of the path.";
            }
          }
          description "Flags.";
        }
        leaf fragment-id {
          type uint8 {
            range "0 .. 127";
          }
          description
            "Identifiler of the fragment.";
        }
        leaf mt-id {
          type uint16 {



Qu, et al.               Expires January 8, 2020               [Page 20]


Internet-Draft                  ppr-yang                       July 2019


            range "0 .. 4095";
          }
          description
          "This leaf defines the identifier
          of a topology as in RFC 5120.";
        }
        leaf algorithm {
          type uint8;
          description
            "The SPF algorithm.";
        }
        uses ppr-prefix-sub-tlv;
        uses ppr-id-sub-tlv;
        uses ppr-pde-sub-tlv;
        uses ppr-attribute-sub-tlv;
      }
    }
  }


  /* Configuration */
  augment "/rt:routing/rt:control-plane-protocols"
        + "/rt:control-plane-protocol/isis:isis" {
    when "../rt:type = 'isis:isis'" {
      description
        "This augments the ISIS routing protocol when used.";
    }
    description
      "This augments the ISIS protocol configuration
       with preferred path routing.";

    container ppr {
      description
        "ISIS PPR.";
      leaf enable {
        type boolean;
        default false;
        description
         "Enable PPR.";
      }
      list ppr-advertise {
        key "name";
        leaf name {
          type leafref {
            path "/rt:routing/ppr:preferred-path-routing/"
                 + "ppr:preferred-path-lists/ppr:name";
            }
          description



Qu, et al.               Expires January 8, 2020               [Page 21]


Internet-Draft                  ppr-yang                       July 2019


            "PPR path list name.";
        }
        description
          "Enable PPR path advertisement.";
      }
    }
  }

  /* Database */
  augment "/rt:routing/"
        + "rt:control-plane-protocols/rt:control-plane-protocol"
        + "/isis:isis/isis:database/isis:levels/isis:lsp" {
        when "/rt:routing/rt:control-plane-protocols/"+
        "rt:control-plane-protocol/rt:type = 'isis:isis'" {
      description
      "This augment ISIS routing protocol when used";
    }
        description
     "This augments ISIS protocol LSDB.";
    uses ppr-tlvs;

  }
}
<CODE ENDS>

4.  OSPF PPR YANG Module

   This YANG module defines OSPF configuration and operation of
   preferred path routing (PPR) as defined in
   ([I-D.chunduri-lsr-ospf-preferred-path-routing]).  It augments the
   base OSPF module defined in [I-D.ietf-ospf-yang].  Both OSPFv2 and
   OSPFv3 are included.

  module: ietf-ospf-ppr
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf:
      +--rw ppr
         +--rw ppr-enable* [name]
            +--rw enable?   boolean
            +--rw name      -> /rt:routing/ppr:preferred-path-routing
                               /preferred-path-lists/name
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:interfaces/ospf:interface/ospf:database
            /ospf:link-scope-lsa-type/ospf:link-scope-lsas
            /ospf:link-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2
            /ospf:body/ospf:opaque/ospf:extended-prefix-tlvs
            /ospf:extended-prefix-tlv:



Qu, et al.               Expires January 8, 2020               [Page 22]


Internet-Draft                  ppr-yang                       July 2019


      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8



Qu, et al.               Expires January 8, 2020               [Page 23]


Internet-Draft                  ppr-yang                       July 2019


               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type/ospf:area-scope-lsas
            /ospf:area-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2
            /ospf:body/ospf:opaque/ospf:extended-prefix-tlvs
            /ospf:extended-prefix-tlv:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*



Qu, et al.               Expires January 8, 2020               [Page 24]


Internet-Draft                  ppr-yang                       July 2019


            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:database
            /ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa
            /ospf:version/ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque
            /ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address



Qu, et al.               Expires January 8, 2020               [Page 25]


Internet-Draft                  ppr-yang                       July 2019


            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8



Qu, et al.               Expires January 8, 2020               [Page 26]


Internet-Draft                  ppr-yang                       July 2019


               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:interfaces/ospf:interface/ospf:database
            /ospf:link-scope-lsa-type/ospf:link-scope-lsas
            /ospf:link-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospf:inter-area-prefix:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix



Qu, et al.               Expires January 8, 2020               [Page 27]


Internet-Draft                  ppr-yang                       July 2019


            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type/ospf:area-scope-lsas
            /ospf:area-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospf:inter-area-prefix:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8



Qu, et al.               Expires January 8, 2020               [Page 28]


Internet-Draft                  ppr-yang                       July 2019


            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:database
            /ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa
            /ospf:version/ospf:ospfv3/ospf:ospfv3/ospf:body



Qu, et al.               Expires January 8, 2020               [Page 29]


Internet-Draft                  ppr-yang                       July 2019


            /ospf:inter-area-prefix:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv



Qu, et al.               Expires January 8, 2020               [Page 30]


Internet-Draft                  ppr-yang                       July 2019


               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:interfaces/ospf:interface/ospf:database
            /ospf:link-scope-lsa-type/ospf:link-scope-lsas
            /ospf:link-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospf:intra-area-prefix:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix



Qu, et al.               Expires January 8, 2020               [Page 31]


Internet-Draft                  ppr-yang                       July 2019


            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type/ospf:area-scope-lsas
            /ospf:area-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospf:intra-area-prefix:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8



Qu, et al.               Expires January 8, 2020               [Page 32]


Internet-Draft                  ppr-yang                       July 2019


            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8



Qu, et al.               Expires January 8, 2020               [Page 33]


Internet-Draft                  ppr-yang                       July 2019


               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:database
            /ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa
            /ospf:version/ospf:ospfv3/ospf:ospfv3/ospf:body
            /ospf:intra-area-prefix:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix



Qu, et al.               Expires January 8, 2020               [Page 34]


Internet-Draft                  ppr-yang                       July 2019


            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:interfaces/ospf:interface/ospf:database
            /ospf:link-scope-lsa-type/ospf:link-scope-lsas
            /ospf:link-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospf:as-external:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration



Qu, et al.               Expires January 8, 2020               [Page 35]


Internet-Draft                  ppr-yang                       July 2019


            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type/ospf:area-scope-lsas



Qu, et al.               Expires January 8, 2020               [Page 36]


Internet-Draft                  ppr-yang                       July 2019


            /ospf:area-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospf:as-external:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv



Qu, et al.               Expires January 8, 2020               [Page 37]


Internet-Draft                  ppr-yang                       July 2019


               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:database
            /ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa
            /ospf:version/ospf:ospfv3/ospf:ospfv3/ospf:body
            /ospf:as-external:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix



Qu, et al.               Expires January 8, 2020               [Page 38]


Internet-Draft                  ppr-yang                       July 2019


            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:interfaces/ospf:interface/ospf:database
            /ospf:link-scope-lsa-type/ospf:link-scope-lsas
            /ospf:link-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospf:nssa:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8



Qu, et al.               Expires January 8, 2020               [Page 39]


Internet-Draft                  ppr-yang                       July 2019


            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv



Qu, et al.               Expires January 8, 2020               [Page 40]


Internet-Draft                  ppr-yang                       July 2019


               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area
            /ospf:database/ospf:area-scope-lsa-type/ospf:area-scope-lsas
            /ospf:area-scope-lsa/ospf:version/ospf:ospfv3/ospf:ospfv3
            /ospf:body/ospf:nssa:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8
            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)



Qu, et al.               Expires January 8, 2020               [Page 41]


Internet-Draft                  ppr-yang                       July 2019


            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32
    augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol/ospf:ospf/ospf:database
            /ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa
            /ospf:version/ospf:ospfv3/ospf:ospfv3/ospf:body/ospf:nssa:
      +--ro ppr-tlvs
         +--ro ppr-tlv*
            +--ro flags?                   bits
            +--ro af?                      iana-rt-types:address-family
            +--ro ppr-prefix-sub-tlv
            |  +--ro mt-id?                     uint8
            |  +--ro prefix-len?                uint8
            |  +--ro mask-len?                  uint8
            |  +--ro ospf-prefix?               inet:ip-address
            |  +--ro ppr-prefix-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-id-sub-tlv
            |  +--ro ppr-id-type?       enumeration
            |  +--ro ppr-id-len?        uint8



Qu, et al.               Expires January 8, 2020               [Page 42]


Internet-Draft                  ppr-yang                       July 2019


            |  +--ro ppr-id-mask-len?   uint8
            |  +--ro ppr-id-algo?       uint8
            |  +--ro (ppr-id)?
            |     +--:(mpls-id)
            |     |  +--ro mpls-id?           uint32
            |     +--:(ipv4-id)
            |     |  +--ro ipv4-id?           inet:ipv4-prefix
            |     +--:(srv6-ipv6-id)
            |        +--ro srv6-ipv6-id?      inet:ipv6-prefix
            +--ro ppr-pde-sub-tlvs*
            |  +--ro pde-type?               enumeration
            |  +--ro ppr-pde-flags?          bits
            |  +--ro pde-id-type?            ppr:ppr-pde-id-type
            |  +--ro pde-id-len?             uint8
            |  +--ro (pde-id)?
            |  |  +--:(mpls-id)
            |  |  |  +--ro mpls-id?                uint32
            |  |  +--:(ipv4-id)
            |  |  |  +--ro ipv4-id?                inet:ipv4-prefix
            |  |  +--:(srv6-ipv6-id)
            |  |     +--ro srv6-ipv6-id?           inet:ipv6-prefix
            |  +--ro ppr-pde-sub-sub-tlvs
            |     +--ro unknown-tlvs
            |        +--ro unknown-tlv*
            |           +--ro type?     uint16
            |           +--ro length?   uint16
            |           +--ro value?    yang:hex-string
            +--ro ppr-attribute-sub-tlv
               +--ro traffic-accounting-sub-tlv
               |  +--ro type?   uint8
               +--ro traffic-statis-sub-tlv
               |  +--ro type?   uint8
               +--ro ipv4-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv4-address
               +--ro ipv6-routerid-sub-tlv
               |  +--ro type?     uint8
               |  +--ro length?   uint8
               |  +--ro value?    inet:ipv6-address
               +--ro ppr-metric-sub-tlv
                  +--ro type?     uint8
                  +--ro length?   uint8
                  +--ro value?    uint32


 <CODE BEGINS> file "ietf-ospf-ppr@2019-07-07.yang"
 module ietf-ospf-ppr {



Qu, et al.               Expires January 8, 2020               [Page 43]


Internet-Draft                  ppr-yang                       July 2019


   yang-version 1.1;
   namespace "urn:ietf:params:xml:ns:yang:ietf-ospf-ppr";

   prefix ospf-ppr;

   import ietf-inet-types {
     prefix inet;
   }

   import iana-routing-types {
     prefix "iana-rt-types";
     reference "RFC 8291 - Common YANG Data Types for the
                Routing Area";
   }

   import ietf-routing {
     prefix rt;
   }

   import ietf-ospf {
     prefix "ospf";
   }

   import ietf-ppr {
     prefix "ppr";
   }

   organization
       "IETF LSR - Link State Routing Working Group";

   contact
     "WG Web:   <http://datatracker.ietf.org/group/lsr/>
      WG List:  <mailto:lsr@ietf.org>

      Author:   Yingzhen Qu
                <mailto:yingzhen.qu@futurewei.com>
                Uma Chunduri
                <mailto:uma.chunduri@futurewei.com>";
   description
     "This Yang module defines the configuration and operational
      state for Preferred Path Routing common to all vendor
      implementations.

      This YANG model conforms to the Network Management
      Datastore Architecture (NDMA) as described in RFC XXXX.

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



Qu, et al.               Expires January 8, 2020               [Page 44]


Internet-Draft                  ppr-yang                       July 2019


      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.";

   reference "RFC XXXX";

   revision 2019-07-07 {
     description
       "Initial revision.";
     reference
       "RFC XXXX: A YANG Data Model for OSPFv2 and OSPFv3 PPR.";
   }


   grouping ppr-prefix-sub-tlv {
     description "Grouping for OSPF prefix sub-tlv.";

     container ppr-prefix-sub-tlv {
       leaf mt-id {
         type uint8 {
           range "0 .. 255";
         }
         description
           "This leaf defines the identifier
           of a topology.";
       }
       leaf prefix-len {
         type uint8;
         description "The length of the profix in bytes.";
       }
       leaf mask-len {
         type uint8;
         description "The length of the profix in bits.";
       }
       leaf ospf-prefix {
         type inet:ip-address;
         description "OSPF Prefix.";
       }
       container ppr-prefix-sub-sub-tlvs {
         uses ospf:unknown-tlvs;
         description
           "PPR-Prefix sub-tlvs.";



Qu, et al.               Expires January 8, 2020               [Page 45]


Internet-Draft                  ppr-yang                       July 2019


       }
       description
         "OSPF PPR prefix sub-tlv.";
     }
   }

   grouping ppr-id-sub-tlv {
     description
       "PPR ID: the actual data plane identifier in the packet header.";

     container ppr-id-sub-tlv {
       description "PPR ID sub tlv.";
       leaf ppr-id-type {
         type enumeration {
             enum mpls {
               value 1;
               description
                 "PPR ID in mpls label format.";
             }
             enum ipv4 {
               value 2;
               description
                 "PPR ID in IPv4 address format.";
             }
             enum ipv6 {
               value 3;
               description
                 "PPR ID in ipv6 address format.";
             }
             enum srv6 {
               value 4;
               description
                 "PPR ID in SRv6 SID format.";
             }
         }
         description "Type of PPR ID.";
       }
       leaf ppr-id-len {
         type uint8;
         description
           "Length of the PPR ID.";
       }
       leaf ppr-id-mask-len {
         type uint8;
         description "The length of the profix in bits.";
       }
       leaf ppr-id-algo {
         type uint8;



Qu, et al.               Expires January 8, 2020               [Page 46]


Internet-Draft                  ppr-yang                       July 2019


         description "The SPF algorithm.";
       }
       choice ppr-id {
         leaf mpls-id {
           type uint32;
           description "MPLS Label format.";
         }
         leaf ipv4-id {
           type inet:ipv4-prefix;
           description "IPv4 format.";
         }
         leaf srv6-ipv6-id {
           type inet:ipv6-prefix;
           description "SRv6 or IPv6 format.";
         }
           description "Preferred Path ID.";
       }
     }

   }

   grouping ppr-pde-sub-tlv {
     description
       "This sub-tlv represents the PPR Path Description
        Element (PDE).";

     list ppr-pde-sub-tlvs {
       description "PPR PDE sub tlvs.";
       leaf pde-type {
         type enumeration {
           enum topological {
            value 1;
            description
              "Topological PDE.";
           }
           enum non-topological {
             value 2;
             description
               "Non-topological PDE.";
           }
         }
         description "PDE type.";
       }
       leaf ppr-pde-flags {
         type bits {
           bit L {
             position 0;
             description



Qu, et al.               Expires January 8, 2020               [Page 47]


Internet-Draft                  ppr-yang                       July 2019


               "If set, the PPR path is a Loose-PPR.";
           }
           bit D {
             position 1;
             description
               "If set, the PDE is topological and this PDE represents
                the node PPR-prfix";
           }
           bit E {
             position 2;
             description
               "Egress Bit. By default this bit MUST be unset.";
           }
         }
         description "Flags.";
       }
       leaf pde-id-type {
         type ppr:ppr-pde-id-type;
         description "Type of PDE ID.";
       }
       leaf pde-id-len {
         type uint8;
         description
           "Length of the PDE ID.";
       }
       choice pde-id {
         leaf mpls-id {
           type uint32;
           description "MPLS Label format.";
         }
         leaf ipv4-id {
           type inet:ipv4-prefix;
           description "IPv4 format.";
         }
         leaf srv6-ipv6-id {
           type inet:ipv6-prefix;
           description "SRv6 or IPv6 format.";
         }
           description "Preferred Path ID.";
       }
       container ppr-pde-sub-sub-tlvs {
         uses ospf:unknown-tlvs;
         description "PPR PDE sub sub-tlv.";
       }
     }
   }

   grouping ppr-attribute-sub-tlv {



Qu, et al.               Expires January 8, 2020               [Page 48]


Internet-Draft                  ppr-yang                       July 2019


     description "Grouping for PPR attribute sub-tlvs.";

     container ppr-attribute-sub-tlv {
       description "PPR attribute sub-tlv.";

     container traffic-accounting-sub-tlv {
       description
         "packet traffic acccounting sub-tlv. Specifies to create
          a counter to count number of packets forwarded to this
          PPR-ID on each node in the path description.";
       leaf type {
         type uint8;
         default 1;
         description "Type 1 sub-tlv.";
       }
     }
     container traffic-statis-sub-tlv {
       description
         "Specifies to create a counter to count number of bytes
         forwarded on this PPR-ID specified in the network header
         (e.g.  IPv4, IPv6) on each node in the path description.";
       leaf type {
         type uint8;
         default 2;
         description "Traffic statistics in bytes sub-tlv.";
       }
     }
     container ipv4-routerid-sub-tlv {
       description "PPR-prefix originating node's IPv4 router ID.";
       leaf type {
         type uint8;
         default 3;
         description "PPR-prefix originating node's IPv4 router ID.";
       }
       leaf length {
         type uint8;
         default 4;
         description "TLV length is 4.";
       }
       leaf value {
         type inet:ipv4-address;
         description "IPv4 router ID.";
       }
     }
     container ipv6-routerid-sub-tlv {
       description "PPR-prefix originating node's IPv6 router ID.";
       leaf type {
         type uint8;



Qu, et al.               Expires January 8, 2020               [Page 49]


Internet-Draft                  ppr-yang                       July 2019


         default 4;
         description "PPR-prefix originating node's IPv6 router ID.";
       }
       leaf length {
         type uint8;
         default 16;
         description "TLV length is 16.";
       }
       leaf value {
         type inet:ipv6-address;
         description "IPv6 router ID.";
       }
     }
     container ppr-metric-sub-tlv {
       description
         "The metric of this path represented through the PPR-ID.";
       leaf type {
         type uint8;
         default 5;
         description "Metric sub-tlv.";
       }
       leaf length {
         type uint8;
         default 4;
         description "4 bytes.";
       }
       leaf value {
         type uint32;
         description "Metirc of the PPR-ID.";
       }
     }
     }
   }

   grouping ppr-tlvs {
     description "PPR TLV in extended prefix opaque LSAs.";

     container ppr-tlvs {
       description "List of PPR TLVs.";
       list ppr-tlv {
         description "OSPF PPR TLV.";
         leaf flags {
           type bits {
             bit IA {
               position 0;
               description
                 "Inter-Area flag.";
             }



Qu, et al.               Expires January 8, 2020               [Page 50]


Internet-Draft                  ppr-yang                       July 2019


             bit A {
               position 1;
               description
                 "If set, it is to signal that the prefixes and PPR
                  IDs advertised in this TLV are directly connected
                  to their originators.";
             }
           }
           description "Flags.";
         }
         leaf af {
           type iana-rt-types:address-family;
           description
             "Address family of the OSPF instance.";
         }

         uses ppr-prefix-sub-tlv;
         uses ppr-id-sub-tlv;
         uses ppr-pde-sub-tlv;
         uses ppr-attribute-sub-tlv;
       }

     }

   }

   /* Configuration */
   augment "/rt:routing/rt:control-plane-protocols"
         + "/rt:control-plane-protocol/ospf:ospf" {
     when "../rt:type = 'ospf:ospfv2' or "
        + "../rt:type = 'ospf:ospfv3'" {
       description
         "This augments the OSPF routing protocol when used.";
     }
     description
       "This augments the OSPF protocol configuration
        with preferred path routing.";

     container ppr {
       description
         "OSPF PPR.";
       list ppr-enable {
         key "name";
         leaf enable {
           type boolean;
           description
             "Enable PPR.";
         }



Qu, et al.               Expires January 8, 2020               [Page 51]


Internet-Draft                  ppr-yang                       July 2019


         leaf name {
           type leafref {
             path "/rt:routing/ppr:preferred-path-routing/"
                  + "ppr:preferred-path-lists/ppr:name";
             }
           description
             "PPR path list name.";
         }
         description
           "Enable PPR.";
       }
     }
   }

   /* Database */
   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:areas/ospf:area/"
         + "ospf:interfaces/ospf:interface/ospf:database/"
         + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
         + "ospf:link-scope-lsa/ospf:version/ospf:ospfv2/"
         + "ospf:ospfv2/ospf:body/ospf:opaque/"
         + "ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv" {
     when "../../../../../../../../../../../../../../"
        + "rt:type = 'ospf:ospfv2'" {
       description
         "This augmentation is only valid for OSPFv2.";
     }
     description
       "PPR specific TLVs for OSPFv2 type 9 opaque LSA.";
     uses ppr-tlvs;
   }

   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:areas/"
         + "ospf:area/ospf:database/"
         + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
         + "ospf:area-scope-lsa/ospf:version/ospf:ospfv2/"
         + "ospf:ospfv2/ospf:body/ospf:opaque/"
         + "ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv" {
     when "../../../../../../../../../../../../"
        + "rt:type = 'ospf:ospfv2'" {
       description
         "This augmentation is only valid for OSPFv2.";
     }
     description
       "PPR specific TLVs for OSPFv2 type 10 opaque LSA.";



Qu, et al.               Expires January 8, 2020               [Page 52]


Internet-Draft                  ppr-yang                       July 2019


     uses ppr-tlvs;
   }

   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:database/"
         + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
         + "ospf:as-scope-lsa/ospf:version/ospf:ospfv2/"
         + "ospf:ospfv2/ospf:body/ospf:opaque/"
         + "ospf:extended-prefix-tlvs/ospf:extended-prefix-tlv" {
     when "../../../../../../../../../../"
        + "rt:type = 'ospf:ospfv2'" {
       description
         "This augmentation is only valid for OSPFv2.";
     }
     description
       "PPR specific TLVs for OSPFv2 type 11 opaque LSA.";
     uses ppr-tlvs;
   }

   /* OSPFv3 inter-area-prefix-lsa */
   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:areas/ospf:area/"
         + "ospf:interfaces/ospf:interface/ospf:database/"
         + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
         + "ospf:link-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:inter-area-prefix" {
     when "../../../../../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {
       description
         "This augmentation is only valid for OSPFv3.";
     }

     description
       "SR specific TLVs for OSPFv3 link scope Inter-Area-Prefix-LSA.";
     uses ppr-tlvs;
   }

   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:areas/"
         + "ospf:area/ospf:database/"
         + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
         + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:inter-area-prefix" {
     when "../../../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {



Qu, et al.               Expires January 8, 2020               [Page 53]


Internet-Draft                  ppr-yang                       July 2019


       description
         "This augmentation is only valid for OSPFv3.";
     }
     description
       "SR specific TLVs for OSPFv3 area scope Inter-Area-Prefix-LSA.";
     uses ppr-tlvs;
   }

   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:database/"
         + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
         + "ospf:as-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:inter-area-prefix" {
     when "../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {
       description
         "This augmentation is only valid for OSPFv3.";
     }
     description
       "SR specific TLVs for OSPFv3 as scope Inter-Area-Prefix-LSA.";
     uses ppr-tlvs;
   }

   /* OSPFv3 intra-area-prefix-lsa */
     augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:areas/ospf:area/"
         + "ospf:interfaces/ospf:interface/ospf:database/"
         + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
         + "ospf:link-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:intra-area-prefix" {
     when "../../../../../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {
       description
         "This augmentation is only valid for OSPFv3.";
     }

     description
       "SR specific TLVs for OSPFv3 link scope Intra-Area-Prefix-LSA.";
     uses ppr-tlvs;
   }

   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:areas/"
         + "ospf:area/ospf:database/"
         + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"



Qu, et al.               Expires January 8, 2020               [Page 54]


Internet-Draft                  ppr-yang                       July 2019


         + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:intra-area-prefix" {
     when "../../../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {
       description
         "This augmentation is only valid for OSPFv3.";
     }
     description
       "SR specific TLVs for OSPFv3 area scope Inter-Area-Prefix-LSA.";
     uses ppr-tlvs;
   }

   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:database/"
         + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
         + "ospf:as-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:intra-area-prefix" {
     when "../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {
       description
         "This augmentation is only valid for OSPFv3.";
     }
     description
       "SR specific TLVs for OSPFv3 as scope Intra-Area-Prefix-LSA.";
     uses ppr-tlvs;
   }


   /* OSPFv3 external-lsa */
     augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:areas/ospf:area/"
         + "ospf:interfaces/ospf:interface/ospf:database/"
         + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
         + "ospf:link-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:as-external" {
     when "../../../../../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {
       description
         "This augmentation is only valid for OSPFv3.";
     }

     description
       "SR specific TLVs for OSPFv3 link scope AS-External-LSA.";
     uses ppr-tlvs;
   }




Qu, et al.               Expires January 8, 2020               [Page 55]


Internet-Draft                  ppr-yang                       July 2019


   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:areas/"
         + "ospf:area/ospf:database/"
         + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
         + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:as-external" {
     when "../../../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {
       description
         "This augmentation is only valid for OSPFv3.";
     }
     description
       "SR specific TLVs for OSPFv3 area scope AS-External-LSA.";
     uses ppr-tlvs;
   }

   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:database/"
         + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
         + "ospf:as-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:as-external" {
     when "../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {
       description
         "This augmentation is only valid for OSPFv3.";
     }
     description
       "SR specific TLVs for OSPFv3 as scope AS-External-LSA.";
     uses ppr-tlvs;
   }


   /* OSPFv3 Type-7 NSSA */
     augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:areas/ospf:area/"
         + "ospf:interfaces/ospf:interface/ospf:database/"
         + "ospf:link-scope-lsa-type/ospf:link-scope-lsas/"
         + "ospf:link-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:nssa" {
     when "../../../../../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {
       description
         "This augmentation is only valid for OSPFv3.";
     }




Qu, et al.               Expires January 8, 2020               [Page 56]


Internet-Draft                  ppr-yang                       July 2019


     description
       "SR specific TLVs for OSPFv3 link scope Type-7-LSA.";
     uses ppr-tlvs;
   }

   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:areas/"
         + "ospf:area/ospf:database/"
         + "ospf:area-scope-lsa-type/ospf:area-scope-lsas/"
         + "ospf:area-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:nssa" {
     when "../../../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {
       description
         "This augmentation is only valid for OSPFv3.";
     }
     description
       "SR specific TLVs for OSPFv3 area scope Type-7-LSA.";
     uses ppr-tlvs;
   }

   augment "/rt:routing/"
         + "rt:control-plane-protocols/rt:control-plane-protocol/"
         + "ospf:ospf/ospf:database/"
         + "ospf:as-scope-lsa-type/ospf:as-scope-lsas/"
         + "ospf:as-scope-lsa/ospf:version/ospf:ospfv3/"
         + "ospf:ospfv3/ospf:body/ospf:nssa" {
     when "../../../../../../../../"
        + "rt:type = 'ospf:ospfv3'" {
       description
         "This augmentation is only valid for OSPFv3.";
     }
     description
       "SR specific TLVs for OSPFv3 as scope Type-7-LSA.";
     uses ppr-tlvs;
   }
 }
 <CODE ENDS>

5.  Security Considerations

   The YANG modules specified in this document define a schema for data
   that is designed to be accessed via network management protocols such
   as NETCONF [RFC6241] or RESTCONF [RFC8040].  The lowest NETCONF layer
   is the secure transport layer, and the mandatory-to-implement secure
   transport is Secure Shell (SSH) [RFC6242].  The lowest RESTCONF layer




Qu, et al.               Expires January 8, 2020               [Page 57]


Internet-Draft                  ppr-yang                       July 2019


   is HTTPS, and the mandatory-to-implement secure transport is TLS
   [RFC5246].

   The NETCONF access control model [RFC6536] 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.

6.  Acknowledgements

   TBD.

7.  IANA Considerations

   TBD.

8.  References

8.1.  Normative References

   [I-D.chunduri-lsr-isis-preferred-path-routing]
              Chunduri, U., Li, R., White, R., Tantsura, J., Contreras,
              L., and Y. Qu, "Preferred Path Routing (PPR) in IS-IS",
              draft-chunduri-lsr-isis-preferred-path-routing-03 (work in
              progress), May 2019.

   [I-D.chunduri-lsr-ospf-preferred-path-routing]
              Chunduri, U., Qu, Y., White, R., Tantsura, J., and L.
              Contreras, "Preferred Path Routing (PPR) in OSPF", draft-
              chunduri-lsr-ospf-preferred-path-routing-03 (work in
              progress), May 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-23 (work in progress), July 2019.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC5246]  Dierks, T., "The Transport Layer Security (TLS) Protocol
              Version 1.2", RFC 5246, August 2008.




Qu, et al.               Expires January 8, 2020               [Page 58]


Internet-Draft                  ppr-yang                       July 2019


   [RFC6020]  Bjorklund, M., "YANG - A Data Modeling Language for the
              Network Configuration Protocol (NETCONF)", RFC 6020,
              October 2010.

   [RFC6241]  Enns, R., "Network Configuration Protocol (NETCONF)",
              RFC 6241, June 2011.

   [RFC6242]  Wasserman, M., "Using the NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, June 2011.

   [RFC6536]  Bierman, A., "Network Configuration Protocol (NETCONF)
              Access Control Model", RFC 6536, March 2012.

   [RFC7950]  Bjorklund, M., "The YANG 1.1 Data Modeling Language",
              RFC 7950, August 2016.

   [RFC8040]  Bierman, A., "RESTCONF Protocol", RFC 8040, January 2017.

8.2.  Informative References

   [I-D.ietf-netmod-yang-tree-diagrams]
              Bjorklund, M. and L. Berger, "YANG Tree Diagrams", draft-
              ietf-netmod-yang-tree-diagrams-06 (work in progress),
              February 2018.

Authors' Addresses

   Yingzhen Qu
   Futurewei
   2330 Central Expressway
   Santa Clara, CA  95050
   USA

   Email: yingzhen.qu@futurewei.com


   Uma Chunduri
   Futurewei
   2330 Central Expressway
   Santa Clara, CA  95050
   USA

   Email: uma.chunduri@futurewei.com








Qu, et al.               Expires January 8, 2020               [Page 59]


Internet-Draft                  ppr-yang                       July 2019


   Jeff Tantsura
   Apstra

   Email: jefftant.ietf@gmail.com















































Qu, et al.               Expires January 8, 2020               [Page 60]