## 4 Using LoRaWAN in Linear Monitoring Systems: KSA Oil Pipeline Case Study
### The Configuration of the Network Based on LoRaWAN Specifications  
Since the network architecture is linear and multi-hop, the number of sensors, the distance between sensors, and the data rate all have an impact on what network configuration is selected.  
LoRaWAN parameters such as SP and CR affect performance metrics such as the capacity and energy of the LoRaWAN network. Hence, the setting of these parameters should not be carried out randomly, and the effect of each parameter on the performance needs to be investigated. In this section, we study the impact of parameters by deriving the relationship between the parameter and its effect on a specific performance metric from its description in the LoRaWAN specifications.  
SF, TP, and CR parameters have an impact on all performance metrics [41; 42; 43; 44; 45], causing high throughput and low energy consumption. Using smaller SF along with low TP has many advantages, such as decreasing energy consumption and increasing throughput, as the data can be sent more quickly. This is beneficial for applications that prioritize lowering energy consumption, as in our application. However, it reduces the communication range. We set SF and TP to their minimum values of 7 and 2 dBm, respectively.  
SF and CR affect the time over the air (ToA), which is the time during which the packet is transmitted over the air and may interfere with other packet transmissions. The ToA, in turn, affects energy consumption and throughput. Increasing SF and CR will result in increasing ToA, thus increasing energy consumption and decreasing throughput. Hence, we set SF and CR to the minimum, which is 7 and 1 for SF and CR; respectively.  
Figure 2: Multi-hop LoRaWAN network architecture for the oil pipeline in the desert.  
Consequently, this will result in energy consumption being lower, and throughput will become higher.  
The communication range between sensors is limited by SF and TP; decreasing SF and TP will result in reduction of the communication range. For example, setting SF to 7 and TP to 2 dBm will limit the communication range to 2 km. Generally, this decrease in communication range may be problematic; however, according to the specific requirements of our application, such a decrease will not cause a degradation in performance. In our design, the communication range between sensors is set to less than 2 km in the multi-hop scenarios (200, 600, and 1800 m). It is important to note that the limitation of the communication range to 2 km has affected the maximum hop range we can use in our architecture design. The maximum hop range we can reach is 11.  
Having the communication range set to lower values--less than 2 km--results in a smaller transmission area. Thus, energy consumption and ToA will become lower. Consequently, the throughput will increase. Another favorable side effect of having a communication range set to lower values is increasing reliability and scalability in data transmission, since the number of sensors communicating with each other will decrease, hence decreasing collision and packet loss.  
The effects of DE and EH will be described when presenting the analytical model in Section 5.