脱力系備忘録BloG ホーム »iperf3で帯域測定!使い方とインターネット品質の調べ方

iperf3で帯域測定!使い方とインターネット品質の調べ方  

インターネット回線の通信品質の調べ方
インターネット回線の通信品質状況を調べたいとき私は以下のサービスをよく使います。

USEN - インターネット回線スピードテスト

Netflix - Fast.com

ただし、これらはあくまでもインターネット回線の通信速度になりますので、プロバイダーの混み具合や地域の回線使用状況で数値がコロコロと変化します。
プロバイダーの乗り換え判断には便利ですが、自宅の通信環境の品質測定には使えません
自宅の環境を調べたいときは「iperf」という便利なツールがあります。
iperfとは
無料で配布されているLAN環境のネットワーク通信帯域(スループット)を測定できるソフトウェアです。
対応OSがWindowsLinuxFreeBSDMacOSと幅広く、コマンドも簡単。
なのですが、サーバーとクライアントの2台をLANで接続して帯域測定する仕組みなので、現在使っているパソコンとは別にもう一台パソコンを用意する必要があります。
幸い、サーバーとクライアントのOSが違っても測定できるので、古いノートパソコンでも引っ張り出してLinuxなりFreeBSDなりの無料OSを導入すればいいのですが、古いパソコンはLANポートが100Mだったりするので注意が必要です。

ちなみに、公式サイトは以下です。
https://iperf.fr/


iperfの使い方
サーバーとクライアントをLANで結びます。
シンプルな例としては
iperf3_03.png
です。

サーバー、クライアントともにコマンドプロンプトやターミナルなどCUI環境でコマンド入力します。

最初にサーバーで
$ iperf3 -s

次にクライアントで
$ iperf3 -c サーバーIPアドレス
を実行すると通信テストが始まり以下のような結果が表示されます。
[ 5] local 192.168.100.2 port 33460 connected to 192.168.100.1 port 5001
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 116 MBytes 970 Mbits/sec 0 1.09 MBytes
[ 5] 1.00-2.00 sec 112 MBytes 944 Mbits/sec 0 1.09 MBytes
[ 5] 2.00-3.00 sec 111 MBytes 933 Mbits/sec 0 1.09 MBytes
[ 5] 3.00-4.00 sec 112 MBytes 944 Mbits/sec 0 1.09 MBytes
[ 5] 4.00-5.00 sec 112 MBytes 944 Mbits/sec 0 1.09 MBytes
[ 5] 5.00-6.00 sec 112 MBytes 944 Mbits/sec 0 1.09 MBytes
[ 5] 6.00-7.00 sec 112 MBytes 944 Mbits/sec 0 1.09 MBytes
[ 5] 7.00-8.00 sec 111 MBytes 933 Mbits/sec 0 1.09 MBytes
[ 5] 8.00-9.00 sec 112 MBytes 944 Mbits/sec 0 1.09 MBytes
[ 5] 9.00-10.00 sec 112 MBytes 944 Mbits/sec 0 1.09 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 1.10 GBytes 944 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver

上記の場合は通信帯域が約1000Mということが分かります。


iperfのオプション
以下のようなオプションがあります。
Usage: iperf3 [-s|-c host] [options]
iperf3 [-h|--help] [-v|--version]

Server or Client:
-p, --port # server port to listen on/connect to
-f, --format [kmgtKMGT] format to report: Kbits, Mbits, Gbits, Tbits
-i, --interval # seconds between periodic throughput reports
-F, --file name xmit/recv the specified file
-A, --affinity n/n,m set CPU affinity
-B, --bind bind to the interface associated with the address
-V, --verbose more detailed output
-J, --json output in JSON format
--logfile f send output to a log file
--forceflush force flushing output at every interval
--timestamps emit a timestamp at the start of each output line
(using optional format string as per strftime(3))
-d, --debug emit debugging output
-v, --version show version information and quit
-h, --help show this message and quit
Server specific:
-s, --server run in server mode
-D, --daemon run the server as a daemon
-I, --pidfile file write PID file
-1, --one-off handle one client connection then exit
--server-bitrate-limit #[KMG][/#] server's total bit rate limit (default 0 = no limit)
(optional slash and number of secs interval for averaging
total data rate. Default is 5 seconds)
--rsa-private-key-path path to the RSA private key used to decrypt
authentication credentials
--authorized-users-path path to the configuration file containing user
credentials
Client specific:
-c, --client run in client mode, connecting to
--sctp use SCTP rather than TCP
-X, --xbind bind SCTP association to links
--nstreams # number of SCTP streams
-u, --udp use UDP rather than TCP
--connect-timeout # timeout for control connection setup (ms)
-b, --bitrate #[KMG][/#] target bitrate in bits/sec (0 for unlimited)
(default 1 Mbit/sec for UDP, unlimited for TCP)
(optional slash and packet count for burst mode)
--pacing-timer #[KMG] set the timing for pacing, in microseconds (default 1000)
--fq-rate #[KMG] enable fair-queuing based socket pacing in
bits/sec (Linux only)
-t, --time # time in seconds to transmit for (default 10 secs)
-n, --bytes #[KMG] number of bytes to transmit (instead of -t)
-k, --blockcount #[KMG] number of blocks (packets) to transmit (instead of -t or -n)
-l, --length #[KMG] length of buffer to read or write
(default 128 KB for TCP, dynamic or 1460 for UDP)
--cport bind to a specific client port (TCP and UDP, default: ephemeral port)
-P, --parallel # number of parallel client streams to run
-R, --reverse run in reverse mode (server sends, client receives)
--bidir run in bidirectional mode.
Client and server send and receive data.
-w, --window #[KMG] set window size / socket buffer size
-C, --congestion set TCP congestion control algorithm (Linux and FreeBSD only)
-M, --set-mss # set TCP/SCTP maximum segment size (MTU - 40 bytes)
-N, --no-delay set TCP/SCTP no delay, disabling Nagle's Algorithm
-4, --version4 only use IPv4
-6, --version6 only use IPv6
-S, --tos N set the IP type of service, 0-255.
The usual prefixes for octal and hex can be used,
i.e. 52, 064 and 0x34 all specify the same value.
--dscp N or --dscp val set the IP dscp value, either 0-63 or symbolic.
Numeric values can be specified in decimal,
octal and hex (see --tos above).
-L, --flowlabel N set the IPv6 flow label (only supported on Linux)
-Z, --zerocopy use a 'zero copy' method of sending data
-O, --omit N omit the first n seconds
-T, --title str prefix every output line with this string
--extra-data str data string to include in client and server JSON
--get-server-output get results from server
--udp-counters-64bit use 64-bit counters in UDP test packets
--repeating-payload use repeating pattern in payload, instead of
randomized payload (like in iperf2)
--username username for authentication
--rsa-public-key-path path to the RSA public key used to encrypt
authentication credentials

関連記事

category: パソコン サーバー

この記事へのコメント

コメントの投稿

非公開コメント

コメントは全て管理人が内容を確認してから表示されます(非公開コメント除く)。
内容によっては表示されない場合がありますことご了承願います。

プロフィール

お問い合わせ

最新記事

最新コメント

▲ Pagetop