Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

如何使用「iperf」測試可用的網路頻寬

Summary: 本文提供如何測試可用網路頻寬的資訊。

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Symptoms

如何測試可用的網路頻寬

    1.下載 iperf 公用程式。  可以至 iperf.fr 取得副本
    2.在要接收資料的伺服器上,開啟提升權限的命令提示字元視窗,並執行下列命令:「iperf.exe –s –w 2m」。
    3.在要傳送資料的伺服器上,開啟提升權限的命令提示字元視窗,並執行下列命令:「iperf –c x.x.x.x –w 2m –t 30s –i 1s」。  在步驟 2 中,將 x.x.x.x 替換為伺服器的 IP 位址。
    4.檢閱步驟 3 傳回伺服器上的資料。  輸出應類似以下文字:

 
C:\Users\some_user\Downloads>iperf -c xx.xx.xx.xx -w 2m -t 30s -i 1s
------------------------------------------------------------
Client connecting to xx.xx.xx.xx, TCP port 5001
TCP window size: 2.00 MByte
------------------------------------------------------------
[156] local xx.xx.xx.xx port 53724 connected with xx.xx.xx.xx port 5001
[ ID] Interval       Transfer     Bandwidth
[156]  0.0- 1.0 sec  113 MBytes  945 Mbits/sec
[156]  1.0- 2.0 sec  112 MBytes  944 Mbits/sec
[156]  2.0- 3.0 sec  113 MBytes  945 Mbits/sec
.
.
.
[156] 28.0-29.0 sec  113 MBytes  945 Mbits/sec
[156] 29.0-30.0 sec  112 MBytes  944 Mbits/sec
[156]  0.0-30.3 sec   3.30 GBytes  945 Mbits/sec

 
其他資訊:

Iperf 是常用的網路測試工具,可建立 TCP 和 UDP 資料流,並測量承載這些資料的網路輸送量。

Iperf 可讓使用者設定各種測試網路的參數,或是用於最佳化或調整網路。Iperf 具有用戶端和伺服器功能,可單向或雙向測量兩端之間的輸送量。它是開放原始碼軟體,可在 Linux、Unix 和 Windows 等各種平台上執行。

上述範例命令會執行緩衝區大小為 2 MB 的單向測試。  測試會執行 30 秒,並每秒顯示結果。  如需進階測試,請參閱以下的完整語法。
 

一般選項:  


-f,--format
[kmKM] 報告的格式:Kbits, Mbits, KBytes, MBytes

-h, --help
顯示說明概要

-i, --interval n
在定期頻寬報告之間暫停 n 秒

-l,--len n[KM]
將讀取/寫如緩衝長度設定為 n (預設為 8 KB)

-m,--print_mss
顯示 TCP 最大區段大小 (MTU - TCP/IP header)

-o,--output <filename>
將報告或錯誤訊息輸出至此特定檔案

-p,--port n
設定伺服器連接埠聆聽/連接至 n (預設為 5001)

-u,--udp
使用 UDP 而不是 TCP

-w,--window n[KM]
TCP 視窗大小 (插槽緩衝大小)

-B,--bind <host>
綁定至 <host>,介面或多點傳送位址

-C,--compatibility
用於無法傳送額外訊息的較舊版本

-M,--mss n
設定 TCP 最大區段大小 (MTU - 40 位元組)

-N,--nodelay
設定 TCP 為無延遲,停用納格演算法

-v,--version
顯示版本資訊並退出

-V,--IPv6Version
將網域設定為 IPv6

-x,--reportexclude
[CDMSV] 排除 C(連線) D(資料) M(多點傳送) S(設定)
V(伺服器) 報告

-y,--reportstyle C|c
設定為 C 或 c 將以 CSV (逗點分隔的值) 顯示報告

伺服器專用選項:  

-s,--server
以伺服器模式執行

-U,--single_udp
以單一執行緒 UDP 模式執行

-D,--daemon
以 daemon 執行伺服器

用戶端專用選項:

-b, --bandwidth n[KM]
將目標頻寬設定為 n bits/sec (預設為 1 Mbit/sec)。此
設定需要 UDP (-u).

-c,--client <host>
以用戶端模式執行,連線至 <host>

-d,--dualtest
同時進行雙向測試

-n,--num n[KM]
傳輸的位元組數量 (不是 -t)

-r,--tradeoff
獨立進行雙向測試

-t,--time n
進行傳輸的秒數 (預設為 10 秒)

-F,--fileinput <name>
輸入要從檔案傳輸的資料

-I,--stdin
輸入要從 stdin 傳輸的資料

-L,--listenport n
接收雙向測試返回的連接埠

-P,--parallel n
要執行的平行用戶端執行緒數量

-T,--ttl n
多點傳送的連線時間 (預設為 1)

-Z,--linux-congestion <algo>
設定 TCP 壅塞控制演算法 (僅 Linux)


資料來源:Wikipedia 和 Manpagez

 

Cause

-

Resolution

-

Article Properties


Affected Product

Desktops & All-in-Ones, Laptops, Servers, PowerEdge

Last Published Date

06 Oct 2021

Version

4

Article Type

Solution