The Age column is a number, and an old neighbour is not a neighbour (#1397) #1398
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!1398
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/arp-ageing"
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?
The Age column is a number, and an old neighbour is not a neighbour. Fixes #1397.
show arpprintedAge (min)as a header over a hard-coded-on every row, and said why in the code and indocs/CLI.md: "the simulator counts steps, not minutes". That stopped being true when convergence gave the model aninstant in milliseconds — and that instant already ages the MAC table (#1395).
What changed
Device.learnArp(ip, mac, port, atMs)stamps when the neighbour was heard. The instant lives in a parallelarpSeenAtmap, soarpstays address → MAC for every reader and fixture that has ever written one.Device.arpLookup(ip, nowMs)— the aged reader, and the egress path uses it: a stale entry resolves tonothing, so the frame is ARP'd for instead of being sent to a neighbour that has moved.
Device.ageArps(nowMs)— one sweep, dropping the address, the port and the instant together.show arpprints minutes since the neighbour was heard, and rows leave when they age out.-now meansnothing dated this entry — which is exactly what a fixture or an imported lab produces — and such an entry is
never aged, because inventing an age for it would be worse than saying nothing.
Documentation corrected while there
docs/SIMULATION.mdstill said "nothing ages it: no MAC ageing timer, no ARP timeout" (wrong since #1395 as well)and listed ARP cache ageing under Absent. The MAC row there now states the age and the forwarding rule, the ARP
row moved to Modelled, and the LLDP note no longer claims the model has no clock to age a neighbour with.
Evidence
test/arp-ageing.test.js— 31 checks: the age in minutes at two instants, the row gone at 6 h with the address,the port and the lookup all cleared, a reply re-learning it (and a cache hit not refreshing the age), the data plane
ARPing again instead of using a stale neighbour — measured in the same ping's event list, before and after: cache
hits and no ARP frames while fresh, no cache hits and ARP frames once aged, and the ping still succeeding because
ARP answers — undated entries never ageing, and a sweep that drops only what aged.
Reverting
engine/cli.jsfails 6;engine/simulator.jsfails 8;engine/device.jsstops the suite at thefirst ping (
arpLookupis gone).test/runtime-agreement.test.jsreads the new row shape (null, printed as-).Suite: 201 suites, 7,730 assertions, 0 failed. Syntax: 269 files, OK.