An OSPF adjacency needs a wire, and a route over a dead port says so (#1271) #1272
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1272
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/ospf-link-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
An OSPF adjacency needs a wire, and a route over a dead port says so
Fixes #1271.
The bug
Two routers with OSPF on the shared segment;
r2learnsr1's LAN. Pull the cable:…while a ping to that LAN fails with
no ARP reply from 10.0.0.1. The data plane knew the path was gone; thecontrol plane went on believing it.
computeOspf()collected interfaces that wereenabledand addressed, then formed an adjacency for everytopology link between two such interfaces. A topology link still exists while its state is
down, and nothingasked. Hellos need a wire that can carry them.
BGP had exactly this defect one iteration earlier (#1269); OSPF had no link-state check at all.
A second, wider symptom
show ip routecould not say that any installed route's next hop is unreachable. A static route or aconnected route over a port with no cable read exactly like a working path — which is why this bug was found
by a ping that disagreed with the table.
Now
Device.ifaceStatus(iface, topo)— the ruleshow interfaces,show arp,show mac address-table, the canvas and BGP already share), so a pulledcable, a down link or a shut far port withdraws the route. A learned route is withdrawn, not annotated:
a router does not keep advertising a path it learned over a cable that has been pulled;
show ip routemarks a route whose egress cannot carry a frame —(down: link down),(down: no cable),(administratively down)— on connected and static rows. Those stay listed, because they areconfiguration rather than learned state, but a row that reads as a working path while every packet to
it is dropped is the defect;
_staleNote()'s own words — the helper the ARP and MAC tables already use for the same port —so three tables cannot describe one port three ways;
Evidence
test/ospf-adjacency-link-state.test.js— 20 checks:Oroute and marks nothing;_staleNote()returns for that port, and is what the row prints;Reverting
engine/simulator.jsfails 3;engine/cli.jsfails 4.show-ip-routestill passes its 30 checks,so the legend, distances and gateway line are untouched.
docs/CLI.mdgains "Readingshow ip routewhen a path is not there", including the deliberate differencebetween a learned route (withdrawn) and a configured one (marked).
Suite: 149 suites, 6,285 assertions, 0 failed.