# A Survey on LoRaWAN Architecture, Protocol and Technologies
## 2 LoRa & LoRaWAN Technologies
### Physical Layer-LoRa  
**Long Range** (LoRa) is a physical layer technology introduced by Semtech and intellectual property rights of the modulation are held by the company [5]. LoRa modulation extends the traditional Spread Spectrum principles to reduce the amount of energy required to transmit bits over the channel. The Data Rate (DR) in attainable communication can be computed from the bandwidth BW (Hz), the Spreading Factor (SF), and the Coding Rate (CR). The LoRa modulation has better performance than Frequency Hopping techniques in managing interferences. The modulation can tolerate interferences of arbitrary power levels up to 30% of the symbol length with less than 6 dB sensitivity degradation [5]. SF is the key variable that ensures the quality of service. When using the lower range of SF values, the data rate is very high and air time is low. The higher SFs extend the range but limit the Quality of Service. SFs from 7 to 12 allow orthogonal communications, i.e., different networks can speak simultaneously on the same frequency band without interfering. Table 2 presents SF values against Chirps/Symbol and Demodulation SNR. SF LoRa modulation is based on the representation of each bit of information by multi-chirps information [5,8]. Figure 3: LoRaWAN OSI reference. The data transmission rate and the SF relationship is defined as below. Symbol rate (RS), bandwidth (BW), and the spreading factor relationship are defined in Equation (1). Equation (1) defines the data transmission rate and relationship between SF, Symbol Rate (RS), bandwidth (BW). \[RS=\frac{BW}{2^{SF}} \tag{1}\]  
LoRa frame format can be either implicit or explicit where explicit packet includes a short header containing information about the bytes, CRC and coding rate used in the frame. LoRa frame format is given Figure 4. In most cases, coding rate and CRC are known and don't change, it doesn't necessary to specify the values, this scenario is called implicit header mode. Frame air time is an important issue for real-time applications. Given CR, SF and BW time required to transmit a LoRa frame can be computed [8], which is the sum of the transmission time of the preamble \(T_{preamble}\) and the payload \(T_{payload}\) as defined in Equation (2):  
\[T_{frame}=T_{preamble}+T_{payload} \tag{2}\]  
\(T_{preamble}\) is depended on the \(T_{sym}\) which is given by Equation (3) and programmable length of modern registers \(n_{preamble}\) in Equation (6) and LoRaWAN 1.0 specifies default preamble value as 8:  
\[T_{sym}=\frac{1}{RS} \tag{3}\]  
\[T_{preamble}=(n_{preamble}+4.25)T_{sym} \tag{4}\] \begin{table}
\begin{tabular}{c c c} \hline \hline
**Spreading Factor** & **Chirps/Symbol** & **Demodulation SNR** \\ \hline
7 & 128 & \(-\)7.5 dB \\
8 & 256 & \(-\)10 dB \\
9 & 512 & \(-\)12.5 dB \\
10 & 1024 & \(-\)15 dB \\
11 & 2048 & \(-\)17.5 dB \\
12 & 4096 & \(-\)20 dB \\ \hline \hline \end{tabular}
\end{table} 
Table 2: LoRa SF values [8]. Figure 4: LoRa frame structure. Frame transmission time is depended on payload size \(n_{payload}\) which is calculated using Packet Length \(PL\) (number of bytes), Implicit Header \(IH\), Low data rate optimization \(DE\) and Coding Rate \(CR=\{1:4/5,4:4/8\}\). \(IH\) is 0 if the header is enabled, otherwise 1. Implicit header reduces packet size by using predefined \(CR\) and \(CRC\) configurations, otherwise, these values are included in the frame header. If a low data rate is enabled \(DE\) value is set to 1. \[n_{payload}=8+max\Big{(}ceil\Big{[}\frac{8 PL-4 SF+28+16 CRC-20 IH}{4(SF-2 DE)} \Big{]}(CR+4),0\Big{)} \tag{5}\]  
\[T_{payload}=n_{payload}\ \times\ T_{sym} \tag{6}\]  
Given Equations (2)-(6) it is possible to calculate frame air time for a single LoRa frame. Using this mathematical model LoRa frame air times are evaluated using \(SF=\{7,8,9,10,11,12\}\) in terms of payload size and the \(BW\). The results of the simulations for different configurations are available in Figures 5-7. We can conclude that LoRa frame air is highly depended on the SF values.