iPerfのオプション Client / Server共通編

便利なiPerfのオプション

前回の記事では、よく使用するオプションについて実際使用した挙動を紹介しました。おそらく実際にiPerfを使用する人の多くは、これらのオプションで事足りていると思います。

今回紹介するオプションは、より効率的に作業を進めるうえで知っておくと便利なオプションになっています。複数のインターフェースを持っているデバイスでの計測や、入出力のデータやフォーマットの指定など知っていて損はないと思います。

今回はそれらのオプションの中でClient/Server共通のオプションになります。
※ iperf 3.1.3の情報になります。

Client/Server共通オプション

以下、Client/Server共通のオプションになります。

”iperf3 -h”で確認できます。

オプション デフォルト値 説明
f

a

(表示される数値が1000以下になるように自動で調整されます+bit表示)

結果に表示されるBnadwidthの単位を変更します。

K/M/Gで単位、大文字/小文字でBytes/bitsの切り替えとなります。

”m”の場合、”Mbits”、”M”の場合”MBytes”となります。

F 指定なし

入出力のデータをファイルで指定します。

送受信両方で”-F test.txt”とした場合、送信側のtest.txtを送信データとして送信し、受信側はtest.txtに受信データを記録します。

A

指定なし

(HAVE_CPU_AFFINITYが有効な場合のみ使用可能)

使用する論理プロセッサーを指定します。

”-A 3”と指定した場合、/proc/cpuinfoのprocessarが3の論理プロセッサーを指定します。

他のスレッドが当該プロセッサーに割り当てられていなければ最大限の性能を発揮できます。

B 指定なし

送受信のアドレスをバインドします。

”iperf3 -s -B 192.168.1.10”の場合、サーバーは192.168.1.10で待ち受けします。

V 結果の詳細情報を表示します。
J 結果をJSON形式で出力します。
d 開発者向けのデバッグ情報を表示します。
v iperfのバージョン情報を表示します。

実際に使ってみた

いくつか実際に使ってみて動作を確認してみました。

”-f”オプション

デフォルトでMbits/secだったものが、”-f K”オプションでKBytes/secに変更されています。
設定しない場合、表示が1000以下の値になるように調整されるためWi-Fiの場合概ね”M+bits(default)”になります。

test@test-ThinkPad-T430:~$ iperf3 -c 192.168.11.11
Connecting to host 192.168.11.11, port 5201
[  4] local 192.168.11.100 port 42652 connected to 192.168.11.11 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  68.5 MBytes   574 Mbits/sec    0   1.34 MBytes       
[  4]   1.00-2.00   sec  73.8 MBytes   619 Mbits/sec    0   1.34 MBytes       
^C[  4]   2.00-2.42   sec  32.3 MBytes   642 Mbits/sec    0   1.34 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-2.42   sec   174 MBytes   604 Mbits/sec    0             sender
[  4]   0.00-2.42   sec  0.00 Bytes  0.00 bits/sec                  receiver
iperf3: interrupt - the client has terminated
test@test-ThinkPad-T430:~$ iperf3 -c 192.168.11.11 -f K
Connecting to host 192.168.11.11, port 5201
[  4] local 192.168.11.100 port 42656 connected to 192.168.11.11 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  73.6 MBytes  75320 KBytes/sec    0   2.14 MBytes       
[  4]   1.00-2.00   sec  76.0 MBytes  77811 KBytes/sec    0   2.14 MBytes       
[  4]   2.00-3.00   sec  76.3 MBytes  78159 KBytes/sec    0   2.14 MBytes       
^C[  4]   3.00-3.19   sec  14.4 MBytes  75736 KBytes/sec    0   2.14 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-3.19   sec   240 MBytes  77014 KBytes/sec    0             sender
[  4]   0.00-3.19   sec  0.00 Bytes  0.00 KBytes/sec                  receiver
iperf3: interrupt - the client has terminated

”-A”オプション

論理プロセッサー数が4の環境で試してみましたが、iperfしか動作していない状態ではメリットは見受けられませんでした。

論理プロセッサー数
$ grep processor /proc/cpuinfo | wc -l
4

存在しない論理プロセッサーを指定するとエラーになります。

