From a8f869fdfb7a728f275a345ea8ef19f7914b225c Mon Sep 17 00:00:00 2001 From: rtrimana Date: Wed, 14 Feb 2018 11:45:27 -0800 Subject: [PATCH] Working scripts and plots for 4 devices (smart plugs) --- base_gexf_generator.py | 17 ++--- devicelist.dat | 2 + exclusion.dat | 3 + main_flow.sh | 1 - plot_scripts/plot_ts_graph_dlink | 68 ++++++++++++++++++ plot_scripts/plot_ts_graph_dlink_combined | 44 ++++++++++++ plot_scripts/plot_ts_graph_tplink | 68 ++++++++++++++++++ plot_scripts/plot_ts_graph_tplink_combined | 45 ++++++++++++ plot_scripts/plot_ts_graph_wemo | 34 ++++----- plot_scripts/plot_ts_graph_wemo-insight | 68 ++++++++++++++++++ .../plot_ts_graph_wemo-insight_combined | 44 ++++++++++++ plot_scripts/plot_ts_graph_wemo_combined | 44 ++++++++++++ run.sh | 71 ++++++++++++++----- 13 files changed, 460 insertions(+), 49 deletions(-) create mode 100644 plot_scripts/plot_ts_graph_dlink create mode 100644 plot_scripts/plot_ts_graph_dlink_combined create mode 100644 plot_scripts/plot_ts_graph_tplink create mode 100644 plot_scripts/plot_ts_graph_tplink_combined create mode 100644 plot_scripts/plot_ts_graph_wemo-insight create mode 100644 plot_scripts/plot_ts_graph_wemo-insight_combined create mode 100644 plot_scripts/plot_ts_graph_wemo_combined diff --git a/base_gexf_generator.py b/base_gexf_generator.py index a85184a..5353912 100644 --- a/base_gexf_generator.py +++ b/base_gexf_generator.py @@ -170,10 +170,18 @@ def place_in_graph(G, eth_src, eth_dst, device_dns_mappings, dev_list, layers, 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 - - 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] @@ -185,13 +193,6 @@ def place_in_graph(G, eth_src, eth_dst, device_dns_mappings, dev_list, layers, 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? diff --git a/devicelist.dat b/devicelist.dat index b94652c..a645060 100644 --- a/devicelist.dat +++ b/devicelist.dat @@ -18,6 +18,7 @@ c4:12:f5:e3:dc:17, MotionSensor_D-Link 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 @@ -27,4 +28,5 @@ b0:b9:8a:73:69:91, RouterPort_WLAN1 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 diff --git a/exclusion.dat b/exclusion.dat index 8a22869..1aaad65 100644 --- a/exclusion.dat +++ b/exclusion.dat @@ -3,4 +3,7 @@ MAC_address, device_name 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 diff --git a/main_flow.sh b/main_flow.sh index 7150ed3..cbc97fb 100755 --- a/main_flow.sh +++ b/main_flow.sh @@ -18,4 +18,3 @@ fi python ./base_gexf_generator.py $1 $2.gexf python ./parser/parse_packet_frequency.py $1 $2 $3 $4 - diff --git a/plot_scripts/plot_ts_graph_dlink b/plot_scripts/plot_ts_graph_dlink new file mode 100644 index 0000000..b79406c --- /dev/null +++ b/plot_scripts/plot_ts_graph_dlink @@ -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 # +# ***************** # +# 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 + diff --git a/plot_scripts/plot_ts_graph_dlink_combined b/plot_scripts/plot_ts_graph_dlink_combined new file mode 100644 index 0000000..5e8c800 --- /dev/null +++ b/plot_scripts/plot_ts_graph_dlink_combined @@ -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 # +# ***************** # +# 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" diff --git a/plot_scripts/plot_ts_graph_tplink b/plot_scripts/plot_ts_graph_tplink new file mode 100644 index 0000000..4f1fb35 --- /dev/null +++ b/plot_scripts/plot_ts_graph_tplink @@ -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 # +# ***************** # +# 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 + diff --git a/plot_scripts/plot_ts_graph_tplink_combined b/plot_scripts/plot_ts_graph_tplink_combined new file mode 100644 index 0000000..7e3d82a --- /dev/null +++ b/plot_scripts/plot_ts_graph_tplink_combined @@ -0,0 +1,45 @@ +# 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" + diff --git a/plot_scripts/plot_ts_graph_wemo b/plot_scripts/plot_ts_graph_wemo index 23b286b..dfe1641 100644 --- a/plot_scripts/plot_ts_graph_wemo +++ b/plot_scripts/plot_ts_graph_wemo @@ -41,21 +41,21 @@ 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 +# 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 @@ -65,12 +65,4 @@ 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/plot_scripts/plot_ts_graph_wemo-insight b/plot_scripts/plot_ts_graph_wemo-insight new file mode 100644 index 0000000..e4c245b --- /dev/null +++ b/plot_scripts/plot_ts_graph_wemo-insight @@ -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 # +# ***************** # +# 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 + diff --git a/plot_scripts/plot_ts_graph_wemo-insight_combined b/plot_scripts/plot_ts_graph_wemo-insight_combined new file mode 100644 index 0000000..c8eb1b4 --- /dev/null +++ b/plot_scripts/plot_ts_graph_wemo-insight_combined @@ -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 # +# ***************** # +# 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" diff --git a/plot_scripts/plot_ts_graph_wemo_combined b/plot_scripts/plot_ts_graph_wemo_combined new file mode 100644 index 0000000..7b21215 --- /dev/null +++ b/plot_scripts/plot_ts_graph_wemo_combined @@ -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 # +# ***************** # +# 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" diff --git a/run.sh b/run.sh index e7c08bb..15f46d8 100755 --- a/run.sh +++ b/run.sh @@ -2,33 +2,66 @@ # 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 -- 2.34.1