diff --git a/r/tor_daemon.R b/r/tor_daemon.R new file mode 100644 index 0000000..7cc4de2 --- /dev/null +++ b/r/tor_daemon.R @@ -0,0 +1,75 @@ +library(ggplot2) +library(sqldf) +library(plyr) +library(cowplot) + +cellssec <- c("1","2","10","20") +tor_bw <- read.csv("tor_bw_2.csv") +tor_bw <- sqldf("select run,conf,latency, CAST(latency as real) / 1000. as lat_ms from tor_bw") +tor_bw$conf <- as.factor(tor_bw$conf) + +gbw1 <- ggplot(data = tor_bw, aes(x = conf, y=lat_ms)) + + geom_boxplot() + + ylim(0,1000) + + ylab("latency (in ms)") + + xlab("cells / second") + + theme_minimal() + +gbw2 <- ggplot(data = tor_bw, aes(x = conf, y=lat_ms)) + + geom_boxplot() + + scale_y_log10() + + ylab("latency (in ms)") + + xlab("cells / second") + + theme_minimal() + +new_values <- c("1","2","3","4","5","6","7","8","∞") +tor_guards <- read.csv("tor_guards.csv") +tor_guards <- sqldf("select run,conf,latency, CAST(latency as real) / 1000. as lat_ms from tor_guards") +tor_guards$conf <- factor( + mapvalues(tor_guards$conf, c(0,1,2,3,4,5,6,7,8), new_values), + levels = new_values, + ordered = TRUE) + +gguard1 <- ggplot(data = tor_guards, aes(x = conf, y=lat_ms)) + + geom_boxplot() + + ylim(0,1000) + + ylab("latency (in ms)") + + xlab("guards") + + theme_minimal() + +gguard2 <- ggplot(data = tor_guards, aes(x = conf, y=lat_ms)) + + geom_boxplot() + + scale_y_log10() + + ylab("latency (in ms)") + + xlab("guards") + + theme_minimal() + +relay_count <- c("6","4","3") +tor_relays <- read.csv("tor_relays.csv") +tor_relays <- sqldf("select run,conf,latency, CAST(latency as real) / 1000. as lat_ms from tor_relays") +tor_relays$conf <- factor( + mapvalues(tor_relays$conf, c(0,1,2), relay_count), + levels = relay_count, + ordered = TRUE) + +grelay1 <- ggplot(data = tor_relays, aes(x = conf, y=lat_ms)) + + geom_boxplot() + + ylim(0,1000) + + #scale_y_log10() + + ylab("latency (in ms)") + + xlab("relay count") + + theme_minimal() + +grelay2 <- ggplot(data = tor_relays, aes(x = conf, y=lat_ms)) + + geom_boxplot() + + scale_y_log10() + + ylab("latency (in ms)") + + xlab("relay count") + + theme_minimal() + +t1 <- plot_grid(gbw1, gguard1, grelay1, labels = c('D', 'E', 'F'), nrow=1, rel_widths = c(5, 8, 4)) +t1 + ggsave("tor_latency_crop.png", dpi=300, dev='png', height=5, width=15, units="cm") + +t2 <- plot_grid(gbw2, gguard2, grelay2, labels = c('A', 'B', 'C'), nrow=1, rel_widths = c(5, 8, 4)) +t2 + ggsave("tor_latency_log.png", dpi=300, dev='png', height=5, width=15, units="cm") + diff --git a/r/tor_latency_crop.png b/r/tor_latency_crop.png new file mode 100644 index 0000000..1529eac Binary files /dev/null and b/r/tor_latency_crop.png differ diff --git a/r/tor_latency_log.png b/r/tor_latency_log.png new file mode 100644 index 0000000..c89eafa Binary files /dev/null and b/r/tor_latency_log.png differ diff --git a/scripts/Makefile b/scripts/Makefile index 6f05559..fa25d97 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -30,16 +30,20 @@ tor_bw_full: orig-client 600 1000 100, \ orig-client 1200 500 100, \ orig-client 6000 100 100, \ - orig-client 12000 50 100 . \ + orig-client 12000 50 100, \ + orig-client 30000 20 100 . \ orig-server, \ + orig-server, \ orig-server, \ orig-server, \ orig-server . \ tor3 -f /etc/torrc_simple, \ + tor3 -f /etc/torrc_simple, \ tor3 -f /etc/torrc_simple, \ tor3 -f /etc/torrc_simple, \ tor3 -f /etc/torrc_simple . \ tor3 -f /etc/torrc_simple, \ + tor3 -f /etc/torrc_simple, \ tor3 -f /etc/torrc_simple, \ tor3 -f /etc/torrc_simple, \ tor3 -f /etc/torrc_simple @@ -108,6 +112,10 @@ tor_guards_full: tor3 -f /etc/torrc_guard_8, \ tor3 -f /etc/torrc_simple +tor_guards_full_parse: + @. parse_lib.sh && \ + parse_latency tor_guards_full 8 + tor_relays_full: ./run-3 \ 16,tor_relays_full . \ @@ -140,3 +148,6 @@ tor_relays_small: tor2 -f /etc/torrc_simple, \ tor2 -f /etc/torrc_single_hop +tor_relays_full_parse: + @. parse_lib.sh && \ + parse_latency tor_relays_full 2