Iperf là một công cụ để đo băng thông và chất lượng của một liên kết mạng

download Iperf là một công cụ để đo băng thông và chất lượng của một liên kết mạng

of 14

Transcript of Iperf là một công cụ để đo băng thông và chất lượng của một liên kết mạng

Iperf l mt cng c o bng thng v cht lng ca mt lin kt mng . Jperf c th c lin kt vi Iperf cung cp mt giao din ngi dng ha vit bng Java.

The network link is delimited by two hosts running Iperf. Cc lin kt mng c gii hn bi hai my chy Iperf.

The quality of a link can be tested as follows: Cht lng ca mt lin kt c th c kim tra nh sau: - Latency (response time or RTT): can be measured with the Ping command. - tr (thi gian p ng hoc RTT): c th c o vi cc lnh Ping . - Jitter (latency variation): can be measured with an Iperf UDP test. - Jitter ( tr dao ng): c th c o bng mt bi kim tra Iperf UDP. - Datagram loss: can be measured with an Iperf UDP test. - Datagram mt: c th c o bng mt bi kim tra Iperf UDP.

The bandwidth is measured through TCP tests. Bng thng c o thng qua cc bi kim tra TCP.

To be clear, the difference between TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) is that TCP use processes to check that the packets are correctly sent to the receiver whereas with UDP the packets are sent without any checks but with the advantage of being quicker than TCP. c r rng, s khc bit gia TCP (Transmission Control Protocol) v UDP (User Datagram Protocol) l qu trnh s dng TCP kim tra cc gi tin mt cch chnh xc c gi n ngi nhn trong khi vi UDP, cc gi tin c gi i m khng c bt k kim tra nhng vi li th nhanh hn TCP. Iperf uses the different capacities of TCP and UDP to provide statistics about network links. Iperf s dng cc nng lc khc nhau ca TCP v UDP cung cp cc s liu thng k v cc lin kt mng.

Finally, Iperf can be installed very easily on any UNIX/Linux or Microsoft Windows system. Cui cng, Iperf c th c ci t rt d dng trn bt k h thng UNIX / Linux hoc Microsoft Windows. One host must be set as client, the other one as server. Mt my ch phi c thit lp nh l khch hng, mt trong nhng khc nh my ch.

Here is a diagram where Iperf is installed on a Linux and Microsoft Windows machine. Di y l mt s ni Iperf c ci t trn my tnh Windows Linux v Microsoft. Linux is used as the Iperf client and Windows as the Iperf server. Linux c s dng nh khch hng Iperf v Windows l cc my ch Iperf. Of course, it is also possible to use two Linux boxes. Tt nhin, n cng c th s dng hai hp Linux.

Iperf tests: Iperf kim tra:

no arg. khng c arg . -b -B -r -R -d -D -w -W Default settings Ci t mc nh Data format nh dng d liu Bi-directional bandwidth Bi-hng bng thng Simultaneous bi-directional bandwidth ng thi hai hng bng thng TCP Window size TCP Window size -p, -t, -i -P,-t-i -u, -b -U-b -m -M -M -M -P -P -h -H Port, timing and interval Cng, thi gian v khong thi gian UDP tests, bandwidth settings UDP kim tra, thit lp bng thng Maximum Segment Size display Segment hin th Kch thc ti a Maximum Segment Size settings Kch thc cc thit lp ti a Segment Parallel tests Song song th nghim help gip

Jperf : Jperf :

no arg. khng c arg . -d -D -u, -b -U-b Default settings Ci t mc nh Simultaneous bi-directional bandwidth ng thi hai hng bng thng UDP tests, bandwidth settings UDP kim tra, thit lp bng thng

Default Iperf settings: Thit lp mc nh Iperf: Also check " Jperf section. Ngoi ra kim tra " Jperf phn.

By default, the Iperf client connects to the Iperf server on the TCP port 5001 and the bandwidth displayed by Iperf is the bandwidth from the client to the server. Theo mc nh, khch hng Iperf kt ni vi my ch Iperf trn cng TCP 5001 v bng thng c hin th bng Iperf l bng thng t my khch n my ch. If you want to use UDP tests, use the -u argument. Nu bn mun s dng th nghim UDP, s dng u -i s . The -d and -r Iperf client arguments measure the bi-directional bandwidths. D- v -r khch hng i s Iperf o bng thng hai chiu. (See further on this tutorial) (Xem thm chi tit v hng dn ny)

Client side: Pha khch hng: #iperf -c 10.1.1.1 # Iperf-c 10.1.1.1

------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.1.1.1, TCP port 5001 Khch hng kt ni n 10.1.1.1, cng TCP 5001 TCP window size: 16384 Byte (default) TCP ca s kch thc: 16384 Byte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [ 3] local 10.6.2.5 port 33453 connected with 10.1.1.1 port 5001 [3] a phng 10.6.2.5 33453 cng kt ni vi 10.1.1.1 cng 5001 [ 3] 0.0-10.2 sec 1.26 MBytes 1.05 Mbits/sec [3] 0,0-10,2 giy 1,26 MBytes 1,05 Mbits / giy

