|
@@ -659,18 +659,20 @@ public class MenuBarNetworkExamples extends JMenu{
|
|
|
|
|
|
System.out.println("Check 3: created Controller");//TODO
|
|
|
|
|
|
+ long hour = 60 * 60 * 1000;
|
|
|
/*
|
|
|
- * Simulate 150000 ms (2 1/2 minutes)
|
|
|
+ * Simulate 24 hours
|
|
|
*/
|
|
|
SimulationController sim = controller.getSimulationController();
|
|
|
sim.setStartTime(0);
|
|
|
sim.resetSimulation();
|
|
|
- sim.setStepDuration(15000);
|
|
|
+ sim.setStepDuration(hour);
|
|
|
sim.setPrintPackets(false);
|
|
|
- sim.setEndTime(150000);
|
|
|
+ sim.setEndTime(24*hour);
|
|
|
|
|
|
- for(int i=0; i<10; i++)
|
|
|
- sim.getSimulationManager().simulateTimeIntervall(15000*i, 15000);
|
|
|
+
|
|
|
+ for(int i=0; i<24; i++)
|
|
|
+ sim.getSimulationManager().simulateTimeIntervall(i*hour, hour);
|
|
|
|
|
|
collectorKNN.setMode(true);
|
|
|
//collectorEM.setMode(true);
|
|
@@ -679,27 +681,50 @@ public class MenuBarNetworkExamples extends JMenu{
|
|
|
System.out.println("Check 4: Trained");//TODO
|
|
|
|
|
|
/*
|
|
|
- * Simulate/Test 30000 without anomalies
|
|
|
+ * Simulate/Test 1 hour without anomalies
|
|
|
*/
|
|
|
|
|
|
- for(int i=10; i<12; i++)
|
|
|
- sim.getSimulationManager().simulateTimeIntervall(15000*i, 15000);
|
|
|
+ for(int i=24; i<25; i++)
|
|
|
+ sim.getSimulationManager().simulateTimeIntervall(hour*i, hour);
|
|
|
System.out.println("Check 5: tested w/0 anomalies");//TODO
|
|
|
|
|
|
/**
|
|
|
- * Insert anomaly & Simulate further packets
|
|
|
+ * Value Anomaly 1h
|
|
|
*/
|
|
|
- Connection ddos = anomalyController.openDDosCreationMenu(broker, new LinkedList<SmartDevice>(zigbee.getDevices()));
|
|
|
- Connection dos = anomalyController.runDosAttack(kitchenLight, kitchenFridge);
|
|
|
+ System.out.println("Value Anomalies:");
|
|
|
+ float min = kitchenFridge.getFSmin();
|
|
|
+ float max = kitchenFridge.getFSmax();
|
|
|
+ float val = kitchenFridge.getFSval();
|
|
|
+ kitchenFridge.setFSmin(18);
|
|
|
+ kitchenFridge.setFSval(18);
|
|
|
+ kitchenFridge.setFSmax(30);
|
|
|
+ kitchenFridge.setLabel((short)1);
|
|
|
+ for(int i=25; i<26; i++)
|
|
|
+ sim.getSimulationManager().simulateTimeIntervall(hour*i, hour);
|
|
|
+ kitchenFridge.setFSmin(min);
|
|
|
+ kitchenFridge.setFSmax(max);
|
|
|
+ kitchenFridge.setFSval(val);
|
|
|
+ kitchenFridge.setLabel((short)0);
|
|
|
+
|
|
|
+ System.out.println("DDoS:");
|
|
|
/**
|
|
|
- * Start Testing another 30000
|
|
|
+ * 1 hour DDoS
|
|
|
*/
|
|
|
- sim.setEndTime(210000);
|
|
|
+ Connection ddos = anomalyController.openDDosCreationMenu(broker, new LinkedList<SmartDevice>(zigbee.getDevices()));
|
|
|
+ for(int i=26; i<27; i++)
|
|
|
+ sim.getSimulationManager().simulateTimeIntervall(hour*i, hour);
|
|
|
+ networkController.deleteConnection(ddos);
|
|
|
|
|
|
+ System.out.println("DoS:");
|
|
|
+ /**
|
|
|
+ * 1 hour DoS
|
|
|
+ */
|
|
|
+ Connection dos = anomalyController.runDosAttack(kitchenLight, kitchenFridge);
|
|
|
+ for(int i=27; i<28; i++)
|
|
|
+ sim.getSimulationManager().simulateTimeIntervall(hour*i, hour);
|
|
|
+ networkController.addConnection(dos);
|
|
|
+
|
|
|
|
|
|
- for(int i=12; i<14; i++)
|
|
|
- sim.getSimulationManager().simulateTimeIntervall(15000*i, 15000);
|
|
|
-
|
|
|
|
|
|
System.out.println("Check 6: Tested w anomalies");//TODO
|
|
|
|