{'fraction_non_alphanumeric': 0.018020549044790495, 'fraction_numerical': 0.0062209022314978326, 'mean_word_length': 4.687514266149281, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Design of Power Efficient Routing Protocol for Smart Livestock Farm Applications

Article history: Received: 16 September, 2020 Accepted: 27 December, 2020 Online: 28 December, 2020 The demand on livestock as a source of protein is increasing with the dramatic increase of world population which approaches 8 billion. As a result, the monitoring of the performance of livestock breeding is becoming essential. The technique which could increase livestock production and improve the efficiency of operation is digitalization of livestock management .This could be achieved by models' realization that relates the rates of productivity and the parameters of operation which count on collecting big volume of data that results from digitalization process. In fact, the adoption of IoT technology in livestock environments is usually challenged by energy problems and power efficient communication technologies. In this paper a modified AODV protocol is proposed to enhance the traditional AODV protocol used in MANET networks that was mainly concerned with optimal route selection based on shortest path to send the data packets through it. The proposed technique models and simulates operational parameters of intermediate nodes as a factor to decide on the optimal path selection in IoT based MANET networks in addition to the shortest path that leads to transmission power gain of the source node. The results show a significant power performance enhancement that reaches average power saving of 33.3% compared to the traditional AODV protocol.


Introduction
This paper is an extension of work originally presented in 14th International Conference on Computer Engineering and Systems (ICCES) [1]. The increase in world population that reaches 8 billion increases the demand for livestock production. As a result, it is necessary to avoid livestock losses and protect it from diseases as this could threaten the countries' economy and food security. The process of observing livestock was difficult as it took a lot of time to detect if they had medical issues or not. Accordingly, researchers illustrated nowadays different advanced monitoring systems for livestock, these systems depend on remote sensors. Different types of sensors were used as: accelerometer, rumination, body temperature and humidity, and sound sensors. They were placed on the cattle to collect data and send it to the processing unit to take the appropriate action [2]. Today, Different technologies play an important role to increase livestock production and to save their losses as well as improving the operation efficiency in large farms. One of the recent technologies that offers the measure, actuate, sense and infer of physical and physiological parameters is the Internet of Things (IoT) technology. Livestock performance monitoring systems using IoT technology require special type of networks. Adhoc network is one of these special networks as it is energy efficient network and elongates the devices' lifetime. In the Adhoc network, different sensors are used to monitor behavior, stress, diseases and temperature. These sensors provide the IoT network with the collected data which allow the early detection of diseases. As a result, early treatment is offered which saves money and time.
The main problem in IoT technology is the energy source as it needs to work for a long time to reduce the need for replacement of sources or human collaboration. This paper concentrates on the study of suitable network topology that provides sensor network operation using energy efficiently. Accordingly, different ASTESJ ISSN: 2415-6698 techniques against farms' environment are illustrated and simulated. Additionally, a Mobile Adhoc network (MANET) algorithm is introduced to decrease the source energy drainage and assure energy sustainability.

Literature Review
Several literatures are presented in previous work that proved the significance of IoT and sensor technologies to improve the livestock farm performance especially the large animal farming. In [3], the author presented a group of micro-sensors which were noninvasive sensors. They were mounted on the livestock using a collar that sent data via the internet wirelessly. As a result, a continuous connection between animals and veterinarian was established.
In [2], the author proposed a system using various sensors which were mounted on the cattle body. These sensors were used to monitor different parameters which allowed to detect the cattle body issues constantly. In [4], the author developed a system using misting systems for heat stress reduction. It was also developed to monitor humidity and temperature ranges. The system assured the avoidance of cattle death and the increase of producing high quality milk by preserving the ranges of the monitored parameters constant.
Although the literature above highlighted the use of rechargeable batteries as a main power source of the sensor nodes used in their studies, the researchers did not consider the battery recharging methodology especially for Adhoc wireless sensor networks. On the other side, the following literature developed techniques that enhance wireless sensor networks' performance.
In [5], the author focused on wireless sensor networks and proposed a gateway based Geographical Energy Aware Routing (M-Gear) protocol. In the system, the sensor nodes were distributed according to their location into four regions. Outside the sensing area, the base station was placed and at the center of the sensing area, the gateway node was located. Their developed protocol performance was compared to the performance of Low Energy Adaptive Clustering Hierarchy (LEACH) protocol. The compared performance was in terms of energy consumption and network lifetime. The comparison proved that M-Gear protocol was better than LEACH protocol.
In [6], the author developed a Modified Sensor Protocol for Information via Negotiation which is called M-SPIN. They made a comparison between the performance of M-SPIN and the traditional SPIN protocol using the broadcast communication. In the developed protocol, the hop distance between nodes and sink node was measured using a distance discovery phase. Additionally, the total number of transmitted packets was reduced as a result of transmitting data only to the sink node. As a result the consumption of total energy was minimized.
In [7], the author proposed an algorithm to modify the Dynamic Source Routing (DSR) protocol. The number of Route Reply (RREP) packets was decreased using the proposed algorithm and it also decreased the size of the header for the data packets which resulted in decreasing the overhead. They also developed an algorithm to reduce the energy consumed in data transmission.
In [8], the author presented a Dynamic MANET On-demand (DYMO) protocol and ant colony optimization algorithm which was capable of managing environmental changes. Graphs were used in ant colony optimization algorithm which was based on probabilities' method to find routes. Two factors were measured to evaluate the discovered routes. The measured factors were the route reliability and delay time. The software used to implement the algorithm was NS-2.
Accordingly, the proposed modified AODV technique capitalize on extending the enhancements in the literature to develop IoT operation aware Adhoc wireless sensor network that is suitable for use in livestock farm applications.

Overview on Energy-Efficient Routing Protocols
Mobile Adhoc network (MANET) is a group of selfconfiguring mobile nodes. These nodes can be used at the same time as router and end node, therefore a fail in the operation of some nodes affects the performance of the network. Energy deficiency of nodes is one of the main problems which affects the performance of network in MANET. As a result, it is important to use energy efficiently in MANET in order to increase the lifetime of node's battery [9]. There are several routing protocols in MANET such as Destination Sequenced Vector (DSDV), Dynamic Source Routing (DSR) and Adhoc On-demand Distance Vector (AODV). These protocols are used to select the optimal route between source and destination in order to send data through it.

Destination Sequenced Distance Vector
DSDV is one of the proactive routing protocols in MANET. It is a table driven routing protocol and it is based on Bellman-Ford algorithm. In this protocol, a routing table is used at each node to store all available destinations. Additionally, advertisements are made as a severe change may exist in the table's data. In this protocol, a sequence number is also sent to the destination in order to discriminate the old routes from the new ones which avoids the formation of loops. It isn't recommended for highly dynamic networks because it needs regular updates in its routing tables which lead to battery drainage [10].

Dynamic Source Routing
DSR protocol creates routes only when requested, therefore it is one of the reactive routing protocols. It doesn't use routing tables at the intermediate nodes as it uses source routing. In this protocol, the intermediate nodes send a Route Request (RREQ) packet with its own address identifier. The available routes in the DSR protocol are being tracked by a route cache. Two main mechanisms are used in DSR: route discovery and route maintenance. They are used to discover routes and to notice if any change occurs in the network topology [11].

Adhoc On-demand Distance Vector
AODV is one of the most known reactive routing protocols in MANET. It creates only a route when a source node needs to send data to a destination node therefore it is better than DSDV as it minimizes the number of broadcasts. It has a good performance in dealing with large number of mobile nodes as it creates dynamically at each intermediate node a routing table. It also has a sequence number counter which prevents the formation of loops in its routing tables. This sequence number also keeps the nodes updated by comparing their routing tables to check how updated information they have about other nodes [12].

Performance Evaluation of Adhoc networks
There are different parameters measured to assess the performance of MANET protocols as summarized in Table 1.

Packet Delivery Fraction
The ratio between the number of broadcasted packets by the source node and the number of received packets at the destination node is known as PDF. In case of low number of nodes, DSR performs better in this metric but the performance declines with the increase of the number of nodes. On the contrary, DSDV performs better in case of large number of nodes but AODV showed that its performance is uniform in both cases [13].

Average end to end delay
It is the time it takes from the packet being created at the source node to the packet being delivered at the destination node. In this metric, DSDV performance declines with the increase of the number of nodes. However, the DSR and AODV performance is uniform [13].

Number of Packets Dropped
It is the failed data packets that couldn't reach the destination node. In case of large number of nodes, DSR and AODV have a good performance. On the other hand, DSDV has the worst performance as it declines with the increase of the number of nodes. The performance of AODV in this metric is the best as it exchanges information periodically between nodes which ensures connection [13]. Figure 1 shows the architecture of a group of mobile nodes connected in MANET network. Each node in this network has different sensors such as accelerometer, skin temperature, humidity and ambient temperature, and respiratory rate. The data sensed from these sensors will be transmitted to a central processing server (CPS) to perform the proper action. In such a network, Power should be used efficiently to elongate the battery lifetime of each node. Accordingly, AODV protocol which is an energy efficient routing protocol is used to select the optimal route to send the collected data to the destination node. As a result, the total transmitted power of source node is reduced. Figure 2 shows the flowchart of how AODV protocol is implemented. When a source node starts to search for a route to send its data through it to the destination node, it searches its routing table. If there is a route in its routing table to destination, it sends its data packets through this route. If there is no route to the destination node, it broadcasts a Route Request (RREQ) packet to all the neighbor nodes. If the node that received the RREQ packet is the destination node or it has in its routing table a route to the destination node, it sends a Route Reply (RREP) packet to the source node. If the receiving node isn't the destination node or there is no route for the destination in its routing table, it broadcasts a RREQ packet to all its neighbors. When the source node receives a RREP packet, it transmits its data packets through the same route where it received the RREP packet. If several RREP packets are received by the source node, it selects the RREP packet received from the shortest route and discard other packets. As a result, the power for transmitting the data packets is reduced which increases the source node battery lifetime.

Proposed Architecture for Livestock monitoring IoT networks
A modified AODV protocol is proposed to enhance the overall network power performance. The optimal route in the modified protocol is selected depending on the index weight of the path rather than depending only on the shortest path. The index weight is a new factor measured to indicate the operation time of each node in a certain path. Each node is given a certain index  which represents its operation time. The index weight of the path is measured as the total index of nodes in a certain path divided by the number of nodes in this path. The path with the highest index weight has the lowest priority to be selected while the path with the lowest index weight has the highest priority to be selected.
The flowchart in Figure 3 shows how the modified AODV protocol is executed. When a source node starts to search for a route to send its data through it to the destination node, it searches its routing table. If there is a route in its routing table to destination, it checks its index weight. If it is low, it sends its data packets through this route. If there is no route in its routing table or the index weight of the available route is high, it broadcasts a Route Request (RREQ) packet to all the neighbor nodes.
If the node that received the RREQ packet is the destination node or it has in its routing table a route to the destination node, it sends a Route Reply (RREP) packet to the source node. If the receiving node isn't the destination node or there is no route for the destination in its routing table, it broadcasts a RREQ packet to all its neighbors. When a RREP packet reaches the source node, it checks the index weight of the route. If it is high, it sends RREQ packet to all its neighbors searching for other routes with lower index weight. If it is low, it starts to send data packets to the destination through the same route where it received the RREP packet. If the source node receives more than one RREP packet. It selects the route with the lowest index weight to send data packets. As a result, it increases the lifetime of the serving nodes which enhances the overall network power performance.

Simulation Model Results
In this simulation, MATLAB software is used to simulate AODV protocol. In Figure 4, it is shown how the source node, destination node and the number of nodes are entered in this model. It is assumed in this simulation that the network has 20 mobile nodes randomly distributed in a farm size of 100 m 2 and a 20 m transmission range between nodes. The source node and the destination node are assumed to be node 2 and node 10 respectively. AODV protocol is implemented in this model to enable the source node to request different available paths to the destination node. The source node will receive RREP packet from the intermediate nodes if they have an available route to the destination node. In Figure 4, the available routes are shown.
In our work, two main performance indicators are used to measure the impact of the proposed advanced AODV protocol on the IoT network performance mainly the energy consumption and network lifetime. i) Energy consumption is based on MATLAB model that is governed by the following equation The multipath fading is also accounted in the simulator model given that the amount of Energy consumption rate considered in the model for the transmitter or receiver circuitry is 50 x 10 -9 and amount of energy consumption for multipath fading is 0.0015 x 10 -12 .
ii) Network lifetime that is defined as the ratio between its residual energy and the energy consumed to transmit data packets (i.e. the time spent until the node run out of energy). It is the third parameter calculated at each route as shown in Figure 7. In this case, the route with the longest network lifetime is the optimal route as it has the lowest energy consumption and the shortest distance. As a result, route 12 is the optimal route in terms of distance, energy consumption, and network lifetime.
The simulation results for applying AODV protocol in cows' performance monitoring system are shown in this section. The first parameter measured as shown in Figure 5 is the total distance between the source node and the destination node at each route. The optimal route is found based on this parameter as the optimal route is the shortest route which is selected to transmit data through it. In this case, the route with the shortest distance is route 12 so it is the optimal route.
In this simulation, the energy consumption is the second parameter calculated at each route as shown in Figure 6. Equation 1 represents the energy consumption model. The route with the shortest distance has the lowest energy consumption. In this case, route 12 is the optimal route in terms of energy consumption and distance. The fourth parameter calculated in this simulation as shown in Figure 8 is the transmitted power at each route. The data are transmitted with minimum power when transmitted through the shortest optimal route to the destination node. In this case, route 12 is the optimal route in terms of distance, energy consumption, network lifetime, and transmitted power. The fifth parameter measured is the power saving as shown in Figure 9. It indicates when selecting the shortest optimal route in MANET how much transmitted power is saved. It is measured at different number of nodes as shown in Figure 9 to indicate that when the node density increases the power saving decreases. Figure 10 shows the power saving which indicates how much transmitted power is saved when selecting the shortest route in MANET compared to the transmitted power in fixed network. It is measured at different number of nodes to indicate that when the node density increases the power saving decreases as shown in Figure 10.  Figure 11 shows different paths between source and destination which are path1 (P1), path2 (P2), path3 (P3), path4 (P4) and path5 (P5). It is assumed for each path that the distance between nodes is equal and the total transmitted power of the source node is 30 dBm. It also shows the transmitted power of each intermediate node in each path. There are some nodes which are common in more than one path such as nodes: 3, 4, 7 and 9. These nodes are called busy intermediate nodes as they could be used several times in the network which will lead to the drainage of their batteries. As a result, as mentioned earlier in section 5 a modified AODV protocol is proposed to save the battery of these busy nodes. There are different scenarios for node process shown in Table 3 as each intermediate node will have an index to indicate how busy this node in order to select the optimal path in terms of its index. In Table 4, it shows the transmitted power of each node and its index of processing. It also shows their index weight which is the total index of nodes divided by the number of nodes in each path. The selection of the optimal route will be based on its index weight, the route with lowest index weight is the optimal route to send data through it.    Figure 12 shows the index weight of each path which indicates the status of the intermediate nodes. If the index weight of a path is high, it indicates that its intermediate nodes were processing for long time therefore this path can't be selected to transmit data through it. As a result, this will save the lifetime of their batteries.  Figure 13 shows the power gain of each path which indicates how much power is saved by selecting a certain path. The optimal path shown in Figure 13 is path 4 as it has the highest power gain. Figure 14 shows the power gain versus the index weight to indicate how much power is saved when selecting the path with the lowest index weight. As shown in Figure 14, the path with the lowest index weight has the highest power gain.

