# Experiencing LoRa Network Establishment on a Smart Energy Campus Testbed
## 6 Deploying LoRa Gateway(s) on Campus  
This section proposes a gateway deployment strategy to build the LoRa network for the smart energy campus scenario. We note that the proposed strategy shows an example of how the experimental results of this paper are applied to application requirements. In a similar way, one can use the resulting data to develop his/her own strategy. Table 7 lists the application parameters in our campus scenario. The campus is expected to deploy about 3000 nodes from which an energy application collects (non-)energy data every 15 s. Data are at most 32 bytes in size and must be transmitted within 300 ms. The application tolerates a network that has more than 90% communication reliability. In a LoRa system with a 125 kHz bandwidth, it is not possible to use high SF settings (10-12) because they fail to satisfy the latency requirement of 300 ms for 32-byte data. This indicates that SF values are assigned to nodes differently. To this end, the following two types of parameters are considered. The communication range is limited to a maximum of 894.6 m (90% of reliability in Table 5). We compute ToA to ensure that the ToA value satisfies the latency requirement for 32-byte payload for each SF value. To this end, we use the following equation. \[ToA=(n_{preamble}+4.25+n_{symbol})T_{symbol} \tag{4}\]  
\(n_{preamble}\) represents the number of programmed preamble symbols. \(n_{symbol}\) denotes the number of symbol byte in payload and is determined by the payload length, the SF value, the presence of header, Adaptive Data Rate (ADR), and the CR value. \(T_{symbol}\) represents a symbol duration. \(n_{symbol}\) and \(T_{symbol}\) are computed as follows:  
\[n_{symbol}=8+max\bigg{(}ceil\bigg{(}\frac{8 PL-4 SF+28+16-20H}{4(SF-2 DE)} \bigg{)}(CR+4),0\bigg{)} \tag{5}\]  
\[T_{symbol}=\frac{2^{SF}}{BW} \tag{6}\]  
Equations (4) and (6) show that the symbol duration increases when the SF value is increased, which leads to the increase of ToA. Table 8 summarizes ToA values with SF values. It unveils that SF 10-12 do not satisfy the latency requirement of 300 ms so that they cannot be used in the testbed. Figure 21 highlights 3000 nodes deployed on the campus testbed; the gateway is at the center, and low SF values are only assigned to nodes. When a SF 9 node transmits a packet, four SF 7 nodes and two SF 8 nodes on the same channel can send packets in sequence. Thus, SF 7 is assigned by 4/7 among all the nodes; similarly, SF 8 by 2/7 and SF 9 by 1/7. In this way, the campus has 57.1%, 28.6%, and 14.3% of SF 7, 8, and 9 nodes, respectively. \begin{table}
\begin{tabular}{l c|l c} \hline
**Parameter** & **Requirement** & **Parameter** & **Requirement** \\ \hline Network coverage & 600 \(\times\) 600 m & Number of nodes & 3000 \\ Max data length & 32 bytes & Data period & 15-150 s \\ Latency & 300 ms & Reliability & 90\% \\ \hline \end{tabular}
\end{table} 
Table 7: Application requirements on the smart energy campus. \begin{table}
\begin{tabular}{l|c c c c c} \hline
**SF** & 7 & 8 & 9 & 10 & 11 & 12 \\ \hline
**ToA [ms]** & 66 & 123 & 226 & 411 & 823 & 1482 \\ \hline \end{tabular}
\end{table} 
Table 8: ToA for each SF value for 32-byte data payload, 125 khz bandwidth, 8 preamble symbols, no header is presented, disabled ADR and CR of 4/5. With a new SF assignment strategy that uses low SF values only, this section presents an experiment conducts with the parameters in Table 7. The number of nodes is increased from 0 to 3000 after setting the data period to 15 s, and then the PDR is recorded. As shown in Figure 22, the PDR decreases as the number of nodes increases; in particular, performance degrades sharply when there are more than 1500 nodes. Since the area becomes small in size, increasing the number of nodes intensifies the contention, resulting in an unfavorable performance (lower than 20%) with 3000 nodes. The figure also reflects that the maximum number of nodes that a gateway can handle is limited to 1670 to meet the 90% reliability requirement.