Completing a new flow that will do automated analysis and graph generation for one...
authorrtrimana <rtrimana@uci.edu>
Wed, 7 Feb 2018 23:58:03 +0000 (15:58 -0800)
committerrtrimana <rtrimana@uci.edu>
Wed, 7 Feb 2018 23:58:03 +0000 (15:58 -0800)
base_gexf_generator.py
main_flow.sh
plot_scripts/plot_ts_graph_wemo
run.sh

index eed37c050b2fdf8319cd677feeeb2623f9d1daed..a85184af02320347bf2138461fa62b3bb4b7672d 100644 (file)
@@ -43,6 +43,7 @@ JSON_KEY_FRAME_LENGTH = "frame.len"
 JSON_KEY_ETH = "eth"
 JSON_KEY_ETH_SRC = "eth.src"
 JSON_KEY_ETH_DST = "eth.dst"
+JSON_KEY_IPV6 = "ipv6"
 JSON_KEY_IP = "ip"
 JSON_KEY_IP_SRC = "ip.src"
 JSON_KEY_IP_DST = "ip.dst"
@@ -292,7 +293,10 @@ def parse_json(file_path):
             if eth_dst in exc_list:
                 print "[ WARNING: Destination ", eth_dst, " is excluded from graph! ]"
                 continue
-           
+            # Exclude if IP does not exist in layers - this means IPv6
+            if JSON_KEY_IP not in layers and JSON_KEY_IPV6 in layers:
+                continue
+            
             # Place nodes and edges in graph
             place_in_graph(G, eth_src, eth_dst, device_dns_mappings, dev_list, layers, 
                 edge_to_prot, edge_to_vol)
index 499845b95f4db51ed0cf478ab041e4a6feb94d34..7150ed3b08a8bb23e4c730885cdf46229bfb4370 100755 (executable)
@@ -1,11 +1,10 @@
 #!/bin/sh
 
 # This is the main script that calls every other script that is needed for the main flow
