module ietf-ospf-ppr {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-ospf-ppr";
prefix ospf-ppr;
import ietf-inet-types {
prefix inet;
}
import ietf-yang-types {
prefix "yang";
}
import ietf-routing-types {
prefix "rt-types";
reference "RFC 8291 - Common YANG Data Types for the
Routing Area";
}
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-segment-routing-common {
prefix sr-cmn;
}
import ietf-ospf {
prefix "ospf";
}
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) 2017 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 2018-06-20 {
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.";
}
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 flags {
type bits {
bit L {
position 0;
description
"If set, the PPR path is a Loose-PPR.";
}
bit A {
position 1;
description
"If set, all non-PPR path nodes in the OSPF area/domain
MUST add a FIB entry for the PPR-ID with NH set to the
shortest path NH for the prefix being advertised.";
}
}
description "Flags.";
}
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 srv6 {
value 3;
description
"PPR ID in SRv6 SID format.";
}
enum ipv6 {
value 4;
description
"PPR ID in ipv6 address 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;
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
"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";
}
}
description "Flags.";
}
leaf 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 {
value 4;
description
"PDE ID in IPv4 address format.";
}
enum ipv6 {
value 5;
description
"PDE ID in IPv6 address format.";
}
enum srv6-node-sid {
value 6;
description
"PDE ID in SRv6 node SID format.";
}
enum srv6-adj-sid {
value 7;
description
"PDE ID in SRv6 node SID format.";
}
}
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 {
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;
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.";
}
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.";
leaf enable {
type boolean;
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.";
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'" {
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/"
+ "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;
}
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.";
}
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;
}
}