BlockChain with IoT, an Emergent Routing Scheme for Smart Agriculture

Blockchain is an emerging field of study in a number of applications and domains. Especially when combine with Internet of Things (IoT) this become truly transformative, opening up new plans of action, improving engagement and revolutionizing many sectors including agriculture. IoT devices are intelligent and have high critical capabilities but low-powered and have less storage, and face many challenges when used in isolation. Maintaining the network and consuming IoT energy by means of redundant or fabricated data transfer lead to consumption of high energy and reduce the life of IoT network. Therefore, an appropriate routing scheme should be in place to ensure consistency and energy efficiency in an IoT network. This research proposes an efficient routing scheme by integrating IoT with Blockchain for distributed nodes which work in a distributed manner to use the communicating links efficiently. The proposed protocol uses smart contracts within heterogeneous IoT networks to find a route to Base Station (BS). Each node can ensure route from an IoT node to sink then base station and permits IoT devices to collaborate during transmission. The proposed routing protocol removes redundant data and blocks IoT architecture attacks and leads to lower consumption of energy and improve the life of network. The performance of this scheme is compared with our existing scheme IoT-based Agriculture and LEACH in Agriculture. Simulation results show that integrating IoT with Blockchain scheme is more efficient, uses low energy, improves throughput and enhances network lifetime. Keywords—IoT; efficient; energy scheme; agriculture


