summaryrefslogtreecommitdiff
path: root/code/perflow/flow_duration.R
diff options
context:
space:
mode:
authorKumar Damani <kumar.damani@mail.utoronto.ca>2018-11-21 23:27:49 +0000
committerKumar Damani <kumar.damani@mail.utoronto.ca>2018-11-21 23:27:49 +0000
commitff0e28fbdfe8fd9f8fbaa9559834fee8f4dbcecc (patch)
tree740e1fee55a6629e65af4993d340df0aa8c513d6 /code/perflow/flow_duration.R
parent09af1849763528d2d66f51025755d848ceb6b7e9 (diff)
all remaining files
Diffstat (limited to 'code/perflow/flow_duration.R')
-rw-r--r--code/perflow/flow_duration.R21
1 files changed, 21 insertions, 0 deletions
diff --git a/code/perflow/flow_duration.R b/code/perflow/flow_duration.R
new file mode 100644
index 0000000..4176ada
--- /dev/null
+++ b/code/perflow/flow_duration.R
@@ -0,0 +1,21 @@
+data_tcp = read.csv(file="../../data/perflow/flow_tcp.csv", header=TRUE, sep=",")
+data_udp = read.csv(file="../../data/perflow/flow_udp.csv", header=TRUE, sep=",")
+data_other= read.csv(file="../../data/perflow/flow_other.csv", header=TRUE, sep=",")
+
+tcp_durs = data_tcp$Duration
+udp_durs = data_udp$Duration
+other_durs = data_other$Duration
+all_durs = c(tcp_durs, udp_durs, other_durs)
+
+all_cdf = ecdf(all_durs)
+tcp_cdf = ecdf(tcp_durs)
+udp_cdf = ecdf(udp_durs)
+
+#plot(all_cdf, col="red", type="S", main="CDF of flow duration of ALL, TCP, UDP flows", xlab="duration (s)", ylab="probability")
+plot(all_cdf, col="red", main="CDF of flow duration of ALL, TCP, UDP flows", xlab="duration (s)", ylab="probability")
+lines(tcp_cdf, col="blue")
+lines(udp_cdf, col="green")
+legend(200,0.2, legend=c("All", "TCP", "UDP"), col=c("red", "blue", "green"), lty=1)
+dev.print(png, '../../plots/perflow/flowdur_all.png', width=500)
+
+quit()