# Energy Efficient Routing Protocol for an IoT-Based WSN System to Detect Forest Fires
## 3 Proposed Model
### Setup Phase  
At the beginning of the setup phase, each sensor node sends an information message (\(\mathrm{SN_{inf}}\)) to the BS. This message \(\mathrm{SN_{inf}}\) consists of \(\mathrm{SN_{id}}\), \(\mathrm{SN_{re}}\), and \(\mathrm{SN_{gn}}\), where \(\mathrm{SN_{id}}\) represents the sensor node ID, \(\mathrm{SN_{re}}\) represents the residual energy of the node, and \(\mathrm{SN_{gn}}\) represents the grid number of the node. The BS compares the residual energy of each sensor node with a predefined threshold called Threshold Energy (TE). If the residual energy in a node is greater than the TE, it is eligible to participate in the CH selection procedure. If a node's residual energy is less than the TE, it cannot participate in the CH selection process. The BS chooses the node with the highest residual energy as the CH among all the eligible nodes in a grid. The BS then broadcasts a message \(\mathrm{BS_{sel}}\) to inform all sensor nodes about the newly selected CHs. The message contains \(\mathrm{SN_{id}}\) and \(\mathrm{SN_{gn}}\) of each selected CH. Here, \(\mathrm{SN_{id}}\) represents the ID of the appointed CH and \(\mathrm{SN_{gn}}\) represents the grid number of the CH. Each ordinary node sends a join request (JOIN_REQ) message to its CH. An ordinary node identifies its CH from the grid number of the CH, which matches the grid number of the node. Each JOIN-REQ message consists of \(\mathrm{SN_{id}}\) and \(\mathrm{SN_{gn}}\) of the requesting node. A CH accepts all the requesting nodes as its members. After a time-out period, the BS broadcasts a message (\(\mathrm{BS_{frm}}\)) to inform all the nodes in the target area about the frame size and structure. The BS then broadcasts a schedule (\(\mathrm{BS_{sch}}\)) for the selected CHs. For each pair of sending and receiving devices, this message contains \(\mathrm{SN_{id}}\) of the sending CH, \(\mathrm{SN_{id}}\) of the receiving CH (or \(\mathrm{BS_{id}}\) of the BS), and \(\mathrm{SN_{slot}}\) which denotes the slot number in which the sender can send data to the receiver. Next, each CH broadcasts the intra-cluster schedule (\(\mathrm{CH_{sch}}\)) in its cluster. The message contains \(\mathrm{SN_{id}}\) and \(\mathrm{SN_{slot}}\) for each cluster member, where \(\mathrm{SN_{id}}\) represents the ID of the cluster member and \(\mathrm{SN_{slot}}\) represents the slot allocated to the member in the frame. A sample network architecture is presented in Figure 1. The target area is split into nine grids (clusters). Each cluster consists of four or five nodes. The CHs are represented by sensor nodes inside red rectangular boxes. The clusters are numbered 1 through 9 from left to right then top to bottom. The first cluster consists of five nodes numbered 1 through 5, and node 3 is the CH. The second cluster consists of four nodes numbered 6 through 9, and node 9 is the CH. Similarly, every other cluster contains some sensor nodes, one of which is appointed as the CH. A frame is divided into two parts, namely intra-cluster communication period and inter-cluster communication period. In the intra-cluster communication period, sensor nodes send data to their CHs in the allocated time slots. In the inter-cluster communication period, a CH sends data to its upstream CH or the BS. The frame size is determined by the BS. A sample frame structure is shown in Figure 2. The frame structure is related to the network presented in Figure 1. The number of ordinary nodes in the largest cluster determines the number of slots in the intra-cluster communication period. The number of slots in the inter-cluster communication period depends on the number of clusters in a column and the number of clusters in a row in the network architecture. In the frame shown in Figure 2, there are four slots in the intra-cluster communication period and five slots in the inter-cluster communication period. To depict the multi-hop data transmission, we consider a scenario where data are transmitted from CH-31 to the BS via CH-17 and CH-3.