From 380906f451993d2b8e468d5a91e8e6c1e6c5f602 Mon Sep 17 00:00:00 2001 From: Asmir Avdicevic Date: Fri, 19 Dec 2025 08:53:23 +0100 Subject: [PATCH 1/2] feat(sims): test adverse conditions --- netsim/sims/integration/adverse.json | 278 +++++++++++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 netsim/sims/integration/adverse.json diff --git a/netsim/sims/integration/adverse.json b/netsim/sims/integration/adverse.json new file mode 100644 index 0000000..fe96e84 --- /dev/null +++ b/netsim/sims/integration/adverse.json @@ -0,0 +1,278 @@ +{ + "name": "adverse_iroh", + "cases": [ + { + "name": "direct_throttled", + "description": "Direct transfer with 4Mbit/s throttle", + "visualize": true, + "nodes": [ + { + "name": "i_srv", + "count": 1, + "cmd": "./bins/iroh-transfer provide --size=10M", + "type": "public", + "wait": 10, + "connect": { + "strategy": "none" + }, + "param_parser": "iroh_endpoint_with_addrs" + }, + { + "name": "i_get", + "count": 1, + "cmd": "time ./bins/iroh-transfer fetch --remote-direct-address=\"%s\" %s", + "type": "public", + "connect": { + "strategy": "params_with_parsed_addrs", + "node": "i_srv" + }, + "process": "short", + "parser": "iroh_cust_10M", + "integration": "magic_iroh_client", + "link": { + "bw": 4, + "latency": 200 + } + } + ] + }, + { + "name": "direct_lossy", + "description": "Direct transfer with 1% packet loss", + "visualize": true, + "nodes": [ + { + "name": "i_srv", + "count": 1, + "cmd": "./bins/iroh-transfer provide --size=10M", + "type": "public", + "wait": 10, + "connect": { + "strategy": "none" + }, + "param_parser": "iroh_endpoint_with_addrs" + }, + { + "name": "i_get", + "count": 1, + "cmd": "time ./bins/iroh-transfer fetch --remote-direct-address=\"%s\" %s", + "type": "public", + "connect": { + "strategy": "params_with_parsed_addrs", + "node": "i_srv" + }, + "process": "short", + "parser": "iroh_cust_10M", + "integration": "magic_iroh_client", + "link": { + "loss": 1, + "bw": 8, + "latency": 200 + } + } + ] + }, + { + "name": "relay_dns_throttled", + "description": "Relay+DNS transfer with 4Mbit/s throttle", + "visualize": true, + "nodes": [ + { + "name": "1_r", + "count": 1, + "cmd": "./bins/iroh-relay --dev --config-path ./data/relay.cfg", + "type": "public", + "wait": 2, + "connect": { + "strategy": "none" + } + }, + { + "name": "2_d", + "count": 1, + "cmd": "./bins/iroh-dns-server --config ./data/dns.test.cfg", + "type": "public", + "wait": 2, + "connect": { + "strategy": "none" + } + }, + { + "name": "i_srv", + "count": 1, + "cmd": "./bins/iroh-transfer provide --env dev --size=10M --relay-url=\"http://10.0.0.1:3340\" --pkarr-relay-url=\"http://10.0.0.2:8080/pkarr\" --dns-origin-domain=\"10.0.0.2:5300\"", + "type": "public", + "wait": 10, + "connect": { + "strategy": "none" + }, + "param_parser": "iroh_endpoint_with_addrs" + }, + { + "name": "i_get", + "count": 1, + "cmd": "time ./bins/iroh-transfer fetch --env dev --relay-url=\"http://10.0.0.1:3340\" --remote-relay-url=\"http://10.0.0.1:3340\" --pkarr-relay-url=\"http://10.0.0.2:8080/pkarr\" --dns-origin-domain=\"10.0.0.2:5300\" --remote-direct-address=\"%s\" %s", + "type": "public", + "connect": { + "strategy": "params_with_parsed_addrs", + "node": "i_srv" + }, + "process": "short", + "parser": "iroh_cust_10M", + "integration": "magic_iroh_client", + "link": { + "bw": 4, + "latency": 200 + } + } + ] + }, + { + "name": "relay_dns_lossy", + "description": "Relay+DNS transfer with 1% packet loss", + "visualize": true, + "nodes": [ + { + "name": "1_r", + "count": 1, + "cmd": "./bins/iroh-relay --dev --config-path ./data/relay.cfg", + "type": "public", + "wait": 2, + "connect": { + "strategy": "none" + } + }, + { + "name": "2_d", + "count": 1, + "cmd": "./bins/iroh-dns-server --config ./data/dns.test.cfg", + "type": "public", + "wait": 2, + "connect": { + "strategy": "none" + } + }, + { + "name": "i_srv", + "count": 1, + "cmd": "./bins/iroh-transfer provide --env dev --size=10M --relay-url=\"http://10.0.0.1:3340\" --pkarr-relay-url=\"http://10.0.0.2:8080/pkarr\" --dns-origin-domain=\"10.0.0.2:5300\"", + "type": "public", + "wait": 10, + "connect": { + "strategy": "none" + }, + "param_parser": "iroh_endpoint_with_addrs" + }, + { + "name": "i_get", + "count": 1, + "cmd": "time ./bins/iroh-transfer fetch --env dev --relay-url=\"http://10.0.0.1:3340\" --remote-relay-url=\"http://10.0.0.1:3340\" --pkarr-relay-url=\"http://10.0.0.2:8080/pkarr\" --dns-origin-domain=\"10.0.0.2:5300\" --remote-direct-address=\"%s\" %s", + "type": "public", + "connect": { + "strategy": "params_with_parsed_addrs", + "node": "i_srv" + }, + "process": "short", + "parser": "iroh_cust_10M", + "integration": "magic_iroh_client", + "link": { + "loss": 1, + "bw": 8, + "latency": 200 + } + } + ] + }, + { + "name": "nat_both_throttled", + "description": "Both nodes behind NAT with 4Mbit/s throttle", + "visualize": true, + "nodes": [ + { + "name": "1_r", + "count": 1, + "cmd": "./bins/iroh-relay --dev --config-path ./data/relay.cfg", + "type": "public", + "wait": 2, + "connect": { + "strategy": "none" + } + }, + { + "name": "i_srv", + "count": 1, + "cmd": "./bins/iroh-transfer provide --env dev --size=10M --relay-url=\"http://10.0.0.1:3340\"", + "type": "nat", + "wait": 10, + "connect": { + "strategy": "none" + }, + "param_parser": "iroh_endpoint_with_addrs" + }, + { + "name": "i_get", + "count": 1, + "cmd": "time ./bins/iroh-transfer fetch --env dev --relay-url=\"http://10.0.0.1:3340\" --remote-relay-url=\"http://10.0.0.1:3340\" --remote-direct-address=\"%s\" %s", + "type": "nat", + "connect": { + "strategy": "params_with_parsed_addrs", + "node": "i_srv" + }, + "process": "short", + "parser": "iroh_cust_10M", + "integration": "magic_iroh_client", + "link": { + "bw": 4, + "latency": 200 + } + } + ] + }, + { + "name": "nat_both_lossy", + "description": "Both nodes behind NAT with 1% packet loss", + "visualize": true, + "nodes": [ + { + "name": "1_r", + "count": 1, + "cmd": "./bins/iroh-relay --dev --config-path ./data/relay.cfg", + "type": "public", + "wait": 2, + "connect": { + "strategy": "none" + } + }, + { + "name": "i_srv", + "count": 1, + "cmd": "./bins/iroh-transfer provide --env dev --size=10M --relay-url=\"http://10.0.0.1:3340\"", + "type": "nat", + "wait": 10, + "connect": { + "strategy": "none" + }, + "param_parser": "iroh_endpoint_with_addrs" + }, + { + "name": "i_get", + "count": 1, + "cmd": "time ./bins/iroh-transfer fetch --env dev --relay-url=\"http://10.0.0.1:3340\" --remote-relay-url=\"http://10.0.0.1:3340\" --remote-direct-address=\"%s\" %s", + "type": "nat", + "connect": { + "strategy": "params_with_parsed_addrs", + "node": "i_srv" + }, + "process": "short", + "parser": "iroh_cust_10M", + "integration": "magic_iroh_client", + "link": { + "loss": 1, + "bw": 8, + "latency": 200 + } + } + ] + } + ] +} From eabe0f08361c263addfb34440c999a382d1fab3f Mon Sep 17 00:00:00 2001 From: Asmir Avdicevic Date: Fri, 19 Dec 2025 08:59:24 +0100 Subject: [PATCH 2/2] fix --- netsim/sims/integration/adverse.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/netsim/sims/integration/adverse.json b/netsim/sims/integration/adverse.json index fe96e84..c22e9f0 100644 --- a/netsim/sims/integration/adverse.json +++ b/netsim/sims/integration/adverse.json @@ -31,7 +31,8 @@ "integration": "magic_iroh_client", "link": { "bw": 4, - "latency": 200 + "latency": 200, + "loss": 0 } } ] @@ -122,7 +123,8 @@ "integration": "magic_iroh_client", "link": { "bw": 4, - "latency": 200 + "latency": 200, + "loss": 0 } } ] @@ -223,7 +225,8 @@ "integration": "magic_iroh_client", "link": { "bw": 4, - "latency": 200 + "latency": 200, + "loss": 0 } } ]