Server side: Pha my ch: #iperf -s # Iperf-s

------------------------------------------------------------ -------------------------------------------------- ---------- Server listening on TCP port 5001 Server lng nghe trn cng TCP 5001 TCP window size: 8.00 KByte (default) TCP ca s kch thc: 8,00 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [852] local 10.1.1.1 port 5001 connected with 10.6.2.5 port 33453 [852] a phng 10.1.1.1 cng 5001 kt ni vi 10.6.2.5 port 33453 [ ID] Interval Transfer Bandwidth [ID] Interval Chuyn Bandwidth [852] 0.0-10.6 sec 1.26 MBytes 1.03 Mbits/sec [852] 0,0-10,6 giy 1,26 MBytes 1,03 Mbits / giy

Data formatting: (-f argument) nh dng d liu: (-e tranh lun)

The -f argument can display the results in the desired format: bits(b), bytes(B), kilobits(k), kilobytes(K), megabits(m), megabytes(M), gigabits(g) or gigabytes(G). -E tranh lun c th hin th cc kt qu trong cc nh dng mong mun: bit (b), byte (B), kilobits (k), kilobytes (K), megabit (m), MB (M), gigabit (g) hoc gigabyte ( G). Generally the bandwidth measures are displayed in bits (or Kilobits, etc ...) and an amount of data is displayed in bytes (or Kilobytes, etc ...). Ni chung cc bin php bng thng c hin th trong bit (kilobits, vv ...) v mt s lng d liu c hin th trong byte (hoc kilobytes, vv ...). As a reminder, 1 byte is equal to 8 bits and, in the computer science world, 1 kilo is equal to 1024 (2^10). Xin nhc li, 1 byte bng 8 bit, v trong th gii khoa hc my tnh, 1 kg tng ng vi 1024 (2 ^ 10). For example: 100'000'000 bytes is not equal to 100 Mbytes but to 100'000'000/1024/1024 = 95.37 Mbytes. V d: 100'000'000 byte l khng bng 100 MB nhng 100'000'000 / 1024 / 1024 = 95,37 MB.

Client side: Pha khch hng: #iperf -c 10.1.1.1 -fb # Iperf-c 10.1.1.1-fb

------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.1.1.1, TCP port 5001 Khch hng kt ni n 10.1.1.1, cng TCP 5001 TCP window size: 16384 Byte (default) TCP ca s kch thc: 16384 Byte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [ 3] local 10.6.2.5 port 54953 connected with 10.1.1.1 port 5001 [3] a phng 10.6.2.5 54953 cng kt ni vi 10.1.1.1 cng 5001 [ 3] 0.0-10.2 sec 1359872 Bytes 1064272 bits/sec [3] 0,0-10,2 giy 1359872 Bytes 1.064.272 bit / giy

Server side: Pha my ch: #iperf -s # Iperf-s

------------------------------------------------------------ -------------------------------------------------- ---------- Server listening on TCP port 5001 Server lng nghe trn cng TCP 5001 TCP window size: 8.00 KByte (default) TCP ca s kch thc: 8,00 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [852] local 10.1.1.1 port 5001 connected with 10.6.2.5 port 33453 [852] a phng 10.1.1.1 cng 5001 kt ni vi 10.6.2.5 port 33453 [ ID] Interval Transfer Bandwidth [ID] Interval Chuyn Bandwidth [852] 0.0-10.6 sec 920 KBytes 711 Kbits/sec [852] 0,0-10,6 giy 920 KBytes 711 Kbits / sec

Top of the page Tr v u trang

Bi-directional bandwidth measurement: (-r argument) Bi-directional bng thng o lng: (-r i s)

The Iperf server connects back to the client allowing the bi-directional bandwidth measurement. Iperf my ch kt ni tr li cho khch hng cho php o bng thng hai chiu. By default, only the bandwidth from the client to the server is measured. Theo mc nh, ch c bng thng t my khch n my ch c o. If you want to measure the bi-directional bandwidth simultaneously, use the -d keyword. Nu bn mun o bng thng hai chiu ng thi, s dng t kha-d. (See next test.) (Xem th nghim tip theo.)

Client side: Pha khch hng: #iperf -c 10.1.1.1 -r # Iperf-c 10.1.1.1-r

------------------------------------------------------------ -------------------------------------------------- ---------- Server listening on TCP port 5001 Server lng nghe trn cng TCP 5001 TCP window size: 85.3 KByte (default) TCP ca s kch thc: 85,3 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- ------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.1.1.1, TCP port 5001 Khch hng kt ni n 10.1.1.1, cng TCP 5001 TCP window size: 16.0 KByte (default) TCP ca s kch thc: 16,0 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [ 5] local 10.6.2.5 port 35726 connected with 10.1.1.1 port 5001 [5] a phng 10.6.2.5 35726 cng kt ni vi 10.1.1.1 cng 5001 [ 5] 0.0-10.0 sec 1.12 MBytes 936 Kbits/sec [5] 0,0-10,0 giy 1,12 MBytes 936 Kbits / sec [ 4] local 10.6.2.5 port 5001 connected with 10.1.1.1 port 1640 [4] a phng 10.6.2.5 cng 5001 kt ni vi 10.1.1.1 cng 1640 [ 4] 0.0-10.1 sec 74.2 MBytes 61.7 Mbits/sec [4] 0,0-10,1 giy 74,2 MBytes 61,7 Mbits / giy