-if [ $# -ne 5 ]
+if [ $# -ne 4 ]
     then
-        echo "Usage: main_flow.sh <json-file-local> <json-file-internet> <output-file-name>"
-        echo "       <json-file-local>    = JSON file of local traffic captured on WLAN interfaces"
-        echo "       <json-file-internet> = JSON file of internet traffic captured on ETH interfaces"
+        echo "Usage: main_flow.sh <json-file> <output-file-name> <device-name> <device-mac-address>"
+        echo "       <json-file>    = JSON file of local/traffic captured on WLAN interfaces"
         echo "       <output-file-name>   = base name for the output files"
         echo "       <device-name>        = device name"
         echo "       <device-mac-address> = device MAC address"
@@ -13,12 +12,10 @@ if [ $# -ne 5 ]
 fi
 
 # Check result folder and create one if it does not exist yet
-[ -d $5 ] || mkdir $5
+[ -d result ] || mkdir result
 
 # Run the analysis
-python ./base_gexf_generator.py $1 $3_local.gexf
-python ./base_gexf_generator.py $2 $3_internet.gexf
-python ./parser/parse_packet_frequency.py $1 $3_local $4 $5
-python ./parser/parse_packet_frequency.py $2 $3_internet $4 $5
-gnuplot ./plot_scripts/plot_ts_graph_wemo
+python ./base_gexf_generator.py $1 $2.gexf
+python ./parser/parse_packet_frequency.py $1 $2 $3 $4
+
 
index 556b5434287d12a09c03f654c7f6a0b8ce49bc3e..71adc2f22ae955be223e705bab06ef96641e24c6 100644 (file)
@@ -25,18 +25,51 @@ set yrange [0:]
 # PER DEVICE SETUP  #
 # ***************** #
 # WeMo switch local
-set output './result/wemo_switch_timestamp_local_incoming.png'
-set title "WeMo Switch Incoming Local Traffic"
-plot "./result/wemo_switch_local_incoming.dat" using 1:2 with lines
-set output './result/wemo_switch_timestamp_local_outgoing.png'
-set title "WeMo Switch Outgoing Local Traffic"
-plot "./result/wemo_switch_local_outgoing.dat" using 1:2 with lines
+# eth0
+set output './result/wemo_switch_eth_timestamp_local_incoming.png'
+set title "WeMo Switch Incoming Local Traffic (eth0)"
+plot "./result/wemo_switch_eth_local_incoming.dat" using 1:2 with lines
+set output './result/wemo_switch_eth_timestamp_local_outgoing.png'
+set title "WeMo Switch Outgoing Local Traffic (eth0)"
+plot "./result/wemo_switch_eth_local_outgoing.dat" using 1:2 with lines
+# wlan1
+set output './result/wemo_switch_wlan_timestamp_local_incoming.png'
+set title "WeMo Switch Incoming Local Traffic (wlan1)"
+plot "./result/wemo_switch_wlan_local_incoming.dat" using 1:2 with lines
+set output './result/wemo_switch_wlan_timestamp_local_outgoing.png'
+set title "WeMo Switch Outgoing Local Traffic (wlan1)"
+plot "./result/wemo_switch_wlan_local_outgoing.dat" using 1:2 with lines
 
 # WeMo switch internet
-set output './result/wemo_switch_timestamp_internet_incoming.png'
-set title "WeMo Switch Incoming Internet Traffic"
-plot "./result/wemo_switch_internet_incoming.dat" using 1:2 with lines
-set output './result/wemo_switch_timestamp_internet_outgoing.png'
-set title "WeMo Switch Outgoing Internet Traffic"
-plot "./result/wemo_switch_internet_outgoing.dat" using 1:2 with lines
+# eth0
+set output './result/wemo_switch_eth_timestamp_internet_incoming.png'
+set title "WeMo Switch Incoming Internet Traffic (eth0)"
+plot "./result/wemo_switch_eth_internet_incoming.dat" using 1:2 with lines
+set output './result/wemo_switch_eth_timestamp_internet_outgoing.png'
+set title "WeMo Switch Outgoing Internet Traffic (eth0)"
+plot "./result/wemo_switch_eth_internet_outgoing.dat" using 1:2 with lines
+# wlan1
+set output './result/wemo_switch_wlan_timestamp_internet_incoming.png'
+set title "WeMo Switch Incoming Internet Traffic (wlan1)"
+plot "./result/wemo_switch_wlan_internet_incoming.dat" using 1:2 with lines
+set output './result/wemo_switch_wlan_timestamp_internet_outgoing.png'
+set title "WeMo Switch Outgoing Internet Traffic (wlan1)"
+plot "./result/wemo_switch_wlan_internet_outgoing.dat" using 1:2 with lines
+
+# WeMo phone local
+# wlan1
+set output './result/wemo_phone_wlan_timestamp_local_incoming.png'
+set title "WeMo Phone Incoming Local Traffic (wlan1)"
+plot "./result/wemo_phone_wlan_local_incoming.dat" using 1:2 with lines
+set output './result/wemo_phone_wlan_timestamp_local_outgoing.png'
+set title "WeMo Phone Outgoing Local Traffic (wlan1)"
+plot "./result/wemo_phone_wlan_local_outgoing.dat" using 1:2 with lines
+# WeMo phone internet
+# wlan1
+set output './result/wemo_phone_wlan_timestamp_internet_incoming.png'
+set title "WeMo Phone Incoming Internet Traffic (wlan1)"
+plot "./result/wemo_phone_wlan_internet_incoming.dat" using 1:2 with lines
+set output './result/wemo_phone_wlan_timestamp_internet_outgoing.png'
+set title "WeMo Phone Outgoing Internet Traffic (wlan1)"
+plot "./result/wemo_phone_wlan_internet_outgoing.dat" using 1:2 with lines
 
diff --git a/run.sh b/run.sh
index 7465ad9d9bd1e4bd16784fc8a43962eea6264bfb..e7c08bbb6f571e417763190fec8d92e479608c26 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -2,5 +2,33 @@
 
 # This lists down all the calls to the main_flow.sh script.
 # Basically, we make one call per one device that we want to analyze.
-./main_flow.sh json/eth1.dump.json json/eth1.dump.json result/wemo_switch WeMo_Switch 94:10:3e:36:60:09
-#./main_flow.sh json/eth1.dump.json json/eth1.dump.json result/google_nexus Google_Nexus 64:bc:0c:43:3f:40
+PREFIX=wemo
+DEVICE=WeMo_Switch
+DEVICE_MAC=94:10:3e:36:60:09
+ROUTER=Router
+ROUTER_MAC=b0:b9:8a:73:69:8f
+PHONE=Nexus_5_Black
+PHONE_MAC=64:89:9a:86:a9:7d
+PATH_LOCAL=/scratch/traffic_measurements/WeMo-February-2018/wemo-local
+PATH_INTERNET=/scratch/traffic_measurements/WeMo-February-2018/wemo-internet
+PATH_LOCAL_WLAN_JSON=$PREFIX.wlan1.local.json
+PATH_LOCAL_ETH_JSON=$PREFIX.eth0.local.json
+PATH_INTERNET_WLAN_JSON=$PREFIX.wlan1.internet.json
+PATH_INTERNET_ETH_JSON=$PREFIX.eth0.internet.json
+PATH_GNUPLOT=./plot_scripts/plot_ts_graph_$PREFIX
+PATH_DIR_RESULT=result
+PATH_RESULT_LOCAL_WLAN=$PREFIX\_switch_wlan_local
+PATH_RESULT_LOCAL_ETH=$PREFIX\_switch_eth_local
+PATH_RESULT_INTERNET_WLAN=$PREFIX\_switch_wlan_internet
+PATH_RESULT_INTERNET_ETH=$PREFIX\_switch_eth_internet
+PATH_RESULT_PHONE_LOCAL_WLAN=$PREFIX\_phone_wlan_local
+PATH_RESULT_PHONE_INTERNET_WLAN=$PREFIX\_phone_wlan_internet
+
+./main_flow.sh $PATH_LOCAL/$PATH_LOCAL_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_LOCAL_WLAN $DEVICE $DEVICE_MAC
+./main_flow.sh $PATH_LOCAL/$PATH_LOCAL_ETH_JSON $PATH_DIR_RESULT/$PATH_RESULT_LOCAL_ETH Router b0:b9:8a:73:69:8f
+./main_flow.sh $PATH_INTERNET/$PATH_INTERNET_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_INTERNET_WLAN WeMo_Switch 94:10:3e:36:60:09
+./main_flow.sh $PATH_INTERNET/$PATH_INTERNET_ETH_JSON $PATH_DIR_RESULT/$PATH_RESULT_INTERNET_ETH Router b0:b9:8a:73:69:8f
+./main_flow.sh $PATH_LOCAL/$PATH_LOCAL_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_PHONE_LOCAL_WLAN Nexus_5_Black 64:89:9a:86:a9:7d
+./main_flow.sh $PATH_INTERNET/$PATH_INTERNET_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_PHONE_INTERNET_WLAN Nexus_5_Black 64:89:9a:86:a9:7d
+gnuplot $PATH_GNUPLOT
+