A TCP / UDP program supporting multiple test scenarios

Overview

sock_test

A TCP / UDP program supporting multiple test scenarios The current communication protocol only supports UDP. TCP will be supported later.

How to compile

Firstly, you need download zip source code or git clone source code.After comple, you can find binary file in output/bin

cd ~
mkdir myTest
cd myTest
git clone https://github.com/yxb1/sock_test.git
cd test
mkdir build
cd build
cmake ..
make

How to run

You have to pass the path of an XML file to the program. There are many configure parameters in the xml file. Through this file, we can flexibly configure some parameters of the program, such as src_ip, src_port, dst_port, dst_ip, interval of send in s/ms/us.

./sock_test server.xml

A xml file "server.xml" as bellow.

<?xml version="1.0" encoding="UTF-8"?>
<task_info_list>
	<version>1.0.0</version>
	<author>[email protected]</author>
	<build_time>2021-11-13 13:00:00</build_time>
	<task_info>
		<protocol identify="server">udp</protocol>
		<src_ip>172.16.5.89</src_ip>
		<src_port>55100</src_port>
		<dst_ip>172.16.5.84</dst_ip>
		<dst_port>61017</dst_port>
		<interval unit="us">100</interval>
		<!-- 1.data_info=data 就是直接由测试程序负责造数据 -->
		<!-- 2.data_info=file 测试程序直接读bin文件,意思就是文件中是数据流。len是一次性读多少数据出来 -->
		<data_info len="1100">data</data_info>
		<!-- <data_info len="1100">data</data_info> -->
		<!-- <data_info file_path="../file/test.bin" len="1100">file</data_info> -->
		<fun_property dt_src="self">just_send</fun_property>
	</task_info>
</task_info_list>

Supported scenarios

One device sends and one device receives

server.xml

...
	<task_info>
		<protocol identify="server">udp</protocol>
		<!-- 1.data_info=data The test program is directly responsible for creating data -->
		<!-- 2.data_info=file The test program directly reads the bin file, which means that the file is a data stream. How much data does len read at one time -->
		<data_info len="1100">data</data_info>
		<!-- <data_info len="1100">data</data_info> -->
		<!-- <data_info file_path="../file/test.bin" len="1100">file</data_info> -->
		<fun_property dt_src="self">just_send</fun_property>
	</task_info>
...

client.xml

...
	<task_info>
	    #If you need to count the packet loss rate, you can configure this option. If necessary, you can configure it as file or not config
		<data_info len="1100">data</data_info>
		<fun_property dt_src="self">just_recv</fun_property>
	</task_info>
...
Two devices transmit and receive at the same time, that is, full duplex communication

server.xml

...
	<task_info>
		<protocol identify="server">udp</protocol>
		<src_ip>172.16.5.89</src_ip>
		<src_port>55100</src_port>
		<dst_ip>172.16.5.84</dst_ip>
		<dst_port>61017</dst_port>
		<interval unit="ms">50</interval>
		<!-- 1.data_info=data 就是直接由测试程序负责造数据 -->
		<!-- 2.data_info=file 测试程序直接读bin文件,意思就是文件中是数据流。len是一次性读多少数据出来 -->
		<data_info file_path="../file/test.bin" len="1100">file</data_info>
		<!-- <data_info len="1100">data</data_info> -->
		<fun_property dt_src="self">send_recv</fun_property>
		<!-- <fun_property>just_recv</fun_property> -->
		<!-- <fun_property dt_src="self">send_recv</fun_property> -->
		<!-- <fun_property dt_src="opposite">send_recv</fun_property> -->
	</task_info>
...

client.xml

...
	<task_info>
	    #If you select self, the client will produce new data to the server. If you select opposite, a complete communication loop will be generated. data(server)->client->server
		<fun_property dt_src="self">send_recv</fun_property>
		<!-- <fun_property>just_recv</fun_property> -->
		<!-- <fun_property dt_src="self">send_recv</fun_property> -->
		<!-- <fun_property dt_src="opposite">send_recv</fun_property> -->
	</task_info>
...

The period of data communication is controlled by the server.

Releases(v21.12.01)
A modern C++ network library for developing high performance network services in TCP/UDP/HTTP protocols.

evpp Introduction 中文说明 evpp is a modern C++ network library for developing high performance network services using TCP/UDP/HTTP protocols. evpp provid

Qihoo 360 2.8k Dec 4, 2021
Mongoose Embedded Web Server Library - a multi-protocol embedded networking library with TCP/UDP, HTTP, WebSocket, MQTT built-in protocols, async DNS resolver, and non-blocking API.

Mongoose - Embedded Web Server / Embedded Networking Library Mongoose is a networking library for C/C++. It implements event-driven non-blocking APIs

Cesanta Software 7.7k Dec 4, 2021
Built a client-server application using TCP and UDP sockets, in which the clients can subscribe/unsubscribe to various topics.