Server side: Pha my ch: #iperf -s # Iperf-s

------------------------------------------------------------ -------------------------------------------------- ---------- Server listening on TCP port 5001 Server lng nghe trn cng TCP 5001 TCP window size: 8.00 KByte (default) TCP ca s kch thc: 8,00 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [852] local 10.1.1.1 port 5001 connected with 10.6.2.5 port 54355 [852] a phng 10.1.1.1 cng 5001 kt ni vi 10.6.2.5 port 54355 [ ID] Interval Transfer Bandwidth [ID] Interval Chuyn Bandwidth [852] 0.0-10.1 sec 1.15 MBytes 956 Kbits/sec [852] 0,0-10,1 giy 1,15 MBytes 956 Kbits / sec ------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.6.2.5, TCP port 5001 Khch hng kt ni n 10.6.2.5, cng TCP 5001 TCP window size: 8.00 KByte (default) TCP ca s kch thc: 8,00 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [824] local 10.1.1.1 port 1646 connected with 10.6.2.5 port 5001 [824] a phng 10.1.1.1 cng 1646 kt ni vi 10.6.2.5 cng 5001 [ ID] Interval Transfer Bandwidth [ID] Interval Chuyn Bandwidth [824] 0.0-10.0 sec 73.3 MBytes 61.4 Mbits/sec [824] 0,0-10,0 giy 73,3 MBytes 61,4 Mbits / giy

Top of the page Tr v u trang

Simultaneous bi-directional bandwidth measurement: (-d argument) ng thi bng thng hai chiu o: (-d i s) Also check the " Jperf " section. Ngoi ra kim tra " Jperf " .

To measure the bi-directional bandwidths simultaneousely, use the -d argument. o bng thng hai chiu simultaneousely, s dng i s-d. If you want to test the bandwidths sequentially, use the -r argument (see previous test). Nu bn mun kim tra cc bng thng theo tun t, s dng r- i s (xem th nghim trc ). By default (ie: without the -r or -d arguments), only the bandwidth from the client to the server is measured. Theo mc nh (v d: khng c r-hay-d i s), ch c bng thng t my khch n my ch c o.

Client side: Pha khch hng: #iperf -c 10.1.1.1 -d # Iperf-c 10.1.1.1-d

------------------------------------------------------------ -------------------------------------------------- ---------- Server listening on TCP port 5001 Server lng nghe trn cng TCP 5001 TCP window size: 85.3 KByte (default) TCP ca s kch thc: 85,3 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- ------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.1.1.1, TCP port 5001 Khch hng kt ni n 10.1.1.1, cng TCP 5001 TCP window size: 16.0 KByte (default) TCP ca s kch thc: 16,0 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [ 5] local 10.6.2.5 port 60270 connected with 10.1.1.1 port 5001 [5] a phng 10.6.2.5 60270 cng kt ni vi 10.1.1.1 cng 5001 [ 4] local 10.6.2.5 port 5001 connected with 10.1.1.1 port 2643 [4] a phng 10.6.2.5 cng 5001 kt ni vi 10.1.1.1 cng 2643 [ 4] 0.0-10.0 sec 76.3 MBytes 63.9 Mbits/sec [4] 0,0-10,0 giy 76,3 MBytes 63,9 Mbits / giy [ 5] 0.0-10.1 sec 1.55 MBytes 1.29 Mbits/sec [5] 0,0-10,1 giy 1,55 MBytes 1,29 Mbits / giy

Server side: Pha my ch: #iperf -s # Iperf-s

------------------------------------------------------------ -------------------------------------------------- ---------- Server listening on TCP port 5001 Server lng nghe trn cng TCP 5001 TCP window size: 8.00 KByte (default) TCP ca s kch thc: 8,00 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [852] local 10.1.1.1 port 5001 connected with 10.6.2.5 port 60270 [852] a phng 10.1.1.1 cng 5001 kt ni vi 10.6.2.5 port 60270 ------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.6.2.5, TCP port 5001 Khch hng kt ni n 10.6.2.5, cng TCP 5001 TCP window size: 8.00 KByte (default) TCP ca s kch thc: 8,00 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [800] local 10.1.1.1 port 2643 connected with 10.6.2.5 port 5001 [800] a phng 10.1.1.1 cng 2643 kt ni vi 10.6.2.5 cng 5001 [ ID] Interval Transfer Bandwidth [ID] Interval Chuyn Bandwidth [800] 0.0-10.0 sec 76.3 MBytes 63.9 Mbits/sec [800] 0,0-10,0 giy 76,3 MBytes 63,9 Mbits / giy [852] 0.0-10.1 sec 1.55 MBytes 1.29 Mbits/sec [852] 0,0-10,1 giy 1,55 MBytes 1,29 Mbits / giy

Top of the page Tr v u trang

