Skip to Content.

rare-dev - Re: [rare-dev] Counter packets and bytes

Subject: Rare project developers

List archive


Re: [rare-dev] Counter packets and bytes


Chronological Thread 
  • From: Alexander Gall <>
  • To: <>
  • Subject: Re: [rare-dev] Counter packets and bytes
  • Date: Tue, 28 Jun 2022 12:43:34 +0200

Hi Carmen

The -n and -k options don't do what you think they do when you use
TCP. Iperf uses a buffer of a certain size when reading and writing
data. By default it uses 128KiB for TCP, see the description of the
--length option.

The -k parameter is in units of that buffer size and you can see that
with -V:

: gall@lepton[gall]; iperf3 -c bsmp1 -k 1 -V | grep Starting
Starting Test: protocol: TCP, 1 streams, 131072 byte blocks, omitting 0
seconds, 1 blocks to send, tos 0
: gall@lepton[gall]; iperf3 -c bsmp1 -k 2 -V | grep Starting
Starting Test: protocol: TCP, 1 streams, 131072 byte blocks, omitting 0
seconds, 2 blocks to send, tos 0

So with -k 1000 you actually send 1000*128KiB of payload data (the
total amount includes all TCP overhead). The number of packets depends
on the MSS and the number of retransmits.

I'm not sure what exactly -n does with TCP.

--
Alex

On Tue, 28 Jun 2022 11:55:46 +0200, Carmen Misa Moreira
<> said:

> Hi,
> I'm using iperf3 with the -k flag to send 1000 packets:

> root@itcs-p4srv-02:/home/mmisamor# iperf3 -c 2001:1458:301:cd::100:3d8
> -L 32772 -p 5204 -i 10 -k 1000 &
> [1] 74718
> root@itcs-p4srv-02:/home/mmisamor# Connecting to host
> 2001:1458:301:cd::100:3d8, port 5204
> [ 5] local 2001:67c:2c4:1::2 port 45904 connected to
> 2001:1458:301:cd::100:3d8 port 5204
> [ ID] Interval Transfer Bitrate Retr Cwnd
> [ 5] 0.00-0.11 sec 124 MBytes 9.09 Gbits/sec 202 683 KBytes
> - - - - - - - - - - - - - - - - - - - - - - - - -
> [ ID] Interval Transfer Bitrate Retr
> [ 5] 0.00-0.11 sec 124 MBytes 9.09 Gbits/sec 202
> sender
> [ 5] 0.00-0.12 sec 121 MBytes 8.81 Gbits/sec
> receiver

> iperf Done.

> But on the switch I received more than 1k packets -> 1713 packets:

> E513-E-YECWH-1#show access-list acl_all_ipv6_flowlabels
> tx rx timers
> seq byte pack byte pack last timout cfg
> 10 0+0 0+0 0+0 0+0 never 00:00:00 all any all
> any all flow 131076&261884
> 11 0+0 0+0 0+0 0+0 never 00:00:00 all any all
> any all flow 65540&261884
> 12 0+0 0+0 0+0 0+0 never 00:00:00 all any all
> any all flow 196612&261884
> 13 0+0 0+0 0+165006 0+1713 00:00:01 00:00:00 all any all
> any all flow 32772&261884
> 20 0+0 0+0 0+0 0+0 never 00:00:00 all any all
> any all flow 131072&261632
> 21 0+0 0+0 0+0 0+0 never 00:00:00 all any all
> any all flow 65536&261632
> 22 0+0 0+0 0+0 0+0 never 00:00:00 all any all
> any all flow 196608&261632
> 23 0+0 0+0 0+0 0+0 never 00:00:00 all any all
> any all flow 32768&261632
> 29 0+0 0+0 0+0 0+0 never 00:00:00 all any all
> any all flow 5201
> 30 0+0 0+0 360+256420 5+2268 00:00:01 00:00:00 all any all
> any all

> So I was wondering if there is something regarding fragmentation or
> something that causes this mismatching in the values, I would expect to
> have 1k packets on the P4 switch in this case. I saw the same behaviour if
> I use the flag -n to send 1000 bytes:

> root@itcs-p4srv-02:/home/mmisamor# iperf3 -c 2001:1458:301:cd::100:3d8
> -L 32772 -p 5204 -i 10 -n 1000 &
> [1] 74722

> root@itcs-p4srv-02:/home/mmisamor# Connecting to host
> 2001:1458:301:cd::100:3d8, port 5204
> [ 5] local 2001:67c:2c4:1::2 port 45908 connected to
> 2001:1458:301:cd::100:3d8 port 5204
> [ ID] Interval Transfer Bitrate Retr Cwnd
> [ 5] 0.00-0.00 sec 106 KBytes 7.06 Gbits/sec 0 13.9 KBytes
> - - - - - - - - - - - - - - - - - - - - - - - - -
> [ ID] Interval Transfer Bitrate Retr
> [ 5] 0.00-0.00 sec 106 KBytes 7.06 Gbits/sec 0
> sender
> [ 5] 0.00-0.00 sec 13.9 KBytes 105 Mbits/sec
> receiver

> iperf Done.

> I received 900 bytes:

> E513-E-YECWH-1#show access-list acl_all_ipv6_flowlabels
> tx rx timers
> seq byte pack byte pack last timout cfg
> 10 0+0 0+0 0+0 0+0 never 00:00:00 all any all any all
> flow 131076&261884
> 11 0+0 0+0 0+0 0+0 never 00:00:00 all any all any all
> flow 65540&261884
> 12 0+0 0+0 0+0 0+0 never 00:00:00 all any all any all
> flow 196612&261884
> 13 0+0 0+0 0+900 0+10 00:00:12 00:00:00 all any all any all
> flow 32772&261884
> 20 0+0 0+0 0+0 0+0 never 00:00:00 all any all any all
> flow 131072&261632
> 21 0+0 0+0 0+0 0+0 never 00:00:00 all any all any all
> flow 65536&261632
> 22 0+0 0+0 0+0 0+0 never 00:00:00 all any all any all
> flow 196608&261632
> 23 0+0 0+0 0+0 0+0 never 00:00:00 all any all any all
> flow 32768&261632
> 29 0+0 0+0 0+0 0+0 never 00:00:00 all any all any all
> flow 5201
> 30 0+0 0+0 0+4037 0+38 00:00:12 00:00:00 all any all any all

> Best regards,

> Carmen Misa

--
Alexander Gall, Network

SWITCH
Werdstrasse 2, P.O. Box, 8021 Zurich, Switzerland
phone +41 44 268 15 15, direct +41 44 268 15 22
https://switch.ch https://swit.ch/linkedin https://swit.ch/twitter



Archive powered by MHonArc 2.6.19.

Top of Page