-
Notifications
You must be signed in to change notification settings - Fork 103
Add BGP dynamic capability support for graceful restart #17
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,7 @@ | |
| /* Standard header for capability TLV */ | ||
| struct capability_header { | ||
| uint8_t code; | ||
| uint8_t length; | ||
| uint8_t length; /* Note, extra one more oct in dynamic capabilities */ | ||
| }; | ||
|
|
||
| /* Generic MP capability data */ | ||
|
|
@@ -35,11 +35,16 @@ struct capability_mp_data { | |
| }; | ||
|
|
||
| struct graceful_restart_af { | ||
| afi_t afi; | ||
| safi_t safi; | ||
| uint16_t afi; | ||
| uint8_t safi; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why ?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to graceful restart RFC 4724 Wrong size is defined in current FRR: This causes failure in compatibility testing with other switches.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But this value is not what is being sent over line inside of the packet. FRR has special code which convert from aft_t, safi_t to a line format
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean the big/small endian convert or something else? Which piece of convert code do you refer to?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we just copy fields from wire directly, without conversion, similar to capability_mp_data. There were multiple problems fixed after the introduction of iana_xxx_t, such as |
||
| uint8_t flag; | ||
| }; | ||
|
|
||
| struct capability_gr { | ||
| uint16_t restart_flag_time; | ||
| struct graceful_restart_af gr[]; | ||
| }; | ||
|
|
||
| /* Capability Code */ | ||
| #define CAPABILITY_CODE_MP 1 /* Multiprotocol Extensions */ | ||
| #define CAPABILITY_CODE_REFRESH 2 /* Route Refresh Capability */ | ||
|
|
||
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.
what 'oct' means here?
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.
FRR implemented the old version of dynamic capability draft, which has only 1 Octect for "length field". This field has been changed in the latest version to 2 Octects. Since the draft hasn't become RFC, and by talking to the authors, they are still trying to finalize the content, hence I didn't change the code, but left some comment there.
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.
Since it's still a draft, what bgp implementations supports it? Why SONiC needs to support it?
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.
Almost all switch vendors with BGP implementation support dynamic capability - Cisco, Juniper, Arista, Huawei...