module bfd { namespace "urn:ietf:params:xml:ns:yang:bfd"; // replace with IANA namespace when assigned prefix "bfd"; import ietf-interfaces { prefix "if"; } import ietf-inet-types { prefix "inet"; } import ietf-yang-types { prefix yang; } organization "IETF BFD Working Group"; contact "WG Web: WG List: WG Chair: Jeff Haas WG Chair: Nobo Akiya Editor: Lianshu Zheng and Reshad Rahman"; description "This module contains the YANG definition for BFD parameters as per RFC5880, RFC5881 and RFC5883"; revision 2015-03-05 { description "Initial revision."; } typedef discriminator { type uint32 { range 1..4294967295; } } typedef diagnostic { type enumeration { enum none { value 0; } enum controlExpiry { value 1; } enum echoFailed { value 2; } enum nborDown { value 3; } enum fwdingReset { value 4; } enum pathDown { value 5; } enum concPathDown { value 6; } enum adminDown { value 7; } enum reverseConcPathDown { value 8; } } } typedef state { type enumeration { enum adminDown { value 0; } enum down { value 1; } enum init { value 2; } enum up { value 3; } } } typedef multiplier { type uint8 { range 1..255; } } typedef TTL { type uint8 { range 1..255; } } typedef bfd-auth-algorithm { description "Authentication algorithm"; type enumeration { enum simple-password { description "Simple password"; } enum keyed-md5 { description "Keyed message Digest 5"; } enum meticulous-keyed-md5 { description "Meticulous keyed message Digest 5"; } enum keyed-sha-1 { description "Keyed secure hash algorithm (SHA1) "; } enum meticulous-keyed-sha-1 { description "Meticulous keyed secure hash algorithm (SHA1) "; } } } typedef vrfName { description "VRF Name"; type string; } feature bfd-centralized-session-config { description "BFD session centralized config supported"; } feature bfd-interface-config { description "BFD per-interface config supported"; } feature bfd-authentication { description "BFD authentication supported"; } grouping bfd-grouping-common-cfg-parms { description "BFD grouping for common config parameters"; leaf local-multiplier { description "Local multiplier"; type multiplier; default 3; } leaf desired-min-tx-interval { description "Desired minimum transmit interval of control packets"; type uint32; units microseconds; mandatory true; } leaf required-min-rx-interval { description "Required minimum receive interval of control packets"; type uint32; units microseconds; mandatory true; } leaf demand-enabled { description "To enbale demand mode"; type boolean; default false; } leaf enable-authentication { description "If set, the Authentication Section is present and the session is to be authenticated (see RFC5880 section 6.7 for details)."; type boolean; default false; } container authentication-parms { if-feature bfd-authentication; leaf key-chain-name { description "Key chain name"; must "../algorithm" { error-message "May not be configured without algorithm"; } type string; } leaf algorithm { description "Authentication algorithm to be used"; must "../key-chain" { error-message "May not be configured without key-chain"; } type bfd-auth-algorithm; } } } grouping bfd-grouping-echo-cfg-parms { description "BFD grouping for echo config parameters"; leaf desired-min-echo-tx-interval { description "Desired minumum transmit interval for echo"; type uint32; units microseconds; default 0; } leaf required-min-echo-rx-interval { description "Required minimum receive interval for echo"; type uint32; units microseconds; default 0; } } grouping bfd-client-base-cfg-parms { description "BFD grouping for base config parameters which could be used by a protocol which is a client of BFD"; container bfd-cfg { leaf enabled { type boolean; description "True if BFD is enabled"; default false; } leaf local-multiplier { type multiplier; default 3; } leaf desired-min-tx-interval { description "Desired minimum transmit interval of control packets"; type uint32; units microseconds; mandatory true; } leaf required-min-rx-interval { description "Required minimum receive interval of control packets"; type uint32; units microseconds; mandatory true; } } } grouping bfd-client-full-cfg-parms { description "BFD grouping for complete config parameters which could be used by a protocol which is a client of BFD."; container bfd-cfg { leaf enabled { type boolean; description "True if BFD is enabled"; default false; } uses bfd-grouping-common-cfg-parms; uses bfd-grouping-echo-cfg-parms; } } grouping bfd-all-session { description "BFD session operational information"; leaf sesssion-type { description "BFD session type, this indicates the path type that BFD is running on"; type enumeration { enum ip-single-hop { value "0"; description "IP single hop"; } enum ip-multi-hop { value "1"; description "IP multi hop"; } } } leaf local-discriminator { description "Local discriminator"; type discriminator; } leaf remote-discriminator { description "Remote discriminator"; type discriminator; } leaf remote-multiplier { description "Remote multiplier"; type multiplier; } leaf out-interface { description "Outgoing physical interface name"; type if:interface-ref; } leaf demand-capability{ description "Local demand mode capability"; type boolean; } list session-running { description "BFD session running information"; leaf local-state { type state; } leaf remote-state { type state; } leaf local-diagnostic { type diagnostic; } leaf remote-diagnostic { type diagnostic; } leaf detect-Mode { description "Detect mode"; type enumeration { enum async-with-echo { value "0"; description "Async with echo"; } enum async-without-echo { value "1"; description "Async without echo"; } enum demand-with-echo { value "2"; description "Demand with echo"; } enum demand-without-echo { value "3"; description "Demand without echo"; } } } leaf actual-tx-interval { description "Actual transmit interval"; type uint32; units microseconds; } leaf actual-rx-interval { description "Actual receive interval"; type uint32; units microseconds; } leaf actual-echo-tx-interval { description "Actual echo transmit interval"; type uint32; units microseconds; } leaf detect-time { description "Detect time"; type uint32; units microseconds; } } list sesssion-statistics { description "BFD session statistics"; leaf create-time { description "Time and date when session was created"; type yang:date-and-time; } leaf last-down-time { description "Time and date of last time the session went down"; type yang:date-and-time; } leaf last-up-time { description "Time and date of last time the session went up"; type yang:date-and-time; } leaf receive-pkt { description "Received Packet Count"; type uint64; } leaf send-pkt { description "Sent Packet Count"; type uint64; } leaf down-count { description "Session Down Count"; type uint32; } leaf receive-bad-pkt { description "Received bad packet count"; type uint64; } leaf send-failed-pkt { description "Packet Failed to Send Count"; type uint64; } leaf short-break-count { description "Shortbreak count"; default "0"; type uint32; } } } container bfd-cfg { container bfd-session-cfg { if-feature bfd-centralized-session-config; list session-ip-sh { key "interface dest-addr"; leaf interface { description "Interface on which the IP single-hop session is running."; type if:interface-ref; } leaf dest-addr { description "IP address of the peer"; type inet:ip-address; } leaf admin-down { description "Is the BFD session administratively down"; type boolean; default false; } uses bfd-grouping-common-cfg-parms; uses bfd-grouping-echo-cfg-parms; } list session-ip-mh { key "vrf-name source-addr dest-addr"; leaf vrf-name { description "Routing instance"; type vrfName; } leaf source-addr { description "Local IP address"; type inet:ip-address; } leaf dest-addr { description "IP address of the peer"; type inet:ip-address; } leaf admin-down { description "Is the BFD session administratively down"; type boolean; default false; } uses bfd-grouping-common-cfg-parms; leaf tx-ttl { type TTL; default 255; description "TTL of outgoing BFD control packets"; } leaf rx-ttl { type TTL; description "Minimum allowed TTL value for incoming BFD control packets"; mandatory true; } } } list bfd-interface-cfg { if-feature bfd-interface-config; description "Per-interface BFD configuration"; key interface; leaf interface { type if:interface-ref; } uses bfd-grouping-common-cfg-parms; uses bfd-grouping-echo-cfg-parms; } } container bfd-oper { container bfd-session-statistics { config "false"; description "BFD session number"; leaf ip-sh-session-num { description "IP single hop session number"; config "false"; type uint32; } leaf ip-mh-session-num { description "IP multi hop session Number"; config "false"; type uint32; } leaf total-session-num { description "Total session number"; config "false"; type uint32; } leaf session-up-num { description "Session up number"; config "false"; type uint32; } leaf sess-down-num { description "Session down number"; config "false"; type uint32; } } container bfd-session-lists { config false; list session-ip-sh { key "interface dest-addr"; leaf interface { type if:interface-ref; } leaf dest-addr { type inet:ip-address; } uses bfd-all-session; } list session-ip-mh { key "vrfName source-addr dest-addr"; leaf vrfName { type vrfName; } leaf source-addr { type inet:ip-address; } leaf dest-addr { type inet:ip-address; } leaf ttl { description "TTL of session"; config "false"; type TTL; } uses bfd-all-session; } } } grouping bfd-notification-params { description "This group describes common params that will be send as part of BFD notification"; leaf local-discr { description "BFD local discriminator"; type discriminator; } leaf remote-discr { description "BFD remote discriminator"; type discriminator; } leaf new-state { description "Current BFD state"; type state; } leaf state-change-reason { description "BFD state change reason"; type string; } leaf time-in-previous-state { description "How long the BFD session was in the previous state"; type string; } leaf dest-addr { description "BFD peer address"; type inet:ip-address; } } notification bfd-singlehop-notification { uses bfd-notification-params; leaf interface { description "Interface to which this BFD session belongs to"; type if:interface-ref; } leaf echo-enabled { description "Was echo enabled for BFD"; type boolean; } } notification bfd-multihop-notification { uses bfd-notification-params; leaf vrf-name { description "Routing instance"; type vrfName; } leaf source-addr { description "BFD local address"; type inet:ip-address; } } }