TCP Window size: (-w argument) TCP Window kch thc: (-w i s)

The TCP window size is the amount of data that can be buffered during a connection without a validation from the receiver. Cc kch thc ca s TCP l s tin ca d liu c th c m trong mt kt ni m khng c mt xc nhn t ngi nhn. It can be between 2 and 65,535 bytes. N c th c gia 2 v 65.535 byte. On Linux systems, when specifying a TCP buffer size with the -w argument, the kernel allocates double as much as indicated. Trn cc h thng Linux, khi ch nh mt kch thc b m TCP vi cc i s w, ht nhn phn b tng gp i nh nhiu nh c ch ra.

Client side: Pha khch hng: #iperf -c 10.1.1.1 -w 2000 # Iperf-c 10.1.1.1-w 2000

WARNING: TCP window size set to 2000 bytes . Ch : kch thc ca s TCP thit lp n 2000 byte . A small window size Mt kch thc ca s nh will give poor performance. s cho hiu sut km. See the Iperf documentation. Xem cc ti liu hng dn Iperf. ------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.1.1.1, TCP port 5001 Khch hng kt ni n 10.1.1.1, cng TCP 5001 TCP window size: 3.91 KByte (WARNING: requested 1.95 KByte) TCP ca s kch thc: 3,91 Kbyte (Ch : yu cu 1,95 Kbyte ) ------------------------------------------------------------ -------------------------------------------------- ---------- [ 3] local 10.6.2.5 port 51400 connected with 10.1.1.1 port 5001 [3] a phng 10.6.2.5 51400 cng kt ni vi 10.1.1.1 cng 5001 [ 3] 0.0-10.1 sec 704 KBytes 572 Kbits/sec [3] 0,0-10,1 giy 704 KBytes 572 Kbits / sec

Server side: Pha my ch: #iperf -s -w 4000 # Iperf-s-w 4000

------------------------------------------------------------ -------------------------------------------------- ---------- Server listening on TCP port 5001 Server lng nghe trn cng TCP 5001 TCP window size: 3.91 KByte TCP ca s kch thc: 3,91 Kbyte ------------------------------------------------------------ -------------------------------------------------- ---------- [852] local 10.1.1.1 port 5001 connected with 10.6.2.5 port 51400 [852] a phng 10.1.1.1 cng 5001 kt ni vi 10.6.2.5 port 51400 [ ID] Interval Transfer Bandwidth [ID] Interval Chuyn Bandwidth [852] 0.0-10.1 sec 704 KBytes 570 Kbits/sec [852] 0,0-10,1 giy 704 KBytes 570 Kbits / giy

Top of the page Tr v u trang

Communication port (-p), timing (-t) and interval (-i): Cng giao tip (-p), thi gian (-t) v khong thi gian (-i):

The Iperf server communication port can be changed with the -p argument. Cc my ch Iperf cng giao tip c th c thay i vi cc tham s-p. It must be configured on the client and the server with the same value, default is TCP port 5001. N phi c cu hnh trn my khch v my ch vi gi tr nh nhau, mc nh l cng TCP 5001. The -t argument specifies the test duration time in seconds, default is 10 secs. -T i s quy nh c th thi gian thi gian th nghim trong vi giy, mc nh l 10 giy. The -i argument indicates the interval in seconds between periodic bandwidth reports. -I tham s cho thy khong thi gian trong vi giy gia cc bo co bng thng nh k.

Client side: Pha khch hng: #iperf -c 10.1.1.1 -p 12000 -t 20 -i 2 # Iperf-c 10.1.1.1-p 12000-t 20-i 2

------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.1.1.1, TCP port 12000 Khch ang kt ni ti 10.1.1.1, TCP cng 12000 TCP window size: 16.0 KByte (default) TCP ca s kch thc: 16,0 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [ 3] local 10.6.2.5 port 58316 connected with 10.1.1.1 port 12000 [3] a phng 10.6.2.5 58316 cng kt ni vi 12.000 cng 10.1.1.1 [ 3] 0.0- 2.0 sec 224 KBytes 918 Kbits/sec [3] 0,0-2,0 giy 224 KBytes 918 Kbits / sec [ 3] 2.0- 4.0 sec 368 KBytes 1.51 Mbits/sec [3] 2,0-4,0 giy 368 KBytes 1,51 Mbits / giy [ 3] 4.0- 6.0 sec 704 KBytes 2.88 Mbits/sec [3] 4,0-6,0 giy 704 KBytes 2,88 Mbits / giy [ 3] 6.0- 8.0 sec 280 KBytes 1.15 Mbits/sec [3] 6,0-8,0 giy 280 KBytes 1,15 Mbits / giy [ 3] 8.0-10.0 sec 208 KBytes 852 Kbits/sec [3] 8,0-10,0 giy 208 KBytes 852 Kbits / sec [ 3] 10.0-12.0 sec 344 KBytes 1.41 Mbits/sec [3] 10,0-12,0 giy 344 KBytes 1,41 Mbits / giy [ 3] 12.0-14.0 sec 208 KBytes 852 Kbits/sec [3] 12,0-14,0 giy 208 KBytes 852 Kbits / sec [ 3] 14.0-16.0 sec 232 KBytes 950 Kbits/sec [3] 14,0-16,0 giy 232 KBytes 950 Kbits / sec [ 3] 16.0-18.0 sec 232 KBytes 950 Kbits/sec [3] 16,0-18,0 giy 232 KBytes 950 Kbits / sec [ 3] 18.0-20.0 sec 264 KBytes 1.08 Mbits/sec [3] 18,0-20,0 giy 264 KBytes 1,08 Mbits / giy [ 3] 0.0-20.1 sec 3.00 MBytes 1.25 Mbits/sec [3] 0,0-20,1 giy 3,00 MBytes 1,25 Mbits / giy

