diff --git a/QUICK_XP.txt b/QUICK_XP.txt new file mode 100644 index 0000000..16bcfda --- /dev/null +++ b/QUICK_XP.txt @@ -0,0 +1,17 @@ +curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - +add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/debian \ + $(lsb_release -cs) \ + stable" + +apt-get update +apt-get install -y docker-ce docker-ce-cli containerd.io + +wget https://gitlab.inria.fr/qdufour/donar/raw/master/scripts/Makefile +wget https://gitlab.inria.fr/qdufour/donar/raw/master/scripts/run-3 +chmod +x run-3 + +docker login registry.gitlab.inria.fr +docker pull registry.gitlab.inria.fr/qdufour/donar + +make ... diff --git a/scripts/Makefile b/scripts/Makefile index 32db450..9e65dc1 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -690,11 +690,7 @@ jan_tor_analysis: jan_battle_normal: ./run-3 \ - 8,jan_battle_normal. \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ + 32,jan_battle_normal. \ orig-client 135000 40 172, \ orig-client 135000 40 172, \ orig-client 135000 40 172, \ @@ -703,22 +699,10 @@ jan_battle_normal: dup2-client 135000 40 172 2, \ dup2-client 135000 40 172 2, \ dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ @@ -727,14 +711,6 @@ jan_battle_normal: orig-server 135000 40 172, \ orig-server 135000 40 172, \ orig-server 135000 40 172, \ - orig-server 135000 40 172, \ - orig-server 135000 40 172, \ - orig-server 135000 40 172, \ - orig-server 135000 40 172, \ - dup2-server 135000 40 172 2, \ - dup2-server 135000 40 172 2, \ - dup2-server 135000 40 172 2, \ - dup2-server 135000 40 172 2, \ dup2-server 135000 40 172 2, \ dup2-server 135000 40 172 2, \ dup2-server 135000 40 172 2, \ @@ -743,90 +719,46 @@ jan_battle_normal: lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16. \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16. + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12. \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12. jan_battle_hardened: ./run-3 \ - 8,jan_battle_hardened. \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ + 32,jan_battle_hardened. \ orig-client 135000 40 172, \ orig-client 135000 40 172, \ orig-client 135000 40 172, \ @@ -835,22 +767,10 @@ jan_battle_hardened: dup2-client 135000 40 172 2, \ dup2-client 135000 40 172 2, \ dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ @@ -859,14 +779,6 @@ jan_battle_hardened: orig-server 135000 40 172, \ orig-server 135000 40 172, \ orig-server 135000 40 172, \ - orig-server 135000 40 172, \ - orig-server 135000 40 172, \ - orig-server 135000 40 172, \ - orig-server 135000 40 172, \ - dup2-server 135000 40 172 2, \ - dup2-server 135000 40 172 2, \ - dup2-server 135000 40 172 2, \ - dup2-server 135000 40 172 2, \ dup2-server 135000 40 172 2, \ dup2-server 135000 40 172 2, \ dup2-server 135000 40 172 2, \ @@ -875,14 +787,6 @@ jan_battle_hardened: lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ lightning-server 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ @@ -902,22 +806,6 @@ jan_battle_hardened: tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ - tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2. \ tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2, \ @@ -934,6 +822,180 @@ jan_battle_hardened: tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2. + +jan_battle_light: + ./run-3 \ + 32,jan_battle_light. \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + orig-client 135000 40 172, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + dup2-client 135000 40 172 2, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ + orig-server-single 135000 40 172, \ + orig-server-single 135000 40 172, \ + orig-server-single 135000 40 172, \ + orig-server-single 135000 40 172, \ + dup2-server-single 135000 40 172 2, \ + dup2-server-single 135000 40 172 2, \ + dup2-server-single 135000 40 172 2, \ + dup2-server-single 135000 40 172 2, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ + lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12. \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12. + + +jan_dcall_normal: + ./run-3 \ + 32,jan_dcall_normal. \ + dcall-simple-client 1 360, \ + dcall-simple-client 1 360, \ + dcall-simple-client 1 360, \ + dcall-simple-client 1 360, \ + dcall-dup2-client 2 352, \ + dcall-dup2-client 2 352, \ + dcall-dup2-client 2 352, \ + dcall-dup2-client 2 352, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 213, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 213, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 213, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 213, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 176, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 176, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 176, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 176. \ + dcall-simple-server 1 360, \ + dcall-simple-server 1 360, \ + dcall-simple-server 1 360, \ + dcall-simple-server 1 360, \ + dcall-dup2-server 2 352, \ + dcall-dup2-server 2 352, \ + dcall-dup2-server 2 352, \ + dcall-dup2-server 2 352, \ + dcall-lightning-server 12 fast_count=3!tick_tock=1!measlat=0!window=2000 213, \ + dcall-lightning-server 12 fast_count=3!tick_tock=1!measlat=0!window=2000 213, \ + dcall-lightning-server 12 fast_count=3!tick_tock=1!measlat=0!window=2000 213, \ + dcall-lightning-server 12 fast_count=3!tick_tock=1!measlat=0!window=2000 213, \ + dcall-lightning-server 12 fast_count=3!tick_tock=0!measlat=0!window=2000 176, \ + dcall-lightning-server 12 fast_count=3!tick_tock=0!measlat=0!window=2000 176, \ + dcall-lightning-server 12 fast_count=3!tick_tock=0!measlat=0!window=2000 176, \ + dcall-lightning-server 12 fast_count=3!tick_tock=0!measlat=0!window=2000 176. \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12. \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12. + +jan_dcall_hardened: + ./run-3 \ + 32,jan_dcall_hardened. \ + dcall-simple-client 1 360, \ + dcall-simple-client 1 360, \ + dcall-simple-client 1 360, \ + dcall-simple-client 1 360, \ + dcall-dup2-client 2 360, \ + dcall-dup2-client 2 360, \ + dcall-dup2-client 2 360, \ + dcall-dup2-client 2 360, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 360, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 360, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 360, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 360, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 311, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 311, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 311, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 311. \ + dcall-simple-server 1 360, \ + dcall-simple-server 1 360, \ + dcall-simple-server 1 360, \ + dcall-simple-server 1 360, \ + dcall-dup2-server 2 360, \ + dcall-dup2-server 2 360, \ + dcall-dup2-server 2 360, \ + dcall-dup2-server 2 360, \ + dcall-lightning-server 12 fast_count=3!tick_tock=1!measlat=0!window=2000 360, \ + dcall-lightning-server 12 fast_count=3!tick_tock=1!measlat=0!window=2000 360, \ + dcall-lightning-server 12 fast_count=3!tick_tock=1!measlat=0!window=2000 360, \ + dcall-lightning-server 12 fast_count=3!tick_tock=1!measlat=0!window=2000 360, \ + dcall-lightning-server 12 fast_count=3!tick_tock=0!measlat=0!window=2000 311, \ + dcall-lightning-server 12 fast_count=3!tick_tock=0!measlat=0!window=2000 311, \ + dcall-lightning-server 12 fast_count=3!tick_tock=0!measlat=0!window=2000 311, \ + dcall-lightning-server 12 fast_count=3!tick_tock=0!measlat=0!window=2000 311. \ tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2, \ @@ -949,139 +1011,88 @@ jan_battle_hardened: tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2. \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ + tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2, \ tor3 -f /etc/torrc_guard_2. - -jan_battle_light: + +jan_dcall_light: ./run-3 \ - 8,jan_battle_light. \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ - orig-client 135000 40 172, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - dup2-client 135000 40 172 2, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-client 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ - orig-server-single 135000 40 172, \ - orig-server-single 135000 40 172, \ - orig-server-single 135000 40 172, \ - orig-server-single 135000 40 172, \ - orig-server-single 135000 40 172, \ - orig-server-single 135000 40 172, \ - orig-server-single 135000 40 172, \ - orig-server-single 135000 40 172, \ - dup2-server-single 135000 40 172 2, \ - dup2-server-single 135000 40 172 2, \ - dup2-server-single 135000 40 172 2, \ - dup2-server-single 135000 40 172 2, \ - dup2-server-single 135000 40 172 2, \ - dup2-server-single 135000 40 172 2, \ - dup2-server-single 135000 40 172 2, \ - dup2-server-single 135000 40 172 2, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=1!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000, \ - lightning-server-single 135000 40 172 12 fast_count=3!tick_tock=0!measlat=1!window=2000. \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16, \ - tor2 -f /etc/torrc_guard_16. \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16, \ - tor2 -f /etc/torrc_single_hop_16. - - + 32,jan_dcall_light. \ + dcall-simple-client 1 360, \ + dcall-simple-client 1 360, \ + dcall-simple-client 1 360, \ + dcall-simple-client 1 360, \ + dcall-dup2-client 2 355, \ + dcall-dup2-client 2 355, \ + dcall-dup2-client 2 355, \ + dcall-dup2-client 2 355, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 198, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 198, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 198, \ + dcall-lightning-client 12 fast_count=3!tick_tock=1!measlat=0!window=2000 198, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 153, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 153, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 153, \ + dcall-lightning-client 12 fast_count=3!tick_tock=0!measlat=0!window=2000 153. \ + dcall-simple-server-single 1 360, \ + dcall-simple-server-single 1 360, \ + dcall-simple-server-single 1 360, \ + dcall-simple-server-single 1 360, \ + dcall-dup2-server-single 2 355, \ + dcall-dup2-server-single 2 355, \ + dcall-dup2-server-single 2 355, \ + dcall-dup2-server-single 2 355, \ + dcall-lightning-server-single 12 fast_count=3!tick_tock=1!measlat=0!window=2000 198, \ + dcall-lightning-server-single 12 fast_count=3!tick_tock=1!measlat=0!window=2000 198, \ + dcall-lightning-server-single 12 fast_count=3!tick_tock=1!measlat=0!window=2000 198, \ + dcall-lightning-server-single 12 fast_count=3!tick_tock=1!measlat=0!window=2000 198, \ + dcall-lightning-server-single 12 fast_count=3!tick_tock=0!measlat=0!window=2000 153, \ + dcall-lightning-server-single 12 fast_count=3!tick_tock=0!measlat=0!window=2000 153, \ + dcall-lightning-server-single 12 fast_count=3!tick_tock=0!measlat=0!window=2000 153, \ + dcall-lightning-server-single 12 fast_count=3!tick_tock=0!measlat=0!window=2000 153. \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12, \ + tor2 -f /etc/torrc_guard_12. \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12, \ + tor2 -f /etc/torrc_single_hop_12. diff --git a/scripts/container/dcall-dup2-client b/scripts/container/dcall-dup2-client new file mode 100755 index 0000000..eb8ea62 --- /dev/null +++ b/scripts/container/dcall-dup2-client @@ -0,0 +1,20 @@ +#!/bin/bash +mkdir -p $3/{log,shared,res} + +donar \ + -a dup2 \ + -c \ + -o $3/shared/onion_services.pub \ + -l $1 \ + -e 5000 \ + -r 5000 \ +> $3/log/client-donar-stdout.log 2> $3/log/client-donar-stderr.log & + +dcall \ + -t filesrc \ + -a file:///assets/i_have_a_dream.mp3 \ + -s fakesink \ + -b 127.0.0.1 \ + -l $2 \ + -d $3/log/client-dcall-gstreamer.log \ +> $3/log/client-dcall-stdout.log 2> $3/log/client-dcall-stderr.log diff --git a/scripts/container/dcall-dup2-server b/scripts/container/dcall-dup2-server new file mode 100755 index 0000000..84d5d14 --- /dev/null +++ b/scripts/container/dcall-dup2-server @@ -0,0 +1,20 @@ +#!/bin/bash +mkdir -p $3/{log,shared} +cd $3/shared + +donar \ + -a dup2 \ + -s \ + -l $1 \ + -e 5000 \ + -r 5000 \ +> ../log/server-donar-stdout.log 2> ../log/server-donar-stderr.log & + +dcall \ + -t filesrc \ + -a file:///assets/i_have_a_dream.mp3 \ + -s fakesink \ + -b 127.0.0.1 \ + -l $2 \ + -d ../log/server-dcall-gstreamer.log \ +> ../log/server-dcall-stdout.log 2> ../log/server-dcall-stderr.log diff --git a/scripts/container/dcall-dup2-server-single b/scripts/container/dcall-dup2-server-single new file mode 100755 index 0000000..f3dc076 --- /dev/null +++ b/scripts/container/dcall-dup2-server-single @@ -0,0 +1,21 @@ +#!/bin/bash +mkdir -p $3/{log,shared} +cd $3/shared + +donar \ + -a dup2 \ + -s \ + -n \ + -l $1 \ + -e 5000 \ + -r 5000 \ +> ../log/server-donar-stdout.log 2> ../log/server-donar-stderr.log & + +dcall \ + -t filesrc \ + -a file:///assets/i_have_a_dream.mp3 \ + -s fakesink \ + -b 127.0.0.1 \ + -l $2 \ + -d ../log/server-dcall-gstreamer.log \ +> ../log/server-dcall-stdout.log 2> ../log/server-dcall-stderr.log diff --git a/scripts/container/dcall-lightning-client b/scripts/container/dcall-lightning-client index 886d326..6be6a5b 100755 --- a/scripts/container/dcall-lightning-client +++ b/scripts/container/dcall-lightning-client @@ -13,8 +13,9 @@ donar \ dcall \ -t filesrc \ - -a /assets/i_have_a_dream.mp3 \ + -a file:///assets/i_have_a_dream.mp3 \ -s fakesink \ + -b 127.0.0.1 \ -l $3 \ - -d $4/log/server-dcall-gstreamer.log \ + -d $4/log/client-dcall-gstreamer.log \ > $4/log/client-dcall-stdout.log 2> $4/log/client-dcall-stderr.log diff --git a/scripts/container/dcall-lightning-server b/scripts/container/dcall-lightning-server index ec9db4f..6080146 100755 --- a/scripts/container/dcall-lightning-server +++ b/scripts/container/dcall-lightning-server @@ -13,8 +13,9 @@ donar \ dcall \ -t filesrc \ - -a /assets/i_have_a_dream.mp3 \ + -a file:///assets/i_have_a_dream.mp3 \ -s fakesink \ + -b 127.0.0.1 \ -l $3 \ -d ../log/server-dcall-gstreamer.log \ > ../log/server-dcall-stdout.log 2> ../log/server-dcall-stderr.log diff --git a/scripts/container/dcall-lightning-server-single b/scripts/container/dcall-lightning-server-single new file mode 100755 index 0000000..0a40a42 --- /dev/null +++ b/scripts/container/dcall-lightning-server-single @@ -0,0 +1,22 @@ +#!/bin/bash +mkdir -p $4/{log,shared} +cd $4/shared + +donar \ + -a lightning \ + -s \ + -n \ + -l $1 \ + -p $2 \ + -e 5000 \ + -r 5000 \ +> ../log/server-donar-stdout.log 2> ../log/server-donar-stderr.log & + +dcall \ + -t filesrc \ + -a file:///assets/i_have_a_dream.mp3 \ + -s fakesink \ + -b 127.0.0.1 \ + -l $3 \ + -d ../log/server-dcall-gstreamer.log \ +> ../log/server-dcall-stdout.log 2> ../log/server-dcall-stderr.log diff --git a/scripts/container/dcall-simple-client b/scripts/container/dcall-simple-client new file mode 100755 index 0000000..a134737 --- /dev/null +++ b/scripts/container/dcall-simple-client @@ -0,0 +1,20 @@ +#!/bin/bash +mkdir -p $3/{log,shared,res} + +donar \ + -a naive \ + -c \ + -o $3/shared/onion_services.pub \ + -l $1 \ + -e 5000 \ + -r 5000 \ +> $3/log/client-donar-stdout.log 2> $3/log/client-donar-stderr.log & + +dcall \ + -t filesrc \ + -a file:///assets/i_have_a_dream.mp3 \ + -s fakesink \ + -b 127.0.0.1 \ + -l $2 \ + -d $3/log/client-dcall-gstreamer.log \ +> $3/log/client-dcall-stdout.log 2> $3/log/client-dcall-stderr.log diff --git a/scripts/container/dcall-simple-server b/scripts/container/dcall-simple-server new file mode 100755 index 0000000..eae200a --- /dev/null +++ b/scripts/container/dcall-simple-server @@ -0,0 +1,20 @@ +#!/bin/bash +mkdir -p $3/{log,shared} +cd $3/shared + +donar \ + -a naive \ + -s \ + -l $1 \ + -e 5000 \ + -r 5000 \ +> ../log/server-donar-stdout.log 2> ../log/server-donar-stderr.log & + +dcall \ + -t filesrc \ + -a file:///assets/i_have_a_dream.mp3 \ + -s fakesink \ + -b 127.0.0.1 \ + -l $2 \ + -d ../log/server-dcall-gstreamer.log \ +> ../log/server-dcall-stdout.log 2> ../log/server-dcall-stderr.log diff --git a/scripts/container/dcall-simple-server-single b/scripts/container/dcall-simple-server-single new file mode 100755 index 0000000..99475bf --- /dev/null +++ b/scripts/container/dcall-simple-server-single @@ -0,0 +1,21 @@ +#!/bin/bash +mkdir -p $3/{log,shared} +cd $3/shared + +donar \ + -a naive \ + -s \ + -n \ + -l $1 \ + -e 5000 \ + -r 5000 \ +> ../log/server-donar-stdout.log 2> ../log/server-donar-stderr.log & + +dcall \ + -t filesrc \ + -a file:///assets/i_have_a_dream.mp3 \ + -s fakesink \ + -b 127.0.0.1 \ + -l $2 \ + -d ../log/server-dcall-gstreamer.log \ +> ../log/server-dcall-stdout.log 2> ../log/server-dcall-stderr.log diff --git a/scripts/jantoran_2.py b/scripts/jantoran_2.py index 8a7decb..3205dbc 100755 --- a/scripts/jantoran_2.py +++ b/scripts/jantoran_2.py @@ -25,8 +25,11 @@ def compute_dropped(s): s['current']['missing'].append((start, s['current']['npkt'], 1+s['current']['npkt']-start)) t = s['current']['missing'] - t = filter(lambda p: (lambda start, stop, diff: start != 0)(*p), t) + # Don't consider first 10 seconds are links are still being connected + t = filter(lambda p: (lambda start, stop, diff: start > 250)(*p), t) + # Below 1 second continuous drop, don't consider the call dropped t = filter(lambda p: (lambda start, stop, diff: diff > 25)(*p), t) + # Don't consider the last drop as it is already parsed elsewhere t = filter(lambda p: (lambda start, stop, diff: stop != s['current']['npkt'])(*p), t) t = [x for x in t] if len(t) > 0: diff --git a/scripts/run-3 b/scripts/run-3 index f7dd03b..aad4727 100755 --- a/scripts/run-3 +++ b/scripts/run-3 @@ -39,6 +39,7 @@ done echo ":: Bootstrap" echo "Create output folder..." +docker pull registry.gitlab.inria.fr/qdufour/donar docker run \ --rm \ --user root \ diff --git a/src/algo_lightning.c b/src/algo_lightning.c index e87146a..6ce3c06 100644 --- a/src/algo_lightning.c +++ b/src/algo_lightning.c @@ -77,7 +77,7 @@ struct light_ctx { int16_t local_stats[MAX_LINKS]; struct timing_entry historic[HISTORIC_SIZE]; struct link_status status[MAX_LINKS]; - uint8_t used; + uint8_t active; uint64_t pkt_rcv_id; uint64_t pkt_sent_id; uint64_t uniq_pkt_sent_id; @@ -119,6 +119,7 @@ void algo_lightning_init(struct evt_core_ctx* ctx, struct algo_ctx* app_ctx, str lightc->pkt_sent_id = 1; lightc->uniq_pkt_sent_id = 1; lightc->disable_scheduler = 0; + lightc->active = 0; lightc->sched_strat = SCHEDULE_BOTH; uint64_t window = 2000; @@ -142,9 +143,8 @@ void algo_lightning_init(struct evt_core_ctx* ctx, struct algo_ctx* app_ctx, str for (int i = 0; i < lightc->sent_past_links; i++) lightc->prev_links[i] = UINT8_MAX; - lightc->used = lightc->fast_count * 2; for (int i = 0; i < lightc->total_links; i++) { - lightc->status[i].used = i < lightc->used ? LINK_SLOW : LINK_NOT_USED; + lightc->status[i].used = LINK_NOT_USED; } union abstract_packet m; @@ -294,12 +294,14 @@ int algo_lightning_on_stream(struct evt_core_ctx* ctx, struct evt_core_fdinfo* f int compare_stat_entry_max(const void *a, const void *b) { const struct stat_entry *sea = a, *seb = b; - if (sea->ooo == -1) return 1; - if (seb->ooo == -1) return -1; - return sea->ooo - seb->ooo; + int ra = sea->ooo; + int rb = seb->ooo; + if (ra < 0) ra = INT16_MAX + -ra; + if (rb < 0) rb = INT16_MAX + -rb; + return ra - rb; } -void algo_lightning_update_stats (struct light_ctx *lightc) { +void algo_lightning_update_stats (struct light_ctx *lightc, struct evt_core_ctx* ctx) { struct timespec now, not_before = {0}, temp_time; set_now(&now); timespec_diff (&now, &lightc->window, ¬_before); @@ -319,22 +321,19 @@ void algo_lightning_update_stats (struct light_ctx *lightc) { int64_t delta = 0; switch (lightc->historic[i].state) { case IN_ORDER: - lightc->stats[l].ooo += delta; - lightc->stats[l].meas_occ += 1; + delta = 0; break; case OOO_ONGOING: timespec_diff(&now, &lightc->historic[i].detected_at, &temp_time); delta = timespec_get_unit (&temp_time, MILISEC); - lightc->stats[l].ooo += delta; - lightc->stats[l].meas_occ += 1; break; case OOO_DONE: timespec_diff(&lightc->historic[i].finished_at, &lightc->historic[i].detected_at, &temp_time); delta = timespec_get_unit (&temp_time, MILISEC); - lightc->stats[l].ooo += delta; - lightc->stats[l].meas_occ += 1; break; } + lightc->stats[l].ooo += delta; + lightc->stats[l].meas_occ += 1; if (lightc->explain) printf("(stats.compute) packet=%ld, link=%d, status=%s, delta=%ld\n", lightc->historic[i].pkt_id, l, ooo_state_str[lightc->historic[i].state], delta); lightc->stats[l].link_id = l; @@ -348,17 +347,18 @@ void algo_lightning_update_stats (struct light_ctx *lightc) { // Compute average for (int i = 0; i < lightc->total_links; i++) { - if (lightc->stats[i].meas_occ <= 0) continue; - lightc->stats[i].ooo = lightc->stats[i].ooo / lightc->stats[i].meas_occ; + if (lightc->stats[i].meas_occ <= 0) lightc->stats[i].ooo = -1; + else lightc->stats[i].ooo = lightc->stats[i].ooo / lightc->stats[i].meas_occ; + + lightc->local_stats[i] = lightc->stats[i].ooo; } // Set my local stats + merge remote stats for (int i = 0; i < lightc->total_links; i++) { - lightc->local_stats[i] = lightc->stats[i].ooo; /* AVG */ - if (lightc->remote_stats[i] == -1) continue; - if (lightc->stats[i].ooo == -1) lightc->stats[i].ooo = lightc->remote_stats[i]; + if (lightc->remote_stats[i] < 0) continue; + if (lightc->stats[i].ooo < 0) lightc->stats[i].ooo = lightc->remote_stats[i]; else lightc->stats[i].ooo = (lightc->remote_stats[i] + lightc->stats[i].ooo) / 2; /* MAX @@ -368,6 +368,14 @@ void algo_lightning_update_stats (struct light_ctx *lightc) { } */ } + // Disable broken links + char url[256]; + for (int i = 0; i < lightc->total_links; i++) { + sprintf(url, "tcp:write:127.0.0.1:%d", 7500 + i); + struct evt_core_fdinfo *to_fdinfo = evt_core_get_from_url (ctx, url); + if (to_fdinfo == NULL) lightc->stats[i].ooo = -2; + } + // Sort if (!lightc->disable_scheduler) { qsort(lightc->stats, lightc->total_links, sizeof(struct stat_entry), compare_stat_entry_max); @@ -384,12 +392,18 @@ int send_message(struct evt_core_ctx* ctx, struct buffer_packet* bp) { struct algo_ctx* app_ctx = cat->app_ctx; struct light_ctx* lightc = app_ctx->misc; - if (lightc->selected_link >= lightc->total_links) return 0; + if (lightc->selected_link >= lightc->total_links) { + fprintf(stderr, "[algo_lightning] PACKET DROPPED! Selected link id %d is greater than the total number of links %d\n", lightc->selected_link, lightc->total_links); + return 0; + } set_now(&lightc->status[lightc->selected_link].last); sprintf(url, "tcp:write:127.0.0.1:%d", 7500 + lightc->selected_link); struct evt_core_fdinfo *to_fdinfo = evt_core_get_from_url (ctx, url); - if (to_fdinfo == NULL) return 0; + if (to_fdinfo == NULL) { + fprintf(stderr, "[algo_lightning] PACKET DROPPED! We don't have any entry for %s currently\n", url); + return 0; + } struct buffer_packet* bp_dup = dup_buffer_tow (&app_ctx->br, bp, to_fdinfo); @@ -452,16 +466,17 @@ void algo_lightning_update_used(struct light_ctx *lightc, struct timespec *now) timespec_diff(now, &lightc->window, ¬_before); if (timespec_gt(&lightc->last_update_used, ¬_before)) return; - int used_to_not = 0, not_to_used = 0; + int used_to_not = -1, not_to_used = -1; int64_t max_ooo = 0; for (int i = 0; i < lightc->total_links; i++) { if (lightc->status[lightc->stats[i].link_id].used == LINK_FAST || lightc->status[lightc->stats[i].link_id].used == LINK_SLOW) { - int64_t retained_ooo = lightc->stats[i].ooo == -1 ? INT64_MAX : lightc->stats[i].ooo; + int64_t retained_ooo = lightc->stats[i].ooo < 0 ? INT64_MAX : lightc->stats[i].ooo; if (retained_ooo >= max_ooo) { max_ooo = retained_ooo; used_to_not = lightc->stats[i].link_id; } } else { + if (lightc->stats[i].ooo == -2) continue; if (timespec_lt(&lightc->status[lightc->stats[i].link_id].last, &oldest)) { oldest = lightc->status[lightc->stats[i].link_id].last; not_to_used = lightc->stats[i].link_id; @@ -469,27 +484,20 @@ void algo_lightning_update_used(struct light_ctx *lightc, struct timespec *now) } } - // Do we have a good link not used? - /*for (int i = 0; i < lightc->used; i++) { - if (lightc->status[lightc->stats[i].link_id].used == LINK_NOT_USED) { - not_to_used = lightc->stats[i].link_id; - break; - } - }*/ - // Swap them //printf("Link %d will be disabled, %d will be enabled\n", used_to_not, not_to_used); + if (used_to_not < 0 || not_to_used < 0) return; lightc->status[used_to_not].used = LINK_NOT_USED; lightc->status[not_to_used].used = LINK_SLOW; lightc->last_update_used = *now; } -void algo_lightning_link_cat(struct light_ctx *lightc) { +void algo_lightning_link_cat(struct light_ctx *lightc, int cur_fast_count) { uint8_t used = 0; //printf("---\n"); for (int i = 0; i < lightc->total_links; i++) { if (lightc->status[lightc->stats[i].link_id].used != LINK_NOT_USED) { - if (used < lightc->fast_count) lightc->status[lightc->stats[i].link_id].used = LINK_FAST; + if (used < cur_fast_count) lightc->status[lightc->stats[i].link_id].used = LINK_FAST; else lightc->status[lightc->stats[i].link_id].used = LINK_SLOW; used++; } @@ -507,15 +515,34 @@ int algo_lightning_on_datagram(struct evt_core_ctx* ctx, struct evt_core_fdinfo* // Pad packet algo_lightning_pad (ctx, fdinfo, bp); - // Compute stats - algo_lightning_update_stats(lightc); + // Prepare links + algo_lightning_update_stats(lightc, ctx); + + // Adapt tags quantity to active links + struct evt_core_cat *cat = evt_core_get_from_cat (ctx, "tcp-write"); + int target_to_use = lightc->fast_count*2 < cat->socklist->len ? lightc->fast_count*2 : cat->socklist->len; + int diff = target_to_use - ((int) lightc->active); + for (int i = 0; i < lightc->total_links && diff > 0; i++) { + if (lightc->status[lightc->stats[i].link_id].used != LINK_NOT_USED) continue; + lightc->status[lightc->stats[i].link_id].used = LINK_SLOW; + diff--; + } + for (int i = lightc->total_links-1; i >= 0 && diff < 0; i--) { + if (lightc->status[lightc->stats[i].link_id].used == LINK_NOT_USED) continue; + lightc->status[lightc->stats[i].link_id].used = LINK_NOT_USED; + diff++; + } + + lightc->active = target_to_use; + + // Update link tags algo_lightning_update_used(lightc, &now); - algo_lightning_link_cat(lightc); + algo_lightning_link_cat(lightc, target_to_use/2); if (ctx->verbose > 1) { - printf("after sort: "); + printf("link ranking (%d fast links, %d total links)\nposition | port | score | class \n", target_to_use/2, target_to_use); for (int i = 0; i < lightc->total_links; i++) { - printf("%d (%ld), ", lightc->stats[i].link_id, lightc->stats[i].ooo); + printf("%8d | %4d | %9ld | %9s \n", i, lightc->stats[i].link_id+7500, lightc->stats[i].ooo, link_cat_str[lightc->status[lightc->stats[i].link_id].used]); } printf("\n"); } @@ -526,7 +553,7 @@ int algo_lightning_on_datagram(struct evt_core_ctx* ctx, struct evt_core_fdinfo* if (lightc->sched_strat == SCHEDULE_BOTH || lightc->sched_strat == SCHEDULE_FAST) { sel_link_last = now; lightc->selected_link = UINT8_MAX; - for (int i = 0, j = 0; i < lightc->total_links && j < lightc->fast_count; i++) { + for (int i = 0; i < lightc->total_links; i++) { if (lightc->status[lightc->stats[i].link_id].used != LINK_FAST) continue; if (timespec_lt (&lightc->status[lightc->stats[i].link_id].last, &sel_link_last)) { lightc->selected_link = lightc->stats[i].link_id; diff --git a/src/algo_naive.c b/src/algo_naive.c index 8b7a51e..d791caa 100644 --- a/src/algo_naive.c +++ b/src/algo_naive.c @@ -49,6 +49,11 @@ int algo_naive_on_datagram(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdi } int algo_naive_on_err(struct evt_core_ctx *ctx, struct evt_core_fdinfo *fdinfo) { - // We do nothing + struct algo_ctx* app_ctx = fdinfo->cat->app_ctx; + if (strcmp("tcp-read", fdinfo->cat->name) == 0 || strcmp("tcp-write", fdinfo->cat->name) == 0) + return app_ctx->ap.sr(ctx, fdinfo); + + fprintf(stderr, "%s is not eligible for a reconnect\n", fdinfo->url); + // We do nothing return 1; } diff --git a/src/dcall.c b/src/dcall.c index c719be1..6cf9313 100644 --- a/src/dcall.c +++ b/src/dcall.c @@ -12,9 +12,10 @@ struct dcall_elements { GstElement *pipeline; GstElement *rx_tap, *rx_jitterbuffer, *rx_depay, *rx_opusdec, *rx_resample, *rx_echocancel, *rx_pulse, *rx_fakesink; GstElement *tx_pulse, *tx_filesrc, *tx_mpegaudioparse, *tx_mpgaudiodec, *tx_audioconvert, *tx_echocancel, *tx_queue, *tx_resample, *tx_opusenc, *tx_pay, *tx_sink; - char *remote_host, *audio_tap, *audio_sink, *audio_file, *gstreamer_log_path; - int remote_port, latency; + char *local_host, *remote_host, *audio_tap, *audio_sink, *audio_file, *gstreamer_log_path; + int remote_port, local_port, latency; guint64 grtppktlost; + GMainLoop *loop; }; int create_rx_chain(struct dcall_elements* de) { @@ -32,8 +33,8 @@ int create_rx_chain(struct dcall_elements* de) { return -1; } - g_object_set(G_OBJECT (de->rx_tap), "port", 5000, NULL); - //g_object_set(G_OBJECT (rx_tap), "address", "127.0.0.1", NULL); + g_object_set(G_OBJECT (de->rx_tap), "port", de->local_port, NULL); + g_object_set(G_OBJECT (de->rx_tap), "address", de->local_host, NULL); g_object_set(G_OBJECT (de->rx_tap), "caps", gst_caps_new_simple("application/x-rtp", "media", G_TYPE_STRING, "audio", NULL), NULL); g_object_set(G_OBJECT (de->rx_jitterbuffer), "do-lost", TRUE, NULL); @@ -65,9 +66,56 @@ int create_rx_chain(struct dcall_elements* de) { return 0; } +static void uridecodebin_newpad (GstElement *src, GstPad *new_pad, gpointer data) { + struct dcall_elements *de = data; + GstPad *sink_pad = gst_element_get_static_pad (de->tx_audioconvert, "sink"); + GstPadLinkReturn ret; + GstCaps *new_pad_caps = NULL; + GstStructure *new_pad_struct = NULL; + const gchar *new_pad_type = NULL; + + g_print ("Received new pad '%s' from '%s':\n", GST_PAD_NAME (new_pad), GST_ELEMENT_NAME (src)); + + /* If our converter is already linked, we have nothing to do here */ + if (gst_pad_is_linked (sink_pad)) { + g_print ("We are already linked. Ignoring.\n"); + goto exit; + } + + /* Check the new pad's type */ + new_pad_caps = gst_pad_get_current_caps (new_pad); + new_pad_struct = gst_caps_get_structure (new_pad_caps, 0); + new_pad_type = gst_structure_get_name (new_pad_struct); + if (!g_str_has_prefix (new_pad_type, "audio/x-raw")) { + g_print ("It has type '%s' which is not raw audio. Ignoring.\n", new_pad_type); + goto exit; + } + + /* Attempt the link */ + ret = gst_pad_link (new_pad, sink_pad); + if (GST_PAD_LINK_FAILED (ret)) { + g_print ("Type is '%s' but link failed.\n", new_pad_type); + } else { + g_print ("Link succeeded (type '%s').\n", new_pad_type); + } + +exit: + /* Unreference the new pad's caps, if we got them */ + if (new_pad_caps != NULL) + gst_caps_unref (new_pad_caps); + + /* Unreference the sink pad */ + gst_object_unref (sink_pad); +} + +static void uridecodebin_drained (GstElement *src, gpointer data) { + struct dcall_elements *de = data; + g_main_loop_quit (de->loop); +} + int create_tx_chain(struct dcall_elements* de) { de->tx_pulse = gst_element_factory_make("pulsesrc", "tx-pulse"); - de->tx_filesrc = gst_element_factory_make("filesrc", "tx-filesrc"); + de->tx_filesrc = gst_element_factory_make("uridecodebin", "tx-filesrc"); de->tx_mpegaudioparse = gst_element_factory_make("mpegaudioparse", "tx-mpegaudioparse"); de->tx_mpgaudiodec = gst_element_factory_make("mpg123audiodec", "tx-mpgaudiodec"); de->tx_audioconvert = gst_element_factory_make("audioconvert", "tx-audioconvert"); @@ -107,14 +155,16 @@ int create_tx_chain(struct dcall_elements* de) { g_object_set (de->tx_pulse, "stream-properties", props, NULL); gst_structure_free (props); - g_object_set(de->tx_filesrc, "location", de->audio_file, NULL); + g_object_set(de->tx_filesrc, "uri", de->audio_file, NULL); if (strcmp(de->audio_tap, "pulsesrc") == 0) { gst_bin_add_many(GST_BIN(de->pipeline), de->tx_pulse, de->tx_echocancel, de->tx_queue, de->tx_resample, de->tx_opusenc, de->tx_pay, de->tx_sink, NULL); gst_element_link_many(de->tx_pulse, de->tx_resample, de->tx_echocancel, de->tx_queue, de->tx_opusenc, de->tx_pay, de->tx_sink, NULL); } else if (strcmp(de->audio_tap, "filesrc") == 0) { gst_bin_add_many(GST_BIN(de->pipeline), de->tx_filesrc, de->tx_mpegaudioparse, de->tx_mpgaudiodec, de->tx_audioconvert, de->tx_queue, de->tx_resample, de->tx_opusenc, de->tx_pay, de->tx_sink, NULL); - gst_element_link_many(de->tx_filesrc, de->tx_mpegaudioparse, de->tx_mpgaudiodec, de->tx_audioconvert, de->tx_resample, de->tx_queue, de->tx_opusenc, de->tx_pay, de->tx_sink, NULL); + gst_element_link_many(de->tx_audioconvert, de->tx_resample, de->tx_queue, de->tx_opusenc, de->tx_pay, de->tx_sink, NULL); + g_signal_connect (de->tx_filesrc, "pad-added", G_CALLBACK (uridecodebin_newpad), de); + g_signal_connect (de->tx_filesrc, "drained", G_CALLBACK(uridecodebin_drained), de); } else { fprintf(stderr, "Wrong audio tap %s, exiting...\n", de->audio_tap); exit(EXIT_FAILURE); @@ -165,24 +215,33 @@ gboolean stop_handler(gpointer user_data) { } int main(int argc, char *argv[]) { - GMainLoop *loop; + + GstBus *bus; struct dcall_elements de = { - .audio_file = "voice.mp3", + .audio_file = "file://./voice.mp3", .gstreamer_log_path = "dcall.log", .latency = 150, - .remote_port = 5000, .remote_host = "127.13.3.7", + .remote_port = 5000, + .local_host = "0.0.0.0", + .local_port = 5000, .audio_sink = "pulsesink", .audio_tap = "pulsesrc", .grtppktlost = 0 }; int opt = 0; - while ((opt = getopt(argc, argv, "t:s:r:p:l:d:a:h")) != -1) { + while ((opt = getopt(argc, argv, "t:s:r:p:l:d:a:hb:c:")) != -1) { switch(opt) { - case 'a': //latency + case 'a': de.audio_file = optarg; break; + case 'b': + de.local_host = optarg; + break; + case 'c': + de.local_port = atoi(optarg); + break; case 'd': de.gstreamer_log_path = optarg; break; @@ -208,12 +267,14 @@ int main(int argc, char *argv[]) { break; } } + printf("dcall configuration:\n\tnetwork in: %s:%d, out: %s:%d\n\taudio in: %s, out: %s\n\tmisc latency: %dms, audio_file: %s\n", + de.local_host, de.local_port, de.remote_host, de.remote_port, de.audio_tap, de.audio_sink, de.latency, de.audio_file); setenv("GST_DEBUG_FILE", de.gstreamer_log_path, 0); setenv("GST_DEBUG", "3,opusdec:5", 0); gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); + de.loop = g_main_loop_new (NULL, FALSE); de.pipeline = gst_pipeline_new ("pipeline"); if (!de.pipeline) { @@ -226,11 +287,11 @@ int main(int argc, char *argv[]) { gst_element_set_state (de.pipeline, GST_STATE_PLAYING); - g_unix_signal_add (SIGTERM, stop_handler, loop); - g_unix_signal_add (SIGINT, stop_handler, loop); + g_unix_signal_add (SIGTERM, stop_handler, de.loop); + g_unix_signal_add (SIGINT, stop_handler, de.loop); g_print ("Running...\n"); - g_main_loop_run (loop); + g_main_loop_run (de.loop); g_print ("Main loop stopped...\n"); @@ -247,7 +308,7 @@ int main(int argc, char *argv[]) { gst_element_set_state (de.pipeline, GST_STATE_NULL); gst_object_unref (GST_OBJECT (de.pipeline)); - g_main_loop_unref (loop); + g_main_loop_unref (de.loop); return 0; } diff --git a/src/donar_client.c b/src/donar_client.c index dd57647..aa77b0d 100644 --- a/src/donar_client.c +++ b/src/donar_client.c @@ -7,12 +7,11 @@ void load_onion_services(struct donar_client_ctx* ctx, char* onion_file, int por void init_socks5_client(struct donar_client_ctx* app_ctx, int pos) { char target_host[255]; - if (strlen(app_ctx->tos.keys[pos].pub) > 254) { - fprintf(stderr, "Domain name is too long\n"); - exit(EXIT_FAILURE); - } - sprintf(target_host, "%s.onion", app_ctx->tos.keys[pos].pub); - + if (strlen(app_ctx->tos.keys[0].pub) > 254) { + fprintf(stderr, "Domain name is too long\n"); + exit(EXIT_FAILURE); + } + sprintf(target_host, "%s.onion", app_ctx->tos.keys[0].pub); app_ctx->ports[pos] = 7500 + pos; socks5_create_dns_client (&app_ctx->evts, "127.0.0.1", "9050", target_host, app_ctx->ports[pos]); @@ -44,13 +43,31 @@ failed: exit(EXIT_FAILURE); } +void reinit_socks5(struct evt_core_ctx* ctx, void* user_data) { + // @FIXME: Ugly way to get donar_client_ctx. Shame on me :/ + struct evt_core_cat* cat = evt_core_get_from_cat (ctx, "socks5-failed"); + if (cat == NULL) { + fprintf(stderr, "Unable to reconnect stream as socks5-failed cat is not available...\n"); + exit(EXIT_FAILURE); + } + struct donar_client_ctx* app_ctx = cat->app_ctx; + int64_t pos = (int64_t) user_data; // trust me... + + fprintf(stdout, "[%s][donar-client] We have waited enough, retriggering socks5 for port %ld\n", current_human_datetime (), pos+7500); + init_socks5_client (app_ctx, pos); +} + int on_socks5_failed(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { struct donar_client_ctx* app_ctx = fdinfo->cat->app_ctx; struct socks5_ctx* s5ctx = fdinfo->other; - int pos = s5ctx->port - 7500; + int64_t pos = 0; + pos = s5ctx->port - 7500; + int64_t to_wait_sec = 30 + pos*3; + fprintf(stdout, "[%s][donar-client] Retriggering socks5 in %ld seconds for port %d\n", current_human_datetime (), to_wait_sec, s5ctx->port); + set_timeout(ctx, 1000 * to_wait_sec, (void*) pos, reinit_socks5); evt_core_rm_fd (ctx, fdinfo->fd); - init_socks5_client (app_ctx, pos); + //init_socks5_client (app_ctx, pos); return 1; } @@ -70,18 +87,11 @@ void init_socks5_sinks(struct donar_client_ctx* app_ctx) { } int donar_client_stream_repair(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) { - // @FIXME: Ugly way to get donar_client_ctx. Shame on me :/ fprintf(stdout, "[%s][donar-client] %s broke\n", current_human_datetime (), fdinfo->url); - struct evt_core_cat* cat = evt_core_get_from_cat (ctx, "socks5-failed"); - if (cat == NULL) { - fprintf(stderr, "Unable to reconnect stream as socks5-failed cat is not available...\n"); - exit(EXIT_FAILURE); - } - struct donar_client_ctx* app_ctx = cat->app_ctx; - struct evt_core_fdinfo* fdtarget = NULL; int port = url_get_port_int (fdinfo->url); - int pos = port - 7500, removed = 0; + int64_t pos = 0, removed = 0; + pos = port - 7500; char buffer[256]; sprintf(buffer, "tcp:read:127.0.0.1:%d", port); @@ -99,8 +109,10 @@ int donar_client_stream_repair(struct evt_core_ctx* ctx, struct evt_core_fdinfo* } if (removed == 2) { - fprintf(stdout, "[%s][donar-client] Retriggering socks5 for port %d\n", current_human_datetime (), port); - init_socks5_client (app_ctx, pos); + int64_t to_wait_sec = 10 + pos*3; + fprintf(stdout, "[%s][donar-client] Retriggering socks5 in %ld seconds for port %d\n", current_human_datetime (), to_wait_sec, port); + set_timeout(ctx, 1000 * to_wait_sec, (void*) pos, reinit_socks5); + //init_socks5_client (app_ctx, pos); return 1; } else if (removed == 0) { fprintf(stdout, "[%s][donar-client] Socks5 has already been retriggered for port %d\n", current_human_datetime (), port); @@ -138,8 +150,13 @@ void donar_client(struct donar_client_ctx* ctx, struct donar_params* dp) { load_onion_services (ctx, dp->onion_file, dp->links); printf("--- Onion services loaded\n"); - for (int i = 0; i < dp->links; i++) { - init_socks5_client(ctx, i); + init_timer(&ctx->evts); + printf("--- Inited Timer\n"); + + for (int64_t i = 0; i < dp->links; i++) { + int64_t to_wait_sec = i * 3; + fprintf(stdout, "[%s][donar-client] Triggering socks5 in %ld seconds for port %d\n", current_human_datetime (), to_wait_sec, i+7500); + set_timeout(&ctx->evts, 1000 * to_wait_sec, (void*) i, reinit_socks5); } printf("--- TCP Clients Connected\n"); @@ -153,5 +170,6 @@ void donar_client(struct donar_client_ctx* ctx, struct donar_params* dp) { evt_core_loop(&(ctx->evts)); + //stop_timer(&(ctx->evts)); tor_os_free (&(ctx->tos)); } diff --git a/src/donar_client.h b/src/donar_client.h index ad44f12..41fdfc5 100644 --- a/src/donar_client.h +++ b/src/donar_client.h @@ -6,6 +6,7 @@ #include "socks5.h" #include "proxy.h" #include "donar_init.h" +#include "timer.h" #define CLIENT_PORT_SIZE 64 diff --git a/src/donar_server.c b/src/donar_server.c index 64e06b1..44c1987 100644 --- a/src/donar_server.c +++ b/src/donar_server.c @@ -1,7 +1,7 @@ #include "donar_server.h" void create_onion_services(struct tor_os_str* tos, struct tor_ctl* tctl, uint16_t* ports, int ports_count, enum TOR_ONION_FLAGS tof) { - tor_os_create (tos, "onion_services.pub", "onion_services.txt", ports_count); + tor_os_create (tos, "onion_services.pub", "onion_services.txt", 1); tor_os_read (tos); int err = 0; @@ -10,7 +10,7 @@ void create_onion_services(struct tor_os_str* tos, struct tor_ctl* tctl, uint16_ fprintf(stderr, "Unable to open Tor Socket\n"); exit(EXIT_FAILURE); } - err = tor_ctl_add_onion (tctl, tos, ports, tof); + err = tor_ctl_add_onion (tctl, tos, ports, ports_count, tof); if (err != 0) { fprintf(stderr, "Unable to create Onion Services (error: %d)\n", err); exit(EXIT_FAILURE); @@ -82,7 +82,7 @@ struct donar_server_os_republish_params { struct donar_server_ctx* dctx; struct donar_params* dp; }; - +/* void republish_tor_os(struct evt_core_ctx* ctx, void* user_data) { struct donar_server_os_republish_params* dsorp = user_data; @@ -94,7 +94,7 @@ void republish_tor_os(struct evt_core_ctx* ctx, void* user_data) { exit(EXIT_FAILURE); } printf("Republish Tor OS\n"); -} +}*/ void donar_server(struct donar_server_ctx* ctx, struct donar_params* dp) { struct algo_params ap = { diff --git a/src/meas_lat.c b/src/meas_lat.c index ed5af9e..a8ff328 100644 --- a/src/meas_lat.c +++ b/src/meas_lat.c @@ -350,7 +350,7 @@ void spawn_tor_server(struct evt_core_ctx* evts, uint16_t *ports) { } void measlat_create_onion_services(struct tor_os_str* tos, struct tor_ctl* tctl, uint16_t* ports, int ports_count, enum TOR_ONION_FLAGS tof) { - tor_os_create (tos, "onion_services.pub", "onion_services.txt", ports_count); + tor_os_create (tos, "onion_services.pub", "onion_services.txt", 1); tor_os_read (tos); int err = 0; @@ -359,7 +359,7 @@ void measlat_create_onion_services(struct tor_os_str* tos, struct tor_ctl* tctl, fprintf(stderr, "Unable to open Tor Socket\n"); exit(EXIT_FAILURE); } - err = tor_ctl_add_onion (tctl, tos, ports, tof); + err = tor_ctl_add_onion (tctl, tos, ports, ports_count, tof); if (err != 0) { fprintf(stderr, "Unable to create Onion Services (error: %d)\n", err); exit(EXIT_FAILURE); diff --git a/src/net_tools.c b/src/net_tools.c index 0b01658..4a44e14 100644 --- a/src/net_tools.c +++ b/src/net_tools.c @@ -34,7 +34,7 @@ int create_ip_client(char* host, char* service, int type) { } if (cursor == NULL) { - fprintf(stderr, "No connect worked\n"); + fprintf(stderr, "No connect worked for %s:%s\n", host, service); exit(EXIT_FAILURE); } diff --git a/src/proxy.c b/src/proxy.c index 1f8e3be..c569047 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -103,7 +103,7 @@ int main_on_tcp_write(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) uint8_t is_rdy = fdinfo->cat->socklist->len >= app_ctx->link_count ? 1 : 0; if (!app_ctx->is_rdy && is_rdy) printf("=== Our %d requested circuits are now up ===\n", app_ctx->link_count); else if (app_ctx->is_rdy && !is_rdy) printf("=== Only %d/%d circuits are available, results could be biased ===\n", fdinfo->cat->socklist->len, app_ctx->link_count); - app_ctx->is_rdy = app_ctx->is_rdy || is_rdy; // @FIXME prevent deactivation for our tests + app_ctx->is_rdy = app_ctx->is_rdy || is_rdy; // @FIXME we don't want deactivation finally // 1. Get current write buffer OR a buffer from the waiting queue OR leave if ((bp = get_write_buffer(&app_ctx->br, fdinfo)) == NULL) return 1; @@ -117,6 +117,7 @@ int main_on_tcp_write(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo) if (write_res == FDS_ERR) goto co_error; if (write_res == FDS_AGAIN) return 1; } + app_ctx->cell_sent++; free_buffer: @@ -218,7 +219,7 @@ void algo_main_init(struct evt_core_ctx* evt, struct algo_params* ap) { struct evt_core_cat tcp_read = { .name = "tcp-read", - .flags = EPOLLIN | EPOLLET | EPOLLHUP, + .flags = EPOLLIN | EPOLLET | EPOLLHUP | EPOLLRDHUP, .app_ctx = ctx, .free_app_ctx = algo_main_destroy, .cb = main_on_tcp_read, @@ -240,7 +241,7 @@ void algo_main_init(struct evt_core_ctx* evt, struct algo_params* ap) { struct evt_core_cat tcp_write = { .name = "tcp-write", - .flags = EPOLLOUT | EPOLLET | EPOLLHUP, + .flags = EPOLLOUT | EPOLLET | EPOLLHUP | EPOLLRDHUP, .app_ctx = ctx, .free_app_ctx = algo_main_destroy, .cb = main_on_tcp_write, diff --git a/src/tor_ctl.c b/src/tor_ctl.c index 093d16b..cf04583 100644 --- a/src/tor_ctl.c +++ b/src/tor_ctl.c @@ -51,7 +51,7 @@ void tor_ctl_list_onions(struct tor_ctl* ctx) { } } -int tor_ctl_add_onion(struct tor_ctl* ctx, struct tor_os_str* tos, uint16_t* port, enum TOR_ONION_FLAGS flags) { +int tor_ctl_add_onion(struct tor_ctl* ctx, struct tor_os_str* tos, uint16_t* port, uint64_t port_per_os, enum TOR_ONION_FLAGS flags) { int err = 0; char buffer1[1024] = {0}; char buffer2[1024] = {0}; @@ -59,12 +59,14 @@ int tor_ctl_add_onion(struct tor_ctl* ctx, struct tor_os_str* tos, uint16_t* por /* Add onion services loaded from file */ for (int i = 0; i < tos->filled; i++) { - if (flags == TOR_ONION_FLAG_NONE) - fprintf(ctx->wsock, "add_onion %s Port=%d,127.13.3.7:%d\n", tos->keys[i].priv, port[i], port[i]); + fprintf(ctx->wsock, "add_onion %s ", tos->keys[i].priv); + for (int j = 0; j < port_per_os; j++) { + fprintf(ctx->wsock, "Port=%d,127.13.3.7:%d ", port[i*port_per_os+j], port[i*port_per_os+j]); + } + if (flags == TOR_ONION_FLAG_NONE) fprintf(ctx->wsock, "\n"); else { - fprintf(ctx->wsock, "add_onion %s Port=%d,127.13.3.7:%d Flags=", tos->keys[i].priv, port[i], port[i]); - if (flags & TOR_ONION_FLAG_NON_ANONYMOUS) - fprintf(ctx->wsock, "NonAnonymous,"); + fprintf(ctx->wsock, "Flags="); + if (flags & TOR_ONION_FLAG_NON_ANONYMOUS) fprintf(ctx->wsock, "NonAnonymous,"); fprintf(ctx->wsock, "\n"); } @@ -80,14 +82,17 @@ int tor_ctl_add_onion(struct tor_ctl* ctx, struct tor_os_str* tos, uint16_t* por /* Complete by creating new onion services */ for (int i = tos->filled; i < tos->size; i++) { - if (flags == TOR_ONION_FLAG_NONE) - fprintf(ctx->wsock, "add_onion NEW:ED25519-V3 Port=%d\n", port[i]); + fprintf(ctx->wsock, "add_onion NEW:ED25519-V3 "); + for (int j = 0; j < port_per_os; j++) { + fprintf(ctx->wsock, "Port=%d,127.13.3.7:%d ", port[i*port_per_os+j], port[i*port_per_os+j]); + } + if (flags == TOR_ONION_FLAG_NONE) fprintf(ctx->wsock, "\n"); else { - fprintf(ctx->wsock, "add_onion NEW:ED25519-V3 Port=%d Flags=", port[i]); - if (flags & TOR_ONION_FLAG_NON_ANONYMOUS) - fprintf(ctx->wsock, "NonAnonymous,"); + fprintf(ctx->wsock, "Flags="); + if (flags & TOR_ONION_FLAG_NON_ANONYMOUS) fprintf(ctx->wsock, "NonAnonymous,"); fprintf(ctx->wsock, "\n"); } + //fprintf(ctx->wsock, "add_onion NEW:RSA1024 Port=%d\n", port[i]); fscanf(ctx->rsock, "%d", &err); diff --git a/src/tor_ctl.h b/src/tor_ctl.h index 3f85eb4..e1c6c86 100644 --- a/src/tor_ctl.h +++ b/src/tor_ctl.h @@ -20,6 +20,6 @@ enum TOR_ONION_FLAGS { }; int tor_ctl_connect(struct tor_ctl* ctx, char* addr, char* service); -int tor_ctl_add_onion(struct tor_ctl* ctx, struct tor_os_str* tos, uint16_t* port, enum TOR_ONION_FLAGS flags); +int tor_ctl_add_onion(struct tor_ctl* ctx, struct tor_os_str* tos, uint16_t* port, uint64_t port_per_os, enum TOR_ONION_FLAGS flags); void tor_ctl_list_onions(struct tor_ctl* ctx); void tor_ctl_close(struct tor_ctl* ctx); diff --git a/src/tor_echo.c b/src/tor_echo.c index 7c33600..98dd874 100644 --- a/src/tor_echo.c +++ b/src/tor_echo.c @@ -14,7 +14,7 @@ struct torecho_ctx { }; void te_create_onion_services(struct tor_os_str* tos, struct tor_ctl* tctl, uint16_t* ports, int ports_count, enum TOR_ONION_FLAGS tof) { - tor_os_create (tos, "onion_services.pub", "onion_services.txt", ports_count); + tor_os_create (tos, "onion_services.pub", "onion_services.txt", 1); tor_os_read (tos); int err = 0; @@ -23,7 +23,7 @@ void te_create_onion_services(struct tor_os_str* tos, struct tor_ctl* tctl, uint fprintf(stderr, "Unable to open Tor Socket\n"); exit(EXIT_FAILURE); } - err = tor_ctl_add_onion (tctl, tos, ports, tof); + err = tor_ctl_add_onion (tctl, tos, ports, ports_count, tof); if (err != 0) { fprintf(stderr, "Unable to create Onion Services (error: %d)\n", err); exit(EXIT_FAILURE); diff --git a/torrc_guard_1 b/torrc_guard_1 index 2b07da1..cce8a5b 100644 --- a/torrc_guard_1 +++ b/torrc_guard_1 @@ -3,4 +3,5 @@ UseEntryGuards 1 NumEntryGuards 1 NumPrimaryGuards 1 SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort #Log INFO stdout diff --git a/torrc_guard_10 b/torrc_guard_10 new file mode 100644 index 0000000..4fc2c60 --- /dev/null +++ b/torrc_guard_10 @@ -0,0 +1,7 @@ +ControlPort 9051 +UseEntryGuards 1 +NumEntryGuards 10 +NumPrimaryGuards 10 +SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort +#Log INFO stdout diff --git a/torrc_guard_11 b/torrc_guard_11 new file mode 100644 index 0000000..50151a3 --- /dev/null +++ b/torrc_guard_11 @@ -0,0 +1,7 @@ +ControlPort 9051 +UseEntryGuards 1 +NumEntryGuards 11 +NumPrimaryGuards 11 +SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort +#Log INFO stdout diff --git a/torrc_guard_12 b/torrc_guard_12 index 4c8a921..4382d75 100644 --- a/torrc_guard_12 +++ b/torrc_guard_12 @@ -3,4 +3,5 @@ UseEntryGuards 1 NumEntryGuards 12 NumPrimaryGuards 12 SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort #Log INFO stdout diff --git a/torrc_guard_13 b/torrc_guard_13 new file mode 100644 index 0000000..aa9f2b0 --- /dev/null +++ b/torrc_guard_13 @@ -0,0 +1,7 @@ +ControlPort 9051 +UseEntryGuards 1 +NumEntryGuards 13 +NumPrimaryGuards 13 +SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort +#Log INFO stdout diff --git a/torrc_guard_14 b/torrc_guard_14 new file mode 100644 index 0000000..9d71c6f --- /dev/null +++ b/torrc_guard_14 @@ -0,0 +1,7 @@ +ControlPort 9051 +UseEntryGuards 1 +NumEntryGuards 14 +NumPrimaryGuards 14 +SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort +#Log INFO stdout diff --git a/torrc_guard_15 b/torrc_guard_15 new file mode 100644 index 0000000..216dc59 --- /dev/null +++ b/torrc_guard_15 @@ -0,0 +1,7 @@ +ControlPort 9051 +UseEntryGuards 1 +NumEntryGuards 15 +NumPrimaryGuards 15 +SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort +#Log INFO stdout diff --git a/torrc_guard_16 b/torrc_guard_16 index dd7248c..a72fe43 100644 --- a/torrc_guard_16 +++ b/torrc_guard_16 @@ -3,4 +3,5 @@ UseEntryGuards 1 NumEntryGuards 16 NumPrimaryGuards 16 SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort #Log INFO stdout diff --git a/torrc_guard_2 b/torrc_guard_2 index 903908e..d910064 100644 --- a/torrc_guard_2 +++ b/torrc_guard_2 @@ -3,4 +3,5 @@ UseEntryGuards 1 NumEntryGuards 2 NumPrimaryGuards 2 SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort #Log DEBUG stdout diff --git a/torrc_guard_3 b/torrc_guard_3 index e64d87d..9a08f16 100644 --- a/torrc_guard_3 +++ b/torrc_guard_3 @@ -3,4 +3,5 @@ UseEntryGuards 1 NumEntryGuards 3 NumPrimaryGuards 3 SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort #Log INFO stdout diff --git a/torrc_guard_4 b/torrc_guard_4 index 720924a..96d2b62 100644 --- a/torrc_guard_4 +++ b/torrc_guard_4 @@ -3,4 +3,5 @@ UseEntryGuards 1 NumEntryGuards 4 NumPrimaryGuards 4 SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort #Log INFO stdout diff --git a/torrc_guard_5 b/torrc_guard_5 index b26ae35..c6a63d6 100644 --- a/torrc_guard_5 +++ b/torrc_guard_5 @@ -3,4 +3,5 @@ UseEntryGuards 1 NumEntryGuards 5 NumPrimaryGuards 5 SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort #Log INFO stdout diff --git a/torrc_guard_6 b/torrc_guard_6 index bdb6f18..3325be5 100644 --- a/torrc_guard_6 +++ b/torrc_guard_6 @@ -3,4 +3,5 @@ UseEntryGuards 1 NumEntryGuards 6 NumPrimaryGuards 6 SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort #Log INFO stdout diff --git a/torrc_guard_7 b/torrc_guard_7 index 28b8ac4..572ae75 100644 --- a/torrc_guard_7 +++ b/torrc_guard_7 @@ -3,4 +3,5 @@ UseEntryGuards 1 NumEntryGuards 7 NumPrimaryGuards 7 SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort #Log INFO stdout diff --git a/torrc_guard_8 b/torrc_guard_8 index ba18a3d..def8b7a 100644 --- a/torrc_guard_8 +++ b/torrc_guard_8 @@ -3,4 +3,5 @@ UseEntryGuards 1 NumEntryGuards 8 NumPrimaryGuards 8 SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort #Log INFO stdout diff --git a/torrc_guard_9 b/torrc_guard_9 new file mode 100644 index 0000000..26b62a2 --- /dev/null +++ b/torrc_guard_9 @@ -0,0 +1,7 @@ +ControlPort 9051 +UseEntryGuards 1 +NumEntryGuards 9 +NumPrimaryGuards 9 +SafeLogging 0 +SocksPort 127.0.0.1:9050 IsolateDestPort +#Log INFO stdout diff --git a/torrc_simple b/torrc_simple index 2a1bbdd..96c3261 100644 --- a/torrc_simple +++ b/torrc_simple @@ -1,5 +1,6 @@ ControlPort 9051 UseEntryGuards 0 +SocksPort 127.0.0.1:9050 IsolateDestPort SafeLogging 0 #IsolateDestPort 1 #Log INFO stdout