// final String outputPcapFile = path + "/2018-10/dlink-plug/dlink-plug-processed.pcap";
// final String triggerTimesFile = path + "/2018-10/dlink-plug/dlink-plug-oct-17-2018.timestamps";
// final String deviceIp = "192.168.1.199"; // .246 == phone; .199 == dlink plug?
+ // TODO: EXPERIMENT - November 7, 2018
+// final String inputPcapFile = path + "/experimental_result/standalone/dlink-plug/wlan1/dlink-plug.wlan1.local.pcap";
+// final String outputPcapFile = path + "/experimental_result/standalone/dlink-plug/wlan1/dlink-plug-processed.pcap";
+// final String triggerTimesFile = path + "/experimental_result/standalone/dlink-plug/timestamps/dlink-plug-nov-7-2018.timestamps";
+// //final String deviceIp = "192.168.1.199"; // .246 == phone; .199 == dlink plug?
+// final String deviceIp = "192.168.1.246"; // .246 == phone; .199 == dlink plug?
// 2) TP-Link July 25 experiment
// final String inputPcapFile = path + "/2018-07/tplink/tplink.wlan1.local.pcap";
// final String outputPcapFile = path + "/2018-10/tplink-plug/tplink-plug-processed.pcap";
// final String triggerTimesFile = path + "/2018-10/tplink-plug/tplink-plug-oct-17-2018.timestamps";
// final String deviceIp = "192.168.1.246"; // .246 == phone; .159 == tplink plug
+ // TODO: EXPERIMENT - November 8, 2018
+// final String inputPcapFile = path + "/experimental_result/standalone/tplink-plug/wlan1/tplink-plug.wlan1.local.pcap";
+// final String outputPcapFile = path + "/experimental_result/standalone/tplink-plug/wlan1/tplink-plug-processed.pcap";
+// final String triggerTimesFile = path + "/experimental_result/standalone/tplink-plug/timestamps/tplink-plug-nov-8-2018.timestamps";
+// final String deviceIp = "192.168.1.159"; // .246 == phone; .159 == tplink plug
+//// final String deviceIp = "192.168.1.246"; // .246 == phone; .159 == tplink plug
// 2b) TP-Link July 25 experiment TRUNCATED:
// Only contains "true local" events, i.e., before the behavior changes to remote-like behavior.
//// final String triggerTimesFile = path + "/2018-08/kwikset-doorlock/kwikset-doorlock-aug-6-2018.timestamps";
// final String triggerTimesFile = path + "/2018-08/kwikset-doorlock/kwikset-doorlock-8hr-data-oct-11-2018.timestamps";
// final String deviceIp = "192.168.1.246"; // .246 == phone; .142 == SmartThings Hub (note: use eth0 capture for this!)
+ // TODO: EXPERIMENT - November 10, 2018
+ final String inputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/wlan1/kwikset-doorlock.wlan1.local.pcap";
+ final String outputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/wlan1/kwikset-doorlock-processed.pcap";
+// final String inputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/eth1/kwikset-doorlock.eth1.local.pcap";
+// final String outputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/eth1/kwikset-doorlock-processed.pcap";
+ final String triggerTimesFile = path + "/experimental_result/standalone/kwikset-doorlock/timestamps/kwikset-doorlock-nov-10-2018.timestamps";
+// final String deviceIp = "192.168.1.183"; // .246 == phone; .142 == SmartThings Hub (note: use eth0 capture for this!)
+ final String deviceIp = "192.168.1.246"; // .246 == phone; .142 == SmartThings Hub (note: use eth0 capture for this!)
// September 12, 2018 - includes both wlan1 and eth1 interfaces
// final String inputPcapFile = path + "/2018-08/kwikset-doorlock/kwikset3.wlan1.local.pcap";
// //final String triggerTimesFile = path + "/2018-08/dlink-siren/dlink-siren-aug-14-2018.timestamps";
// //final String triggerTimesFile = path + "/actual/timestamps/dlink-siren-8hr-data-oct-10-2018.timestamps";
// final String deviceIp = "192.168.1.246"; // .246 == phone; .183 == siren
+ // TODO: EXPERIMENT - November 9, 2018
+// final String inputPcapFile = path + "/experimental_result/standalone/dlink-siren/wlan1/dlink-siren.wlan1.local.pcap";
+// final String outputPcapFile = path + "/experimental_result/standalone/dlink-siren/wlan1/dlink-siren-processed.pcap";
+// final String triggerTimesFile = path + "/experimental_result/standalone/dlink-siren/timestamps/dlink-siren-nov-9-2018.timestamps";
+// final String deviceIp = "192.168.1.183"; // .246 == phone; .183 == siren
+//// final String deviceIp = "192.168.1.246"; // .246 == phone; .183 == siren
// 14) Nest thermostat August 15 experiment
- final String inputPcapFile = path + "/2018-08/nest/nest.wlan1.local.pcap";
- final String outputPcapFile = path + "/2018-08/nest/nest-processed.pcap";
- final String triggerTimesFile = path + "/2018-08/nest/nest-aug-15-2018.timestamps";
- final String deviceIp = "192.168.1.246"; // .246 == phone; .127 == Nest thermostat
+// final String inputPcapFile = path + "/2018-08/nest/nest.wlan1.local.pcap";
+// final String outputPcapFile = path + "/2018-08/nest/nest-processed.pcap";
+// final String triggerTimesFile = path + "/2018-08/nest/nest-aug-15-2018.timestamps";
+// final String deviceIp = "192.168.1.246"; // .246 == phone; .127 == Nest thermostat
// 15) Alexa August 16 experiment
// final String inputPcapFile = path + "/2018-08/alexa/alexa.wlan1.local.pcap";
// TODO: Merging test
ppListOfListListOn = PcapPacketUtils.mergeSignatures(ppListOfListListOn, sortedAllConversation);
ppListOfListListOn = PcapPacketUtils.sortSignatures(ppListOfListListOn);
+ // TODO: Need to remove sequence number 2 for ST plug since it is not a good signature!
+ //PcapPacketUtils.removeSequenceFromSignature(ppListOfListListOn, 2);
+ // TODO: Need to remove sequence number 0 for TP-Link plug since it is not a good signature!
+ // TODO: This sequence actually belongs to the local communication between the plug and the phone
+ //PcapPacketUtils.removeSequenceFromSignature(ppListOfListListOn, 0);
PcapPacketUtils.printSignatures(ppListOfListListOn);
//count = 0;
/*for (List<List<PcapPacket>> ll : ppListOfListListOn) {
ppListOfListListOff = PcapPacketUtils.mergeSignatures(ppListOfListListOff, sortedAllConversation);
ppListOfListListOff = PcapPacketUtils.sortSignatures(ppListOfListListOff);
// TODO: Need to remove sequence number 1 for Nest Thermostat since it is not a good signature!
- PcapPacketUtils.removeSequenceFromSignature(ppListOfListListOff, 1);
+ //PcapPacketUtils.removeSequenceFromSignature(ppListOfListListOff, 1);
+ // TODO: Need to remove sequence number 0 for Arlo Camera since it is not a good signature!
+ //PcapPacketUtils.removeSequenceFromSignature(ppListOfListListOff, 0);
+ // TODO: Need to remove sequence number 2 for ST plug since it is not a good signature!
+ //PcapPacketUtils.removeSequenceFromSignature(ppListOfListListOff, 2);
+ // TODO: Need to remove sequence number 0 for TP-Link plug since it is not a good signature!
+ // TODO: This sequence actually belongs to the local communication between the plug and the phone
+ //PcapPacketUtils.removeSequenceFromSignature(ppListOfListListOff, 0);
PcapPacketUtils.printSignatures(ppListOfListListOff);
//count = 0;
/*for (List<List<PcapPacket>> ll : ppListOfListListOff) {
// final String onSignatureFile = path + "/2018-07/dlink/onSignature-DLink-Plug-phone.sig";
// final String offSignatureFile = path + "/2018-07/dlink/offSignature-DLink-Plug-phone.sig";
+ // TODO: The following are negative tests against the PCAP file from UNSW
+ /* final String inputPcapFile = path + "/UNSW/16-09-28.pcap"; TODO: Seems to be broken! */
+ /* final String inputPcapFile = path + "/UNSW/16-10-02.pcap"; TODO: Seems to be broken! */
+ /* final String inputPcapFile = path + "/UNSW/16-10-03.pcap"; TODO: Seems to be broken! */
+ /* final String inputPcapFile = path + "/UNSW/16-10-04.pcap"; TODO: Seems to be broken! */
+ /* final String inputPcapFile = path + "/UNSW/16-10-07.pcap"; TODO: Seems to be broken! */
+ /* final String inputPcapFile = path + "/UNSW/16-10-08.pcap"; TODO: Seems to be broken! */
+ /* final String inputPcapFile = path + "/UNSW/16-10-09.pcap"; TODO: Seems to be broken! */
+ /* final String inputPcapFile = path + "/UNSW/16-10-10.pcap"; TODO: Seems to be broken! */
+ /* final String inputPcapFile = path + "/UNSW/16-10-11.pcap"; TODO: Seems to be broken! */
+
+
+// final String inputPcapFile = path + "/UNSW/16-09-23.pcap";
+// final String inputPcapFile = path + "/UNSW/16-09-24.pcap";
+// final String inputPcapFile = path + "/UNSW/16-09-25.pcap";
+// final String inputPcapFile = path + "/UNSW/16-09-26.pcap";
+// final String inputPcapFile = path + "/UNSW/16-09-27.pcap";
+// final String inputPcapFile = path + "/UNSW/16-09-29.pcap";
+// final String inputPcapFile = path + "/UNSW/16-10-01.pcap";
+// final String inputPcapFile = path + "/UNSW/16-10-06.pcap";
+
+ // TODO: The following one is very long!!!
+// final String inputPcapFile = path + "/UNSW/16-10-12.pcap";
// TODO: The following are tests for signatures against training data
-
/*
// D-Link Plug experiment
final String inputPcapFile = path + "/training/dlink-plug/wlan1/dlink-plug.wlan1.local.pcap";
final String onSignatureFile = path + "/training/dlink-plug/signatures/dlink-plug-onSignature-phone-side.sig";
final String offSignatureFile = path + "/training/dlink-plug/signatures/dlink-plug-offSignature-phone-side.sig";
*/
+ // TODO: EXPERIMENT - November 7, 2018
+ // D-Link Plug experiment
+ //final String inputPcapFile = path + "/experimental_result/standalone/dlink-plug/wlan1/dlink-plug.wlan1.local.pcap";
+ //final String inputPcapFile = path + "/experimental_result/smarthome/dlink-plug/wlan1/dlink-plug.wlan1.detection.pcap";
+ //final String inputPcapFile = path + "/experimental_result/smarthome/dlink-plug/eth0/dlink-plug.eth0.detection.pcap";
+ // D-Link Plug DEVICE signatures
+// final String onSignatureFile = path + "/experimental_result/standalone/dlink-plug/signatures/dlink-plug-onSignature-device-side.sig";
+// final String offSignatureFile = path + "/experimental_result/standalone/dlink-plug/signatures/dlink-plug-offSignature-device-side.sig";
+ // D-Link Plug PHONE signatures
+ //final String onSignatureFile = path + "/experimental_result/standalone/dlink-plug/signatures/dlink-plug-onSignature-phone-side.sig";
+ //final String offSignatureFile = path + "/experimental_result/standalone/dlink-plug/signatures/dlink-plug-offSignature-phone-side.sig";
+
+ // TODO: EXPERIMENT - November 9, 2018
+ // D-Link Siren experiment
+ //final String inputPcapFile = path + "/experimental_result/standalone/dlink-siren/wlan1/dlink-siren.wlan1.local.pcap";
+ //final String inputPcapFile = path + "/experimental_result/smarthome/dlink-siren/wlan1/dlink-siren.wlan1.detection.pcap";
+// final String inputPcapFile = path + "/experimental_result/smarthome/dlink-siren/eth0/dlink-siren.eth0.detection.pcap";
+ // D-Link Siren DEVICE signatures
+ // TODO: The device signature does not have pairs---only one packet which is 216, so we don't consider this as a signature
+// final String onSignatureFile = path + "/experimental_result/standalone/dlink-siren/signatures/dlink-siren-onSignature-device-side.sig";
+// final String offSignatureFile = path + "/experimental_result/standalone/dlink-siren/signatures/dlink-siren-offSignature-device-side.sig";
+ // D-Link Siren PHONE signatures
+// final String onSignatureFile = path + "/experimental_result/standalone/dlink-siren/signatures/dlink-siren-onSignature-phone-side.sig";
+// final String offSignatureFile = path + "/experimental_result/standalone/dlink-siren/signatures/dlink-siren-offSignature-phone-side.sig";
- /*
// TP-Link Plug experiment
- final String inputPcapFile = path + "/training/tplink-plug/wlan1/tplink-plug.wlan1.local.pcap";
+ //final String inputPcapFile = path + "/training/tplink-plug/wlan1/tplink-plug.wlan1.local.pcap";
// TP-Link Plug DEVICE signatures
//final String onSignatureFile = path + "/training/tplink-plug/signatures/tplink-plug-onSignature-device-side.sig";
//final String offSignatureFile = path + "/training/tplink-plug/signatures/tplink-plug-offSignature-device-side.sig";
- */
+ // TODO: EXPERIMENT - November 8, 2018
+ // TP-Link Plug experiment
+// final String inputPcapFile = path + "/experimental_result/standalone/tplink-plug/wlan1/tplink-plug.wlan1.local.pcap";
+// final String inputPcapFile = path + "/experimental_result/standalone/tplink-plug/eth0/tplink-plug.eth0.local.pcap";
+// final String inputPcapFile = path + "/experimental_result/smarthome/tplink-plug/wlan1/tplink-plug.wlan1.detection.pcap";
+ //final String inputPcapFile = path + "/experimental_result/smarthome/tplink-plug/eth0/tplink-plug.eth0.detection.pcap";
+ // TP-Link Plug DEVICE signatures
+// final String onSignatureFile = path + "/experimental_result/standalone/tplink-plug/signatures/tplink-plug-onSignature-device-side.sig";
+// final String offSignatureFile = path + "/experimental_result/standalone/tplink-plug/signatures/tplink-plug-offSignature-device-side.sig";
+// final String onSignatureFile = path + "/experimental_result/standalone/tplink-plug/signatures/tplink-plug-onSignature-device-side-outbound.sig";
+// final String offSignatureFile = path + "/experimental_result/standalone/tplink-plug/signatures/tplink-plug-offSignature-device-side-outbound.sig";
+ // TP-Link Plug PHONE signatures
+// final String onSignatureFile = path + "/experimental_result/standalone/tplink-plug/signatures/tplink-plug-onSignature-phone-side.sig";
+// final String offSignatureFile = path + "/experimental_result/standalone/tplink-plug/signatures/tplink-plug-offSignature-phone-side.sig";
// Arlo camera experiment
// final String inputPcapFile = path + "/training/arlo-camera/wlan1/arlo-camera.wlan1.local.pcap";
// SmartThings Plug experiment
// final String inputPcapFile = path + "/training/st-plug/wlan1/st-plug.wlan1.local.pcap";
- // TP-Link Plug DEVICE signatures
- //final String onSignatureFile = path + "/training/st-plug/signatures/st-plug-onSignature-device-side.sig";
- //final String offSignatureFile = path + "/training/st-plug/signatures/st-plug-offSignature-device-side.sig";
- // TP-Link Plug PHONE signatures
+// // TP-Link Plug DEVICE signatures
+// //final String onSignatureFile = path + "/training/st-plug/signatures/st-plug-onSignature-device-side.sig";
+// //final String offSignatureFile = path + "/training/st-plug/signatures/st-plug-offSignature-device-side.sig";
+// // TP-Link Plug PHONE signatures
// final String onSignatureFile = path + "/training/st-plug/signatures/st-plug-onSignature-phone-side.sig";
// final String offSignatureFile = path + "/training/st-plug/signatures/st-plug-offSignature-phone-side.sig";
*/
// Nest Thermostat experiment
- final String inputPcapFile = path + "/training/nest-thermostat/wlan1/nest-thermostat.wlan1.local.pcap";
- // Nest Thermostat DEVICE signatures
-// final String onSignatureFile = path + "/training/nest-thermostat/signatures/nest-thermostat-onSignature-device-side.sig";
-// final String offSignatureFile = path + "/training/nest-thermostat/signatures/nest-thermostat-offSignature-device-side.sig";
- // Nest Thermostat PHONE signatures
- final String onSignatureFile = path + "/training/nest-thermostat/signatures/nest-thermostat-onSignature-phone-side.sig";
- final String offSignatureFile = path + "/training/nest-thermostat/signatures/nest-thermostat-offSignature-phone-side.sig";
+// final String inputPcapFile = path + "/training/nest-thermostat/wlan1/nest-thermostat.wlan1.local.pcap";
+// // Nest Thermostat DEVICE signatures
+//// final String onSignatureFile = path + "/training/nest-thermostat/signatures/nest-thermostat-onSignature-device-side.sig";
+//// final String offSignatureFile = path + "/training/nest-thermostat/signatures/nest-thermostat-offSignature-device-side.sig";
+// // Nest Thermostat PHONE signatures
+// final String onSignatureFile = path + "/training/nest-thermostat/signatures/nest-thermostat-onSignature-phone-side.sig";
+// final String offSignatureFile = path + "/training/nest-thermostat/signatures/nest-thermostat-offSignature-phone-side.sig";
/*
// Hue Bulb experiment
// // Kwikset Doorlock PHONE signatures
// final String onSignatureFile = path + "/2018-08/kwikset-doorlock/onSignature-Kwikset-Doorlock-phone.sig";
// final String offSignatureFile = path + "/2018-08/kwikset-doorlock/offSignature-Kwikset-Doorlock-phone.sig";
+ // TODO: EXPERIMENT - November 10, 2018
+ // Kwikset Door lock experiment
+// final String inputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/wlan1/kwikset-doorlock.wlan1.local.pcap";
+// //final String inputPcapFile = path + "/experimental_result/smarthome/kwikset-doorlock/wlan1/kwikset-doorlock.wlan1.detection.pcap";
+//// final String inputPcapFile = path + "/experimental_result/smarthome/kwikset-doorlock/eth0/kwikset-doorlock.eth0.detection.pcap";
+// // Kwikset Door lock PHONE signatures
+// final String onSignatureFile = path + "/experimental_result/standalone/kwikset-doorlock/signatures/kwikset-doorlock-onSignature-phone-side.sig";
+// final String offSignatureFile = path + "/experimental_result/standalone/kwikset-doorlock/signatures/kwikset-doorlock-offSignature-phone-side.sig";
+
/*
List<List<List<PcapPacket>>> offSignature = PrintUtils.deserializeSignatureFromFile(offSignatureFile);
// LAN
- SignatureDetector onDetector = new SignatureDetector(onSignature, null);
- SignatureDetector offDetector = new SignatureDetector(offSignature, null);
+// SignatureDetector onDetector = new SignatureDetector(onSignature, null);
+// SignatureDetector offDetector = new SignatureDetector(offSignature, null);
// WAN
-// SignatureDetector onDetector = new SignatureDetector(onSignature, "128.195.205.105");
-// SignatureDetector offDetector = new SignatureDetector(offSignature, "128.195.205.105");
+ SignatureDetector onDetector = new SignatureDetector(onSignature, "128.195.205.105");
+ SignatureDetector offDetector = new SignatureDetector(offSignature, "128.195.205.105");
final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).
withLocale(Locale.US).withZone(ZoneId.of("America/Los_Angeles"));
// Print out packet lengths in a sequence
int packetCounter = 0;
for(PcapPacket pcapPacket : listPcapPacket) {
- System.out.print(pcapPacket.length());
+ if(pcapPacket != null) {
+ System.out.print(pcapPacket.length());
+ }
if(packetCounter < listPcapPacket.size() - 1) {
System.out.print(" "); // Provide space if not last packet
} else {
from datetime import datetime
-
-path = "/scratch/July-2018/training/"
+#path = "/scratch/July-2018/experimental_result/smarthome/"
+path = "/scratch/July-2018/experimental_result/standalone/"
# D-Link plug
#device = "dlink-plug/self-test"
-#fileExperiment = "dlink-plug-oct-17-2018.timestamps"
-#fileDetection = "detection-on-training-device-side"
-#fileDetection = "detection-on-training-phone-side"
+#fileExperiment = "dlink-plug-nov-7-2018.timestamps"
+#fileDetection = "device-side-detection"
+#fileDetection = "phone-side-detection"
+#device = "dlink-plug/timestamps"
+#fileExperiment = "dlink-plug-smarthome-nov-8-2018.timestamps"
+#fileDetection = "dlink-plug-smarthome-nov-8-2018.phone.wlan1.detections"
+#fileDetection = "dlink-plug-smarthome-nov-8-2018.phone.eth0.detections"
+#fileDetection = "dlink-plug-smarthome-nov-8-2018.device.eth0.detections"
+
+# TP-Link plug
+#device = "tplink-plug/self-test"
+#fileExperiment = "tplink-plug-nov-8-2018.timestamps"
+#fileDetection = "device-side-detection"
+#fileDetection = "phone-side-detection"
+#device = "tplink-plug/timestamps"
+#fileExperiment = "tplink-plug-smarthome-nov-9-2018.timestamps"
+#fileDetection = "tplink-plug-smarthome-nov-9-2018.eth0.device.detections"
+#fileDetection = "tplink-plug-smarthome-nov-9-2018.wlan1.phone.detections"
+
+# D-Link siren
+#device = "dlink-siren/self-test"
+#fileExperiment = "dlink-siren-nov-9-2018.timestamps"
+#fileDetection = "phone-side-detection"
+device = "dlink-siren/timestamps"
+fileExperiment = "dlink-siren-smarthome-nov-10-2018.timestamps"
+fileDetection = "dlink-siren-smarthome-nov-10-2018.eth0.phone.detections"
+
+# Kwikset door lock
+device = "kwikset-doorlock/self-test"
+fileExperiment = "kwikset-doorlock-nov-10-2018.timestamps"
+fileDetection = "phone-side-detection"
+#device = "kwikset-doorlock/timestamps"
+#fileExperiment = "kwikset-doorlock-smarthome-nov-10-2018.timestamps"
+#fileDetection = "kwikset-doorlock-smarthome-nov-10-2018.eth0.phone.detections"
+
# Arlo camera
#device = "arlo-camera/self-test"
#fileExperiment = "arlo-camera-aug-10-2018.timestamps"
#fileExperiment = "blossom-sprinkler-aug-13-2018.timestamps"
#fileDetection = "detection-on-training-device-side"
# Nest thermostat
-device = "nest-thermostat/self-test"
-fileExperiment = "nest-aug-15-2018.timestamps"
-fileDetection = "detection-on-training-phone-side"
+#device = "nest-thermostat/self-test"
+#fileExperiment = "nest-aug-15-2018.timestamps"
+#fileDetection = "detection-on-training-phone-side"
# Hue bulb
#device = "hue-bulb/self-test"
#fileExperiment = "hue-bulb-aug-7-2018.timestamps"