-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from NordSecurity/LLT-5652-perf
LLT-5652 Performance measurements
- Loading branch information
Showing
13 changed files
with
296 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[target.'cfg(unix)'] | ||
runner = 'sudo -E' | ||
[alias] | ||
xtask = "run --package xtask --" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM debian:bookworm-slim | ||
RUN apt-get update && apt-get install --no-install-recommends -y \ | ||
iperf3 \ | ||
iproute2 \ | ||
iputils-ping \ | ||
net-tools \ | ||
wireguard-go \ | ||
wireguard-tools \ | ||
&& rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "xtask" | ||
license = "BSD-3-Clause" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
clap = { version = "4.5", features = ["derive"] } | ||
xshell = "0.2.7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
version: '3.2' | ||
|
||
services: | ||
left: | ||
hostname: left | ||
container_name: left | ||
image: neptun-runner:0.0.1 | ||
entrypoint: /neptun/config/left.sh | ||
privileged: true | ||
depends_on: | ||
right: | ||
condition: service_healthy | ||
networks: | ||
default: | ||
ipv4_address: 176.0.0.2 | ||
volumes: | ||
- ../../target/release:/neptun/current | ||
- ../../base/target/release:/neptun/base | ||
- .:/neptun/config | ||
|
||
right: | ||
hostname: right | ||
container_name: right | ||
image: neptun-runner:0.0.1 | ||
entrypoint: /neptun/config/right.sh | ||
privileged: true | ||
healthcheck: | ||
test: ["CMD-SHELL", "cat /.iperf_ready"] | ||
interval: 1s | ||
start_interval: 1s | ||
start_period: 60s | ||
networks: | ||
default: | ||
ipv4_address: 176.0.0.3 | ||
volumes: | ||
- ../../target/release:/neptun/current | ||
- ../../base/target/release:/neptun/base | ||
- .:/neptun/config | ||
|
||
networks: | ||
default: | ||
driver: bridge | ||
ipam: | ||
config: | ||
- subnet: 176.0.0.0/24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
wireguard-go wg0 | ||
wg set wg0 \ | ||
listen-port 51820 \ | ||
private-key <(echo AH7jKt6M0RS21MkRG+URrfgmwvJqdhVvqtKeF4WR+E8=) \ | ||
peer mqrc8+LD+6zvMeCtyCcIBPEYuXT74lq1Hros0Np8ZgA= \ | ||
allowed-ips 10.0.0.2/32 \ | ||
endpoint 176.0.0.3:51820 | ||
ip address add dev wg0 10.0.0.1/24 | ||
ip link set up dev wg0 | ||
|
||
/neptun/base/neptun-cli --disable-drop-privileges wg1 | ||
wg set wg1 \ | ||
listen-port 51821 \ | ||
private-key <(echo sKZoT3qgxDm1bWny+1ttoi00qS2KXvo1L4Zb265wr3c=) \ | ||
peer CMWokCGH+YPN7CL2C2aAkDlnhw1blH0tKPOnEOgzrxM= \ | ||
allowed-ips 10.0.1.2/32 \ | ||
endpoint 176.0.0.3:51821 | ||
ip address add dev wg1 10.0.1.1/24 | ||
ip link set up dev wg1 | ||
|
||
/neptun/current/neptun-cli --disable-drop-privileges wg2 | ||
wg set wg2 \ | ||
listen-port 51822 \ | ||
private-key <(echo 0Fn5JWI1QGDiaVYLDBSLklIEBUujfpX1oH/UGI2D62k=) \ | ||
peer fqrU1Wk8nuyy6phf8IUDwcKK1ElslFYDyteANr2hlgM= \ | ||
allowed-ips 10.0.2.2/32 \ | ||
endpoint 176.0.0.3:51822 | ||
ip address add dev wg2 10.0.2.1/24 | ||
ip link set up dev wg2 | ||
|
||
echo | ||
echo "Raw network:" | ||
iperf3 -i 10 -t 10 --bidir -c 176.0.0.3 | ||
|
||
echo | ||
echo "Wireguard-go:" | ||
iperf3 -i 60 -t 120 --bidir -c 10.0.0.2 | ||
|
||
echo | ||
echo "Base NepTUN:" | ||
iperf3 -i 60 -t 120 --bidir -c 10.0.1.2 | ||
|
||
echo | ||
echo "Current NepTUN:" | ||
iperf3 -i 60 -t 120 --bidir -c 10.0.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
wireguard-go wg0 | ||
wg set wg0 \ | ||
listen-port 51820 \ | ||
private-key <(echo MLBFYI9O69v8WdVodp4YucqnvW+onpD/R5kF/GE18F8=) \ | ||
peer 7gr2QZyPpaIdlsPcZcQozgpjDdCkefZtxz12Dmpj/3Y= \ | ||
allowed-ips 10.0.0.1/32 \ | ||
endpoint 176.0.0.2:51820 | ||
ip address add dev wg0 10.0.0.2/24 | ||
ip link set up dev wg0 | ||
|
||
/neptun/base/neptun-cli --disable-drop-privileges wg1 | ||
wg set wg1 \ | ||
listen-port 51821 \ | ||
private-key <(echo WAoFbPJ6QaXXltwLqBADFkMG6qLZuivSlkIUv2Sc3lY=) \ | ||
peer HcDZRTIcI3Yok4XTwhAScKoNkb9MIZ2wyjS1oQvZnic= \ | ||
allowed-ips 10.0.1.1/32 \ | ||
endpoint 176.0.0.2:51821 | ||
ip address add dev wg1 10.0.1.2/24 | ||
ip link set up dev wg1 | ||
|
||
/neptun/current/neptun-cli --disable-drop-privileges wg2 | ||
wg set wg2 \ | ||
listen-port 51822 \ | ||
private-key <(echo eNOePaXKpyN9IjNEDe1a4CzBAwdbLupbF5wfdCUjS18=) \ | ||
peer zj6KZHkVw3ILScBGgUaYfuRkwhK6GgrIHmzfd4MPx1k= \ | ||
allowed-ips 10.0.2.1/32 \ | ||
endpoint 176.0.0.2:51822 | ||
ip address add dev wg2 10.0.2.2/24 | ||
ip link set up dev wg2 | ||
|
||
iperf3 -s > /dev/null & | ||
touch /.iperf_ready | ||
sleep infinity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
mod perf; | ||
|
||
use clap::Parser; | ||
|
||
#[derive(Parser, Debug)] | ||
enum Cmd { | ||
/// Run performance benchmark | ||
Perf(perf::Cmd), | ||
} | ||
|
||
fn main() { | ||
match Cmd::parse() { | ||
Cmd::Perf(perf) => perf.run(), | ||
} | ||
} |
Oops, something went wrong.