module ietf-segment-routing-common {
yang-version 1.1;
namespace
"urn:ietf:params:xml:ns:yang:ietf-segment-routing-common";
prefix sr-cmn;
import ietf-inet-types {
prefix inet;
}
organization
"IETF SPRING - SPRING Working Group";
contact
"WG Web:
WG List:
Editor: Stephane Litkowski
Editor: Yingzhen Qu
Author: Acee Lindem
Author: Pushpasis Sarkar
Author: Jeff Tantsura
";
description
"The YANG module defines a collection of generic types and
grouping for Segment Routing (SR) as described in RFC 8402.
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-02-28 {
description
"Initial version";
reference "RFC XXXX: YANG Data Model for Segment Routing.";
}
feature sid-last-hop-behavior {
description
"Configurable last hop behavior.";
}
identity segment-routing-transport {
description
"Base identity for segment routing transport.";
}
identity segment-routing-transport-mpls {
base segment-routing-transport;
description
"This identity represents MPLS transport for segment
routing.";
}
identity segment-routing-transport-ipv6 {
base segment-routing-transport;
description
"This identity represents IPv6 transport for segment
routing.";
}
identity prefix-sid-algorithm {
description
"Base identity for prefix-sid algorithm.";
}
identity prefix-sid-algorithm-shortest-path {
base prefix-sid-algorithm;
description
"Shortest Path First (SPF) prefix-sid algorithm. This
is the default algorthm.";
}
identity prefix-sid-algorithm-strict-spf {
base prefix-sid-algorithm;
description
"This algorithm mandates that the packet is forwarded
according to ECMP-aware SPF algorithm.";
}
grouping srlr {
description
"Grouping for SR Label Range configuration.";
leaf lower-bound {
type uint32;
description
"Lower value in the label range.";
}
leaf upper-bound {
type uint32;
description
"Upper value in the label range.";
}
}
grouping srgb {
description
"Grouping for SR Global Label range.";
list srgb {
key "lower-bound upper-bound";
ordered-by user;
description
"List of global blocks to be advertised.";
uses srlr;
}
}
grouping srlb {
description
"Grouping for SR Local Block range.";
list srlb {
key "lower-bound upper-bound";
ordered-by user;
description
"List of SRLBs.";
uses srlr;
}
}
grouping sid-value-type {
description
"Defines how the SID value is expressed.";
leaf value-type {
type enumeration {
enum "index" {
description
"The value will be interpreted as an index.";
}
enum "absolute" {
description
"The value will become interpreted as an absolute
value.";
}
}
default "index";
description
"This leaf defines how value must be interpreted.";
}
}
grouping prefix-sid {
description
"This grouping defines cfg of prefix SID.";
leaf prefix {
type inet:ip-prefix;
description
"connected prefix sid.";
}
uses prefix-sid-attributes;
}
grouping ipv4-sid {
description
"Grouping for an IPv4 prefix SID.";
leaf prefix {
type inet:ipv4-prefix;
description
"Connected IPv4 prefix sid.";
}
uses prefix-sid-attributes;
}
grouping ipv6-sid {
description
"Grouping for an IPv6 prefix SID.";
leaf prefix {
type inet:ipv6-prefix;
description
"Connected ipv6 prefix sid.";
}
uses prefix-sid-attributes;
}
grouping last-hop-behavior {
description
"Defines last hop behavior";
leaf last-hop-behavior {
if-feature "sid-last-hop-behavior";
type enumeration {
enum "explicit-null" {
description
"Use explicit-null for the SID.";
}
enum "no-php" {
description
"Do not use Penultimate Hop Popping (PHP)
for the SID.";
}
enum "php" {
description
"Use PHP for the SID.";
}
}
description
"Configure last hop behavior.";
}
}
grouping node-capabilities {
description
"Containing SR node capabilities.";
container node-capabilities {
config false;
description
"Shows the SR capability of the node.";
list transport-planes {
key "transport-plane";
description
"List of supported transport planes.";
leaf transport-plane {
type identityref {
base segment-routing-transport;
}
description
"Transport plane supported";
}
}
leaf entropy-readable-label-depth {
type uint8;
description
"Maximum label stack depth that a router can read.";
}
}
}
grouping prefix-sid-attributes {
description
"Grouping for Segment Routing (SR) prefix attributes.";
uses sid-value-type;
leaf start-sid {
type uint32;
mandatory true;
description
"Value associated with prefix. The value must be
interpreted in the context of value-type.";
}
leaf range {
type uint32;
description
"Indicates how many SIDs can be allocated.";
}
leaf algorithm {
type identityref {
base prefix-sid-algorithm;
}
description
"Prefix-sid algorithm.";
}
}
}