A saved serial link came back unclocked, and the port block said it ran at 0Mb/s #1487
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1487
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 symptom
Serial WAN links landed yesterday with a rule enforced at cabling time: exactly one end of a V.35 pair supplies the clock, and a link with none — or with two — is refused. Save that lab and reopen it:
The cable now refuses a link that was working when the file was written.
And the port block was lying about the same line, twice:
0Mb/sfor a link that answers a ping is worse than no number: a reader concludes the line is dead. And nothing anywhere said which end clocks it, so the only fact that makes a serial link work was the one fact no surface showed.show running-confighad noclock rateline either — a command that took effect and left no trace.Measured
formatSpeedMbps()rounded to whole megabits:1.544 → 2M,0.064 → 0M,0.1152 → 0M,0.0096 → 0M.serialize()writes 26 keys per port;clockRateBpswas not among them, andDevice.hydrate()had no branch to read it back.show running-configprintedspeedandduplexfor a forced port and nothing for a clocked one.This is the fifth time the save path has dropped a per-port fact —
spec(#1459), DHCP leases (#1465), LLDP neighbours (#1467),speedMbps/maxRangeM(#1405, #1321) — and the shape is identical every time: a fact added to the live object, the serializer left alone, and no test that round-trips that field.What changed
if (i.clockRateBps) doc.clockRateBps = i.clockRateBps;— written only when set, the same rulespeedMbps/natRole/maxRangeMfollow, so an ordinary board does not grow aclockRateBps: nullline on every port in a 2,039-model catalogue.Device.hydrate()restores it, refusing a document that says"fast",-64000, and rounding64000.7the way the command does.clock rate 64000in the interface block, typed-only like everything else in running-config — so a backup of a WAN lab restores a clocked link rather than an invalid one.speed: 1.544Mb/s (auto), link runs at 64Kb/s, DCE, clock rate 64000, duplex: full.64K,115.2K,9.6K— and fractions are kept above it (1.544M,2.5G). Fixing the formatter fixes it everywhere it is used:speedrefusals, the validator's messages, and every port block.Evidence
test/serial-clock-survives-save.test.js— 32 checks, 32 passed / 0 failed; with the fix stashed, 14 failed, printing the old strings (speed: 2Mb/s (auto), link runs at 0Mb/s,1.544 -> 2M (wanted 1.544M)).It asserts the document carries the clock on the clocked port and no key at all on the DTE port or an ethernet port; a reopened lab keeps the clock, the 64 kbps line rate, a clean validation and a working ping; a document with the field stripped is exactly as invalid as the bug made it (
E_SERIAL_NO_CLOCK);no clock rateclears both config and document;show interfacesprints the rated speed, the line rate,DCE, clock rate 64000on the DCE only, and never0Mb/s; ten rates across five units; three hand-edited-document cases; and the document is byte-identical after one, two and three load/save cycles.Docs:
docs/PHYSICAL_LAYER.md§2.1 gains a table of the three places the clock now lives and the before/after of each;docs/ARCHITECTURE.mdgains "The fifth field the save path dropped, and the rate that said zero".Merging the two feature PRs yesterday also moved four citations out of tolerance (
_help(),openFlow(),_deliver()+ a duplicate) — they now point at the definitions themselves, andcheck:citationsis back to its single documented false positive.Full suite: 242 suites, 9,019 assertions, 0 failed. Syntax 311 files.
Landed as #1488 (
f4b2c0d1). Post-merge onmain:serial-clock-survives-save32/32,serial-links40/40 (the feature's own suite, unchanged),speed-duplex55/55 (the settings the new formatter touches), tree clean,check:citationsback to its one documented false positive.The two bugs shared a cause worth naming: the engine enforced a rule (exactly one clocked end) that neither the save nor the console could see. The cable refused a link that had been working when the file was written — and the port block reported that same link as running at
0Mb/s. Both are now facts a reader can check.Correction to the comment above: the merge commit is
d1be7d21, not the hash I wrote there — I typed it from the branch tip instead of reading it back from the merge.git log --oneline -1onmainnow:d1be7d21 The serial clock was invisible to the save, the config and the port block (#1488).spanning-tree portfast,vlan 20 name labanddo show vlaneach answered a different question #1493