Server side: Pha my ch: #iperf -s -p 12000 # Iperf-s-p 12000

------------------------------------------------------------ -------------------------------------------------- ---------- Server listening on TCP port 12000 Server lng nghe trn cng TCP 12000 TCP window size: 8.00 KByte (default) TCP ca s kch thc: 8,00 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [852] local 10.1.1.1 port 12000 connected with 10.6.2.5 port 58316 [852] a phng 10.1.1.1 12000 cng kt ni vi 10.6.2.5 port 58316 [ ID] Interval Transfer Bandwidth [ID] Interval Chuyn Bandwidth [852] 0.0-20.1 sec 3.00 MBytes 1.25 Mbits/sec [852] 0,0-20,1 giy 3,00 MBytes 1,25 Mbits / giy

Top of the page Tr v u trang

UDP tests: (-u), bandwidth settings (-b) UDP kim tra: (-u), thit lp bng thng (-b) Also check the " Jperf " section. Ngoi ra kim tra " Jperf " .

The UDP tests with the -u argument will give invaluable information about the jitter and the packet loss. Cc xt nghim UDP vi u i s s cung cp cho thng tin v gi v jitter v mt mt cc gi tin. If you don't specify the -u argument, Iperf uses TCP. Nu bn khng ch nh cc tham s-u, Iperf s dng TCP. To keep a good link quality, the packet loss should not go over 1 %. gi cht lng lin kt tt, mt gi tin khng nn i hn 1%. A high packet loss rate will generate a lot of TCP segment retransmissions which will affect the bandwidth. T l mt gi cao s to ra rt nhiu phn on TCP truyn li s nh hng n bng thng.

The jitter is basically the latency variation and does not depend on the latency. Jitter v c bn l s bin thin tr v khng ph thuc vo tr. You can have high response times and a very low jitter. Bn c th c thi gian p ng cao v jitter rt thp. The jitter value is particularly important on network links supporting voice over IP (VoIP) because a high jitter can break a call. Gi tr jitter l c bit quan trng trn cc lin kt mng li h tr ging ni qua IP (VoIP) bi v mt jitter cao c th ph v mt cuc gi. The -b argument allows the allocation if the desired bandwidth. -B i s cho php vic phn b bng thng mong mun.

Client side: Pha khch hng: #iperf -c 10.1.1.1 -u -b 10m # Iperf-c 10.1.1.1-u-b 10m

------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.1.1.1, UDP port 5001 Khch hng kt ni n 10.1.1.1, UDP port 5001 Sending 1470 byte datagrams Gi 1470 datagrams byte UDP buffer size: 108 KByte (default) UDP b m kch thc: 108 Kbyte (mc nh ) ------------------------------------------------------------ -------------------------------------------------- ---------- [ 3] local 10.6.2.5 port 32781 connected with 10.1.1.1 port 5001 [3] a phng 10.6.2.5 32781 cng kt ni vi 10.1.1.1 cng 5001 [ 3] 0.0-10.0 sec 11.8 MBytes 9.89 Mbits/sec [3] 0,0-10,0 giy 11,8 MBytes 9,89 Mbits / giy [ 3] Sent 8409 datagrams [3] Gi 8409 datagrams [ 3] Server Report: [3] Report Server: [ 3] 0.0-10.0 sec 11.8 MBytes 9.86 Mbits/sec 2.617 ms 9/ 8409 (0.11%) [3] 0,0-10,0 giy 11,8 MBytes 9,86 Mbits / giy 2,617 ms 9 / 8409 (0,11%)

Server side: Pha my ch: #iperf -s -u -i 1 # Iperf-s-u-i 1

