Repository navigation
Add support for ospf auto cost configuration #1693
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
17e52f6
confd: add OSPF auto-cost reference bandwidth
saba8814 2052260
statd: report OSPF auto-cost reference bandwidth
saba8814 58576c8
test: add OSPF auto-cost reference bandwidth test
saba8814 7b5c82a
doc: describe OSPF auto-cost reference bandwidth
saba8814 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ MODULES=( | |
| "[email protected]" | ||
| "[email protected]" | ||
| "[email protected]" | ||
| "[email protected] -e bfd -e explicit-router-id -e hybrid-interface" | ||
| "[email protected] -e auto-cost -e bfd -e explicit-router-id -e hybrid-interface" | ||
| "[email protected]" | ||
| "[email protected]" | ||
| "[email protected]" | ||
|
|
@@ -31,7 +31,7 @@ MODULES=( | |
| "[email protected]" | ||
| "[email protected]" | ||
| "[email protected]" | ||
| "infix-routing@2026-09-28.yang" | ||
| "infix-routing@2026-10-07.yang" | ||
| "[email protected]" | ||
| "[email protected]" | ||
| "[email protected]" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,12 +26,19 @@ module infix-routing { | |
| contact "[email protected]"; | ||
| description "Deviations and augments for ietf-routing, ietf-ospf, and ietf-rip."; | ||
|
|
||
| revision 2026-10-07 { | ||
| description "Add OSPF auto-cost reference-bandwidth, for OSPFv2 and | ||
| OSPFv3. The default 100000 Mbit/s matches the value | ||
| previously used, and auto-cost can not be disabled."; | ||
| reference "internal"; | ||
| } | ||
|
|
||
| revision 2026-09-28 { | ||
| description "Add ospf, rip, and bfd features, where ospf covers OSPFv2 | ||
| and OSPFv3, and rip covers RIPv2 and RIPng. A build without | ||
| FRR leaves them off, so only static routes can be configured | ||
| and the device advertises exactly what it supports."; | ||
| reference "Issue #1670"; | ||
| reference "internal"; | ||
| } | ||
|
|
||
| revision 2026-07-22 { | ||
|
|
@@ -67,19 +74,19 @@ module infix-routing { | |
| Allows displaying which area a route was learned from, | ||
| how long neighbors have been up, their DR/BDR role, and | ||
| the interface with local address."; | ||
| reference "Issue #1190"; | ||
| reference "internal"; | ||
| } | ||
|
|
||
| revision 2025-11-11 { | ||
| description "Add BFD IP single-hop support (RFC 9127). | ||
| Deviate session-statistics (not implemented yet)."; | ||
| reference "RFC 9127, Issue #1190"; | ||
| reference "RFC 9127"; | ||
| } | ||
| revision 2025-11-10 { | ||
| description "Add must constraint to prevent backbone area as stub/NSSA. | ||
| Enable OSPF operational data for CLI: un-deviate priority, | ||
| hello-timer, wait-timer, route metric and route-tag fields."; | ||
| reference "RFC 2328, RFC 3101, Issue #1190"; | ||
| reference "RFC 2328, RFC 3101"; | ||
| } | ||
| revision 2024-11-27 { | ||
| description "Deviate address-family in OSPF"; | ||
|
|
@@ -423,8 +430,21 @@ module infix-routing { | |
| } | ||
| } | ||
|
|
||
| deviation "/rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/ospf:ospf/ospf:auto-cost" { | ||
| deviate not-supported; | ||
| /* The reference bandwidth must be the same on all routers in the OSPF | ||
| domain. Frr always derives the interface cost from it, unless a cost | ||
| is set on the interface, so auto-cost can not be disabled. */ | ||
| deviation "/rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/ospf:ospf/ospf:auto-cost/ospf:enabled" { | ||
| deviate add { | ||
| default "true"; | ||
| must ". = 'true'" { | ||
| error-message "Disabling OSPF auto-cost is not supported."; | ||
| } | ||
| } | ||
| } | ||
| deviation "/rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/ospf:ospf/ospf:auto-cost/ospf:reference-bandwidth" { | ||
| deviate add { | ||
| default "100000"; | ||
| } | ||
|
saba8814 marked this conversation as resolved.
|
||
| } | ||
| deviation "/rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/ospf:ospf/ospf:database" { | ||
| deviate not-supported; | ||
|
|
||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| include::ospfv2.adoc[] | ||
|
|
||
| <<< | ||
|
|
||
| include::ospfv3.adoc[] | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| === OSPFv2 Auto-Cost Reference Bandwidth | ||
|
|
||
| ifdef::topdoc[:imagesdir: {topdoc}../../test/case/routing/ospf_auto_cost] | ||
|
|
||
| ==== Description | ||
|
|
||
| Verifies that the OSPFv2 interface cost follows the configured auto-cost | ||
| reference bandwidth. The reference bandwidth must be the same on all | ||
| routers in an OSPF domain, so it is changed on both R1 and R2. | ||
|
|
||
| The cost of an interface is the reference bandwidth divided by the link | ||
| speed, with 1 as the lowest cost. A link of unknown speed, e.g., a virtual | ||
| link, counts as 10000 Mbit/s. On a 1 Gbit/s link the cost is: | ||
|
|
||
| |=== | ||
| | Reference bandwidth | Cost | ||
| | 100000 Mbit/s (default) | 100 | ||
| | 10000 Mbit/s | 10 | ||
| | 1000 Mbit/s | 1 | ||
| |=== | ||
|
|
||
| The test reads the link speed on each router to calculate the expected | ||
| cost, and reads the reference bandwidth back from the operational | ||
| datastore. | ||
|
|
||
| ==== Topology | ||
|
|
||
| image::topology.svg[OSPFv2 Auto-Cost Reference Bandwidth topology, align=center, scaledwidth=75%] | ||
|
|
||
| ==== Sequence | ||
|
|
||
| . Set up topology and attach to target DUTs | ||
| . Configure OSPFv2 on R1 and R2 | ||
| . Wait for OSPFv2 adjacency between R1 and R2 | ||
| . Verify default reference bandwidth 100000 Mbit/s and link cost | ||
| . Set reference bandwidth 10000 Mbit/s on R1 and R2 | ||
| . Verify reference bandwidth 10000 Mbit/s and link cost | ||
| . Set reference bandwidth 1000 Mbit/s on R1 and R2 | ||
| . Verify reference bandwidth 1000 Mbit/s and link cost | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| test.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| === OSPFv3 Auto-Cost Reference Bandwidth | ||
|
|
||
| ifdef::topdoc[:imagesdir: {topdoc}../../test/case/routing/ospf_auto_cost] | ||
|
|
||
| ==== Description | ||
|
|
||
| Verifies that the OSPFv3 interface cost follows the configured auto-cost | ||
| reference bandwidth. The reference bandwidth must be the same on all | ||
| routers in an OSPF domain, so it is changed on both R1 and R2. | ||
|
|
||
| The cost of an interface is the reference bandwidth divided by the link | ||
| speed, with 1 as the lowest cost. A link of unknown speed, e.g., a virtual | ||
| link, counts as 10000 Mbit/s. On a 1 Gbit/s link the cost is: | ||
|
|
||
| |=== | ||
| | Reference bandwidth | Cost | ||
| | 100000 Mbit/s (default) | 100 | ||
| | 10000 Mbit/s | 10 | ||
| | 1000 Mbit/s | 1 | ||
| |=== | ||
|
|
||
| The test reads the link speed on each router to calculate the expected | ||
| cost, and reads the reference bandwidth back from the operational | ||
| datastore. | ||
|
|
||
| ==== Topology | ||
|
|
||
| image::topology.svg[OSPFv3 Auto-Cost Reference Bandwidth topology, align=center, scaledwidth=75%] | ||
|
|
||
| ==== Sequence | ||
|
|
||
| . Set up topology and attach to target DUTs | ||
| . Configure OSPFv3 on R1 and R2 | ||
| . Wait for OSPFv3 adjacency between R1 and R2 | ||
| . Verify default reference bandwidth 100000 Mbit/s and link cost | ||
| . Set reference bandwidth 10000 Mbit/s on R1 and R2 | ||
| . Verify reference bandwidth 10000 Mbit/s and link cost | ||
| . Set reference bandwidth 1000 Mbit/s on R1 and R2 | ||
| . Verify reference bandwidth 1000 Mbit/s and link cost | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| test.py |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.