Add serial WAN links: a V.35 medium, a clock, and a router that has the ports #1483

Merged
jaylouisw merged 3 commits from feat/serial-links into main 2026-11-12 05:24:56 +00:00
Owner

Add serial WAN links: a V.35 medium, a clock, and a router that has the ports

The engine had 64 media — copper, fibre at nine rates, PON, DAC, DOCSIS, MoCA, DSL, powerline, Wi-Fi, cellular — and no concept of a synchronous serial cable. No device in the catalogue had a serial port either. So the first WAN lab anyone builds in Packet Tracer (two routers back to back, one DCE, clock rate, an IP each, a ping) was impossible rather than merely unmodelled.

The medium. serial-v35 and a serial cage: one cable, no choice of optic, mated only to itself, refused against RJ45 as a connector mismatch. Its rate is clocked, not negotiated, so the speed ladder is the set clock rate can dial (64k–8M), filtered by the port's own maximum like every other cage.

The clock. A serial link has exactly one DCE. Neither end clocked is E_SERIAL_NO_CLOCK; both ends clocked is E_SERIAL_TWO_CLOCKS. Both refuse at cabling time and both name the fix. The link's rate is the clock, not the port's ceiling — a 64 kbps line is 64 kbps. clock rate <bps> is refused on a non-serial port, and refuses a rate the port cannot clock by listing the ones it can.

The hardware. cisco/2811: two onboard 10/100 FastEthernet (not gigabit — the 2811 predates onboard GigabitEthernet, and a lab expecting 1G is describing a 2911) plus a WIC-2T in the first HWIC slot giving Se0/0/0 and Se0/0/1.

Three existing invariants caught this and were right to, which is the part worth reporting:

Invariant What it said Verdict
hardware-invariants "no data port advertises a sub-100 Mbps-only cage" — 2811 at 1.544 Mbps Correct rule, wrong scope: added to slowIsCorrect beside DSL and PON, because a T1 is honestly 1.544 Mbps and flagging it would push a contributor to inflate the one number the spec exists to state
cable-matrix serial × serial had no row Added as mated; the clock refusal is reported as a note, because it is configuration, not physics
bidi-media counted the clock refusal as a lost pairing It is not — the medium is shared, nobody has said who clocks it

84 suites, 4212 assertions, 40 new in test/serial-links.test.js (medium, mating, the 2811's ports, both clock refusals, the CLI's own refusals, and a ping crossing a clocked link). docs/PHYSICAL_LAYER.md gains §2.1; CONNECTORS.md the cage row; CLI.md the command.


Bridged from GitHub PR #1367 by @Jaylouisw — https://github.com/Jaylouisw/packetforge/pull/1367

Add serial WAN links: a V.35 medium, a clock, and a router that has the ports The engine had 64 media — copper, fibre at nine rates, PON, DAC, DOCSIS, MoCA, DSL, powerline, Wi-Fi, cellular — and **no concept of a synchronous serial cable**. No device in the catalogue had a serial port either. So the first WAN lab anyone builds in Packet Tracer (two routers back to back, one DCE, `clock rate`, an IP each, a ping) was impossible rather than merely unmodelled. **The medium.** `serial-v35` and a `serial` cage: one cable, no choice of optic, mated only to itself, refused against RJ45 as a connector mismatch. Its rate is clocked, not negotiated, so the speed ladder is the set `clock rate` can dial (64k–8M), filtered by the port's own maximum like every other cage. **The clock.** A serial link has exactly one DCE. Neither end clocked is `E_SERIAL_NO_CLOCK`; both ends clocked is `E_SERIAL_TWO_CLOCKS`. Both refuse at cabling time and both name the fix. The link's rate is **the clock**, not the port's ceiling — a 64 kbps line is 64 kbps. `clock rate <bps>` is refused on a non-serial port, and refuses a rate the port cannot clock by listing the ones it can. **The hardware.** `cisco/2811`: two onboard 10/100 FastEthernet (**not** gigabit — the 2811 predates onboard GigabitEthernet, and a lab expecting 1G is describing a 2911) plus a WIC-2T in the first HWIC slot giving `Se0/0/0` and `Se0/0/1`. **Three existing invariants caught this and were right to**, which is the part worth reporting: | Invariant | What it said | Verdict | |---|---|---| | `hardware-invariants` | "no data port advertises a sub-100 Mbps-only cage" — 2811 at 1.544 Mbps | Correct rule, wrong scope: added to `slowIsCorrect` beside DSL and PON, because a T1 is **honestly** 1.544 Mbps and flagging it would push a contributor to inflate the one number the spec exists to state | | `cable-matrix` | serial × serial had no row | Added as mated; the clock refusal is reported as a **note**, because it is configuration, not physics | | `bidi-media` | counted the clock refusal as a lost pairing | It is not — the medium is shared, nobody has said who clocks it | 84 suites, 4212 assertions, 40 new in `test/serial-links.test.js` (medium, mating, the 2811's ports, both clock refusals, the CLI's own refusals, and a ping crossing a clocked link). `docs/PHYSICAL_LAYER.md` gains §2.1; `CONNECTORS.md` the cage row; `CLI.md` the command. --- > Bridged from GitHub PR #1367 by @Jaylouisw — https://github.com/Jaylouisw/packetforge/pull/1367
ownsIpOn() answers 'will I serve this address on this interface'. Delivery needs 'do I hold it at all' asked first, and the function conflated them: a frame addressed to an address the device held on ANOTHER interface matched no rule, returned null, and was forwarded - TTL decremented, packet dead. A host could ping its gateway's near-side address and not its far-side one, on the same router, over the same cable. traceroute to a far-side address of the first hop timed out for the same reason.

