Changes between Version 22 and Version 23 of GIMIv1.1Tutorial/Analyze


Ignore:
Timestamp:
10/24/12 23:55:24 (12 years ago)
Author:
Cong
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GIMIv1.1Tutorial/Analyze

    v22 v23  
    4242{{{
    4343library(RSQLite)
    44 con <- dbConnect(dbDriver("SQLite"), dbname = "gimi30-ping_all.sq3")
     44con <- dbConnect(dbDriver("SQLite"), dbname = "gimi20-2012-10-18t14.03.42-04.00.sq3")
    4545dbListTables(con)
    4646dbReadTable(con,"pingmonitor_myping")
    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
     48mydata1 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.4.10'")
     49rtt1 <- abs(mydata1$rtt)
     50
     51mydata2 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.5.12'")
     52rtt2 <- abs(mydata2$rtt)
     53
     54mydata3 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.4.11'")
     55rtt3 <- abs(mydata3$rtt)
     56
     57mydata4 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.2.12'")
     58rtt4 <- abs(mydata4$rtt)
     59
     60mydata5 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.1.13'")
     61rtt5 <- abs(mydata5$rtt)
     62
     63mydata6 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.5.11'")
     64rtt6 <- abs(mydata6$rtt)
     65
     66mydata7 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.2.10'")
     67rtt7 <- abs(mydata7$rtt)
     68
     69mydata8 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.3.13'")
     70rtt8 <- abs(mydata8$rtt)
     71
     72mydata9 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.6.14'")
     73rtt9 <- abs(mydata9$rtt)
     74
     75mydata10 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.1.10'")
     76rtt10 <- abs(mydata10$rtt)
     77
     78mydata11 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.3.12'")
     79rtt11 <- abs(mydata11$rtt)
     80
     81mydata12 <- dbGetQuery(con, "select dest_addr, rtt from pingmonitor_myping where dest_addr='192.168.6.12'")
     82rtt12 <- abs(mydata12$rtt)
     83
     84png(filename="gimi20-nmetrics-eth", height=650, width=900,
     85 bg="white")
     86g_range <- range(0,rtt1,rtt2,rtt3,rtt4,rtt5,rtt6,rtt7,rtt8,rtt9,rtt10,rtt11,rtt12)
     87
     88plot(rtt1,type="o",col="red",ylim= g_range, lty=2, xlab="Experiment Interval",ylab="RTT")
     89lines(rtt2,type="o",col="blue",xlab="Experiment Interval",ylab="Received Data")
     90lines(rtt3,type="o",col="green",xlab="Experiment Interval",ylab="Received Data")
     91lines(rtt4,type="o",col="purple",xlab="Experiment Interval",ylab="Received Data")
     92lines(rtt5,type="o",col="violetred",xlab="Experiment Interval",ylab="Received Data")
     93lines(rtt6,type="o",col="springgreen",xlab="Experiment Interval",ylab="Received Data")
     94lines(rtt7,type="o",col="skyblue",xlab="Experiment Interval",ylab="Received Data")
     95lines(rtt8,type="o",col="sienna",xlab="Experiment Interval",ylab="Received Data")
     96lines(rtt9,type="o",col="pink",xlab="Experiment Interval",ylab="Received Data")
     97lines(rtt10,type="o",col="yellow",xlab="Experiment Interval",ylab="Received Data")
     98lines(rtt11,type="o",col="thistle",xlab="Experiment Interval",ylab="Received Data")
     99lines(rtt12,type="o",col="orange",xlab="Experiment Interval",ylab="Received Data")
     100
     101title(main="nmetrics experiment on ExoGENI (Received Data)", col.main="red", font.main=4)
     102legend("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
     105dev.off()
    52106}}}
    53107
     
    56110[[Image(gimi20-ping.png)]]
    57111
    58 The following [http://emmy9.casa.umass.edu/GEC15-GIMI-Tutorial/R_script_otr.r script] plots results from the
     112The following [http://emmy9.casa.umass.edu/GEC15-GIMI-Tutorial/R_script_otr.r script] plots otr results from the
    591134th experiment we executed.
    60114
    61115{{{
     116
    62117library(RSQLite)
    63118con <- dbConnect(dbDriver("SQLite"), dbname = "gimi20-otg-nmetrics.sq3")
    64119dbListTables(con)
    65120dbReadTable(con,"otr2_udp_in")
    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
     122mydata1 <- dbGetQuery(con, "select oml_sender_id, pkt_length from otr2_udp_in where src_host='192.168.4.10'")
     123pkt_length <- mydata1$pkt_length
     124#plot(rx_bytes1, type="o", color="red", xlab="Experiment Interval", ylab="Received data")
     125
     126
     127png(filename="gimi20_otg1.png", height=650, width=900,
     128 bg="white")
     129g_range <- range(0,pkt_length)
     130
     131plot(pkt_length,type="o",col="red",ylim= g_range, lty=2, xlab="Experiment Interval",ylab="Packet Size")
     132
     133title(main="Received packet size with sender address 192.168.4.10", col.main="red", font.main=4)
     134legend("bottomright", g_range[1], legend=c("interface1"), cex=0.8,
     135   col=c("blue"), pch=21, lty=1);
     136
    71137dev.off()
    72138}}}
     
    75141The resulting plot is shown below.
    76142
    77 [[Image(gimi31_otg1.jpg)]]
     143[[Image(gimi20-otg1.png)]]
     144
     145Both scripts are simply executed with:
     146
     147{{{
     148R -f <script_name>
     149}}}
     150
     151The following [http://emmy9.casa.umass.edu/GEC15-GIMI-Tutorial/R_script_nmetrics.r script] plots part of nmetrics results from the
     1524th experiment we executed.
     153
     154{{{
     155library(RSQLite)
     156con <- dbConnect(dbDriver("SQLite"), dbname = "gimi20-otg-nmetrics.sq3")
     157dbListTables(con)
     158dbReadTable(con,"nmetrics_net_if")
     159
     160mydata1 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=1")
     161rx_bytes1 <- abs(mydata1$rx_bytes)
     162#plot(rx_bytes1, type="o", color="red", xlab="Experiment Interval", ylab="Received data")
     163
     164mydata2 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=2")
     165rx_bytes2 <- abs(mydata2$rx_bytes)
     166
     167mydata3 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=3")
     168rx_bytes3 <- abs(mydata3$rx_bytes)
     169
     170mydata4 <- dbGetQuery(con, "select oml_sender_id, rx_bytes from nmetrics_net_if where oml_sender_id=4")
     171rx_bytes4 <- abs(mydata4$rx_bytes)
     172
     173png(filename="gimi20-nmetrics-eth", height=650, width=900,
     174 bg="white")
     175g_range <- range(0,rx_bytes1,rx_bytes2,rx_bytes3,rx_bytes4)
     176
     177plot(rx_bytes1,type="o",col="red",ylim= g_range, lty=2, xlab="Experiment Interval",ylab="Received Data")
     178lines(rx_bytes2,type="o",col="blue",xlab="Experiment Interval",ylab="Received Data")
     179lines(rx_bytes3,type="o",col="green",xlab="Experiment Interval",ylab="Received Data")
     180lines(rx_bytes4,type="o",col="purple",xlab="Experiment Interval",ylab="Received Data")
     181title(main="nmetrics experiment on ExoGENI (Received Data)", col.main="red", font.main=4)
     182legend("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
     187The resulting plot is shown below.
     188
     189[[Image(gimi20-otg1.png)]]
    78190
    79191Both scripts are simply executed with: