serial: clock rate takes the box's menu, not the port's link ladder #2127
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!2127
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "rev/1119-0912"
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?
Question. On a Cisco serial port, is the set of rates
clock rateaccepts the set of rates the line can run at — so a 1.544 Mbps port refusesclock rate 9600— or the parser's own menu?Verdict: the parser's menu. A serial port's
clock rate ?prints the standard rates (1200 … 4000000) and, under them,<300-4000000> Choose clockrate from list above; any integer in that range is accepted, and one that is not on the menu is rounded to the nearest rate the hardware supports, with the command reference's line%Clockrate rounded to nearest value that your hardware can support.The rounded rate — not the typed one — is whatshow running-configthen holds.PacketForge built its acceptable set from the port's link-speed ladder (a 2811 offered six rates) and refused 9600, 19200, 38400, 72000, 125000, 128000, 148000, 250000, 500000, 800000 and 1000000, every one of which the box's own menu prints.
test/serial-links.test.jshad pinned that defect (/% 9600 bps is not a rate/) — the suite had been written from the same wrong rule.Changed
engine/cli.js:SERIAL_CLOCK_RATES(the vendor's menu, cited at the constant) unioned with the rates the port declares, cut to the port's top rate. On the menu → stored as typed. Inside 300 … top but not on the menu → stored at the nearest menu rate and the console prints the vendor's sentence verbatim. Below 300 or above the top → refused with the range quoted (300-<top> bps).test/serial-clock-menu.test.js(new, 77 checks) andtest/serial-links.test.js§5 flipped to the vendor's behaviour.docs/CLI.md,docs/PHYSICAL_LAYER.md§2.1,research/serial-clock-menu.md(sources: IOS Interface & Hardware Component Command Referenceclock rate; a 2501clock rate ?capture; Troubleshooting Serial Lines; the 4-port serial SPA guide; the serial interface card guide and HWIC-2T datasheet).Still open (recorded, not guessed): the top of the range on a 2811. The model declares its Se ports at
1.544M(a T1 line rate); the WIC-2T card is 2.048 Mbps per port and the HWIC-2T 8 Mbps per port, so a real card's menu would include 2000000/4000000. Which card the model should declare is device data, not a parser rule, so it is untouched.Tests:
node scripts/syntax-check.jsOK (447 files);npm test— 368 suites, 12,545 assertions, 0 failed.clock ratetakes the box's menu, not the port's link ladder (#2126)