Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement SBFD #17336

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

implement SBFD #17336

wants to merge 24 commits into from

Conversation

forrestchu
Copy link

implementing the SBFD feature (RFC7880, RFC7881) in FRR.

What is the motivation for this PR?
The PhoenixWing project aims to implement SRv6 features into the SONiC community. In PhoenixWing traffic engineering case, we use SBFD to protect SRv6 TE paths.

How did you do it?
SBFD HLD in SoNiC community: sonic-net/SONiC#1766

use SBFD to protect TE path, two types of configs are supported:

  1. SBFD echo mode, which mainly used in Our SRv6 TE case. Only need to config at local side:
    configure terminal->
    bfd ->
    peer X::X bfd-mode sbfd-echo bfd-name name local-address X::X encap-type SRv6 encap-data X::X source-ipv6 X::X
  2. SBFD initiator and reflector mode, Need to config at local side and remote side:
    2.1) local config:
    configure terminal->
    bfd ->
    peer X::X bfd-mode sbfd-init bfd-name name local-address X::X encap-type SRv6 encap-data X::X source-ipv6 X::X remote-discr 12345
    2.2) remote config:
    configure terminal ->
    bfd ->
    sbfd reflector source-address X::X discriminator 12345

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good ... I think we need a topo test for this, though

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be broken into multiple commits, and this also needs a topo test.

@donaldsharp
Copy link
Member

a) This needs to be broken up into multiple commits. 4k lines to review is impossible. Break it down into small logical bits of work, this will never be reviewed otherwise
b) Actually take the time and write a topotest to show that this works.
c) The commit message is utterly useless and will help no-one in the future understand what is going on. This needs to be addressed
d) There is no documentation. This must be added as well.

Without some major changes this is dead in the water.

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@riw777
Copy link
Member

riw777 commented Dec 3, 2024

Looks like the docs are in, but we still need a topo test ...

@forrestchu
Copy link
Author

Looks like the docs are in, but we still need a topo test ...

Yes Russ White, Thanks for reviewing the code. The topo test in ongoing, I will update the PR later.

@forrestchu
Copy link
Author

Hello, @riw777 @donaldsharp greetings :)
The Docs and topotests are added. For the topotests, there are 3 scenarios to use SBFD according to the document:

  1. SBFD with SRv6 encapsulation
  2. echo SBFD with SRv6 encapsulation
  3. normal SBFD with no SRv6 encapsulation

