# Security Framework for IoT Based Real-Time Health Applications
## 5 Evaluation and Implementation
#### Results of Contiki Coaja Simulation  
For the real-time simulation, we have used the Contiki operating system 2.7 with a Cooja simulation environment as shown in Figure 6, which provides the results of different framework modules using different parameters. These parameters help judge the secure packet transmission, time to live (TTL) maximum time, and minimum time using CoAP in a real-time e-health environment from the sensor layer to the network layer. CoAP works in a client-server environment. To support CoAP in Cooja, a Copper extension is used and operated on Mozilla Firefox. CoAP also supports GET, PUT, POST, and DELETE methods [50; 51] as the sensor devices are limited in power, processing, and memory. This works under the 6 LoWPAN network: a border router is used to connect a regular IP with the RPL 6 LoWPAN network. In the Contiki-Cooja simulation environment, the border router is present at the edge of the border of a network. The border router is also working as a gateway to connect two different networks: one is a wireless sensor network, and the other is Wi-Fi, Bluetooth, etc. When conducting tests for Cooja, two main points we need to concentrate on are:  
* Border router, which allows access to the internet.
* Web-server, which gives internet access to the border router. Through the following steps, the Cooja simulation for a border router is done.  
The following are the steps to create the sky motes (shown in Figure 6) as a client and server:  
* For creating the server mote: Go to motes > Create mote > Select the mote type > Browse > Go to example folder > Select IPV6 > Rpl-border router > Border-router.c > Open > Compile > Create > Add motes > Add only 1 mote to make it server > View > Select the interfaces for the network.  
Figure 6: Deep client and server communication using sky mote.  
After creating the server more, more one goes to the more connectivity of all the client motes. By default, client motes are always active to communicate with each other, but they wait for the connection response from the CoAP server. The following Figure 7 shows the process of getting the IPV6 address from the server. After getting the IPV6 connection, we can communicate securely via a Copper extension for the CoAP in Mozilla Firefox.  
After getting the IPV6 of the server, it enables us to communicate successfully using the IDs of client motes and server motes. These mote IDs are used to show the neighboring and connecting routes, which can be seen in Figure 8. Moreover, the paths in which these packets are moving can be detected.  
Figure 8: Neighbors and routes of the client mote.  
Figure 7: Server IPv6 address.  
The following Figure 9 shows the ping statistic for more four having ID aaaa::212:7404:4:404. The statistics show that we have selected five packets to transmit over the network through the border router working on the motes' edge. All the packets are transmitted towards the receiving end, and the given transmission shows zero packet loss. Hence, we can say that the packets are securely and successfully transmitted.  
Figure 9 shows that our developed security framework for the real-time health monitoring system's privacy is implemented in the Contiki-Cooja simulation environment. Thus, to prove the results, we have implemented one module of the framework; this module covers the network layer.  
The network layer covers how the devices are interconnected and communicating in the end-to-end secure environment successfully. Furthermore, the rest of the framework can also be implemented by using a simulation environment in the future. Our results ensure that the framework is successfully running and can be deployed quickly in the future.