show interfaces reports what has crossed the port (#1251) #1252
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!1252
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/interface-counters"
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 interfacesreports what has crossed the portFixes #1251.
Two defects were stacked underneath the missing lines.
Per device, not per port.
flow.counterFor()keeps{bytesIn, bytesOut, packetsIn, packetsOut}keyedby
devId, so there was no per-port figure to print.Ping was never counted at all. Both counting sites were guarded by
if (frame.l4):An ICMP echo carries
icmp, ARP carriesarp, LLDP carrieslldp— none carryl4. Measured after threeanswered pings on a two-device lab:
counter keys after ping: []. The traffic this simulator exists togenerate was invisible to its own counters.
Now
countPacket()keeps a per-port tally beside the device totals.assumed: transport payload, the echo payload, ARP's 28 bytes, and the TLVs an LLDP frame is made of —
lldp.buildFrame()computes its own payload length, so no counted packet reports zero bytes.show interfacesprints both directions per port. With no simulation run it printscounters: not measured (no simulation run)instead of zeros: "nothing has looked" and "nothing crossed"are different answers.
switch sending an LLDP frame cannot move a connection's byte count; the per-port tally keeps both, and
transportPacketsIn/transportBytesInare what reconcile with the device totals.Evidence
test/interface-counters.test.js— 29 checks:log, not from a byte total, and it is the case that proved "reads zero" was the wrong assertion;
leaves the port;
interface tallies exceed them by exactly the control frames;
test/flow.test.jsis unchanged and still asserts exact transport totals — that is what the split isfor. Reverting the engine changes fails the new suite.
docs/CLI.mdgains a "Counters" section undershow interfaces.Suite: 139 suites, 5,993 assertions, 0 failed.
show interfacesreports what has crossed the port (#1251)show interfacesnow says what the port threw away, and why (#1257) #1258show vlanprints VLAN 1 twice and puts every trunk in VLAN 1 #1261show vlanprinted VLAN 1 twice, and put every trunk in VLAN 1 (#1261) #1262show access-listsreports which rule matched (#1267) #1268