## 3 EQPD-MAC Protocol Development
### Energy Model  
The energy model is described in this subsection. The energy expended when a node switches from receiving to transmitting mode or vice versa, is called the switching energy. Hence it is given by:  
\[E_{\mathit{Switching}}=P_{\mathit{Switching}}\times T_{\mathit{Switching}} \tag{2}\]  
where \(P_{\mathit{Switching}}\) and \(T_{\mathit{Switching}}\) denote the power consumption and the amount of time it takes a node to do the switching, respectively.  
In order to ensure that the channel is clear of other transmissions, each node inspects it before transmitting. Listening energy refers to the energy used to examine the channel. In listening mode, the radio is operational but does not receive or transmit any packets.  
\[E_{\mathit{Listening}}=P_{\mathit{Listening}}\times T_{\mathit{Listening}} \tag{3}\]  
where \(P_{\mathit{Listening}}\) and \(T_{\mathit{Listening}}\) denote the power consumption and the amount of time it spent listening to the channel, respectively.  
When a node sends a Tx beacon or receives an Rx beacon, the amount of energy consumed is given by:  
\[E_{\mathit{Beacon}}=P_{\mathit{Bacon}}\times T_{\mathit{Beacon}} \tag{4}\]  
where \(P_{\mathit{Beacon}}\) and \(T_{\mathit{Beacon}}\) denote the power consumption and the amount of time it takes to send or receive a beacon, respectively.  
Figure 6: Multi-hop Topology.  
Transmission energy is dependent on the distance travelled and the amount of interference encountered. Packets are exchanged between the nodes in this situation, either by transmitting or forwarding them by the other nodes. Total energy consumed during each packet transmission is given by:  
\[E_{TX}=\ L_{P\!H}\times P_{TX}\times T_{TX} \tag{5}\]  
where \(L_{P\!H}\), \(P_{TX}\) and \(T_{TX}\) denote length of each packet in bytes, the power consumption, and the amount of time it takes a node to do a transmission, respectively.  
When a node receives packets, it expends energy in the same way as when it transmits.  
\[E_{RX}=\ L_{P\!H}\times P_{RX}\times T_{RX} \tag{6}\]  
where \(L_{P\!H}\), \(P_{RX}\) and \(T_{RX}\) denote length of each packet in bytes, the power consumption, and the amount of time it takes to receive a packet, respectively.  
Furthermore, the amount of energy wasted by the nodes when they switch off after the node goes to sleep state is also given by:  
\[E_{Sleep}=P_{Sleep}\times T_{Sleep} \tag{7}\]  
where \(P_{Sleep}\) and \(T_{Sleep}\) denote the power consumption and the amount of time it takes to go into the sleep state, respectively.  
As a result, the overall energy consumption \(E_{T}\) can be calculated by adding up the energy used and is given by:  
\[E_{T}=\sum_{i=0}^{n}P_{i}\times T_{i} \tag{8}\]  
Assuming that there are \(n\) states, \(i\) is the number of the particular state in which the radio is on, and \(P\) is its power consumption rate, \(T\) is the amount of time spent in each state \(i\) etc.  
The equations show that the time spent in each state affects energy usage. As the time spent in each stage increases, the energy consumption will increase. In other words, if the sensor nodes can process packets more quickly, the energy consumption can be reduced. Additionally, the nodes save energy during idle states by extending the sleeping duration through adaptive active/sleep time. EQPD-MAC dynamically changes the amount of time spent listening and sleeping in order to reduce energy usage.