module ietf-mpls-ldp {
namespace "urn:ietf:params:xml:ns:yang:ietf-mpls-ldp";
prefix "ldp";
import ietf-inet-types {
prefix "inet";
}
import ietf-yang-types {
prefix "yang";
}
import ietf-routing {
prefix "rt";
}
import ietf-routing-types {
prefix "rt-types";
}
import ietf-interfaces {
prefix "if";
}
import ietf-ip {
prefix "ip";
}
organization
"IETF MPLS Working Group";
contact
"WG Web:
WG List:
Editor: Kamran Raza
Editor: Rajiv Asati
Editor: Xufeng Liu
Editor: Santosh Esale
Editor: Xia Chen
Editor: Himanshu Shah
";
description
"This YANG module defines the essential components for the
management of Multi-Protocol Label Switching (MPLS) Label
Distribution Protocol (LDP). It is also the base model to
be augmented for Multipoint LDP (mLDP).
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).
This version of this YANG module is part of RFC XXXX; see the
RFC itself for full legal notices.";
revision 2018-02-28 {
description
"Initial revision.";
reference
"RFC XXXX: YANG Data Model for MPLS LDP.";
}
/*
* Typedefs
*/
typedef ldp-address-family {
type identityref {
base rt:address-family;
}
description
"LDP address family type.";
}
typedef duration32-inf {
type union {
type uint32;
type enumeration {
enum "infinite" {
description "The duration is infinite.";
}
}
}
units seconds;
description
"Duration represented as 32 bit seconds with infinite.";
}
typedef advertised-received {
type enumeration {
enum advertised {
description "Advertised information.";
}
enum received {
description "Received information.";
}
}
description
"Received or advertised.";
}
typedef downstream-upstream {
type enumeration {
enum downstream {
description "Downstream information.";
}
enum upstream {
description "Upstream information.";
}
}
description
"Received or advertised.";
}
typedef label-adv-mode {
type enumeration {
enum downstream-unsolicited {
description "Downstream Unsolicited.";
}
enum downstream-on-demand {
description "Downstream on Demand.";
}
}
description
"Label Advertisement Mode.";
}
typedef oper-status-event-type {
type enumeration {
enum up {
value 1;
description
"Operational status changed to up.";
}
enum down {
value 2;
description
"Operational status changed to down.";
}
}
description "Operational status event type for notifications.";
}
/*
* Identities
*/
identity adjacency-flag-base {
description "Base type for adjacency flags.";
}
identity adjacency-flag-active {
base adjacency-flag-base;
description
"This adjacency is configured and actively created.";
}
identity adjacency-flag-passive {
base adjacency-flag-base;
description
"This adjacency is not configured and passively accepted.";
}
/*
* Groupings
*/
grouping adjacency-state-attributes {
description
"The operational state attributes of an LDP hello adjacency,
which can used for basic and extended discoveris, in IPv4 and
IPv6 address families.";
leaf-list flag {
type identityref {
base adjacency-flag-base;
}
description
"On or more flags to indicate whether the adjacency is
actively created, passively accepted, or both.";
}
container hello-holdtime {
description
"Containing hello holdtime state information.";
leaf adjacent {
type uint16;
units seconds;
description
"The holdtime value learned from the adjacent LSR.";
}
leaf negotiated {
type uint16;
units seconds;
description
"The holdtime negotiated between this LSR and the adjacent
LSR.";
}
leaf remaining {
type uint16;
units seconds;
description
"The time remaining until the holdtime timer expires.";
}
}
leaf next-hello {
type uint16;
units seconds;
description
"The time when the next Hello message will be sent.";
}
container statistics {
description
"Statistics objects.";
leaf discontinuity-time {
type yang:date-and-time;
mandatory true;
description
"The time on the most recent occasion at which any one or
more of this interface's counters suffered a
discontinuity. If no such discontinuities have occurred
since the last re-initialization of the local management
subsystem, then this node contains the time the local
management subsystem re-initialized itself.";
}
leaf hello-received {
type yang:counter64;
description
"The number of Hello messages received.";
}
leaf hello-dropped {
type yang:counter64;
description
"The number of Hello messages dropped.";
}
} // statistics
} // adjacency-state-attributes
grouping basic-discovery-timers {
description
"The timer attributes for basic discovery, used in the
per-interface setting and in the all-interface setting.";
leaf hello-holdtime {
type uint16 {
range 15..3600;
}
units seconds;
default 15;
description
"The time interval for which a LDP link Hello adjacency
is maintained in the absence of link Hello messages from
the LDP neighbor";
}
leaf hello-interval {
type uint16 {
range 5..1200;
}
units seconds;
default 5;
description
"The interval between consecutive LDP link Hello messages
used in basic LDP discovery";
}
} // basic-discovery-timers
grouping binding-address-state-attributes {
description
"Operational state attributes of an address binding, used in
IPv4 and IPv6 address families.";
leaf advertisement-type {
type advertised-received;
description
"Received or advertised.";
}
container peer {
when "../advertisement-type = 'received'" {
description
"Applicable for received address.";
}
description
"LDP peer from which this address is received.";
uses ldp-peer-ref;
}
} // binding-address-state-attributes
grouping binding-label-state-attributes {
description
"Operational state attributes for a FEC-label binding, used in
IPv4 and IPv6 address families.";
list peer {
key "lsr-id label-space-id advertisement-type";
description
"List of advertised and received peers.";
uses ldp-peer-ref {
description
"The LDP peer from which this binding is received, or to
which this binding is advertised.
The peer is identified by its LDP ID, which consists of
the LSR ID and the Label Space ID.";
}
leaf advertisement-type {
type advertised-received;
description
"Received or advertised.";
}
leaf label {
type rt-types:mpls-label;
description
"Advertised (outbound) or received (inbound)
label.";
}
leaf used-in-forwarding {
type boolean;
description
"'true' if the lable is used in forwarding.";
}
} // peer
} // binding-label-state-attributes
grouping graceful-restart-attributes-per-peer {
description
"Per peer graceful restart attributes.
On the local side, these attributes are configuration and
operational state data. One the peer side, these attributes
are operational state data reveiced from the peer.";
container graceful-restart {
description
"Attributes for graceful restart.";
leaf enable {
type boolean;
default false;
description
"Enable or disable graceful restart.";
}
leaf reconnect-time {
type uint16 {
range 10..1800;
}
units seconds;
default 120;
description
"Specifies the time interval that the remote LDP peer
must wait for the local LDP peer to reconnect after the
remote peer detects the LDP communication failure.";
}
leaf recovery-time {
type uint16 {
range 30..3600;
}
units seconds;
default 120;
description
"Specifies the time interval, in seconds, that the remote
LDP peer preserves its MPLS forwarding state after
receiving the Initialization message from the restarted
local LDP peer.";
}
} // graceful-restart
} // graceful-restart-attributes-per-peer
grouping ldp-interface-ref {
description
"Defining a reference to LDP interface.";
leaf name {
type if:interface-ref;
must "(/if:interfaces/if:interface[if:name=current()]/ip:ipv4)"
+ " or "
+ "(/if:interfaces/if:interface[if:name=current()]/ip:ipv6)"
{
description "Interface is IPv4 or IPv6.";
}
description
"The name of an LDP interface.";
}
}
grouping ldp-peer-ref {
description
"An absolute reference to an LDP peer, by the LDP ID, which
consists of the LSR ID and the Label Space ID.";
leaf lsr-id {
type leafref {
path "/rt:routing/rt:control-plane-protocols/ldp:mpls-ldp/"
+ "ldp:peers/ldp:peer/ldp:lsr-id";
}
description
"The LSR ID of the peer, as a portion of the peer LDP ID.";
}
leaf label-space-id {
type leafref {
path "/rt:routing/rt:control-plane-protocols/ldp:mpls-ldp/"
+ "ldp:peers/ldp:peer/ldp:label-space-id";
}
description
"The Label Space ID of the peer, as a portion of the peer
LDP ID.";
}
} // ldp-peer-ref
grouping ldp-peer-ref-container {
description
"A container containing an absolute reference to an LDP peer.";
container peer {
description
"Reference to an LDP peer, by the LDP ID, which consists of
the LSR ID and the Label Space ID.";
uses ldp-peer-ref;
} // peer
} // ldp-peer-ref
grouping peer-attributes {
description
"Peer configuration attributes, used in the per-peer setting
can in the all-peer setting.";
leaf session-ka-holdtime {
type uint16 {
range 45..3600;
}
units seconds;
default 180;
description
"The time interval after which an inactive LDP session
terminates and the corresponding TCP session closes.
Inactivity is defined as not receiving LDP packets from the
peer.";
}
leaf session-ka-interval {
type uint16 {
range 15..1200;
}
units seconds;
default 60;
description
"The interval between successive transmissions of keepalive
packets. Keepalive packets are only sent in the absence of
other LDP packets transmitted over the LDP session.";
}
} // peer-attributes
grouping peer-authentication {
description
"Peer authentication container, used in the per-peer setting
can in the all-peer setting.";
container authentication {
description
"Containing authentication information.";
choice auth-type-selection {
description
"Options for expressing authentication setting.";
case auth-key {
leaf md5-key {
type string;
description
"MD5 Key string.";
}
}
}
} // authentication
} // peer-authentication
grouping peer-state-derived {
description
"The peer state information derived from the LDP protocol
operatoins.";
container label-advertisement-mode {
config false;
description "Label advertisement mode state.";
leaf local {
type label-adv-mode;
description
"Local Label Advertisement Mode.";
}
leaf peer {
type label-adv-mode;
description
"Peer Label Advertisement Mode.";
}
leaf negotiated {
type label-adv-mode;
description
"Negotiated Label Advertisement Mode.";
}
}
leaf next-keep-alive {
type uint16;
units seconds;
config false;
description "Time to send the next KeepAlive message.";
}
container received-peer-state {
config false;
description
"Operational state information learned from the peer.";
uses graceful-restart-attributes-per-peer;
container capability {
description "Configure capability.";
container end-of-lib {
description
"Configure end-of-lib capability.";
leaf enable {
type boolean;
description
"Enable end-of-lib capability.";
}
}
container typed-wildcard-fec {
description
"Configure typed-wildcard-fec capability.";
leaf enable {
type boolean;
description
"Enable typed-wildcard-fec capability.";
}
}
container upstream-label-assignment {
description
"Configure upstream label assignment capability.";
leaf enable {
type boolean;
description
"Enable upstream label assignment.";
}
}
} // capability
} // received-peer-state
container session-holdtime {
config false;
description "Session holdtime state.";
leaf peer {
type uint16;
units seconds;
description "Peer holdtime.";
}
leaf negotiated {
type uint16;
units seconds;
description "Negotiated holdtime.";
}
leaf remaining {
type uint16;
units seconds;
description "Remaining holdtime.";
}
} // session-holdtime
leaf session-state {
type enumeration {
enum non-existent {
description "NON EXISTENT state. Transport disconnected.";
}
enum initialized {
description "INITIALIZED state.";
}
enum openrec {
description "OPENREC state.";
}
enum opensent {
description "OPENSENT state.";
}
enum operational {
description "OPERATIONAL state.";
}
}
config false;
description
"Representing the operational status of the LDP session.";
reference
"RFC5036, Sec. 2.5.4.";
}
container tcp-connection {
config false;
description "TCP connection state.";
leaf local-address {
type inet:ip-address;
description "Local address.";
}
leaf local-port {
type inet:port-number;
description "Local port number.";
}
leaf remote-address {
type inet:ip-address;
description "Remote address.";
}
leaf remote-port {
type inet:port-number;
description "Remote port number.";
}
} // tcp-connection
leaf up-time {
type string;
config false;
description "Up time. The interval format in ISO 8601.";
}
container statistics {
config false;
description
"Statistics objects.";
leaf discontinuity-time {
type yang:date-and-time;
mandatory true;
description
"The time on the most recent occasion at which any one or
more of this interface's counters suffered a
discontinuity. If no such discontinuities have occurred
since the last re-initialization of the local management
subsystem, then this node contains the time the local
management subsystem re-initialized itself.";
}
container received {
description "Inbound statistics.";
uses statistics-peer-received-sent;
}
container sent {
description "Outbound statistics.";
uses statistics-peer-received-sent;
}
leaf total-addresses {
type uint32;
description
"The number of learned addresses.";
}
leaf total-labels {
type uint32;
description
"The number of learned labels.";
}
leaf total-fec-label-bindings {
type uint32;
description
"The number of learned label-address bindings.";
}
} // statistics
} // peer-state-derived
grouping statistics-peer-received-sent {
description
"Inbound and outbound statistic counters.";
leaf total-octets {
type yang:counter64;
description
"The total number of octets sent or received.";
}
leaf total-messages {
type yang:counter64;
description
"The number of messages sent or received.";
}
leaf address {
type yang:counter64;
description
"The number of address messages sent or received.";
}
leaf address-withdraw {
type yang:counter64;
description
"The number of address-withdraw messages sent or received.";
}
leaf initialization {
type yang:counter64;
description
"The number of initialization messages sent or received.";
}
leaf keepalive {
type yang:counter64;
description
"The number of keepalive messages sent or received.";
}
leaf label-abort-request {
type yang:counter64;
description
"The number of label-abort-request messages sent or
received.";
}
leaf label-mapping {
type yang:counter64;
description
"The number of label-mapping messages sent or received.";
}
leaf label-release {
type yang:counter64;
description
"The number of label-release messages sent or received.";
}
leaf label-request {
type yang:counter64;
description
"The number of label-request messages sent or received.";
}
leaf label-withdraw {
type yang:counter64;
description
"The number of label-withdraw messages sent or received.";
}
leaf notification {
type yang:counter64;
description
"The number of messages sent or received.";
}
} // statistics-peer-received-sent
/*
* Configuration data and operational state data nodes
*/
augment "/rt:routing/rt:control-plane-protocols" {
description "LDP augmentation.";
container mpls-ldp {
presence
"Enables the LDP protocol.";
description
"Containing configuration and operational data for the LDP
protocol.";
container global {
description
"Global attributes for LDP.";
container capability {
description
"Containing the LDP capability data. The container is
used for augmentations.";
reference
"RFC5036: Sec. 1.5.";
} // capability
container graceful-restart {
description
"Attributes for graceful restart.";
leaf enable {
type boolean;
default false;
description
"Enable or disable graceful restart.";
}
leaf reconnect-time {
type uint16 {
range 10..1800;
}
units seconds;
default 120;
description
"Specifies the time interval that the remote LDP peer
must wait for the local LDP peer to reconnect after
the remote peer detects the LDP communication
failure.";
}
leaf recovery-time {
type uint16 {
range 30..3600;
}
units seconds;
default 120;
description
"Specifies the time interval, in seconds, that the
remote LDP peer preserves its MPLS forwarding state
after receiving the Initialization message from the
restarted local LDP peer.";
}
leaf forwarding-holdtime {
type uint16 {
range 30..3600;
}
units seconds;
default 180;
description
"Specifies the time interval, in seconds, before the
termination of the recovery phase.";
}
} // graceful-restart
leaf lsr-id {
type rt-types:router-id;
description
"Specify the value to act as the LDP LSR ID.
If this attribute is not specified, LDP uses the router
ID as determined by the system.";
}
container address-families {
description
"Per address family confgiration and operational state.
The address family can be either IPv4 or IPv6.";
container ipv4 {
presence
"Present if IPv4 is enabled, unless the 'enable'
leaf is set to 'false'";
description
"Containing data related to the IPv4 address family.";
leaf enable {
type boolean;
default true;
description
"'true' to enable the address family.";
}
leaf label-distribution-controlmode {
type enumeration {
enum independent {
description
"Independent label distribution control.";
}
enum ordered {
description
"Ordered label distribution control.";
}
}
config false;
description
"Label distribution control mode.";
reference
"RFC5036: LDP Specification. Sec 2.6.";
}
// ipv4 bindings
container bindings {
config false;
description
"LDP address and label binding information.";
list address {
key "address";
description
"List of address bindings learned by LDP.";
leaf address {
type inet:ipv4-address;
description
"The IPv4 address learned from an Address
message received from or advertised to a peer.";
}
uses binding-address-state-attributes;
} // binding-address
list fec-label {
key "fec";
description
"List of FEC-label bindings learned by LDP.";
leaf fec {
type inet:ipv4-prefix;
description
"The prefix FEC value in the FEC-label binding,
learned in a Label Mapping message received from
or advertised to a peer.";
}
uses binding-label-state-attributes;
} // fec-label
} // bindings
} // ipv4
} // address-families
} // global
container discovery {
description
"Neibgbor discovery configuration and operational state.";
container interfaces {
description
"A list of interfaces for LDP Basic Descovery.";
reference
"RFC5036: LDP Specification. Sec 2.4.1.";
uses basic-discovery-timers;
list interface {
key "name";
description
"List of LDP interfaces used for LDP Basic Discovery.";
uses ldp-interface-ref;
leaf next-hello {
type uint16;
units seconds;
config false;
description "Time to send the next hello message.";
}
container address-families {
description
"Container for address families.";
container ipv4 {
presence
"Present if IPv4 is enabled, unless the 'enable'
leaf is set to 'false'";
description
"IPv4 address family.";
leaf enable {
type boolean;
default true;
description
"Enable the address family on the interface.";
}
// ipv4
container hello-adjacencies {
config false;
description
"Containing a list of hello adjacencies.";
list hello-adjacency {
key "adjacent-address";
config false;
description "List of hello adjacencies.";
leaf adjacent-address {
type inet:ipv4-address;
description
"Neighbor address of the hello adjacency.";
}
uses adjacency-state-attributes;
uses ldp-peer-ref-container;
} // hello-adjacency
} // hello-adjacencies
} // ipv4
} // address-families
} // list interface
} // interfaces
container targeted
{
description
"A list of targeted neighbors for extended discovery.";
leaf hello-holdtime {
type uint16 {
range 15..3600;
}
units seconds;
default 45;
description
"The time interval for which LDP targeted Hello
adjacency is maintained in the absence of targeted
Hello messages from an LDP neighbor.";
}
leaf hello-interval {
type uint16 {
range 5..3600;
}
units seconds;
default 15;
description
"The interval between consecutive LDP targeted Hello
messages used in extended LDP discovery.";
}
container hello-accept {
description
"LDP policy to control the acceptance of extended
neighbor discovery Hello messages.";
leaf enable {
type boolean;
default false;
description
"'true' to accept; 'false' to deny.";
}
} // hello-accept
container address-families {
description
"Container for address families.";
container ipv4 {
presence
"Present if IPv4 is enabled.";
description
"IPv4 address family.";
container hello-adjacencies {
config false;
description
"Containing a list of hello adjacencies.";
list hello-adjacency {
key "local-address adjacent-address";
description "List of hello adjacencies.";
leaf local-address {
type inet:ipv4-address;
description
"Local address of the hello adjacency.";
}
leaf adjacent-address {
type inet:ipv4-address;
description
"Neighbor address of the hello adjacency.";
}
uses adjacency-state-attributes;
uses ldp-peer-ref-container;
} // hello-adjacency
} // hello-adjacencies
list target {
key "adjacent-address";
description
"Targeted discovery params.";
leaf adjacent-address {
type inet:ipv4-address;
description
"Configures a remote LDP neighbor and enables
extended LDP discovery of the specified
neighbor.";
}
leaf enable {
type boolean;
default true;
description
"Enable the target.";
}
leaf local-address {
type inet:ipv4-address;
description
"The local address used as the source address to
send targeted Hello messages.
If the value is not specified, the
transport-address is used as the source
address.";
}
} // target
} // ipv4
} // address-families
} // targeted
} // discovery
container peers {
description
"Peers configuration attributes.";
uses peer-authentication;
uses peer-attributes;
list peer {
key "lsr-id label-space-id";
description
"List of peers.";
leaf lsr-id {
type rt-types:router-id;
description
"The LSR ID of the peer, to identify the globally
unique LSR. This is the first four octets of the LDP
ID. This leaf is used together with the leaf
'label-space-id' to form the LDP ID.";
reference
"RFC5036. Sec 2.2.2.";
}
leaf label-space-id {
type uint16;
description
"The Label Space ID of the peer, to identify a specific
label space within the LSR. This is the last two
octets of the LDP ID. This leaf is used together with
the leaf 'lsr-id' to form the LDP ID.";
reference
"RFC5036. Sec 2.2.2.";
}
uses peer-authentication;
container capability {
description
"Per peer capability";
}
container address-families {
description
"Per-vrf per-af params.";
container ipv4 {
presence
"Present if IPv4 is enabled.";
description
"IPv4 address family.";
container hello-adjacencies {
config false;
description
"Containing a list of hello adjacencies.";
list hello-adjacency {
key "local-address adjacent-address";
description "List of hello adjacencies.";
leaf local-address {
type inet:ipv4-address;
description
"Local address of the hello adjacency.";
}
leaf adjacent-address {
type inet:ipv4-address;
description
"Neighbor address of the hello adjacency.";
}
uses adjacency-state-attributes;
leaf interface {
type if:interface-ref;
description "Interface for this adjacency.";
}
} // hello-adjacency
} // hello-adjacencies
} // ipv4
} // address-families
uses peer-state-derived;
} // list peer
} // peers
} // container mpls-ldp
}
/*
* RPCs
*/
rpc mpls-ldp-clear-peer {
description
"Clears the session to the peer.";
input {
uses ldp-peer-ref {
description
"The LDP peer to be cleared. If this is not provided
then all peers are cleared.
The peer is identified by its LDP ID, which consists of
the LSR ID and the Label Space ID.";
}
}
}
rpc mpls-ldp-clear-hello-adjacency {
description
"Clears the hello adjacency";
input {
container hello-adjacency {
description
"Link adjacency or targettted adjacency. If this is not
provided then all hello adjacencies are cleared";
choice hello-adjacency-type {
description "Adjacency type.";
case targeted {
container targeted {
presence "Present to clear targeted adjacencies.";
description
"Clear targeted adjacencies.";
leaf target-address {
type inet:ip-address;
description
"The target address. If this is not provided then
all targeted adjacencies are cleared";
}
} // targeted
}
case link {
container link {
presence "Present to clear link adjacencies.";
description
"Clear link adjacencies.";
leaf next-hop-interface {
type leafref {
path "/rt:routing/rt:control-plane-protocols/"
+ "mpls-ldp/discovery/interfaces/interface/name";
}
description
"Interface connecting to next-hop. If this is not
provided then all link adjacencies are cleared.";
}
leaf next-hop-address {
type inet:ip-address;
must "../next-hop-interface" {
description
"Applicable when interface is specified.";
}
description
"IP address of next-hop. If this is not provided
then adjacencies to all next-hops on the given
interface are cleared.";
} // next-hop-address
} // link
}
}
}
}
}
rpc mpls-ldp-clear-peer-statistics {
description
"Clears protocol statistics (e.g. sent and received
counters).";
input {
uses ldp-peer-ref {
description
"The LDP peer whose statistics are to be cleared.
If this is not provided then all peers' statistics are
cleared.
The peer is identified by its LDP ID, which consists of
the LSR ID and the Label Space ID.";
}
}
}
/*
* Notifications
*/
notification mpls-ldp-peer-event {
description
"Notification event for a change of LDP peer operational
status.";
leaf event-type {
type oper-status-event-type;
description "Event type.";
}
uses ldp-peer-ref-container;
}
notification mpls-ldp-hello-adjacency-event {
description
"Notification event for a change of LDP adjacency operational
status.";
leaf event-type {
type oper-status-event-type;
description "Event type.";
}
choice hello-adjacency-type {
description
"Interface or targeted adjacency.";
case targeted {
container targeted {
description
"Targeted adjacency through LDP extended discovery.";
leaf target-address {
type inet:ip-address;
description
"The target adjacent address learned.";
}
} // targeted
}
case link {
container link {
description
"Link adjacency through LDP basic discovery.";
leaf next-hop-interface {
type if:interface-ref;
description
"The interface connecting to the adjacent next hop.";
}
leaf next-hop-address {
type inet:ip-address;
must "../next-hop-interface" {
description
"Applicable when interface is specified.";
}
description
"IP address of the next hop. This can be IPv4 or IPv6
address.";
}
} // link
}
}
}
notification mpls-ldp-fec-event {
description
"Notification event for a change of FEC status.";
leaf event-type {
type oper-status-event-type;
description "Event type.";
}
leaf prefix {
type inet:ip-prefix;
description
"The address prefix element of the FEC whose status
has changed.";
}
}
}