# Reliable Link Level Routing Algorithm in Pipeline Monitoring Using Implicit Acknowledgements
## 4 Energy and Transmission Time Analysis
### End-to-End Transmission Time  
It is important to know how much time is necessary to transmit information from a sensor to the control station. We can approximate the end-to-end delay by the sum of the time between the arrival of information at a node \(v_{i}\) and the arrival at the \(v_{i+2}\) node [46]. In this scenario the information (alerts) is just transmitted using a single frame, and the probability that other nodes that are part of the lineal infrastructure generate alarms at the same time is very low. Therefore, this simplification will be realistic in many situations. Then, it is necessary to determine the time to transmit a frame when using explicit ACK, Equation (1), or implicit ACK, Equation (2):  
\[de(x)=T_{BO}+T_{CCA}+T_{fra}(x)+T_{TA}+T_{ACK}+T_{IFS}+\tau \tag{1}\]  
\[de(x)=T_{fra}(x)+T_{IFS}+T_{TA}+T_{BO}+T_{CCA}+\tau \tag{2}\]  
where \(x\) represents the number of bytes that have been received from the upper layer, \(T_{BO}\) is the back off period, \(T_{CCA}\) means Clear Channel Assessment time, \(T_{fra}(x)\) is Transmission time for a payload of \(x\) byte, \(T_{TA}\) is Turnaround time from TX to RX, \(T_{ACK}\) is Transmission time for an ACK, \(T_{IFS}\) (Interframe Space time) is the Frame Processing time, \(\tau\) is Propagation delay. The back off period is calculated as the product of the number of back off slots and the time for each slot (20 symbols or 320 \(\upmu\)s). The number of back off slots is a random number uniformly in the interval (0, 2\({}^{\text{BE}}-1\)), with BE the back off exponent which has a minimum of 3. As we only assume one sender and a Bit Error Rate (BER) of zero, the BE value will not change. Hence, the number of back off slots can be represented as the mean of the interval: (2, 2\({}^{3}-1\)) or 3.5. Regarding IFS, Short IFS (SIFS) is used when the Media Access Control Protocol Data Unit (MPDU) is smaller than or equal to 18 bytes (192 \(\upmu\)s). Otherwise, Long IFS (LIFS) is used (640 \(\upmu\)s). Then, the transmission time of a frame with a payload of \(x\) bytes can be formulated as:  
\[T_{fra}(x)=8\left(L_{phy}\ +L_{MACHDR}\ L_{address}\ +x+L_{MACFTR}\right)/\ R_{data} \tag{3}\]  
where \(L_{phy}\) is the Length of the PHY and synchronization header in bytes (6 bytes), \(L_{MACHDR}\) is Length of the MAC header in bytes (3 bytes), \(L_{address}\) is the length of the MAC address info field, \(L_{MACFTR}\) is the length of the MAC footer in bytes (2 bytes), and \(R_{data}\) is the raw data rate (250 kbps). The transmission time for an acknowledgment can be formulated as:  
\[T_{ACK}=\left(L_{phy}+L_{MACHDR}+L_{MACFTR}\right)/\ R_{data} \tag{4}\]  
So, in summary, the delay can be expressed as:  
\[de(x)=a(x)+b \tag{5}\]  
In Equation (5), \(a\) and \(b\) depend on the length of the data bytes (SIFS or LIFS) and the length of the address used (64 bit, 16 bit, or no addresses). Then, the delay in the communication between a node and the edge node is a linear function of the number of bytes in the payload and the number of nodes. The MPDU is set to a maximum of 127 bytes, but the maximum number of payload bits depends on the usage of short or long addresses. Figure 13 shows the time required by the RXN node to retransmit a message, and the time required by TXN to send a second frame using eACK and iACK, B0 = 3 and short addresses scheme. The results indicate that in the different scenarios the delay is lower when iACK is used. With a payload of 114 bytes and eACK, the delay in RXN is 5.88 ms while with iACK it is 5.53 ms. With a 12-byte payload and eACK, the delay is 2.62 ms and with iACK it is 2.27 ms. Thus, delays increase with payload length, but they are always lower with iACK. Figure 14 shows how the delay decreases with the use of iACK instead of eACK, in percentages that depend on the payload, the length of the node's address and the mode of operation of the node, TXN or RXN. The delay reduction by using iACK is higher in the TXN node. In RXN, the percentage is smaller when the payload decreases.