test@test-ThinkPad-T430:~$ iperf3 -c 192.168.11.11 -A 2
Connecting to host 192.168.11.11, port 5201
[  4] local 192.168.11.100 port 42694 connected to 192.168.11.11 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  70.1 MBytes   588 Mbits/sec    0   1.51 MBytes       
[  4]   1.00-2.00   sec  67.1 MBytes   563 Mbits/sec    0   1.51 MBytes       
[  4]   2.00-3.00   sec  69.1 MBytes   580 Mbits/sec    0   1.51 MBytes       
[  4]   3.00-4.00   sec  76.3 MBytes   640 Mbits/sec    0   1.51 MBytes       
[  4]   4.00-5.00   sec  77.0 MBytes   645 Mbits/sec    0   1.51 MBytes       
[  4]   5.00-6.00   sec  64.8 MBytes   543 Mbits/sec    0   1.51 MBytes       
[  4]   6.00-7.00   sec  73.1 MBytes   613 Mbits/sec    0   1.51 MBytes       
[  4]   7.00-8.00   sec  68.9 MBytes   579 Mbits/sec    0   1.51 MBytes       
[  4]   8.00-9.00   sec  68.4 MBytes   573 Mbits/sec    0   1.51 MBytes       
[  4]   9.00-10.00  sec  71.8 MBytes   603 Mbits/sec    0   1.51 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   707 MBytes   593 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   707 MBytes   593 Mbits/sec                  receiver
iperf Done.
test@test-ThinkPad-T430:~$ iperf3 -c 192.168.11.11 -A 3
Connecting to host 192.168.11.11, port 5201
[  4] local 192.168.11.100 port 42702 connected to 192.168.11.11 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  67.6 MBytes   567 Mbits/sec    0   1.34 MBytes       
[  4]   1.00-2.00   sec  71.2 MBytes   598 Mbits/sec    0   1.34 MBytes       
[  4]   2.00-3.00   sec  72.1 MBytes   605 Mbits/sec    0   1.34 MBytes       
[  4]   3.00-4.00   sec  67.0 MBytes   562 Mbits/sec    0   1.34 MBytes       
[  4]   4.00-5.00   sec  70.6 MBytes   592 Mbits/sec    0   1.34 MBytes       
[  4]   5.00-6.00   sec  73.0 MBytes   612 Mbits/sec    0   1.34 MBytes       
[  4]   6.00-7.00   sec  73.9 MBytes   620 Mbits/sec    0   1.34 MBytes       
[  4]   7.00-8.00   sec  73.3 MBytes   615 Mbits/sec    0   1.34 MBytes       
[  4]   8.00-9.00   sec  75.2 MBytes   631 Mbits/sec    0   1.34 MBytes       
[  4]   9.00-10.00  sec  72.1 MBytes   605 Mbits/sec    0   1.34 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   716 MBytes   601 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   716 MBytes   601 Mbits/sec                  receiver
iperf Done.
test@test-ThinkPad-T430:~$ iperf3 -c 192.168.11.11 -A 10
iperf3: error - unable to set CPU affinity: Invalid argument

”-B オプション”

以下はサーバー側を”iperf3 -s -B 192.168.11.11”(Ether)/”iperf3 -s -B 192.168.11.9”(Wi-Fi)でそれぞれ設定した場合の”iperf3 -c 192.168.11.11”の挙動です。

192.168.11.9が設定されている場合は接続が失敗しています。

複数のインターフェースを持っている場合に、使用するインターフェースを指定します。

test@test-ThinkPad-T430:~$ iperf3 -c 192.168.11.11
Connecting to host 192.168.11.11, port 5201
[  4] local 192.168.11.100 port 34804 connected to 192.168.11.11 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  14.9 MBytes   125 Mbits/sec   17   43.8 KBytes       
[  4]   1.00-2.00   sec  10.7 MBytes  89.5 Mbits/sec   11   39.6 KBytes       
^C[  4]   2.00-2.38   sec  3.40 MBytes  75.0 Mbits/sec    3   48.1 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-2.38   sec  29.0 MBytes   102 Mbits/sec   31             sender
[  4]   0.00-2.38   sec  0.00 Bytes  0.00 bits/sec                  receiver
iperf3: interrupt - the client has terminated
test@test-ThinkPad-T430:~$ iperf3 -c 192.168.11.11
iperf3: error - unable to connect to server: Connection refused
test@test-ThinkPad-T430:~$ 

”-V”オプション

iPerfのバージョン情報、カーネルバージョン情報、時間情報、接続情報、結果の詳細が追加されています。

