-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
bgpd:support of color extended community color-only types #17231
base: master
Are you sure you want to change the base?
bgpd:support of color extended community color-only types #17231
Conversation
Add support of color extended community color-only types, RFC 9256. The type only support 00 01 10. configuration example: ! frr version 10.3-dev-my-manual-build frr defaults traditional hostname router3 ! route-map color permit 1 set extcommunity color 10:100 01:200 00:300 exit ! vrf Vrf1 exit-vrf ! interface lo ipv6 address 3::3/128 exit ! router bgp 3 bgp router-id 3.3.3.3 bgp log-neighbor-changes no bgp ebgp-requires-policy no bgp default ipv4-unicast bgp bestpath as-path multipath-relax timers bgp 10 30 neighbor 100.13.13.1 remote-as 1 neighbor 100.13.13.1 advertisement-interval 0 neighbor 100.23.23.2 remote-as 2 neighbor 100.23.23.2 advertisement-interval 0 neighbor 1000:3000::1 remote-as 1 neighbor 1000:3000::1 ebgp-multihop neighbor 1000:3000::1 update-source 1000:3000::3 neighbor 1000:3000::1 capability extended-nexthop neighbor 2000:3000::2 remote-as 2 neighbor 2000:3000::2 ebgp-multihop neighbor 2000:3000::2 update-source 2000:3000::3 neighbor 2000:3000::2 capability extended-nexthop ! address-family ipv4 unicast neighbor 100.13.13.1 activate neighbor 100.23.23.2 activate exit-address-family ! address-family ipv6 unicast redistribute connected route-map color neighbor 1000:3000::1 activate neighbor 2000:3000::2 activate exit-address-family exit ! end Signed-off-by: guozhongfeng.gzf <guozhongfeng.gzf@alibaba-inc.com>
Signed-off-by: guozhongfeng.gzf <guozhongfeng.gzf@alibaba-inc.com>
@@ -347,7 +348,7 @@ static inline void encode_color(uint32_t color_id, struct ecommunity_val *eval) | |||
memset(eval, 0, sizeof(*eval)); | |||
eval->val[0] = ECOMMUNITY_ENCODE_OPAQUE; | |||
eval->val[1] = ECOMMUNITY_COLOR; | |||
eval->val[2] = 0x00; | |||
eval->val[2] = (as << 6) & 0xff; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this NEW encoding defined? Could you point to the right RFC (section)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this sectino:8.8.1. Color-Only BGP Destination Steering
This section defines an alternative steering mechanism based only on the Color Extended community.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any paragraph saying about this encoding, or am I blind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mybe the description is not very clear, similar to nokia,huawei,arista,cisco
Arista: https://arista.my.site.com/AristaCommunity/s/article/SR-TE-Policy-With-Null-Endpoint-Color-Only-IP-Steering-Using-CO-Bits-Modification
nokia:https://documentation.nokia.com/acg/23-7-2/books/classic-cli-part-i/c227-bgp-sr-policies.html#ai9j1gjko5__ai9j1gjko7
huawei:https://support.huawei.com/enterprise/en/doc/EDOC1100143014/c38497ba/sr-mpls-te-policy
cisco:https://www.cisco.com/c/en/us/td/docs/iosxr/cisco8000/segment-routing/78x/b-segment-routing-cg-cisco8000-78x/configuring-sr-te-policy.html#concept_lzh_xyn_rkb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, now I see. This is called CO flags.
While this is fine, I find the naming confusing. Why these flags are called as
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please fix the frrbot
and Verify Source
issues.
@@ -347,7 +348,7 @@ static inline void encode_color(uint32_t color_id, struct ecommunity_val *eval) | |||
memset(eval, 0, sizeof(*eval)); | |||
eval->val[0] = ECOMMUNITY_ENCODE_OPAQUE; | |||
eval->val[1] = ECOMMUNITY_COLOR; | |||
eval->val[2] = 0x00; | |||
eval->val[2] = (as << 6) & 0xff; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, now I see. This is called CO flags.
While this is fine, I find the naming confusing. Why these flags are called as
?
uint8_t color_type; | ||
/* get the color type */ | ||
ptr++; | ||
color_type = (*ptr) >> 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the references in the comments about this and where they come from to allow people to find the information faster.
Add support of color extended community color-only types, RFC 9256.
The type only support 00 01 10.
configuration example:
!
frr version 10.3-dev-my-manual-build
frr defaults traditional
hostname router3
!
route-map color permit 1
set extcommunity color 10:100 01:200 00:300
exit
!
vrf Vrf1
exit-vrf
!
interface lo
ipv6 address 3::3/128
exit
!
router bgp 3
bgp router-id 3.3.3.3
bgp log-neighbor-changes
no bgp ebgp-requires-policy
no bgp default ipv4-unicast
bgp bestpath as-path multipath-relax
timers bgp 10 30
neighbor 100.13.13.1 remote-as 1
neighbor 100.13.13.1 advertisement-interval 0
neighbor 100.23.23.2 remote-as 2
neighbor 100.23.23.2 advertisement-interval 0
neighbor 1000:3000::1 remote-as 1
neighbor 1000:3000::1 ebgp-multihop
neighbor 1000:3000::1 update-source 1000:3000::3
neighbor 1000:3000::1 capability extended-nexthop
neighbor 2000:3000::2 remote-as 2
neighbor 2000:3000::2 ebgp-multihop
neighbor 2000:3000::2 update-source 2000:3000::3
neighbor 2000:3000::2 capability extended-nexthop
!
address-family ipv4 unicast
neighbor 100.13.13.1 activate
neighbor 100.23.23.2 activate
exit-address-family
!
address-family ipv6 unicast
redistribute connected route-map color
neighbor 1000:3000::1 activate
neighbor 2000:3000::2 activate
exit-address-family
exit
!
end
router1# show bgp ipv6 unicast 3::3
BGP routing table entry for 3::3/128, version 4
Paths: (1 available, best #1, table default)
Advertised to non peer-group peers:
1000:3000::3 1000:4000::4
3
1000:3000::3 from 1000:3000::3 (3.3.3.3)
(fe80::a8c1:abff:fea8:81f) (used)
Origin incomplete, metric 0, valid, external, best (First path received)
Extended Community: Color:00:300 Color:01:200 Color:10:100
Last update: Thu Oct 24 11:25:35 2024