Skip to content

Commit

Permalink
Test to remove
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasan6979 committed Jan 16, 2025
1 parent 81e7dfd commit 30fb670
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 51 deletions.
11 changes: 7 additions & 4 deletions neptun/src/device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1068,18 +1068,19 @@ impl Device {
{
break;
}
tracing::error!(
message="Fatal read error on tun interface: errno", error=?e
println!(
"Fatal read error on tun interface {e}"
);
return Action::Exit;
}
Err(e) => {
tracing::error!(
message="Unexpected error on tun interface", error=?e
println!(
"Unexpected error on tun interface {e}"
);
return Action::Exit;
}
};
println!("got data");

let dst_addr = match Tunn::dst_address(
&element.data[DATA_OFFSET..len + DATA_OFFSET],
Expand All @@ -1103,6 +1104,7 @@ impl Device {
}

let res = {
println!("queueing for encap");
let mut tun = peer.tunnel.lock();
tun.queue_encapsulate(len, element, iter, peer.endpoint_ref(), &mut t.dst_buf[..])
};
Expand Down Expand Up @@ -1179,6 +1181,7 @@ fn send_to_network(
udp6: Arc<Socket>,
) {
while let Ok(msg) = network_rx.recv() {
println!("send_to_network");
match &msg.res {
NeptunResult::Done => {}
NeptunResult::Err(e) => {
Expand Down
54 changes: 27 additions & 27 deletions xtask/perf/left.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#!/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
# 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/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 \
Expand All @@ -30,17 +30,17 @@ wg set wg2 \
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 "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 "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 "Base NepTUN:"
# iperf3 -i 60 -t 120 --bidir -c 10.0.1.2

echo
echo "Current NepTUN:"
Expand Down
36 changes: 18 additions & 18 deletions xtask/perf/right.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#!/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
# 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/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 \
Expand Down
4 changes: 2 additions & 2 deletions xtask/src/perf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ fn build_neptun_cli(dir: &str) {

impl Cmd {
pub fn run(&self) {
let worktree = GitWorktree::new("base", &self.base);
// let worktree = GitWorktree::new("base", &self.base);
build_neptun_cli(".");
build_neptun_cli(&worktree.name);
// build_neptun_cli(&worktree.name);

let sh = Shell::new().expect("Failed to create shell object");
cmd!(
Expand Down

0 comments on commit 30fb670

Please sign in to comment.