------------------------------------------------------------ -------------------------------------------------- ---------- Server listening on UDP port 5001 Server lng nghe trn UDP port 5001 Receiving 1470 byte datagrams Tip nhn 1.470 byte datagrams UDP buffer size: 8.00 KByte (default) UDP m kch thc: 8,00 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [904] local 10.1.1.1 port 5001 connected with 10.6.2.5 port 32781 [904] a phng 10.1.1.1 cng 5001 kt ni vi 10.6.2.5 port 32781 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [ID] Interval Jitter Chuyn bng thng gim / datagrams Tng s [904] 0.0- 1.0 sec 1.17 MBytes 9.84 Mbits/sec 1.830 ms 0/ 837 (0%) [904] 0,0-1,0 giy 1,17 MBytes 9,84 Mbits / giy 1,830 ms 0 / 837 (0%) [904] 1.0- 2.0 sec 1.18 MBytes 9.94 Mbits/sec 1.846 ms 5/ 850 (0.59%) [904] 1,0-2,0 giy 1,18 MBytes 9,94 Mbits / giy 1,846 ms 5 / 850 (0,59%) [904] 2.0- 3.0 sec 1.19 MBytes 9.98 Mbits/sec 1.802 ms 2/ 851 (0.24%) [904] 2,0-3,0 giy 1,19 MBytes 9,98 Mbits / giy 1,802 ms 2 / 851 (0,24%) [904] 3.0- 4.0 sec 1.19 MBytes 10.0 Mbits/sec 1.830 ms 0/ 850 (0%) [904] 3,0-4,0 giy 1,19 MBytes Mbits / giy 10,0 1,830 ms 0 / 850 (0%) [904] 4.0- 5.0 sec 1.19 MBytes 9.98 Mbits/sec 1.846 ms 1/ 850 (0.12%) [904] 4,0-5,0 giy 1,19 MBytes 9,98 Mbits / giy 1,846 ms 1 / 850 (0,12%) [904] 5.0- 6.0 sec 1.19 MBytes 10.0 Mbits/sec 1.806 ms 0/ 851 (0%) [904] 5,0-6,0 giy 1,19 MBytes 10,0 Mbits / sec 1,806 ms 0 / 851 (0%) [904] 6.0- 7.0 sec 1.06 MBytes 8.87 Mbits/sec 1.803 ms 1/ 755 (0.13%) [904] 6,0-7,0 giy 1,06 MBytes 8,87 Mbits / giy 1,803 ms 1 / 755 (0,13%) [904] 7.0- 8.0 sec 1.19 MBytes 10.0 Mbits/sec 1.831 ms 0/ 850 (0%) [904] 7,0-8,0 giy 1,19 MBytes 10,0 Mbits / sec 1,831 ms 0 / 850 (0%) [904] 8.0- 9.0 sec 1.19 MBytes 10.0 Mbits/sec 1.841 ms 0/ 850 (0%) [904] 8,0-9,0 giy 1,19 MBytes Mbits / giy 10,0 1,841 ms 0 / 850 (0%) [904] 9.0-10.0 sec 1.19 MBytes 10.0 Mbits/sec 1.801 ms 0/ 851 (0%) [904] 9,0-10,0 giy 1,19 MBytes Mbits / giy 10,0 1,801 ms 0 / 851 (0%) [904] 0.0-10.0 sec 11.8 MBytes 9.86 Mbits/sec 2.618 ms 9/ 8409 (0.11%) [904] 0,0-10,0 giy 11,8 MBytes 9,86 Mbits / giy 2,618 ms 9 / 8409 (0,11%)

Top of the page Tr v u trang

Maximum Segment Size (-m argument) display: Segment Kch thc ti a (-m tham s) hin th:

The Maximum Segment Size (MSS) is the largest amount of data, in bytes, that a computer can support in a single, unfragmented TCP segment. Kch thc ti a phn on (MSS) l s tin ln nht ca d liu, trong byte, mt my tnh c th h tr trong mt phn on, n TCP unfragmented. It can be calculated as follows: N c th c tnh nh sau: MSS = MTU - TCP & IP headers MSS = MTU - TCP tiu IP The TCP & IP headers are equal to 40 bytes. TCP tiu IP bng 40 byte. The MTU or Maximum Transmission Unit is the greatest amount of data that can be transferred in a frame. MTU hoc n v truyn dn ti a l s tin ln nht ca d liu c th c chuyn giao trong mt khung. Here are some default MTU size for different network topology: Di y l mt s kch thc MTU mc nh cho cu trc lin kt mng khc nhau: Ethernet - 1500 bytes: used in a LAN. Ethernet - 1500 byte: c s dng trong mng LAN. PPPoE - 1492 bytes: used on ADSL links. PPPoE - 1492 bytes: c s dng trn cc lin kt ADSL. Token Ring (16Mb/sec) - 17914 bytes: old technology developed by IBM. Token Ring (16Mb/sec) - 17.914 byte: cng ngh c c pht trin bi IBM. Dial-up - 576 bytes Dial-up - 576 byte

Generally, a higher MTU (and MSS) brings higher bandwidth efficiency Ni chung, mt MTU cao hn (MSS) mang li hiu qu bng thng cao hn

Client side: Pha khch hng: #iperf -c 10.1.1.1 -m # Iperf-c 10.1.1.1-m

------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.1.1.1, TCP port 5001 Khch hng kt ni n 10.1.1.1, cng TCP 5001 TCP window size: 16.0 KByte (default) TCP ca s kch thc: 16,0 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [ 3] local 10.6.2.5 port 41532 connected with 10.1.1.1 port 5001 [3] a phng 10.6.2.5 41532 cng kt ni vi 10.1.1.1 cng 5001 [ 3] 0.0-10.2 sec 1.27 MBytes 1.04 Mbits/sec [3] 0,0-10,2 giy 1,27 MBytes 1,04 Mbits / giy [ 3] MSS size 1448 bytes (MTU 1500 bytes, ethernet) [3] MSS kch thc 1448 byte (MTU 1500 bytes, ethernet )

