show interfaces now says what the port threw away, and why (#1257) #1258
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!1258
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/interface-drops"
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?
show interfacesnow says what the port threw away, and whyFixes #1257.
Three silences, not one
The command reported what crossed a port and nothing about what was discarded there, so two datagrams dropped
for want of a route read exactly like a port nothing had ever touched. Underneath that:
dropwith a reason; every reason was thrown away withthe event log.
dropevent at all — it emitsacl-deny, a different type, counted bynothing. The commonest discard of all left the port looking completely idle:
access-list 101 deny icmp any any+ip access-group 101 in+ two denied pings =0of everything.dev.pendingforever: no event, no counter, andpingreportedsuccess: false, reason: null. Ping an address whose port is shut and the simulator said,in effect, "no".
Now
flowLib.countDrop()tallies the device and — when the event named one — the port;dropsFor()reads it;_emit(), the funnel every discard already passes through, so a discard site addedlater is counted by construction rather than by whoever remembers;
_discardReason()is one table of which events mean "this frame was discarded":drop,acl-deny,vlan-drop,nat-drop, and anything carryingdiscard: true.stp-blockis deliberately not in thetable — the same type also fires once per blocked candidate port while a frame is flooding, and counting
each of those would report one lost frame three times — so the frame-level ingress site opts in explicitly;
_sweepPending()runs when the queue empties and reports every packet whose next hop never answered asno ARP reply from <ip>, on the port that asked;pingreports that same sentence as the reply's reason instead ofnull(convergingstill wins);show interfacesprintsN drops (reason xN, …)— reasons longest-first, overflow counted rather thansilently cut, and nothing at all on a clean port — plus discards that never named a port once at the end
as
device-wide …, rather than inventing a port for them.Evidence
test/interface-drops.test.js— 38 checks:counters: not measured;failed ping its reason;
match one for one;
dropped frame;
_dropSummary()reads identically for identical input.Reverting
engine/cli.jsfails 5 of the 38; revertingengine/flow.jsorengine/simulator.jsfails thesuite outright (the API it measures is gone).
docs/CLI.mdgains a "What the port threw away" subsection.Suite: 142 suites, 6,080 assertions, 0 failed.
show interfacesnow says what the port threw away, and why (#1257)W_DUPLEX_MISMATCHcan now fire, and a forced line rate is stored (#1259) #1260