diff --git a/r/config_light.R b/r/config_light.R new file mode 100644 index 0000000..2989d17 --- /dev/null +++ b/r/config_light.R @@ -0,0 +1,29 @@ +library(ggplot2) +library(sqldf) +library(plyr) +library(dplyr) + +d <- read.csv("../../donar-res/tmp_light/boxplot1.csv") +d$strat <- as.factor(d$strat) +d$window <- as.factor(d$window) +#d$decile <- factor(d$decile, levels = c("MIN", "D0.1", "D1", "D25", "D50", "D75", "D99", "D99.9")) +d$decile <-factor(d$decile,levels=c("MAX", "D99.9", "D99", "D75", "D50", "D25", "D1", "D0.1", "MIN")) +d <- d %>% mutate (lat = latency / 1000) +ggplot(sqldf("select * from d where decile != 'MAX'") %>% arrange(decile), aes(x=strat:window,y=lat,group=decile,fill=decile)) + + geom_bar(stat='identity', position='identity') + + scale_fill_grey() + + geom_hline(yintercept = 200) + + geom_hline(yintercept = 400) + + theme_classic() + +e <- read.csv("../../donar-res/tmp_light/boxplot2.csv") +e$strat <- as.factor(e$strat) +e$links <- as.factor(e$links) +e$decile <-factor(e$decile,levels=c("MAX", "D99.9", "D99", "D75", "D50", "D25", "D1", "D0.1", "MIN")) +e <- e %>% mutate (lat = latency / 1000) +ggplot(sqldf("select * from e where decile != 'MAX'") %>% arrange(decile), aes(x=strat:links,y=lat,group=decile,fill=decile)) + + geom_bar(stat='identity', position='identity') + + scale_fill_grey() + + geom_hline(yintercept = 200) + + geom_hline(yintercept = 400) + + theme_classic() diff --git a/r/lightning_begin.R b/r/lightning_begin.R index ebd0cea..9fce98d 100644 --- a/r/lightning_begin.R +++ b/r/lightning_begin.R @@ -1,7 +1,7 @@ library(ggplot2) library(sqldf) library(plyr) -lib +library(dplyr) library(cowplot) link_info <- read.csv("../res/tmp_graph/u.txt") @@ -168,3 +168,5 @@ lats <- ggplot(torbw, aes(x=rate,y=lat, group=rate)) + theme_classic() lats + ggsave("tor_bw.png", dpi=300, dev='png', height=8, width=15, units="cm") + +lightlinks <- read.csv("../../donar-res/tmp_light/lightning-links.csv") diff --git a/scripts/boxplot.py b/scripts/boxplot.py new file mode 100755 index 0000000..c5036c2 --- /dev/null +++ b/scripts/boxplot.py @@ -0,0 +1,35 @@ +#!/usr/bin/python3 + +import sys, re + +current_run="none" +d = {} +input() +for line in sys.stdin: + packet_id,latency,flag,link_id,vanilla,way,run,conf = line.split(",") + conf = conf.rstrip() + if int(packet_id) > 7400 or int(packet_id) < 10: continue + latency = int(latency) + + if conf not in d: d[conf] = {} + if (run,way,packet_id) not in d[conf]: + d[conf][(run,way,packet_id)] = latency + else: + d[conf][(run,way,packet_id)] = min(latency, d[conf][(run,way,packet_id)]) + +#print("strat,window,decile,latency") +print("links,strat,decile,latency") +for conf,value in d.items(): + s = sorted(value.values()) + szs = len(s) + #m = re.match(r".*tick_tock=(\d+).+window=(\d+)", conf) + m = re.match(r"^(\d+).*tick_tock=(\d+)", conf) + print(f"{m[1]},{m[2]},MIN,{s[0]}") + print(f"{m[1]},{m[2]},D0.1,{s[int(szs*0.001)]}") + print(f"{m[1]},{m[2]},D1,{s[int(szs*0.01)]}") + print(f"{m[1]},{m[2]},D25,{s[int(szs*0.25)]}") + print(f"{m[1]},{m[2]},D50,{s[int(szs*0.5)]}") + print(f"{m[1]},{m[2]},D75,{s[int(szs*0.75)]}") + print(f"{m[1]},{m[2]},D99,{s[int(szs*0.99)]}") + print(f"{m[1]},{m[2]},D99.9,{s[int(szs*0.999)]}") + print(f"{m[1]},{m[2]},MAX,{s[-1]}") diff --git a/src/algo_lightning.c b/src/algo_lightning.c index 7efc06b..7847422 100644 --- a/src/algo_lightning.c +++ b/src/algo_lightning.c @@ -247,7 +247,7 @@ void monitoring(struct evt_core_ctx* ctx, struct evt_core_fdinfo* fdinfo, struct uint8_t link_id = prev_links[i]; int64_t miss_id = pkt_id - (i+1); struct timing_entry *te = &lightc->historic[miss_id % HISTORIC_SIZE]; - if (te->pkt_id == miss_id) continue; // Entry already exists + if (te->pkt_id >= miss_id) continue; // Entry already exists te->state = OOO_ONGOING; te->detected_at = now; te->link_id = link_id;