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 3k Jun 27, 2022
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 8.5k Jun 29, 2022
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 Jun 22, 2022
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 34 Jun 19, 2022
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
Wrapper for linux TCP/UDP/unix/USB socket connections

Socket Connection wrapper shared library Shared library that realize sockets connections and could transfer data-packages. Navigation Navigation Insta

Dmitry Golgovsky 7 Dec 21, 2021
Portable, single-file, protocol-agnostic TCP and UDP socket wrapper, primarily for game networking

Documentation This is a header-only library, as such most of its functional documentation is contained within the "header section" of the source code

null 62 Mar 23, 2022
📡 TCP/UDP port redirector

rinetd, by Thomas Boutell and Sam Hocevar. Released under the terms of the GNU General Public License, version 2 or later. This program is used to eff

Sam Hocevar 420 Jun 28, 2022
(Test assignment) Transfer files over the network using a homegrown UDP protocol

Требования Linux x86_64 gcc >= 4.9 (C++11) Сборка $ make Запуск $ make run -j5 -j5 позволяет серверу и четырём клиентам запуститься одновременно. В

Alexander Batischev 2 Dec 18, 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.7k Jun 27, 2022
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 17 Jun 9, 2022
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 7.7k Jun 22, 2022
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 1.2k Jun 21, 2022
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 2.1k Jun 24, 2022
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 Jun 20, 2022
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 6.1k Jun 21, 2022
Simple local P2P chat on UDP sockets

Local P2P Chat This is a fully decentralized chat. To communicate, simply run it on computers in a single local network (using one port). All messages

Anton Khalitov 15 Apr 13, 2022