From fc24c20e1fc34693db9d4268d123f5616c07eec4 Mon Sep 17 00:00:00 2001 From: sachendras <44847441+sachendras@users.noreply.github.com> Date: Fri, 27 Sep 2024 08:43:15 -0700 Subject: [PATCH 1/3] Update gNOI.bgp.proto Current gNOI.BGP proto lacks guidance on how the ClearBGPNeighborRequest must be handled. As per RFC --- bgp/bgp.proto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bgp/bgp.proto b/bgp/bgp.proto index 1a19702..10c9127 100644 --- a/bgp/bgp.proto +++ b/bgp/bgp.proto @@ -39,7 +39,8 @@ message ClearBGPNeighborRequest { enum Mode { SOFT = 0; // Send route-refresh and reapply policy. SOFTIN = 1; // Re-apply inbound policy on stored Adj-RIB-In. - HARD = 2; // Teardown and restart TCP connection. + HARD = 2; // Teardown, restart TCP connection, Send Cease notification (code 6) with subcode 9 and flush all routes. + GRACEFUL = 4; // Teardown, restart TCP connection, Send Cease notification (code 6) with subcode 4 and dont flush routes. } Mode mode = 3; // Which mode to use for the clear operation. } From 0ee80a1a76d513ca643135d0f298047db7a5aef5 Mon Sep 17 00:00:00 2001 From: sachendras <44847441+sachendras@users.noreply.github.com> Date: Fri, 27 Sep 2024 08:57:29 -0700 Subject: [PATCH 2/3] Update gNOI.bgp.proto Current gNOI.BGP proto lacks guidance on how the ClearBGPNeighborRequest.Hard must be handled. As per RFC4486, code6 subcode 4, ```If a BGP speaker decides to administratively reset the peering with a neighbor, then the speaker SHOULD send a NOTIFICATION message with the Error Code Cease and the Error Subcode "Administrative Reset".``` which basically leaves implementations to make a choice if they should "reset TCP connection" and "Flush all routes OR not Flush all routes". Hence in rfc8538#section-3.2 for GR a new subcode 9 called `HARD RESET` was introduced to clear such ambiguities so the GR process can be handled more predictively. Having said that, the gNOI.ClearBGPNeighborRequest API must also have 2 options for reseting a TCP connection to match the RFC. The `GRACEFUL` option introduced in this pull expects sending subcode 4 and the existing `HARD` option expects sending subcode 9 so the GR behavior can be accurately handled. --- bgp/bgp.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgp/bgp.proto b/bgp/bgp.proto index 10c9127..7e7c3e3 100644 --- a/bgp/bgp.proto +++ b/bgp/bgp.proto @@ -40,7 +40,7 @@ message ClearBGPNeighborRequest { SOFT = 0; // Send route-refresh and reapply policy. SOFTIN = 1; // Re-apply inbound policy on stored Adj-RIB-In. HARD = 2; // Teardown, restart TCP connection, Send Cease notification (code 6) with subcode 9 and flush all routes. - GRACEFUL = 4; // Teardown, restart TCP connection, Send Cease notification (code 6) with subcode 4 and dont flush routes. + GRACEFUL = 4; // Teardown, restart TCP connection, Send Cease notification (code 6) with subcode 4. } Mode mode = 3; // Which mode to use for the clear operation. } From a5ab33f78abe32de5e3c678c4dee7daaf92a05c8 Mon Sep 17 00:00:00 2001 From: sachendras <44847441+sachendras@users.noreply.github.com> Date: Fri, 27 Sep 2024 13:46:33 -0700 Subject: [PATCH 3/3] Update gNOIbgp.proto Update to be more accurate and match the RFC requirements in rfc8538#section-3.1 for subcode9. --- bgp/bgp.proto | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bgp/bgp.proto b/bgp/bgp.proto index 7e7c3e3..8136829 100644 --- a/bgp/bgp.proto +++ b/bgp/bgp.proto @@ -39,7 +39,11 @@ message ClearBGPNeighborRequest { enum Mode { SOFT = 0; // Send route-refresh and reapply policy. SOFTIN = 1; // Re-apply inbound policy on stored Adj-RIB-In. - HARD = 2; // Teardown, restart TCP connection, Send Cease notification (code 6) with subcode 9 and flush all routes. + HARD = 2; // Teardown, restart TCP connection, Send Cease + // notification (code 6) with subcode 4. However, if the "N" bit for + // Graceful-Restart" is set, then encapsulate the original Notification + // message in the data portion of the Subcode 9 message as per + // rfc8538#section-3.1 and also Flush the routes. GRACEFUL = 4; // Teardown, restart TCP connection, Send Cease notification (code 6) with subcode 4. } Mode mode = 3; // Which mode to use for the clear operation.