Simplifying script for UNSW layer 3 experiment: reuse the UNB script and iterate...
authorrtrimana <rtrimana@uci.edu>
Thu, 14 Mar 2019 16:29:00 +0000 (09:29 -0700)
committerrtrimana <rtrimana@uci.edu>
Thu, 14 Mar 2019 16:29:00 +0000 (09:29 -0700)
Code/Projects/PacketLevelSignatureExtractor/execute_layer3_unsw_all_detection.sh

index bcc9a8c..92570eb 100755 (executable)
 #!/bin/bash
 
-#set -x # echo invoked commands to std out
-
-# Base dir should point to the experimental_result folder which contains the subfolders:
-# - 'smarthome' which contains the traces collected while other devices are idle
-# - 'standalone' which contains signatures and the traces used to generate the signatures.
-BASE_DIR=$1
-readonly BASE_DIR
-
-OUTPUT_DIR=$2
-readonly OUTPUT_DIR
-
-BASE_DIR_UNSW=$3
-readonly BASE_DIR_UNSW
+# Arg1 should point to the folder with UNSW traces (PCAP files w/o any expected events).
+UNSW_TRACES_DIR=$1
 
-PCAPS_BASE_DIR="$BASE_DIR/smarthome"
-readonly PCAPS_BASE_DIR
-
-SIGNATURES_BASE_DIR="$BASE_DIR/standalone"
+# Arg2 should point to the base directory  for signature files (i.e., /some/local/path/experimental_result/standalone)
+SIGNATURES_BASE_DIR=$2
 readonly SIGNATURES_BASE_DIR
 
