mirror of
https://github.com/TrustTunnel/TrustTunnel.git
synced 2026-04-07 16:57:26 +00:00
Squashed commit of the following: commit7b93fde43dAuthor: boommy <a.yakushin> Date: Tue Mar 3 17:13:53 2026 +0400 Make flush do nothing by default commit791d1906a5Author: boommy <a.yakushin> Date: Tue Mar 3 17:13:44 2026 +0400 Do not send deferred headers in write method commit03075b729dAuthor: boommy <a.yakushin> Date: Tue Mar 3 17:10:54 2026 +0400 Flush at the start of data exchange commit13a420a4a7Author: boommy <a.yakushin> Date: Tue Mar 3 17:05:41 2026 +0400 Consume deferred headers in flush method and utilize WaitingWritable event for it commit08ccb5b216Author: boommy <a.yakushin> Date: Tue Mar 3 17:04:15 2026 +0400 Remove consuming deferred headers from wait_writable commitfb1305d264Author: boommy <a.yakushin> Date: Tue Mar 3 17:02:12 2026 +0400 Extend ulimit for bench remote container
Architecture
The benchmark consists of 3 isolated parts:
remote-side- acts as HTTP servers for the benchmarkmiddle-box- acts as a VPN endpoint host, either WireGuard or TrustTunnellocal-side- acts as a benchmark running host, can establish tunnels to the server residing on the remote side through the VPN endpoint
How to run
Single host
-
Build docker images
cd ./bench ./single_host.sh build --client=<TrustTunnelClient.git> --endpoint=<TrustTunnel.git>This command prepares all the parts to run on the current host. To see the full set of the available options run:
./single_host.sh --help -
Run the benchmark
./single_host.sh runThis command runs all the parts of the benchmark on the current host.
Separate hosts
Assume IP addresses of host_1, host_2 and host_3 are 1.1.1.1, 2.2.2.2 and 3.3.3.3 respectively.
-
Running
host_1as a remote sidescp Dockerfile user@1.1.1.1:~ scp -r remote-side user@1.1.1.1:~ ssh user@1.1.1.1 docker build -t bench-common . docker build -t bench-rs ./remote-side docker run -d -p 8080:8080 -p 5201:5201 -p 5201:5201/udp bench-rs -
Running
host_2as a middle boxscp Dockerfile user@2.2.2.2:~ git clone <TrustTunnel.git> ./middle-box/trusttunnel-rust/trusttunnel-endpoint scp -r middle-box user@2.2.2.2:~ ssh user@2.2.2.2 docker build -t bench-common .-
WireGuard
docker build -t bench-mb-wg ./middle-box/wireguard docker run -d \ --cap-add=NET_ADMIN --cap-add=SYS_MODULE --device=/dev/net/tun \ -p 51820:51820/udp \ bench-mb-wg -
TrustTunnel
docker build \ --build-arg ENDPOINT_HOSTNAME=endpoint.bench \ -t bench-mb-ag ./middle-box/trusttunnel-rust/ docker run -d \ --cap-add=NET_ADMIN --cap-add=SYS_MODULE --device=/dev/net/tun \ -p 4433:4433 -p 4433:4433/udp \ bench-mb-ag
-
-
Run the benchmark from
host_3scp Dockerfile user@3.3.3.3:~ git clone <TrustTunnel.git> ./local-side/trusttunnel/trusttunnel-endpoint scp -r local-side user@3.3.3.3:~ ssh user@3.3.3.3 docker build -t bench-common . docker build -t bench-ls ./local-side-
No VPN
./local-side/bench.sh no-vpn bridge 1.1.1.1 results/no-vpn -
WireGuard
docker build -t bench-ls-wg ./local-side/wireguard ./local-side/bench.sh wg bridge 1.1.1.1 results/wg 2.2.2.2 -
TrustTunnel
docker build -t bench-ls-ag ./local-side/trusttunnel ./local-side/bench.sh ag bridge 1.1.1.1 results/ag 2.2.2.2 endpoint.bench
-