Skip to content

Commit

Permalink
Add new OSPF attributes to the validation schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ipspace committed Dec 15, 2024
1 parent b65ae98 commit 3067d6c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 27 deletions.
4 changes: 2 additions & 2 deletions docs/module/ospf.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ OSPF is also supported on these [routing daemons](platform-daemons):
| ------------------------ |:--:|:--:|:--:|:--:|:--:|
| BIRD ||||||

(ospf-interface)=
(ospf-interface-support)=
The following table documents the interface-level OSPF features:

| Operating system | Cost | Network<br />type | Unnumbered<br />IPv4 interfaces | Passive<br />interfaces |
Expand Down Expand Up @@ -167,7 +167,7 @@ You can specify most node parameters as global values (top-level topology elemen

## VRF Parameters

* You can specify the default area for a VRF OSPF instance with VRF-level **ospf.area** parameter
* You can use most OSPF node parameters (for example, **area**, **digest**, **password**, or **timers**) in VRF definitions to change the VRF OSPF instance configuration.
* By default, _netlab_ redistributes BGP- and connected routes into VRF OSPF instances on all network devices. You can change that on devices supporting configurable route import with the **[ospf.import](routing_import)** VRF parameter.
* You can change the [router ID](routing_router_id) of a VRF OSPF instance with **ospf.router_id** parameter. Use this parameter when building back-to-back links between VRFs on the same node.
* Set **ospf.active** to *True* to force a VRF to use OSPF even when no routers are attached to the VRF interfaces.
Expand Down
65 changes: 41 additions & 24 deletions netsim/modules/ospf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,20 @@ attributes:
ipv4: bool
ipv6: bool
area: { type: ipv4, use: id }
passive: bool
process: { type: int, min_value: 1 }
reference_bandwidth: { type: int, min_value: 1 }
bfd:
ipv4: bool
ipv6: bool
strict: bool # Support RFC9355
strict_delay: { type: int, min_value: 0, max_value: 600 } # optional delay in seconds
_alt_types: [ bool ]
passive: bool
process: { type: int, min_value: 1 }
reference_bandwidth: { type: int, min_value: 1 }

node:
af:
area:
passive:
process:
reference_bandwidth:
bfd:
router_id: { type: ipv4, use: id }
import: _r_import
default:
_alt_types: [ bool ]
type: dict
Expand All @@ -38,34 +34,55 @@ attributes:
policy: id
cost: int
type: { type: str, valid_values: [ e1, e2 ] }
digest: { type: dict }
import: _r_import
passive:
password: str
process:
reference_bandwidth:
router_id: { type: ipv4, use: id }
timers:
hello: { type: int, min_value: 1, max_value: 65535 }
dead: { type: int, min_value: 3, max_value: 65535 }

node_copy: [ area, passive, digest, password, timers ]

node_copy: [ area, passive ]
vrf_aware: [ area ]
vrf_copy: [ area, router_id, reference_bandwidth ]
vrf:
active: bool
router_id: { type: ipv4, use: id }
area: { copy: global }
import: _r_import
default:
_alt_types: [ bool ]
type: dict
_keys: # Use 'keys' to make 'type' a valid attribute
always: bool
policy: id
cost: int
type: { type: str, valid_values: [ e1, e2 ] }
default: { copy: node }
digest: { copy: node }
passive: bool
password: { copy: node }
router_id: { copy: node }
timers: { copy: node }

link:
cost: { type: int, min_value: 1, max_value: 65534 }
area: { type: ipv4, use: id }
area: { copy: global }
bfd: bool
passive: bool
cost: { type: int, min_value: 1, max_value: 65534 }
digest: { copy: node }
network_type: { type: str, valid_values: [ point-to-point, point-to-multipoint, broadcast, non-broadcast ] }
passive: bool
password: { copy: node }
timers: { copy: node }

intf_to_neighbor: False
interface:
priority: { type: int, min_value: 0, max_value: 255 }

features:
unnumbered: Can run OSPFv2 over unnumbered IPv4 interfaces
strict_bfd: Supports strict BFD mode (RFC 9355)
import: Import routes from other routing protocols
default: Originate external default route
digest: MD5 authentication
import: Import routes from other routing protocols
password: Cleartext authentication
priority: Router priority
strict_bfd: Supports strict BFD mode (RFC 9355)
timers: Supports OSPF interface timers
unnumbered: Can run OSPFv2 over unnumbered IPv4 interfaces

warnings:
inactive: True
2 changes: 1 addition & 1 deletion tests/errors/link-invalid-attr.log
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ IncorrectAttr in links: links[1] uses an attribute from module bgp which is not
IncorrectAttr in links: Invalid interface attribute 'wtf' found in links[1].r1
... use 'netlab show attributes interface' to display valid attributes
IncorrectAttr in ospf: Invalid ospf interface attribute 'process' found in links[1].r1.ospf
... use 'netlab show attributes --module ospf' to display valid attributes
... use 'netlab show attributes --module ospf interface' to display valid attributes
IncorrectAttr in links: links[1].r2 uses an attribute from module bgp which is not enabled in nodes.r2
IncorrectAttr in links: links[1].r3 uses an attribute from module ospf which is not enabled in nodes.r3
IncorrectAttr in links: Invalid interface attribute 'prefix' found in links[1].r3
Expand Down

0 comments on commit 3067d6c

Please sign in to comment.