module ietf-isis-ppr {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-isis-ppr";
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:
WG List:
Author: Yingzhen Qu
Uma Chunduri
";
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
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.";
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.";
}
}
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;
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.";
}
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;
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.";
}
}
}
}
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 {
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
"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;
}
}