show interfaces reports no traffic, and ping traffic is never counted at all #1251

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

What happens

show interfaces prints the link state, the address and the peer — and nothing about traffic. That is the
table an operator pastes to answer is anything crossing this port, and it cannot answer.

Two defects are stacked underneath:

1. The counts are per device, not per port. flow.counterFor() keeps
{bytesIn, bytesOut, packetsIn, packetsOut} per devId. There is no per-port figure to print, so the only
honest answer today is none.

2. Ping was never counted at all. Both counting sites are guarded by if (frame.l4):

if (out.l4) flowLib.countPacket(this.flowState, dev.id, 'out', out.l4.bytes || 0);
if (f.l4)   flowLib.countPacket(this.flowState, dev.id, 'in',  f.l4.bytes || 0);

An ICMP echo carries icmp, an ARP frame carries arp, an LLDP frame carries lldp — none of them carry
l4. Measured on a two-device lab, after three answered pings:

counter keys after ping: []

So the traffic a packet simulator exists to generate is invisible to its own counters, and the command that
would report it reports nothing.

Expected

  • per-port tallies alongside the device totals, so a port can be asked about on its own;
  • every frame counted, whichever builder produced it — ICMP echo, ARP, LLDP — with a payload size that is
    modelled rather than assumed (an LLDP frame's TLVs are known, so its size is known);
  • show interfaces prints N packets input, B bytes / N packets output, B bytes per port;
  • interface accounting stays separate from flow accounting: a flow's byte count must not move because a
    switch sent an LLDP frame;
  • with no simulation run behind the device, say counters: not measured (no simulation run) rather than
    printing zeros — "nothing has looked" and "nothing crossed" are different answers.

Scope

The existing counter mechanism and the existing show interfaces output. No new commands.

## What happens `show interfaces` prints the link state, the address and the peer — and nothing about traffic. That is the table an operator pastes to answer *is anything crossing this port*, and it cannot answer. Two defects are stacked underneath: **1. The counts are per device, not per port.** `flow.counterFor()` keeps `{bytesIn, bytesOut, packetsIn, packetsOut}` per `devId`. There is no per-port figure to print, so the only honest answer today is none. **2. Ping was never counted at all.** Both counting sites are guarded by `if (frame.l4)`: ```js if (out.l4) flowLib.countPacket(this.flowState, dev.id, 'out', out.l4.bytes || 0); if (f.l4) flowLib.countPacket(this.flowState, dev.id, 'in', f.l4.bytes || 0); ``` An ICMP echo carries `icmp`, an ARP frame carries `arp`, an LLDP frame carries `lldp` — none of them carry `l4`. Measured on a two-device lab, after three answered pings: ``` counter keys after ping: [] ``` So the traffic a packet simulator exists to generate is invisible to its own counters, and the command that would report it reports nothing. ## Expected * per-port tallies alongside the device totals, so a port can be asked about on its own; * every frame counted, whichever builder produced it — ICMP echo, ARP, LLDP — with a payload size that is modelled rather than assumed (an LLDP frame's TLVs are known, so its size is known); * `show interfaces` prints `N packets input, B bytes` / `N packets output, B bytes` per port; * **interface accounting stays separate from flow accounting**: a flow's byte count must not move because a switch sent an LLDP frame; * with no simulation run behind the device, say `counters: not measured (no simulation run)` rather than printing zeros — "nothing has looked" and "nothing crossed" are different answers. ## Scope The existing counter mechanism and the existing `show interfaces` output. No new commands.
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#1251
No description provided.