Currently only scenario-3 is topo-tested. Since for scenario-1 and scenario-2, they depend on the PR(#16894) to implement the SRv6 locator Functions.
I will raise another topotest PR for scenario-1 and scenario-2 once the PR #16894 is merged.

Thanks & Regards.

@frrbot frrbot bot added the bfd label Jan 7, 2025
@frrbot frrbot bot added documentation tests Topotests, make check, etc labels Jan 7, 2025
@forrestchu forrestchu force-pushed the sbfd branch 6 times, most recently from 5e0b3d4 to 95d9081 Compare January 7, 2025 09:02
lib/bfd.c Outdated Show resolved Hide resolved
bfdd/bfd_packet.c Outdated Show resolved Hide resolved
bfdd/bfd_packet.c Outdated Show resolved Hide resolved
@pguibert6WIND
Copy link
Member

some doc warnings to be fixed too.

/root/frr/doc/user/sbfd.rst:204: WARNING: duplicate clicmd description of sbfd reflector source-address 200::D discriminator 456, other instance in sbfd
/root/frr/doc/user/sbfd.rst:239: ERROR: Unexpected indentation.
/root/frr/doc/user/sbfd.rst:244: WARNING: Block quote ends without a blank line; unexpected unindent.
/root/frr/doc/user/sbfd.rst:293: ERROR: Unexpected indentation.
/root/frr/doc/user/sbfd.rst:298: WARNING: Block quote ends without a blank line; unexpected unindent.
/root/frr/doc/user/sbfd.rst: WARNING: document isn't included in any toctree

doc/user/sbfd.rst Outdated Show resolved Hide resolved
@forrestchu forrestchu force-pushed the sbfd branch 4 times, most recently from f6abb02 to 7b31f00 Compare January 15, 2025 13:25
bfdd/bfdd_cli.c Outdated Show resolved Hide resolved
yang/frr-bfdd.yang Outdated Show resolved Hide resolved
zebra/zebra_ptm.h Outdated Show resolved Hide resolved
@pguibert6WIND
Copy link
Member

pguibert6WIND commented Jan 16, 2025

summary of remarks:

  • BD_SBFD_DETECT_FAILED value is a standard value or a value arbitrarily chose for implementing a proprietary SBFD ? see IANA values, clarify what needs to be done
  • common non SBFD specific changes should be done in a separate commits: this is the case of many control values added originally in the pull request
  • no SRTE code should be present at this point (hooks, define to add bfd in srte)
  • yang should be the most clear possible: this is why yang is implemented instead of vtysh: leaf-list instead of string, more description and wisely chosen variable names (the most generic possible).
  • should internal API be ready to offer multiple SID in segment-list.
  • CI passes

@forrestchu forrestchu force-pushed the sbfd branch 4 times, most recently from b5e5a92 to f80b6f5 Compare January 20, 2025 05:48
main changes:
  1)optimize sbfd cmd line, encap-data supports ipv6 address list validated with yang, add multihop option
  2)redesign function get_ip_by_interface
  3)leaf name changes for yang file and fix some yang errors
  4)delete unused code and macros
  5)Fix some typos

Signed-off-by: wumu.zsl <[email protected]>
@pguibert6WIND
Copy link
Member

If I reset all the commits for this branch, I can see that zebra_ptm.h file is modified, whereas it should not:

root@ubuntu2204hwe:~/frr# git reset HEAD~24
--- a/zebra/zebra_ptm.h
+++ b/zebra/zebra_ptm.h
@@ -48,13 +48,13 @@ struct zebra_ptm_cb {
 #define ZEBRA_IF_PTM_ENABLE_ON     1
 #define ZEBRA_IF_PTM_ENABLE_UNSPEC 2
 
-#define IS_BFD_ENABLED_PROTOCOL(protocol)                                      \
-       ((protocol) == ZEBRA_ROUTE_BGP || (protocol) == ZEBRA_ROUTE_OSPF ||    \
-        (protocol) == ZEBRA_ROUTE_OSPF6 || (protocol) == ZEBRA_ROUTE_ISIS ||  \
-        (protocol) == ZEBRA_ROUTE_PIM ||                                      \
-        (protocol) == ZEBRA_ROUTE_OPENFABRIC ||                               \
+#define IS_BFD_ENABLED_PROTOCOL(protocol)                                                          \
+       ((protocol) == ZEBRA_ROUTE_BGP || (protocol) == ZEBRA_ROUTE_OSPF ||                        \
+        (protocol) == ZEBRA_ROUTE_OSPF6 || (protocol) == ZEBRA_ROUTE_ISIS ||                      \
+        (protocol) == ZEBRA_ROUTE_PIM || (protocol) == ZEBRA_ROUTE_OPENFABRIC ||                  \
         (protocol) == ZEBRA_ROUTE_STATIC || (protocol) == ZEBRA_ROUTE_RIP)
 
+

One of the last changes you should do is rework all the changes you made and split in consistent commits.

dnl ----------------------
dnl checking for IPV6_HDRINCL
dnl ----------------------
AC_MSG_CHECKING([for IPV6_HDRINCL])
Copy link
Member

@pguibert6WIND pguibert6WIND Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this block really needed ?
I don't see HAVE_IPV6_HDRINCL in the code, so I think is not needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bfd documentation master rebase PR needs rebase size/XXL tests Topotests, make check, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants