<CODE BEGINS> file "ietf-mup@2023-03-09.yang"
module ietf-mup {
yang-version "1.1";
namespace "urn:ietf:params:xml:ns:yang:ietf-mup";
prefix "ietf-mup";
import ietf-yang-types {
prefix yang;
reference
"RFC 6991: Common YANG Data Types.";
}
import ietf-inet-types {
prefix inet;
reference
"RFC 6991: Common YANG Data Types.";
}
import ietf-interfaces {
prefix if;
reference
"RFC 8343: YANG Data Model for Interface Management.";
}
import ietf-routing {
prefix rt;
reference
"RFC 8349, A YANG Data Model for Routing Management
(NMDA Version).";
}
import ietf-routing-types {
prefix rt-types;
reference
"RFC 8294: Common YANG Data Types for the Routing Area.";
}
import ietf-routing-policy {
prefix rt-pol;
reference
"RFC 9067: A YANG Data Model for Routing Policy.";
}
import ietf-network-instance {
prefix ni;
reference
"RFC 8529: YANG Data Model for Network Instance.";
}
import ietf-bgp {
prefix bgp;
reference
"I-D.ietf-idr-bgp-model: BGP Model for Service Provider
Network.";
}
import iana-bgp-types {
prefix bt;
reference
"I-D.ietf-idr-bgp-model: BGP Model for Service Provider
Network.";
}
import ietf-segment-routing {
prefix sr;
reference
"RFC 9020: YANG Data Model for Segment Routing.";
}
import ietf-srv6-base {
prefix srv6;
reference
"I-D.ietf-spring-srv6-yang: YANG Data Model for SRv6 Base
and Static.";
}
organization
"IETF BESS Working Group";
contact
"WG Web: <https://datatracker.ietf.org/wg/bess/about>
WG List: <bess@ietf.org>
Editor: Mahesh Jethanandani (mjethanandani at gmail dot com)
Author: Tetsuya Murakami (tetsuya at arrcus dot com)";
description
"This module augments the BGP YANG model to add support for
configuration in mobile networks.
Copyright (c) 2022 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
(https://www.rfc-editor.org/info/rfcXXXX); 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 "2023-03-09" {
description
"Initial Version.";
reference
"RFC XXXX, A YANG Model for BGP configuration in mobile
networks.";
}
/*
* Identities
*/
identity sid-allocation-mode {
description
"Base identity to be used to express types of SRv6 segment ID
allocation strategies.";
}
identity sid-per-nexthop {
base sid-allocation-mode;
description
"A segment ID is allocated per nexthop entry in the RIB.";
}
identity instance-sid {
base sid-allocation-mode;
description
"A single segment ID is used.";
}
/*
* Typedefs
*/
typedef mup-ext-community-type {
type string {
// (ASN):(local-part)
pattern '(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]' +
'{2}|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8]' +
'[0-9]{5}|429[0-3][0-9]{6}|4[0-1][0-9]{7}|[1-3][0-9]' +
'{9}|[1-9][0-9]{1,8}|[0-9])';
}
description
"A type definition utilised to define the extended community
in routes of Mobile User Plane (MUP) SAFI. The above pattern
is a placeholder regex, till such time that a format for it has
been defined.";
}
/*
* Identities
*/
identity ipv4-mup {
base bt:afi-safi-type;
description
"AFI/SAFI for Mobile User Plane (AFI,SAFI = 1, 85)";
reference
"RFC XXXX: A YANG Model for BGP configuration of Mobile
User Plane (MUP).";
}
identity ipv6-mup {
base bt:afi-safi-type;
description
"AFI/SAFI for Mobile User Plane (AFI,SAFI = 2, 85)";
reference
"RFC XXXX: A YANG Model for BGP configuration of Mobile
User Plane (MUP).";
}
identity architecture-type {
description
"Base identity for Architecture Type.";
reference
"I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
User Plane (MUP) SAFI.";
}
identity three-gpp-5g {
base architecture-type;
description
"The Architecture Type for BGP-MUP NLRI.";
reference
"I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
User Plane (MUP) SAFI.";
}
identity route-type {
description
"Base identity for Route Type.";
reference
"I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
User Plane (MUP) SAFI.";
}
identity segment-type {
description
"Base identity for Segment Type.";
reference
"I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
User Plane (MUP) SAFI.";
}
identity isd {
base route-type;
base segment-type;
description
"The Interwork Segment Discovery Route Type.";
reference
"I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
User Plane (MUP) SAFI.";
}
identity dsd {
base route-type;
base segment-type;
description
"The Direct Segment Discovery Route Type.";
reference
"I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
User Plane (MUP) SAFI.";
}
identity type-1-st {
base route-type;
description
"Type 1 Session Transformed (ST) Route Type.";
reference
"I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
User Plane (MUP) SAFI.";
}
identity type-2-st {
base route-type;
description
"Type 2 Session Transformed (ST) Route Type.";
reference
"I-D.mpmz-bess-mup-safi: BGP Extensions for the Mobile
User Plane (MUP) SAFI.";
}
/*
* Groupings
*/
grouping rts {
description
"Grouping for configuration of route targets for AFI/SAFIs.";
container rts {
description
"Container for configuration of Route Targets for address
family list.";
list rt {
key "name";
description
"List of route targets for a given afi-safi type.";
leaf name {
type identityref {
base bt:afi-safi-type;
}
must "derived-from-or-self(., 'ipv4-mup') or " +
"derived-from-or-self(., 'ipv6-mup')" {
error-message
"Only ipv4-mup or ipv6-mup are supported.";
}
description
"Name of the AFI/SAFI type.";
}
container route-targets {
description
"Route Targets for a network instance.";
list route-target {
key "target type";
description
"List of route targets.";
leaf target {
type rt-types:route-target;
description
"A Route Target is an 8-octet BGP extended community
initially identifying a set of sites in a BGP VPN
(RFC 4364). However, it has since taken on a more
general role in BGP route filtering. A Route Target
consists of two or three fields: a 2-octet Type
field, an administrator field, and, optionally, an
assigned number field.
According to the data formats for types 0, 1, 2, and
6 as defined in RFC 4360, RFC 5668, and RFC 7432,
the encoding pattern is defined as:
0:2-octet-asn:4-octet-number
1:4-octet-ipv4addr:2-octet-number
2:4-octet-asn:2-octet-number
6:6-octet-mac-address
Additionally, a generic pattern is defined for future
Route Target types:
2-octet-other-hex-number:6-octet-hex-number
Some valid examples are 0:100:100, 1:1.1.1.1:100,
2:1234567890:203, and 6:26:00:08:92:78:00.";
}
leaf type {
type rt-types:route-target-type;
description
"Reference to route-target type.";
}
}
}
leaf route-policy {
type leafref {
path "/rt-pol:routing-policy/rt-pol:policy-definitions/" +
"rt-pol:policy-definition/rt-pol:name";
require-instance true;
}
description
"Reference to the route policy containing set of
route-targets.";
}
}
}
}
grouping bgp-mup {
description
"BGP-MUP NLRI configuration.";
uses rts;
container routing-table-limit {
description
"The routing-table limit command sets a limit on the maximum
number of routes imported that the IPv4 or IPv6 address
family of a MUP instance can support.
By default, there is no limit on the maximum number of
routes that the IPv4 or IPv6 address family of a MUP
instance can support, but the total number of private
network and public network routes on a device cannot
exceed the allowed maximum number of unicast routes.";
list routes {
key "type";
description
"List of routes that need to be limited by type.";
leaf type {
type identityref {
base route-type;
}
description
"The type of route on which a limit is being placed.";
}
leaf number {
type uint32 {
range "1..max";
}
description
"Specifies the maximum number of routes supported by a
MUP instance. ";
}
choice action {
description
"Choice of actions to take.";
leaf percent {
type rt-types:percentage;
description
"Specifies the percentage of the maximum number of
routes. When the maximum number of routes that join
the MUP instance is up to the value
(number*percent)/100, the system prompts alarms.
The MUP routes can be still added to the routing
table, but after the number of routes reaches number,
the subsequent routes are dropped.";
}
leaf simple {
type boolean;
description
"Indicates that when MUP routes exceed number, routes
can still be added into the routing table, but the
system prompts alarms.
However, after the total number of VPN routes and
network public routes reaches the unicast route limit
specified in the License, the subsequent routes
are dropped.";
}
}
}
}
list segment {
key "type";
description
"List of segments.";
leaf type {
type identityref {
base segment-type;
}
description
"Type of segment.";
}
leaf locator {
type leafref {
path "/rt:routing/sr:segment-routing/srv6:srv6" +
"/srv6:locators/srv6:locator/srv6:name";
}
must "derived-from-or-self(../type, 'isd')";
description
"Reference to locator in the 'default' VRF
configuration.";
}
leaf-list entry {
type union {
type inet:ip-prefix;
type if:interface-ref;
type enumeration {
enum router-ip {
description
"Entry is of type router-ip.";
}
}
}
description
"MUP entries.";
}
leaf-list mup-ext-comm {
type mup-ext-community-type;
must "derived-from-or-self(../type, 'dsd')";
description
"MUP extended community type.";
}
}
leaf architecture-type {
type identityref {
base architecture-type;
}
description
"Encoding of the rest of BGP-MUP NLRI for a given
MUP architecture.";
}
}
/*
* BGP configuration
*/
augment "/rt:routing/rt:control-plane-protocols" +
"/rt:control-plane-protocol/bgp:bgp/bgp:global" +
"/bgp:afi-safis/bgp:afi-safi" {
description
"Augmentation of the BGP model to add BGP-MUP.";
container ipv4-mup {
when "derived-from-or-self (../../bgp:afi-safi/bgp:name,
'ipv4-mup')" {
description
"This configuration applies only if the identity is
IPv4 MUP.";
}
uses bgp-mup;
description
"IPv4 MUP configuration and management.";
}
container ipv6-mup {
when "derived-from-or-self (../../bgp:afi-safi/bgp:name,
'ipv6-mup')" {
description
"This configuration applies only if the identity is
IPv6 MUP.";
}
uses bgp-mup;
description
"IPv6 MUP configuration and management.";
}
}
augment "/rt:routing/rt:control-plane-protocols" +
"/rt:control-plane-protocol/bgp:bgp/bgp:global" +
"/bgp:afi-safis/bgp:afi-safi/bgp:ipv4-unicast" {
description
"Augmentation of the BGP model to add RT for ipv4-unicast.";
uses rts;
}
augment "/rt:routing/rt:control-plane-protocols" +
"/rt:control-plane-protocol/bgp:bgp/bgp:global" +
"/bgp:afi-safis/bgp:afi-safi/bgp:ipv6-unicast" {
description
"Augmentation of the BGP model to add RT for ipv6-unicast.";
uses rts;
}
augment "/rt:routing/rt:control-plane-protocols" +
"/rt:control-plane-protocol/bgp:bgp/bgp:global" +
"/bgp:afi-safis/bgp:afi-safi/bgp:l3vpn-ipv4-unicast" {
description
"Augmentation of the BGP model to add RT for
l3vpn-ipv4-unicast.";
uses rts;
}
augment "/rt:routing/rt:control-plane-protocols" +
"/rt:control-plane-protocol/bgp:bgp/bgp:global" +
"/bgp:afi-safis/bgp:afi-safi/bgp:l3vpn-ipv6-unicast" {
description
"Augmentation of the BGP model to add RT for
l3vpn-ipv6-unicast.";
uses rts;
}
augment "/rt:routing/rt:control-plane-protocols" +
"/rt:control-plane-protocol/bgp:bgp/bgp:neighbors" +
"/bgp:neighbor/bgp:afi-safis/bgp:afi-safi" {
description
"Augmentation of the BGP model to add BGP-MUP.";
container ipv4-mup {
when "derived-from-or-self(../../bgp:afi-safi/bgp:name,
'ipv4-mup')" {
description
"This configuration applies only if the identity is
IPv4 MUP.";
}
presence "Presence container for IPv4 MUP.";
description
"IPv4 MUP configuration and management on a per neighbor
basis.";
}
container ipv6-mup {
when "derived-from-or-self(../../bgp:afi-safi/bgp:name,
'ipv6-mup')" {
description
"This configuration applies only if the identity is
IPv6 MUP.";
}
presence "Presence container for IPv6 MUP.";
description
"IPv6 MUP configuration and management on a per neighbor
basis.";
}
}
augment "/rt:routing/rt:control-plane-protocols" +
"/rt:control-plane-protocol/bgp:bgp/bgp:neighbors" +
"/bgp:neighbor/bgp:statistics" {
description
"Augmentation of the BGP per-neighbor statistics to add
BGP-MUP specific counters.";
leaf isd-sent {
type yang:zero-based-counter32;
description
"Total number of BGP Interwork Segment Discovery routes sent
per neighbor.";
}
leaf isd-received {
type yang:zero-based-counter32;
description
"Total number of BGP Interwork Segment Discovery routes
received per neighbor.";
}
leaf dsd-sent {
type yang:zero-based-counter32;
description
"Total number of BGP Direct Segment Discovery routes sent
per neighbor.";
}
leaf dsd-received {
type yang:zero-based-counter32;
description
"Total number of BGP Direct Segment Discovery routes
received per neighbor.";
}
leaf type-1-st-sent {
type yang:zero-based-counter32;
description
"Total number of BGP Type 1 Session Transformed routes sent
per neighbor.";
}
leaf type-1-st-received {
type yang:zero-based-counter32;
description
"Total number of BGP Type 1 Session Transformed routes
received per neighbor.";
}
leaf type-2-st-sent {
type yang:zero-based-counter32;
description
"Total number of BGP Type 2 Session Transformed routes sent
per neighbor.";
}
leaf type-2-st-received {
type yang:zero-based-counter32;
description
"Total number of BGP Type 2 Session Transformed routes
received per neighbor.";
}
}
augment "/rt:routing/rt:control-plane-protocols" +
"/rt:control-plane-protocol/bgp:bgp/bgp:global" {
description
"Augmentation of the BGP model to add SRv6 mobile
configuration.";
container srv6 {
description
"Container to define SRv6 MUP configuration.";
leaf locator {
type leafref {
path "/rt:routing/sr:segment-routing/srv6:srv6" +
"/srv6:locators/srv6:locator/srv6:name";
}
description
"Reference to the locator configured.";
}
leaf sid-manager-connected {
type boolean;
config false;
description
"Is the connection with segment ID manager active?";
}
leaf locator-registered {
type boolean;
config false;
description
"Is the locator name registered?";
}
leaf micro-segment-enabled {
type boolean;
config false;
description
"Is the locator enabled for micro-segment behavior?";
}
leaf sid-allocation-mode {
type identityref {
base sid-allocation-mode;
}
must "boolean((../mobile/encapsulation/locator) or " +
"(../mobile/decapsulations/decapsulation/locator) or " +
"(../locator))" {
error-message
"SRv6 locator name must be configured";
}
description
"The segment ID allocation mode to be used for L3 entries
in the network instance";
}
container mobile {
description
"MUP configuration.";
container encapsulation {
description
"Encapsulation configuration for mobile data.";
leaf locator {
type leafref {
path "../../../locator";
}
description
"Encapsulation specific locator.";
}
}
container decapsulations {
description
"Container for all SRv6 mobile decapsulation
configurations";
list decapsulation {
key "id";
description
"SRv6 mobile decapsulation config";
leaf id {
type uint16 {
range "1..100";
}
description
"SRv6 mobile decapsulation entry id";
}
leaf locator {
type leafref {
path "../../../../locator";
}
description
"Encapsulation specific locator.";
}
container mup-ext-communities {
description
"MUP extended communities configuration.";
leaf-list mup-ext-community {
type mup-ext-community-type;
description
"List of MUP extended communities.";
}
}
}
}
}
}
}
/*
* Network Instance configuration.
*/
augment "/ni:network-instances/ni:network-instance/ni:ni-type" {
description
"Augment network instance for per VRF MUP parameters";
case mup {
container mup {
description
"Configuration of MUP specific parameters";
container rd {
description
"Route distinguisher parameters.";
leaf rd {
type union {
type rt-types:route-distinguisher;
type enumeration {
enum auto {
description
"Route distinguisher is assigned automatically.";
}
}
}
description
"Route distinguisher value.";
reference
"RFC 4364: BGP/MPLS IP Virtual Private Networks
(VPNs).";
}
leaf auto-rd {
type rt-types:route-distinguisher;
config false;
description
"Automatically assigned RD value when rd is configured
as 'auto'.";
}
}
}
}
}
}
<CODE ENDS>