From: wumu.zsl Date: Wed, 5 Feb 2025 02:18:23 +0000 (+0000) Subject: doc: fix sbfd.rst doc warnings X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=6c45ec39299463123ce101129f1a5036408a9037;p=mirror%2Ffrr.git doc: fix sbfd.rst doc warnings Signed-off-by: wumu.zsl --- diff --git a/doc/developer/sbfd.rst b/doc/developer/sbfd.rst index 7bbd2428dd..66a3b48dba 100644 --- a/doc/developer/sbfd.rst +++ b/doc/developer/sbfd.rst @@ -27,7 +27,7 @@ SBFD takes the same data packet format as BFD, but with a much simpler state mac According to RFC7880, SBFD has a stateless SBFDReflector and a stateful SBFDInitiator with the state machine as below: :: - + +--+ ADMIN DOWN, | | TIMER | V @@ -78,6 +78,7 @@ A bfd-name is always associated with a TE path, for example if we use the sbfd s Meanwhile bfdd will notify the sbfd status to the Pathd, we should add the bfd-name field in PTM bfd notify message ZEBRA_BFD_DEST_REPLAY: :: + * Message format: * - header: command, vrf * - l: interface index @@ -113,6 +114,7 @@ According to RFC7881, SBFD Control packet dst port should be 7784, src port can :: + UDP(sport=4784, dport=7784)/BFD() or UDP(sport=3784, dport=7784)/BFD() if "multihop" is specified for sbfd initiator we choose the 4784 as the source port, so the reflected packet will take 4784 as the dst port, this is a local BFD_MULTI_HOP_PORT so the reflected packet can be handled by the existing bfd_recv_cb function. @@ -122,6 +124,7 @@ if "multihop" is not specified for sbfd initiator we choose the 3784 as the sour For echo SBFD with SRv6 encapsulation case, we re-use the BFD Echo port, the UDP ports in packet are set as: :: + UDP(sport=3785, dport=3785)/BFD() diff --git a/doc/user/sbfd.rst b/doc/user/sbfd.rst index 390d82a6c0..d26bffe07b 100644 --- a/doc/user/sbfd.rst +++ b/doc/user/sbfd.rst @@ -27,7 +27,7 @@ SBFD takes the same data packet format as BFD, but with a much simpler state mac According to RFC7880, SBFD has a stateless SBFDReflector and a stateful SBFDInitiator with the state machine as below: :: - + +--+ ADMIN DOWN, | | TIMER | V @@ -73,24 +73,28 @@ In the following example, we set up a sbfd session to monitor the path A-B-D (al A is the SBFDInitiator, and D is the SBFDReflector, A will trasmit the SBFD packet to B as the format: :: + IPv6(src="200::A", dst="100::B", nh=43)/IPv6ExtHdrSegmentRouting(addresses=["100::D"], nh=41, segleft=1)/IPv6(src="200::A", dst="200::D")/UDP(dport=7784)/BFD(my_dis=123, your_disc=456, state=UP) Upon receiving the packet, B will take the Srv6 End action since the dst ip 100::B is the End address, B will the shift the dst address according to Srv6 spec, then trasmit the SBFD packet to D as the format: :: + IPv6(src="200::A", dst="100::D", nh=41)/IPv6(src="200::A", dst="200::D")/UDP(dport=7784)/BFD(my_dis=123, your_disc=456, state=UP) After D receive the packet, It will decap the outer IPv6 header since the dst ip 100::D is the End address, the decapped packet is: :: + IPv6(src="200::A", dst="200::D")/UDP(dport=7784)/BFD(my_dis=123, your_disc=456, state=UP) This packet will be routed to kernel stack of D since its dst is 200::D. Then the SBFDReflector service on D will get the packet and Reflect it. The response packet will be: :: + IPv6(src="200::D", dst="200::A")/UDP(sport=7784)/BFD(my_dis=456, your_disc=123, state=UP) @@ -132,18 +136,21 @@ For example, we use Echo SBFD session to protect Srv6 path: A-B-D A is also the SBFDInitiator, and B, C, D is Srv6 ready nodes, A will trasmit the SBFD packet to B as the format: :: + IPv6(src="200::A", dst="100::B", nh=43)/IPv6ExtHdrSegmentRouting(addresses=["100::D"], nh=41, segleft=1)/IPv6(src="200::A", dst="200::A")/UDP(dport=3785)/BFD(my_dis=123, your_disc=123, state=UP) Upon receiving the packet, B will take the Srv6 End action since the dst ip 100::B is the End address, B will the shift the dst address according to Srv6 spec, then trasmit the SBFD packet to D as the format: :: + IPv6(src="200::A", dst="100::D", nh=41)/IPv6(src="200::A", dst="200::A")/UDP(dport=3785)/BFD(my_dis=123, your_disc=123, state=UP) After D receive the packet, It will decap the outer IPv6 header since the dst ip 100::D is the End address, the decapped packet is: :: + IPv6(src="200::A", dst="200::A")/UDP(dport=3785)/BFD(my_dis=123, your_disc=123, state=UP) @@ -181,6 +188,7 @@ We can also configure a SBFD Initiator-Reflector session based on simple IPv6/IP A is the SBFDInitiator, and D is the SBFDReflector, A will trasmit the SBFD packet to B or C as the format: :: + IPv6(src="200::A", dst="200::D")/UDP(dport=7784)/BFD(my_dis=123, your_disc=456, state=UP) @@ -189,6 +197,7 @@ Upon receiving the packet, B/C will route the packet to D according to the dst i After D receive the packet, packet will be sent to kernel stack of D since its dst is 200::D. Then the SBFDReflector service on D will get the packet and reflect it. The response packet will be: :: + IPv6(src="200::D", dst="200::A")/UDP(sport=7784)/BFD(my_dis=456, your_disc=123, state=UP) @@ -226,6 +235,7 @@ This command will show all the BFD and SBFD sessions in the bfdd: :: + BFD Peers: peer 200::D bfd-mode sbfd-init bfd-name a-d multihop local-address 200::A vrf default remote-discr 456 ID: 1421669725 @@ -254,6 +264,7 @@ This command will show all the BFD and SBFD session packet counters: .. clicmd:: show bfd peers counters :: + BFD Peers: peer 200::A bfd-mode sbfd-echo bfd-name a-b-d local-address 200::A vrf default srv6-source-ipv6 200::A srv6-encap-data 100::B 100::D Control packet input: 0 packets @@ -281,6 +292,7 @@ we also implemented a new show command to display BFD sessions with a bfd-name, .. clicmd:: show bfd bfd-name a-b-d :: + BFD Peers: peer 200::A bfd-mode sbfd-echo bfd-name a-b-d local-address 200::A vrf default srv6-source-ipv6 200::A srv6-encap-data 100::B 100::D ID: 123