| Internet-Draft | YANG Data Model for SR Policy Group | November 2026 |
| Gong, et al. | Expires 19 May 2027 | [Page] |
This document defines a YANG data model for Segment Routing (SR) Policy Group that can be used for configuring, instantiating, and managing SR Policy groups. The model is generic and applies equally to the MPLS and SRv6 instantiations of SR Policy groups.¶
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 19 May 2027.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
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 Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The Network Configuration Protocol (NETCONF) [RFC6241] defines mechanisms to manage network devices. YANG [RFC7950] is a modular language that represents data structures in an XML tree format, and is used as a data modeling language for the NETCONF.¶
[I-D.ietf-spring-sr-policy-group] describes SR Policy Groups in MPLS and IPv6 environments. It illustrates some use cases for parent SR Policies and SR Policy Groups to provide best practice cases for operators.¶
[I-D.ietf-spring-sr-policy-yang] defines a YANG data model for SR Policy that can be used for configuring, instantiating, and managing SR policies.¶
This document defines a YANG data model for SR Policy Groups that can be used for configuring, instantiating, and managing SR Policy groups. The model is generic and applies equally to the MPLS and SRv6 instantiations of SR Policy groups.¶
The terminology for describing YANG data models is found in [RFC7950], including:¶
The definitions of the basic terms are identical to those found in Segment Routing Architecture [RFC8402], Segment Routing Policy Architecture [RFC9256], and Segment Routing Policy Group [I-D.ietf-spring-sr-policy-group].¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
Tree diagrams used in this document follow the notation defined in [RFC8340].¶
In this document, names of data nodes, actions, and other data model objects are often used without a prefix, as long as it is clear from the context in which YANG module each name is defined. Otherwise, names are prefixed using the standard prefix associated with the corresponding YANG module, as shown in Table 1.¶
| Prefix | YANG module | Reference |
|---|---|---|
| rt | ietf-routing | [RFC8349] |
| sr-policy | ietf-sr-policy | [I-D.ietf-spring-sr-policy-yang] |
The SR Policy Group YANG data model is defined in this document.¶
The ietf-sr-policy-group.yang data model provides the methods for configuring and managing SR Policy groups. It includes:¶
The following diagram depicts the high-level YANG organization and hierarchy for an SR Policy Group specification:¶
Segment-routing
Traffic-engineering
+ attributes
| + ......
+ policies
| policy* [headend color endpoint]
| ......
+ sr-policy-groups
sr-policy-group* [group-color]
+ name
+ description
+ service-distinguish-method
+ forward-based-dscp
| + best-effort-dscp-list-v4
| + best-effort-dscp-list-v6
| + dscp-mismatch-drop
| + dscp-color-mapping-entries
| mapping-entry* [policy-color dataplane]
| dscp-list
| ......
+ forward-based-dot1q
| + best-effort-dot1q-list
| + dot1q-mismatch-drop
| + dot1q-color-mapping-entries
| mapping-entry* [policy-color]
| dot1q-list
| ......
+ forward-based-serviceclass
+ best-effort-classlist
+ class-mismatch-drop
+ class-color-mapping-entries
mapping-entry* [policy-color]
class-list
......
The SR Policy Group YANG data model augments "/rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering", i.e., the SR Policy model specified in [I-D.ietf-spring-sr-policy-yang], and specifies the configuration to manage the SR Policy groups.¶
The complete tree of the ietf-sr-policy-group.yang data model is represented as follows. See [RFC8340] for an explanation of the symbols used.¶
module: ietf-sr-policy-group
augment /rt:routing/sr-policy:segment-routing
/sr-policy:traffic-engineering:
+--rw sr-policy-groups
+--rw sr-policy-group* [group-color]
+--rw group-color uint32
+--rw name? string
+--rw description? string
+--rw service-distinguish-method? enumeration
+--rw forward-based-dscp
| +--rw best-effort-dscp-list-v4? string
| +--rw best-effort-dscp-list-v6? string
| +--rw dscp-mismatch-drop? boolean
| +--rw dscp-color-mapping-entries
| +--rw mapping-entry* [policy-color dataplane]
| +--rw policy-color uint32
| +--rw dataplane dataplane-type
| +--rw dscp-list? string
| +--rw is-as-default? boolean
+--rw forward-based-dot1q
| +--rw best-effort-dot1q-list? string
| +--rw dot1q-mismatch-drop? boolean
| +--rw dot1q-color-mapping-entries
| +--rw mapping-entry* [policy-color]
| +--rw policy-color uint32
| +--rw dot1q-list? string
| +--rw is-as-default? boolean
+--rw forward-based-serviceclass
+--rw best-effort-classlist? string
+--rw class-mismatch-drop? boolean
+--rw class-color-mapping-entries
+--rw mapping-entry* [policy-color]
+--rw policy-color uint32
+--rw class-list? string
+--rw is-as-default? boolean
This module augments the "ietf-sr-policy" YANG data model defined in [I-D.ietf-spring-sr-policy-yang] and imports the "ietf-routing" module defined in [RFC8349].¶
<CODE BEGINS> file "ietf-sr-policy-group@2026-11-16.yang"
module ietf-sr-policy-group {
yang-version "1.1";
namespace "urn:ietf:params:xml:ns:yang:ietf-sr-policy-group";
prefix "sr-policy-group";
import ietf-routing {
prefix rt;
reference
"RFC 8349: A YANG Data Model for Routing Management
(NMDA Version)";
}
import ietf-sr-policy {
prefix sr-policy;
reference
"RFC XXXX: YANG Data Model for Segment Routing Policy";
}
organization
"IETF SPRING Working Group";
contact
"WG Web: <https://datatracker.ietf.org/wg/spring/>
WG List: SPRING <mailto:spring@ietf.org>
Author: Liyan Gong
<mailto:gongliyan@chinamobile.com>
Author: Changwang Lin
<mailto:linchangwang.04414@h3c.com>
Author: Ran Chen
<mailto:chen.ran@zte.com.cn>
Author: Haiyang Zhang
<mailto:zhang.haiyangA@h3c.com>";
description
"This module describes a YANG model for configuring and managing
SR Policy Groups.
This YANG model conforms to the Network Management
Datastore Architecture (NMDA) as described in RFC 8342.
Copyright (c) 2026 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 Revised BSD License set
forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX;
see the RFC itself for full legal notices.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
'MAY', and 'OPTIONAL' in this document are to be interpreted as
described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
they appear in all capitals, as shown here.";
revision 2026-11-16 {
description
"Initial revision.";
reference
"RFC XXXX: YANG Data Model for SR Policy Group";
}
typedef dataplane-type {
type enumeration {
enum mpls {
value 1;
description "Segment-routing MPLS";
}
enum srv6 {
value 2;
description "Segment-routing v6";
}
}
description "Dataplane type of segment routing";
}
augment "/rt:routing/sr-policy:segment-routing"
+ "/sr-policy:traffic-engineering" {
description
"SR Policy Group augmentation to the segment routing traffic
engineering model.";
container sr-policy-groups {
description
"Configuration parameters of SR Policy Group.";
list sr-policy-group {
key "group-color";
description
"Each entry contains parameters for SR Policy Group
identified by the 'group-color' key.";
leaf group-color {
type uint32 {
range "1..4294967295";
}
mandatory true;
description "Color associated with the policy group";
}
leaf name {
type string {
length "1..59";
}
description "SR Policy Group name";
}
leaf description {
type string;
description "Description of the policy group";
}
leaf service-distinguish-method {
type enumeration {
enum DSCP-based {
value 1;
description "Distinguish service type based on DSCP
in the message";
}
enum dot1q-based {
value 2;
description "Distinguish service type based on dot1q";
}
enum ServiceClass-based {
value 3;
description "Distinguish service type based on service
class";
}
enum None {
value 4;
description "Not configure service type recognition
method";
}
}
description "Service traffic steering methods within SR
Policy Group";
}
container forward-based-dscp {
description "parameters of DSCP based steering traffic
for SR Policy Group";
leaf best-effort-dscp-list-v4 {
type string;
description "DSCP values for IPv4 packets matching
best-effort. It is a comma-separated list of DSCP
values. Each item can be an individual DSCP value
or a DSCP value range. Use a tilde (~) to separate
the start and end DSCP values of a range.
Example: 1,2,3,5~8.";
}
leaf best-effort-dscp-list-v6 {
type string;
description "DSCP values for IPv6 packets matching
best-effort. It is a comma-separated list of DSCP
values. Each item can be an individual DSCP value
or a DSCP value range. Use a tilde (~) to separate
the start and end DSCP values of a range.
Example: 1,2,3,5~8.";
}
leaf dscp-mismatch-drop {
type boolean;
default "false";
description "When all DSCP values configured for
best effort forwarding and SR policy forwarding do
not match, and no default forwarding path is
specified, discard traffic.";
}
container dscp-color-mapping-entries {
description "DSCP-color mapping table";
list mapping-entry {
key "policy-color dataplane";
description "This table contains color-DSCP mappings
for an SR Policy Group.";
leaf policy-color {
type uint32 {
range "1..4294967295";
}
mandatory true;
description "Color associated with the policy
group";
}
leaf dataplane {
type dataplane-type;
mandatory true;
description "The data plane type of the mapping
relationship between DSCP and color";
}
leaf dscp-list {
type string;
description "DSCP values for packets matching.
It is a comma-separated list of DSCP values.
Each item can be an individual DSCP value or
a DSCP value range. Use a tilde (~) to separate
the start and end DSCP values of a range.
Example: 1,2,3,5~8.";
}
leaf is-as-default {
type boolean;
default false;
description "Whether to use the SR policy
with this color as the default policy for
packets";
}
}
}
}
container forward-based-dot1q {
description "parameters of dot1q based steering
traffic for SR Policy Group";
leaf best-effort-dot1q-list {
type string;
description "Dot1q values for packets matching
best-effort. It is a comma-separated list of
dot1q values. Each item can be an individual
dot1q value or a dot1q value range. Use a
tilde (~) to separate the start and end dot1q
values of a range. Example: 1,2,3,5~8.";
}
leaf dot1q-mismatch-drop {
type boolean;
default "false";
description "When all dot1q values configured
for best effort forwarding and SR policy
forwarding do not match, and no default
forwarding path is specified, discard traffic.";
}
container dot1q-color-mapping-entries {
description "Dot1q-color mapping table";
list mapping-entry {
key "policy-color";
description "This table contains color-dot1q
mappings for an SR Policy Group.";
leaf policy-color {
type uint32 {
range "1..4294967295";
}
mandatory true;
description "Color associated with the policy
group";
}
leaf dot1q-list {
type string;
description "Dot1q values for packets
matching. It is a comma-separated list of
dot1q values. Each item can be an individual
dot1q value or a dot1q value range. Use a tilde
(~) to separate the start and end dot1q values
of a range. Example: 1,2,3,5~8.";
}
leaf is-as-default {
type boolean;
default false;
description "Whether to use the SR policy
with this color as the default policy for
packets";
}
}
}
}
container forward-based-serviceclass {
description "parameters of service class based steering
traffic for SR Policy Group";
leaf best-effort-classlist {
type string;
description "Service class values for packets matching
best-effort. It is a comma-separated list of
service class values. Each item can be an
individual service class value or a service
class value range. Use a tilde (~) to separate
the start and end service class values of a
range. Example: 1,2,3,5~8.";
}
leaf class-mismatch-drop {
type boolean;
default "false";
description "When all service class values configured
for best effort forwarding and SR policy forwarding
do not match, and no default forwarding path is
specified, discard traffic.";
}
container class-color-mapping-entries {
description "Serviceclass-color mapping table";
list mapping-entry {
key "policy-color";
description "This table contains color-serviceclass
mappings for an SR Policy Group.";
leaf policy-color {
type uint32 {
range "1..4294967295";
}
mandatory true;
description "Color associated with the policy
group";
}
leaf class-list {
type string;
description "Service class values for packets
matching. It is a comma-separated list of
service class values. Each item can be an
individual service class value or a service
class value range. Use a tilde (~) to separate
the start and end service class values of
a range. Example: 1,2,3,5~8.";
}
leaf is-as-default {
type boolean;
default false;
description "Whether to use the SR policy
with this color as the default policy for
packets";
}
}
}
}
}
} // sr-policy-groups
} // augment
}
<CODE ENDS>¶
This section is modeled after the template described in Section 3.7.1 of [RFC9907].¶
The "ietf-sr-policy-group" YANG module defines a data model that is designed to be accessed via YANG-based management protocols, such as Network Configuration Protocol (NETCONF) [RFC6241] and RESTCONF [RFC8040]. These YANG-based management protocols (1) have to use a secure transport layer (e.g., Secure Shell (SSH) [RFC4252], TLS [RFC9846], and QUIC [RFC9000]) and (2) have to use mutual authentication.¶
The Network Configuration Access Control Model (NACM) [RFC8341] provides the means to restrict access for particular NETCONF or RESTCONF users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content.¶
There are a number of data nodes defined in this YANG module that are writable/creatable/deletable (i.e., config true, which is the default). All writable data nodes are likely to be sensitive or vulnerable in some network environments. Write operations (e.g., edit-config) and delete operations to these data nodes without proper protection or authentication can have a negative effect on network operations. The following subtrees and data nodes have particular sensitivities/vulnerabilities:¶
rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/ sr-policy-group:sr-policy-groups rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/ sr-policy-group:sr-policy-groups/sr-policy-group:sr-policy-group/ sr-policy-group:service-distinguish-method rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/ sr-policy-group:sr-policy-groups/sr-policy-group:sr-policy-group/ sr-policy-group:forward-based-dscp rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/ sr-policy-group:sr-policy-groups/sr-policy-group:sr-policy-group/ sr-policy-group:forward-based-dot1q rt:routing/sr-policy:segment-routing/sr-policy:traffic-engineering/ sr-policy-group:sr-policy-groups/sr-policy-group:sr-policy-group/ sr-policy-group:forward-based-serviceclass¶
An unauthorized modification of the SR Policy Group configuration, such as the mapping relationships between DSCP, dot1q, or service class values and SR Policy colors, could cause traffic to be steered onto unintended paths, disrupt services, or violate traffic segregation policies.¶
This YANG module does not define any read-only data nodes (i.e., config false), RPC operations, or actions.¶
This document requests IANA to register the following URI in the "ns" registry within the "IETF XML Registry" group [RFC3688]:¶
URI: urn:ietf:params:xml:ns:yang:ietf-sr-policy-group Registrant Contact: The IESG. XML: N/A, the requested URI is an XML namespace.¶
This document requests IANA to register the following YANG module in the "YANG Module Names" registry [RFC7950]:¶
Name: ietf-sr-policy-group Maintained by IANA? N Namespace: urn:ietf:params:xml:ns:yang:ietf-sr-policy-group Prefix: sr-policy-group Reference: RFC XXXX¶