Indian Journal of Science and Technology, Vol 9(20), DOI: 10.17485/ijst/2016/v9i20/92603, May 2016 ISSN (Print) : 0974-6846 ISSN (Online) : 0974-5645 Performance Evaluation of CoAP and UDP using NS-2 for Fire Alarm System M. Divya*, D. Shruthi and Ratnamala Korlepara Department of Computer Science and Engineering, Amrita School of Engineering, Amrita Vishwa Vidyapeetham Amrita University, Coimbatore 641112, Tamil Nadu, India; m_divya@cb.amrita.edu, shruthitup@gmail.com, ratna1994@gmail.com Abstract Objective: In this work, we measure the performance metrics for the combination of Constrained Application Protocol (CoAP) and User Datagram Protocol (UDP) protocols. Method: In this work, number of nodes is changed to check the performance of CoAP and UDP and ns-2 simulator is used to simulate Fire Alarm System. Findings: Throughput values are high for multiple servers compared to single server and the values increase with the number of nodes. It is helpful in saving a person s life and prevents property loss when there is a fire accident since the packets are processed at a faster rate. Overhead, delay and packet loss values are less for multiple servers compared to single server which is an advantage but the values increase when the number of nodes increase which is disadvantageous in case of fire accidents as the packets might not reach on time or it might be lost during transmission. For single server, the values for overhead, delay and packet loss kept fluctuating for different number of nodes. Novelty: CoAP protocol implementation in ns-2 and comparison of performance for single server and multiple servers. Keywords: CoAP, Fire Alarm System, NS-2, Performance Metrics, UDP, WSN 1. Introduction The use of Internet of Things (IoT) 1 for emerging networking applications like Smart City, Smart Health Care, and Smart Energy Management system is of high importance. IoT involves communication between many devices with constrained resources which are readable, locatable, and recognizable via the internet. In some sensitive applications like Fire Alarm System IoT plays a very important role. At present times, fire accidents claim a million lives every year. Securing human life and property against such accidents have become so crucial these days. Monitoring all the residential areas is an effective method to reduce personal and property losses that are caused due to fire disasters. Automatic fire alarm systems with several fire detectors are deployed in those sites. Wireless Sensor Network has been deployed efficiently as mentioned in 2 for health monitoring, environmental monitoring and industrial monitoring systems because they provide low cost solutions. Fire Alarm system hence uses WSN as mentioned in 3,4 for communication between the nodes because a network without any infrastructure reduces wiring costs and also it consists of small-sized, low power and low-cost devices that are integrated with limited computation. Evacuation cannot be efficiently finished if the necessary information about a fire outbreak is not collected on time. Environment is monitored for timely evacuation with the help of sensors having wireless connectivity and processing capability to collect information faster and assist in environmental protection. These sensors transfer temperature information to the servers to detect fire. Internet enabled wireless sensor networks can be realized by adapting those protocols suitable for the application. Transmission of sensor data requires a protocol with less bandwidth and energy. CoAP is used to address the intense requirements of these real world constrained networks. In addition, most of the applications today require multicast and asynchronous communication compared to the unicast and synchronous approach. CoAP is based on Representational State Transfer (REST) archi- *Author for correspondence
Performance Evaluation of CoAP and UDP using NS-2 for Fire Alarm System tecture where every resource is uniquely addressed using a set of commands like GET, PUT, POST and DELETE. The main objective of the project is to study the performance of CoAP and UDP for the given scenarios in Fire Alarm System application. Performance metrics like throughput, overhead and delay overhead, throughput, packet loss and delay are calculated for the application and transport layer protocols and the results are analyzed as mentioned in 5,6. The analysis is based on how the system works when there is a single server and when we have multiple servers. 2. Application and Transport Layer Protocols (CoAP and UDP) 2.1 Constrained Application Layer Protocol (CoAP) IoT network consists of millions of nodes most of which are resource constrained. CoAP is a recently developed Application Layer protocol that is intended to operate in such constrained networks. It is deployed highly in most of the current industrial projects. It is based on Representational State Transfer (REST) architecture which is a style of architecture that helps in addressing each resource uniquely by using set of commands like GET, PUT, POST and DELETE. It also provides energy-efficiency and bandwidth-efficiency in packet transmission. CoAP has four message types namely, Confirmable (CON), Non- Confirmable (NON), Acknowledgement (ACK) and Reset (RST) as mentioned in Figure 1. CoAP uses two message types, request and response, by making use of a simple binary base header format. CoAP also has some additional functionality when compared to HTTP which makes it suitable for Machine-to-Machine (M2M) applications. 2.2 User Datagram Protocol CoAP uses UDP as the transport layer protocol which is a connectionless protocol. UDP helps in transmitting messages to many nodes with high speed. The unreliability of UDP is compromised by providing the CoAP with retransmission mechanism to avoid high packet loss. UDP allows communications to take place without the Figure 1. CoAP protocol interaction. establishment of connection. Hence UDP is much faster when compared to TCP. 3. System Design The evaluation of the performance metrics of CoAP and UDP are done for the following two scenarios for a residential building. Single server: In this scenario, a single server will be used for the entire building and all the nodes will send packets to the main server. This server will check if the temperature or carbon monoxide values are greater than the threshold value. If values are high, the server will send a fire alarm message. Multiple servers: In this scenario, multiple servers are used for the building and the nodes send the packets to the server which is nearer to them. Then the server will check if the temperature or carbon monoxide values are greater than the threshold value. If values are high, the server will send a fire alarm message. These two scenarios are simulated using Network Simulator-2 (ns-2) 7. It is an open source simulator used for the simulation of network protocols. It is also capable of simulating wired as well as wireless networks. In ns-2, complex scenarios can be easily tested and results can be quickly obtained which in turn helps in testing more ideas in a smaller time frame. It also has better CPU utilization compared to other simulators. 2 Vol 9 (20) May 2016 www.indjst.org Indian Journal of Science and Technology
M. Divya, D. Shruthi and Ratnamala Korlepara 4. Simulation of Fire Alarm System When there is a single server, the decision for the temperature information transmitted is made only by that single main server. Each sensor node will search for the closest neighbouring node and will route the packet accordingly. In the multiple servers scenario, each floor has a server located locally to take the decisions for all the temperature information received in its range. These local servers cache the information received from the clients so that the main server can directly retrieve the data of a particular client from the local server itself. When a client does not find any local server in its range it will send the data to the neighbouring node which will then send it to the local server available. Once the servers receive the temperature information from the sensor nodes it is processed. If the temperature value is greater than the threshold value then a fire alarm is displayed, else the packet is dropped. The CoAP protocol features 8 are implemented using C language and Tool Command Language (TCL) scripts are written to simulate the topology for single server and multiple servers as shown in Figure 2a and Figure 2b respectively. From the trace file obtained after simulating, performance metrics are calculated. For both single server and multiple server scenarios, the number of nodes is varied from 20 to 100 and the protocols are tested against scalability. For each of the varied number of nodes all the above mentioned performance metrics were measured. 5. Performance Evaluation and Simulation Results In this section, we compare the performance of Fire Alarm System through simulation experiments with different network scenes. The performance is evaluated by means of dynamic simulations with the help of the Network Simulator NS-2. The simulation setup is described first and then the performance metrics are defined. Finally, the simulation results are depicted using graphs. 5.1 Simulation Set-up Simulations have shown that CoAP and UDP protocol can be considered reliable. In our experiment, network with as specified number of nodes are randomly distributed in an area of 500 500. IEEE 802.11 MAC protocol is used in the network. The number of nodes is varied as 20,40,60,80 and 100. The nodes are placed randomly in the specified area. Table 1 summarizes the simulation parameters used. 5.2 Performance Metrics The performance of the Fire Alarm system is analysed for the following scenarios. Several client nodes with single server Several client nodes with multiple servers Figure 2. servers. Network topology of single server and multiple Table 1. Simulation parameters Maximum Simulation Time 200 Sec Application Layer CoAP Transport Layer UDP outing protocol AODV Mac protocol 802.11 No of nodes 20,40,60,80,100 Nodes Placement Random Distribution Vol 9 (20) May 2016 www.indjst.org Indian Journal of Science and Technology 3
Performance Evaluation of CoAP and UDP using NS-2 for Fire Alarm System These scenarios are simulated and the performance metrics are obtained from the graph. The following metrics are considered for the analysis of the performance of CoAP and UDP for various scenarios. 5.2.1 Overhead The extra bandwidth, memory and resources required to transmit a packet efficiently. Overhead is considered for analysis as multiple servers might require additional resources in Fire Alarm System. 5.2.2 Throughput It is the ratio of the number of packets that are successfully delivered to the main server to the number of packets sent by client node. Throughput is considered for analysis to check which scenario successfully delivers most of the packets to the server since it is necessary to receive fire alarm message early due to any fire accident. 5.2.3 Packet Loss It is the percentage of number of packets lost over the network during transmission to the number of packets sent. Packet loss is considered for analysis to check if multiple servers result in more packet loss or single server. According to the values for packet loss for both scenarios, the scenario with better performance or less packet loss can be chosen for Fire Alarm System. 5.2.4 Delay The delay of a network specifies the time taken for a bit of data to reach the destination from the source node. Delay of packets varies for different scenarios. Therefore, it is considered for analysis to check if multiple servers result in more delay or less and how it affects the Fire Alarm System. 5.3 Simulation Results The simulation results show the comparison of performance of Fire Alarm System when Single and Multiple Servers are used for different number of nodes. For single server and multiple servers used in a building, the graphs for overhead are given in Figure 3a and Figure 3b respectively. Figure 3 depicts that when multiple servers were used, the overhead value increased as the number of nodes were increased. When single server was used, the values kept fluctuating. When multiple server values were compared Figure 3. Overhead for single server and multiple servers. to single server, the overheads were mostly high for single server. For Single and multiple servers used in a building, the graphs for throughput are given in Figure 4a and Figure 4b respectively. Figure 4 depicts that when multiple servers were used, throughput was high compared to using single server. When multiple servers were used, increasing the number of nodes did not affect the throughput since multiple servers were available to take decisions locally. For single server and multiple servers used in a building, the graphs for packet loss are given in Figure 5a and Figure 5b respectively. Figure 5 depicts that when multiple servers were used, packet loss increases as the number of nodes were 4 Vol 9 (20) May 2016 www.indjst.org Indian Journal of Science and Technology
M. Divya, D. Shruthi and Ratnamala Korlepara Figure 5. Packet loss for single server and multiple servers. Figure 4. Throughput for single server and multiple servers. Figure 6. Delay for single server and multiple servers. Vol 9 (20) May 2016 www.indjst.org Indian Journal of Science and Technology 5
Performance Evaluation of CoAP and UDP using NS-2 for Fire Alarm System increased. But the values were lesser when compared to the number of packets lost when single server was used. For single server and multiple servers used in a building, the graphs for delay are given in Figure 6a and Figure 6b respectively. Figure 6 depicts that when multiple servers were used, delay values were lesser but closer to the values obtained when single server was used. But when the number of nodes was increased for multiple servers, delay increased which is a disadvantage while having more transmissions. 6. Conclusion We conclude that usage of multiple servers give better results compared to single server. Single server is not the best choice in case of fire emergency as the values for the performance metrics fluctuate and are high compared to multiple servers. In the future work, high packet loss which occurs in multiple servers due to the increase in the number of nodes can be reduced by discovering multiple paths from the source node to the server and it can be stored in a candidate set. If a particular path fails in transmitting the packet, then an alternative reliable path can be chosen from the set to transmit the packet. Also the end-to-end delay can be reduced by using mobile nodes instead of static nodes, where the nodes move from left to right direction and the delay is reduced if the speed of the mobile node is increased. 7. References 1. Velusamy K, Venkitaramanan D, Vasudevan SK, Periasamy P, Arumugam B. Internet of things in cloud. Journal of Engineering and Applied Sciences. 2013; 8(9):304 13. 2. Salehian S, Shamshiri R. A survey on mobility management protocols in wireless sensor network-internet protocol. Indian Journal of Science and Technology. 2015 June; 8(11):1 8. DOI: 10.17485/ijst/2015/v8i11/71774. 3. Zhang L, Wang G. Design and implementation of automatic fire evacuation system based on wireless sensor networks. 2009 International Symposium on Information Processing (ISIP 09); Huangshan: P. R. China. ISIP; 2009 August 21 23. p. 410 13. 4. Alkhatib AAA. Smart and low cost technique for forest fire detection using wireless sensor network. International Journal of Computer Applications. 2013 November; 81:12. 5. Radoi IE, Shenoy A, Arvind DK. Evaluation of routing protocols for internet-enabled wireless sensor networks. ICWMC 2012: The Eighth International Conference on Wireless and Mobile Communications; 2012. 6. Olempia KJ, Pandeeswaran C, Natarajan P. A survey on energy efficient contention based and hybrid MAC protocols for wireless sensor networks. Indian Journal of Science and Technology. 2016 Mar; 9(12):1 10. DOI: 10.17485/ ijst/2016/v9i12/89932. 7. Weing artner E, vom Lehn H, Wehrle K. a performance comparison of recent network simulators. 2009 IEEE International Conference on Communications, Dresden; 2009 June 14 18. p. 1 5. 8. Shelvy Z, Hartke K, Frank B. Constrained Application Protocol (CoAP) draft-ietf-core-coap-08. Core Working Group; 2011. p. 1 88. 6 Vol 9 (20) May 2016 www.indjst.org Indian Journal of Science and Technology