* packet stats validation
@ 2022-02-11 8:48 Oleksij Rempel
2022-02-11 21:50 ` Andrew Lunn
0 siblings, 1 reply; 3+ messages in thread
From: Oleksij Rempel @ 2022-02-11 8:48 UTC (permalink / raw)
To: netdev
Hi all,
I'm implementing stats64 for the ksz switch and by validating my
implementation found different by count methods in different sub
systems. For example, i send 64 byte packet with:
mausezahn enp1s0f3 -c 1 -a rand -p 64
- tshark is recognizing 64 byte frame with 50 byte data
- Intel igb is counting it as 64 byte
- ksz9477 switch HW counter is counting it as 68 bytes packet
- linux bridge is counting it as 50 byte packet
Can you please help me to understand this differences?
Do linux bridge is doing it correct or it is a bug?
ksz9477 is probably adding a tag and counting tagged packets. Should
this number be provided to stats64?
Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: packet stats validation
2022-02-11 8:48 packet stats validation Oleksij Rempel
@ 2022-02-11 21:50 ` Andrew Lunn
2022-02-12 2:21 ` Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2022-02-11 21:50 UTC (permalink / raw)
To: Oleksij Rempel; +Cc: netdev
On Fri, Feb 11, 2022 at 09:48:04AM +0100, Oleksij Rempel wrote:
> Hi all,
>
> I'm implementing stats64 for the ksz switch and by validating my
> implementation found different by count methods in different sub
> systems. For example, i send 64 byte packet with:
>
> mausezahn enp1s0f3 -c 1 -a rand -p 64
>
> - tshark is recognizing 64 byte frame with 50 byte data
> - Intel igb is counting it as 64 byte
> - ksz9477 switch HW counter is counting it as 68 bytes packet
> - linux bridge is counting it as 50 byte packet
>
> Can you please help me to understand this differences?
> Do linux bridge is doing it correct or it is a bug?
> ksz9477 is probably adding a tag and counting tagged packets. Should
> this number be provided to stats64?
I've come across this before, when i was doing systematic testing of
switches, using different USB ethernet dongles as traffic
source/sinks. Tests with one board and set of dongles gave different
results to a different board with different dongles. The drivers
counted different bytes in the frames. Some drivers include the FCS,
some don't, etc. I proposed a change to one of the drivers so it gave
the same counters as the other, but it was rejected. Because it is not
clearly defined what should be counted, there is not correct driver.
It is also unclear how you should count runt frames which get padded
up to 64 when actually put on the wire. This might be why the bridge
is so different, the frame as not been padded yet.
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: packet stats validation
2022-02-11 21:50 ` Andrew Lunn
@ 2022-02-12 2:21 ` Stephen Hemminger
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2022-02-12 2:21 UTC (permalink / raw)
To: Andrew Lunn; +Cc: Oleksij Rempel, netdev
On Fri, 11 Feb 2022 22:50:32 +0100
Andrew Lunn <andrew@lunn.ch> wrote:
> On Fri, Feb 11, 2022 at 09:48:04AM +0100, Oleksij Rempel wrote:
> > Hi all,
> >
> > I'm implementing stats64 for the ksz switch and by validating my
> > implementation found different by count methods in different sub
> > systems. For example, i send 64 byte packet with:
> >
> > mausezahn enp1s0f3 -c 1 -a rand -p 64
> >
> > - tshark is recognizing 64 byte frame with 50 byte data
> > - Intel igb is counting it as 64 byte
> > - ksz9477 switch HW counter is counting it as 68 bytes packet
> > - linux bridge is counting it as 50 byte packet
> >
> > Can you please help me to understand this differences?
> > Do linux bridge is doing it correct or it is a bug?
> > ksz9477 is probably adding a tag and counting tagged packets. Should
> > this number be provided to stats64?
>
> I've come across this before, when i was doing systematic testing of
> switches, using different USB ethernet dongles as traffic
> source/sinks. Tests with one board and set of dongles gave different
> results to a different board with different dongles. The drivers
> counted different bytes in the frames. Some drivers include the FCS,
> some don't, etc. I proposed a change to one of the drivers so it gave
> the same counters as the other, but it was rejected. Because it is not
> clearly defined what should be counted, there is not correct driver.
>
> It is also unclear how you should count runt frames which get padded
> up to 64 when actually put on the wire. This might be why the bridge
> is so different, the frame as not been padded yet.
>
> Andrew
Accepted practice for BSD and Linux (and therefore vendors using those OS)
is to not count FCS. The hardware focused vendors tend to count the FCS.
The argument for including FCS is partly for calculating QoS values in bit/sec
and partly to include it for marketing reasons.
Linux is documented to not include FCS in statistics.
(see https://www.kernel.org/doc/html/latest/networking/statistics.html).
Any device that counts FCS in byte count is broken and should be fixed!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-12 2:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-11 8:48 packet stats validation Oleksij Rempel
2022-02-11 21:50 ` Andrew Lunn
2022-02-12 2:21 ` Stephen Hemminger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.