I. INTRODUCTION
IoT has started to play a major role in our daily life in recent years, extending our perceptions and the ability to modify the environment around us [1]. IoT is defined as interconnecting physical devices that allow data collection and exchange of these information [2]. The Global Internet of Things Standards Initiative identified IoT as an infrastructure for the information society. IoT permits the sensing or remote operation of devices through established system that creates opportunities to incorporate the universe more directly into computerized systems and improve performance [3].As IoT combines with other technologies such as WSN and blockchain the technology is an illustration of the more general class of smart structures, including inventions, such as smart grids, smart cities, smart homes as shown in Fig. 1 [4] and smart agriculture [5]. The Internet of Things (IoT) has pervasively penetrated the most facets of human life everywhere in recent years, such as towns, households, universities, industrial plants, organizations, agricultural ecosystems, hospitals and health centres [6].
The agriculture sector in particular applies IoT for transformation of farming techniques [7]. IoT is a diverse system with several types of devices from different companies gathering, distributing, storing, analyzing data and taking appropriate action. To combine a large number of different devices the IoT faces many challenges [8]. One such problem is routing, which defines a transmission route from a source www.ijacsa.thesai.org IoT system to base station [9]. In fact, agricultural field in smart farming is generally made up of several clusters that can be designated for different farming activities. Different monitoring strategies may be required for each of those activities [10]. In addition, smart farming is particularly categorized by the high density of IoT nodes in wide range placements. It generally results in heavy data sharing, which directly induces network crowding, radio interfering, latency issues and high energy usage [10]. Though, in most multicluster farms, only basic data from each cluster is generally required, rather than complete data via automated routing as some time only the average temperature and humidity information is needed [11,12]. Incompatibility issues between different IoT devices and between the different areas where IoT is deployed are also posed due to improper communication protocols as shown in Fig. 2 by AWS (Amazon Web Services) [13].
Most IoT communications go from nodes to gateways which route information server remotely. Node-level communication between peers is not very common, excluding for specific applications, for example in smart swarms [14]. IoT applications also require decentralization when no trusted centralized system exists [15]. IoT is well known in smart farming but only patented systems are installed which lead to problems with compatibility and connectivity among dissimilar devices. To address limitations on IoT since its inception, blockchain integration with it will be one of the best solutions. Blockchain is changing many industries by opening up new innovation paths as shown in Fig. 3. The blockchain will decentralized provide protection and privacy to IoT data. Blockchain with IoT using homomorphic encryption offers a secure, decentralized IoT network where the IoT data is stored safely in the blockchain instead of centralized servers [16].
Blockchain technology is an online platform which tracks and records transactions chronologically resources via distributed registers (shared ledgers). Transactions in the network may include such as receiving and sending cash payments for services and products, making reservations, booking hotel rooms or flights, signing contracts, and so on. In addition, blockchain technology allows you to track asset ownership if you lease it to a third party. In short valuable things can be leased, recorded, exchanged and tracked on the blockchain platform and their duplicate transactions records are shared at the same participating agent's time with in the network [17].
Blockchain is the evolutionary next step for smart agriculture. This technology has great potential for smart farming and allows data sharing more transparent, safe and effective for smart farming. Blockchain technology will make IoT data routing more secure and can block attacks on the IoT network especially in agriculture domain because according to our knowledge extracted from literature this problem in smart farming for developing appropriate routing protocols was never been undertaken. Therefore, this research presents a novel routing scheme IoT with BlockChain that will be a feasible routing communication scheme by getting IoT nodes on the blockchain which make the routing data more secure and purified while IoT network with low energy consumption than that of existing networks.   II. LITERATURE REVIEW Researchers developed as system based on WSN technology sensors are deployed in farm which sense the information associated to humidity, temperature, sunlight and wind speed. Artificial neural network algorithm is applied on sensed information to categorize and to form clusters. Clusters are then investigating with predefined data set to generate the output. Because of particular crop condition, the expected result shows the diseases can be caused [18]. Authors developed a system based on media access control layer which collect agricultural farm environmental information periodically and transfer to end user through MAC lay protocol [19]. The researchers suggested a Zigbee protocol to track the agricultural environment. Wireless sensor nodes are used in the farm to capture live information and send this information via the Zigbee protocol to the base station (BS) [20]. Irrigation is a www.ijacsa.thesai.org very important aspect of agriculture in order to improve current structures researchers introduced Low energy adoptive clustering hierarchy (LEACH) protocol in agriculture in which most nodes are sent data to cluster heads, with cluster heads combining and reducing the data and sending it to the base station. At each round, each node uses a stochastic algorithm to decide whether it will become a head of the cluster in this round [21]. Authors developed a multi-path routing scheme in order to reduce the energy expended during the selection process of the forwarding nodes in order to prolong the network's existence [22]. Researchers has developed an analytical data collection protocol that takes into account the clustering and multi-path routing to extend the life of the network in IoT network [23]. Authors proposed a data packet interception protocol between the greenhouse agriculture network IoT nodes as one of the layers of their network. [24,25].
The researchers proposed a cluster-aided multipath routing method that distributes the selected farm among regions and nodes are deployed in the regions and one CH for each region is selected which collect data for nodes and transfer this information to base station. Nodes deployed in the regions use tradeoff technique for decision making to take residual energy among themselves and between the neighbored nodes which lead to low energy consumption [26].
Literature review on existing IoT based systems showed some of its limitations which can be overcome by integrating it with blockchain. Blockchain technology can be applied in various sectors in addition to its basic characteristics such as cryptocurrencies and smart contracts (the most important is shown in Fig. 4 where IoT technologies are required, such as data storage identity management, smart living time stamping services, intelligent mobile crowd sensing supply chain management systems, cyber law and security [27]. Researchers focused on IoT device management through a blockchain [28]. The energy sector may also benefit from the application of a blockchain to IoT and authors developed a blockchain-based system that enables IoT devices to pay for services without human intervention to each other [29]. Researchers have also proposed architectural cluster structure based on blockchain SDN. The Peer to Peer network distributed among controllers and the absence of intermediaries for secure communication leads to the design of the proposed architecture in a stable and comparable way. Inside the SDN domain the P2P relation between the IoT devices can be observed [30]. Authors proposed a blockchain based thin client authentication scheme for IoT network which use public key infrastructure (PKI) to secure communication between IoT devices which identify each ID for each device to avoid the problem of single point of failure [31].
Research proposed decentralized framework based on IoT and blockchain for green agriculture to guarantee authentication and robust credentials of IoT devices named as bubbles of trust which create secure virtual regions (bubbles) which protects the data integrity. This system resists again attacks on IoT network as shown in Fig. 5 [32].

III. MOTIVATION
The related literature focuses on mechanized routing to reduce energy consumption in order to enhance the life of the network which highlights weakness to lead the research problem. Drawing on literature review, CH is held accountable to communicate cluster data straight to BS which leads to high energy consumption. Cluster head far from the BS use high energy to transfer data to BS in one hop. Thus, these problems lead to the rapid exhaustion of cluster heads which are away from the BS. Another issue is the transfer of aggregated data without filtering of redundant information which also lead to consume extra energy. In most Agricultural protocols such as LEACH [21]. CH broadcast information direct to BS and unbalanced load sharing between CHs has preferred to expend their energy quickly, thereby disrupting the data transmission cycle and shortening the life of the network. To resolve these problems this research, propose an energy-efficient and secure IoT with Blockchain scheme.

IV. INTERNET OF THINGS (IOT) NETWORK
At some point of our research we took the preliminary concept from the LEACH protocol which is greatest protocol among available schemes to reinforce network overall performance, minimize energy use and extend the system's lifespan. For the purpose of low energy consumption and more www.ijacsa.thesai.org longer network life than LEACH protocol we propose a novel scheme IoT-based Agriculture. The objective of this scheme is to acquire and share records from IoT nodes installed in the cluster farm and to pass information to BS viz. sink as illustrated in Fig. 6.

A. Initialization Phase
In order to conduct research, we selected area of 500 × 500 2 and distributed that area among clusters and IoT nodes are placed in various clusters randomly. This research used different IoT nodes such as soil moisture, humidity, temperature, air pressure and water level. Nodes in the farm are shared among clusters so that each cluster accommodates all five nodes and does not communicate with each other in the same cluster but communicates most effectively with their CH for transfer of information to base station through sink.

B. LEACH First Order Radio Energy Model
This research work makes specialty on First Order Radio Energy Model wherein radio dissipates E elec = 50 nl/bit to run the transmitter or receiver circuit system and ϵ amp = 100 pJ/bit/m for the transmit amplifier to achieve an satisfactory E b N 0 as shown in Fig. 7 these values are to some extent improved than the available state of the art in the radio design It is also assumed that an e 2 energy loss due to channel transmission. Thus, to transmit a 3-bit message a distance l using radio models the radio dissipates.
( , ) = * +∈ * * 2 To receive message radio expands: A transfer of a message is not cheap process therefore scheme make efforts to reduce transmission distance as well as reducing the number of operations for each message.

C. Mechanism of Clustering
Clustering process started after IoT nodes had been deployed to a cluster farm and each cluster is denoted as G. Every cluster has similar node form, or different depending on the actual requirement. For each cluster one cluster head (CH) is selected and all nodes pass information to their respective CH.

 CH Selection
CH selection takes two things into account: Initial the optimum ratio of nodes in a network and the record of nodes operating as cluster head. It is based totally on random number generation between 0 and 1 to take the decision for each n node. If the random number generated has a lower value than the threshold value (Tn) for that round the communicating node is to become cluster head.
Since p is an acceptable proportion of CH, the number of rounds is referred to as r and G represents set of nodes. There is equal opportunity for all nodes and they have 1/p chance in each round to become CH. Cluster heads inform their member nodes that they have been chosen as CHs through advertising message in advertising phase and member nodes enter the cluster after receiving message from CH.

D. Routing Phase
For efficient routing first we introduced a novel IoT clustering protocol (IoT-based Agriculture) and then integrated IoT with blockchain to get more better results. Three step data transmission technique is introduced. In initial step member nodes collect information share with their respective cluster head and in second step CH transfer information to sink while in final step sink transmit information to BS. Whole process is illustrated in Fig. 8.  Wherever E residual is node level residual energy and where E initial the initial is level energy. Therefore, the optimal number of clusters m opt could be written as Where X is the network diameter while 0 represents the preliminary energy source. To transmit and receive data, this model could be adopted as an extension of the First Order Radio model and calculated as equations "(6)" For the normal transmission range of IoT nodes the distance threshold is . ℎ and Є are energy dissipation to route the radio and transmitter amplifier having values 50 nJ/bit and 10 pJ/bit/ 2 . m is denoted the data packet size and Є is multi path model of transmitter amplifier and having its value is 0.0013 pJ/bit/m4. Therefore receiving energy can be considered as = * Assume that the sink is positioned outside the farm and nodes are deployed in the cluster farm are properly aware of where is the sink is placed and equally unable modify its place. A CH is selected on the basis of higher energy and a lesser Euclidean distance to sink and GH. We assume the Euclidean distance between any two nodes a and b to the next two dimensions of the Euclidean distance as: where x 1 and x 2 are the width dimensions, y 1 and y 2 represent dimensions of length of nodes a and b correspondingly. Nodes which selected as CH collect and transfer information from nodes to grid head (GH) and GH transmit information to the sink. The purpose of this methodology is to reduce unnecessary operations and its features are shown in equation "(9)" WE consumed is calculated using equation (5) WE consumed = ∑ l o (i) x ( E TX Control packet + =1 E RX Control packets) Where WE consumed is the quantity of energy spent by node and l o is the cumulative distance. while E TX ControlPacket is the energy consumption during packets transmission. To obtain the objective specified in equation "(4)" we divide the total node energy into diverse equivalent portions, named as energy levels (EL) that can be determined from equation "(6)". Where Eo is referred to as initial stationary node energy, and TL is defined as total energy level and depends on the IoT node's energy consumption level. and reciprocal proportional to EL When the TL value is minimum then the EL value will be maximum. IoT node chosen as CH remains as CH if the value of EL does not reduce. The node selected as CH remains as CH if the value of EL does not reduce the residual energy and there is no CH reselection step but if the residual energy of CH is reduced by EL, the control packet announcement will transmit the end of its selection as CH. And the new selection cycle for CH starts. Only the transmitting node remains active and all other nodes in the cluster shut off for energy efficiency. The CH has obtained data and begins aggregating to remove any duplication and then bundled as much data as possible for fair usage of bandwidth.

EL = Eo/TL
As in Fig. 9, the entire cycle is shown in the form of a flowchart.

F. Blockchain Integration with IoT
Blockchain smart contracts have the ability to make the routing protocol more secure by eliminating redundant from aggregated data collected by IoT nodes and blocks the attacks on IoT network which lead to low consumption of energy and extend the lifespan of network. This research approach emphasis on using autonomously executed smart blockchain smart contracts. Thousands of collectively distributed mining nodes implements the functions and code of smart contracts and mutually agree with final results. One thing needs to be mentioned over here that blockchain network is made up of mining nodes. A computing machine that gathers, authenticates, and performs transactions is known as mining node as shown in Fig. 10.

V. SIMULATION RESULTS AND DISCUSSION
Packet size for MATLAB simulation is 200 bits. 100 IoT nodes are randomly installed at cluster farm of 500×500 2 with four sink, and one BS is located outdoor. 5000 rounds were considered in each simulation technique. To assess the efficiency of our proposed scheme BlockChain with IoT it is compared with the current LEACH protocol applied in agriculture and IoT based Agriculture considering 5000 rounds in each technique. IoT nodes forward threshold data to the sink and in each round IoT node essential physical metrics are shared with its closest nodes in order to keep them aware of changing environments in the network. Nodes measure their distance from the neighboring nodes after every 100th round and responsible for sharing information with their respective CH which will further transfer information to base station via sink.
 Network stability period First node dead time decides the network's stability period. As shown in Fig. 11 IoT-based agriculture has a much longer period of stability in agriculture than LEACH, as it only transfers data when there is a gap between the current value and the previously taken value. The first node of LEACH exhausts at 168 rounds where IoT-based Agriculture's first node exhaust after 463 rounds and shows 23% improvement.

 Energy consumption
Energy consumption in networks is a major problem and a very important part of protocol development, system design and performance evaluation. IoT nodes are consumed low energy as opposed to WSN, and have longer network life. IoTbased agriculture therefore consumes 68 % less energy than LEACH's in agriculture as shown in Fig. 12. It is the amount of time an IoT network is going to be fully operational. The moment that the first IoT node runs out of energy to send a packet is one of the most used concepts of network lifespan, since losing a node could mean that the network could lose any functionalities. Clustering mechanism plays an important role to reduce or enhance the network life such as LEACH in Agriculture CHs disperses the same energy in each round which reduce its life where as in our proposed scheme IoT based Agriculture CHs disperse different energy in each round due to proper load balancing therefore it increase the life to network by 112% than that of LEACH as seen in Fig. 13. In rural areas farmers often have low incomes especially in developing countries and cannot afford to replace the IoT network. Thus, it is very important for the IoT network to have a longer lifespan to reduce replacement cost burdon on famers and it can only be done if the IoT network uses low energy during data transfer. To make this possible the transfer of redundant data needs to be blocked during data transmission and attack on IoT network may be also avoided.
To block flow of redundant data and attack on IoT network we integrated blockchain with IoT and propose a new scheme IoT with Blockchain and evaluate the results with our own IoT based agriculture scheme. Fig. 14 and Table I show that IoT with the Blockchain scheme increases the network stability period by preventing the transmission of redundant and unwanted data and keeping transmission losses lower. In the simulations of 5000 rounds the initial node of IoT based agriculture exhausts at 463 rounds while IoT with Blockchain exhausts at 513 rounds thus increasing the stability period by 2%.  The energy consumption of IoT with Blockchain is 27 percent less than that of IoT based Agriculture which means that IoT with Blockchain has longer life than IoT based Agriculture. The comparison results are shown in Table II and Fig. 15.
The simulation results in Table III and Fig. 16 indicate the network life for IoT based Agriculture and IoT with Blockchain schemes. IoT with Blockchain shows 5% improvement against IoT based Agriculture.
Accumulated results of all three schemes are illustrated as Fig. 17, 18 and 19. The IoT with blockchain scheme shows much better results that of LEACH and IoT based Agriculture.    (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 4, 2020 428 | P a g e www.ijacsa.thesai.org

 Throughput
Throughput is the number of packets received successfully per second in the sink. In terms of bit rates communication is intermediated across two different links. There are high data rates in IoT based agriculture and IoT with Blockchain connections between nodes and sink while links between source nodes have low data rates. In IoT based Agriculture and IoT with Blockchain nodes are capable to transmit more packets than nodes that use LEACH in Agriculture. Fig. 20 shows that IoT based Agriculture ad IoT with Blockchain achieves higher performance than LEACH in Agriculture although all consider the node-connecting links path-loss and cumulative noise effects.

VI. CONCLUSION AND FUTURE RESEARCH DIRECTION
IoT is one of the latest agricultural technologies and its combination with blockchain now opens up new paths. IoT nodes have the ability to sense environmental characteristics of the cluster farm and transfer sensed information to base station through sink which reduce burdon on CH. While blockchain further eliminate redundant data that avoid to use high energy by IoT nodes during transmission. In this research we proposed an energy efficient IoT with blockchain scheme and the simulation results showed that our proposed scheme has longer network life, consume low energy and outstanding throughput than that of LEACH in Agriculture. In our future research work we will develop a smart model based on IoT and blockchain for clustered farm environment monitoring and information sharing with farmers and other stakeholders for timely decision making to improve agricultural production.