## 4 Methods
### Experimental Scenarios  
The laboratory is structured around six scenarios, designed to generate representative network traffic. Additionally, the collected data will serve as a foundation for AI-driven research in areas such as alert triage, root cause analysis, and collaborative threat response strategies. Figure 1: IoT lab physical network topology. Figure 2: IoT lab logical network topology. The first scenario emulates a rural deployment using a public LoRaWAN infrastructure, The Things Network, which is commonly adopted in smart agriculture, cultural heritage monitoring, and wildfire detection. These use cases typically require remote acquisition of environmental data, such as temperature, humidity, or livestock location, without the need for on-site infrastructure. Two commercial LoRaWAN Dragino sensors are used: the LHT65, designed for measuring temperature and humidity and the LGT-92, a device for geolocation tracking, which were configured using Over The Air Activation. The data are received by a Mikrotik LR8 gateway and forwarded to The Things Network servers, where data are made accessible through an MQTT broker. A Node-RED flow (Figure 3) subscribes to this MQTT broker, decodes the incoming payloads, and transforms them into readable data structures, which are then stored in InfluxDB and MongoDB. The second scenario, LoRaWAN with Activation by Personalization (ABP), explores an alternative deployment of LoRaWAN that does not rely on Internet connectivity or external cloud services. This scenario implements a fully local LoRaWAN infrastructure using a Dragino LDS02 sensor (Dragino Technology Co., Shenzhen, China), designed for detecting the open and closed status of doors or gates, useful for monitoring facilities like barns or livestock enclosures, where door status and access control are essential for safety and intrusion detection. The sensor is configured in ABP mode with predefined authentication parameters and transmits data to a Dragino LPS8 gateway, which is set up in private mode to manage the LoRaWAN network autonomously. The LPS8 gateway is configured to forward all incoming data directly to a local Mosquito MQTT broker, hosted on the same dockerized virtual machine as used in Scenario 1. Then, the data are processed using Node-RED (Figure 4), which manages topic subscriptions, payload decoding, and routing of messages to the data storage systems. The third experimental scenario in the laboratory explores the integration of WiFi connectivity with the MQTT protocol to enable efficient short-range communication between IoT devices. This configuration simulates real-time alert systems in enclosed rural infrastructures, such as animal sheds or machinery rooms, where motion detection can help monitor unauthorized access, animal movement, or equipment usage. The experimental setup consists of an Arduino ESP32 development board connected to a PIR motion sensor (HC-SR501), which is capable of detecting movement within a specific coverage area. The  
Figure 4: Scenario 2: LoRaWAN ABP Node-RED Flow. Figure 3: Scenario 1: LoRaWAN TTN Node-RED Flow. ESP32 device is programmed to connect to a WiFi network managed locally via a Dragino LPS8 router and publishes motion detection events in JSON format to a designated topic on a Mosquito MQTT broker. Then, sensor readings are processed through Node-RED (Figure 5) and directed to the appropriate storage systems. The fourth experimental scenario in the Smart Rural IoT Laboratory explores an IoT communication system based on HTTP over WiFi. The hardware setup includes an Arduino ESP32 microcontroller connected to two sensors: a DHT11 for measuring temperature and humidity, and a KY-038 sound sensor for detecting ambient noise. The ESP32 is programmed to collect data at regular intervals and send them via HTTP POST requests to a server hosted on the backend of the laboratory. Network connectivity is provided by a Dragino LPS8 router, functioning as a local WiFi access point.