Built a client-server application using TCP and UDP sockets, in which the clients can subscribe/unsubscribe to various topics.

null 1 Oct 15, 2021
Winpcap-based network packet capture tool, support TLS (part), UDP, ICMP, TCP, ARP, DNS and other protocol analysis, interface reference wireshark.

Winpcap-based network packet capture tool, support TLS (part), UDP, ICMP, TCP, ARP, DNS and other protocol analysis, interface reference wireshark.

null 20 Nov 26, 2021
Provide translation, currency conversion, and voting services. First using telnet you create a connection to a TCP socket, then the server connects to 3 UDP sockets hosted on other servers to do tasks.

to run micro servers g++ translator.cpp -o translator ./translator <port 1> g++ voting.cpp -o voting ./voting <port 2> g++ currency_converter.cpp -o c

Jacob Artuso 1 Oct 29, 2021
Built a peer-to-peer group based file sharing system where users could share or download files from the groups they belonged to. Supports parallel downloading with multiple file chunks from multiple peers.

Mini-Torrent Built a peer-to-peer group based file sharing system where users could share or download files from the groups they belonged to. Supports

null 1 Nov 15, 2021
Warp speed Data Transfer (WDT) is an embeddedable library (and command line tool) aiming to transfer data between 2 systems as fast as possible over multiple TCP paths.

WDT Warp speed Data Transfer Design philosophy/Overview Goal: Lowest possible total transfer time - to be only hardware limited (disc or network bandw

Facebook 2.6k Dec 7, 2021
A Tcp/Ip stack implementation on top of Solarflare ef_vi, and a C++ headers only framework for tcp multiplexing client/server.

Efvitcp Efvitcp is a tcp library using Solarflare ef_vi interface on linux, and also a tcp multiplexing framework for both C++ client and server progr

Meng Rao 16 Dec 1, 2021
an easy implementation of a multi-process tcp server and a multi-thread tcp client

一个TCP多进程服务器-多线程客户端的简单实现。 客户端类似Apache ab的测试功能,能够通过向某一个ip端口发送指定并发量和总数量的tcp短连接;服务端处理tcp短连接,每来一条消息就打印一条log。 使用cmake编译,建议在vscode里编译,或者命令行 # 终端进入目录 mkdir bu

adin 1 Nov 28, 2021
Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios

Welcome to WSLg WSLg is short for Windows Subsystem for Linux GUI and the purpose of the project is to enable support for running Linux GUI applicatio

Microsoft 6.8k Dec 1, 2021
A flexible tool for redirecting a given program's TCP traffic to SOCKS5 or HTTP proxy.

graftcp English | 简体中文 Introduction graftcp can redirect the TCP connection made by the given program [application, script, shell, etc.] to SOCKS5 or

mingang.he 1k Nov 30, 2021
ENet reliable UDP networking library

Please visit the ENet homepage at http://enet.bespin.org for installation and usage instructions. If you obtained this package from github, the quick

Lee Salzman 2k Nov 27, 2021
QUIC, a multiplexed stream transport over UDP

QUIC, a multiplexed stream transport over UDP QUIC is an experimental protocol aimed at reducing web latency over that of TCP. On the surface, QUIC is

Devsisters Corp. 1.6k Nov 27, 2021
Reliable & unreliable messages over UDP. Robust message fragmentation & reassembly. P2P networking / NAT traversal. Encryption.

GameNetworkingSockets GameNetworkingSockets is a basic transport layer for games. The features are: Connection-oriented API (like TCP) ... but message

Valve Software 5.8k Nov 30, 2021
About Add any Program in any language you like or add a hello world Program ❣️ if you like give us ⭐

Hello-World About Add any Program in any language you like or add a hello world Program ❣️ if you like give us ⭐ Give this Project a Star ⭐ If you lik

Lokesh Jangid 18 Oct 27, 2021
mTCP: A Highly Scalable User-level TCP Stack for Multicore Systems

README mTCP is a highly scalable user-level TCP stack for multicore systems. mTCP source code is distributed under the Modified BSD License. For more

null 1.7k Nov 29, 2021
FreeModbus is a Modbus ASCII/RTU and Modbus TCP implementation for embedded systems

FreeModbus is a Modbus ASCII/RTU and Modbus TCP implementation for embedded systems. It provides an implementation of the Modbus Application Protocol

Mahmood Hosseini 17 Nov 9, 2021
High performant TCP server for rtl-sdr

About Key features Share available RF bandwidth between several independent clients: Total bandwidth can be 2016000 samples/sec at 436,600,000 hz One

dernasherbrezon 87 Nov 20, 2021
A simple tcp tunnel on c using sockets Right now it only supports linux systems

A simple tcp tunnel on c using sockets Right now it only supports linux systems build BY MAKE mkdir build make cd build ./tunnel.o <localport> <rem

notaweeb 8 Sep 20, 2021