# ======================================================================================================================
# ================================================== HUE BULB ON/OFF ===================================================
+# TODO: NOT DETECTED BECAUSE IT'S ETH1 SIGNATURE (NOT WLAN)
# IFTTT
PCAP_FILE="$PCAPS_BASE_DIR/hue-bulb/hue-bulb-onoff/wlan1/hue-bulb-onoff.wlan1.ifttt.detection.pcap"
# ======================================================================================================================
# ================================================ HUE BULB INTENSITY ==================================================
+# TODO: NOT DETECTED BECAUSE IT'S ETH1 SIGNATURE (NOT WLAN)
# IFTTT
PCAP_FILE="$PCAPS_BASE_DIR/hue-bulb/hue-bulb-intensity/wlan1/hue-bulb-intensity.wlan1.ifttt.detection.pcap"
ON_SIGNATURE="$SIGNATURES_BASE_DIR/hue-bulb/hue-bulb-intensity/signatures/hue-bulb-intensity-onSignature-device-side.sig"
OFF_SIGNATURE="$SIGNATURES_BASE_DIR/hue-bulb/hue-bulb-intensity/signatures/hue-bulb-intensity-offSignature-device-side.sig"
RESULTS_FILE="$OUTPUT_DIR/hue-bulb/hue-bulb-intensity/hue-bulb-intensity.wlan1.detection.pcap___device-side.detectionresults"
-SIGNATURE_DURATION=""
+SIGNATURE_DURATION="106"
EPSILON="10.0"
PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
#./gradlew run -DmainClass=edu.uci.iotproject.detection.layer2.Layer2SignatureDetector --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.
+# ======================================================================================================================
+# RELAXED MATCHING
+PCAP_FILE="$PCAPS_BASE_DIR/tplink-plug/wlan/tplink-plug.wlan.pcap"
+
+# DEVICE SIDE
+ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-plug/analyses/tplink-plug-onClusters-device-side.cls"
+OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-plug/analyses/tplink-plug-offClusters-device-side.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.detection.pcap___device-side.detectionresults"
+SIGNATURE_DURATION="902"
+EPSILON="10.0"
+MINUS_R="-r"
+DELTA="21"
+PACKETLIST="592,1234,593,1235"
+
+PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON' '$MINUS_R' '$DELTA' '$PACKETLIST'"
+#./gradlew run -DmainClass=edu.uci.iotproject.detection.layer2.Layer2SignatureDetector --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.
# ======================================================================================================================
# REMOTE
#ON_SKIPPED_PACKETS="4"
#OFF_SKIPPED_PACKETS="4"
+PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
+#./gradlew run -DmainClass=edu.uci.iotproject.detection.layer2.Layer2SignatureDetector --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# TODO: IMC DATASET DEVICES
+# ================================================= BLINK CAMERA WATCH =================================================
+PCAP_FILE="$PCAPS_BASE_DIR/blink-camera/blink-camera-watch/wlan/blink-camera-watch.wlan.pcap"
+
+# DEVICE SIDE
+ON_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/analyses/blink-camera-watch-onClusters-device-side.cls"
+OFF_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/analyses/blink-camera-watch-offClusters-device-side.cls"
+ON_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/signatures/blink-camera-watch-onSignature-device-side.sig"
+OFF_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/signatures/blink-camera-watch-offSignature-device-side.sig"
+RESULTS_FILE="$OUTPUT_DIR/blink-camera/blink-camera-watch/blink-camera-watch.wlan.detection.pcap___device-side.detectionresults"
+SIGNATURE_DURATION="365"
+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.layer2.Layer2SignatureDetector --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# ================================================= BLINK CAMERA PHOTO =================================================
+PCAP_FILE="$PCAPS_BASE_DIR/blink-camera/blink-camera-photo/wlan/blink-camera-photo.wlan.pcap"
+
+# DEVICE SIDE
+ON_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/analyses/blink-camera-photo-onClusters-device-side.cls"
+OFF_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/analyses/blink-camera-photo-offClusters-device-side.cls"
+ON_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/signatures/blink-camera-photo-onSignature-device-side.sig"
+OFF_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/signatures/blink-camera-photo-offSignature-device-side.sig"
+RESULTS_FILE="$OUTPUT_DIR/blink-camera/blink-camera-photo/blink-camera-photo.wan.detection.pcap___device-side.detectionresults"
+#SIGNATURE_DURATION="1429"
+SIGNATURE_DURATION="12000"
+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.layer2.Layer2SignatureDetector --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# ================================================== WEMO INSIGHT PLUG =================================================
+# LOCAL
+PCAP_FILE="$PCAPS_BASE_DIR/wemo-insight-plug/wlan/wemo-insight-plug.wlan.pcap"
+
+# PHONE SIDE
+ON_ANALYSIS="$SIGNATURES_BASE_DIR/wemo-insight-plug/analyses/wemo-insight-plug-onClusters-phone-side.cls"
+OFF_ANALYSIS="$SIGNATURES_BASE_DIR/wemo-insight-plug/analyses/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.detection.pcap___phone-side.detectionresults"
+SIGNATURE_DURATION="124"
+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.layer2.Layer2SignatureDetector --args="$PROGRAM_ARGS"
# ======================================================================================================================
\ No newline at end of file
# ======================================================================================================================
# ==================================================== TP-LINK PLUG ====================================================
-TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-plug/timestamps/tplink-plug-smarthome-nov-9-2018.timestamps"
+#TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-plug/timestamps/tplink-plug-smarthome-nov-9-2018.timestamps"
+# TODO: Timestamp file for IMC PCAP file
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-plug/timestamps/tplink-plug.wlan.timestamps"
# DEVICE SIDE
RESULTS_FILE="$RESULTS_BASE_DIR/tplink-plug/tplink-plug.wlan1.detection.pcap___device-side.detectionresults"
ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
-EXACT_MATCH="true"
+EXACT_MATCH="false"
PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
-#./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
+./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
# DEVICE SIDE OUTBOUND
RESULTS_FILE="$RESULTS_BASE_DIR/tplink-plug/tplink-plug.wlan1.detection.pcap___device-side-outbound.detectionresults"
# ================================================== WEMO INSIGHT PLUG =================================================
# LOCAL
TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/wemo-insight-plug/timestamps/wemo-insight-plug-smarthome-nov-22-2018.timestamps"
+# TODO: Timestamp file for IMC PCAP file
+#TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/wemo-insight-plug/timestamps/wemo-insight-plug.timestamps"
# Has no device side signature.
EXACT_MATCH="true"
PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
#./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# TODO: IMC DATASET DEVICES
+# TODO: THE LABELS IN THE IMC DATASET ARE NOT STRICTLY 15 SECONDS SO WE HAVE TO LOOSEN THE TIMING CONSTRAINT (30 SECONDS)
+# ================================================= BLINK CAMERA WATCH =================================================
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/blink-camera/blink-camera-watch/timestamps/blink-camera-watch.wlan.timestamps"
+
+RESULTS_FILE="$RESULTS_BASE_DIR/blink-camera/blink-camera-watch/blink-camera-watch.wlan.detection.pcap___device-side.detectionresults"
+ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
+EXACT_MATCH="true"
+PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
+#./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# ================================================= BLINK CAMERA PHOTO =================================================
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/blink-camera/blink-camera-photo/timestamps/blink-camera-photo.wlan.timestamps"
+
+RESULTS_FILE="$RESULTS_BASE_DIR/blink-camera/blink-camera-photo/blink-camera-photo.wlan.detection.pcap___device-side.detectionresults"
+ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
+EXACT_MATCH="true"
+PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
+#./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
# ======================================================================================================================
\ No newline at end of file
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.
+# ======================================================================================================================
+# RELAXED MATCHING
+PCAP_FILE="$PCAPS_BASE_DIR/tplink-plug/wan/tplink-plug.wan.pcap"
+
+# DEVICE SIDE
+ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-plug/analyses/tplink-plug-onClusters-device-side.cls"
+OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-plug/analyses/tplink-plug-offClusters-device-side.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.eth0.detection.pcap___device-side-outbound.detectionresults"
+SIGNATURE_DURATION="902"
+EPSILON="10.0"
+MINUS_R="-r"
+DELTA="21"
+PACKETLIST="592,1234,593,1235"
+
+PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON' '$MINUS_R' '$DELTA' '$PACKETLIST'"
+#./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.
# ======================================================================================================================
# REMOTE
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"
-# ======================================================================================================================
\ No newline at end of file
+# ======================================================================================================================
+
+# TODO: IMC DATASET DEVICES
+# ================================================= BLINK CAMERA WATCH =================================================
+PCAP_FILE="$PCAPS_BASE_DIR/blink-camera/blink-camera-watch/wan/blink-camera-watch.wan.pcap"
+
+# DEVICE SIDE
+ON_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/analyses/blink-camera-watch-onClusters-device-side.cls"
+OFF_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/analyses/blink-camera-watch-offClusters-device-side.cls"
+ON_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/signatures/blink-camera-watch-onSignature-device-side.sig"
+OFF_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/signatures/blink-camera-watch-offSignature-device-side.sig"
+RESULTS_FILE="$OUTPUT_DIR/blink-camera/blink-camera-watch/blink-camera-watch.wan.detection.pcap___device-side.detectionresults"
+SIGNATURE_DURATION="365"
+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"
+# ======================================================================================================================
+
+# ================================================= BLINK CAMERA PHOTO =================================================
+PCAP_FILE="$PCAPS_BASE_DIR/blink-camera/blink-camera-photo/wan/blink-camera-photo.wan.pcap"
+
+# DEVICE SIDE
+ON_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/analyses/blink-camera-photo-onClusters-device-side.cls"
+OFF_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/analyses/blink-camera-photo-offClusters-device-side.cls"
+ON_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/signatures/blink-camera-photo-onSignature-device-side.sig"
+OFF_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/signatures/blink-camera-photo-offSignature-device-side.sig"
+RESULTS_FILE="$OUTPUT_DIR/blink-camera/blink-camera-photo/blink-camera-photo.wan.detection.pcap___device-side.detectionresults"
+SIGNATURE_DURATION="1429"
+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 ====================================================
# LOCAL
-TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-plug/timestamps/tplink-plug-smarthome-nov-9-2018.timestamps"
+#TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-plug/timestamps/tplink-plug-smarthome-nov-9-2018.timestamps"
+# TODO: Timestamp for relaxed matching
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-plug/timestamps/tplink-plug.wan.timestamps"
# DEVICE SIDE
RESULTS_FILE="$RESULTS_BASE_DIR/tplink-plug/tplink-plug.wlan1.wan-detection.pcap___device-side.detectionresults"
# DEVICE SIDE OUTBOUND
RESULTS_FILE="$RESULTS_BASE_DIR/tplink-plug/tplink-plug.eth0.detection.pcap___device-side-outbound.detectionresults"
ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
-EXACT_MATCH="true"
+EXACT_MATCH="false"
PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
#./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
# ======================================================================================================================
EXACT_MATCH="true"
PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
#./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# TODO: IMC DATASET DEVICES
+# TODO: THE LABELS IN THE IMC DATASET ARE NOT STRICTLY 15 SECONDS SO WE HAVE TO LOOSEN THE TIMING CONSTRAINT (30 SECONDS)
+# ================================================= BLINK CAMERA WATCH =================================================
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/blink-camera/blink-camera-watch/timestamps/blink-camera-watch.wan.timestamps"
+
+RESULTS_FILE="$RESULTS_BASE_DIR/blink-camera/blink-camera-watch/blink-camera-watch.wan.detection.pcap___device-side.detectionresults"
+ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
+EXACT_MATCH="true"
+PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
+#./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# ================================================= BLINK CAMERA PHOTO =================================================
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/blink-camera/blink-camera-photo/timestamps/blink-camera-photo.wan.timestamps"
+
+RESULTS_FILE="$RESULTS_BASE_DIR/blink-camera/blink-camera-photo/blink-camera-photo.wan.detection.pcap___device-side.detectionresults"
+ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
+EXACT_MATCH="true"
+PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
+#./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
# ======================================================================================================================
\ No newline at end of file
# IFTTT
INPUT_PCAP="$SIGNATURES_BASE_DIR/hue-bulb/hue-bulb-intensity/eth1/hue-bulb-intensity.eth1.ifttt.pcap"
+# TODO: THE LOW INTENSITY PART SEEMS TO BE MISSING THE TRAILING C-378
+# TODO: WE CAN TWEAK THE CODE AND ALLOW THE FOLLOWING LINES
+# int lowerBound = numberOfEventsPerType - (int)(numberOfEventsPerType * 0.2);
+# int upperBound = numberOfEventsPerType + (int)(numberOfEventsPerType * 0.2);
# DEVICE SIDE
OUTPUT_PCAP="$OUTPUT_DIR/hue-bulb/hue-bulb-intensity/eth1/hue-bulb-processed.pcap"
TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/hue-bulb/hue-bulb-intensity/timestamps/hue-bulb-intensity-ifttt-dec-20-2019.timestamps"
-DEVICE_IP="192.168.1.101"
+DEVICE_IP="192.168.1.100"
ON_SIGNATURE="$OUTPUT_DIR/hue-bulb/hue-bulb-intensity/signatures/hue-bulb-intensity-onSignature-device-side.sig"
OFF_SIGNATURE="$OUTPUT_DIR/hue-bulb/hue-bulb-intensity/signatures/hue-bulb-intensity-offSignature-device-side.sig"
ON_ANALYSIS="$OUTPUT_DIR/hue-bulb/hue-bulb-intensity/analyses/hue-bulb-intensity-onClusters-device-side.cls"
INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-two-outlet-plug/wlan1/tplink-two-outlet-plug.wlan1.local.pcap"
OUTPUT_PCAP="$OUTPUT_DIR/tplink-two-outlet-plug/wlan1/tplink-two-outlet-plug-processed.pcap"
-# TODO: TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-two-outlet-plug/timestamps/tplink-two-outlet-plug-dec-21-2019.timestamps"
-# TODO: DEVICE_IP="192.168.1.159"
+TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-two-outlet-plug/timestamps/tplink-two-outlet-plug-dec-22-2019.timestamps"
+DEVICE_IP="192.168.1.178"
ON_SIGNATURE="$OUTPUT_DIR/tplink-two-outlet-plug/signatures/tplink-two-outlet-plug-onSignature-device-side.sig"
OFF_SIGNATURE="$OUTPUT_DIR/tplink-two-outlet-plug/signatures/tplink-two-outlet-plug-offSignature-device-side.sig"
ON_ANALYSIS="$OUTPUT_DIR/tplink-two-outlet-plug/analyses/tplink-two-outlet-plug-onClusters-device-side.cls"
INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-power-strip/wlan1/tplink-power-strip.wlan1.local.pcap"
OUTPUT_PCAP="$OUTPUT_DIR/tplink-power-strip/wlan1/tplink-power-strip-processed.pcap"
-# TODO: TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-power-strip/timestamps/tplink-power-strip-dec-21-2019.timestamps"
-# TODO: DEVICE_IP="192.168.1.159"
+TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-power-strip/timestamps/tplink-power-strip-dec-22-2019.timestamps"
+DEVICE_IP="192.168.1.142"
ON_SIGNATURE="$OUTPUT_DIR/tplink-power-strip/signatures/tplink-power-strip-onSignature-device-side.sig"
OFF_SIGNATURE="$OUTPUT_DIR/tplink-power-strip/signatures/tplink-power-strip-offSignature-device-side.sig"
ON_ANALYSIS="$OUTPUT_DIR/tplink-power-strip/analyses/tplink-power-strip-onClusters-device-side.cls"
# ============================================== TP-LINK LIGHT BULB ON/OFF =============================================
# KL-110 (newer model than LB-130 but no color---only dimmable white)
-INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/wlan1/tplink-light-bulb-white-onoff.wlan1.local.pcap"
-
-OUTPUT_PCAP="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/wlan1/tplink-light-bulb-white-processed.pcap"
-# TODO: TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-two-outlet-plug/timestamps/tplink-two-outlet-plug-dec-21-2019.timestamps"
-# TODO: DEVICE_IP="192.168.1.159"
-ON_SIGNATURE="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/signatures/tplink-light-bulb-white-onoff-onSignature-device-side.sig"
-OFF_SIGNATURE="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/signatures/tplink-light-bulb-white-onoff-offSignature-device-side.sig"
-ON_ANALYSIS="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/analyses/tplink-light-bulb-white-onoff-onClusters-device-side.cls"
-OFF_ANALYSIS="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/analyses/tplink-light-bulb-white-onoff-offClusters-device-side.cls"
+INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-onoff/wlan1/tplink-bulb-white-onoff.wlan1.local.pcap"
+
+OUTPUT_PCAP="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-onoff/wlan1/tplink-bulb-white-processed.pcap"
+TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-onoff/timestamps/tplink-bulb-white-onoff-dec-21-2019.timestamps"
+DEVICE_IP="192.168.1.227"
+ON_SIGNATURE="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-onoff/signatures/tplink-bulb-white-onoff-onSignature-device-side.sig"
+OFF_SIGNATURE="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-onoff/signatures/tplink-bulb-white-onoff-offSignature-device-side.sig"
+ON_ANALYSIS="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-onoff/analyses/tplink-bulb-white-onoff-onClusters-device-side.cls"
+OFF_ANALYSIS="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-onoff/analyses/tplink-bulb-white-onoff-offClusters-device-side.cls"
EPSILON="10.0"
DELETED_SEQUENCES_ON="-1"
DELETED_SEQUENCES_OFF="-1"
# ============================================= TP-LINK LIGHT BULB INTENSITY ===========================================
# KL-110 (newer model than LB-130 but no color---only dimmable white)
-INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/wlan1/tplink-light-bulb-white-intensity.wlan1.local.pcap"
-
-OUTPUT_PCAP="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/wlan1/tplink-light-bulb-white-processed.pcap"
-# TODO: TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/timestamps/tplink-light-bulb-white-onoff-dec-21-2019.timestamps"
-# TODO: DEVICE_IP="192.168.1.159"
-ON_SIGNATURE="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/signatures/tplink-light-bulb-white-intensity-onSignature-device-side.sig"
-OFF_SIGNATURE="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/signatures/tplink-light-bulb-white-intensity-offSignature-device-side.sig"
-ON_ANALYSIS="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/analyses/tplink-light-bulb-white-intensity-onClusters-device-side.cls"
-OFF_ANALYSIS="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/analyses/tplink-light-bulb-white-intensity-offClusters-device-side.cls"
+INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-intensity/wlan1/tplink-bulb-white-intensity.wlan1.local.pcap"
+
+OUTPUT_PCAP="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-intensity/wlan1/tplink-bulb-white-processed.pcap"
+TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-intensity/timestamps/tplink-bulb-white-intensity-dec-21-2019.timestamps"
+DEVICE_IP="192.168.1.227"
+ON_SIGNATURE="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-intensity/signatures/tplink-bulb-white-intensity-onSignature-device-side.sig"
+OFF_SIGNATURE="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-intensity/signatures/tplink-bulb-white-intensity-offSignature-device-side.sig"
+ON_ANALYSIS="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-intensity/analyses/tplink-bulb-white-intensity-onClusters-device-side.cls"
+OFF_ANALYSIS="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-intensity/analyses/tplink-bulb-white-intensity-offClusters-device-side.cls"
EPSILON="10.0"
DELETED_SEQUENCES_ON="-1"
DELETED_SEQUENCES_OFF="-1"
INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-onoff/wlan1/tplink-camera-onoff.wlan1.local.pcap"
OUTPUT_PCAP="$OUTPUT_DIR/tplink-camera/tplink-camera-onoff/wlan1/tplink-light-camera-processed.pcap"
-# TODO: TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-onoff/timestamps/tplink-camera-onoff-dec-21-2019.timestamps"
-# TODO: DEVICE_IP="192.168.1.159"
+TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-onoff/timestamps/tplink-camera-onoff-dec-22-2019.timestamps"
+DEVICE_IP="192.168.1.235"
ON_SIGNATURE="$OUTPUT_DIR/tplink-camera/tplink-camera-onoff/signatures/tplink-camera-onoff-onSignature-device-side.sig"
OFF_SIGNATURE="$OUTPUT_DIR/tplink-camera/tplink-camera-onoff/signatures/tplink-camera-onoff-offSignature-device-side.sig"
ON_ANALYSIS="$OUTPUT_DIR/tplink-camera/tplink-camera-onoff/analyses/tplink-camera-onoff-onClusters-device-side.cls"
INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-recording/wlan1/tplink-camera-recording.wlan1.local.pcap"
OUTPUT_PCAP="$OUTPUT_DIR/tplink-camera/tplink-camera-recording/wlan1/tplink-light-camera-processed.pcap"
-# TODO: TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-recording/timestamps/tplink-camera-recording-dec-21-2019.timestamps"
-# TODO: DEVICE_IP="192.168.1.159"
+TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-recording/timestamps/tplink-camera-recording-dec-22-2019.timestamps"
+DEVICE_IP="192.168.1.235"
ON_SIGNATURE="$OUTPUT_DIR/tplink-camera/tplink-camera-recording/signatures/tplink-camera-recording-onSignature-device-side.sig"
OFF_SIGNATURE="$OUTPUT_DIR/tplink-camera/tplink-camera-recording/signatures/tplink-camera-recording-offSignature-device-side.sig"
ON_ANALYSIS="$OUTPUT_DIR/tplink-camera/tplink-camera-recording/analyses/tplink-camera-recording-onClusters-device-side.cls"
PROGRAM_ARGS="'$INPUT_PCAP' '$OUTPUT_PCAP' '$TIMESTAMP_FILE' '$DEVICE_IP' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$EPSILON' '$DELETED_SEQUENCES_ON' '$DELETED_SEQUENCES_OFF'"
#./gradlew run -DmainClass=edu.uci.iotproject.SignatureGenerator --args="$PROGRAM_ARGS"
-# ======================================================================================================================
\ No newline at end of file
+# ======================================================================================================================
+
+# TODO: RETRAINING
+# ==================================================== TP-LINK PLUG ====================================================
+INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-plug/wlan1/tplink-plug.wlan1.local.pcap"
+
+OUTPUT_PCAP="$OUTPUT_DIR/tplink-plug/wlan1/tplink-plug-processed.pcap"
+TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-plug/timestamps/tplink-plug-retraining-dec-25-2019.timestamps"
+DEVICE_IP="192.168.1.160"
+ON_SIGNATURE="$OUTPUT_DIR/tplink-plug/signatures/tplink-plug-onSignature-device-side.sig"
+OFF_SIGNATURE="$OUTPUT_DIR/tplink-plug/signatures/tplink-plug-offSignature-device-side.sig"
+ON_ANALYSIS="$OUTPUT_DIR/tplink-plug/analyses/tplink-plug-onClusters-device-side.cls"
+OFF_ANALYSIS="$OUTPUT_DIR/tplink-plug/analyses/tplink-plug-offClusters-device-side.cls"
+EPSILON="10.0"
+# TODO: Change the deleted sequences to 0 if we want to get just the outbound signatures
+DELETED_SEQUENCES_ON="-1"
+DELETED_SEQUENCES_OFF="-1"
+
+PROGRAM_ARGS="'$INPUT_PCAP' '$OUTPUT_PCAP' '$TIMESTAMP_FILE' '$DEVICE_IP' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$EPSILON' '$DELETED_SEQUENCES_ON' '$DELETED_SEQUENCES_OFF'"
+#./gradlew run -DmainClass=edu.uci.iotproject.SignatureGenerator --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# ==================================================== TP-LINK BULB ====================================================
+INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-bulb/tplink-bulb-onoff/wlan1/tplink-bulb-onoff.wlan1.local.pcap"
+
+OUTPUT_PCAP="$OUTPUT_DIR/tplink-bulb/tplink-bulb-onoff/wlan1/tplink-bulb-onoff-processed.pcap"
+TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/tplink-bulb/tplink-bulb-onoff/timestamps/tplink-bulb-onoff-retraining-dec-23-2019.timestamps"
+DEVICE_IP="192.168.1.140"
+ON_SIGNATURE="$OUTPUT_DIR/tplink-bulb/tplink-bulb-onoff/signatures/tplink-bulb-onoff-onSignature-device-side.sig"
+OFF_SIGNATURE="$OUTPUT_DIR/tplink-bulb/tplink-bulb-onoff/signatures/tplink-bulb-onoff-offSignature-device-side.sig"
+ON_ANALYSIS="$OUTPUT_DIR/tplink-bulb/tplink-bulb-onoff/analyses/tplink-bulb-onoff-onClusters-device-side.cls"
+OFF_ANALYSIS="$OUTPUT_DIR/tplink-bulb/tplink-bulb-onoff/analyses/tplink-bulb-onoff-offClusters-device-side.cls"
+EPSILON="10.0"
+DELETED_SEQUENCES_ON="-1"
+DELETED_SEQUENCES_OFF="-1"
+
+PROGRAM_ARGS="'$INPUT_PCAP' '$OUTPUT_PCAP' '$TIMESTAMP_FILE' '$DEVICE_IP' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$EPSILON' '$DELETED_SEQUENCES_ON' '$DELETED_SEQUENCES_OFF'"
+#./gradlew run -DmainClass=edu.uci.iotproject.SignatureGenerator --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# ================================================== WEMO INSIGHT PLUG =================================================
+INPUT_PCAP="$SIGNATURES_BASE_DIR/wemo-insight-plug/wlan1/wemo-insight-plug.wlan1.local.pcap"
+
+OUTPUT_PCAP="$OUTPUT_DIR/wemo-insight-plug/wlan1/wemo-insight-plug-processed.pcap"
+TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/wemo-insight-plug/timestamps/wemo-insight-plug-retraining-jan-9-2020.timestamps"
+# The format 192.168.10 is needed to generate packet length 260
+DEVICE_IP="192.168.10.246"
+ON_SIGNATURE="$OUTPUT_DIR/wemo-insight-plug/signatures/wemo-insight-plug-onSignature-phone-side.sig"
+OFF_SIGNATURE="$OUTPUT_DIR/wemo-insight-plug/signatures/wemo-insight-plug-offSignature-phone-side.sig"
+ON_ANALYSIS="$OUTPUT_DIR/wemo-insight-plug/analyses/wemo-insight-plug-onClusters-phone-side.cls"
+OFF_ANALYSIS="$OUTPUT_DIR/wemo-insight-plug/analyses/wemo-insight-plug-offClusters-phone-side.cls"
+EPSILON="10.0"
+DELETED_SEQUENCES_ON="-1"
+DELETED_SEQUENCES_OFF="0"
+
+PROGRAM_ARGS="'$INPUT_PCAP' '$OUTPUT_PCAP' '$TIMESTAMP_FILE' '$DEVICE_IP' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$EPSILON' '$DELETED_SEQUENCES_ON' '$DELETED_SEQUENCES_OFF'"
+#./gradlew run -DmainClass=edu.uci.iotproject.SignatureGenerator --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# IMC DATASET
+# ================================================= BLINK CAMERA WATCH =================================================
+INPUT_PCAP="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/wlan1/blink-camera-watch.wlan1.local.pcap"
+
+OUTPUT_PCAP="$OUTPUT_DIR/blink-camera/blink-camera-watch/wlan1/blink-camera-watch-processed.pcap"
+TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/timestamps/blink-camera-watch-retraining-dec-23-2019.timestamps"
+DEVICE_IP="192.168.1.228"
+ON_SIGNATURE="$OUTPUT_DIR/blink-camera/blink-camera-watch/signatures/blink-camera-watch-onSignature-device-side.sig"
+OFF_SIGNATURE="$OUTPUT_DIR/blink-camera/blink-camera-watch/signatures/blink-camera-watch-offSignature-device-side.sig"
+ON_ANALYSIS="$OUTPUT_DIR/blink-camera/blink-camera-watch/analyses/blink-camera-watch-onClusters-device-side.cls"
+OFF_ANALYSIS="$OUTPUT_DIR/blink-camera/blink-camera-watch/analyses/blink-camera-watch-offClusters-device-side.cls"
+EPSILON="10.0"
+DELETED_SEQUENCES_ON="-1"
+DELETED_SEQUENCES_OFF="-1"
+
+PROGRAM_ARGS="'$INPUT_PCAP' '$OUTPUT_PCAP' '$TIMESTAMP_FILE' '$DEVICE_IP' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$EPSILON' '$DELETED_SEQUENCES_ON' '$DELETED_SEQUENCES_OFF'"
+#./gradlew run -DmainClass=edu.uci.iotproject.SignatureGenerator --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# ================================================= BLINK CAMERA PHOTO =================================================
+INPUT_PCAP="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/wlan1/blink-camera-photo.wlan1.local.pcap"
+
+OUTPUT_PCAP="$OUTPUT_DIR/blink-camera/blink-camera-photo/wlan1/blink-camera-photo-processed.pcap"
+TIMESTAMP_FILE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/timestamps/blink-camera-photo-retraining-dec-24-2019.timestamps"
+DEVICE_IP="192.168.1.228"
+ON_SIGNATURE="$OUTPUT_DIR/blink-camera/blink-camera-photo/signatures/blink-camera-photo-onSignature-device-side.sig"
+OFF_SIGNATURE="$OUTPUT_DIR/blink-camera/blink-camera-photo/signatures/blink-camera-photo-offSignature-device-side.sig"
+ON_ANALYSIS="$OUTPUT_DIR/blink-camera/blink-camera-photo/analyses/blink-camera-photo-onClusters-device-side.cls"
+OFF_ANALYSIS="$OUTPUT_DIR/blink-camera/blink-camera-photo/analyses/blink-camera-photo-offClusters-device-side.cls"
+EPSILON="10.0"
+DELETED_SEQUENCES_ON="-1"
+DELETED_SEQUENCES_OFF="-1"
+
+PROGRAM_ARGS="'$INPUT_PCAP' '$OUTPUT_PCAP' '$TIMESTAMP_FILE' '$DEVICE_IP' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$EPSILON' '$DELETED_SEQUENCES_ON' '$DELETED_SEQUENCES_OFF'"
+#./gradlew run -DmainClass=edu.uci.iotproject.SignatureGenerator --args="$PROGRAM_ARGS"
+# ======================================================================================================================
ON_SIGNATURE="$SIGNATURES_BASE_DIR/hue-bulb/hue-bulb-intensity/signatures/hue-bulb-intensity-onSignature-device-side.sig"
OFF_SIGNATURE="$SIGNATURES_BASE_DIR/hue-bulb/hue-bulb-intensity/signatures/hue-bulb-intensity-offSignature-device-side.sig"
RESULTS_FILE="$OUTPUT_DIR/hue-bulb/hue-bulb-intensity/hue-bulb-intensity.eth1.validation.pcap___device-side.detectionresults"
-SIGNATURE_DURATION="84"
+SIGNATURE_DURATION="106"
EPSILON="10.0"
PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
# TODO: SAME VENDOR OBSERVATION (TP-LINK DEVICES)
# =============================================== TP-LINK TWO-OUTLET PLUG ==============================================
-INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-two-outlet-plug/wlan1/tplink-two-outlet-plug.wlan1.local.pcap"
+PCAP_FILE="$SIGNATURES_BASE_DIR/tplink-two-outlet-plug/wlan1/tplink-two-outlet-plug.wlan1.local.pcap"
ON_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-two-outlet-plug/signatures/tplink-two-outlet-plug-onSignature-device-side.sig"
OFF_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-two-outlet-plug/signatures/tplink-two-outlet-plug-offSignature-device-side.sig"
ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-two-outlet-plug/analyses/tplink-two-outlet-plug-onClusters-device-side.cls"
OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-two-outlet-plug/analyses/tplink-two-outlet-plug-offClusters-device-side.cls"
RESULTS_FILE="$OUTPUT_DIR/tplink-two-outlet-plug/tplink-two-outlet-plug.wlan1.validation.pcap___device-side.detectionresults"
-# TODO: SIGNATURE_DURATION=""
+SIGNATURE_DURATION="2428"
EPSILON="10.0"
PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
# ======================================================================================================================
# ================================================= TP-LINK POWER STRIP ================================================
-INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-power-strip/wlan1/tplink-power-strip.wlan1.local.pcap"
+PCAP_FILE="$SIGNATURES_BASE_DIR/tplink-power-strip/wlan1/tplink-power-strip.wlan1.local.pcap"
ON_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-power-strip/signatures/tplink-power-strip-onSignature-device-side.sig"
OFF_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-power-strip/signatures/tplink-power-strip-offSignature-device-side.sig"
ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-power-strip/analyses/tplink-power-strip-onClusters-device-side.cls"
OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-power-strip/analyses/tplink-power-strip-offClusters-device-side.cls"
RESULTS_FILE="$OUTPUT_DIR/tplink-power-strip/tplink-power-strip.wlan1.validation.pcap___device-side.detectionresults"
-# TODO: SIGNATURE_DURATION=""
+SIGNATURE_DURATION="5472"
EPSILON="10.0"
PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
# ============================================== TP-LINK LIGHT BULB ON/OFF =============================================
# KL-110 (newer model than LB-130 but no color---only dimmable white)
-INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/wlan1/tplink-light-bulb-white-onoff.wlan1.local.pcap"
+PCAP_FILE="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-onoff/wlan1/tplink-bulb-white-onoff.wlan1.local.pcap"
-ON_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/signatures/tplink-light-bulb-white-onoff-onSignature-device-side.sig"
-OFF_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/signatures/tplink-light-bulb-white-onoff-offSignature-device-side.sig"
-ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/analyses/tplink-light-bulb-white-onoff-onClusters-device-side.cls"
-OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/analyses/tplink-light-bulb-white-onoff-offClusters-device-side.cls"
-RESULTS_FILE="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/tplink-light-bulb-white-onoff.wlan1.validation.pcap___device-side.detectionresults"
-# TODO: SIGNATURE_DURATION=""
+ON_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-onoff/signatures/tplink-bulb-white-onoff-onSignature-device-side.sig"
+OFF_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-onoff/signatures/tplink-bulb-white-onoff-offSignature-device-side.sig"
+ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-onoff/analyses/tplink-bulb-white-onoff-onClusters-device-side.cls"
+OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-onoff/analyses/tplink-bulb-white-onoff-offClusters-device-side.cls"
+RESULTS_FILE="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-onoff/tplink-bulb-white-onoff.wlan1.validation.pcap___device-side.detectionresults"
+SIGNATURE_DURATION="2373"
EPSILON="10.0"
PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
# ============================================= TP-LINK LIGHT BULB INTENSITY ===========================================
# KL-110 (newer model than LB-130 but no color---only dimmable white)
-INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/wlan1/tplink-light-bulb-white-intensity.wlan1.local.pcap"
+PCAP_FILE="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-intensity/wlan1/tplink-bulb-white-intensity.wlan1.local.pcap"
-ON_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/signatures/tplink-light-bulb-white-intensity-onSignature-device-side.sig"
-OFF_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/signatures/tplink-light-bulb-white-intensity-offSignature-device-side.sig"
-ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/analyses/tplink-light-bulb-white-intensity-onClusters-device-side.cls"
-OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/analyses/tplink-light-bulb-white-intensity-offClusters-device-side.cls"
-RESULTS_FILE="$OUTPUT_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/tplink-light-bulb-white-intensity.wlan1.validation.pcap___device-side.detectionresults"
-# TODO: SIGNATURE_DURATION=""
+ON_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-intensity/signatures/tplink-bulb-white-intensity-onSignature-device-side.sig"
+OFF_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-intensity/signatures/tplink-bulb-white-intensity-offSignature-device-side.sig"
+ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-intensity/analyses/tplink-bulb-white-intensity-onClusters-device-side.cls"
+OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-bulb-white/tplink-bulb-white-intensity/analyses/tplink-bulb-white-intensity-offClusters-device-side.cls"
+RESULTS_FILE="$OUTPUT_DIR/tplink-bulb-white/tplink-bulb-white-intensity/tplink-bulb-white-intensity.wlan1.validation.pcap___device-side.detectionresults"
+SIGNATURE_DURATION="3971"
EPSILON="10.0"
PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
# ======================================================================================================================
# ================================================ TP-LINK CAMERA ON/OFF ===============================================
-INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-onoff/wlan1/tplink-camera-onoff.wlan1.local.pcap"
+PCAP_FILE="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-onoff/wlan1/tplink-camera-onoff.wlan1.local.pcap"
ON_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-onoff/signatures/tplink-camera-onoff-onSignature-device-side.sig"
OFF_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-onoff/signatures/tplink-camera-onoff-offSignature-device-side.sig"
ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-onoff/analyses/tplink-camera-onoff-onClusters-device-side.cls"
OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-onoff/analyses/tplink-camera-onoff-offClusters-device-side.cls"
RESULTS_FILE="$OUTPUT_DIR/tplink-camera/tplink-camera-onoff/tplink-camera-onoff.wlan1.validation.pcap___device-side.detectionresults"
-# TODO: SIGNATURE_DURATION=""
+SIGNATURE_DURATION="1913"
+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"
+# ======================================================================================================================
+
+# TODO: IMC (NEW DEVICE)
+# ================================================= BLINK CAMERA WATCH =================================================
+PCAP_FILE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/wlan1/blink-camera-watch.wlan1.local.pcap"
+
+ON_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/signatures/blink-camera-watch-onSignature-device-side.sig"
+OFF_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/signatures/blink-camera-watch-offSignature-device-side.sig"
+ON_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/analyses/blink-camera-watch-onClusters-device-side.cls"
+OFF_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-watch/analyses/blink-camera-watch-offClusters-device-side.cls"
+RESULTS_FILE="$OUTPUT_DIR/blink-camera/blink-camera-watch/blink-camera-watch.wlan1.validation.pcap___device-side.detectionresults"
+SIGNATURE_DURATION="365"
EPSILON="10.0"
+# TODO: The signature is only for ON (Watch feature) so, the OFF doesn't have anything (false negatives)
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 CAMERA RECORDING =============================================
-INPUT_PCAP="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-recording/wlan1/tplink-camera-recording.wlan1.local.pcap"
+# ================================================= BLINK CAMERA PHOTO =================================================
+PCAP_FILE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/wlan1/blink-camera-photo.wlan1.local.pcap"
-ON_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-recording/signatures/tplink-camera-recording-onSignature-device-side.sig"
-OFF_SIGNATURE="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-recording/signatures/tplink-camera-recording-offSignature-device-side.sig"
-ON_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-recording/analyses/tplink-camera-recording-onClusters-device-side.cls"
-OFF_ANALYSIS="$SIGNATURES_BASE_DIR/tplink-camera/tplink-camera-recording/analyses/tplink-camera-recording-offClusters-device-side.cls"
-RESULTS_FILE="$OUTPUT_DIR/tplink-camera/tplink-camera-recording/tplink-camera-recording.wlan1.validation.pcap___device-side.detectionresults"
-# TODO: SIGNATURE_DURATION=""
+ON_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/signatures/blink-camera-photo-onSignature-device-side.sig"
+OFF_SIGNATURE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/signatures/blink-camera-photo-offSignature-device-side.sig"
+ON_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/analyses/blink-camera-photo-onClusters-device-side.cls"
+OFF_ANALYSIS="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/analyses/blink-camera-photo-offClusters-device-side.cls"
+RESULTS_FILE="$SIGNATURES_BASE_DIR/blink-camera/blink-camera-photo/blink-camera-photo.wlan1.validation.pcap___device-side.detectionresults"
+SIGNATURE_DURATION="1429"
EPSILON="10.0"
PROGRAM_ARGS="'$PCAP_FILE' '$ON_ANALYSIS' '$OFF_ANALYSIS' '$ON_SIGNATURE' '$OFF_SIGNATURE' '$RESULTS_FILE' '$SIGNATURE_DURATION' '$EPSILON'"
# ================================================ HUE BULB INTENSITY ==================================================
# IFTTT
-TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/hue-bulb/hue-bulb-onoff/timestamps/hue-bulb-intensity-ifttt-dec-20-2019.timestamps"
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/hue-bulb/hue-bulb-intensity/timestamps/hue-bulb-intensity-ifttt-dec-20-2019.timestamps"
+# TODO: THERE WILL BE 50 FPS BECAUSE EVENTS ARE DETECTED TWICE (ON/OFF SIGNATURES ARE BOTH REFERRING TO THE SAME EVENT)
#DEVICE SIDE
-RESULTS_FILE="$RESULTS_BASE_DIR/hue-bulb/hue-bulb-onoff/hue-bulb-intensity.eth1.validation.pcap___device-side.detectionresults"
+RESULTS_FILE="$RESULTS_BASE_DIR/hue-bulb/hue-bulb-intensity/hue-bulb-intensity.eth1.validation.pcap___device-side.detectionresults"
ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
EXACT_MATCH="true"
PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
EXACT_MATCH="true"
PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
-./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
+#./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
# ======================================================================================================================
# =============================================== TP LINK BULB INTENSITY ===============================================
# ================================================== WEMO INSIGHT PLUG =================================================
# LOCAL
TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/wemo-insight-plug/timestamps/wemo-insight-plug-nov-21-2018.timestamps"
+# TODO: Timestamp file for retraining PCAP file
+#TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/wemo-insight-plug/timestamps/wemo-insight-plug-retraining-jan-9-2020.timestamps"
# Has no device side signature.
# TODO: SAME VENDOR OBSERVATION (TP-LINK DEVICES)
# =============================================== TP-LINK TWO-OUTLET PLUG ==============================================
-# TODO: TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-two-outlet-plug/timestamps/tplink-two-outlet-dec-16-2019.timestamps"
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-two-outlet-plug/timestamps/tplink-two-outlet-plug-dec-22-2019.timestamps"
RESULTS_FILE="$RESULTS_BASE_DIR/tplink-two-outlet-plug/tplink-two-outlet-plug.wlan1.validation.pcap___device-side.detectionresults"
ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
# ======================================================================================================================
# ================================================= TP-LINK POWER STRIP ================================================
-# TODO: TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-power-strip/timestamps/tplink-power-strip-dec-16-2019.timestamps"
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-power-strip/timestamps/tplink-power-strip-dec-22-2019.timestamps"
RESULTS_FILE="$RESULTS_BASE_DIR/tplink-power-strip/tplink-power-strip.wlan1.validation.pcap___device-side.detectionresults"
ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
# ============================================== TP-LINK LIGHT BULB ON/OFF =============================================
# KL-110 (newer model than LB-130 but no color---only dimmable white)
-# TODO: TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/timestamps/tplink-light-bulb-white-onoff-dec-16-2019.timestamps"
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-bulb-white/tplink-bulb-white-onoff/timestamps/tplink-bulb-white-onoff-dec-21-2019.timestamps"
-RESULTS_FILE="$RESULTS_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-onoff/tplink-light-bulb-white-onoff.wlan1.validation.pcap___device-side.detectionresults"
+RESULTS_FILE="$RESULTS_BASE_DIR/tplink-bulb-white/tplink-bulb-white-onoff/tplink-bulb-white-onoff.wlan1.validation.pcap___device-side.detectionresults"
ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
EXACT_MATCH="true"
PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
# ============================================= TP-LINK LIGHT BULB INTENSITY ===========================================
# KL-110 (newer model than LB-130 but no color---only dimmable white)
-# TODO: TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/timestamps/tplink-light-bulb-white-intensity-dec-16-2019.timestamps"
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-bulb-white/tplink-bulb-white-intensity/timestamps/tplink-bulb-white-intensity-dec-21-2019.timestamps"
-RESULTS_FILE="$RESULTS_BASE_DIR/tplink-light-bulb-white/tplink-light-bulb-white-intensity/tplink-light-bulb-white-intensity.wlan1.validation.pcap___device-side.detectionresults"
+RESULTS_FILE="$RESULTS_BASE_DIR/tplink-bulb-white/tplink-bulb-white-intensity/tplink-bulb-white-intensity.wlan1.validation.pcap___device-side.detectionresults"
ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
EXACT_MATCH="true"
PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
# ======================================================================================================================
# ================================================ TP-LINK CAMERA ON/OFF ===============================================
-# TODO: TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-camera/tplink-camera-onoff/timestamps/tplink-camera-onoff-dec-16-2019.timestamps"
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-camera/tplink-camera-onoff/timestamps/tplink-camera-onoff-dec-22-2019.timestamps"
RESULTS_FILE="$RESULTS_BASE_DIR/tplink-camera/tplink-camera-onoff/tplink-camera-onoff.wlan1.validation.pcap___device-side.detectionresults"
ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
#./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
# ======================================================================================================================
-# =============================================== TP-LINK CAMERA RECORDING =============================================
-# TODO: TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/tplink-camera/tplink-camera-intensity/timestamps/tplink-camera-intensity-dec-16-2019.timestamps"
+# TODO: IMC (NEW DEVICE)
+# ================================================= BLINK CAMERA WATCH =================================================
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/blink-camera/blink-camera-watch/timestamps/blink-camera-watch-retraining-dec-23-2019.timestamps"
+
+RESULTS_FILE="$RESULTS_BASE_DIR/blink-camera/blink-camera-watch/blink-camera-watch.wlan1.validation.pcap___device-side.detectionresults"
+ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
+EXACT_MATCH="true"
+PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
+#./gradlew run -DmainClass=edu.uci.iotproject.evaluation.DetectionResultsAnalyzer --args="$PROGRAM_ARGS"
+# ======================================================================================================================
+
+# ================================================= BLINK CAMERA PHOTO =================================================
+TIMESTAMPS_FILE="$TIMESTAMPS_BASE_DIR/blink-camera/blink-camera-photo/timestamps/blink-camera-photo-retraining-dec-24-2019.timestamps"
-RESULTS_FILE="$RESULTS_BASE_DIR/tplink-camera/tplink-camera-intensity/tplink-camera-intensity.wlan1.validation.pcap___device-side.detectionresults"
+RESULTS_FILE="$RESULTS_BASE_DIR/blink-camera/blink-camera-photo/blink-camera-photo.wlan1.validation.pcap___device-side.detectionresults"
ANALYSIS_RESULTS_FILE="$RESULTS_FILE.analysis"
EXACT_MATCH="true"
PROGRAM_ARGS="'$TIMESTAMPS_FILE' '$RESULTS_FILE' '$ANALYSIS_RESULTS_FILE' '$EXACT_MATCH'"
* Set of port numbers that we consider TLS traffic.
* Note: purposefully initialized as a {@link HashSet} to get O(1) {@code contains()} call.
*/
- private static final Set<Integer> TLS_PORTS = Stream.of(443, 8443, 41143).
+ private static final Set<Integer> TLS_PORTS = Stream.of(443, 8443, 41143, 5671, 30001).
collect(Collectors.toCollection(HashSet::new));
/**
private long mIncludedPackets = 0;
public static final int INCLUSION_WINDOW_MILLIS = 15_000;
- //public static final int INCLUSION_WINDOW_MILLIS = 30_000;
+ // TODO: Relax the inclusion time if needed
+// public static final int INCLUSION_WINDOW_MILLIS = 30_000;
public TriggerTrafficExtractor(String pcapFilePath, List<Instant> triggerTimes, String deviceIp) throws PcapNativeException, NotOpenException {
mPcapFilePath = pcapFilePath;
import edu.uci.iotproject.trafficreassembly.layer2.Layer2FlowObserver;
import org.pcap4j.core.*;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.function.Function;
/**
private String mTrainingRouterWlanMac;
private String mRouterWlanMac;
+ /**
+ * Relaxed matching
+ */
+ private int mDelta;
+ private Set<Integer> mPacketSet;
+
/**
* Create a new {@link Layer2ClusterMatcher} that attempts to find occurrences of {@code cluster}'s members.
* @param cluster The sequence mutations that the new {@link Layer2ClusterMatcher} should search for.
*/
public Layer2ClusterMatcher(List<List<PcapPacket>> cluster, String trainingRouterWlanMac, String routerWlanMac, int inclusionTimeMillis,
- boolean isRangeBased, double eps, int limitSkippedPackets) {
+ boolean isRangeBased, double eps, int limitSkippedPackets, int delta, Set<Integer> packetSet) {
// Consider all flows if no flow filter specified.
this(cluster, trainingRouterWlanMac, routerWlanMac, flow -> true, inclusionTimeMillis, isRangeBased, eps,
- limitSkippedPackets);
+ limitSkippedPackets, delta, packetSet);
}
/**
*/
public Layer2ClusterMatcher(List<List<PcapPacket>> cluster, String trainingRouterWlanMac, String routerWlanMac,
Function<Layer2Flow, Boolean> flowFilter, int inclusionTimeMillis, boolean isRangeBased,
- double eps, int limitSkippedPackets) {
+ double eps, int limitSkippedPackets, int delta, Set<Integer> packetSet) {
super(cluster, isRangeBased);
mFlowFilter = flowFilter;
mTrainingRouterWlanMac = trainingRouterWlanMac;
mSkippedPackets = new ArrayList<>();
// Give integer's MAX_VALUE if -1
mLimitSkippedPackets = limitSkippedPackets == -1 ? Integer.MAX_VALUE : limitSkippedPackets;
+ mDelta = delta;
+ mPacketSet = packetSet;
}
@Override
}
}
+ // TODO: Relaxed matching is applied in conservative matching
private void conservativeMatching(Layer2Flow flow, PcapPacket newPacket) {
if (mPerFlowSeqMatchers.get(flow) == null) {
// If this is the first time we encounter this flow, we need to set up sequence matchers for it.
// Prepare a "state 0" sequence matcher for each sequence variation in the cluster.
for (int i = 0; i < matchers.length; i++) {
matchers[i][0] = new Layer2SequenceMatcher(mCluster.get(i), mInclusionTimeMillis, mTrainingRouterWlanMac,
- mRouterWlanMac);
+ mRouterWlanMac, mDelta, mPacketSet);
}
// Associate the new sequence matcher table with the new flow
mPerFlowSeqMatchers.put(flow, matchers);
// from state zero completed its matching or if it replaced a different one in state 1 or not.
if (sm.getMatchedPacketsCount() == 1) {
matchers[i][j] = new Layer2SequenceMatcher(sm.getTargetSequence(), mInclusionTimeMillis,
- mTrainingRouterWlanMac, mRouterWlanMac);
+ mTrainingRouterWlanMac, mRouterWlanMac, mDelta, mPacketSet);
}
}
}
import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
/**
* Attempts to detect the presence of a specific packet sequence in the set of packets provided through multiple calls
private int mInclusionTimeMillis;
+ /**
+ * Relaxed matching
+ */
+ private int mDelta;
+ private Set<Integer> mPacketSet;
/**
* Create a {@code Layer2SequenceMatcher}.
* @param routerWlanMac The target trace router's WLAN MAC (used for determining the direction of packets).
*/
public Layer2SequenceMatcher(List<PcapPacket> sequence, int inclusionTimeMillis, String trainingRouterWlanMac,
- String routerWlanMac) {
+ String routerWlanMac, int delta, Set<Integer> packetSet) {
super(sequence, trainingRouterWlanMac, routerWlanMac);
mSequence = sequence;
// Compute packet directions for sequence.
}
mInclusionTimeMillis =
inclusionTimeMillis == 0 ? TriggerTrafficExtractor.INCLUSION_WINDOW_MILLIS : inclusionTimeMillis;
+ mDelta = delta;
+ mPacketSet = packetSet;
}
/**
// Get representative of the packet we expect to match next.
PcapPacket expected = mSequence.get(mMatchedPackets.size());
// First verify if the received packet has the length we're looking for.
- if (packet.getOriginalLength() == expected.getOriginalLength()) {
+ if ((mDelta > 0 && mPacketSet.contains(expected.getOriginalLength()) &&
+ expected.getOriginalLength() - mDelta <= packet.getOriginalLength() &&
+ packet.getOriginalLength() <= expected.getOriginalLength() + mDelta) ||
+ packet.getOriginalLength() == expected.getOriginalLength()) {
// If this is the first packet, we only need to verify that its length is correct. Time constraints are
// obviously satisfied as there are no previous packets. Furthermore, direction matches by definition as we
// don't know the MAC of the device (or phone) in advance, so we can't enforce a rule saying "first packet
}
public static void main(String[] args) throws PcapNativeException, NotOpenException, IOException {
+ String errMsg = String.format("SPECTO version 1.0\n" +
+ "Copyright (C) 2018-2019 Janus Varmarken and Rahmadi Trimananda.\n" +
+ "University of California, Irvine.\n" +
+ "All rights reserved.\n\n" +
+ "Usage: %s inputPcapFile onAnalysisFile offAnalysisFile onSignatureFile offSignatureFile " +
+ "resultsFile signatureDuration eps onMaxSkippedPackets offMaxSkippedPackets" +
+ "\n inputPcapFile: the target of the detection" +
+ "\n onAnalysisFile: the file that contains the ON clusters analysis" +
+ "\n offAnalysisFile: the file that contains the OFF clusters analysis" +
+ "\n onSignatureFile: the file that contains the ON signature to search for" +
+ "\n offSignatureFile: the file that contains the OFF signature to search for" +
+ "\n resultsFile: where to write the results of the detection" +
+ "\n signatureDuration: the maximum duration of signature detection" +
+ "\n epsilon: the epsilon value for the DBSCAN algorithm\n" +
+ "\n Additional options (add '-r' before the following two parameters):" +
+ "\n delta: delta for relaxed matching" +
+ "\n packetId: packet number in the sequence" +
+ "\n (could be more than one packet whose matching is relaxed, " +
+ "\n e.g., 0,1 for packets 0 and 1)",
+ Layer2SignatureDetector.class.getSimpleName());
+ String optParamsExplained = "Above are the required, positional arguments. In addition to these, the " +
+ "following options and associated positional arguments may be used:\n" +
+ " '-onmacfilters <regex>;<regex>;...;<regex>' which specifies that sequence matching should ONLY" +
+ " be performed on flows where the MAC of one of the two endpoints matches the given regex. Note " +
+ "that you MUST specify a regex for each cluster of the signature. This is to facilitate more " +
+ "aggressive filtering on parts of the signature (e.g., the communication that involves the " +
+ "smart home device itself as one can drop all flows that do not include an endpoint with a MAC " +
+ "that matches the vendor's prefix).\n" +
+ " '-offmacfilters <regex>;<regex>;...;<regex>' works exactly the same as onmacfilters, but " +
+ "applies to the OFF signature instead of the ON signature.\n" +
+ " '-sout <boolean literal>' true/false literal indicating if output should also be printed to std out; default is true.\n" +
+ " '-vpn <router mac>' router's MAC address; this is to simulate a VPN that combines all flows even when the traffic is not a VPN traffic.\n" +
+ " '-onskipped <max duration of on-signature>' the maximum duration of ON signature detection.\n" +
+ " '-offskipped <max duration of off-signature>' the maximum duration of OFF signature detection.\n";
// Parse required parameters.
if (args.length < 8) {
- String errMsg = String.format("SPECTO version 1.0\n" +
- "Copyright (C) 2018-2019 Janus Varmarken and Rahmadi Trimananda.\n" +
- "University of California, Irvine.\n" +
- "All rights reserved.\n\n" +
- "Usage: %s inputPcapFile onAnalysisFile offAnalysisFile onSignatureFile offSignatureFile " +
- "resultsFile signatureDuration eps onMaxSkippedPackets offMaxSkippedPackets" +
- "\n inputPcapFile: the target of the detection" +
- "\n onAnalysisFile: the file that contains the ON clusters analysis" +
- "\n offAnalysisFile: the file that contains the OFF clusters analysis" +
- "\n onSignatureFile: the file that contains the ON signature to search for" +
- "\n offSignatureFile: the file that contains the OFF signature to search for" +
- "\n resultsFile: where to write the results of the detection" +
- "\n signatureDuration: the maximum duration of signature detection" +
- "\n eps: the epsilon value for the DBSCAN algorithm",
- Layer2SignatureDetector.class.getSimpleName());
System.out.println(errMsg);
- String optParamsExplained = "Above are the required, positional arguments. In addition to these, the " +
- "following options and associated positional arguments may be used:\n" +
- " '-onmacfilters <regex>;<regex>;...;<regex>' which specifies that sequence matching should ONLY" +
- " be performed on flows where the MAC of one of the two endpoints matches the given regex. Note " +
- "that you MUST specify a regex for each cluster of the signature. This is to facilitate more " +
- "aggressive filtering on parts of the signature (e.g., the communication that involves the " +
- "smart home device itself as one can drop all flows that do not include an endpoint with a MAC " +
- "that matches the vendor's prefix).\n" +
- " '-offmacfilters <regex>;<regex>;...;<regex>' works exactly the same as onmacfilters, but " +
- "applies to the OFF signature instead of the ON signature.\n" +
- " '-sout <boolean literal>' true/false literal indicating if output should also be printed to std out; default is true.\n" +
- " '-vpn <router mac>' router's MAC address; this is to simulate a VPN that combines all flows even when the traffic is not a VPN traffic.\n" +
- " '-onskipped <max duration of on-signature>' the maximum duration of ON signature detection.\n" +
- " '-offskipped <max duration of off-signature>' the maximum duration of OFF signature detection.\n";
System.out.println(optParamsExplained);
return;
}
final String resultsFile = args[5];
final int signatureDuration = Integer.parseInt(args[6]);
final double eps = Double.parseDouble(args[7]);
+ // Additional feature---relaxed matching
+ int delta = 0;
+ final Set<Integer> packetSet = new HashSet<>();
+ if (args.length > 8 && args[8].equals("-r")) {
+ delta = Integer.parseInt(args[9]);
+ StringTokenizer stringTokenizerOff = new StringTokenizer(args[10], ",");
+ // Add the list of packet IDs
+ while(stringTokenizerOff.hasMoreTokens()) {
+ int id = Integer.parseInt(stringTokenizerOff.nextToken());
+ packetSet.add(id);
+ }
+ } else {
+ System.out.println(errMsg);
+ System.out.println(optParamsExplained);
+ return;
+ }
// Parse optional parameters.
List<Function<Layer2Flow, Boolean>> onSignatureMacFilters = null, offSignatureMacFilters = null;
}
Layer2SignatureDetector onDetector = onSignatureMacFilters == null ?
new Layer2SignatureDetector(onSignature, TRAINING_ROUTER_WLAN_MAC, ROUTER_WLAN_MAC, signatureDuration,
- isRangeBasedForOn, eps, onMaxSkippedPackets, vpnClientMacAddress) :
+ isRangeBasedForOn, eps, onMaxSkippedPackets, vpnClientMacAddress, delta, packetSet) :
new Layer2SignatureDetector(onSignature, TRAINING_ROUTER_WLAN_MAC, ROUTER_WLAN_MAC,
onSignatureMacFilters, signatureDuration, isRangeBasedForOn, eps, onMaxSkippedPackets,
- vpnClientMacAddress);
+ vpnClientMacAddress, delta, packetSet);
Layer2SignatureDetector offDetector = offSignatureMacFilters == null ?
new Layer2SignatureDetector(offSignature, TRAINING_ROUTER_WLAN_MAC, ROUTER_WLAN_MAC, signatureDuration,
- isRangeBasedForOff, eps, offMaxSkippedPackets, vpnClientMacAddress) :
+ isRangeBasedForOff, eps, offMaxSkippedPackets, vpnClientMacAddress, delta, packetSet) :
new Layer2SignatureDetector(offSignature, TRAINING_ROUTER_WLAN_MAC, ROUTER_WLAN_MAC, offSignatureMacFilters,
- signatureDuration, isRangeBasedForOff, eps, offMaxSkippedPackets, vpnClientMacAddress);
+ signatureDuration, isRangeBasedForOff, eps, offMaxSkippedPackets, vpnClientMacAddress, delta, packetSet);
final List<UserAction> detectedEvents = new ArrayList<>();
onDetector.addObserver((signature, match) -> {
UserAction event = new UserAction(UserAction.Type.TOGGLE_ON, match.get(0).get(0).getTimestamp());
public Layer2SignatureDetector(List<List<List<PcapPacket>>> searchedSignature, String trainingRouterWlanMac,
String routerWlanMac, int signatureDuration, boolean isRangeBased, double eps,
- int limitSkippedPackets, String vpnClientMacAddress) {
+ int limitSkippedPackets, String vpnClientMacAddress, int delta, Set<Integer> packetSet) {
this(searchedSignature, trainingRouterWlanMac, routerWlanMac, null, signatureDuration, isRangeBased,
- eps, limitSkippedPackets, vpnClientMacAddress);
+ eps, limitSkippedPackets, vpnClientMacAddress, delta, packetSet);
}
public Layer2SignatureDetector(List<List<List<PcapPacket>>> searchedSignature, String trainingRouterWlanMac,
String routerWlanMac, List<Function<Layer2Flow, Boolean>> flowFilters,
int inclusionTimeMillis, boolean isRangeBased, double eps, int limitSkippedPackets,
- String vpnClientMacAddress) {
+ String vpnClientMacAddress, int delta, Set<Integer> packetSet) {
if (flowFilters != null && flowFilters.size() != searchedSignature.size()) {
throw new IllegalArgumentException("If flow filters are used, there must be a flow filter for each cluster " +
"of the signature.");
List<List<PcapPacket>> cluster = mSignature.get(i);
Layer2ClusterMatcher clusterMatcher = flowFilters == null ?
new Layer2ClusterMatcher(cluster, trainingRouterWlanMac, routerWlanMac, inclusionTimeMillis,
- isRangeBased, eps, limitSkippedPackets) :
+ isRangeBased, eps, limitSkippedPackets, delta, packetSet) :
new Layer2ClusterMatcher(cluster, trainingRouterWlanMac, routerWlanMac, flowFilters.get(i),
- inclusionTimeMillis, isRangeBased, eps, limitSkippedPackets);
+ inclusionTimeMillis, isRangeBased, eps, limitSkippedPackets, delta, packetSet);
clusterMatcher.addObserver(this);
clusterMatchers.add(clusterMatcher);
}
*/
private int mInclusionTimeMillis;
+ /**
+ * Relaxed matching
+ */
+ private int mDelta;
+ private Set<Integer> mPacketSet;
+
/**
* Create a {@link Layer3ClusterMatcher}.
* @param cluster The cluster that traffic is matched against.
* {@code cluster}.
*/
public Layer3ClusterMatcher(List<List<PcapPacket>> cluster, String routerWanIp, int inclusionTimeMillis,
- boolean isRangeBased, double eps,
+ boolean isRangeBased, double eps, int delta, Set<Integer> packetSet,
ClusterMatcherObserver... detectionObservers) {
super(cluster, isRangeBased);
Objects.requireNonNull(detectionObservers, "detectionObservers cannot be null");
mTcpReassembler = new TcpReassembler(mRouterWanIp);
mInclusionTimeMillis =
inclusionTimeMillis == 0 ? TriggerTrafficExtractor.INCLUSION_WINDOW_MILLIS : inclusionTimeMillis;
+ mDelta = delta;
+ mPacketSet = packetSet;
}
@Override
}
}
+ // TODO: Relaxed matching with delta is only applied to conservative matching for now
public void performDetectionConservative() {
/*
* Let's start out simple by building a version that only works for signatures that do not span across multiple
* won't have to be recomputed internally in each call to findSubsequenceInSequence().
*/
Optional<List<PcapPacket>> match;
- while ((match = findSubsequenceInSequence(signatureSequence, cPkts, mClusterMemberDirections, null)).
+ while ((match = findSubsequenceInSequence(signatureSequence, cPkts, mClusterMemberDirections, null, mDelta, mPacketSet)).
isPresent()) {
List<PcapPacket> matchSeq = match.get();
// Notify observers about the match.
return Optional.empty();
}
+ /**
+ * Overload the same method with relaxed matching.
+ *
+ * @param subsequence The sequence to search for.
+ * @param sequence The sequence to search.
+ * @param subsequenceDirections The directions of packets in {@code subsequence} such that for all {@code i},
+ * {@code subsequenceDirections[i]} is the direction of the packet returned by
+ * {@code subsequence.get(i)}. May be set to {@code null}, in which this call will
+ * internally compute the packet directions.
+ * @param sequenceDirections The directions of packets in {@code sequence} such that for all {@code i},
+ * {@code sequenceDirections[i]} is the direction of the packet returned by
+ * {@code sequence.get(i)}. May be set to {@code null}, in which this call will internally
+ * compute the packet directions.
+ * @param delta The delta for relaxed matching
+ * @param packetSet The set of unique packet lengths, whose matching is to be relaxed
+ *
+ * @return An {@link Optional} containing the part of {@code sequence} that matches {@code subsequence}, or an empty
+ * {@link Optional} if no part of {@code sequence} matches {@code subsequence}.
+ */
+ private Optional<List<PcapPacket>> findSubsequenceInSequence(List<PcapPacket> subsequence,
+ List<PcapPacket> sequence,
+ Conversation.Direction[] subsequenceDirections,
+ Conversation.Direction[] sequenceDirections,
+ int delta,
+ Set<Integer> packetSet) {
+ if (sequence.size() < subsequence.size()) {
+ // If subsequence is longer, it cannot be contained in sequence.
+ return Optional.empty();
+ }
+ if (isTlsSequence(subsequence) != isTlsSequence(sequence)) {
+ // We consider it a mismatch if one is a TLS application data sequence and the other is not.
+ return Optional.empty();
+ }
+ // If packet directions have not been precomputed by calling code, we need to construct them.
+ if (subsequenceDirections == null) {
+ subsequenceDirections = getPacketDirections(subsequence, mRouterWanIp);
+ }
+ if (sequenceDirections == null) {
+ sequenceDirections = getPacketDirections(sequence, mRouterWanIp);
+ }
+ int subseqIdx = 0;
+ int seqIdx = 0;
+ while (seqIdx < sequence.size()) {
+ PcapPacket subseqPkt = subsequence.get(subseqIdx);
+ PcapPacket seqPkt = sequence.get(seqIdx);
+ // We only have a match if packet lengths and directions match.
+ // Do relaxed matching here if applicable
+ if ((delta > 0 && packetSet.contains(subseqPkt.getOriginalLength()) &&
+ subseqPkt.getOriginalLength() - delta <= seqPkt.getOriginalLength() &&
+ seqPkt.getOriginalLength() <= subseqPkt.getOriginalLength() + delta &&
+ subsequenceDirections[subseqIdx] == sequenceDirections[seqIdx]) ||
+ // Or just exact matching
+ (subseqPkt.getOriginalLength() == seqPkt.getOriginalLength() &&
+ subsequenceDirections[subseqIdx] == sequenceDirections[seqIdx])) {
+ // A match; advance both indices to consider next packet in subsequence vs. next packet in sequence.
+ subseqIdx++;
+ seqIdx++;
+ if (subseqIdx == subsequence.size()) {
+ // We managed to match the entire subsequence in sequence.
+ // Return the sublist of sequence that matches subsequence.
+ /*
+ * TODO:
+ * ASSUMES THE BACKING LIST (i.e., 'sequence') IS _NOT_ STRUCTURALLY MODIFIED, hence may not work
+ * for live traces!
+ */
+ return Optional.of(sequence.subList(seqIdx - subsequence.size(), seqIdx));
+ }
+ } else {
+ // Mismatch.
+ if (subseqIdx > 0) {
+ /*
+ * If we managed to match parts of subsequence, we restart the search for subsequence in sequence at
+ * the index of sequence where the current mismatch occurred. I.e., we must reset subseqIdx, but
+ * leave seqIdx untouched.
+ */
+ subseqIdx = 0;
+ } else {
+ /*
+ * First packet of subsequence didn't match packet at seqIdx of sequence, so we move forward in
+ * sequence, i.e., we continue the search for subsequence in sequence starting at index seqIdx+1 of
+ * sequence.
+ */
+ seqIdx++;
+ }
+ }
+ }
+ return Optional.empty();
+ }
+
/**
* Overloading the method {@code findSubsequenceInSequence} for range-based matching. Instead of a sequence,
* we have sequences of lower and upper bounds.
private static String ROUTER_WAN_IP = "128.195.55.242";
public static void main(String[] args) throws PcapNativeException, NotOpenException, IOException {
+ String errMsg = String.format("SPECTO version 1.0\n" +
+ "Copyright (C) 2018-2019 Janus Varmarken and Rahmadi Trimananda.\n" +
+ "University of California, Irvine.\n" +
+ "All rights reserved.\n\n" +
+ "Usage: %s inputPcapFile onAnalysisFile offAnalysisFile onSignatureFile offSignatureFile resultsFile" +
+ "\n inputPcapFile: the target of the detection" +
+ "\n onAnalysisFile: the file that contains the ON clusters analysis" +
+ "\n offAnalysisFile: the file that contains the OFF clusters analysis" +
+ "\n onSignatureFile: the file that contains the ON signature to search for" +
+ "\n offSignatureFile: the file that contains the OFF signature to search for" +
+ "\n resultsFile: where to write the results of the detection" +
+ "\n signatureDuration: the maximum duration of signature detection" +
+ "\n epsilon: the epsilon value for the DBSCAN algorithm\n" +
+ "\n Additional options (add '-r' before the following two parameters):" +
+ "\n delta: delta for relaxed matching" +
+ "\n packetId: packet number in the sequence" +
+ "\n (could be more than one packet whose matching is relaxed, " +
+ "\n e.g., 0,1 for packets 0 and 1)",
+ Layer3SignatureDetector.class.getSimpleName());
if (args.length < 8) {
- String errMsg = String.format("SPECTO version 1.0\n" +
- "Copyright (C) 2018-2019 Janus Varmarken and Rahmadi Trimananda.\n" +
- "University of California, Irvine.\n" +
- "All rights reserved.\n\n" +
- "Usage: %s inputPcapFile onAnalysisFile offAnalysisFile onSignatureFile offSignatureFile resultsFile" +
- "\n inputPcapFile: the target of the detection" +
- "\n onAnalysisFile: the file that contains the ON clusters analysis" +
- "\n offAnalysisFile: the file that contains the OFF clusters analysis" +
- "\n onSignatureFile: the file that contains the ON signature to search for" +
- "\n offSignatureFile: the file that contains the OFF signature to search for" +
- "\n resultsFile: where to write the results of the detection" +
- "\n signatureDuration: the maximum duration of signature detection" +
- "\n epsilon: the epsilon value for the DBSCAN algorithm",
- Layer3SignatureDetector.class.getSimpleName());
System.out.println(errMsg);
return;
}
// final int signatureDuration = Integer.parseInt(args[6]);
final int signatureDuration = TriggerTrafficExtractor.INCLUSION_WINDOW_MILLIS;
final double eps = Double.parseDouble(args[7]);
-
+ // Additional feature---relaxed matching
+ int delta = 0;
+ final Set<Integer> packetSet = new HashSet<>();
+ if (args.length == 11 && args[8].equals("-r")) {
+ delta = Integer.parseInt(args[9]);
+ StringTokenizer stringTokenizerOff = new StringTokenizer(args[10], ",");
+ // Add the list of packet IDs
+ while(stringTokenizerOff.hasMoreTokens()) {
+ int id = Integer.parseInt(stringTokenizerOff.nextToken());
+ packetSet.add(id);
+ }
+ } else {
+ System.out.println(errMsg);
+ return;
+ }
// Prepare file outputter.
File outputFile = new File(resultsFile);
outputFile.getParentFile().mkdirs();
}
// WAN
Layer3SignatureDetector onDetector = new Layer3SignatureDetector(onSignature, ROUTER_WAN_IP,
- signatureDuration, isRangeBasedForOn, eps);
+ signatureDuration, isRangeBasedForOn, eps, delta, packetSet);
Layer3SignatureDetector offDetector = new Layer3SignatureDetector(offSignature, ROUTER_WAN_IP,
- signatureDuration, isRangeBasedForOff, eps);
+ signatureDuration, isRangeBasedForOff, eps, delta, packetSet);
final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).
withLocale(Locale.US).withZone(ZoneId.of("America/Los_Angeles"));
}
public Layer3SignatureDetector(List<List<List<PcapPacket>>> searchedSignature, String routerWanIp,
- int inclusionTimeMillis, boolean isRangeBased, double eps) {
+ int inclusionTimeMillis, boolean isRangeBased, double eps,
+ int delta, Set<Integer> packetSet) {
// note: doesn't protect inner lists from changes :'(
mSignature = Collections.unmodifiableList(searchedSignature);
// Generate corresponding/appropriate ClusterMatchers based on the provided signature
List<Layer3ClusterMatcher> clusterMatchers = new ArrayList<>();
for (List<List<PcapPacket>> cluster : mSignature) {
clusterMatchers.add(new Layer3ClusterMatcher(cluster, routerWanIp, inclusionTimeMillis,
- isRangeBased, eps, this));
+ isRangeBased, eps, delta, packetSet, this));
}
mClusterMatchers = Collections.unmodifiableList(clusterMatchers);