Here the MSS is not equal to 1500 - 40 but to 1500 - 40 - 12 (Timestamps option) = 1448 Di y MSS khng bng 1500-40 nhng n 1500 - 40 - 12 (Timestamps ty chn) = 1448

Server side: Pha my ch: #iperf -s # Iperf-s

Top of the page Tr v u trang

Maximum Segment Size (-M argument) settings: Kch thc ti a b phn ci t (i s-M):

Use the -M argument to change the MSS. S dng M-tham s thay i MSS. (See the previous test for more explanations about the MSS) (Xem th nghim trc y gii thch thm v MSS) #iperf -c 10.1.1.1 -M 1300 -m # Iperf-c 10.1.1.1-M 1300-m

WARNING: attempt to set TCP maximum segment size to 1300 , but got 536 Ch : c gng thit lp kch thc phn on TCP ti a cho 1300, nhng c 536 ------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.1.1.1, TCP port 5001 Khch hng kt ni n 10.1.1.1, cng TCP 5001 TCP window size: 16.0 KByte (default) TCP ca s kch thc: 16,0 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [ 3] local 10.6.2.5 port 41533 connected with 10.1.1.1 port 5001 [3] a phng 10.6.2.5 41533 cng kt ni vi 10.1.1.1 cng 5001 [ 3] 0.0-10.1 sec 4.29 MBytes 3.58 Mbits/sec [3] 0,0-10,1 giy 4,29 MBytes 3,58 Mbits / giy [ 3] MSS size 1288 bytes (MTU 1328 bytes, unknown interface) [3] MSS kch thc 1288 byte (MTU 1328 bytes, giao din cha bit )

Server side: Pha my ch: #iperf -s # Iperf-s

Top of the page Tr v u trang

Parallel tests (-P argument): Kim tra song song (-P i s):

Use the -P argument to run parallel tests. S dng P-i s cho chy th nghim song song.

Client side: Pha khch hng: #iperf -c 10.1.1.1 -P 2 # Iperf-c 10.1.1.1-P 2

------------------------------------------------------------ -------------------------------------------------- ---------- Client connecting to 10.1.1.1, TCP port 5001 Khch hng kt ni n 10.1.1.1, cng TCP 5001 TCP window size: 16.0 KByte (default) TCP ca s kch thc: 16,0 Kbyte (mc nh) ------------------------------------------------------------ -------------------------------------------------- ---------- [ 3] local 10.6.2.5 port 41534 connected with 10.1.1.1 port 5001 [3] a phng 10.6.2.5 41534 cng kt ni vi 10.1.1.1 cng 5001 [ 4] local 10.6.2.5 port 41535 connected with 10.1.1.1 port 5001 [4] a phng 10.6.2.5 41535 cng kt ni vi 10.1.1.1 cng 5001 [ 4] 0.0-10.1 sec 1.35 MBytes 1.12 Mbits/sec [4] 0,0-10,1 giy 1,35 MBytes 1,12 Mbits / giy [ 3] 0.0-10.1 sec 1.35 MBytes 1.12 Mbits/sec [3] 0,0-10,1 giy 1,35 MBytes 1,12 Mbits / giy [SUM] 0.0-10.1 sec 2.70 MBytes 2.24 Mbits/sec [SUM] 0,0-10,1 giy 2,70 MBytes 2,24 Mbits / giy

Server side: Pha my ch: #iperf -s # Iperf-s

Top of the page Tr v u trang

Iperf help: Iperf gip : #iperf -h # Iperf-h

Usage: iperf [-s|-c host] [options] Cch s dng: iperf [-s |-c ch] [la chn] iperf [-h|--help] [-v|--version] iperf [-h - help] [-v | - phin bn]

Client/Server: Client / Server: -f -F -i -I -l -L -m -M -p -P -u -U -w -W -B -B -C -C -M -M -N -N -V -V --format - nh dng --interval - Khong thi gian --len - Len --print_mss - Print_mss --port - Port --udp - Udp --window - Ca s --bind - Bind --compatibility - Kh nng tng thch --mss - MSS --nodelay - Nodelay --IPv6Version - IPv6Version [kmKM] KmKM] # # #[KM] # [KM]

# #

#[KM] # [KM] "host" "Host"

# # format to report: Kbits, Mbits, KBytes, MBytes nh dng bo co: Kbits, Mbits, KBytes, MBytes seconds between periodic bandwidth reports giy gia cc bo co bng thng nh k length of buffer to read or write (default 8 KB) chiu di ca b m c hoc vit (mc nh 8 KB ) print TCP maximum segment size (MTU - TCP/IP header) in TCP phn khc kch thc ti a (MTU - tiu TCP / IP ) server port to listen on/connect to my ch cng lng nghe / kt ni vi use UDP rather than TCP s dng UDP kh hn so vi TCP TCP window size (socket buffer size) Kch thc ca s TCP (socket kch thc b m) bind to "host", an interface or multicast address lin kt vi "ch", mt giao din hoc a ch multicast for use with older versions does not sent extra msgs cho s dng vi phin bn c khng c gi cc thng ip thm set TCP maximum segment size (MTU - 40 bytes) thit lp TCP phn khc kch thc ti a (MTU - 40 byte ) set TCP no delay, disabling Nagle's Algorithm thit lp TCP khng chm tr, v hiu ha Nagle ca thut ton Set the domain to IPv6 Thit lp cc tn min IPv6

