
私はボードをいくつか持っています (ただし、PC の場合も質問は同じだと思います。ただし、Linux を実行するボードなので、コンソール ツールを実行したいのですが)。これらは有線でインターネットに接続されています。
現在、1 つはイーサネット ポートに接続されています (予想どおり)。もう 1 つは、USB ポートに接続し、次にイーサネット ケーブルに接続するコンバータ (正しい用語がわかりません) に接続されています。
両方の速度を測定(および基本的な動作チェック)したいと思います。
これどうやってするの?
答え1
これにはいくつかの異なるアプローチがあります。私はethツールデバイスの「基本」情報を取得するにはiperfを使用し、実際の速度をチェックします。違いを示すために、遅いとわかっている接続(ホームプラグ経由)を使用しています。理論的には、USB接続ではかもしれないボトルネックを経験する
まず、もちろん、デバイスとそのIPアドレスに関する情報を知る必要がありip addr
ます。
次にethtoolを使ってアダプタの情報を取得します
geek@box31:~$ ethtool eno1
Settings for eno1:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Auto-negotiation: on
master-slave cfg: preferred slave
master-slave status: slave
Port: Twisted Pair
PHYAD: 0
Transceiver: external
MDI-X: Unknown
netlink error: Operation not permitted
Link detected: yes
ここで重要なSpeed: 1000Mb/s
のは、回線速度です。実質的におそらく、この「フル」スピードに達することはないでしょう。これは最速ハードウェアできた家庭ユーザー環境では、ほとんどのシステムはギガビットまたは高速 (100baseT) イーサネットですが、現在では家庭用システムで最大 10Gig のマルチギガ NIC が見られるようになってきています。
これを実証するために、私はiperf3- 別のシステムでサーバーを実行し、iperf3 -s
次のようにサーバーに接続します。iperf3 -c ip_of_server -t 10
次のような出力が得られます
iperf3: interrupt - the client has terminated
geek@box31:~$ iperf3 -c 192.168.2.121 -t 10
Connecting to host 192.168.2.121, port 5201
[ 5] local 192.168.2.86 port 44846 connected to 192.168.2.121 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 12.1 MBytes 101 Mbits/sec 0 351 KBytes
[ 5] 1.00-2.00 sec 10.6 MBytes 88.7 Mbits/sec 0 351 KBytes
[ 5] 2.00-3.00 sec 10.3 MBytes 86.7 Mbits/sec 0 351 KBytes
[ 5] 3.00-4.00 sec 10.5 MBytes 87.7 Mbits/sec 0 351 KBytes
[ 5] 4.00-5.00 sec 10.2 MBytes 85.7 Mbits/sec 0 351 KBytes
[ 5] 5.00-6.00 sec 10.9 MBytes 91.2 Mbits/sec 0 351 KBytes
[ 5] 6.00-7.00 sec 10.5 MBytes 87.7 Mbits/sec 0 351 KBytes
[ 5] 7.00-8.00 sec 10.2 MBytes 85.2 Mbits/sec 0 351 KBytes
[ 5] 8.00-9.00 sec 10.3 MBytes 86.2 Mbits/sec 0 351 KBytes
[ 5] 9.00-10.00 sec 10.5 MBytes 88.2 Mbits/sec 5 173 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 106 MBytes 88.8 Mbits/sec 5 sender
[ 5] 0.00-10.00 sec 104 MBytes 87.6 Mbits/sec receiver
正確な解釈は読者の課題として残しておきます。しかしこの場合、接続の両端がは完全なギガビット接続が可能な場合、速度が遅くなることがわかります。
直接ポイントツーポイント接続、またはフルギガビット対応のルーターやスイッチを介した接続では、回線速度に近い速度が得られますが、同等ではありません。Iperfはかわいいオーバーヘッドが低いので、httpやhttpsのような「現実世界」のプロトコルでは、小さい速度の違い。
パケット サイズなど他の要因もありますが、それはこの回答の範囲を超えています。