## 3 LoRaWAN Networking
It is an LPWAN technology for battery-operated wireless connection of objects to the Internet in regional, national, or worldwide networks that aims at major IoT needs, including two-way communication, end-to-end protection, mobility, and localization. The LoRa physical layer supports long-range communication links, whereas the LoRaWAN protocol principally functions as a protocol to route the network layer between LoRaWAN gateways and LoRa devices. LoRaWAN also manages the data rate, communication frequencies, and transmission power for all nodes in the network, which are asynchronous and transmit data on demand. As shown in Figure 7, the transmitted data by an end device will be received by nearby gateways that forward the data payloads to the cloud server (The Things Network (TTN)) that is integrated into several IoT platforms. The duplicated packets will be filtered at the network server, which also manages the network and ensures data security. By using any of the available integrations, the received information is forwarded to application servers (Web-based dashboards and MobileApps.). A LoRaWAN technology architecture defines the three fundamental types of devices as follows:  
* End devices (ED): These are devices that either take downlink (DL) traffic from the network server or generate uplink (UL) traffic for transmission to the gateways;
* Gateways (GW): These are the devices that demodulate LoRa communication and transmit it between the network server and the end devices in a wireless network. Wired or wireless access points link gateways to the Internet. The LoRaWAN gateway is sophisticated, concurrently listening to the radio on several channels and delivering thousands of ENs simultaneously;
* Network Server (NS): This is the device which serves as the core backend of a LoRaWAN network, collecting traffic from all end devices in the network and processing it on an application server. LoRaWAN enables sensing nodes to transmit information as small packets with low energy consumption to a faraway gateway for many kilometers in one hop, and the technology is robust to interference [15]. LoRaWAN networks may be used for relatively dense installations with low latency and reliability requirements, and they are becoming increasingly popular [23]. Figure 7: LoRaWAN network architecture. When compared to other wireless technologies, LoRaWAN provides the option of private network installations as well as easy integration with a variety of WAN network platforms (e.g., TTN). Because of this and its open access specifications, LoRaWAN has attracted the interest of the scientific community, technology manufacturers, and service providers since its first appearance in the market [34]. The adaptive data rate (ADR) is included in the LoRaWAN network to choose a transmission speed that better fits the conditions of the channel. LoRaWAN works on free regional frequency bands such as 915 MHz in America, 868 MHz in Europe, and 433 MHz in Asia as the carrier frequency. It uses 125, 250, or 500 kHz as its bandwidth. For error detection and correction, LoRaWAN uses the coding rate and employed number of bits to show this. The combination of all aforementioned features made LoRaWAN a powerful technology for very long-range transmission in IoT applications. Because of its specific modulation, LoRa is a multipurpose technology that can be versatile and function in different types of environments and application groups. LoRaWAN defines three operation modes as classes [35]: A, B, and C. All nodes must be initialized with Class A, as the default choice mode is considered when EDs send data at any time to the GW through an ALOHA-based LoRaWAN MAC protocol. * Class A: This class uses two receiving windows at specific times following each UL transmission. As a timing diagram in Figure 8, at the beginning of these receiving windows, only DL transmissions are allowed. With regard to the first window, DL transmissions are carried out using the identical channel and data rate settings as the prior UL transmission.