## 4 Proposed Metrics
### Results and Discussion of the Proposed Metrics
#### 4.2.1 MAC Layer Metrics  
MAC layer metrics reflect channel occupancy and throughput, which are parameters that have a direct impact on the use of bandwidth and the availability of the nodes to send and receive packets. Furthermore, the number of collisions in a network is a parameter that is reflected in the number of packet retransmissions, which gives an indication of interference in the channel, malfunctioning nodes or attacks. Retransmissions and CSMA/CA Retries  
As said before, the MAC layer protocol implemented for the three protocols studied here is non-persistent CSMA/CA. Regarding the retransmissions, the MAC layer protocol implemented has a maximum of three retransmissions for each packet. If a packet has more than three collisions, the node will not replicate the packet anymore and the packet will be dropped. Therefore, when the average number of retransmissions is very close to three, this means that the channel is heavily congested, and therefore, there are many collisions. Before transmitting a packet, the CSMA/CA algorithm calculates a delay of \(\left(2^{BE}-1\right)\) backoff units, where \(BE\) is the backoff exponent, and the node waits for this delay. Then, the node performs the clear channel assessment (CCA) to listen to the channel. If the channel is free, the node transmits; if the channel is busy, the node increments the value of \(NB\) by one, where \(NB\) is the number of times the CSMA/CA algorithm was required to backoff in its attempt to transmit (\(NB\) starts at zero) and applies Equation (2):  
\[BE=min(BE+1,macMaxBE) \tag{2}\]  
where \(macMaxBE\) is the maximum value of the backoff exponent, which for the CSMA/CA standard is five. Subsequently, if:  
\[NB>macMaxCSMABackoffs \tag{3}\]  
is true, the packet is dropped. If it is false, the algorithm recalculates the delay again. Here, \(macMaxCSMABackoffs\) is the maximum number of backoffs that the CSMA/CA algorithm will attempt before dropping the packet [33]. Therefore, when the average number of CSMA/CA retries is very close to five, this means that the channel is constantly busy and nodes should wait longer to transmit. This metric directly influences the network delay. Figure 11 displays the average node retransmissions and the average CSMA/CA retries for the four studied protocols. Here, we remark that for the four protocols, initially, there are many retransmissions and CSMA/CA retries. This is so because when the nodes connect to the network, they begin by sending broadcast packets to discover neighbors, so there is a greater number of packets in the network: overhead and traffic packets produce more collisions. Note that in the retransmissions, during the first 10 s, the four protocols increase their average (the line has the highest peak of the graph). This is because of the amount of packets flowing in the network during the time of the formation of the topology. The CSMA retries also show this peak, because as the channel is constantly busy, the CSMA retries increase. However, regarding retransmissions, it is important to mention that this first peak has an average value of 2.7 for AODV and DSR, 2.6 for ZTR and 2.5 for MPH. Concerning also the first peak, the CSMA retry metric has an average value of 3.6 for AODV, 3.5 for DSR and ZTR and 3.3 for MPH. During the following 60 s, the protocols maintain a stability period. Regarding retransmissions, this period has an average of 1.98 for AODV, 1.93 for DSR, 2.1 for ZTR and 1.7 for MPH. As regards CSMA retries, this period has an average of 2.3 for AODV, 2.2 for DSR, 2.4 for ZTR and 1.7 for MPH. Note that after approximately 60 s, the AODV and DSR protocols increase retransmissions and CSMA/CA retries again; this is possibly due to the onset of expired routes and routes that are no longer valid. Consequently, nodes must re-learn some routes, and the overhead increases again.