-# Files that are too big or could generate errors but results are valid
-PCAP_FILE_ARR[0]="$BASE_DIR_UNSW/UNSW/16-09-28.pcap"
-PCAP_FILE_ARR[1]="$BASE_DIR_UNSW/UNSW/16-10-02.pcap"
-PCAP_FILE_ARR[2]="$BASE_DIR_UNSW/UNSW/16-10-03.pcap"
-PCAP_FILE_ARR[3]="$BASE_DIR_UNSW/UNSW/16-10-04-a.pcap"
-PCAP_FILE_ARR[4]="$BASE_DIR_UNSW/UNSW/16-10-04-b.pcap"
-PCAP_FILE_ARR[5]="$BASE_DIR_UNSW/UNSW/16-10-07.pcap"
-PCAP_FILE_ARR[6]="$BASE_DIR_UNSW/UNSW/16-10-08.pcap"
-PCAP_FILE_ARR[7]="$BASE_DIR_UNSW/UNSW/16-10-09.pcap"
-PCAP_FILE_ARR[8]="$BASE_DIR_UNSW/UNSW/16-10-10.pcap"
-PCAP_FILE_ARR[9]="$BASE_DIR_UNSW/UNSW/16-10-11.pcap"
-PCAP_FILE_ARR[10]="$BASE_DIR_UNSW/UNSW/16-10-12-a.pcap"
-PCAP_FILE_ARR[11]="$BASE_DIR_UNSW/UNSW/16-10-12-b.pcap"
-PCAP_FILE_ARR[12]="$BASE_DIR_UNSW/UNSW/16-10-12-c.pcap"
-PCAP_FILE_ARR[13]="$BASE_DIR_UNSW/UNSW/16-10-12-d.pcap"
-# Normal files with valid results
-PCAP_FILE_ARR[14]="$BASE_DIR_UNSW/UNSW/16-09-23.pcap"
-PCAP_FILE_ARR[15]="$BASE_DIR_UNSW/UNSW/16-09-24.pcap"
-PCAP_FILE_ARR[16]="$BASE_DIR_UNSW/UNSW/16-09-25.pcap"
-PCAP_FILE_ARR[17]="$BASE_DIR_UNSW/UNSW/16-09-26.pcap"
-PCAP_FILE_ARR[18]="$BASE_DIR_UNSW/UNSW/16-09-27.pcap"
-PCAP_FILE_ARR[19]="$BASE_DIR_UNSW/UNSW/16-09-29.pcap"
-PCAP_FILE_ARR[20]="$BASE_DIR_UNSW/UNSW/16-10-01.pcap"
-PCAP_FILE_ARR[21]="$BASE_DIR_UNSW/UNSW/16-10-06.pcap"
-
-for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
-do
-       # ==================================================== ARLO CAMERA =====================================================
-       # Has no device side signature.
-       PCAP_FILE=${PCAP_FILE_ARR[$i]}
-       
-       echo "$PCAP_FILE"
-
-       # PHONE SIDE (TODO: may possibly be the .incomplete signatures)
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/arlo-camera/analysis/arlo-camera-onClusters-phone-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/arlo-camera/analysis/arlo-camera-offClusters-phone-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/arlo-camera/signatures/arlo-camera-onSignature-phone-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/arlo-camera/signatures/arlo-camera-offSignature-phone-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/arlo-camera/arlo-camera.eth0.detection.pcap___phone-side$i.detectionresults"
-       SIGNATURE_DURATION="548"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       ./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-       # ======================================================================================================================
-
-
-
-       # ================================================= BLOSSOM SPRINKLER ==================================================
-       # DEVICE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/blossom-sprinkler/analysis/blossom-sprinkler-onClusters-device-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/blossom-sprinkler/analysis/blossom-sprinkler-offClusters-device-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/blossom-sprinkler/signatures/blossom-sprinkler-onSignature-device-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/blossom-sprinkler/signatures/blossom-sprinkler-offSignature-device-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/blossom-sprinkler/blossom-sprinkler.eth0.detection.pcap___device-side$i.detectionresults"
-       SIGNATURE_DURATION="9274"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-
-       # PHONE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/blossom-sprinkler/analysis/blossom-sprinkler-onClusters-phone-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/blossom-sprinkler/analysis/blossom-sprinkler-offClusters-phone-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/blossom-sprinkler/signatures/blossom-sprinkler-onSignature-phone-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/blossom-sprinkler/signatures/blossom-sprinkler-offSignature-phone-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/blossom-sprinkler/blossom-sprinkler.eth0.detection.pcap___phone-side$i.detectionresults"
-       SIGNATURE_DURATION="3670"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       ./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-       # ======================================================================================================================
-
-
-
-       # ==================================================== D-LINK PLUG =====================================================
-       # DEVICE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/dlink-plug/analysis/dlink-plug-onClusters-device-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/dlink-plug/analysis/dlink-plug-offClusters-device-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/dlink-plug/signatures/dlink-plug-onSignature-device-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/dlink-plug/signatures/dlink-plug-offSignature-device-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/dlink-plug/dlink-plug.eth0.detection.pcap___device-side$i.detectionresults"
-       SIGNATURE_DURATION="8866"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-
-       # PHONE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/dlink-plug/analysis/dlink-plug-onClusters-phone-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/dlink-plug/analysis/dlink-plug-offClusters-phone-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/dlink-plug/signatures/dlink-plug-onSignature-phone-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/dlink-plug/signatures/dlink-plug-offSignature-phone-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/dlink-plug/dlink-plug.eth0.detection.pcap___phone-side$i.detectionresults"
-       SIGNATURE_DURATION="193"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-       # ======================================================================================================================
-
-
-
-       # ==================================================== D-LINK SIREN ====================================================
-       # PHONE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/dlink-siren/analysis/dlink-siren-onClusters-phone-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/dlink-siren/analysis/dlink-siren-offClusters-phone-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/dlink-siren/signatures/dlink-siren-onSignature-phone-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/dlink-siren/signatures/dlink-siren-offSignature-phone-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/dlink-siren/dlink-siren.eth0.detection.pcap___phone-side$i.detectionresults"
-       SIGNATURE_DURATION="71"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-       # ======================================================================================================================
-
-
-
-       # ===================================================== HUE BULB =======================================================
-       # Has no device side signature.
-
-       # PHONE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/hue-bulb/analysis/hue-bulb-onClusters-phone-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/hue-bulb/analysis/hue-bulb-offClusters-phone-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/hue-bulb/signatures/hue-bulb-onSignature-phone-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/hue-bulb/signatures/hue-bulb-offSignature-phone-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/hue-bulb/hue-bulb.eth0.detection.pcap___phone-side$i.detectionresults"
-       SIGNATURE_DURATION="27"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-       # ======================================================================================================================
-
-
-
-       # ================================================= KWIKSET DOORLOCK ===================================================
-       # Has no device side signature.
-
-       # PHONE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/kwikset-doorlock/analysis/kwikset-doorlock-onClusters-phone-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/kwikset-doorlock/analysis/kwikset-doorlock-offClusters-phone-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/kwikset-doorlock/signatures/kwikset-doorlock-onSignature-phone-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/kwikset-doorlock/signatures/kwikset-doorlock-offSignature-phone-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/kwikset-doorlock/kwikset-doorlock.eth0.detection.pcap___phone-side$i.detectionresults"
-       SIGNATURE_DURATION="3161"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-       # ======================================================================================================================
-
-
-
-       # ================================================= NEST THERMOSTAT ====================================================
-       # Has no device side signature.
-
-       # PHONE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/nest-thermostat/analysis/nest-thermostat-onClusters-phone-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/nest-thermostat/analysis/nest-thermostat-offClusters-phone-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/nest-thermostat/signatures/nest-thermostat-onSignature-phone-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/nest-thermostat/signatures/nest-thermostat-offSignature-phone-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/nest-thermostat/nest-thermostat.eth0.detection.pcap___phone-side$i.detectionresults"
-       SIGNATURE_DURATION="1179"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       ./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-       # ======================================================================================================================
-
-
-
-       # ====================================================== ST PLUG =======================================================
-       # Has no device side signature.
-
-       # PHONE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/st-plug/analysis/st-plug-onClusters-phone-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/st-plug/analysis/st-plug-offClusters-phone-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/st-plug/signatures/st-plug-onSignature-phone-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/st-plug/signatures/st-plug-offSignature-phone-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/st-plug/st-plug.wlan1.detection.pcap___phone-side$i.detectionresults"
-       SIGNATURE_DURATION="2445"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-       # ======================================================================================================================
-
-
-
-       # ==================================================== TP-LINK BULB ====================================================
-       # Has no device side signature.
-
-       # PHONE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-bulb/analysis/tplink-bulb-onClusters-phone-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-bulb/analysis/tplink-bulb-offClusters-phone-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-bulb/signatures/tplink-bulb-onSignature-phone-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-bulb/signatures/tplink-bulb-offSignature-phone-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/tplink-bulb/tplink-bulb.wlan1.wan-detection.pcap___phone-side$i.detectionresults"
-       SIGNATURE_DURATION="162"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-       # ======================================================================================================================
-
-
-
-       # ==================================================== TP-LINK PLUG ====================================================
-       # DEVICE SIDE (both the 112, 115 and 556, 1293 sequences)
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-plug/analysis/tplink-plug-onClusters.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-plug/analysis/tplink-plug-offClusters.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-plug/signatures/tplink-plug-onSignature-device-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-plug/signatures/tplink-plug-offSignature-device-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/tplink-plug/tplink-plug.wlan1.wan-detection.pcap___device-side$i.detectionresults"
-       SIGNATURE_DURATION="3660"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-
-       # DEVICE SIDE OUTBOUND (contains only those packets that go through the WAN port, i.e., only the 556, 1293 sequence)
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-plug/analysis/tplink-plug-onClusters.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-plug/analysis/tplink-plug-offClusters.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-plug/signatures/tplink-plug-onSignature-device-side-outbound.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-plug/signatures/tplink-plug-offSignature-device-side-outbound.sig"
-       RESULTS_FILE="$OUTPUT_DIR/tplink-plug/tplink-plug.wlan1.wan-detection.pcap___device-side-outbound$i.detectionresults"
-       SIGNATURE_DURATION="224"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-
-       # Phone side does not make sense as it is merely a subset of the device side and does not differentiate ONs from OFFs.
-       # ======================================================================================================================
-
-
-
-       # ================================================== WEMO INSIGHT PLUG =================================================
-       # Has no device side signature.
-
-       # PHONE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/wemo-insight-plug/analysis/wemo-insight-plug-onClusters-phone-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/wemo-insight-plug/analysis/wemo-insight-plug-offClusters-phone-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/wemo-insight-plug/signatures/wemo-insight-plug-onSignature-phone-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/wemo-insight-plug/signatures/wemo-insight-plug-offSignature-phone-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/wemo-insight-plug/wemo-insight-plug.wlan1.wan-detection.pcap___phone-side$i.detectionresults"
-       SIGNATURE_DURATION="106"
-       EPSILON="10.0"
-
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-       # ======================================================================================================================
-
-
-
-       # ===================================================== WEMO PLUG ======================================================
-       # Has no device side signature.
+# Arg3 should point to base directory where the detection results for the UNSW trace are to be output.
+# Subfolders will be created for each individual pcap file in UNSW_TRACES_DIR.
+OUTPUT_DIR=$3
+readonly OUTPUT_DIR
 