The fallback now says: nothing above refused it and this is an L3 device, so the address is mine - one stack. The interface-scoped rules still outrank it, which is what keeps WAN/LAN role separation, L2 VLAN isolation and bridge-group membership intact; test/address-ownership.test.js pins all three, and port-roles.test.js already pinned the first.

The second half is the half that would have gone unnoticed: once the router accepted the packet it replied out the interface that OWNS the address - a port with no cable - so it answered and the host still saw silence. The reply now leaves by the port the request arrived on, with the tagged-subinterface case keeping its own sender.

Found by checking the baseline first: near-side ping true, far-side ping false on main. 83 suites, 4152 assertions, 24 new in test/address-ownership.test.js. docs/SIMULATION.md gains 3.1 Address ownership, and the rest of section 3 is renumbered.
Add serial WAN links: a V.35 medium, a clock, and a router that has the ports
Some checks failed
CI / Test (Node 18) (pull_request) Successful in 1m11s
CI / Test (Node 20) (pull_request) Successful in 1m6s
CI / Server smoke test (pull_request) Successful in 26s
CI / Test (Node 22) (pull_request) Successful in 1m4s
CI / Docker build (pull_request) Failing after 10s
CodeQL / Analyze (pull_request) Failing after 6s
CI / Workflow lint (pull_request) Successful in 14s
1dcc1157c1
The engine had 64 media across copper, fibre at nine rates, PON, DAC, DOCSIS, MoCA, DSL, powerline, Wi-Fi and cellular - and no concept of a synchronous serial cable. No device in the catalogue had a serial port either, so the first WAN lab anyone builds in Packet Tracer (two routers back to back, one DCE, clock rate, an IP each, a ping) was impossible rather than merely unmodelled.

serial-v35 is a medium and a cage of its own: one cable, no choice of optic, mated only to itself and refused against RJ45 as a connector mismatch. The rate is clocked, not negotiated, so CAGE_SPEEDS.serial is the set a 'clock rate' command can dial - 64k to 8M - and the ladder is filtered by the port's own maximum like every other cage.

A serial link has exactly one DCE. Neither end clocked is E_SERIAL_NO_CLOCK and both ends clocked is E_SERIAL_TWO_CLOCKS, both raised at cabling time, both naming the fix. The link's rate is the clock rather than the port's ceiling, so a 64 kbps line is 64 kbps. 'clock rate <bps>' is refused on a non-serial port and refuses a rate the port cannot clock, listing what would work.

cisco/2811 is the reference device: two onboard 10/100 FastEthernet (not gigabit - it predates onboard GigabitEthernet) and a WIC-2T in the first HWIC slot giving Se0/0/0 and Se0/0/1.