test@test-ThinkPad-T430:~$ iperf3 -c 192.168.11.11 -V
iperf 3.0.11
Linux test-ThinkPad-T430 4.9.11-qca6174-qca9377+ #1 SMP Thu Sep 22 22:11:03 JST 2022 x86_64 x86_64 x86_64 GNU/Linux
Time: Sat, 24 Sep 2022 01:39:41 GMT
Connecting to host 192.168.11.11, port 5201
      Cookie: test-ThinkPad-T430.1663983581.808015
      TCP MSS: 1448 (default)
[  4] local 192.168.11.100 port 42678 connected to 192.168.11.11 port 5201
Starting Test: protocol: TCP, 1 streams, 131072 byte blocks, omitting 0 seconds, 10 second test
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  69.6 MBytes   582 Mbits/sec    0   1.37 MBytes       
[  4]   1.00-2.00   sec  70.5 MBytes   593 Mbits/sec    0   1.37 MBytes       
[  4]   2.00-3.00   sec  75.1 MBytes   630 Mbits/sec    0   1.37 MBytes       
[  4]   3.00-4.00   sec  75.2 MBytes   631 Mbits/sec    0   1.37 MBytes       
[  4]   4.00-5.00   sec  77.6 MBytes   650 Mbits/sec    0   1.37 MBytes       
[  4]   5.00-6.00   sec  74.3 MBytes   624 Mbits/sec    0   1.37 MBytes       
[  4]   6.00-7.00   sec  74.5 MBytes   625 Mbits/sec    0   1.37 MBytes       
[  4]   7.00-8.00   sec  76.0 MBytes   638 Mbits/sec    0   1.37 MBytes       
[  4]   8.00-9.00   sec  72.9 MBytes   611 Mbits/sec    0   1.37 MBytes       
[  4]   9.00-10.00  sec  75.4 MBytes   633 Mbits/sec    0   1.37 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
Test Complete. Summary Results:
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   741 MBytes   622 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   741 MBytes   622 Mbits/sec                  receiver
CPU Utilization: local/sender 22.4% (0.1%u/22.3%s), remote/receiver 0.3% (0.1%u/0.3%s)
iperf Done.

”-J”オプション

結果をJSON形式で表示します。
ファイル出力することで、結果のデータ処理に便利です。

