summaryrefslogtreecommitdiff
path: root/doc/design-paper/node-selection/exit-capacity.R
blob: ece84e93d08a0858d4b937e80663dc64ae3ba3db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Read data
t <- read.table("exit-capacity.dat", header=TRUE)

## Normalize columns
t[,2] <- t[,2]/max(t[,2])*100
t[,3] <- t[,3]/max(t[,3])*100

## Remove uninteresting ports
ports <- c(22, 25, 80, 119, 135, 443,
           563, 8080, 6667)
t <- t[t$port %in% ports,]

## Plot
pdf("exit-capacity.pdf")
par(las=1)
col <- grey(c(1,4)/5)
barplot(t(as.matrix(t[,2:3])), names=t$port,
        beside=TRUE, xlab="Port number",
        ylab="Exit capacity available (%)",
        col=col, cex.axis=0.8, cex.names=0.8)
par(xpd=TRUE)
legend(x="topright", legend=c("Nodes", "Bandwidth"),
       fill=col, bty="n", inset=c(-0.05,-0.15))
dev.off()