1 // SPDX-License-Identifier: BSD-2-Clause
4 namespace "http://frrouting.org/yang/bfdd";
7 import ietf-inet-types {
10 import ietf-yang-types {
13 import frr-interface {
19 import frr-route-types {
20 prefix frr-route-types;
23 organization "FRRouting";
25 "FRR Users List: <mailto:frog@lists.frrouting.org>
26 FRR Development List: <mailto:dev@lists.frrouting.org>";
28 "This module defines a model for managing FRR bfdd daemon.
30 Copyright 2020 FRRouting
32 Redistribution and use in source and binary forms, with or without
33 modification, are permitted provided that the following conditions
36 1. Redistributions of source code must retain the above copyright notice,
37 this list of conditions and the following disclaimer.
39 2. Redistributions in binary form must reproduce the above copyright
40 notice, this list of conditions and the following disclaimer in the
41 documentation and/or other materials provided with the distribution.
43 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
56 description "Initial revision.";
58 "RFC 5880: Bidirectional Forwarding Detection (BFD).
59 RFC 5881: Bidirectional Forwarding Detection (BFD)
60 for IPv4 and IPv6 (Single Hop).
61 RFC 5883: Bidirectional Forwarding Detection (BFD) for Multihop Paths.";
66 * BFD types declaration.
69 description "Detection multiplier";
75 typedef discriminator {
76 description "BFD session identification";
78 range "1..4294967295";
83 description "BFD session state";
87 description "Administratively down";
95 description "Initializing";
105 description "BFD session diagnostic";
111 enum control-expired {
113 description "Control timer expired";
117 description "Echo function failed";
121 description "Neighbor signaled session down";
123 enum forwarding-reset {
125 description "Forwarding plane reset";
129 description "Path down";
131 enum concatenated-path-down {
133 description "Concatenated path down";
135 enum administratively-down {
137 description "Administratively down";
139 enum reverse-concat-path-down {
141 description "Reverse concatenated path down";
146 typedef profile-name {
150 description "Profile name format";
153 typedef profile-ref {
155 path "/frr-bfdd:bfdd/frr-bfdd:bfd/frr-bfdd:profile/frr-bfdd:name";
156 require-instance false;
158 description "Reference to a BFD profile";
164 grouping session-common {
165 description "Common BFD session settings";
167 leaf detection-multiplier {
170 description "Local session detection multiplier";
173 leaf desired-transmission-interval {
175 range "10000..60000000";
179 description "Minimum desired control packet transmission interval";
182 leaf required-receive-interval {
184 range "10000..60000000";
188 description "Minimum required control packet receive interval";
191 leaf administrative-down {
194 description "Disables or enables the session administratively";
201 "Don't attempt to start session establishment.";
205 grouping session-echo {
206 description "BFD session echo settings";
211 description "Use echo packets to detect failures";
214 leaf desired-echo-transmission-interval {
216 range "10000..60000000";
220 description "Minimum desired echo packet transmission interval";
223 leaf required-echo-receive-interval {
225 range "0 | 10000..60000000";
229 description "Minimum required echo packet receive interval";
233 grouping session-multi-hop {
234 description "BFD session multi hop settings.";
242 "Minimum expected TTL on received packets.";
246 grouping bfd-monitoring {
248 "BFD monitoring template for protocol integration.";
251 type inet:ip-address;
253 "Source address to use for liveness check.
255 When source is not set and multi-hop is `false` the source
256 address will be `0.0.0.0` (any).
258 When source is not set and multi-hop is `true` the source
259 address will be automatic selected through Next Hop Tracking (NHT).";
264 "Use multi hop session instead of single hop.";
271 "BFD pre configured profile.";
272 type frr-bfdd:profile-ref;
276 grouping session-states {
280 leaf local-discriminator {
282 description "Local session identifier";
287 description "Local session state";
290 leaf local-diagnostic {
292 description "Local session diagnostic";
295 leaf local-multiplier {
297 description "Local session current multiplier";
303 leaf remote-discriminator {
305 description "Remote session identifier";
310 description "Remote session state";
313 leaf remote-diagnostic {
315 description "Local session diagnostic";
318 leaf remote-multiplier {
320 description "Remote session detection multiplier";
324 * Negotiated settings.
326 leaf negotiated-transmission-interval {
327 description "Negotiated transmit interval";
332 leaf negotiated-receive-interval {
333 description "Negotiated receive interval";
338 leaf detection-mode {
339 description "Detection mode";
342 enum async-with-echo {
344 description "Async with echo";
346 enum async-without-echo {
348 description "Async without echo";
350 enum demand-with-echo {
352 description "Demand with echo";
354 enum demand-without-echo {
356 description "Demand without echo";
364 leaf last-down-time {
365 type yang:date-and-time;
366 description "Time and date of the last time session was down";
370 type yang:date-and-time;
371 description "Time and date of the last time session was up";
374 leaf session-down-count {
376 description "Number of times the session went down";
379 leaf session-up-count {
381 description "Number of times the session went up";
384 leaf control-packet-input-count {
386 description "Number of control packets received";
389 leaf control-packet-output-count {
391 description "Number of control packets sent";
395 * Echo mode operational data.
397 leaf negotiated-echo-transmission-interval {
400 description "Negotiated echo transmit interval";
406 leaf echo-packet-input-count {
408 description "Number of echo packets received";
411 leaf echo-packet-output-count {
413 description "Number of echo packets sent";
422 presence "Present if the BFD protocol is enabled";
426 description "BFD pre configuration profiles";
430 description "Profile name";
435 uses session-multi-hop;
440 key "dest-addr interface vrf";
441 description "List of single hop sessions";
444 type inet:ip-address;
445 description "IP address of the peer";
449 type frr-interface:interface-ref;
450 description "Interface to use to contact peer";
454 type frr-vrf:vrf-ref;
455 description "Virtual Routing Domain name";
459 type inet:ip-address;
460 description "Local IP address";
465 description "Override defaults with profile.";
478 key "source-addr dest-addr vrf";
479 description "List of multi hop sessions";
482 type inet:ip-address;
483 description "Local IP address";
487 type inet:ip-address;
488 description "IP address of the peer";
492 type frr-vrf:vrf-ref;
493 description "Virtual Routing Domain name";
498 description "Override defaults with profile.";
502 uses session-multi-hop;