sockperf 工具

目录

[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模式特点:

持续发送:客户端持续发送数据包,不等待响应

模拟真实负载:类似于实际应用中的流媒体、监控数据等

测量:单向延迟、丢包率、吞吐量
相关推荐
ouynagda1 分钟前
Linux Socket 网络编程学习笔记
linux·网络·学习
牛马也想出海4 分钟前
海外社媒代理IP:TikTok、IG等6大社媒平台防封号IP选型指南
运维·服务器·网络·新媒体运营
昌原的儿子LEO9 分钟前
【Linux网络编程】TCP套接字核心函数详解|三次握手|send/recv/listen/accept接口梳理
linux·网络·tcp/ip
实心儿儿11 分钟前
Linux —— 五种IO模型与非阻塞IO
运维·服务器
筝筝ba16 分钟前
extended/factory_reset.robot
linux·运维·服务器·网络·网络协议·p2p
wangduqiang74719 分钟前
如何借助AI申请专利不依靠代理机构
linux
优化Henry21 分钟前
5G网络切片之S-NSSAIlist相关参数解析
运维·服务器·网络·笔记·学习·信息与通信
子有内涵27 分钟前
【Linux】C++ 实现可扩展 TCP 服务器|回响、字典、远程命令
linux·运维·服务器
catino32 分钟前
spring-事务@Transactional
java·数据库·spring
新兴AI民工32 分钟前
# 【Linux内核三十六】进程管理模块:CFS负载均衡(一):sched_domain与sched_group层级构建
linux·运维·负载均衡