# Improving Energy Efficiency in LoRaWAN Networks with Multiple Gateways
## 3 LoRa and LoRaWAN Overview
The symbol duration can be expressed according to the following formula [2]:  
\[T_{sym}=\dfrac{2^{SF}}{BW} \tag{1}\]  
Thus, the symbol rate \(R_{s}\) (symbols/s) can be deduced as follows:  
\[R_{s}=\dfrac{1}{T_{sym}}=\dfrac{BW}{2^{SF}} \tag{2}\]  
Having a code rate \(CR\), we can express the data rate (\(R_{b}\)) in bits/s as follows [20]:  
\[R_{b}=SF\times\dfrac{BW}{2^{SF}}\times\dfrac{4}{4+CR} \tag{3}\] \begin{table}
\begin{tabular}{c c c c} \hline \hline
**SF** & **Data Rate [kbps]** & **Sensitivity [dBm]** & **Required SNR [dB]** \\ \hline
7 & 5.458 & \(-123\) & \(-7.5\) \\
8 & 3.125 & \(-126\) & \(-10\) \\
9 & 1.757 & \(-129\) & \(-12.5\) \\
10 & 0.976 & \(-132\) & \(-15\) \\
11 & 0.537 & \(-134.5\) & \(-17.5\) \\
12 & 0.293 & \(-137\) & \(-20\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Data rate, sensitivity and SNR thresholds of different SFs for the 868 MHz band, bandwidth 125 kHz, coding rate 4/5 [21]. The frame structure at the physical layer comprises a preamble, an optional header, and the data payload, as shown in Figure 1. The preamble allows the receiver to be synchronized with the transmitter. The preamble contains a number of \(n_{preamble}\) up chirp symbols with 4.25 LoRa symbols as frame delimiters for synchronization. As a result, the preamble length is equal to (\(n_{preamble}+4.25\)) symbols. Thus, the preamble duration can be expressed as follows:  
\[T_{preamble}=(n_{preamble}+4.25)\times T_{sym} \tag{4}\]  
Because the preamble size scales with SF and there is no single preamble for all SFs, the transmitter and receiver must know the SF in advance in order to detect the preamble. There is an optional PHY header following the preamble. This header is transmitted with the highest code rate of 4/8 when it is present. The remaining portion of the frame is encoded using the code rate specified in the PHY header. The payload is sent after the header. The maximum payload size is defined for each region in the LoRaWAN Regional Parameters [4]. For the EU863-870 MHz band, the maximum payload size varies between 51 bytes for the slowest data rate (SF 12, BW 125 kHz) and 222 bytes for the faster rate (SF 7, BW 125 kHz). There is an optional payload CRC at the end of the frame. The number of symbols \(n_{payload}\) that comprise the header and the packet payload is calculated with Equation (5). We denote by \(PL\) the size of the payload in bytes; \(H\) is equal to 0 when the header is enabled and 1 otherwise; and \(DE=1\) if low-data-rate optimization is enabled (\(SF\geq 11\)), and 0 otherwise [2]. \[n_{payload}=8+max\bigg{(}ceil\bigg{(}\frac{8 PL-4 SF+28+16-20H}{4(SF-2 DE)}\bigg{)}( CR+4),0\bigg{)} \tag{5}\]  
Then, we can deduce the payload duration as follows:  
\[T_{payload}=n_{payload}\cdot T_{sym} \tag{6}\]  
The time on air (ToA) of a LoRa transmission is computed according to the payload size and depends on several parameters: SF, BW, and CR. These parameters can cause significant variation in the transmission time. The time on air is simply obtained as the sum of the preamble and payload duration: for a given payload size, and at a given BW and coding rate, we denote by \(ToA(s)\) the time to transmit a packet at SF \(s\). Table 3 presents the ToA configuration assuming a 125 kHz bandwidth and a coding rate of 4/5. It can be seen that the ToA increases when the SF is incremented. On top of the physical layer runs the medium access control MAC protocol, LoRaWAN, standardized by the LoRa Alliance [5]. This open-access standard describes the network architecture and defines the communication protocol used to connect each network entity. LoRaWAN is designed as a single-hop star network. While this greatly simplifies the  
Figure 1: LoRa frame structure. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**SF** & **7** & **8** & **9** & **10** & **11** & **12** \\ \hline \(ToA\) [s] & 0.1245 & 0.2097 & 0.3801 & 0.6816 & 1.206 & 2.254 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: ToA for different SFs, when payload length = 50 bytes, \(BW=125\) kHz, coding rate = 4/5.