目录
[0. 背景介绍](#0. 背景介绍)
[1. 安装](#1. 安装)
[2 使用说明](#2 使用说明)
[2.1 sockperf server](#2.1 sockperf server)
[2.2 sockperf client](#2.2 sockperf client)
0. 背景介绍
因数据单向发送,无法测试tcp协议,使用iperf3 发送udp 数据时,因为iperf3 发送udp 数据前,需要先建立一个tcp 连接后,才开始发送udp 数据,所以不适用。
sockperf 发送udp 数据不需要提前建立tcp 连接。
1. 安装
1. 下载安装包
2. 解压安装包
[root@idpa tools]# unzip sockperf-sockperf_v2.zip
Archive: sockperf-sockperf_v2.zip
3c65ad99cd385e18f8a2a655c19826e81a4d17e8
creating: sockperf-sockperf_v2/
creating: sockperf-sockperf_v2/.ci/
inflating: sockperf-sockperf_v2/.ci/Jenkinsfile
inflating: sockperf-sockperf_v2/.ci/README.md
inflating: sockperf-sockperf_v2/.ci/artifa
......
......
......
root@idpa sockperf-sockperf_v2]# pwd
/magx/tools/sockperf-sockperf_v2
[root@idpa sockperf-sockperf_v2]#
root@idpa tools]#
[root@idpa tools]# cd sockperf-sockperf_v2/
[root@idpa sockperf-sockperf_v2]# ll
total 44
-rw-r--r-- 1 root root 79 Jul 31 18:28 authors
-rwxr-xr-x 1 root root 552 Jul 31 18:28 autogen.sh
drwxr-xr-x 2 root root 98 Jul 31 18:28 build
drwxr-xr-x 3 root root 16 Jul 31 18:28 config
-rw-r--r-- 1 root root 7073 Jul 31 18:28 configure.ac
drwxr-xr-x 3 root root 50 Jul 31 18:28 contrib
-rw-r--r-- 1 root root 1554 Jul 31 18:28 copying
drwxr-xr-x 4 root root 132 Jul 31 18:28 debian
drwxr-xr-x 2 root root 41 Jul 31 18:28 doc
-rwxr-xr-x 1 root root 1491 Jul 31 18:28 Makefile.am
-rw-r--r-- 1 root root 0 Jul 31 18:28 news
-rw-r--r-- 1 root root 3511 Jul 31 18:28 README.md
-rw-r--r-- 1 root root 1770 Jul 31 18:28 SECURITY.md
-rw-r--r-- 1 root root 5 Jul 31 18:28 sockperf-version
drwxr-xr-x 2 root root 4096 Jul 31 18:28 src
drwxr-xr-x 4 root root 4096 Jul 31 18:28 tests
drwxr-xr-x 2 root root 75 Jul 31 18:28 tools
drwxr-xr-x 3 root root 39 Jul 31 18:28 win
[root@idpa sockperf-sockperf_v2]#
[root@idpa sockperf-sockperf_v2]#
3. 开始安装
root@idpa sockperf-sockperf_v2]# pwd
/magx/tools/sockperf-sockperf_v2
[root@idpa sockperf-sockperf_v2]#
[root@idpa sockperf-sockperf_v2]# ll
total 18360
-rw-r--r-- 1 root root 45872 Dec 11 16:13 aclocal.m4
-rw-r--r-- 1 root root 79 Jul 31 18:28 authors
-rwxr-xr-x 1 root root 552 Jul 31 18:28 autogen.sh
drwxr-xr-x 2 root root 119 Dec 11 16:15 build
drwxr-xr-x 4 root root 27 Dec 11 16:13 config
-rw-r--r-- 1 root root 2898 Dec 11 16:15 config.h
-rw-r--r-- 1 root root 2599 Dec 11 16:13 config.h.in
-rw-r--r-- 1 root root 38577 Dec 11 16:15 config.log
-rwxr-xr-x 1 root root 68822 Dec 11 16:15 config.status
-rwxr-xr-x 1 root root 634482 Dec 11 16:13 configure
-rw-r--r-- 1 root root 7073 Jul 31 18:28 configure.ac
drwxr-xr-x 3 root root 50 Jul 31 18:28 contrib
-rw-r--r-- 1 root root 1554 Jul 31 18:28 copying
drwxr-xr-x 4 root root 132 Jul 31 18:28 debian
drwxr-xr-x 2 root root 57 Dec 11 16:15 doc
-rwxr-xr-x 1 root root 344844 Dec 11 16:15 libtool
-rw-r--r-- 1 root root 42245 Dec 11 16:15 Makefile
-rwxr-xr-x 1 root root 1491 Jul 31 18:28 Makefile.am
-rw-r--r-- 1 root root 43393 Dec 11 16:13 Makefile.in
-rw-r--r-- 1 root root 0 Jul 31 18:28 news
-rw-r--r-- 1 root root 3511 Jul 31 18:28 README.md
-rw-r--r-- 1 root root 1770 Jul 31 18:28 SECURITY.md
-rwxr-xr-x 1 root root 17509272 Dec 11 16:17 sockperf
-rw-r--r-- 1 root root 5 Jul 31 18:28 sockperf-version
drwxr-xr-x 3 root root 4096 Dec 11 16:17 src
-rw-r--r-- 1 root root 23 Dec 11 16:15 stamp-h1
drwxr-xr-x 4 root root 4096 Dec 11 16:15 tests
drwxr-xr-x 2 root root 110 Dec 11 16:15 tools
drwxr-xr-x 3 root root 39 Jul 31 18:28 win
[root@idpa sockperf-sockperf_v2]#
[root@idpa sockperf-sockperf_v2]# ./autogen.sh
......
......
[root@idpa sockperf-sockperf_v2]# ./configure --prefix=/usr/local
......
......
[root@idpa sockperf-sockperf_v2]# make
......
......
[root@idpa sockperf-sockperf_v2]#
[root@idpa sockperf-sockperf_v2]# make install
make[1]: Entering directory '/magx/tools/sockperf-sockperf_v2'
make[2]: Entering directory '/magx/tools/sockperf-sockperf_v2'
/usr/bin/mkdir -p '/usr/local/bin'
/bin/sh ./libtool --mode=install /usr/bin/install -c sockperf '/usr/local/bin'
libtool: install: /usr/bin/install -c sockperf /usr/local/bin/sockperf
/usr/bin/mkdir -p '/usr/local/share/doc/sockperf'
/usr/bin/install -c -m 644 README.md authors news sockperf-version copying '/usr/local/share/doc/sockperf'
make[2]: Leaving directory '/magx/tools/sockperf-sockperf_v2'
make[1]: Leaving directory '/magx/tools/sockperf-sockperf_v2'
[root@idpa sockperf-sockperf_v2]#
2 使用说明
2.1 sockperf server
sockperf Server: sockperf server -i <sockserverIP> -p <sockserver Port>
# 192.168.2.90 (sockperf Server)
# 192.168.2.221 (sockperf Client)
#***********************************************
# 192.168.2.90 (sockperf Server)
[root@idpa wangkatool]#
[root@idpa wangkatool]# sockperf server -i 11.1.1.90 -p 54321
s0 ckper千:==Vers10n#3,10-n0,01taa
sockperf:[SERVER]listen on:
【0]IP=11.1,1.90
PORT 54321#UDP
sockperf:Warmup stage (sending a few dummy messages)...
sockperf:[tid 235411]using recvfrom()to block on socket(s)

2.2 sockperf client
#***********************************************
# 192.168.2.221 (sockperf Client)
# sockperf ul -i <sockperf server IP> -p <sockperf Server Port> -m XX --client_ip <sockperf Client IP> --client_port <sockperf client port> -t <发送时间>
#注意:
1. 默认发送udp 包
under-load (ul) sockperf ul 有负载模式,模拟真实流量压力
ul模式特点:
持续发送:客户端持续发送数据包,不等待响应
模拟真实负载:类似于实际应用中的流媒体、监控数据等
测量:单向延迟、丢包率、吞吐量
