# LaRaCog: A Protocol for Cognitive Radio-Based LoRa Network
## 1 Introduction  
Statistics foresee 50 billion IoT objects to be connected by 2030 [1]. Wireless communications including IoT use different protocols that vary between proprietary to interoperable ones. LoRaWAN is an interoperable IoT wireless communication protocol used for Long-Range (LoRa) networks. Its system architecture ensures a long range and a low-power consumption at a low bit rate. The battery lifetime, network capacity, Quality of Service (QoS) and security enable LoRaWAN to be used in various applications [2]. Several applications are integrating LoRaWAN protocol, especially those involving sensors such as smartmetering, smart parking, smart street lighting, vehicle fleet tracking [3], in agriculture such as smart farming [4; 5], and in environment or atmospheric monitoring [6]. The majority of the IoT wireless networks operate on the free unlicensed spectrum. The ever-growing demand for the IoT technologies will increase the load on the burdened unlicensed spectrum. Therefore, the Cognitive Radio (CR) technique can address such a challenge by sharing unused licensed spectra. CR shares the spectrum between two types of users: primary and secondary users. Primary users (PU) are allowed to access the licensed spectrum whenever needed, while the secondary users (SU) can transmit on the licensed spectrum only when the primary users are idle or the channel is not in use. To manage this sharing process, the secondary users are responsible for making spectrum sensing before transmitting to avoid any interference with the primary users. In LoRaCog, when applying CR, the IoT devices are acting as secondary users. As it is known, one of the CR's main challenges is the high power consumption due to spectrum sensing [7], while on the other hand, the main advantage of LoRaWAN is its suitability for battery-operated devices. This forms the relationship and incentive for combining both technologies, leading to the delivery of LoRaCog. Usually, the end devices (EDs) in LoRaWAN are battery powered, making CR implementation a real challenge. On the other hand, CR and LoRaWAN are partially similar in having multiple channel options; for example, LoRaWAN ED can use one of several channels within the allowed frequency. Moreover, as per LoRaWAN protocol, EDs are provided by the channel's parameters for their next uplink. These characteristics make the CR technique, where the channel allocation is dynamic, suitable to LoRaWAN specifications after undergoing certain modifications. Indeed, CR means operation on the licensed bands sometimes, which could result in interference with the existing users. However, thanks to the spectrum sensing mechanism performed by the CR-based LoRa network, this interference can be minimized to a tolerable threshold. In our recent work [8], we adapted LoRaWAN protocol to cope with spectrum sensing. The modification applied to LoRaWAN allows the EDs to sense on demand a given channel and provide a CR-based network with the status of that channel, while the EDs themselves operate only on the unlicensed bands. This research presents the new protocol \"LoRaCog\" that allows the LoRa network to dynamically operate on both the licensed and the unlicensed bands using CR. We exploit the rearrangement of the preamble frame in LoRa suggested by our previous work LoRa+ [9], and we suggest a new mechanism for spectrum sensing by Gateway (GW) to identify the unused spectrum and convey the parameters (unused spectrum) to EDs based on the decision by the Network Server (NS). These modifications result in operating the LoRa network over both the available licensed and the unlicensed spectrum alleviating the congestion on the unlicensed spectrum and decreasing the rejected packets rate. It is worth mentioning that LoRaCog does not replace LoRaWAN, but it can be considered as a complementary solution that assists LoRaWAN to avoid the high congestion on the unlicensed bands and open the door to use the licensed bands using CR technology.