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:
WG Chair: Loa Andersson
WG Chair: Ross Callon
WG Chair: George Swallow
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).";
revision 2017-10-29 {
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
"Adjacency state attributes.";
leaf-list flag {
type identityref {
base "adjacency-flag-base";
}
description "Adjacency flags.";
}
container hello-holdtime {
description "Hello holdtime state.";
leaf adjacent {
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.";
}
}
leaf next-hello {
type uint16;
units seconds;
description "Time to send the next hello message.";
}
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
"Basic discovery timer attributes.";
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
"Address binding attributes";
leaf advertisement-type {
type advertised-received;
description
"Received or advertised.";
}
leaf peer {
type leafref {
path "../../../../../../ldp:peers/ldp:peer/ldp:lsr-id";
}
must "../advertisement-type = 'received'" {
description
"Applicable for received address.";
}
description
"LDP peer from which this address is received.";
} // peer
} // binding-address-state-attributes
grouping binding-label-state-attributes {
description
"Label binding attributes";
list peer {
key "lsr-id advertisement-type";
description
"List of advertised and received peers.";
leaf lsr-id {
type leafref {
path "../../../../../../../ldp:peers/ldp:peer/"
+ "ldp:lsr-id";
}
description
"LDP peer from which this binding is received,
or to which this binding is advertised.";
}
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 extended-discovery-policy-attributes {
description
"LDP policy to control the acceptance of extended neighbor
discovery hello messages.";
container hello-accept {
description
"Extended discovery acceptance policies.";
leaf enable {
type boolean;
description
"'true' to accept; 'false' to deny.";
}
} // hello-accept
} // extended-discovery-policy-attributes
grouping extended-discovery-timers {
description
"Extended discovery timer attributes.";
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.";
}
} // extended-discovery-timers
grouping global-attributes {
description "Configuration attributes at global level.";
uses instance-attributes;
} // global-attributes
grouping graceful-restart-attributes {
description
"Graceful restart configuration attributes.";
container graceful-restart {
description
"Attributes for graceful restart.";
leaf enable {
type boolean;
description
"Enable or disable graceful restart.";
}
leaf reconnect-time {
type uint16 {
range 10..1800;
}
units seconds;
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;
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;
description
"Specifies the time interval, in seconds, before the
termination of the recovery phase.";
}
} // graceful-restart
} // graceful-restart-attributes
grouping graceful-restart-attributes-per-peer {
description
"Per peer graceful restart configuration attributes.";
container graceful-restart {
description
"Attributes for graceful restart.";
leaf enable {
type boolean;
description
"Enable or disable graceful restart.";
}
leaf reconnect-time {
type uint16 {
range 10..1800;
}
units seconds;
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;
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 instance-attributes {
description "Configuration attributes at instance level.";
container capability {
description "Configure capability.";
} // capability
uses graceful-restart-attributes;
leaf lsr-id {
type yang:dotted-quad;
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.";
}
} // instance-attributes
grouping ldp-adjacency-ref {
description
"An absolute reference to an LDP adjacency.";
choice hello-adjacency-type {
description
"Interface or targeted adjacency.";
case targeted {
container targeted {
description "Targeted adjacency.";
leaf target-address {
type inet:ip-address;
description
"The target address.";
}
} // targeted
}
case link {
container link {
description "Link adjacency.";
leaf next-hop-interface {
type if:interface-ref;
description
"Interface connecting to next-hop.";
}
leaf next-hop-address {
type inet:ip-address;
must "../next-hop-interface" {
description
"Applicable when interface is specified.";
}
description
"IP address of next-hop.";
}
} // link
}
}
} // ldp-adjacency-ref
grouping ldp-fec-event {
description
"The event attributes for a change of FEC
(Forwarding Equivalence Class) status.";
leaf prefix {
type inet:ip-prefix;
description
"The address prefix element of the FEC whose status
has changed.";
}
} // ldp-fec-event
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.";
leaf peer-ref {
type leafref {
path "/rt:routing/rt:control-plane-protocols/mpls-ldp/"
+ "peers/peer/lsr-id";
}
description
"Reference to an LDP peer.";
}
} // ldp-peer-ref
grouping peer-attributes {
description "Peer configuration attributes.";
leaf session-ka-holdtime {
type uint16 {
range 45..3600;
}
units seconds;
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;
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.";
/*
leaf session-authentication-md5-password {
type string {
length "1..80";
}
description
"Assigns an encrypted MD5 password to an LDP
peer";
} // md5-password
*/
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 "Peer derived state attributes.";
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.";
}
leaf peer-ldp-id {
type yang:dotted-quad;
config false;
description "Peer LDP ID.";
}
container received-peer-state {
config false;
description "Peer features.";
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.";
}
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.";
}
leaf remote-address {
type inet:ip-address;
description "Remote address.";
}
leaf remote-port {
type inet:port-number;
description "Remote port.";
}
} // 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 "Container for LDP protocol.";
description
"Container for LDP protocol.";
container global {
description
"Global attributes for LDP.";
uses global-attributes;
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
"'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.";
leaf address {
type inet:ipv4-address;
description
"Binding address.";
}
uses binding-address-state-attributes;
} // binding-address
list fec-label {
key "fec";
description
"List of label bindings.";
leaf fec {
type inet:ipv4-prefix;
description
"Prefix FEC.";
}
uses binding-label-state-attributes;
} // fec-label
} // bindings
} // ipv4
} // address-families
} // global
container discovery {
description
"Neibgbor discovery configuration.";
container interfaces {
description
"A list of interfaces for basic descovery.";
uses basic-discovery-timers;
list interface {
key "name";
description
"List of LDP interfaces.";
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;
leaf peer {
type leafref {
path "../../../../../../../../"
+ "peers/peer/lsr-id";
}
description
"LDP peer from this adjacency.";
}
} // hello-adjacency
} // hello-adjacencies
} // ipv4
} // address-families
} // list interface
} // interfaces
container targeted
{
description
"A list of targeted neighbors for extended discovery.";
uses extended-discovery-timers;
uses extended-discovery-policy-attributes;
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;
leaf peer {
type leafref {
path "../../../../../../../peers/peer/"
+ "lsr-id";
}
description
"LDP peer from this adjacency.";
}
} // 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;
description
"Enable the target.";
}
leaf local-address {
type inet:ipv4-address;
description
"The local address.";
}
} // target
} // ipv4
} // address-families
} // targeted
} // discovery
container peers {
description
"Peers configuration attributes.";
uses peer-authentication;
uses peer-attributes;
list peer {
key "lsr-id";
description
"List of peers.";
leaf lsr-id {
type yang:dotted-quad;
description "LSR ID.";
}
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 {
leaf lsr-id {
type union {
type yang:dotted-quad;
type uint32;
}
description
"LSR ID of peer to be cleared. If this is not provided
then all peers are cleared";
}
}
}
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 {
leaf lsr-id {
type union {
type yang:dotted-quad;
type uint32;
}
description
"LSR ID of peer whose statistic are to be cleared.
If this is not provided then all peers statistics are
cleared";
}
}
}
/*
* 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;
}
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.";
}
uses ldp-adjacency-ref;
}
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.";
}
uses ldp-fec-event;
}
}