-       # PHONE SIDE
-       ON_ANALYSIS="$SIGNATURES_BASE_DIR/wemo-plug/analysis/wemo-plug-onClusters-phone-side.cls"
-       OFF_ANALYSIS="$SIGNATURES_BASE_DIR/wemo-plug/analysis/wemo-plug-offClusters-phone-side.cls"
-       ON_SIGNATURE="$SIGNATURES_BASE_DIR/wemo-plug/signatures/wemo-plug-onSignature-phone-side.sig"
-       OFF_SIGNATURE="$SIGNATURES_BASE_DIR/wemo-plug/signatures/wemo-plug-offSignature-phone-side.sig"
-       RESULTS_FILE="$OUTPUT_DIR/wemo-plug/wemo-plug.wlan1.wan-detection.pcap___phone-side$i.detectionresults"
-       SIGNATURE_DURATION="147"
-       EPSILON="10.0"
+#set -x # echo invoked commands to std out
 
-       PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
-       #./gradlew run -DmainClass=edu.uci.iotproject.detection.layer3.Layer3SignatureDetector --args="$PROGRAM_ARGS"
-       # ======================================================================================================================
-done
+for PCAP_FILE in $UNSW_TRACES_DIR/*.pcap; do
+    # skip non pcap files
+    [ -e "$PCAP_FILE" ] || continue
+    # make an output sub dir in the base output dir that is the filename minus extension
+    OUTPUT_SUB_DIR=$(basename "$PCAP_FILE" .pcap)
+    ./execute_layer3_unb_all_detection.sh $PCAP_FILE $SIGNATURES_BASE_DIR $OUTPUT_DIR/$OUTPUT_SUB_DIR
+done
\ No newline at end of file