===== Test Network =====
==== Test packet size (MTU) ====
You can check the maximum packet size on network using ping
[root@testh]/root# ping -c2 -w 10 -s 1470 nim01
1478 bytes from 172.10.10.10: icmp_seq=2 ttl=64 time=0 ms
45 00 05 c6 c3 8f 00 00 40 01 32 51 ac 15 13 8b * E.......@.2Q....
ac 15 13 8d 00 00 7b be 01 3a 00 03 64 ff 17 2d * ......{..:..d..-
00 0b 8c c0 00 84 01 3a 00 01 02 03 04 05 06 07 * .......:........
08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 * ................
18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 * ........ !"#$%&'
28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 * ()*+,-./01234567
38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 * 89:;<=>?@ABCDEFG
48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 * HIJKLMNOPQRSTUVW
58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 * XYZ[\]^_`abcdefg
68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 * hijklmnopqrstuvw
78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 * xyz{|}~.........
88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 * ................
98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 * ................
...
If packet size are to high, you 'll have a packet lost 100%
[root@testh]/root# ping -c2 -w 10 -D -s 9000 nim01
PING nim01.lu (172.10.10.10): 1500 data bytes
--- nim01.lu ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
Generate network trafic and check the packet size, here packet 1500, on NFS
[root@testh]/root# tcpdump -i en1 -vvv host myserver.lu
16:33:44.209433 IP (tos 0x0, ttl 60, id 20437, offset 0, flags [none], proto TCP (6), length 1500)
testh.lu.42305 > myserver.lu.shilp: Flags [.], cksum 0x0000 (incorrect -> 0xa6bb), seq 495870232:495871680, ack 4016785, win 65535, options [nop,nop,TS val 1698414524 ecr 4145383147], length 1448: NFS request xid 0 0 null
16:33:44.209438 IP (tos 0x0, ttl 60, id 20438, offset 0, flags [none], proto TCP (6), length 1500)
testh.lu.42305 > myserver.lu.shilp: Flags [.], cksum 0x0000 (incorrect -> 0xa113), seq 495871680:495873128, ack 4016785, win 65535, options [nop,nop,TS val 1698414524 ecr 4145383147], length 1448: NFS request xid 0 0 null
16:33:44.209445 IP (tos 0x0, ttl 60, id 20439, offset 0, flags [none], proto TCP (6), length 1500)
testh.lu.42305 > myserver.lu.shilp: Flags [.], cksum 0x0000 (incorrect -> 0x9b6b), seq 495873128:495874576, ack 4016785, win 65535, options [nop,nop,TS val 1698414524 ecr 4145383147], length 1448: NFS request xid 0 0 null
29300 packets captured
462059 packets received by filter
432674 packets dropped by kernel
==== Reset count in netstat ====
To clear some statistics for the adapters
netstat -Zv
Or
entstat -r entX
==== Using iperf ====
Iperf is a free tool available on linux, and AIX (perzl.org), also available for Windows
You must first start the iperf server (-s) to listen for communication, and the start a client (-c) which generates traffic.
In my case nimbcp is the server, and nimprod the client.
You can test for example latency (Jitter) on network using UDP (-u) protocol:
root@nimbcp - /root > iperf -s -P 5 -i 1 -u
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size: 640 KByte (default)
------------------------------------------------------------
.....
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 3] 0.0- 1.0 sec 129 KBytes 1.06 Mbits/sec 0.116 ms 0/ 89 (0%)
[ 4] 0.0- 1.0 sec 126 KBytes 1.03 Mbits/sec 0.128 ms 1/ 89 (1.1%)
[ 5] 0.0- 1.0 sec 128 KBytes 1.05 Mbits/sec 0.113 ms 1/ 89 (1.1%)
root@nimprod - /root > iperf -r -c nimbcp -P 5 -i 1 -u
WARNING: option -r is not valid for server mode
------------------------------------------------------------
Client connecting to nimbcp, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size: 64.0 KByte (default)
------------------------------------------------------------
...
[ ID] Interval Transfer Bandwidth
[ 7] 0.0- 1.0 sec 129 KBytes 1.06 Mbits/sec
[ 3] 0.0- 1.0 sec 129 KBytes 1.06 Mbits/sec
[ 4] 0.0- 1.0 sec 129 KBytes 1.06 Mbits/sec
[ 5] 0.0- 1.0 sec 129 KBytes 1.06 Mbits/sec
[ 6] 0.0- 1.0 sec 129 KBytes 1.06 Mbits/sec
[SUM] 0.0- 1.0 sec 646 KBytes 5.29 Mbits/sec
You can test for example TCP throughput on network on 5 parallel connections:
root@nimbcp - /root > iperf -s -P 5 -i 1
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 256 KByte (default)
------------------------------------------------------------
....
[ ID] Interval Transfer Bandwidth
[ 4] 0.0- 1.0 sec 33.9 MBytes 284 Mbits/sec
[ 5] 0.0- 1.0 sec 27.7 MBytes 232 Mbits/sec
[ 6] 0.0- 1.0 sec 14.2 MBytes 119 Mbits/sec
[ 7] 0.0- 1.0 sec 22.3 MBytes 187 Mbits/sec
[ 8] 0.0- 1.0 sec 7.43 MBytes 62.3 Mbits/sec
[SUM] 0.0- 1.0 sec 105 MBytes 885 Mbits/sec
root@nimprod - /root > iperf -r -c nimbcp -P 5 -i 1
WARNING: option -r is not valid for server mode
------------------------------------------------------------
Client connecting to nimbcp, TCP port 5001
TCP window size: 256 KByte (default)
------------------------------------------------------------
....
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 34.2 MBytes 287 Mbits/sec
[ 4] 0.0- 1.0 sec 28.0 MBytes 235 Mbits/sec
[ 6] 0.0- 1.0 sec 22.8 MBytes 191 Mbits/sec
[ 5] 0.0- 1.0 sec 14.4 MBytes 121 Mbits/sec
[ 7] 0.0- 1.0 sec 7.62 MBytes 64.0 Mbits/sec
[SUM] 0.0- 1.0 sec 107 MBytes 898 Mbits/sec
==== Using ftp ====
Network theoretical throughput:
^^speed bit/s^throughput Mbyte/s^throughput Gbyte/s^
||100 Mbps|12,5MB/s|45 GB/h|
||1 Gbps|125 MB/s|450 GB/h|
||10 Gbps|1,25 GB/s|4500 GB/h|
manu@mypc:/tmp> ftp 10.0.10.21
Connected to 10.0.10.21.
220 aix01 FTP server (Version 4.2 Tue Feb 19 19:37:47 CST 2013) ready.
Name (10.0.102.21:manu): root
331 Password required for root.
Password:
230-Last login: Tue Sep 15 16:09:42 CDT 2015 on /dev/pts/0 from 10.0.11.37
230 User root logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /tmp
250 CWD command successful.
ftp> bin
200 Type set to I.
ftp> put "| dd if=/dev/zero bs=32k count=10000" /dev/null
local: | dd if=/dev/zero bs=32k count=10000 remote: /dev/null
229 Entering Extended Passive Mode (|||32789|)
150 Opening data connection for /dev/null.
10000+0 records in
10000+0 records out
327680000 bytes (328 MB) copied, 27,8874 s, 11,8 MB/s
226 Transfer complete.
327680000 bytes sent in 00:27 (11.20 MiB/s)
ftp>
**Remark**
As ftp is a single threat process, you have to run multiples sessions in parallel.
create a file .netrc
machine testftp login root password root
macdef init
put "|dd if=/dev/zero bs=1M count=1000" /dev/null
bye
# chmod 400 .netrc
# for i in 1 2 3 4 5 6 7 8
do
ftp testftp | grep seconds &
done