Server specific: My ch c th: -s -S -U -U -D -D --server - My ch --single_udp - Single_udp --daemon - Daemon run in server mode chy trong ch my ch run in single threaded UDP mode chy trong ch duy nht UDP lung run the server as a daemon chy cc my ch nh l mt daemon

Client specific: Khch hng c th: -b -B -c -C -d -D -n -N -r -R -t -T -F -F -I -I -L -L -P -P -T -T --bandwidth - Bng thng --client - Khch hng --dualtest - Dualtest --num - Num --tradeoff - S cn bng --time - Thi gian --fileinput - Fileinput --stdin - Stdin --listenport - Listenport --parallel - Song song --ttl - Ttl #[KM] # [KM] "host" "Host"

#[KM] # [KM]

# # "name" "Tn"

# # # # # # for UDP, bandwidth to send at in bits/sec (default 1 Mbit/sec, implies -u) UDP, bng thng gi ti trong bit / giy (mc nh 1 Mbit / giy, c ngha-u) run in client mode, connecting to "host" chy trong ch khch hng, kt ni vi "my ch " Do a bidirectional test simultaneously Lm mt kim tra hai chiu ng thi number of bytes to transmit (instead of -t) s byte truyn ti (thay v-t) Do a bidirectional test individually Lm mt kim tra hai chiu ring bit time in seconds to transmit for (default 10 secs) thi gian trong vi giy truyn ti (mc nh 10 giy) input the data to be transmitted from a file nhp vo cc d liu c truyn t mt tp tin input the data to be transmitted from stdin u vo d liu c truyn t thit b nhp chun port to recieve bidirectional tests back on cng nhn c cc bi kim tra hai chiu tr li number of parallel client threads to run s lng cc ch ca khch hng song song chy time-to-live, for multicast (default 1) thi gian sinh sng, cho multicast (mc nh 1)

Miscellaneous: Linh tinh: -h -H -v -V --help - Help --version - Phin bn print this message and quit in thng bo ny v b thuc l print version information and quit in thng tin phin bn v b thuc l

Top of the page Tr v u trang

JPERF JPERF

Jperf is a graphical frontend for Iperf written in Java. Jperf l mt li vo ha cho Iperf c vit bng Java.

1. 1. Installation: Ci t:

Download Jperf. Ti v Jperf .

Linux Linux

Uncompress the downloaded file: Gii nn tp tin ti v: #tar -xvf jperf2.0.0.zip # Tar-xvf jperf2.0.0.zip

Launch Jperf. Launch Jperf. #cd jperf2.0.0 # Cd jperf2.0.0 #./jperf.sh #. / Jperf.sh

If you have the following message, it means that you need to install Iperf with: "apt-get install iperf" Nu bn c thng bo sau y, n c ngha l bn cn phi ci t Iperf vi: "apt-get install iperf"

Iperf is probably not in your Path! Iperf c l khng phi trong ng dn ca bn! Please download it here 'http://dast.nlanr.net/Projects/Iperf/' Xin vui lng ti v ti y "http://dast.nlanr.net/Projects/Iperf/ and put the executable in your PATH environment variable. v thc thi trong bin mi trng PATH ca bn.

Microsoft Windows Microsoft Windows

Uncompress the downloaded file with your favorite program. Gii nn cc tp tin ti v vi chng trnh yu thch ca bn. Access the uncompressed folder called by default "jperf2.0.0" and double-click on "jperf.bat". Truy cp th mc khng nn c gi l mc nh "jperf2.0.0" v double-click vo "jperf.bat". Note that the iperf utility is already present in the /bin folder. Lu rng cc tin ch iperf hin din trong th mc / bin.

2. 2. Examples: V d:

Default settings, bandwidth measurement: Ci t mc nh, bng thng o lng: Also check " Iperf " section for more details. Ngoi ra kim tra " Iperf " bit thm chi tit.

- Linux client: - Linux khch hng:

- Windows server: - Windows my ch:

Top of the page Tr v u trang Jperf Jperf

Simultaneous bi-directional bandwidth measurement: ng thi bng thng hai chiu o lng : Also check " Iperf " section for more details. Ngoi ra kim tra " Iperf " bit thm chi tit.

- Linux client: - Linux khch hng:

- Windows server: - Windows my ch:

Top of the page Tr v u trang Jperf Jperf

Jitter measurement: Jitter o lng: Also check " Iperf " section for more details. Ngoi ra kim tra " Iperf " bit thm chi tit.

- Linux client: - Linux khch hng:

- Windows server: - Windows my ch:

Top of the page Tr v u trang Jperf Jperf