Three existing invariants caught the change and were right to: hardware-invariants flagged serial as a sub-100 Mbps cage (added to slowIsCorrect beside DSL and PON - a T1 is honestly 1.544 Mbps), the cable matrix had no serial pair (added as mated, with the clock refusal treated as a note because it is configuration, not physics), and bidi-media counted the clock refusal as a lost pairing (it is not - the medium is shared, nobody has said who clocks it). 84 suites, 4212 assertions, 40 new in test/serial-links.test.js.
jaylouisw force-pushed feat/serial-links from 1dcc1157c1
Some checks failed
CI / Test (Node 18) (pull_request) Successful in 1m11s
CI / Test (Node 20) (pull_request) Successful in 1m6s
CI / Server smoke test (pull_request) Successful in 26s
CI / Test (Node 22) (pull_request) Successful in 1m4s
CI / Docker build (pull_request) Failing after 10s
CodeQL / Analyze (pull_request) Failing after 6s
CI / Workflow lint (pull_request) Successful in 14s
to 4f0d2e7062
All checks were successful
CI / Classify the change (pull_request) Successful in 10s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 12s
CI / Test (Node 18) (pull_request) Successful in 3m35s
CI / Test (Node 20) (pull_request) Successful in 3m7s
CI / Server smoke test (pull_request) Successful in 33s
CI / Docker build (pull_request) Successful in 44s
CI / Test (Node 22) (pull_request) Successful in 3m1s
2026-11-12 05:20:08 +00:00
Compare
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-12 05:20:25 +00:00
jaylouisw force-pushed feat/serial-links from 4f0d2e7062
All checks were successful
CI / Classify the change (pull_request) Successful in 10s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 12s
CI / Test (Node 18) (pull_request) Successful in 3m35s
CI / Test (Node 20) (pull_request) Successful in 3m7s
CI / Server smoke test (pull_request) Successful in 33s
CI / Docker build (pull_request) Successful in 44s
CI / Test (Node 22) (pull_request) Successful in 3m1s
to dc6f47f926
All checks were successful
CI / Classify the change (pull_request) Successful in 13s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 18s
CI / Test (Node 18) (pull_request) Successful in 3m20s
CI / Test (Node 20) (pull_request) Successful in 3m4s
CI / Server smoke test (pull_request) Successful in 30s
CI / Docker build (pull_request) Successful in 43s
CI / Test (Node 22) (pull_request) Successful in 2m55s
2026-11-12 05:24:53 +00:00
Compare
Author
Owner

Rebased onto main and landed (ff5c18f1), both commits. Conflicts were all adjacent-insertion, not behavioural: the VRRP ownership block in engine/device.js, the ip address dhcp row in docs/CLI.md, and the media table in engine/media.js where main had grown per-baud console variants while the branch added serial-v35. Resolutions kept both sides and were checked by the branch's own suite:

  • engine/device.js — kept main's VRRP block and the branch's holdsIp() commentary above holdsIp();
  • engine/media.js — kept main's five console-baud media, added only serial-v35 (the branch's older single console-rs232 entry would have collided with the key);
  • docs/CLI.md — kept main's corrected DHCP-client row, added the two clock rate rows;
  • test/hardware-invariants.test.js — union of the slow-is-correct set, both rationales kept in the comment.

The same fossil CodeQL failure as #1484 was present (this branch's base predates dd8b024a, which dropped the GitHub-legacy workflows); the rebase removed it.

Rebasing also put the new 2811 in front of test/doc-catalog-counts.test.js, which requires every count in docs/DEVICE_REGISTRY.md to match the catalogue: 2,038 → 2,039 models, 368 → 369 routers, 48 → 49 Cisco devices. Regenerated with scripts/regen-registry-doc.js rather than hand-edited.

Verified before pushing: full suite 240 suites / 8,944 assertions, 4 failures all from the document counts, fixed; serial-links 40/40, cable-matrix 406, hardware-invariants 26, bidi-media 73, address-ownership 24, doc-catalog-counts 24, syntax 309 files. Post-merge on main: catalogue 2,039 with the 2811 present, serial-links 40/40.

Rebased onto `main` and landed (`ff5c18f1`), both commits. Conflicts were all adjacent-insertion, not behavioural: the VRRP ownership block in `engine/device.js`, the `ip address dhcp` row in `docs/CLI.md`, and the media table in `engine/media.js` where `main` had grown per-baud console variants while the branch added `serial-v35`. Resolutions kept both sides and were checked by the branch's own suite: * `engine/device.js` — kept `main`'s VRRP block and the branch's `holdsIp()` commentary above `holdsIp()`; * `engine/media.js` — kept `main`'s five console-baud media, added only `serial-v35` (the branch's older single `console-rs232` entry would have collided with the key); * `docs/CLI.md` — kept `main`'s corrected DHCP-client row, added the two `clock rate` rows; * `test/hardware-invariants.test.js` — union of the slow-is-correct set, both rationales kept in the comment. The same fossil CodeQL failure as #1484 was present (this branch's base predates `dd8b024a`, which dropped the GitHub-legacy workflows); the rebase removed it. Rebasing also put the new 2811 in front of `test/doc-catalog-counts.test.js`, which requires every count in `docs/DEVICE_REGISTRY.md` to match the catalogue: 2,038 → 2,039 models, 368 → 369 routers, 48 → 49 Cisco devices. Regenerated with `scripts/regen-registry-doc.js` rather than hand-edited. Verified before pushing: full suite 240 suites / 8,944 assertions, 4 failures all from the document counts, fixed; `serial-links` 40/40, `cable-matrix` 406, `hardware-invariants` 26, `bidi-media` 73, `address-ownership` 24, `doc-catalog-counts` 24, syntax 309 files. Post-merge on `main`: catalogue 2,039 with the 2811 present, `serial-links` 40/40.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!1483
No description provided.