From: Stephen Hemminger <stephen@networkplumber.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>, netdev@vger.kernel.org
Subject: Re: packet stats validation
Date: Fri, 11 Feb 2022 18:21:43 -0800 [thread overview]
Message-ID: <20220211182143.458faa6c@hermes.local> (raw)
In-Reply-To: <YgbaKDZhHfGV542h@lunn.ch>
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!
prev parent reply other threads:[~2022-02-12 2:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220211182143.458faa6c@hermes.local \
--to=stephen@networkplumber.org \
--cc=andrew@lunn.ch \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.