account for preamble and inter-packet gap
Subsystems (2)
PATCH 1/1 account for preamble and inter-packet gap
Hi!
If you account for the Frame Check Sequence when computing bandwidth stats, it's only fair that you count the preamble and inter-packet gap as well. Suggested patch attached.
cheers,
Lennert
pktgen.c renamed from pktgen.c.orig +2 -2
@@ -2564,7 +2564,7 @@static void show_results (struct pktgen_dev *pkt_dev,int nr_frags) {__u64 total_us, bps, mbps, pps, idle; -int size = pkt_dev->cur_pkt_size +4 ;/* incl 32bit ethernet CRC */ +int size = pkt_dev->cur_pkt_size +4 +8 +12 ;/* incl 32bit ethernet CRC plus preamble plus inter-packet gap */ char *p = pkt_dev->result; total_us = pkt_dev->stopped_at - pkt_dev->started_at;
@@ -2777,7 +2777,7 @@ pkt_dev->last_ok =1 ; pkt_dev->sofar++; pkt_dev->seq_num++; - pkt_dev->tx_bytes += (pkt_dev->cur_pkt_size +4 );/* count csum */ + pkt_dev->tx_bytes += (pkt_dev->cur_pkt_size +4 +8 +12 );/* count csum and preamble and inter-packet gap*/ }else if (ret ==NETDEV_TX_LOCKED && (odev->features &NETIF_F_LLTX )) {
Quoted 5 lines · Lennert Buytenhek
Hi!
If you account for the Frame Check Sequence when computing bandwidth stats, it's only fair that you count the preamble and inter-packet gap as well. Suggested patch attached.
a) When an ethernet NIC claims 100Mbps, does this count the preamble and IPG?
b) Or, can send and receive 100Mbps of data by only counting the ethernet header + payload + CRC?
If b is true, then I definately would not want to see the IPG and preamble counted. If a is true, then I still don't want it counted, but I would agree that it is worth considering :)
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 6 lines · Ben Greear
Quoted 3 lines
If you account for the Frame Check Sequence when computing bandwidth stats, it's only fair that you count the preamble and inter-packet gap as well. Suggested patch attached.
a) When an ethernet NIC claims 100Mbps, does this count the preamble and IPG?
Yes. That's how we arrive at the 148kpps 'max pps for fast ethernet' figure -- 100000000 bits per second, each packet taking 8*(8+60+4+12) bits on the wire.
Another person suggested in private that what I'm after is properly called '% utilization'. It might not be possible to determine the speed of the physical medium though.
In either case, it seems wrong to count the FCS but not the preamble/IPG. Maybe it's more appropriate to remove the FCS from the calculations.
--L
PATCH 1/1 account for preamble and inter-packet gap
In reply to Lennert BuytenhekQuoted 3 lines · Lennert Buytenhek
If you account for the Frame Check Sequence when computing bandwidth stats, it's only fair that you count the preamble and inter-packet gap as well. Suggested patch attached.
Well from pktgen TX view we don't know what the layer under us will do. We simply deliver packets and hope those get transmitted but we are not 100% sure neither about ipg or preample. We don't even know that packets are seen on the wire. We use to verify this in our specific HW setup. So what trusted statistics can we give?
I've heard some boxes that didn't do the ipg correctly. Don't know what NIC this was. We can only estimate stats at the point where we are delivering packets. Other devices has "true" L2 stats.
OK. Adding FCS yes kinda compromise and maybe was wrong in this aspect.
Also we should think of calculation should work with link other link link layers not only ethernet.
The only solution I can think of is of having a selectable option in the config for output stats. To support different L2 layers and with warning if we are "predicting" L2 statistics. Feel free to extend your patch.
--ro
Quoted 3 lines · Robert Olsson
I've heard some boxes that didn't do the ipg correctly. Don't know what NIC this was. We can only estimate stats at the point where we are delivering packets. Other devices has "true" L2 stats.
Just found out the other day that via-rhine appears to do this.
Quoted 1 line
OK. Adding FCS yes kinda compromise and maybe was wrong in this aspect.
Let's remove it then?
Quoted 4 lines
The only solution I can think of is of having a selectable option in the config for output stats. To support different L2 layers and with warning if we are "predicting" L2 statistics. Feel free to extend your patch.
At that point it might be easier to just do it in userspace, no?
--L