47 | | mydata <- dbGetQuery(con, "select dest_addr,rtt from pingmonitor_myping where dest_addr='192.168.4.10'") |
48 | | rtt <- mydata$rtt |
49 | | pdf("gimi31_ping1.pdf") |
50 | | plot(rtt,type="o",col="red",xlab="Experiment Interval",ylab="RTT (ms)") |
51 | | title(main="Ping Experiment to IP address 192.168.4.10", col.main="blue", font.main=4) |
| 47 | |
| 48 | mydata1 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.4.10'") |
| 49 | rtt1 <- abs(mydata1$rtt) |
| 50 | |
| 51 | mydata2 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.5.12'") |
| 52 | rtt2 <- abs(mydata2$rtt) |
| 53 | |
| 54 | mydata3 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.4.11'") |
| 55 | rtt3 <- abs(mydata3$rtt) |
| 56 | |
| 57 | mydata4 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.2.12'") |
| 58 | rtt4 <- abs(mydata4$rtt) |
| 59 | |
| 60 | mydata5 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.1.13'") |
| 61 | rtt5 <- abs(mydata5$rtt) |
| 62 | |
| 63 | mydata6 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.5.11'") |
| 64 | rtt6 <- abs(mydata6$rtt) |
| 65 | |
| 66 | mydata7 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.2.10'") |
| 67 | rtt7 <- abs(mydata7$rtt) |
| 68 | |
| 69 | mydata8 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.3.13'") |
| 70 | rtt8 <- abs(mydata8$rtt) |
| 71 | |
| 72 | mydata9 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.6.14'") |
| 73 | rtt9 <- abs(mydata9$rtt) |
| 74 | |
| 75 | mydata10 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.1.10'") |
| 76 | rtt10 <- abs(mydata10$rtt) |
| 77 | |
| 78 | mydata11 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.3.12'") |
| 79 | rtt11 <- abs(mydata11$rtt) |
| 80 | |
| 81 | mydata12 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.6.12'") |
| 82 | rtt12 <- abs(mydata12$rtt) |
| 83 | |
| 84 | png(filename="gimi20-nmetrics-eth", height=650, width=900, |
| 85 | bg="white") |
| 86 | g_range <- range(0,rtt1,rtt2,rtt3,rtt4,rtt5,rtt6,rtt7,rtt8,rtt9,rtt10,rtt11,rtt12) |
| 87 | |
| 88 | plot(rtt1,type="o",col="red",ylim= g_range, lty=2, xlab="Experiment Interval",ylab="RTT") |
| 89 | lines(rtt2,type="o",col="blue",xlab="Experiment Interval",ylab="Received Data") |
| 90 | lines(rtt3,type="o",col="green",xlab="Experiment Interval",ylab="Received Data") |
| 91 | lines(rtt4,type="o",col="purple",xlab="Experiment Interval",ylab="Received Data") |
| 92 | lines(rtt5,type="o",col="violetred",xlab="Experiment Interval",ylab="Received Data") |
| 93 | lines(rtt6,type="o",col="springgreen",xlab="Experiment Interval",ylab="Received Data") |
| 94 | lines(rtt7,type="o",col="skyblue",xlab="Experiment Interval",ylab="Received Data") |
| 95 | lines(rtt8,type="o",col="sienna",xlab="Experiment Interval",ylab="Received Data") |
| 96 | lines(rtt9,type="o",col="pink",xlab="Experiment Interval",ylab="Received Data") |
| 97 | lines(rtt10,type="o",col="yellow",xlab="Experiment Interval",ylab="Received Data") |
| 98 | lines(rtt11,type="o",col="thistle",xlab="Experiment Interval",ylab="Received Data") |
| 99 | lines(rtt12,type="o",col="orange",xlab="Experiment Interval",ylab="Received Data") |
| 100 | |
| 101 | title(main="nmetrics experiment on ExoGENI (Received Data)", col.main="red", font.main=4) |
| 102 | legend("topright", g_range[4], legend=c("192.168.4.10","192.168.5.12","192.168.4.11","192.168.2.12","192.168.5.11","192.168.2.10","192.168.3.13","192.168.6.14","192.168.1.10","192.168.3.12","192.168.6.12"), cex=0.8, |
| 103 | col=c("blue","red","green","purple","violetred","springgreen","skyblue","sienna","pink","yellow","thistle","orange"), pch=15:16:17:18:19:20:21:22:23:24:25:26, lty=1:2:3:4:5:6:7:8:9:10:11:12); |
| 104 | |
| 105 | dev.off() |
66 | | mydata <- dbGetQuery(con, "select pkt_length from otr2_udp_in where src_host='192.168.4.10'") |
67 | | pkt_length <- mydata$pkt_length/1024/1024*8 |
68 | | pdf("gimi31_otg1.pdf", height=5.5, width=7, pointsize=14) |
69 | | plot(pkt_length,type="o",col="red",xlab="Experiment Interval",ylab="Packet size") |
70 | | title(main="Received packet size with sender address 192.168.4.10", col.main="blue", font.main=4) |
| 121 | |
| 122 | mydata1 <- dbGetQuery(con, "select oml_sender_id, pkt_length from otr2_udp_in where src_host='192.168.4.10'") |
| 123 | pkt_length <- mydata1$pkt_length |
| 124 | #plot(rx_bytes1, type="o", color="red", xlab="Experiment Interval", ylab="Received data") |
| 125 | |
| 126 | |
| 127 | png(filename="gimi20_otg1.png", height=650, width=900, |
| 128 | bg="white") |
| 129 | g_range <- range(0,pkt_length) |
| 130 | |
| 131 | plot(pkt_length,type="o",col="red",ylim= g_range, lty=2, xlab="Experiment Interval",ylab="Packet Size") |
| 132 | |
| 133 | title(main="Received packet size with sender address 192.168.4.10", col.main="red", font.main=4) |
| 134 | legend("bottomright", g_range[1], legend=c("interface1"), cex=0.8, |
| 135 | col=c("blue"), pch=21, lty=1); |
| 136 | |
77 | | [[Image(gimi31_otg1.jpg)]] |
| 143 | [[Image(gimi20-otg1.png)]] |
| 144 | |
| 145 | Both scripts are simply executed with: |
| 146 | |
| 147 | {{{ |
| 148 | R -f <script_name> |
| 149 | }}} |
| 150 | |
| 151 | The following [http://emmy9.casa.umass.edu/GEC15-GIMI-Tutorial/R_script_nmetrics.r script] plots part of nmetrics results from the |
| 152 | 4th experiment we executed. |
| 153 | |
| 154 | {{{ |
| 155 | library(RSQLite) |
| 156 | con <- dbConnect(dbDriver("SQLite"), dbname = "gimi20-otg-nmetrics.sq3") |
| 157 | dbListTables(con) |
| 158 | dbReadTable(con,"nmetrics_net_if") |
| 159 | |
| 160 | mydata1 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=1") |
| 161 | rx_bytes1 <- abs(mydata1$rx_bytes) |
| 162 | #plot(rx_bytes1, type="o", color="red", xlab="Experiment Interval", ylab="Received data") |
| 163 | |
| 164 | mydata2 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=2") |
| 165 | rx_bytes2 <- abs(mydata2$rx_bytes) |
| 166 | |
| 167 | mydata3 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=3") |
| 168 | rx_bytes3 <- abs(mydata3$rx_bytes) |
| 169 | |
| 170 | mydata4 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=4") |
| 171 | rx_bytes4 <- abs(mydata4$rx_bytes) |
| 172 | |
| 173 | png(filename="gimi20-nmetrics-eth", height=650, width=900, |
| 174 | bg="white") |
| 175 | g_range <- range(0,rx_bytes1,rx_bytes2,rx_bytes3,rx_bytes4) |
| 176 | |
| 177 | plot(rx_bytes1,type="o",col="red",ylim= g_range, lty=2, xlab="Experiment Interval",ylab="Received Data") |
| 178 | lines(rx_bytes2,type="o",col="blue",xlab="Experiment Interval",ylab="Received Data") |
| 179 | lines(rx_bytes3,type="o",col="green",xlab="Experiment Interval",ylab="Received Data") |
| 180 | lines(rx_bytes4,type="o",col="purple",xlab="Experiment Interval",ylab="Received Data") |
| 181 | title(main="nmetrics experiment on ExoGENI (Received Data)", col.main="red", font.main=4) |
| 182 | legend("bottomright", g_range[4], legend=c("interface1","interface2","interface3","interface4"), cex=0.8, |
| 183 | col=c("blue","red","green","purple"), pch=21:22:23:24, lty=1:2:3:4); |
| 184 | }}} |
| 185 | |
| 186 | |
| 187 | The resulting plot is shown below. |
| 188 | |
| 189 | [[Image(gimi20-otg1.png)]] |