-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
add more bgp config schema and add increment config #2355
base: master
Are you sure you want to change the base?
add more bgp config schema and add increment config #2355
Conversation
The transition of taking FRR as the default routing stack probably will be done in sonic March release of next year, will it make sense to support FRR too? Or even take FRR support as the priority? |
ae1355b
to
3efab1b
Compare
I will have a look at this, and report here. |
I think @zhenggen-xu @rodnymolina @nikos-github have been handling FRR related work, probably they could answer your questions better. |
@batmancn Simon, as you may know, most of the SONiC<->FRR integration work has been already done over the last couple of years. You can easily build an FRR-based sonic image by simply changing the ROUTE_STACK knob present in rules/config file. At this point only minor items are pending, such as double-checking that the existing Quagga jinja templates are fully compliant with FRR (which they mostly are), and update SONiC's testing framework to deal with potential CLI differences between Quagga and FRR. I agree with @jipanyang suggestion of extending your PR to FRR's routing-stack. |
The "extending your PR to FRR's routing-stack" is also I need to do in my environment, I will have a look at this. I will pay attention on discuss/design spec/proposal/... of QUAGGA<->FRR. And I will search these, it's thankful if someone tell these to me. |
@batmancn Please take a look at this PR for some details about the FRR support: #2099 High level the reason we want to move to FRR is that it has a more active community, and has the features we need on SONiC roadmap etc. If you can extend the template to FRR, that would be great. Ansible framework changes were also upstreamed to sonic-mgmt repo. The default stack is quagga on github but internally we have done the ansible tests without any problem at the time the PR was submitted. |
OK, thank you. The last, you mean testcase of mgmt repo is worked on FRR, that's great. |
I have added frr increment config feature by moving these code to sonic-frr, refer to this commit "ac574f86" on branch "bgp_config_schema_enhance_and_increment_config". These code has been tested by the same way described in 1st conversation "Test cases" section, by "frr_test.sh" script. |
…x-kernel] advance submodule head linkmgrd: * ab5b2c1 2022-09-02 | Fix mux config (sonic-net#128) (HEAD -> 202205, github/202205) [Longxiang Lyu] utilities: * 7de9305 2022-09-07 | [generate dump]Added error message when saisdkdump fails (sonic-net#2356) (HEAD -> 202205, github/202205) [Sudharsan Dhamal Gopalarathnam] * c5b0a6d 2022-09-07 | [counterpoll]Fixing counterpoll show for tunnel and acl stats (sonic-net#2355) [Sudharsan Dhamal Gopalarathnam] * 1452b44 2022-09-05 | [GCU] Fix missing backend in dry run (sonic-net#2347) [jingwenxie] * bc7b845 2022-09-04 | Add Password Hardening CLI support (sonic-net#2338) [davidpil2002] * 55e8948 2022-09-06 | [fast-reboot]Avoid stopping masked services during fast-reboot (sonic-net#2335) [Sudharsan Dhamal Gopalarathnam] * f7d69d4 2022-08-30 | Replace cmp in acl_loader with operator.eq (sonic-net#2328) [Zhaohui Sun] * 4054ebb 2022-09-05 | Add verification for override (sonic-net#2305) [jingwenxie] * 729d811 2022-05-30 | Fix sonic-installer and 'show version' command crash when database docker not running issue. (sonic-net#2183) [Hua Liu] platform-daemons: * 36ba7c0 2022-09-07 | [ycable] cleanup logic for creating grpc future ready (sonic-net#289) (HEAD -> 202205) [vdahiya12] * 2a9db73 2022-09-01 | [ycabled] fix insert events from xcvrd;cleanup some mux toggle logic (sonic-net#287) [vdahiya12] platform-common: * d7c990d 2022-09-03 | [CMIS] 'get_transceiver_info' should return 'None' when CMIS cable EEPROM is not ready (sonic-net#305) (HEAD -> 202205) [Kebo Liu] linux-kernel: * 25ea052 2022-08-31 | [patch]: Add accpt_untracked_na kernel param (sonic-net#292) (HEAD -> 202205) [Lawrence Lee] Signed-off-by: Ying Xie <[email protected]>
…x-kernel] advance submodule head (#12025) linkmgrd: * ab5b2c1 2022-09-02 | Fix mux config (#128) (HEAD -> 202205, github/202205) [Longxiang Lyu] utilities: * 7de9305 2022-09-07 | [generate dump]Added error message when saisdkdump fails (#2356) (HEAD -> 202205, github/202205) [Sudharsan Dhamal Gopalarathnam] * c5b0a6d 2022-09-07 | [counterpoll]Fixing counterpoll show for tunnel and acl stats (#2355) [Sudharsan Dhamal Gopalarathnam] * 1452b44 2022-09-05 | [GCU] Fix missing backend in dry run (#2347) [jingwenxie] * bc7b845 2022-09-04 | Add Password Hardening CLI support (#2338) [davidpil2002] * 55e8948 2022-09-06 | [fast-reboot]Avoid stopping masked services during fast-reboot (#2335) [Sudharsan Dhamal Gopalarathnam] * f7d69d4 2022-08-30 | Replace cmp in acl_loader with operator.eq (#2328) [Zhaohui Sun] * 4054ebb 2022-09-05 | Add verification for override (#2305) [jingwenxie] * 729d811 2022-05-30 | Fix sonic-installer and 'show version' command crash when database docker not running issue. (#2183) [Hua Liu] platform-daemons: * 36ba7c0 2022-09-07 | [ycable] cleanup logic for creating grpc future ready (#289) (HEAD -> 202205) [vdahiya12] * 2a9db73 2022-09-01 | [ycabled] fix insert events from xcvrd;cleanup some mux toggle logic (#287) [vdahiya12] platform-common: * d7c990d 2022-09-03 | [CMIS] 'get_transceiver_info' should return 'None' when CMIS cable EEPROM is not ready (#305) (HEAD -> 202205) [Kebo Liu] linux-kernel: * 25ea052 2022-08-31 | [patch]: Add accpt_untracked_na kernel param (#292) (HEAD -> 202205) [Lawrence Lee] Signed-off-by: Ying Xie <[email protected]> Signed-off-by: Ying Xie <[email protected]>
Update sonic-utilities submodule pointer to include the following: * 4d377a6 [subinterface]Added additional checks in portchannel and subinterface commands ([sonic-net#2345](sonic-net/sonic-utilities#2345)) * bbcdf2e disk_check: Publish event for RO state ([sonic-net#2320](sonic-net/sonic-utilities#2320)) * 3fd537b Support the bandit check by GitHub Action ([sonic-net#2358](sonic-net/sonic-utilities#2358)) * 491d3d3 [generate dump]Added error message when saisdkdump fails ([sonic-net#2356](sonic-net/sonic-utilities#2356)) * 6830e01 [counterpoll]Fixing counterpoll show for tunnel and acl stats ([sonic-net#2355](sonic-net/sonic-utilities#2355)) * 3be2ad7 [fast-reboot]Avoid stopping masked services during fast-reboot ([sonic-net#2335](sonic-net/sonic-utilities#2335)) * 0e1b0cf [GCU] Fix missing backend in dry run ([sonic-net#2347](sonic-net/sonic-utilities#2347)) * 676c31b Add verification for override ([sonic-net#2305](sonic-net/sonic-utilities#2305)) * 48997c2 Add Password Hardening CLI support ([sonic-net#2338](sonic-net/sonic-utilities#2338)) * 414e239 update unit tests for swap ([#locato](https://github.com/Azure/sonic-utilities/pull/locato)) * a91a492 consider swap checking memory in ([#stalle](https://github.com/Azure/sonic-utilities/pull/stalle)) * f0ce586 [route_check]: Ignore standalone tunnel routes ([sonic-net#2325](sonic-net/sonic-utilities#2325)) Signed-off-by: dgsudharsan <[email protected]>
Update sonic-utilities submodule pointer to include the following: * 0a7557b [minigraph] add option to specify golden path in load_minigraph ([sonic-net#2350](sonic-net/sonic-utilities#2350)) * 322aefc [GCU]Remove GCU unique lane check for duplicate lanes platforms ([sonic-net#2343](sonic-net/sonic-utilities#2343)) * 7099fff [fastboot] fastboot enhancement: Use warm-boot infrastructure for fast-boot ([sonic-net#2286](sonic-net/sonic-utilities#2286)) * 09026ed [warm-reboot] fix warm-reboot when /tmp/cache is missing ([sonic-net#2367](sonic-net/sonic-utilities#2367)) * a3c404c Fix typo in platform_sfputil_helper.is_rj45_port ([sonic-net#2374](sonic-net/sonic-utilities#2374)) * 637d834 Vnet_route_check Vxlan tunnel route update. ([sonic-net#2281](sonic-net/sonic-utilities#2281)) * 29a3e51 Added support for tunnel route status in show vnet routes all. ([sonic-net#2341](sonic-net/sonic-utilities#2341)) * 1ac584b Use 'default' VRF when VRF name is not provided ([sonic-net#2368](sonic-net/sonic-utilities#2368)) * 4d377a6 [subinterface]Added additional checks in portchannel and subinterface commands ([sonic-net#2345](sonic-net/sonic-utilities#2345)) * bbcdf2e disk_check: Publish event for RO state ([sonic-net#2320](sonic-net/sonic-utilities#2320)) * 3fd537b Support the bandit check by GitHub Action ([sonic-net#2358](sonic-net/sonic-utilities#2358)) * 491d3d3 [generate dump]Added error message when saisdkdump fails ([sonic-net#2356](sonic-net/sonic-utilities#2356)) * 6830e01 [counterpoll]Fixing counterpoll show for tunnel and acl stats ([sonic-net#2355](sonic-net/sonic-utilities#2355)) * 3be2ad7 [fast-reboot]Avoid stopping masked services during fast-reboot ([sonic-net#2335](sonic-net/sonic-utilities#2335)) * 0e1b0cf [GCU] Fix missing backend in dry run ([sonic-net#2347](sonic-net/sonic-utilities#2347)) * 676c31b Add verification for override ([sonic-net#2305](sonic-net/sonic-utilities#2305)) * 48997c2 Add Password Hardening CLI support ([sonic-net#2338](sonic-net/sonic-utilities#2338)) * 414e239 update unit tests for swap ([#locato](https://github.com/sonic-net/sonic-utilities/pull/locato)) * a91a492 consider swap checking memory in ([#stalle](https://github.com/sonic-net/sonic-utilities/pull/stalle)) * f0ce586 [route_check]: Ignore standalone tunnel routes ([sonic-net#2325](sonic-net/sonic-utilities#2325)) Signed-off-by: dprital <[email protected]>
0a7557bd9 [minigraph] add option to specify golden path in load_minigraph (#2350) 322aefc37 [GCU]Remove GCU unique lane check for duplicate lanes platforms (#2343) 7099fffa7 [fastboot] fastboot enhancement: Use warm-boot infrastructure for fast-boot (#2286) 09026edbb [warm-reboot] fix warm-reboot when /tmp/cache is missing (#2367) a3c404c74 Fix typo in platform_sfputil_helper.is_rj45_port (#2374) 637d834ce Vnet_route_check Vxlan tunnel route update. (#2281) 29a3e5180 Added support for tunnel route status in show vnet routes all. (#2341) 1ac584bb3 Use 'default' VRF when VRF name is not provided (#2368) 4d377a620 [subinterface]Added additional checks in portchannel and subinterface commands (#2345) bbcdf2ed7 disk_check: Publish event for RO state (#2320) 3fd537b0a Support the bandit check by GitHub Action (#2358) 491d3d380 [generate dump]Added error message when saisdkdump fails (#2356) 6830e01ec [counterpoll]Fixing counterpoll show for tunnel and acl stats (#2355) 3be2ad7de [fast-reboot]Avoid stopping masked services during fast-reboot (#2335) 0e1b0cf20 [GCU] Fix missing backend in dry run (#2347) 676c31bd0 Add verification for override (#2305) 48997c266 Add Password Hardening CLI support (#2338) 414e239ea update unit tests for swap allocator a91a4922f consider swap checking memory in installer f0ce58635 [route_check]: Ignore standalone tunnel routes (#2325)
Related work items: sonic-net#2151, sonic-net#2194, sonic-net#2224, sonic-net#2237, sonic-net#2264, sonic-net#2281, sonic-net#2286, sonic-net#2297, sonic-net#2299, sonic-net#2305, sonic-net#2325, sonic-net#2335, sonic-net#2338, sonic-net#2341, sonic-net#2343, sonic-net#2347, sonic-net#2350, sonic-net#2355, sonic-net#2356, sonic-net#2358, sonic-net#2360, sonic-net#2363, sonic-net#2367, sonic-net#2368, sonic-net#2370, sonic-net#2374, sonic-net#2392, sonic-net#2398, sonic-net#2408, sonic-net#2414, sonic-net#2415, sonic-net#2419, sonic-net#2421, sonic-net#2422, sonic-net#2423, sonic-net#2426, sonic-net#2427, sonic-net#2430, sonic-net#2431, sonic-net#2433, sonic-net#2434, sonic-net#2436, sonic-net#2437, sonic-net#2441, sonic-net#2444, sonic-net#2445, sonic-net#2446, sonic-net#2456, sonic-net#2458, sonic-net#2460, sonic-net#2461, sonic-net#2463, sonic-net#2472, sonic-net#2475, sonic-net#11877, sonic-net#12024, sonic-net#12065, sonic-net#12097, sonic-net#12130, sonic-net#12209, sonic-net#12217, sonic-net#12244, sonic-net#12251, sonic-net#12255, sonic-net#12276, sonic-net#12284
0a7557bd9 [minigraph] add option to specify golden path in load_minigraph (sonic-net#2350) 322aefc37 [GCU]Remove GCU unique lane check for duplicate lanes platforms (sonic-net#2343) 7099fffa7 [fastboot] fastboot enhancement: Use warm-boot infrastructure for fast-boot (sonic-net#2286) 09026edbb [warm-reboot] fix warm-reboot when /tmp/cache is missing (sonic-net#2367) a3c404c74 Fix typo in platform_sfputil_helper.is_rj45_port (sonic-net#2374) 637d834ce Vnet_route_check Vxlan tunnel route update. (sonic-net#2281) 29a3e5180 Added support for tunnel route status in show vnet routes all. (sonic-net#2341) 1ac584bb3 Use 'default' VRF when VRF name is not provided (sonic-net#2368) 4d377a620 [subinterface]Added additional checks in portchannel and subinterface commands (sonic-net#2345) bbcdf2ed7 disk_check: Publish event for RO state (sonic-net#2320) 3fd537b0a Support the bandit check by GitHub Action (sonic-net#2358) 491d3d380 [generate dump]Added error message when saisdkdump fails (sonic-net#2356) 6830e01ec [counterpoll]Fixing counterpoll show for tunnel and acl stats (sonic-net#2355) 3be2ad7de [fast-reboot]Avoid stopping masked services during fast-reboot (sonic-net#2335) 0e1b0cf20 [GCU] Fix missing backend in dry run (sonic-net#2347) 676c31bd0 Add verification for override (sonic-net#2305) 48997c266 Add Password Hardening CLI support (sonic-net#2338) 414e239ea update unit tests for swap allocator a91a4922f consider swap checking memory in installer f0ce58635 [route_check]: Ignore standalone tunnel routes (sonic-net#2325)
** What I did **
Now BGP config shema have some limitation: only support BGP asn and BGP neighbor and its increment config.
To use SONiC in more scenes
I create or add more schema into BGP config like these:
BGP_PEER_RANGE, VLAN_INTERFACE, INTERFACE, LOOPBACK_INTERFACE, BGP_METADATA, STATIC_ROUTE, BGP_AS_SET, BGP_COMMUNITY_SET, BGP_POLICY_ROUTE_MAP, BGP_PREFIX_SET, IP_ACCESS_LIST.
I add increment config method associate with schemas above.
I add retain route feature into config file of quagga.
I add "del" opcode for handler function in bgpcfgd, which could verify "add" or "del" of config converted from CONFIG DB of redis, refer to: add opcode for notification of redis DB sonic-py-swsssdk#42
** Detail of these shema **
Most of these schema bellow support increment config.
All of increment config support add/delete.
Some of increment config support update, like static route.
BGP asn(this is original repo code):
{
"DEVICE_METADATA": {
"localhost": {
"bgp_asn": "5001"
}
}
}
BGP neighbor:
{
"BGP_NEIGHBOR": {
"192.168.1.10": {
"admin_status": "up",
"asn": "5001",
"name": "test",
"local_addr": "192.168.1.20",
"policy_in": "BGP_POLICY_NAME_1|BGP_POLICY_NAME_2|BGP_POLICY_NAME_3|BGP_POLICY_NAME_4",
"policy_out": "BGP_POLICY_NAME_1|BGP_POLICY_NAME_2",
"policy_import": "BGP_POLICY_NAME_1|BGP_POLICY_NAME_2|BGP_POLICY_NAME_3|BGP_POLICY_NAME_4",
"policy_export": "BGP_POLICY_NAME_1|BGP_POLICY_NAME_2",
"remote_as": "20",
"description": "DESCRIPTION",
"password": "PASSWORD",
"ebgp_multihop": "64",
"maximum_paths": "64",
"prefix_in": "BGP_PREFIX_SET_NAME_1|BGP_PREFIX_SET_NAME_2",
"prefix_out": "BGP_PREFIX_SET_NAME_1|BGP_PREFIX_SET_NAME_2"
}
}
}
Add BGP policy, remote as, password, eBGP multihop, maximun path, prefix list config.
Detail of these config is bellow.
{
"VLAN": {
"Vlan3998": {
"vlanid": "3998"
}
},
"LOOPBACK_INTERFACE": {
"Loopback1|10.18.0.32/32": {}
},
"VLAN_INTERFACE": {
"Vlan3998|100.8.1.2/24": {}
}
}
Add L3 interface IP to advertise in BGP using network command in quagga.
Add "del" opcode to verify add or delete operate, refer to: sonic-net/sonic-py-swsssdk#42
static route, redistribute:
STATIC_ROUTE: {
"dst_ip:1.1.1.1/24|nexthop:1.1.1.2": {
"metric": "30"
}
},
BGP_METADATA: {
"localhost": {
"redistribute": "static"
}
}
BGP neighbor peer group:
{
"BGP_NEIGHBOR": {
BGP_NEIGHBOR_PEER_GROUP_NAME: {
"admin_status": "up",
"asn": "5002",
"name": "peergroup1",
"local_addr": "192.168.1.20"
},
"12.12.12.12": {
"peer_group": BGP_NEIGHBOR_PEER_GROUP_NAME
}
}
}
ip as-path access-list:
{
"BGP_AS_SET": {
"as_path_1": {
"description": "as_path_1",
"action": "permit",
"line": "^3356$ _65101$"
}
}
}
ip community-list:
{
"BGP_COMMUNITY_SET": {
"community_1" : {
"description": "community_1",
"line": "7675:70 7675:80 7675:60",
"action": "deny"
}
}
}
ip prefix-list:
{
"BGP_PREFIX_SET": {
"0.0.0.0/0|CU_IN|deny": {
"description": "CU_IN",
"compare": "le",
"length": "32",
"seq": "5"
}
}
}
route-map:
{
"BGP_POLICY_ROUTE_MAP": {
"bgp_policy_1|deny|20": {
"description": "I am description",
"match_as_path": "as_path_1",
"set_as_path": "1"
},
"bgp_policy_1|deny|21": {
"match_prefix_list": "ipv6|match_prefix_list_ipv6_name",
"set_metric": "10"
},
"bgp_policy_1|deny|22": {
"match_prefix_list": "ipv6|match_prefix_list_ipv6_name",
"set_community": "4567:10"
},
"bgp_policy_1|deny|23": {
"match_prefix_list": "ipv6|match_prefix_list_ipv6_name",
"set_local_preference": "10"
},
"bgp_policy_1|deny|24": {
"match_prefix_list": "ipv6|match_prefix_list_ipv6_name",
"set_ip_next_hop": "127.0.0.1"
}
}
}
access-list:
{
"IP_ACCESS_LIST": {
"filter|deny 1.2.1.2/24 exact-match": {},
"filter|permit 2.1.2.1/24": {},
"filter|remark 2424:24 3232:32": {}
}
}
}
graceful-restart:
{
"BGP_METADATA": {
"localhost": {
"graceful_restart_param": "restart-time 120|stalepath-time 360"
}
}
}
this is for user define gr capacity, not support increment config.
{
"BGP_METADATA": {
"localhost": {
"maximum_paths": "30"
}
}
}
this is for user define maximum, not support increment config.
** Test cases **
I add test json file here: https://github.com/batmancn/sonic-buildimage/tree/testcase_of_bgp_config_schema_enhance_and_increment_config/dockers/docker-fpm-quagga/unit_test
You could test functions above by
bash bgp_test.sh
orfrr_test.sh
.** issues **