test@test-ThinkPad-T430:~$ iperf3 -c 192.168.11.11 -J
{
	"start":	{
		"connected":	[{
				"socket":	4,
				"local_host":	"192.168.11.100",
				"local_port":	42686,
				"remote_host":	"192.168.11.11",
				"remote_port":	5201
			}],
		"version":	"iperf 3.0.11",
		"system_info":	"Linux test-ThinkPad-T430 4.9.11-qca6174-qca9377+ #1 SMP Thu Sep 22 22:11:03 JST 2022 x86_64 x86_64 x86_64 GNU/Linux
", "timestamp": { "time": "Sat, 24 Sep 2022 01:42:10 GMT", "timesecs": 1663983730 }, "connecting_to": { "host": "192.168.11.11", "port": 5201 }, "cookie": "test-ThinkPad-T430.1663983730.090391", "tcp_mss_default": 1448, "test_start": { "protocol": "TCP", "num_streams": 1, "blksize": 131072, "omit": 0, "duration": 10, "bytes": 0, "blocks": 0, "reverse": 0 } }, "intervals": [{ "streams": [{ "socket": 4, "start": 0, "end": 1.00014, "seconds": 1.00014, "bytes": 71954872, "bits_per_second": 5.75561e+08, "retransmits": 0, "snd_cwnd": 1404560, "omitted": false }], "sum": { "start": 0, "end": 1.00014, "seconds": 1.00014, "bytes": 71954872, "bits_per_second": 5.75561e+08, "retransmits": 0, "omitted": false } }, { "streams": [{ "socket": 4, "start": 1.00014, "end": 2.00012, "seconds": 0.999979, "bytes": 74911528, "bits_per_second": 5.99305e+08, "retransmits": 0, "snd_cwnd": 1404560, "omitted": false }], "sum": { "start": 1.00014, "end": 2.00012, "seconds": 0.999979, "bytes": 74911528, "bits_per_second": 5.99305e+08, "retransmits": 0, "omitted": false } }, { "streams": [{ "socket": 4, "start": 2.00012, "end": 3.00012, "seconds": 1, "bytes": 70855624, "bits_per_second": 5.66843e+08, "retransmits": 0, "snd_cwnd": 1404560, "omitted": false }], "sum": { "start": 2.00012, "end": 3.00012, "seconds": 1, "bytes": 70855624, "bits_per_second": 5.66843e+08, "retransmits": 0, "omitted": false } }, { "streams": [{ "socket": 4, "start": 3.00012, "end": 4.00011, "seconds": 0.99999, "bytes": 74146232, "bits_per_second": 5.93176e+08, "retransmits": 0, "snd_cwnd": 1404560, "omitted": false }], "sum": { "start": 3.00012, "end": 4.00011, "seconds": 0.99999, "bytes": 74146232, "bits_per_second": 5.93176e+08, "retransmits": 0, "omitted": false } }, { "streams": [{ "socket": 4, "start": 4.00011, "end": 5.00008, "seconds": 0.999969, "bytes": 73204416, "bits_per_second": 5.85653e+08, "retransmits": 0, "snd_cwnd": 1404560, "omitted": false }], "sum": { "start": 4.00011, "end": 5.00008, "seconds": 0.999969, "bytes": 73204416, "bits_per_second": 5.85653e+08, "retransmits": 0, "omitted": false } }, { "streams": [{ "socket": 4, "start": 5.00008, "end": 6.00013, "seconds": 1.00006, "bytes": 76420208, "bits_per_second": 6.11327e+08, "retransmits": 0, "snd_cwnd": 1404560, "omitted": false }], "sum": { "start": 5.00008, "end": 6.00013, "seconds": 1.00006, "bytes": 76420208, "bits_per_second": 6.11327e+08, "retransmits": 0, "omitted": false } }, { "streams": [{ "socket": 4, "start": 6.00013, "end": 7.00125, "seconds": 1.00112, "bytes": 71285712, "bits_per_second": 5.69649e+08, "retransmits": 0, "snd_cwnd": 1404560, "omitted": false }], "sum": { "start": 6.00013, "end": 7.00125, "seconds": 1.00112, "bytes": 71285712, "bits_per_second": 5.69649e+08, "retransmits": 0, "omitted": false } }, { "streams": [{ "socket": 4, "start": 7.00125, "end": 8.00011, "seconds": 0.99886, "bytes": 71156048, "bits_per_second": 5.69898e+08, "retransmits": 1, "snd_cwnd": 1404560, "omitted": false }], "sum": { "start": 7.00125, "end": 8.00011, "seconds": 0.99886, "bytes": 71156048, "bits_per_second": 5.69898e+08, "retransmits": 1, "omitted": false } }, { "streams": [{ "socket": 4, "start": 8.00011, "end": 9.0001, "seconds": 0.999992, "bytes": 76592272, "bits_per_second": 6.12743e+08, "retransmits": 0, "snd_cwnd": 1404560, "omitted": false }], "sum": { "start": 8.00011, "end": 9.0001, "seconds": 0.999992, "bytes": 76592272, "bits_per_second": 6.12743e+08, "retransmits": 0, "omitted": false } }, { "streams": [{ "socket": 4, "start": 9.0001, "end": 10.0001, "seconds": 1.00002, "bytes": 71015152, "bits_per_second": 5.68109e+08, "retransmits": 0, "snd_cwnd": 1404560, "omitted": false }], "sum": { "start": 9.0001, "end": 10.0001, "seconds": 1.00002, "bytes": 71015152, "bits_per_second": 5.68109e+08, "retransmits": 0, "omitted": false } }], "end": { "streams": [{ "sender": { "socket": 4, "start": 0, "end": 10.0001, "seconds": 10.0001, "bytes": 731542064, "bits_per_second": 5.85226e+08, "retransmits": 1 }, "receiver": { "socket": 4, "start": 0, "end": 10.0001, "seconds": 10.0001, "bytes": 731511656, "bits_per_second": 5.85202e+08 } }], "sum_sent": { "start": 0, "end": 10.0001, "seconds": 10.0001, "bytes": 731542064, "bits_per_second": 5.85226e+08, "retransmits": 1 }, "sum_received": { "start": 0, "end": 10.0001, "seconds": 10.0001, "bytes": 731511656, "bits_per_second": 5.85202e+08 }, "cpu_utilization_percent": { "host_total": 23.79, "host_user": 0.158389, "host_system": 23.5999, "remote_total": 0.28546, "remote_user": 0.0507977, "remote_system": 0.234662 } } }

まとめ

今回は、iPerfのClient/Server共通のオプションを紹介しました。

次回は、Client/Serverそれぞれ固有のオプションをご紹介します。

お問い合わせ

Qualcomm製品に関するご質問等がございましたら、以下リンクよりお問い合わせください。

Qualcomm メーカー情報Topへ

Qualcomm メーカー情報Topページへ戻りたい方は、以下をクリックしてください。