else:
protocol = split_protocol[3] + ":" + split_protocol[4]
#print "timestamp: ", timestamp, " - new protocol added: ", protocol, "\n"
+ # And source and destination IPs
+ 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.]+')
+ src_is_local = ip_re.search(ip_src)
+ dst_is_local = ip_re.search(ip_dst)
# Store protocol into the set (source)
protocols = None
# Key to search in the dictionary is <src-mac-address>-<dst-mac_address>
- dict_key = eth_src + "-" + eth_dst
+ dict_key = ip_src + "-" + ip_dst
+ #print "Key: ", dict_key
if dict_key not in edge_to_prot:
edge_to_prot[dict_key] = set()
protocols = edge_to_prot[dict_key]
edge_to_vol[dict_key] = 0;
edge_to_vol[dict_key] = edge_to_vol[dict_key] + packet_len
volume = str(edge_to_vol[dict_key])
- # And source and destination IPs
- 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.]+')
- src_is_local = ip_re.search(ip_src)
- dst_is_local = ip_re.search(ip_dst)
# Skip device to cloud communication if we are interested in the local graph.
# TODO should this go before the protocol dict is changed?
d0:52:a8:a3:60:0f, ZigBeeHub_Samsung_SmartThings
64:bc:0c:43:3f:40, Smartphone_Nexus_5_White
64:89:9a:86:a9:7d, Smartphone_Nexus_5_Black
+a8:96:75:2f:0c:9c, Smartphone_Motorola
60:f1:89:96:45:f6, Samsung_S7_Edge
60:57:18:8e:aa:94, Laptop_PC_HP
b0:b9:8a:73:69:8e, RouterPort_Bridge-LAN
74:da:38:0d:05:55, RaspberryPi_Controller
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
ff:ff:ff:ff:ff:ff, Broadcast_MAC
60:57:18:8e:aa:94, Laptop_PC_HP
74:da:38:0d:05:55, RaspberryPi_Controller
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
+40:5d:82:2f:50:2a, WebCam_Netgear_Arlo
+18:b4:30:bf:34:7e, Thermostat_Nest
python ./base_gexf_generator.py $1 $2.gexf
python ./parser/parse_packet_frequency.py $1 $2 $3 $4
-
--- /dev/null
+# 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 #
+# ***************** #
+# DLink switch local
+# eth0
+set output './result/dlink_switch_eth_timestamp_local_incoming.png'
+set title "DLink Switch Incoming Local Traffic (eth0)"
+plot "./result/dlink_switch_eth_local_incoming.dat" using 1:2 with lines
+set output './result/dlink_switch_eth_timestamp_local_outgoing.png'
+set title "DLink Switch Outgoing Local Traffic (eth0)"
+plot "./result/dlink_switch_eth_local_outgoing.dat" using 1:2 with lines
+# wlan1
+set output './result/dlink_switch_wlan_timestamp_local_incoming.png'
+set title "DLink Switch Incoming Local Traffic (wlan1)"
+plot "./result/dlink_switch_wlan_local_incoming.dat" using 1:2 with lines
+set output './result/dlink_switch_wlan_timestamp_local_outgoing.png'
+set title "DLink Switch Outgoing Local Traffic (wlan1)"
+plot "./result/dlink_switch_wlan_local_outgoing.dat" using 1:2 with lines
+
+# DLink switch remote
+# eth0
+set output './result/dlink_switch_eth_timestamp_remote_incoming.png'
+set title "DLink Switch Incoming Remote Traffic (eth0)"
+plot "./result/dlink_switch_eth_remote_incoming.dat" using 1:2 with lines
+set output './result/dlink_switch_eth_timestamp_remote_outgoing.png'
+set title "DLink Switch Outgoing Remote Traffic (eth0)"
+plot "./result/dlink_switch_eth_remote_outgoing.dat" using 1:2 with lines
+# wlan1
+set output './result/dlink_switch_wlan_timestamp_remote_incoming.png'
+set title "DLink Switch Incoming Remote Traffic (wlan1)"
+plot "./result/dlink_switch_wlan_remote_incoming.dat" using 1:2 with lines
+set output './result/dlink_switch_wlan_timestamp_remote_outgoing.png'
+set title "DLink Switch Outgoing Remote Traffic (wlan1)"
+plot "./result/dlink_switch_wlan_remote_outgoing.dat" using 1:2 with lines
+
+# DLink phone local
+# wlan1
+set output './result/dlink_phone_wlan_timestamp_local_incoming.png'
+set title "DLink Phone Incoming Local Traffic (wlan1)"
+plot "./result/dlink_phone_wlan_local_incoming.dat" using 1:2 with lines
+set output './result/dlink_phone_wlan_timestamp_local_outgoing.png'
+set title "DLink Phone Outgoing Local Traffic (wlan1)"
+plot "./result/dlink_phone_wlan_local_outgoing.dat" using 1:2 with lines
+
--- /dev/null
+# 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 #
+# ***************** #
+# DLink switch local
+# wlan1 / eth0
+set output './result/dlink_switch_wlan_timestamp_local_incoming.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 output './result/dlink_switch_wlan_timestamp_local_outgoing.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 output './result/dlink_switch_wlan_timestamp_remote_incoming.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 output './result/dlink_switch_wlan_timestamp_remote_outgoing.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"
--- /dev/null
+# 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 #
+# ***************** #
+# TPLink switch local
+# eth0
+set output './result/tplink_switch_eth_timestamp_local_incoming.png'
+set title "TP-Link Switch Incoming Local Traffic (eth0)"
+plot "./result/tplink_switch_eth_local_incoming.dat" using 1:2 with lines
+set output './result/tplink_switch_eth_timestamp_local_outgoing.png'
+set title "TP-Link Switch Outgoing Local Traffic (eth0)"
+plot "./result/tplink_switch_eth_local_outgoing.dat" using 1:2 with lines
+# wlan1
+set output './result/tplink_switch_wlan_timestamp_local_incoming.png'
+set title "TP-Link Switch Incoming Local Traffic (wlan1)"
+plot "./result/tplink_switch_wlan_local_incoming.dat" using 1:2 with lines
+set output './result/tplink_switch_wlan_timestamp_local_outgoing.png'
+set title "TP-Link Switch Outgoing Local Traffic (wlan1)"
+plot "./result/tplink_switch_wlan_local_outgoing.dat" using 1:2 with lines
+
+# TPLink switch remote
+# eth0
+set output './result/tplink_switch_eth_timestamp_remote_incoming.png'
+set title "TP-Link Switch Incoming Remote Traffic (eth0)"
+plot "./result/tplink_switch_eth_remote_incoming.dat" using 1:2 with lines
+set output './result/tplink_switch_eth_timestamp_remote_outgoing.png'
+set title "TP-Link Switch Outgoing Remote Traffic (eth0)"
+plot "./result/tplink_switch_eth_remote_outgoing.dat" using 1:2 with lines
+# wlan1
+set output './result/tplink_switch_wlan_timestamp_remote_incoming.png'
+set title "TP-Link Switch Incoming Remote Traffic (wlan1)"
+plot "./result/tplink_switch_wlan_remote_incoming.dat" using 1:2 with lines
+set output './result/tplink_switch_wlan_timestamp_remote_outgoing.png'
+set title "TP-Link Switch Outgoing Remote Traffic (wlan1)"
+plot "./result/tplink_switch_wlan_remote_outgoing.dat" using 1:2 with lines
+
+# TPLink phone local
+# wlan1
+set output './result/tplink_phone_wlan_timestamp_local_incoming.png'
+set title "TP-Link Phone Incoming Local Traffic (wlan1)"
+plot "./result/tplink_phone_wlan_local_incoming.dat" using 1:2 with lines
+set output './result/tplink_phone_wlan_timestamp_local_outgoing.png'
+set title "TP-Link Phone Outgoing Local Traffic (wlan1)"
+plot "./result/tplink_phone_wlan_local_outgoing.dat" using 1:2 with lines
+
--- /dev/null
+# 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 #
+# ***************** #
+# TPLink switch local
+# wlan1 / eth0
+set output './result/tplink_switch_wlan_timestamp_local_incoming.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 output './result/tplink_switch_wlan_timestamp_local_outgoing.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 output './result/tplink_switch_wlan_timestamp_remote_incoming.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 output './result/tplink_switch_wlan_timestamp_remote_outgoing.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 "WeMo Switch Outgoing Local Traffic (wlan1)"
plot "./result/wemo_switch_wlan_local_outgoing.dat" using 1:2 with lines
-# WeMo switch internet
+# WeMo switch remote
# 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
+set output './result/wemo_switch_eth_timestamp_remote_incoming.png'
+set title "WeMo Switch Incoming Remote Traffic (eth0)"
+plot "./result/wemo_switch_eth_remote_incoming.dat" using 1:2 with lines
+set output './result/wemo_switch_eth_timestamp_remote_outgoing.png'
+set title "WeMo Switch Outgoing Remote Traffic (eth0)"
+plot "./result/wemo_switch_eth_remote_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
+set output './result/wemo_switch_wlan_timestamp_remote_incoming.png'
+set title "WeMo Switch Incoming Remote Traffic (wlan1)"
+plot "./result/wemo_switch_wlan_remote_incoming.dat" using 1:2 with lines
+set output './result/wemo_switch_wlan_timestamp_remote_outgoing.png'
+set title "WeMo Switch Outgoing Remote Traffic (wlan1)"
+plot "./result/wemo_switch_wlan_remote_outgoing.dat" using 1:2 with lines
# WeMo phone local
# wlan1
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
--- /dev/null
+# 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 #
+# ***************** #
+# WeMo Insight switch local
+# eth0
+set output './result/wemo-insight_switch_eth_timestamp_local_incoming.png'
+set title "WeMo Insight Switch Incoming Local Traffic (eth0)"
+plot "./result/wemo-insight_switch_eth_local_incoming.dat" using 1:2 with lines
+set output './result/wemo-insight_switch_eth_timestamp_local_outgoing.png'
+set title "WeMo Insight Switch Outgoing Local Traffic (eth0)"
+plot "./result/wemo-insight_switch_eth_local_outgoing.dat" using 1:2 with lines
+# wlan1
+set output './result/wemo-insight_switch_wlan_timestamp_local_incoming.png'
+set title "WeMo Insight Switch Incoming Local Traffic (wlan1)"
+plot "./result/wemo-insight_switch_wlan_local_incoming.dat" using 1:2 with lines
+set output './result/wemo-insight_switch_wlan_timestamp_local_outgoing.png'
+set title "WeMo Insight Switch Outgoing Local Traffic (wlan1)"
+plot "./result/wemo-insight_switch_wlan_local_outgoing.dat" using 1:2 with lines
+
+# WeMo Insight switch remote
+# eth0
+set output './result/wemo-insight_switch_eth_timestamp_remote_incoming.png'
+set title "WeMo Insight Switch Incoming Remote Traffic (eth0)"
+plot "./result/wemo-insight_switch_eth_remote_incoming.dat" using 1:2 with lines
+set output './result/wemo-insight_switch_eth_timestamp_remote_outgoing.png'
+set title "WeMo Insight Switch Outgoing Remote Traffic (eth0)"
+plot "./result/wemo-insight_switch_eth_remote_outgoing.dat" using 1:2 with lines
+# wlan1
+set output './result/wemo-insight_switch_wlan_timestamp_remote_incoming.png'
+set title "WeMo Insight Switch Incoming Remote Traffic (wlan1)"
+plot "./result/wemo-insight_switch_wlan_remote_incoming.dat" using 1:2 with lines
+set output './result/wemo-insight_switch_wlan_timestamp_remote_outgoing.png'
+set title "WeMo Insight Switch Outgoing Remote Traffic (wlan1)"
+plot "./result/wemo-insight_switch_wlan_remote_outgoing.dat" using 1:2 with lines
+
+# WeMo Insight phone local
+# wlan1
+set output './result/wemo-insight_phone_wlan_timestamp_local_incoming.png'
+set title "WeMo Insight Phone Incoming Local Traffic (wlan1)"
+plot "./result/wemo-insight_phone_wlan_local_incoming.dat" using 1:2 with lines
+set output './result/wemo-insight_phone_wlan_timestamp_local_outgoing.png'
+set title "WeMo Insight Phone Outgoing Local Traffic (wlan1)"
+plot "./result/wemo-insight_phone_wlan_local_outgoing.dat" using 1:2 with lines
+
--- /dev/null
+# 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 #
+# ***************** #
+# WeMo Insight switch local
+# wlan1 / eth0
+set output './result/wemo-insight_switch_wlan_timestamp_local_incoming.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 output './result/wemo-insight_switch_wlan_timestamp_local_outgoing.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 output './result/wemo-insight_switch_wlan_timestamp_remote_incoming.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 output './result/wemo-insight_switch_wlan_timestamp_remote_outgoing.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"
--- /dev/null
+# 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 #
+# ***************** #
+# WeMo switch local
+# wlan1 / eth0
+set output './result/wemo_switch_wlan_timestamp_local_incoming.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 output './result/wemo_switch_wlan_timestamp_local_outgoing.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 output './result/wemo_switch_wlan_timestamp_remote_incoming.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 output './result/wemo_switch_wlan_timestamp_remote_outgoing.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"
# 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.
-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
+#PHONE=Nexus_5_Black
+#PHONE_MAC=64:89:9a:86:a9:7d
+PHONE=Motorola
+PHONE_MAC=a8:96:75:2f:0c:9c
+
+#PREFIX=wemo
+#DEVICE=WeMo_Switch
+#DEVICE_MAC=94:10:3e:36:60:09
+#PATH_SETUP=/scratch/traffic_measurements/Switches-Feb2018/wemo/setup
+#PATH_LOCAL=/scratch/traffic_measurements/Switches-Feb2018/wemo/local
+#PATH_REMOTE=/scratch/traffic_measurements/Switches-Feb2018/wemo/remote
+
+#PREFIX=tplink
+#DEVICE=TPLink_Switch
+#DEVICE_MAC=50:c7:bf:33:1f:09
+#PATH_SETUP=/scratch/traffic_measurements/Switches-Feb2018/tplink/setup
+#PATH_LOCAL=/scratch/traffic_measurements/Switches-Feb2018/tplink/local
+#PATH_REMOTE=/scratch/traffic_measurements/Switches-Feb2018/tplink/remote
+
+#PREFIX=wemo-insight
+#DEVICE=WeMo_Insight_Switch
+#DEVICE_MAC=14:91:82:25:10:77
+#PATH_SETUP=/scratch/traffic_measurements/Switches-Feb2018/wemo-insight/setup
+#PATH_LOCAL=/scratch/traffic_measurements/Switches-Feb2018/wemo-insight/local
+#PATH_REMOTE=/scratch/traffic_measurements/Switches-Feb2018/wemo-insight/remote
+
+PREFIX=dlink
+DEVICE=DLink_Switch
+DEVICE_MAC=90:8d:78:e3:81:0c
+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_SETUP_WLAN_JSON=$PREFIX.wlan1.setup.json
+PATH_SETUP_ETH_JSON=$PREFIX.eth0.setup.json
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_REMOTE_WLAN_JSON=$PREFIX.wlan1.remote.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_DIR_RESULT=result
+PATH_RESULT_SETUP_WLAN=$PREFIX\_switch_wlan_setup
+PATH_RESULT_SETUP_ETH=$PREFIX\_switch_eth_setup
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_REMOTE_WLAN=$PREFIX\_switch_wlan_remote
+PATH_RESULT_REMOTE_ETH=$PREFIX\_switch_eth_remote
PATH_RESULT_PHONE_LOCAL_WLAN=$PREFIX\_phone_wlan_local
-PATH_RESULT_PHONE_INTERNET_WLAN=$PREFIX\_phone_wlan_internet
+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 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
-
+./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
+gnuplot $PATH_GNUPLOT_COMBINED