module ietf-srv6-static {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-srv6-static";
prefix srv6-static;
import ietf-interfaces {
prefix "if";
reference "RFC 8343: A YANG Data Model for Interface Management";
}
import ietf-inet-types {
prefix inet;
reference "RFC 6991: Common YANG Data Types";
}
import ietf-routing {
prefix "rt";
reference
"RFC 8349: A YANG Data Model for Routing Management (NMDA
version)";
}
import ietf-segment-routing {
prefix sr;
reference "draft-ietf-spring-sr-yang";
}
import ietf-srv6-types {
prefix srv6-types;
reference "RFC XXXX: YANG Data Model for SRv6";
// RFC Editor: replace XXXX with actual RFC number and remove
// this note
}
import ietf-srv6-base {
prefix srv6;
reference "RFC XXXX: YANG Data Model for SRv6";
// RFC Editor: replace XXXX with actual RFC number and remove
// this note
}
organization
"IETF SPRING Working Group";
contact
"WG Web:
WG List:
Editor: Kamran Raza
Editor: Jaganbabu Rajamanickam
Editor: Xufeng Liu
Editor: Zhibo Hu
Editor: Iftekhar Hussain
Editor: Himanshu Shah
Editor: Daniel Voyer
Editor: Hani Elmalky
Editor: Satoru Matsushima
Editor: Katsuhiro Horiba
Editor: Ahmed AbdelSalam
";
description
"This YANG module defines the essential elements for the
management of Static application for Segment-Routing with
IPv6 dataplane (SRv6).
Copyright (c) 2018 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).";
reference "RFC XXXX";
// RFC Editor: replace XXXX with actual RFC number and remove
// this note
revision 2022-01-14 {
description
"Alignment with SRv6 network programming rev16";
reference
"RFC XXXX: YANG Data Model for SRv6";
// RFC Editor: replace XXXX with actual RFC number and remove
// this note
}
revision 2019-10-30 {
description
"Extended model for EVPN behaviors";
reference
"RFC XXXX: YANG Data Model for SRv6";
// RFC Editor: replace XXXX with actual RFC number and remove
// this note
}
revision 2019-07-08 {
description
"Alignment with SRv6 network programming";
reference
"RFC XXXX: YANG Data Model for SRv6";
// RFC Editor: replace XXXX with actual RFC number and remove
// this note
}
revision 2018-10-22 {
description
"Initial revision.";
reference
"RFC XXXX: YANG Data Model for SRv6";
// RFC Editor: replace XXXX with actual RFC number and remove
// this note
}
/*
* Config and State
*/
grouping path-attrs-v6 {
description
"IPv6 Path properties";
leaf interface {
type if:interface-ref;
description "The outgoing interface";
}
leaf next-hop {
type inet:ipv6-address;
description "The IP address of the next-hop";
}
leaf table {
type srv6-types:table-id;
description "The routing table associated with the next-hop";
}
uses srv6:path-attrs-cmn;
}
grouping path-attrs-v4 {
description
"IPv4 Path properties";
leaf interface {
type if:interface-ref;
description "The outgoing interface";
}
leaf next-hop {
type inet:ipv4-address;
description "The IP address of the next-hop";
}
leaf table {
type srv6-types:table-id;
description "The routing table associated with the next-hop";
}
uses srv6:path-attrs-cmn;
}
grouping path-attrs-mpls {
description
"MPLS Path properties";
leaf interface {
type if:interface-ref;
description "The outgoing interface";
}
leaf next-hop {
type inet:ip-address;
description "The IP address of the next-hop";
}
uses srv6:path-attrs-cmn;
}
grouping multi-paths-v6 {
description "Multipath grouping";
container paths {
description "List of outgoing paths";
list path {
key path-index;
description "The list of paths associated with the SID";
leaf path-index {
type uint8;
description "Index of the path";
}
uses path-attrs-v6;
container sid-list {
description "SID-list associated with the path";
uses srv6:path-out-sids;
}
}
}
}
grouping multi-paths-v4 {
description "Multipath grouping";
container paths {
description "List of outgoing paths";
list path {
key path-index;
description "The list of paths associated with the SID";
leaf path-index {
type uint8;
description "Index of the path";
}
uses path-attrs-v4;
container sid-list {
description "SID-list associated with the path";
uses srv6:path-out-sids;
}
}
}
}
grouping multi-paths-mpls {
description "Multipath grouping";
container paths {
description "List of outgoing paths";
list path {
key path-index;
description "The list of paths associated with the SID";
leaf path-index {
type uint8;
description "Index of the path";
}
uses path-attrs-mpls;
container sid-list {
description "SID-list associated with the path";
uses srv6:path-out-sids;
}
}
}
}
grouping multi-paths-v6-BUM {
description
"Multipath grouping for EVPN bridging BUM use case";
container paths {
description
"List of outgoing paths for flooding";
list path {
key path-index;
description "The list of paths associated with the SID";
leaf path-index {
type uint8;
description "Index of the path";
}
leaf l2-interface {
type if:interface-ref;
description "The outgoing L2 interface for flooding";
}
}
}
}
grouping srv6-sid-config {
description
"Configuration parameters relating to SRv6 sid.";
leaf function {
type srv6-types:srv6-func-value;
description
"SRv6 function value.";
}
leaf end-behavior-type {
type identityref {
base srv6-types:srv6-endpoint-type;
}
mandatory true;
description
"Type of SRv6 end behavior.";
}
container end {
when "../end-behavior-type = 'End'" {
description
"This container is valid only when the user chooses End
behavior (variant: no PSP, no USP).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: no PSP, no USP)";
}
container end_psp {
when "../end-behavior-type = 'End_PSP'" {
description
"This container is valid only when the user chooses End
behavior (variant: PSP only).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: PSP only)";
}
container end_usp {
when "../end-behavior-type = 'End_USP'" {
description
"This container is valid only when the user chooses End
behavior (variant: USP only).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: USP only)";
}
container end_psp_usp {
when "../end-behavior-type = 'End_PSP_USP'" {
description
"This container is valid only when the user chooses End
behavior (variant: PSP/USP).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: PSP/USP)";
}
container end_usd {
when "../end-behavior-type = 'End_USD'" {
description
"This container is valid only when the user chooses End
behavior (variant: USD only).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: USD)";
}
container end_psp_usd {
when "../end-behavior-type = 'End_PSP_USD'" {
description
"This container is valid only when the user chooses End
behavior (variant: PSP/USD).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: PSP/USD)";
}
container end_usp_usd {
when "../end-behavior-type = 'End_USP_USD'" {
description
"This container is valid only when the user chooses End
behavior (variant: USP/USD).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: USP/USD)";
}
container end_psp_usp_usd {
when "../end-behavior-type = 'End_PSP_USP_IUSD'" {
description
"This container is valid only when the user chooses End
behavior (variant: PSP/USP/USD).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: PSP/USP/USD)";
}
container end-t {
when "../end-behavior-type = 'End.T'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: no PSP, no USP).";
}
description
"Endpoint with specific IPv6 table lookup (variant: no PSP,
no USP).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-t_psp {
when "../end-behavior-type = 'End.T_PSP'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: PSP only).";
}
description
"Endpoint with specific IPv6 table lookup (variant: PSP only).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-t_usp {
when "../end-behavior-type = 'End.T_USP'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: USP only).";
}
description
"Endpoint with specific IPv6 table lookup (variant: USP only).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-t_psp_usp {
when "../end-behavior-type = 'End.T_PSP_USP'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: USP/PSP).";
}
description
"Endpoint with specific IPv6 table lookup (variant: USP/PSP).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-t_usd {
when "../end-behavior-type = 'End.T_USD'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: USD only).";
}
description
"Endpoint with specific IPv6 table lookup (variant: USD only).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-t_psp_usd {
when "../end-behavior-type = 'End.T_PSP_USD'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: PSP/USD only).";
}
description
"Endpoint with specific IPv6 table lookup (variant: PSP/USD
only).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-t_usp_usd {
when "../end-behavior-type = 'End.T_USP_USD'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: USP/USD only).";
}
description
"Endpoint with specific IPv6 table lookup (variant:
USP/USD only).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-t_psp_usp_usd {
when "../end-behavior-type = 'End.T_PSP_USP_USD'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: USP only).";
}
description
"Endpoint with specific IPv6 table lookup (variant:
PSP/USP/USD only).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-x {
when "../end-behavior-type = 'End.X'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: no USP/PSP)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: no USP/PSP).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-x_psp {
when "../end-behavior-type = 'End.X_PSP'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: PSP only)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: PSP only).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-x_usp {
when "../end-behavior-type = 'End.X_USP'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: USP only)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: USP only).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-x_psp_usp {
when "../end-behavior-type = 'End.X_PSP_USP'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: PSP/USP)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: PSP/USP).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-x_usd {
when "../end-behavior-type = 'End.X_USD'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: USD only)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: PSP/USP).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-x_psp_usd {
when "../end-behavior-type = 'End.X_PSP_USD'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: PSP/USD only)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: PSP/USP).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-x_usp_usd {
when "../end-behavior-type = 'End.X_USP_USD'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: USP/USD only)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: PSP/USP).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-x_psp_usp_usd {
when "../end-behavior-type = 'End.X_PSP_USP_USD'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: PSP/USP/USD only)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: PSP/USP).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-b6-encaps {
when "../end-behavior-type = 'End.B6.Encaps' or
../end-behavior-type = 'End.B6.Encaps.Red'" {
description
"This container is valid only when the user chooses
End.B6.Encaps or End.B6.Encaps.Red behavior.";
}
description
"Endpoint bound to an SRv6 Policy.
Insert SRH based on the policy and forward the
packet toward the first hop configured in the policy.
This is the SRv6 instantiation of a Binding SID.
This behavior also adds an outer IPv6 header";
// TODO presence "Mandatory child only if container is present";
leaf policy-name {
type string;
mandatory true;
description "SRv6 policy name.";
}
leaf source-address {
type inet:ipv6-address;
mandatory true;
description
"IPv6 source address for Encap.";
}
uses multi-paths-v6;
}
container end-bm {
when "../end-behavior-type = 'End.BM'" {
description
"This container is valid only when the user chooses
End.BM behavior.";
}
description
"Endpoint bound to an SR-MPLS Policy.
push an MPLS label stack on the
received packet and forward the according to
Lable L1.
This is an SRv6 instantiation of an SR-MPLS Binding SID.";
// TODO presence "Mandatory child only if container is present";
leaf policy-name {
type string;
mandatory true;
description "SRv6 policy name";
}
uses multi-paths-mpls;
}
container end-dx6 {
when "../end-behavior-type = 'End.DX6'" {
description
"This container is valid only when the user chooses
End.DX6 behavior.";
}
description
"Endpoint with decapsulation and cross-connect to
an array of IPv6 adjacencies. Pop the (outer)
IPv6 header and its extension headers and forward
to layer-3 adjacency bound to the SID S.
The End.DX6 used in the L3VPN use-case.";
uses multi-paths-v6;
// TODO: Backup path of type "Lookup in table"
}
container end-dx4 {
when "../end-behavior-type = 'End.DX4'" {
description
"This container is valid only when the user chooses
End.DX4 behavior.";
}
description
"Endpoint with decapsulation and cross-connect to
an array of IPv4 adjacencies.
Pop the (outer) IPv6 header and its extension
header and forward to layer-3 adjacency bound
to the SID S.
This would be equivalent to the per-CE VPN
label in MPLS.";
uses multi-paths-v4;
// TODO: Backup path of type "Lookup in table"
}
container end-dt6 {
when "../end-behavior-type = 'End.DT6'" {
description
"This container is valid only when the user chooses
End.DT6 behavior.";
}
description
"Endpoint with decapsulation and specific IPv6 table
lookup.
Pop the (outer) IPv6 header and its extension
headers.
Lookup the exposed inner IPv6 DA in IPv6
table T and forward via the matched table entry.
End.DT6 function is used in L3VPN use-case.";
// TODO presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description "IPv6 table";
}
}
container end-dt4 {
when "../end-behavior-type = 'End.DT4'" {
description
"This container is valid only when the user chooses
End.DT4 behavior.";
}
description
"Endpoint with decapsulation and specific
IPv4 table lookup.
Pop the (outer) IPv6 header and its extension
headers.
Lookup the exposed inner IPv4 DA in IPv4
table T and forward via the matched table entry.
This would be equivalent to the per-VRF VPN label
in MPLS.";
// TODO presence "Mandatory child only if container is present";
leaf lookup-table-ipv4 {
type srv6-types:table-id;
mandatory true;
description "IPv4 table";
}
}
container end-dt46 {
when "../end-behavior-type = 'End.DT46'" {
description
"This container is valid only when the user chooses
End.DT46 behavior.";
}
description
"Endpoint with decapsulation and specific
IP table lookup.
Depending on the protocol type (IPv4 or IPv6)
of the inner ip packet and the specific VRF name
forward the packet.
This would be equivalent to the per-VRF VPN
label in MPLS.";
// TODO presence "Mandatory child only if container is present";
leaf lookup-table-ipv4 {
type srv6-types:table-id;
mandatory true;
description "IPv4 table";
}
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description "IPv6 table";
}
}
/* EVPN END behavior types */
container end-dx2 {
when "../end-behavior-type = 'End.DX2'" {
description
"This container is valid only when the user chooses
End.DX2 behavior.";
}
description
"This is an Endpoint with decapsulation and Layer-2
cross-connect to OIF.
Pop the (outer) IPv6 header and its extension headers.
Forward the resulting frame via OIF associated to the SID.
The End.DX2 function is the L2VPN/EVPN VPWS use-case.";
container path {
description "Outgoing path";
leaf l2-interface {
type if:interface-ref;
mandatory true;
description "Outgoing L2 interface";
}
}
}
container end-dx2v {
when "../end-behavior-type = 'End.DX2V'" {
description
"This container is valid only when the user chooses
End.DX2V behavior.";
}
description
"Endpoint with decapsulation and specific VLAN
L2 table lookup.
Pop the (outer) IPv6 header and its extension headers.
Lookup the exposed inner VLANs in L2 table T.
Forward via the matched table entry.
The End.DX2V is used for EVPN Flexible cross-connect
use-cases";
leaf lookup-table-vlan {
type srv6-types:table-id;
mandatory true;
description
"VLAN lookup table. There could be multiple
vlan demux tables on the node, where a DX2V SID
points to one vlan table";
}
}
container end-dt2u {
when "../end-behavior-type = 'End.DT2U'" {
description
"This container is valid only when the user chooses
End.DT2U behavior.";
}
description
"Endpoint with decapsulation and specific
unicast L2 MAC table lookup.
Pop the (outer) IPv6 header and its extension headers.
Learn the exposed inner MAC SA in L2 MAC table T.
Lookup the exposed inner MAC DA in L2 MAC table T.
Forward via the matched T entry else to all L2OIF in T.
The End.DT2U is used for EVPN Bridging unicast use cases";
leaf lookup-table-mac {
type srv6-types:table-id;
mandatory true;
description "MAC L2 lookup table";
}
}
container end-dt2m {
when "../end-behavior-type = 'End.DT2M'" {
description
"This container is valid only when the user chooses
End.DT2M behavior.";
}
description
"Endpoint with decapsulation and specific flooding table.
Pop the (outer) IPv6 header and its extension headers.
Learn the exposed inner MAC SA in L2 MAC table T.
Forward on all L2OIF (in the flooding table) excluding the one
identfied by Arg.FE2.
The End.DT2M is used for EVPN Bridging BUM use case with
ESI (Split Horizon) filtering capability.";
leaf flooding-table {
type srv6-types:table-id;
mandatory true;
description "L2 Flooding table (list of OIFs)";
}
uses multi-paths-v6-BUM;
/* TODO - Support for argument Arg.FE2. It is an argument specific
to EVPN ESI filtering and EVPN-ETREE used to exclude specific
OIF (or set of OIFs) from flooding table. */
}
/* End of EVPN END behavior types */
}
grouping srv6-static-cfg {
description
"Grouping configuration and operation for SRv6 sid.";
list sid {
key "function";
description "List of locally instantiated SIDs";
uses srv6-sid-config;
}
}
augment "/rt:routing/sr:segment-routing/srv6:srv6/srv6:locators/srv6:locator" {
description
"This augments locator leaf within SRv6.";
container static {
description "Static SRv6";
/* Local SIDs */
container local-sids {
description
"SRv6-static locally instantiated SIDs";
uses srv6-static-cfg;
/* no state for now; SID state accessible through base model */
}
}
}
} // module