W_DUPLEX_MISMATCH can never fire, and a forced line rate is not stored anywhere #1259

Closed
opened 2026-11-09 19:41:28 +00:00 by jaylouisw · 0 comments
Owner

What happens

Two things in the engine can describe a link's physical behaviour and neither can be set:

  1. Interface.duplex is 'full' for every port in the catalogue and no command changes it. So
    W_DUPLEX_MISMATCH — a warning docs/CONNECTORS.md publishes in its code table — is unreachable. Only
    test/ can trigger it, by passing duplexA/duplexB directly to validateLink.
  2. There is no speed command. speed 100 is refused as unrecognised, and a port that has been forced
    to 100 Mb/s goes on describing itself as 1G: nothing stores it, show running-config prints nothing,
    show interfaces prints nothing, and the link keeps running at its auto-negotiated rate.

show interfaces also never reports the rate or the duplex at all, which is the first thing you look at when
a link is up but slow.

Expected

  • speed auto | <mbps> and duplex auto | full | half in interface config, refused when the port cannot do
    the rate — naming the port, the rate, and what it does support;
  • the forced rate actually governs the link: it narrows what negotiation has to offer, so the cable's rate,
    its serialisation delay and its warnings all follow; show interfaces reports (forced) vs (auto), and
    the rate the link negotiated when that differs;
  • W_DUPLEX_MISMATCH becomes reachable once one end can be set to half against a full-duplex peer;
  • two ends forced to rates with nothing in common do not silently "work": no common rate means the link does
    not come up, and it says so;
  • show running-config prints what was set, and the config still replays byte-identically;
  • a device that sets neither behaves exactly as it did — the catalogue ships no forced rate and no half
    duplex.

Found while doing it

Topology.revalidateFor(linkId) assumed the caller's A side was link.a. Re-checking a cable from the other
end handed the validator its own port as "the peer", which came back as two E_PORT_IN_USE errors — a cable
that plainly exists looking like a second cable in the same socket.

Scope

Existing interface-config mechanism, existing validator, existing printer. No new commands beyond the two
standard ones whose rules were already modelled.

## What happens Two things in the engine can describe a link's physical behaviour and neither can be set: 1. **`Interface.duplex` is `'full'` for every port in the catalogue and no command changes it.** So `W_DUPLEX_MISMATCH` — a warning `docs/CONNECTORS.md` publishes in its code table — is unreachable. Only `test/` can trigger it, by passing `duplexA`/`duplexB` directly to `validateLink`. 2. **There is no `speed` command.** `speed 100` is refused as unrecognised, and a port that has been forced to 100 Mb/s goes on describing itself as 1G: nothing stores it, `show running-config` prints nothing, `show interfaces` prints nothing, and the link keeps running at its auto-negotiated rate. `show interfaces` also never reports the rate or the duplex at all, which is the first thing you look at when a link is up but slow. ## Expected * `speed auto | <mbps>` and `duplex auto | full | half` in interface config, refused when the port cannot do the rate — naming the port, the rate, and what it *does* support; * the forced rate actually governs the link: it narrows what negotiation has to offer, so the cable's rate, its serialisation delay and its warnings all follow; `show interfaces` reports `(forced)` vs `(auto)`, and the rate the link negotiated when that differs; * **`W_DUPLEX_MISMATCH` becomes reachable** once one end can be set to half against a full-duplex peer; * two ends forced to rates with nothing in common do not silently "work": no common rate means the link does not come up, and it says so; * `show running-config` prints what was set, and the config still replays byte-identically; * a device that sets neither behaves exactly as it did — the catalogue ships no forced rate and no half duplex. ## Found while doing it `Topology.revalidateFor(linkId)` assumed the caller's A side was `link.a`. Re-checking a cable from the other end handed the validator its own port as "the peer", which came back as two `E_PORT_IN_USE` errors — a cable that plainly exists looking like a second cable in the same socket. ## Scope Existing interface-config mechanism, existing validator, existing printer. No new commands beyond the two standard ones whose rules were already modelled.
Sign in to join this conversation.
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#1259
No description provided.