From 5aeb216ea53f330a3ac72e3982dcff9500bc1fb3 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Wed, 10 Mar 2021 01:17:47 +0300 Subject: [PATCH 1/2] bfdd: fix starting echo receive timer Currently this timer is only started when we receive the first echo packet. If we never receive the packet, the timer is never started and the user falsely assumes that echo function is working. Signed-off-by: Igor Ryzhov --- bfdd/bfd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bfdd/bfd.c b/bfdd/bfd.c index 3cbb3691ec..9dfffbf369 100644 --- a/bfdd/bfd.c +++ b/bfdd/bfd.c @@ -494,8 +494,10 @@ void ptm_bfd_echo_stop(struct bfd_session *bfd) void ptm_bfd_echo_start(struct bfd_session *bfd) { bfd->echo_detect_TO = (bfd->remote_detect_mult * bfd->echo_xmt_TO); - if (bfd->echo_detect_TO > 0) + if (bfd->echo_detect_TO > 0) { + bfd_echo_recvtimer_update(bfd); ptm_bfd_echo_xmt_TO(bfd); + } } void ptm_bfd_sess_up(struct bfd_session *bfd) From f1825d571e2cf48922fe86d5158018a13bd75d4c Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Wed, 10 Mar 2021 01:35:55 +0300 Subject: [PATCH 2/2] bfdd: warn users about echo-mode restrictions Echo-mode implementation is currently broken. Instead of sending packets to it's own address, bfdd is sending echo packets to the peer's address. It may seem to work when testing between two FRR instances, because FRR loops back such packets, but no other implementation is supposed to do that. Let's warn users that the current implementation works only between two FRR instances. Signed-off-by: Igor Ryzhov --- bfdd/bfdd_cli.c | 4 ++++ doc/user/bfd.rst | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bfdd/bfdd_cli.c b/bfdd/bfdd_cli.c index 206f6c7d0c..211588cce1 100644 --- a/bfdd/bfdd_cli.c +++ b/bfdd/bfdd_cli.c @@ -433,6 +433,10 @@ DEFPY_YANG( return CMD_WARNING_CONFIG_FAILED; } + if (!no && !bglobal.bg_use_dplane) { + vty_out(vty, "%% Current implementation of echo mode works only when the peer is also FRR.\n"); + } + nb_cli_enqueue_change(vty, "./echo-mode", NB_OP_MODIFY, no ? "false" : "true"); return nb_cli_apply_changes(vty, NULL); diff --git a/doc/user/bfd.rst b/doc/user/bfd.rst index b8f749b740..87f560b5bb 100644 --- a/doc/user/bfd.rst +++ b/doc/user/bfd.rst @@ -174,7 +174,8 @@ BFD peers and profiles share the same BFD session configuration commands. .. clicmd:: echo-mode Enables or disables the echo transmission mode. This mode is disabled - by default. + by default. If you are not using distributed BFD then echo mode works + only when the peer is also FRR. It is recommended that the transmission interval of control packets to be increased after enabling echo-mode to reduce bandwidth usage.