Media and rate must agree: 100BASE-FX exists, and no port is uncablable at its own speed #9
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!9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/media-rate-consistency"
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?
Two holes in the same seam: the media a cage offers versus the rate a port declares.
Supersedes the closed #1474 / #1496 — the FX fix in the first commit never reached
main(mediaById('100base-fx')still returnednullthere), and the second commit's invariant cannot pass without it, so they belong in one change.1. 100BASE-FX had no medium, and 100M links were called GPON
Both SC cages offered the id
100base-fxand noMEDIAentry by that name existed. Every PON port in the catalogue (111 devices) advertised a medium the engine could not describe, and the one device that needs it — the Allied Telesis AT-MC102XL's 100M sc-upc port — could not be cabled to anything.preferredMedia()takes the rate the link will run at. The media list is the connector's whole repertoire, and the old rule preferred the fastest candidate — so two 100M converters were labelledGPON (SC/UPC)while negotiating at 100 Mbps. The rate bound picks 100BASE-FX, falling back to the full list when nothing fits.test/cage-media-resolves.test.jsasserts every id any cage offers, at every rate band, resolves — 2 offenders before, 0 after.2. Twenty-two wired ports could not be cabled at their own rate
Asking the catalogue a question nothing had asked before — for every wired port, is there a medium whose rate it can actually run? — produced 22 failures out of 13,723:
Cisco NCS 2006, 18 ports. Ten-gigabit client ports declared in QSFP+ cages. A QSFP+ cage is a 40G cage (40GBASE-SR4/LR4, 40G DAC), so a 10G port in one has no medium at all. Cisco's NCS 2000 ten-port client cards are SFP+ based; QSFP+ appears on that platform only where 4x10G/40G aggregation is offered. Now SFP+ at 10G, and the test proves one cables to an ordinary SFP+ port at 10 Gbps. The 100G ports keep QSFP28.
Ubiquiti ES-12F, 4 ports. Ports 9–12 declared 100M only. Ubiquiti's figures are (8) 100/1000 Mbps SFP (1–8) and (4) 1000 Mbps SFP (9–12) — the catalogue had it inverted, and 100M-only SFP ports have no 100M medium. Now 1G, keeping 100/1000 behaviour on 1–8.
Why nothing caught it: the port-type audit asks whether a port contradicts its type; this is a port contradicting its own rate.
test/wired-port-has-media.test.jsnow runs that comparison over all 13,723 wired ports and pins both devices so they cannot regress.85 suites, 4,243 assertions, all passing on this branch. Cable matrix unchanged: 171 pairs, 0 verdict divergences.
Both SC cages offered the id '100base-fx' and there was no MEDIA entry with that name, so mediaById('100base-fx') returned null. Every PON port in the catalogue advertised a medium the engine could not describe, and the one device that needs it - the Allied Telesis AT-MC102XL's sc-upc port at 100M - had no medium to be cabled with at all. A media id was written into a cage list in one place and the media itself was never added in another, and nothing compared the two. Three parts: 1. 100BASE-FX is declared: 100 Mbps, 1310 nm, multimode, 2 km, SC/UPC. Declared as sc-upc rather than for both polished SC cages because the ferrule is UPC - an SC/APC PON port cannot mate with it, so that cage no longer offers it. The same reasoning removes 1000BASE-LX from the APC cage. 2. preferredMedia() takes the rate the link will run at. The media list is the connector's whole repertoire, and the old rule preferred the fastest candidate - so two 100M media converters facing each other were labelled 'GPON (SC/UPC)' while negotiated at 100 Mbps. The rate bound picks 100BASE-FX instead, and falls back to the full list rather than refusing to name a link when nothing fits. 3. test/cage-media-resolves.test.js asserts the general invariant that was missing: every id any cage offers, at every rate band the catalogue uses, must resolve in MEDIA. It found exactly two offenders before the fix and none after. It also pins the specific hardware (two AT-MC102XLs cable at 100 Mbps over 100BASE-FX, a real OLT's PON port offers no unresolvable media and no 100BASE-FX) and that nothing else about the SC/UPC cage changed. 84 suites, 4228 assertions. Cable matrix unchanged: every cage pair keeps its verdict.