Removing main_flow.sh; fixing flow to take time series plots from non DNS data
authorrtrimana <rtrimana@uci.edu>
Thu, 15 Feb 2018 19:52:44 +0000 (11:52 -0800)
committerrtrimana <rtrimana@uci.edu>
Thu, 15 Feb 2018 19:52:44 +0000 (11:52 -0800)
12 files changed:
base_gexf_generator.py
devicelist.dat
exclusion.dat
main_flow.sh [deleted file]
parser/parse_packet_frequency.py
plot_scripts/plot_ts_graph_dlink_combined
plot_scripts/plot_ts_graph_smartthings-plug [new file with mode: 0644]
plot_scripts/plot_ts_graph_smartthings-plug_combined [new file with mode: 0644]
plot_scripts/plot_ts_graph_tplink_combined
plot_scripts/plot_ts_graph_wemo-insight_combined
plot_scripts/plot_ts_graph_wemo_combined
run.sh

index 535391286d2a4a9fdf50a1401ab668abb3c8a4fc..5874b21fb25a79b12079802fc46aff0949611d9c 100644 (file)
@@ -174,7 +174,8 @@ def place_in_graph(G, eth_src, eth_dst, device_dns_mappings, dev_list, layers,
     ip_src = layers[JSON_KEY_IP][JSON_KEY_IP_SRC]
     ip_dst = layers[JSON_KEY_IP][JSON_KEY_IP_DST]
     # Categorize source and destination IP addresses: local vs. non-local
     ip_src = layers[JSON_KEY_IP][JSON_KEY_IP_SRC]
     ip_dst = layers[JSON_KEY_IP][JSON_KEY_IP_DST]
     # Categorize source and destination IP addresses: local vs. non-local
-    ip_re = re.compile(r'\b192.168.[0-9.]+')
+    #ip_re = re.compile(r'\b192.168.[0-9.]+')
+    ip_re = re.compile(r'\b192.168.1.[0-9.]+')
     src_is_local = ip_re.search(ip_src) 
     dst_is_local = ip_re.search(ip_dst)
     # Store protocol into the set (source)
     src_is_local = ip_re.search(ip_src) 
     dst_is_local = ip_re.search(ip_dst)
     # Store protocol into the set (source)
index a645060aaa0f3a637f69eb0b1ebc208801a823a8..77910b8e6fb22dc75d48c435c39231a671c8761b 100644 (file)
@@ -26,6 +26,7 @@ b0:b9:8a:73:69:8f, RouterPort_ETH1
 b0:b9:8a:73:69:90, RouterPort_WLAN0
 b0:b9:8a:73:69:91, RouterPort_WLAN1
 74:da:38:0d:05:55, RaspberryPi_Controller
 b0:b9:8a:73:69:90, RouterPort_WLAN0
 b0:b9:8a:73:69:91, RouterPort_WLAN1
 74:da:38:0d:05:55, RaspberryPi_Controller
+74:da:38:68:72:84, RaspberryPi_3_Vigilia
 d4:6a:6a:4f:e2:33, Dell_laptop
 80:e6:50:25:70:72, Apple_MAC
 68:a8:6d:06:e5:5e, Apple_MAC_PLRG
 d4:6a:6a:4f:e2:33, Dell_laptop
 80:e6:50:25:70:72, Apple_MAC
 68:a8:6d:06:e5:5e, Apple_MAC_PLRG
index 1aaad65a7b2300deb4f179c0d89fbe7cc9fdd219..99c0556588fc688b18a9c772a8f45a3aa379a805 100644 (file)
@@ -2,6 +2,7 @@ MAC_address, device_name
 60:f1:89:96:45:f6, Samsung_S7_Edge
 60:57:18:8e:aa:94, Laptop_PC_HP
 74:da:38:0d:05:55, RaspberryPi_Controller
 60:f1:89:96:45:f6, Samsung_S7_Edge
 60:57:18:8e:aa:94, Laptop_PC_HP
 74:da:38:0d:05:55, RaspberryPi_Controller
+74:da:38:68:72:84, RaspberryPi_3_Vigilia
 80:e6:50:25:70:72, Apple_MAC
 68:a8:6d:06:e5:5e, Apple_MAC_PLRG
 d4:6a:6a:4f:e2:33, Dell_laptop
 80:e6:50:25:70:72, Apple_MAC
 68:a8:6d:06:e5:5e, Apple_MAC_PLRG
 d4:6a:6a:4f:e2:33, Dell_laptop
diff --git a/main_flow.sh b/main_flow.sh
deleted file mode 100755 (executable)
index cbc97fb..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-# This is the main script that calls every other script that is needed for the main flow
-if [ $# -ne 4 ]
-    then
-        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"
-        exit 1
-fi
-
-# Check result folder and create one if it does not exist yet
-[ -d result ] || mkdir result
-
-# Run the analysis
-python ./base_gexf_generator.py $1 $2.gexf
-python ./parser/parse_packet_frequency.py $1 $2 $3 $4
-
index a08fcbafbbd2d27314ddeb3d7fcea78b61eb5bbf..d6ab9d4143cfda36b95659d07a1ee9b9b00a3656 100644 (file)
@@ -207,17 +207,23 @@ def main():
         print "Usage: python", sys.argv[0], "<input_file> <output_file> <device_name> <mac_address>"
         return
     # Parse the file for the specified MAC address
         print "Usage: python", sys.argv[0], "<input_file> <output_file> <device_name> <mac_address>"
         return
     # Parse the file for the specified MAC address
-    timelen_incoming = parse_json(sys.argv[1], sys.argv[4], True)
-    timelen_incoming = include_timestamps_zero_packets(timelen_incoming)
-    timelen_outgoing = parse_json(sys.argv[1], sys.argv[4], False)
-    timelen_outgoing = include_timestamps_zero_packets(timelen_outgoing)
-    # Write statistics into file
     print "====================================================================="
     print "====================================================================="
-    print "==> Analyzing incoming traffic ..."
-    save_to_file(sys.argv[3] + INCOMING_APPENDIX, timelen_incoming, sys.argv[2] + INCOMING_APPENDIX + FILE_APPENDIX)
+    print "Analyzing file: ", sys.argv[1]
+    timelen_incoming = parse_json(sys.argv[1], sys.argv[4], True)
+    if len(timelen_incoming) > 0:
+        timelen_incoming = include_timestamps_zero_packets(timelen_incoming)
+        print "==> Printing incoming traffic ..."
+        save_to_file(sys.argv[3] + INCOMING_APPENDIX, timelen_incoming, sys.argv[2] + INCOMING_APPENDIX + FILE_APPENDIX)
+    else:
+        print "No incoming traffic to this MAC address!"
     print "====================================================================="
     print "====================================================================="
-    print "==> Analyzing outgoing traffic ..."
-    save_to_file(sys.argv[3] + OUTGOING_APPENDIX, timelen_outgoing, sys.argv[2] + OUTGOING_APPENDIX + FILE_APPENDIX)
+    timelen_outgoing = parse_json(sys.argv[1], sys.argv[4], False)
+    if len(timelen_outgoing) > 0:
+        timelen_outgoing = include_timestamps_zero_packets(timelen_outgoing)
+        print "==> Printing outgoing traffic ..."
+        save_to_file(sys.argv[3] + OUTGOING_APPENDIX, timelen_outgoing, sys.argv[2] + OUTGOING_APPENDIX + FILE_APPENDIX)
+    else:
+        print "No outgoing traffic from this MAC address!"
     print "====================================================================="
     #for time in time_freq.keys():
     #for key in sorted(time_freq):
     print "====================================================================="
     #for time in time_freq.keys():
     #for key in sorted(time_freq):
@@ -263,7 +269,7 @@ def parse_json(filepath, macaddress, incomingoutgoing):
             datetimeobj = parser.parse(datetime)
             # Remove the microsecond part
             timestr = str(datetimeobj.time())[:8]
             datetimeobj = parser.parse(datetime)
             # Remove the microsecond part
             timestr = str(datetimeobj.time())[:8]
-            print str(timestr) + " - src:" + str(src) + " - dest:" + str(dst) + " - length: ", length
+            #print str(timestr) + " - src:" + str(src) + " - dest:" + str(dst) + " - length: ", length
             # Get and count the traffic for the specified MAC address
             if incomingoutgoing:           
                 if dst == macaddress:
             # Get and count the traffic for the specified MAC address
             if incomingoutgoing:           
                 if dst == macaddress:
index 5e8c800ad0cc17b76932bd338cd1f01839bdf70c..84b24395a693c67a5a0399e716d01b5b88d7d69b 100644 (file)
@@ -27,18 +27,18 @@ set yrange [0:]
 # ***************** #
 # DLink switch local
 # wlan1 / eth0
 # ***************** #
 # DLink switch local
 # wlan1 / eth0
-set output './result/dlink_switch_wlan_timestamp_local_incoming.png'
+set output './result/dlink_switch_wlan_timestamp_local_incoming_combined.png'
 set title "DLink Switch Incoming Local Traffic (wlan1/eth0)"
 plot "./result/dlink_switch_wlan_local_incoming.dat" using 1:2 with lines title "wlan1", "./result/dlink_switch_eth_local_incoming.dat" using 1:2 with lines title "eth0", "./result/dlink_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/dlink_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 set title "DLink Switch Incoming Local Traffic (wlan1/eth0)"
 plot "./result/dlink_switch_wlan_local_incoming.dat" using 1:2 with lines title "wlan1", "./result/dlink_switch_eth_local_incoming.dat" using 1:2 with lines title "eth0", "./result/dlink_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/dlink_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
-set output './result/dlink_switch_wlan_timestamp_local_outgoing.png'
+set output './result/dlink_switch_wlan_timestamp_local_outgoing_combined.png'
 set title "DLink Switch Outgoing Local Traffic (wlan1/eth0)"
 plot "./result/dlink_switch_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1", "./result/dlink_switch_eth_local_outgoing.dat" using 1:2 with lines title "eth0", "./result/dlink_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/dlink_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 
 # DLink switch remote
 # wlan1
 set title "DLink Switch Outgoing Local Traffic (wlan1/eth0)"
 plot "./result/dlink_switch_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1", "./result/dlink_switch_eth_local_outgoing.dat" using 1:2 with lines title "eth0", "./result/dlink_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/dlink_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 
 # DLink switch remote
 # wlan1
-set output './result/dlink_switch_wlan_timestamp_remote_incoming.png'
+set output './result/dlink_switch_wlan_timestamp_remote_incoming_combined.png'
 set title "DLink Switch Incoming Remote Traffic (wlan1/eth0)"
 plot "./result/dlink_switch_wlan_remote_incoming.dat" using 1:2 with lines title "wlan1", "./result/dlink_switch_eth_remote_incoming.dat" using 1:2 with lines title "eth0"
 set title "DLink Switch Incoming Remote Traffic (wlan1/eth0)"
 plot "./result/dlink_switch_wlan_remote_incoming.dat" using 1:2 with lines title "wlan1", "./result/dlink_switch_eth_remote_incoming.dat" using 1:2 with lines title "eth0"
-set output './result/dlink_switch_wlan_timestamp_remote_outgoing.png'
+set output './result/dlink_switch_wlan_timestamp_remote_outgoing_combined.png'
 set title "DLink Switch Outgoing Remote Traffic (wlan1/eth0)"
 plot "./result/dlink_switch_wlan_remote_outgoing.dat" using 1:2 with lines title "wlan1", "./result/dlink_switch_eth_remote_outgoing.dat" using 1:2 with lines title "eth0"
 set title "DLink Switch Outgoing Remote Traffic (wlan1/eth0)"
 plot "./result/dlink_switch_wlan_remote_outgoing.dat" using 1:2 with lines title "wlan1", "./result/dlink_switch_eth_remote_outgoing.dat" using 1:2 with lines title "eth0"
diff --git a/plot_scripts/plot_ts_graph_smartthings-plug b/plot_scripts/plot_ts_graph_smartthings-plug
new file mode 100644 (file)
index 0000000..56e298f
--- /dev/null
@@ -0,0 +1,68 @@
+# Script to plot time series graphs for network traffic analysis
+#
+# by Rahmadi Trimananda (rahmadi.trimananda@uci.edu)
+# Programming Language Research Group @ University of California, Irvine
+# Winter 2018
+
+# ************ #
+# BASIC SETUP  #
+# ************ #
+set terminal pngcairo enhanced font 'Verdana,10'
+set autoscale
+unset key
+unset log
+unset label
+set xtics 50
+set xtics rotate by 60 right
+set ytics auto
+set xlabel "Packet Timestamp (hh:mm:ss)"
+set ylabel "Packet Size (bytes)"
+set xdata time
+set timefmt "%H:%M:%S"
+set xrange [:]
+set yrange [0:]
+
+# ***************** #
+# PER DEVICE SETUP  #
+# ***************** #
+# SmartThings Plug switch local
+# eth0
+set output './result/smartthings-plug_switch_eth_timestamp_local_incoming.png'
+set title "SmartThings Plug Switch Incoming Local Traffic (eth0)"
+plot "./result/smartthings-plug_switch_eth_local_incoming.dat" using 1:2 with lines
+set output './result/smartthings-plug_switch_eth_timestamp_local_outgoing.png'
+set title "SmartThings Plug Switch Outgoing Local Traffic (eth0)"
+plot "./result/smartthings-plug_switch_eth_local_outgoing.dat" using 1:2 with lines
+# wlan1
+#set output './result/smartthings-plug_switch_wlan_timestamp_local_incoming.png'
+#set title "SmartThings Plug Switch Incoming Local Traffic (wlan1)"
+#plot "./result/smartthings-plug_switch_wlan_local_incoming.dat" using 1:2 with lines
+set output './result/smartthings-plug_switch_wlan_timestamp_local_outgoing.png'
+set title "SmartThings Plug Switch Outgoing Local Traffic (wlan1)"
+plot "./result/smartthings-plug_switch_wlan_local_outgoing.dat" using 1:2 with lines
+
+# SmartThings Plug switch remote
+# eth0
+set output './result/smartthings-plug_switch_eth_timestamp_remote_incoming.png'
+set title "SmartThings Plug Switch Incoming Remote Traffic (eth0)"
+plot "./result/smartthings-plug_switch_eth_remote_incoming.dat" using 1:2 with lines
+set output './result/smartthings-plug_switch_eth_timestamp_remote_outgoing.png'
+set title "SmartThings Plug Switch Outgoing Remote Traffic (eth0)"
+plot "./result/smartthings-plug_switch_eth_remote_outgoing.dat" using 1:2 with lines
+# wlan1
+#set output './result/smartthings-plug_switch_wlan_timestamp_remote_incoming.png'
+#set title "SmartThings Plug Switch Incoming Remote Traffic (wlan1)"
+#plot "./result/smartthings-plug_switch_wlan_remote_incoming.dat" using 1:2 with lines
+set output './result/smartthings-plug_switch_wlan_timestamp_remote_outgoing.png'
+set title "SmartThings Plug Switch Outgoing Remote Traffic (wlan1)"
+plot "./result/smartthings-plug_switch_wlan_remote_outgoing.dat" using 1:2 with lines
+
+# SmartThings Plug phone local
+# wlan1
+set output './result/smartthings-plug_phone_wlan_timestamp_local_incoming.png'
+set title "SmartThings Plug Phone Incoming Local Traffic (wlan1)"
+plot "./result/smartthings-plug_phone_wlan_local_incoming.dat" using 1:2 with lines
+set output './result/smartthings-plug_phone_wlan_timestamp_local_outgoing.png'
+set title "SmartThings Plug Phone Outgoing Local Traffic (wlan1)"
+plot "./result/smartthings-plug_phone_wlan_local_outgoing.dat" using 1:2 with lines
+
diff --git a/plot_scripts/plot_ts_graph_smartthings-plug_combined b/plot_scripts/plot_ts_graph_smartthings-plug_combined
new file mode 100644 (file)
index 0000000..6080dde
--- /dev/null
@@ -0,0 +1,44 @@
+# Script to plot time series graphs for network traffic analysis
+#
+# by Rahmadi Trimananda (rahmadi.trimananda@uci.edu)
+# Programming Language Research Group @ University of California, Irvine
+# Winter 2018
+
+# ************ #
+# BASIC SETUP  #
+# ************ #
+set terminal pngcairo enhanced font 'Verdana,10'
+set autoscale
+set key
+unset log
+unset label
+set xtics 50
+set xtics rotate by 60 right
+set ytics auto
+set xlabel "Packet Timestamp (hh:mm:ss)"
+set ylabel "Packet Size (bytes)"
+set xdata time
+set timefmt "%H:%M:%S"
+set xrange [:]
+set yrange [0:]
+
+# ***************** #
+# PER DEVICE SETUP  #
+# ***************** #
+# SmartThings Plug switch local
+# wlan1 / eth0
+set output './result/smartthings-plug_switch_wlan_timestamp_local_incoming_combined.png'
+set title "SmartThings Plug Switch Incoming Local Traffic (wlan1/eth0)"
+plot "./result/smartthings-plug_switch_eth_local_incoming.dat" using 1:2 with lines title "eth0", "./result/smartthings-plug_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/smartthings-plug_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
+set output './result/smartthings-plug_switch_wlan_timestamp_local_outgoing_combined.png'
+set title "SmartThings Plug Switch Outgoing Local Traffic (wlan1/eth0)"
+plot "./result/smartthings-plug_switch_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1", "./result/smartthings-plug_switch_eth_local_outgoing.dat" using 1:2 with lines title "eth0", "./result/smartthings-plug_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/smartthings-plug_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
+
+# SmartThings Plug switch remote
+# wlan1
+set output './result/smartthings-plug_switch_wlan_timestamp_remote_incoming_combined.png'
+set title "SmartThings Plug Switch Incoming Remote Traffic (wlan1/eth0)"
+plot "./result/smartthings-plug_switch_eth_remote_incoming.dat" using 1:2 with lines title "eth0"
+set output './result/smartthings-plug_switch_wlan_timestamp_remote_outgoing_combined.png'
+set title "SmartThings Plug Switch Outgoing Remote Traffic (wlan1/eth0)"
+plot "./result/smartthings-plug_switch_wlan_remote_outgoing.dat" using 1:2 with lines title "wlan1", "./result/smartthings-plug_switch_eth_remote_outgoing.dat" using 1:2 with lines title "eth0"
index 7e3d82a2f769610089c5344642dc66341a8bb722..ece1962745947970a4c40578b4c3dba36a989103 100644 (file)
@@ -27,19 +27,19 @@ set yrange [0:]
 # ***************** #
 # TPLink switch local
 # wlan1 / eth0
 # ***************** #
 # TPLink switch local
 # wlan1 / eth0
-set output './result/tplink_switch_wlan_timestamp_local_incoming.png'
+set output './result/tplink_switch_wlan_timestamp_local_incoming_combined.png'
 set title "TP-Link Switch Incoming Local Traffic (wlan1/eth0)"
 plot "./result/tplink_switch_wlan_local_incoming.dat" using 1:2 with lines title "wlan1", "./result/tplink_switch_eth_local_incoming.dat" using 1:2 with lines title "eth0", "./result/tplink_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/tplink_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 set title "TP-Link Switch Incoming Local Traffic (wlan1/eth0)"
 plot "./result/tplink_switch_wlan_local_incoming.dat" using 1:2 with lines title "wlan1", "./result/tplink_switch_eth_local_incoming.dat" using 1:2 with lines title "eth0", "./result/tplink_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/tplink_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
-set output './result/tplink_switch_wlan_timestamp_local_outgoing.png'
+set output './result/tplink_switch_wlan_timestamp_local_outgoing_combined.png'
 set title "TP-Link Switch Outgoing Local Traffic (wlan1/eth0)"
 plot "./result/tplink_switch_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1", "./result/tplink_switch_eth_local_outgoing.dat" using 1:2 with lines title "eth0", "./result/tplink_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/tplink_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 
 # TPLink switch remote
 # wlan1 / eth0
 set title "TP-Link Switch Outgoing Local Traffic (wlan1/eth0)"
 plot "./result/tplink_switch_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1", "./result/tplink_switch_eth_local_outgoing.dat" using 1:2 with lines title "eth0", "./result/tplink_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/tplink_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 
 # TPLink switch remote
 # wlan1 / eth0
-set output './result/tplink_switch_wlan_timestamp_remote_incoming.png'
+set output './result/tplink_switch_wlan_timestamp_remote_incoming_combined.png'
 set title "TP-Link Switch Incoming Remote Traffic (wlan1/eth0)"
 plot "./result/tplink_switch_wlan_remote_incoming.dat" using 1:2 with lines title "wlan1", "./result/tplink_switch_eth_remote_incoming.dat" using 1:2 with lines title "eth0"
 set title "TP-Link Switch Incoming Remote Traffic (wlan1/eth0)"
 plot "./result/tplink_switch_wlan_remote_incoming.dat" using 1:2 with lines title "wlan1", "./result/tplink_switch_eth_remote_incoming.dat" using 1:2 with lines title "eth0"
-set output './result/tplink_switch_wlan_timestamp_remote_outgoing.png'
+set output './result/tplink_switch_wlan_timestamp_remote_outgoing_combined.png'
 set title "TP-Link Switch Outgoing Remote Traffic (wlan1/eth0)"
 plot "./result/tplink_switch_wlan_remote_outgoing.dat" using 1:2 with lines title "wlan1", "./result/tplink_switch_eth_remote_outgoing.dat" using 1:2 with lines title "eth0"
 
 set title "TP-Link Switch Outgoing Remote Traffic (wlan1/eth0)"
 plot "./result/tplink_switch_wlan_remote_outgoing.dat" using 1:2 with lines title "wlan1", "./result/tplink_switch_eth_remote_outgoing.dat" using 1:2 with lines title "eth0"
 
index c8eb1b45a7f60aa5b42c11bbcf2f6d8c9e7bfa4f..9036c388e0e0686fda2cb825fdc63562e689b947 100644 (file)
@@ -27,18 +27,18 @@ set yrange [0:]
 # ***************** #
 # WeMo Insight switch local
 # wlan1 / eth0
 # ***************** #
 # WeMo Insight switch local
 # wlan1 / eth0
-set output './result/wemo-insight_switch_wlan_timestamp_local_incoming.png'
+set output './result/wemo-insight_switch_wlan_timestamp_local_incoming_combined.png'
 set title "WeMo Insight Switch Incoming Local Traffic (wlan1/eth0)"
 plot "./result/wemo-insight_switch_wlan_local_incoming.dat" using 1:2 with lines title "wlan1", "./result/wemo-insight_switch_eth_local_incoming.dat" using 1:2 with lines title "eth0", "./result/wemo-insight_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/wemo-insight_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 set title "WeMo Insight Switch Incoming Local Traffic (wlan1/eth0)"
 plot "./result/wemo-insight_switch_wlan_local_incoming.dat" using 1:2 with lines title "wlan1", "./result/wemo-insight_switch_eth_local_incoming.dat" using 1:2 with lines title "eth0", "./result/wemo-insight_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/wemo-insight_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
-set output './result/wemo-insight_switch_wlan_timestamp_local_outgoing.png'
+set output './result/wemo-insight_switch_wlan_timestamp_local_outgoing_combined.png'
 set title "WeMo Insight Switch Outgoing Local Traffic (wlan1/eth0)"
 plot "./result/wemo-insight_switch_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1", "./result/wemo-insight_switch_eth_local_outgoing.dat" using 1:2 with lines title "eth0", "./result/wemo-insight_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/wemo-insight_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 
 # WeMo Insight switch remote
 # wlan1
 set title "WeMo Insight Switch Outgoing Local Traffic (wlan1/eth0)"
 plot "./result/wemo-insight_switch_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1", "./result/wemo-insight_switch_eth_local_outgoing.dat" using 1:2 with lines title "eth0", "./result/wemo-insight_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/wemo-insight_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 
 # WeMo Insight switch remote
 # wlan1
-set output './result/wemo-insight_switch_wlan_timestamp_remote_incoming.png'
+set output './result/wemo-insight_switch_wlan_timestamp_remote_incoming_combined.png'
 set title "WeMo Insight Switch Incoming Remote Traffic (wlan1/eth0)"
 plot "./result/wemo-insight_switch_wlan_remote_incoming.dat" using 1:2 with lines title "wlan1", "./result/wemo-insight_switch_eth_remote_incoming.dat" using 1:2 with lines title "eth0"
 set title "WeMo Insight Switch Incoming Remote Traffic (wlan1/eth0)"
 plot "./result/wemo-insight_switch_wlan_remote_incoming.dat" using 1:2 with lines title "wlan1", "./result/wemo-insight_switch_eth_remote_incoming.dat" using 1:2 with lines title "eth0"
-set output './result/wemo-insight_switch_wlan_timestamp_remote_outgoing.png'
+set output './result/wemo-insight_switch_wlan_timestamp_remote_outgoing_combined.png'
 set title "WeMo Insight Switch Outgoing Remote Traffic (wlan1/eth0)"
 plot "./result/wemo-insight_switch_wlan_remote_outgoing.dat" using 1:2 with lines title "wlan1", "./result/wemo-insight_switch_eth_remote_outgoing.dat" using 1:2 with lines title "eth0"
 set title "WeMo Insight Switch Outgoing Remote Traffic (wlan1/eth0)"
 plot "./result/wemo-insight_switch_wlan_remote_outgoing.dat" using 1:2 with lines title "wlan1", "./result/wemo-insight_switch_eth_remote_outgoing.dat" using 1:2 with lines title "eth0"
index 7b21215e28f6434a1d58c412f24f32ee6dfd4d59..d8707b01c8040a8e8b185f7a02d602729a8f77f7 100644 (file)
@@ -27,18 +27,18 @@ set yrange [0:]
 # ***************** #
 # WeMo switch local
 # wlan1 / eth0
 # ***************** #
 # WeMo switch local
 # wlan1 / eth0
-set output './result/wemo_switch_wlan_timestamp_local_incoming.png'
+set output './result/wemo_switch_wlan_timestamp_local_incoming_combined.png'
 set title "WeMo Switch Incoming Local Traffic (wlan1/eth0)"
 plot "./result/wemo_switch_wlan_local_incoming.dat" using 1:2 with lines title "wlan1", "./result/wemo_switch_eth_local_incoming.dat" using 1:2 with lines title "eth0", "./result/wemo_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/wemo_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 set title "WeMo Switch Incoming Local Traffic (wlan1/eth0)"
 plot "./result/wemo_switch_wlan_local_incoming.dat" using 1:2 with lines title "wlan1", "./result/wemo_switch_eth_local_incoming.dat" using 1:2 with lines title "eth0", "./result/wemo_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/wemo_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
-set output './result/wemo_switch_wlan_timestamp_local_outgoing.png'
+set output './result/wemo_switch_wlan_timestamp_local_outgoing_combined.png'
 set title "WeMo Switch Outgoing Local Traffic (wlan1/eth0)"
 plot "./result/wemo_switch_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1", "./result/wemo_switch_eth_local_outgoing.dat" using 1:2 with lines title "eth0", "./result/wemo_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/wemo_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 
 # WeMo switch remote
 # wlan1
 set title "WeMo Switch Outgoing Local Traffic (wlan1/eth0)"
 plot "./result/wemo_switch_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1", "./result/wemo_switch_eth_local_outgoing.dat" using 1:2 with lines title "eth0", "./result/wemo_phone_wlan_local_outgoing.dat" using 1:2 with lines title "wlan1-phone-outgoing", "./result/wemo_phone_wlan_local_incoming.dat" using 1:2 with lines title "wlan1-phone-incoming"
 
 # WeMo switch remote
 # wlan1
-set output './result/wemo_switch_wlan_timestamp_remote_incoming.png'
+set output './result/wemo_switch_wlan_timestamp_remote_incoming_combined.png'
 set title "WeMo Switch Incoming Remote Traffic (wlan1/eth0)"
 plot "./result/wemo_switch_wlan_remote_incoming.dat" using 1:2 with lines title "wlan1", "./result/wemo_switch_eth_remote_incoming.dat" using 1:2 with lines title "eth0"
 set title "WeMo Switch Incoming Remote Traffic (wlan1/eth0)"
 plot "./result/wemo_switch_wlan_remote_incoming.dat" using 1:2 with lines title "wlan1", "./result/wemo_switch_eth_remote_incoming.dat" using 1:2 with lines title "eth0"
-set output './result/wemo_switch_wlan_timestamp_remote_outgoing.png'
+set output './result/wemo_switch_wlan_timestamp_remote_outgoing_combined.png'
 set title "WeMo Switch Outgoing Remote Traffic (wlan1/eth0)"
 plot "./result/wemo_switch_wlan_remote_outgoing.dat" using 1:2 with lines title "wlan1", "./result/wemo_switch_eth_remote_outgoing.dat" using 1:2 with lines title "eth0"
 set title "WeMo Switch Outgoing Remote Traffic (wlan1/eth0)"
 plot "./result/wemo_switch_wlan_remote_outgoing.dat" using 1:2 with lines title "wlan1", "./result/wemo_switch_eth_remote_outgoing.dat" using 1:2 with lines title "eth0"
diff --git a/run.sh b/run.sh
index 15f46d891fedcd8fcaf9d3600fca23997fcd4e1a..5a7cb3bf68b1d2b9676edf6c1e7f752ce7d91be0 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -37,11 +37,22 @@ PATH_SETUP=/scratch/traffic_measurements/Switches-Feb2018/dlink/setup
 PATH_LOCAL=/scratch/traffic_measurements/Switches-Feb2018/dlink/local
 PATH_REMOTE=/scratch/traffic_measurements/Switches-Feb2018/dlink/remote
 
 PATH_LOCAL=/scratch/traffic_measurements/Switches-Feb2018/dlink/local
 PATH_REMOTE=/scratch/traffic_measurements/Switches-Feb2018/dlink/remote
 
+#PREFIX=smartthings-plug
+#DEVICE=SmartThings_Plug
+#DEVICE_MAC=d0:52:a8:a3:60:0f
+#PATH_SETUP=/scratch/traffic_measurements/Switches-Feb2018/smartthings/setup
+#PATH_LOCAL=/scratch/traffic_measurements/Switches-Feb2018/smartthings/local
+#PATH_REMOTE=/scratch/traffic_measurements/Switches-Feb2018/smartthings/remote
+
 PATH_SETUP_WLAN_JSON=$PREFIX.wlan1.setup.json
 PATH_SETUP_ETH_JSON=$PREFIX.eth0.setup.json
 PATH_SETUP_WLAN_JSON=$PREFIX.wlan1.setup.json
 PATH_SETUP_ETH_JSON=$PREFIX.eth0.setup.json
+PATH_LOCAL_WLAN_DNS_JSON=$PREFIX.wlan1.local.dns.json
 PATH_LOCAL_WLAN_JSON=$PREFIX.wlan1.local.json
 PATH_LOCAL_WLAN_JSON=$PREFIX.wlan1.local.json
+PATH_LOCAL_ETH_DNS_JSON=$PREFIX.eth0.local.dns.json
 PATH_LOCAL_ETH_JSON=$PREFIX.eth0.local.json
 PATH_LOCAL_ETH_JSON=$PREFIX.eth0.local.json
+PATH_REMOTE_WLAN_DNS_JSON=$PREFIX.wlan1.remote.dns.json
 PATH_REMOTE_WLAN_JSON=$PREFIX.wlan1.remote.json
 PATH_REMOTE_WLAN_JSON=$PREFIX.wlan1.remote.json
+PATH_REMOTE_ETH_DNS_JSON=$PREFIX.eth0.remote.dns.json
 PATH_REMOTE_ETH_JSON=$PREFIX.eth0.remote.json
 PATH_GNUPLOT=./plot_scripts/plot_ts_graph_$PREFIX
 PATH_GNUPLOT_COMBINED=./plot_scripts/plot_ts_graph_$PREFIX\_combined
 PATH_REMOTE_ETH_JSON=$PREFIX.eth0.remote.json
 PATH_GNUPLOT=./plot_scripts/plot_ts_graph_$PREFIX
 PATH_GNUPLOT_COMBINED=./plot_scripts/plot_ts_graph_$PREFIX\_combined
@@ -55,13 +66,21 @@ PATH_RESULT_REMOTE_ETH=$PREFIX\_switch_eth_remote
 PATH_RESULT_PHONE_LOCAL_WLAN=$PREFIX\_phone_wlan_local
 PATH_RESULT_PHONE_REMOTE_WLAN=$PREFIX\_phone_wlan_remote
 
 PATH_RESULT_PHONE_LOCAL_WLAN=$PREFIX\_phone_wlan_local
 PATH_RESULT_PHONE_REMOTE_WLAN=$PREFIX\_phone_wlan_remote
 
-./main_flow.sh $PATH_SETUP/$PATH_SETUP_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_SETUP_WLAN $DEVICE $DEVICE_MAC
-./main_flow.sh $PATH_SETUP/$PATH_SETUP_ETH_JSON $PATH_DIR_RESULT/$PATH_RESULT_SETUP_ETH $ROUTER $ROUTER_MAC
-./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 $ROUTER_MAC
-./main_flow.sh $PATH_REMOTE/$PATH_REMOTE_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_REMOTE_WLAN $DEVICE $DEVICE_MAC
-./main_flow.sh $PATH_REMOTE/$PATH_REMOTE_ETH_JSON $PATH_DIR_RESULT/$PATH_RESULT_REMOTE_ETH $ROUTER $ROUTER_MAC
-./main_flow.sh $PATH_LOCAL/$PATH_LOCAL_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_PHONE_LOCAL_WLAN $PHONE $PHONE_MAC
-./main_flow.sh $PATH_REMOTE/$PATH_REMOTE_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_PHONE_REMOTE_WLAN $PHONE $PHONE_MAC
-#gnuplot $PATH_GNUPLOT
+#python ./base_gexf_generator.py $PATH_SETUP/$PATH_SETUP_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_SETUP_WLAN.gexf
+#python ./base_gexf_generator.py $PATH_SETUP/$PATH_SETUP_ETH_JSON $PATH_DIR_RESULT/$PATH_RESULT_SETUP_ETH.gexf
+
+python ./base_gexf_generator.py $PATH_LOCAL/$PATH_LOCAL_WLAN_DNS_JSON $PATH_DIR_RESULT/$PATH_RESULT_LOCAL_WLAN.gexf
+python ./parser/parse_packet_frequency.py $PATH_LOCAL/$PATH_LOCAL_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_LOCAL_WLAN $DEVICE $DEVICE_MAC
+python ./base_gexf_generator.py $PATH_LOCAL/$PATH_LOCAL_ETH_DNS_JSON $PATH_DIR_RESULT/$PATH_RESULT_LOCAL_ETH.gexf
+python ./parser/parse_packet_frequency.py $PATH_LOCAL/$PATH_LOCAL_ETH_JSON $PATH_DIR_RESULT/$PATH_RESULT_LOCAL_ETH $ROUTER $ROUTER_MAC
+
+python ./base_gexf_generator.py $PATH_REMOTE/$PATH_REMOTE_WLAN_DNS_JSON $PATH_DIR_RESULT/$PATH_RESULT_REMOTE_WLAN.gexf
+python ./parser/parse_packet_frequency.py $PATH_REMOTE/$PATH_REMOTE_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_REMOTE_WLAN $DEVICE $DEVICE_MAC
+python ./base_gexf_generator.py $PATH_REMOTE/$PATH_REMOTE_ETH_DNS_JSON $PATH_DIR_RESULT/$PATH_RESULT_REMOTE_ETH.gexf
+python ./parser/parse_packet_frequency.py $PATH_REMOTE/$PATH_REMOTE_ETH_JSON $PATH_DIR_RESULT/$PATH_RESULT_REMOTE_ETH $ROUTER $ROUTER_MAC
+
+python ./parser/parse_packet_frequency.py $PATH_LOCAL/$PATH_LOCAL_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_PHONE_LOCAL_WLAN $PHONE $PHONE_MAC
+python ./parser/parse_packet_frequency.py $PATH_REMOTE/$PATH_REMOTE_WLAN_JSON $PATH_DIR_RESULT/$PATH_RESULT_PHONE_REMOTE_WLAN $PHONE $PHONE_MAC
+
+gnuplot $PATH_GNUPLOT
 gnuplot $PATH_GNUPLOT_COMBINED
 gnuplot $PATH_GNUPLOT_COMBINED