# Proposed Fuzzy-NN Algorithm with LoRa Communication Protocol for Clustered Irrigation Systems
## 3 Irrigation Systems Algorithms
### FITRA Communication Protocol  
The FITRA communication protocol uses LoRa radio as its physical transmission medium. LoRa is a long-range and low-power communication protocol. It was developed by SemTech (Neuchatel,  
Figure 5: FITRA NN algorithm state for the calculation of vane’s operation. Switzerland) and it is the prevailing technology for IoT networks [34; 35]. LoRa EU radio frequencies are in the ISM band of 868 MHz and 433 MHz. The 868 MHz band LoRa uses seven channels [0; 12; 6; 4; 5] of 125 KHz bandwidth, followed by two 250 KHz special purpose channels and a R\({}_{\rm X2}\) channel [36; 37]. The 868 MHz band is mainly used inurban areas forming the smart cities IoT grid. For agricultural applications, the 433 MHz band can achieve better distances with less attenuation over distance. Nevertheless, in the 433 MHz band the channels that can be used are limited to three channels: (433.175 MHz, 433.375 MHz and 433.575 MHz). Moreover, even if the specification defines the 433 MHz LoRaWAN band use, existing devices in the market utilize only the 868 MHz band for LoRa Mac layer and infrastructure. The LoRa radio medium includes a higher data link protocol called LoRaWAN. LoRaWAN protocol is standardized by the LoRa Alliance [37] and so far include three protocol transmission classes: (i) Class A for synchronous periodic transmission with reception windows; (ii) Class B that sets periodic reception windows set by LoRaWAN gateways; and (iii) class C that extends class A by keeping the receiver window open until next node periodic transmission [21; 28; 37]. Apart from the class-based collision avoidance mechanism, LoRaWAN also includes adaptive rate transmissions, specific infrastructure, addressing, security provisions and management capabilities [21]. LoRaWAN addressing is based on a 64-bit unique identifierdevice and a 64-bit unique application for the application devices identifier. It supports join requests (ABP and OTAA) to the gateway send to the Application service backend [21; 28; 36]. LoRaWAN security is based on three security keys set for the application, the network and the session. The encryption algorithm used is the AES-128 [36; 37]. LoRaWAN includes a frame integrity code called MIC (Message Integrity code) similar to radio physical layer checksum. MIC uses the AES-CMAC algorithm. It also includes frame counters at the gateways in order to prevent frame replay attacks [37]. LoRaWAN also maintains an adaptive data rate mechanism for the control of the end nodes data rate transmission [36; 37]. The PHDR fields for LoRa physical layer data transmission and LoRaWAN packet structure for class-A data transmissions are presented in Figure 6a. Focusing on LoRa radio only, LoRa physical layer frame is consisted by a 1-byte 0 \(\times\) 34 value preamble (8 bytes if LoRaWAN MAC header is included), followed by PHDR and PHDR_CRC field. PHDR contains the frame length in bytes, the coding rate CR value (1 byte) and the existence or not of a 16-bit CRC field apart from PHDR_CRC for CR [4/5... 4/8] [37]. The PHDR contents apart from CR field (Flags) used by LoRaWAN higher protocol, maintains a 1-byte synchronization preamble, low-level source address, destination address, message ID and flags Field (where CR value is set) [37]. Figure 6: _Cont._  
LoRaWAN protocol strengthens LoRa radio integrity, security and scalability. However, for non-urban areas where 433 MHz transponders adequately perform, there is no existing infrastructure support in terms of gateways nor a full stack implementation of open source LoRaWAN over 433 MHz radio. The 433 MHz band limited available channels are left to the amateur radio developers in order to implement data protocols using the physical LoRa medium. The authors suggest that the FITRA communication protocol over LoRa radio does not use the LoRaWAN MAC layer implementation and uses only the physical layer header implemented for the RH_RF95 devices [22; 31].