Skip to content
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

T5916: Added segment routing check for index size and SRGB size #2780

Merged
merged 1 commit into from Jan 10, 2024

Conversation

Cheeze-It
Copy link
Contributor

@Cheeze-It Cheeze-It commented Jan 10, 2024

Change Summary

We are adding a check to make sure that the segment routing global base and
the index base do not have a size mismatch. Originally one could configure a
larger index size than segment routing global base size. This is a small check to
prevent that type of configuration in the future.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

No

Component(s) name

isis, ospf

Proposed changes

What we are basically adding here is a check to first gather the segment routing
global block and to basically calculate how large it is in size. This is done by checking
the maximum and minimum values and doing just a simple subtraction. Then we do
a check for each prefix that is configured inside of segment routing in IS-IS and OSPF
to make sure that if an index is configured that the size is smaller than the segment
routing global base size.

How to test

Baseline configs are:

set protocols isis interface lo
set protocols isis net '49.0001.1921.6825.5000.00'
set protocols isis segment-routing global-block high-label-value '600'
set protocols isis segment-routing global-block low-label-value '500'
set protocols isis segment-routing prefix 192.168.255.0/32 index value '50'
set protocols ospf interface lo area '0'
set protocols ospf segment-routing global-block high-label-value '600'
set protocols ospf segment-routing global-block low-label-value '500'
set protocols ospf segment-routing prefix 192.168.255.0/32 index value '50'

If one reduces the size of the IS-IS SRGB or OSPF SRGB to below the size of
the index size, we get the following error for both protocols:

vyos@vyos:~$ configure
[edit]
vyos@vyos# set protocols isis segment-routing global-block high-label-value '525'
[edit]
vyos@vyos# set protocols ospf segment-routing global-block high-label-value '525'
[edit]
vyos@vyos# commit

Segment routing prefix 192.168.255.0/32 cannot have an index base size
larger than the SRGB label base.

[[protocols isis]] failed

Segment routing prefix 192.168.255.0/32 cannot have an index base size
larger than the SRGB label base.

[[protocols ospf]] failed
Commit failed

Individually they work too:

vyos@vyos# set protocols isis segment-routing global-block high-label-value '545'
[edit]
vyos@vyos# commit

Segment routing prefix 192.168.255.0/32 cannot have an index base size
larger than the SRGB label base.

[[protocols isis]] failed
Commit failed
[edit]
vyos@vyos# discard

  Changes have been discarded

[edit]
vyos@vyos# set protocols ospf segment-routing global-block high-label-value '510'
[edit]
vyos@vyos# commit

Segment routing prefix 192.168.255.0/32 cannot have an index base size
larger than the SRGB label base.

[[protocols ospf]] failed
Commit failed
[edit]
vyos@vyos# discard

  Changes have been discarded

[edit]
vyos@vyos# exit

Smoketest result

I didn't include a smoketest because the smoketest is not needed in this case.
The smoketest we do already configures the values correctly.

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team January 10, 2024 01:29
@c-po c-po merged commit 8523cfb into vyos:current Jan 10, 2024
8 checks passed
@c-po
Copy link
Member

c-po commented Jan 10, 2024

@Mergifyio backport sagitta

Copy link

mergify bot commented Jan 10, 2024

backport sagitta

✅ Backports have been created

@c-po
Copy link
Member

c-po commented Jan 10, 2024

@Mergifyio backport sagitta

Copy link

mergify bot commented Jan 10, 2024

backport sagitta

✅ Backports have been created

c-po added a commit that referenced this pull request Jan 10, 2024
T5916: Added segment routing check for index size and SRGB size (backport #2780)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants