From: rtrimana Date: Wed, 7 Feb 2018 23:58:03 +0000 (-0800) Subject: Completing a new flow that will do automated analysis and graph generation for one... X-Git-Url: http://plrg.eecs.uci.edu/git/?p=pingpong.git;a=commitdiff_plain;h=0eaee7be00139a89a2779c121f254b5d40b404c7 Completing a new flow that will do automated analysis and graph generation for one device --- diff --git a/base_gexf_generator.py b/base_gexf_generator.py index eed37c0..a85184a 100644 --- a/base_gexf_generator.py +++ b/base_gexf_generator.py @@ -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) diff --git a/main_flow.sh b/main_flow.sh index 499845b..7150ed3 100755 --- a/main_flow.sh +++ b/main_flow.sh @@ -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 " - echo " = JSON file of local traffic captured on WLAN interfaces" - echo " = JSON file of internet traffic captured on ETH interfaces" + echo "Usage: main_flow.sh " + echo " = JSON file of local/traffic captured on WLAN interfaces" echo " = base name for the output files" echo " = device name" echo " = 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 + diff --git a/plot_scripts/plot_ts_graph_wemo b/plot_scripts/plot_ts_graph_wemo index 556b543..71adc2f 100644 --- a/plot_scripts/plot_ts_graph_wemo +++ b/plot_scripts/plot_ts_graph_wemo @@ -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 7465ad9..e7c08bb 100755 --- 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 +