随笔记录
目录
1 背景介绍
2. Iperf3
2.1 基本框架介绍
2.2 Iperf3 发送TCP包
2.3 IPerf 发送UDP 包
1 背景介绍
基于测试USER DMA 压力测试需求。
2. Iperf3
2.1 基本框架介绍
Iperf3 发送数据包 TCP/UDP 包
1. 查看网卡配置信息
2. 此处因共用一张板卡,所以使用网络命令空间将网卡swift1f0 与swift1f1 分隔
swift1f0: 11.1.1.73/24
swift1f1: 11.1.1.77/24 网络命令空间:netABC
# 具体配置信息查看 # https://blog.csdn.net/weixin_57632548/article/details/144208553
3. 启动Iperf3 Server 端
4. 启动Iperf3 TCP/UDP Client 端
2.2 Iperf3 发送TCP包
Iperf3 发送TCP 包
1. 查看网卡配置信息
2. 此处因共用一张板卡,所以使用网络命令空间将网卡swift1f0 与swift1f1 分隔
swift1f0: 11.1.1.73/24
swift1f1: 11.1.1.77/24 网络命令空间:netABC
# 具体配置信息查看 # https://blog.csdn.net/weixin_57632548/article/details/144208553
3. 启动Iperf3 Server 端
# iperf3 -B <网口 IP> -p <端口号> -i 1 -s
4. 启动Iperf3 UDP Client 端
# iperf3 -c <Server IP> -p <Server Port> -t <Client 发送请求时间>
//****************************************************************************
1. 查看网卡配置信息
[root@localhost ~]# ifconfig
enp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.1.22.73 netmask 255.255.255.0 broadcast 10.1.22.255
inet6 fe80::5a11:22ff:fe9e:2888 prefixlen 64 scopeid 0x20<link>
ether 58:11:22:9e:28:88 txqueuelen 1000 (Ethernet)
RX packets 36791 bytes 5299374 (5.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 84553 bytes 85625222 (81.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 94447 bytes 1482873984 (1.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 94447 bytes 1482873984 (1.3 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
swift1f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 11.1.1.73 netmask 255.255.255.0 broadcast 0.0.0.0
ether 9e:b4:77:b6:24:c2 txqueuelen 1000 (Ethernet)
RX packets 6911206643 bytes 10201401605836 (9.2 TiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 55529383 bytes 82735704767 (77.0 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:56:07:08 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]#
2. 登录终端1 ssh 10.1.22.73:
# server端:iperf3 -B 11.1.1.73 -p 12345 -i 1 -s
[root@localhost ~]#
[root@localhost ~]# iperf3 -B 11.1.1.73 -p 12345-i 1 -s
-----------------------------------------------------------
Server listening on 54320
-----------------------------------------------------------
3 登录终端2 ssh 10.1.22.73
# 执行ip netns exec netABC bash,进入namespace: 11.1.1.77
# client端:iperf3 -c 11.1.1.73 -p 12345-t 86400
[root@localhost ~]#
[root@localhost ~]# ip netns exec netABC bash
[root@localhost ~]# iperf3 -c 11.1.1.73 -p 12345 -t 40
//*******************************************************************
# 11.1.1.73 端
// Server 端:
[root@localhost ~]# iperf3 -B 11.1.1.73 -p 12345 -i 1 -s
# 11.1.1.77 端
// Client 端:
[root@localhost version]# ip netns exec netABC bash
[root@localhost version]# iperf3 -c 11.1.1.73 -p 12345 -t 40
2.3 IPerf 发送UDP 包
Iperf3 发送UDP 包
1. 查看网卡配置信息
2. 此处因共用一张板卡,所以使用网络命令空间将网卡swift1f0 与swift1f1 分隔
swift1f0: 11.1.1.73/24
swift1f1: 11.1.1.77/24 网络命令空间:netABC
# 具体配置信息查看 # https://blog.csdn.net/weixin_57632548/article/details/144208553
3. 启动Iperf3 Server 端
# iperf3 -B <网口 IP> -p <端口号> -i 1 -s
4. 启动Iperf3 UDP Client 端
# iperf3 -c <Server IP> -p <Server Port> -u -b <每秒发送数据> -t <Client 发送请求时间>
//****************************************************************************
1. 查看网卡配置信息
[root@localhost ~]# ifconfig
enp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.1.22.73 netmask 255.255.255.0 broadcast 10.1.22.255
inet6 fe80::5a11:22ff:fe9e:2888 prefixlen 64 scopeid 0x20<link>
ether 58:11:22:9e:28:88 txqueuelen 1000 (Ethernet)
RX packets 36791 bytes 5299374 (5.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 84553 bytes 85625222 (81.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 94447 bytes 1482873984 (1.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 94447 bytes 1482873984 (1.3 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
swift1f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 11.1.1.73 netmask 255.255.255.0 broadcast 0.0.0.0
ether 9e:b4:77:b6:24:c2 txqueuelen 1000 (Ethernet)
RX packets 6911206643 bytes 10201401605836 (9.2 TiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 55529383 bytes 82735704767 (77.0 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:56:07:08 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]#
2. 登录终端1 ssh 10.1.22.73:
# server端:iperf3 -B 11.1.1.73 -p 54320-i 1 -s
[root@localhost ~]#
[root@localhost ~]# iperf3 -B 11.1.1.73 -p 54320-i 1 -s
-----------------------------------------------------------
Server listening on 54320
-----------------------------------------------------------
3 登录终端2 ssh 10.1.22.73
# 执行ip netns exec netABC bash,进入namespace: 11.1.1.77
# client端:iperf3 -c 11.1.1.73 -p 54320 -u -b 10000m -t 86400
[root@localhost ~]#
[root@localhost ~]# ip netns exec netABC bash
[root@localhost ~]# iperf3 -c 11.1.1.73 -p 54320 -u -b 10000m -t 86400
//*******************************************************************
# 11.1.1.73 端
// Server 端:
[root@localhost ~]# iperf3 -B 11.1.1.73 -p 54320-i 1 -s
# 11.1.1.77 端
// Client 端:
[root@localhost version]# ip netns exec netABC bash
[root@localhost version]# iperf3 -c 11.1.1.73 -p 54320 -u -b 10000m -t 86400
到此已基本介绍完Iperf3 工具基本功能