moduleopenconfig-bfd {
yang-version1;
namespace"http://openconfig.net/yang/bfd";
prefixoc-bfd;
importopenconfig-extensions {
prefixocext;
}
importopenconfig-types {
prefixoc-types;
}
importopenconfig-interfaces {
prefixoc-if;
}
importopenconfig-inet-types {
prefixoc-inet;
}
importopenconfig-if-types {
prefixoc-ift;
}
importopenconfig-network-instance {
prefixoc-ni;
}
importopenconfig-policy-types {
prefixoc-pol-types;
}
organization"OpenConfig working group";
contact"OpenConfig working group
www.openconfig.net";
description"An OpenConfig model of Bi-Directional Forwarding Detection (BFD)
configuration and operational state.";
revision"2017-11-17" {
description"Update version number for initial sharing.";
reference"0.1.0";
}
revision"2017-10-19" {
description"Adopt OpenConfig types models, type corrections";
reference"0.0.2";
}
revision"2016-06-24" {
description"Initial revision";
reference"0.0.1";
}
ocext:openconfig-version"0.1.0";
typedefbfd-session-state {
typeenumeration {
enum"UP" {
value0;
description"The BFD session is perceived to be up by the system.";
}
enum"DOWN" {
value1;
description"The BFD session is perceived to be down by the system.";
}
enum"ADMIN_DOWN" {
value2;
description"The BFD session is administratively disabled.";
}
enum"INIT" {
value3;
description"The BFD session is perceived to be initialising by the
system.";
}
}
description"The state of the BFD session according to the system referred
to by the context of the leaf.";
reference"RFC5880 - Bidirectional Forwarding Detection, Section
4.1";
}
typedefbfd-diagnostic-code {
typeenumeration {
enum"NO_DIAGNOSTIC" {
value0;
description"No diagnostic code was specified, or the session has not
changed state.";
}
enum"DETECTION_TIMEOUT" {
value1;
description"The control detection time expired: no BFD packet was
received within the required period.";
}
enum"ECHO_FAILED" {
value2;
description"The BFD echo function failed - echo packets have not been
received for the required period of time.";
}
enum"FORWARDING_RESET" {
value3;
description"The forwarding plane in the local system was reset - such
that the remote system cannot rely on the forwarding state of
the device specifying this error code.";
}
enum"PATH_DOWN" {
value4;
description"Signalling outside of BFD specified that the path underlying
this session has failed.";
}
enum"CONCATENATED_PATH_DOWN" {
value5;
description"When a BFD session runs over a series of path segments, this
error code indicates that a subsequent path segment (i.e.,
one in the transmit path between the source and destination
of the session) has failed.";
}
enum"ADMIN_DOWN" {
value6;
description"The BFD session has been administratively disabled by the
peer.";
}
enum"REVERSE_CONCATENATED_PATH_DOWN" {
value7;
description"In the case that a BFD session is running over a series of
path segments, this error code indicates that a path segment
on the reverse path (i.e., in the transmit direction from the
destination to the source of the session) has failed.";
}
}
description"Diagnostic codes defined by BFD. These typically indicate the
reason for a change of session state.";
reference"RFC5880 - Bidirectional Forwarding Detection, Section
4.1";
}
groupingbfd-interface-config {
description"Top-level per-interface configuration parameters for BFD.";
leafid {
typestring;
description"A unique identifier for the interface.";
}
leafenabled {
typeboolean;
description"When this leaf is set to true then the BFD session is enabled
on the specified interface - if it is set to false, it is
administratively disabled.";
}
leaflocal-address {
typeoc-inet:ip-address;
description"The source IP address to be used for BFD sessions over this
interface.";
}
leafdesired-minimum-tx-interval {
typeuint32;
units"microseconds";
description"The minimum interval between transmission of BFD control
packets that the operator desires. This value is advertised to
the peer, however the actual interval used is specified by
taking the maximum of desired-minimum-tx-interval and the
value of the remote required-minimum-receive interval value.
This value is specified as an integer number of microseconds.";
}
leafrequired-minimum-receive {
typeuint32;
units"microseconds";
description"The minimum interval between received BFD control packets that
this system should support. This value is advertised to the
remote peer to indicate the maximum frequency (i.e., minimum
inter-packet interval) between BFD control packets that is
acceptable to the local system.";
}
leafdetection-multiplier {
typeuint16 {
range"1..max";
}
description"The number of packets that must be missed to declare this
session as down. The detection interval for the BFD session
is calculated by multiplying the value of the negotiated
transmission interval by this value.";
}
leafenable-per-member-link {
when"/oc-if:interfaces/oc-if:interface"
+ "[name=current()/../../interface-ref/config/interface]/"
+ "oc-if:state/oc-if:type = 'oc-ift:IF_AGGREGATE'" {
description"Include per-member link BFD only when the type of
interface is a link aggregate.";
}
typeboolean;
default'false';
description"When this leaf is set to true - BFD will be enabled on
each member interface of the aggregated Ethernet bundle.";
}
} // grouping bfd-interface-configgroupingbfd-interface-state {
description"Operational state parameters relating to BFD running on an
interface.";
} // grouping bfd-interface-stategroupingbfd-session-state-mode-timers-common {
description"Common operational state parameters that are re-used across
both asynchronous and echo modes of BFD.";
leaflast-packet-transmitted {
typeuint64;
description"The date and time at which the last BFD packet
was transmitted for this session, expressed as the number
of nanoseconds since the Unix Epoch (January 1, 1970,
00:00 UTC).";
}
leaflast-packet-received {
typeuint64;
description"The date and time at which the last BFD packet
was received for this session, expressed as the number
of nanoseconds since the Unix Epoch (January 1, 1970,
00:00 UTC).";
}
leaftransmitted-packets {
typeuint64;
description"The number of packets that have been transmitted
by the local system.";
}
leafreceived-packets {
typeuint64;
description"The number of packets that have been received by the
local system from the remote neighbour.";
}
leafup-transitions {
typeuint64;
description"The number of times that the adjacency with the neighbor
has transitioned into the up state.";
}
} // grouping bfd-session-state-mode-timers-commongroupingbfd-session-state-sessiondetails-common {
description"Common session details for a BFD session.";
leafsession-state {
typebfd-session-state;
description"The state of the BFD session perceived by the local system.";
}
leafremote-session-state {
typebfd-session-state;
description"The reported state of the BFD session according to the remote
system. This state reflects the last state reported in a BFD
control packet.";
}
leaflast-failure-time {
typeoc-types:timeticks64;
description"The time of the last transition of the BFD session out of
the UP state, expressed as the number of nanoseconds since
the Unix epoch.";
}
leaffailure-transitions {
typeuint64;
description"The number of times that the BFD session has transitioned
out of the UP state.";
}
leaflocal-discriminator {
typestring;
description"A unique identifier used by the local system to identify this
BFD session.";
}
leafremote-discriminator {
typestring;
description"A unique identified used by the remote system to identify this
BFD session.";
}
leaflocal-diagnostic-code {
typebfd-diagnostic-code;
description"The local BFD diagnostic code indicating the most recent
reason for failure of this BFD session.";
}
leafremote-diagnostic-code {
typebfd-diagnostic-code;
description"The remote BFD diagnostic code indicating the remote system's
reason for failure of the BFD session";
}
leafremote-minimum-receive-interval {
typeuint32;
description"The value of the minimum receive interval that was specified
in the most recent BFD control packet received from the peer.";
}
leafdemand-mode-requested {
typeboolean;
description"This leaf is set to true when the remote system has requested
demand mode be run for this session.";
}
leafremote-authentication-enabled {
typeboolean;
description"This leaf is set to true when the remote system has specified
that authentication is present for the BFD session.";
}
leafremote-control-plane-independent {
typeboolean;
description"This leaf is set to true when the remote system has specified
that the hardware implementing this BFD session is independent
of the control plane's liveliness.";
}
} // grouping bfd-session-state-sessiondetails-commongroupingbfd-session-state-async-common {
description"Common parameters for asynchronous BFD sessions";
containerasync {
description"Operational state parameters specifically relating to
asynchronous mode of BFD.";
usesbfd-session-state-mode-timers-common;
} // container async
} // grouping bfd-session-state-async-commongroupingbfd-session-state-echo-common {
description"Common parameters for echo-mode BFD sessions.";
containerecho {
description"Operational state parameters specifically relating to the
echo mode of BFD.";
leafactive {
typeboolean;
description"This leaf is set to true when echo mode is running between
the local and remote system. When it is set to false, solely
asynchronous mode is active.";
}
usesbfd-session-state-mode-timers-common;
} // container echo
} // grouping bfd-session-state-echo-commongroupingbfd-session-state-common {
description"Common operational state parameters that may be re-used across
multiple BFD session contexts.";
leaflocal-address {
typeoc-inet:ip-address;
description"The IP address used by the local system for this BFD session.";
}
leafremote-address {
typeoc-inet:ip-address;
description"The IP address used by the remote system for this BFD session.";
}
leaf-listsubscribed-protocols {
typeidentityref {
baseoc-pol-types:INSTALL_PROTOCOL_TYPE;
}
description"Indicates the set of protocols that currently use
this BFD session for liveliness detection.";
}
usesbfd-session-state-sessiondetails-common;
usesbfd-session-state-echo-common;
usesbfd-session-state-async-common;
} // grouping bfd-session-state-commongroupingbfd-session-microbfd-common {
description"BFD session parameters utilised only for micro-BFD sessions.";
usesbfd-session-state-sessiondetails-common;
usesbfd-session-state-async-common;
} // grouping bfd-session-microbfd-commongroupingbfd-interface-peer-state {
description"Per-peer, per-interface operational state parameters for BFD.";
usesbfd-session-state-common;
} // grouping bfd-interface-peer-stategroupingbfd-interface-microbfd-config {
description"Configuration parameters for a microBFD session on an
interface.";
leaflocal-address {
typeoc-inet:ip-address;
description"The local IP address used by the system for the micro-BFD session
specified.";
}
leafremote-address {
typeoc-inet:ip-address;
description"The remote IP destination that should be used by the system for
the micro-BFD session specified.";
}
leafmember-interface {
typeleafref {
path"/oc-if:interfaces/"
+ "oc-if:interface/oc-if:config/oc-if:name";
}
description"Reference to a member link of the aggregate interface being
described.";
}
} // grouping bfd-interface-microbfd-configgroupingbfd-interface-microbfd-state {
description"Operational state parameters relating to a micro-BFD session on
an interface.";
usesbfd-session-microbfd-common;
} // grouping bfd-interface-microbfd-stategroupingbfd-interface-microbfd-structural {
description"Structural grouping for micro-bfd configuration and state
parameters.";
containermicro-bfd-sessions {
when"/oc-if:interfaces/oc-if:interface"
+ "[name=current()/../interface-ref/config/interface]/"
+ "oc-if:state/oc-if:type = 'oc-ift:IF_AGGREGATE'" {
description"Include per-member link BFD only when the type of
interface is a link aggregate.";
}
description"Parameters relating to micro-BFD sessions associated
with the interface.";
listmicro-bfd-session {
key "member-interface";
description"This list contains configuration and state parameters
relating to micro-BFD session.";
reference"RFC7130 - Bidirectional Forwarding Detection (BFD)
on Link Aggregation Group (LAG) Interfaces.";
leafmember-interface {
typeleafref {
path"../config/member-interface";
}
description"A reference to the member interface of the link
aggregate.";
}
containerconfig {
description"Configuration parameters for the micro-BFD session.";
usesbfd-interface-microbfd-config;
} // container configcontainerstate {
configfalse;
description"Operational state parameters for the micro-BFD session.";
usesbfd-interface-microbfd-config;
usesbfd-interface-microbfd-state;
} // container state
} // list micro-bfd-session
} // container micro-bfd-sessions
} // grouping bfd-interface-microbfd-structuralgroupingbfd-interface-peer-structural {
description"Structural grouping for BFD peers (in the context of an interface).";
containerpeers {
description"Parameters relating to the BFD peers which are seen
over this interface.";
listpeer {
key "local-discriminator";
configfalse;
description"Parameters relating to the BFD peer specified by the
remote address.";
leaflocal-discriminator {
typeleafref {
path"../state/local-discriminator";
}
description"The local discriminator, which is unique for the
session on the system.";
}
containerstate {
configfalse;
description"Operational state parameters for the BFD session.";
usesbfd-interface-peer-state;
} // container state
} // list peer
} // container peers
} // grouping bfd-interface-peer-structuralgroupingbfd-top {
description"Structural grouping for Bidirectional Forwarding Detection (BFD).";
containerbfd {
description"Configuration and operational state parameters for BFD.";
reference"RFC5880, RFC5881";
containerinterfaces {
description"Interfaces on which BFD sessions are to be enabled.";
listinterface {
key "id";
description"Per-interface configuration and state parameters for BFD.";
leafid {
typeleafref {
path"../config/id";
}
description"A reference to an identifier for the interface on which
BFD is enabled.";
}
containerconfig {
description"Configuration parameters for BFD on the specified
interface.";
usesbfd-interface-config;
} // container configcontainerstate {
configfalse;
description"Operational state parameters for BFD on the specified
interface.";
usesbfd-interface-config;
usesbfd-interface-state;
} // container stateusesoc-if:interface-ref;
usesbfd-interface-microbfd-structural;
usesbfd-interface-peer-structural;
} // list interface
} // container interfaces
} // container bfd
} // grouping bfd-topgroupingenable-bfd-config {
description"Configuration parameters relating to enabling BFD.";
leafenabled {
typeboolean;
description"When this leaf is set to true, BFD is used to detect the
liveliness of the remote peer or next-hop.";
}
} // grouping enable-bfd-configgroupingenable-bfd-state {
description"Operational state parameters relating to enabling BFD.";
leafassociated-session {
typeleafref {
path"/bfd/interfaces/interface/peers/peer/local-discriminator";
}
description"A reference to the BFD session that is tracking the liveliness
of the remote entity.";
}
} // grouping enable-bfd-stategroupingbfd-enable {
description"Grouping which can be included in a protocol wishing to enable
BFD.";
containerenable-bfd {
description"Enable BFD for liveliness detection to the next-hop or
neighbour.";
containerconfig {
description"Configuration parameters relating to enabling BFD.";
usesenable-bfd-config;
} // container configcontainerstate {
configfalse;
description"Operational state parameters relating to enabing BFD.";
usesenable-bfd-config;
usesenable-bfd-state;
} // container state
} // container enable-bfd
} // grouping bfd-enableaugment/oc-ni:network-instances/oc-ni:network-instance/oc-ni:protocols/oc-ni:protocol/oc-ni:bgp/oc-ni:neighbors/oc-ni:neighbor {
description"Augment the BGP routing protocol to add a link to BFD for
neighbour detection.";
usesbfd-enable;
}
augment/oc-ni:network-instances/oc-ni:network-instance/oc-ni:protocols/oc-ni:protocol/oc-ni:bgp/oc-ni:peer-groups/oc-ni:peer-group {
description"Augment the BGP routing protocol to add a link to BFD for
neighbor detection when specified within a peer-group.";
usesbfd-enable;
}
augment/oc-ni:network-instances/oc-ni:network-instance/oc-ni:protocols/oc-ni:protocol/oc-ni:static-routes/oc-ni:static/oc-ni:next-hops/oc-ni:next-hop {
description"Augment the static route configuration to allow a next-hop
to be tracked by BFD.";
usesbfd-enable;
}
usesbfd-top;
} // module openconfig-bfd