ubuntu:ネットワーク帯域幅の測定
This is an old revision of the document!
概要
- 2つのコンピュータの間の通信速度を測定する方法です。
- ファイルの受信側のIPアドレス(あるいはホスト名)を xxx.xxx.xxx.xxx とします
pingを使う方法
概算になりますが、計測に必要なソフトを別に入れる必要がないのでお手軽です。
pingコマンドのオプションは次のとおりです
- -c … データを送る回数
- -s … データのサイズ(最大65507バイト)。ただし実際に送られるデータはこれにIPヘッダ20バイトとICMPヘッダ8バイトが加わる
実際に次のように測定します
$ ping -c 10 -s 65507 xxx.xxx.xxx.xxx PING xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) 65507(65535) bytes of data. 65515 bytes from xxx.xxx.xxx.xxx: icmp_seq=2 ttl=63 time=3.11 ms 65515 bytes from xxx.xxx.xxx.xxx: icmp_seq=3 ttl=63 time=3.07 ms 65515 bytes from xxx.xxx.xxx.xxx: icmp_seq=4 ttl=63 time=3.21 ms 65515 bytes from xxx.xxx.xxx.xxx: icmp_seq=5 ttl=63 time=3.17 ms 65515 bytes from xxx.xxx.xxx.xxx: icmp_seq=6 ttl=63 time=3.21 ms 65515 bytes from xxx.xxx.xxx.xxx: icmp_seq=7 ttl=63 time=3.18 ms 65515 bytes from xxx.xxx.xxx.xxx: icmp_seq=8 ttl=63 time=3.12 ms 65515 bytes from xxx.xxx.xxx.xxx: icmp_seq=9 ttl=63 time=3.21 ms 65515 bytes from xxx.xxx.xxx.xxx: icmp_seq=10 ttl=63 time=3.16 ms --- xxx.xxx.xxx.xxx ping statistics --- 10 packets transmitted, 9 received, 10% packet loss, time 9023ms rtt min/avg/max/mdev = 3.072/3.165/3.218/0.060 ms
この場合は毎回65507+20+8=65535バイトのファイルが送信されます。 一回の送受信に平均3.165秒かかっていて、1バイトは8ビットですから、この場合は通信速度として
65535 * 8 * 2 / 3.165 / 1000 = 約 331 Mbps
が得られます。 (2倍する理由はよくわかりませんでした)
ubuntu/ネットワーク帯域幅の測定.1669403024.txt.gz · Last modified: 2022/11/26 04:03 by koudai