## 4 Performance Metrics Study  
Metrics of the network layer are fundamental because they show the performance and usefulness of a routing protocol. Each routing protocol is designed for specific applications and certain scenarios. These metrics indicate how the bandwidth use is affected by the overhead of the routing protocol in use. In addition, the availability of effective routes and the ability of the network for self-configuration show the capacity of the protocol to recover from topology changes [40]. Recovery times have an impact on the latency in the network, and even though the networks conform with different technologies, it is highly essential to understand and evaluate the performance metrics as shown in [41]. This analysis allows network customization to improve its different aspects and provide better communication. Therefore, using these metrics the proactive and reactive protocols can be compared. To perform such comparison a simulated and a real scenario were implemented. The next section describes the simulation. Figure 2 describes performance metrics in a general way. The measurement and control of these performance parameters provide the network optimization because some parameters influence others, allowing the information in a wireless network to be delivered reliably. Sensor networks usually have similarities, so it is necessary to know some comparison criteria that allow us to decide which of them is the most suitable to implement and thus, solve our problems. The most important and useful metrics for comparing sensor networks are the following:  
* _Response time:_ The speed at which the data packets are sent among the different nodes. * _Network lifetime:_ The durability and resistance of the devices and, in general, of the network, must be considered if a budget is allocated or limited or both. * _Security:_ Security is vital in any field, but, in wireless networks, it is complicated to secure information. However, it is relevant to assess the risks or vulnerabilities that the network may experience. * _Types of data that can be transmitted:_ Wireless technologies such as WiFi or ZigBee, do not transmit the same types of data. It is important to select and analyze the data that it is desired to send to choose the most appropriate one. Packets that carry the information in the network are traffic packets, while the control packets are those used by the routing protocol to establish the network rules. These control packages constitute the overhead of the network, so if a network has a high overhead, there will be a higher probability of collisions. * _Battery life:_ One of the main issues in sensor networks is the energy required by the components of the masses. The life of the batteries is expected to be extended by using the application of a sleep technique to the nodes of the system. * _Packet retransmission:_ In WSNs a sensor node may need to transmit a packet multiple times to ensure delivery. This may be due to packets which have been either damaged or lost and needs to be resending or just for forwarding packets to other nodes. The indiscriminate use of packet retransmission has a negative impact on battery life. * _Resilience:_ It is the network ability to face faults or changes in its normal operation maintaining an acceptable level of service. * _Complexity and cost:_ The complexity represented by the installation of the sensor network is considered one of the most important criteria. From this, the cost can be derived, this being an agent of great relief in any project. * _Listening to the channel retries:_ According to each data link layer algorithm, the nodes listen to the channel before transmitting to know if there are collisions. After a specific number of attempts, the packet is dropped. If the number of listening tries is high, it means that the channel has high interference. Figure 2: General performance metrics. * _Packet loss:_ It occurs when information packets do not arrive in the expected way. Some of the causes can be damaged hardware.