Discussion and Conclusion
The results from applying the AODV routing protocol to select the shortest route showed that when the total distance between source and destination decreases, the energy consumption decreases which increases the network lifetime. It also showed that a decrease in the transmitted power occurs when the total distance decreases. For MANET and classical fixed networks, the power saving is calculated for each route found at different node densities. It showed that when the node density increases, the power saving decreases.  The traditional AODV protocol focused only on how to enhance the battery lifetime of the source node depending on selecting shortest optimal route. It didn't highlight the importance of the intermediate nodes which are serving nodes and their batteries could be drained quickly due to their operation time in the network. As a result a modified AODV protocol is proposed, this protocol added a new feature to select the optimal route. The selection of the optimal route in the modified AODV protocol is depending on the operation time of each node in the path. Each node is given an index which specifies its operation time as shown in Table 3. An index weight which is the total index of the nodes in a certain path divided by the number of nodes in this path is measured for each path. This factor indicates if the available path could be used or not. The path with a high index weight has the lowest priority to be selected because it indicates that the operation time of the intermediate nodes in this path is very high and thus the probability to have lower battery state of charge is higher.
Accordingly, the optimal path is the path that has the lowest index weight.
By applying the modified AODV protocol to select the optimal route depending on the index weight of the route as a priority to selection of the shortest route (i.e. if two routes have the same index, then the shortest one is selected). The protocol supports to give the intermediate node with longer operation time the opportunity to focus on sensed data processing. The networking processing function is then off loaded from this intermediate node to other nodes with lower operational time and accordingly higher probability of battery charge lifetime.
As observed in Table 5 the optimal path in terms of power gain is path2 and path4. It is also observed in Table 4 that the best path in terms of index weight is path 4. By comparing the power gain when selecting the shortest route (measured in hop counts) which is path 3 in Figure 11 to the power gain when selecting path4 which has the lowest index weight, it proved that the power is enhanced by 33.3% as shown in Table 6.
As a summary, a convenient network topology is studied in this paper to provide a network of sensors which has an energy efficient operation. Accordingly, in order to decrease the source energy drainage which assures energy sustainability, MANET algorithm is proposed. In MANET, AODV is the most common known routing protocol as its performance is the best compared to other MANET protocols. In this simulation, AODV was applied to allow the selection of the optimal route between source node and destination node. The optimal route is selected as it has the shortest distance, the lowest energy consumption and the longest lifetime.
A modified AODV algorithm is proposed in order to enhance the overall network power performance. The protocol depends on giving intermediate nodes with lower operation time a higher priority to share in the network routing even if the path could be longer which could lead to a power saving that reaches 33.3%. As a result, the paths in the modified AODV are selected based on the index weight of the path. The selected path is the path with the lowest index weight.