1 Introduction

Since the last decade, the emerging Internet of Things (IoT) paradigm received significant researcher’s attention for intelligent manufacturing based real-time applications. One such application is Intelligent Manufacturing of Smart Farming (IMSF) of IoT to automate the farming process to grow agricultural productivity and conserves supplies like power, water, etc. As the IoT delivered the novel dimension for the precision farming domain, it should be transformative and user friendly for end-users. The farm conditions such as soil depreciation, exhausting lands, excess weather, etc. having severe negative impacts on farm productivity that leads to overall ecosystem failure of the country. As approximately 70% of families are having the main source of income remains agriculture in India, lower farm productivity directly affects the national ecosystem. Farming becomes a vital source for the human being in the Indian subcontinent due to farm products like food, raw materials, and grains. The recent advancement in technology offers automation and flexibility in improving productivity and minimizing extra labor. The IoT paradigm has initiated an appropriate base for precision farming, but it requires several challenges consideration while real-time implementation in Indian agricultural regions (rural areas). In such farming regions, the implementation of IoT enabled SF solutions leads to challenges like connectivity, availability, scalability, and reliability. The connectivity challenge in rural areas recently addressed using WiFi-based Long Distance (WiLD) with affordable deployment cost (Bhagwat et al. 2004; Chebrolu et al. 2007; Hussain et al. 2016). Other than WiLD, fog computing and cloud computing presented for effective and efficient IoT enabled methods for rural agriculture (Tordera et al. 2016; Armbrust et al. 2010). But the use of these techniques solves connectivity problem, but may introduce another challenge of excessive energy consumption of sensor devices. As the sensor nodes are resource-constrained, the design and deployment of IoT enabled SF applications should be resource-efficient while satisfying the Quality of Service (QoS) requirements.

Recently several solutions of SF proposed using Wireless Sensor Network (WSN) deployment due to a cost-effective approach (Kassim et al. 2014; Zhu et al. 2011). The WSN-based methods introduced in two categories such as simulation-based and real-time based. The WSN characteristics like minimum energy consumption, secure, digital data transmission, actuators, and/or sensors integration allow to WSN-assisted IoT SF applications. Farming applications such as fertilizer controlling, soil monitoring, irrigation monitoring, environment monitoring, crop quality monitoring, weather monitoring, etc. implemented using WSN (Ojha et al. 2015). And hence IoT enabled farming considers WSN as a core part while implementing above farming applications. Using WSN for smart farming should address network-level problems such as energy-efficiency, computational-efficiency, and QoS-efficiency. The network-level problems mainly related to the methods of clustering and data transmission that are yet to solve for scalable agricultural applications. In SF, the sensors deployed across the farm collects the periodic on-field data and transmit wirelessly towards the remote station for farm monitoring and decision-making processes. As the sensors are resource-constrained, the process of data collection and multi-hop transmission should be efficient in terms of energy consumption and Quality of Service (QoS) performances of data transmission. The clustering-based solutions proven to be energy efficient in WSNs, this motivates the intelligent manufacturing of energy-efficient SF. The recent simulation-based methods were using conventional clustering techniques such as LEACH (Heinzelman et al. 2000), TEEN (Manjeshwar et al. 2001), SEP (Smaragdakis et al. 2004), DEEC (Qing 2006), etc. which may not be the long term solution for scalable farming conditions.

Novel solution Cross Layer-IoT (CL-IoT) introduced in this paper to address the challenges of optimal clustering and data transmission concerning to intelligent manufacturing of SF applications. The problem of optimal Cluster Head (CH) selection has formulated in this paper by considering the parameters of different layers. It means the cross-layer approach parameters used to compute the probability of each sensor node while performing the clustering and routing operations. After the initial cluster formation, the optimal CH selected for each cluster by performing each sensor node cross-layer probability evaluation. The cross-layer parameters utilized to improve the energy-efficiency with minimum clustering and routing overhead. The data transmission process designed in this paper by using the nature-inspired algorithm to minimize the data forwarding delay and energy consumption. The nature-inspired algorithm designed with novel probabilistic decision rule functions to elect the accurate and efficient route for data transmission. The CL-IoT protocol proposed to achieve a trade-off among the energy consumption of the CHs and delay (QoS) in forwarding the data packets by considering the SF applications. In Sect. 2 presents a brief review of related works on real-time precision farming, simulation-based precision farming, and recent clustering solutions of WSNs. In Sect. 3 presents the design of CL-IoT with system model, problem formulation, clustering, and data transmission techniques for SF applications. In Sect. 4 presents the experimental results. In Sect. 5 presents the conclusion and future work.

2 Related work

Since from last decade several works introduced for precision farming, some of them are designed real-time basic with limited set of sensor nodes, some are designed on simulation-basic using the clustering and other mechanisms with small to large farm areas and sensor nodes.

2.1 Real-time precision farming

The recent works introduced the real-time design and deployment of WSNs for precision farming. Dan et al. (2015) proposed the real-time design and implementation for the Greenhouse conditions controlling application. They used the Zigbee as communication technology in their implementation where sensor nodes deployed to acquire the greenhouse environmental data and transmit that to control nodes. They designed control nodes to monitor the farm application according to periodic data received from the sensor nodes. Thus they considered the phases like data sensing, data transmission, and data analysis. Baranwal et al. (2016) introduced real-time smart farming to cope up with problems like rodent’s detection and crop protection from threats. They designed real-time crop monitoring using periodical data collection and processing operations. For electronic devices and sensor devices integration, they used a python script. Furthermore, Mat et al. (2016) deployed various sensors in the farm region for real-time irrigation monitoring. They used sensors like CO2, humidity, moisture, and temperature and administered the test in a hot environment for the empirical study of scheduled irrigation system and an automated irrigation system. Lerdsuwan et al. (2017) proposed a recent energy-efficient technique for real-time data transmission. They designed an algorithm to reduce the sensor node’s energy consumption with assured QoS performance for IoT enabled smart agriculture. Farzad Kiani et al. (2018) deployed various sensor nodes in the agricultural region to monitor the temperature, soil moisture, and humidity. The process of water supply automated via their approach and works as per the actual needs. It helps to minimize water consumption. However, the real-time methods are presented with a very limited set of sensors and farm area which is not suitable for actual SF. Lack of scalability, energy-efficiency, and fault tolerance of these methods suggests designing the simulation-based techniques before its real-time deployments.

2.2 Simulation-based precision farming

Due to constraints at the real-time implementation of precision farming, other researchers presented simulation-based precision farming using various energy-efficient methods recently. Khedo et al. (2014) introduced the PotatoSense method for precision farming. They implemented and evaluated the PotatoSense for the automatic potato farm controlling via simulations. The design of PotatoSense based on the different energy-efficient algorithms and the Hybrid Energy-Efficient Distributed (HEED) clustering approach. Nikolidakis et al. (2015) proposed Equalized Cluster Head Election Routing Protocol (ECHERP) as an energy-efficient solution. They designed and simulated ECHERP for the irrigation monitoring farm application. Sonam Maurya et al. (2017) introduced another simulation-based approach for precision farming. The hybrid routing solution proposed for recurrent threshold values for effective precision farming services. The design of the hybrid routing method based on various data transmission types like fuzzy clustering and direct data transmission. They achieved energy consumption reduction by threshold-based routing operations. Yousef Hamouda et al. (2018) analyzed the problem of sampling interval selection for energy-efficiency in applications of smart farming using WSNs. With this connection, the sensor nodes sense the soil moisture and temperature during each time interval in a particular farm region. Variable sampling interval then computed according to temperature and soil data periodically. Parganiha et al. (2018) proposed the clustering approach using the method of hybrid coverage to minimize the energy utilization for smart farming applications. The least clustering cost technique was considered by them to select the Cluster Head (CH) and the best number of sensor nodes as Cluster Members (CM). Fathallah et al. (2018) recently introduced a novel algorithm for smart farming using the Routing Protocol for Low power and lossy networks (RPL). They defined as Partition Aware-RPL (PA-RPL) for smart farming. The routing has built according to the partition of farmland that raises the efficient in-network aggregation. Agrawal et al. (2019) proposed a novel product density model to estimate the energy demands at the base station by considering precision agriculture application. Moreover, an Enhanced Duty Cycling technique designed using residual energy parameters. Most of these techniques rely on conventional solutions of clustering and data transmissions that cannot solve the problems of SF entirely by considering the long communication distances.

2.3 Clustering and data transmission methods

This section presents the recent algorithms of clustering and data transmissions based on different techniques like fuzzy systems, nature-inspired algorithms, etc. Neamatollahi et al. (2017) proposed the fuzzy-model-based clustering algorithm FHRP (Fuzzy-based Hyper Round Policy) to improve the network lifetime of WSNs. The distance from BS and residual energy parameters exploited as input to fuzzy model to compute the HR length. Zhang et al. (2017) proposed energy-efficient routing protocol for WSN called E2HRC (Energy-Efficient Heterogeneous Ring Clustering). The E2HRC algorithm designed to enhance the performance of existing RPL (Routing Protocol for Low-power and Lossy Networks). Behera et al. (2018) modified the LEACH protocol to enhance the network lifetime performance of IoT applications. In LEACH, the author proposed the threshold limit for CH selection along with parallel power level switching among the sensor nodes. Kaur et al. (2018) introduced the GSTEB (General Self-organizing Tree-based Energy Balance) routing protocol to improve inter-cluster data aggregation. The improved ACO (Ant Colony Optimization) algorithm exploited to select the efficient CH nodes. The hybrid soft computing algorithm used to transmit data from CHs to the sink node. Kaur et al. (2018) proposed PSO (Particle Swarm Optimization) based novel clustering algorithm for WSNs to address the problems related to unequal and UFC (Fault-Tolerant Clustering) called PSO-UFC. Anthony Jesudurai et al. (2018) proposed IEECHS (Improved Energy Efficient Cluster Head Selection) for IoT enabled WSNs. Wang et al. (2018) proposed another recent clustering protocol for energy consumption reduction in IoT enabled WSNs, they designed the algorithm of uneven cluster formation to achieve energy efficiency and load balancing. Preeth et al. (2018) proposed the FEEC-IIR clustering protocol which is based on FEEC (Fuzzy-based Energy-Efficient Clustering) and IIR (Immune-Inspired Routing) methods for WSN-assisted IoT applications. The adaptive fuzzy-based decision-making function was used for efficient CH selection. Aftab et al. (2019) introduced the HSCS (Hybrid Self-organized Clustering Scheme) algorithm by for IoT enabled drone-based cognitive networks; they used the hybrid solution using DA (Dragonfly Algorithm) and GSO (Glowworm Swarm Optimization) techniques. Faizan Ullah et al. (2019) proposed the energy-efficient clustering and routing algorithm based on three-layer hybrid clustering by. The limit control packets exchange among the nodes at each round to select the lower layer head. Saranraj et al. (2019) proposed clustering protocol with the main focus on optimal CH selection by utilizing the distance with other sensor nodes and the current status of energy. The scheduling of nodes as a cluster member and CH depends on its distance and current consumption factors to enhance the network’s lifetime. Micheletti et al. (2019) proposed novel clustering technique for heterogeneous WSNs by combining definitions of the CH routing tree and CH rotation to balance the energy consumption of node. Chalapathi et al. (2019) introduced the clustering optimized for IoT enabled WSNs in which they proposed the time synchronization protocol E-SATS (Efficient and Simple Algorithm for Time Synchronization). Behera et al. (2020) proposed I-SEP (Improved-Stable Election Protocol), they implemented a threshold-based cluster head selection for a heterogeneous network. All the clustering methods mainly focused on to achieve the energy efficiency for WSNs/or WSN-assisted IoT applications. Achieving the trade-offs among various challenges of SF applications using these protocols is a challenging task.

2.4 Research motivation and contributions

The recent progress and methods show that the clustering techniques already acceptable solutions to achieve energy efficiency via the optimal CH selection and stable clustering. The intelligent manufacturing of IoT assisted SF is, however, challenging using those methods due to factors such as density, farm area, long-distance communications, higher delay/latency, and packet losses. The SF applications requirements concerning with the energy efficiency, lower latency, and lower data transmission delay. This work motivates us to present the IMSF solution by considering the requirements of different layers while selecting CH and forming stable clusters to address the energy asymmetry problem for SF applications. The contributions are:

  • The protocol CL-IoT differs from the above protocols as it mainly focused on scalability and efficiency (energy and QoS) trade-offs for SF applications in this paper through the cross-layer clustering and data transmission solution.

  • Cross-layer based evaluations of sensor nodes and selects the optimal and stable CH node using a simple heuristic technique with minimum clustering and CH selection overhead.

  • Nature-inspired algorithm based inter-cluster and intra-cluster data transmissions via optimal and stable route formation.

  • Extensive performance evaluations via the simulation studies of proposed and existing works on various farming conditions and applications.

.

3 CL-IoT: intelligent manufacturing of smart farming

This section presents the complete design of proposed CL-IoT protocol to address the SF applications key requirements such as energy-efficiency, lower latency, and lower communication delay. First we present the generalized system model and problem definition followed by protocol designing assumptions, cross-layer clustering for optimal CH selection, nature-inspired algorithm based data transmission.

3.1 System model

Figure 1 showing the WSN-assisted IoT network for SF applications using the actuators and Gateway node. The \(N\) number of sensor nodes (red color) \(S=\left\{{S}^{1},{S}^{2}, \dots {S}^{N}\right\}\) randomly deployed in farm area which are indicated by IoT nodes in this paper. Each IoT node may consist of group different farm sensors such as soil moisture, temperature, humidity, light intensity, and wind speed. The network is divided into \(M\) number of clusters and having blue color Cluster Heads (CHs) \(Q=\left\{{CH}_{1 }, {CH}_{2}\dots {CH}_{M}\right\}\). The data received and aggregated at each \(CH\) node further transmitted to the green color Gateway/Sink/Base Station (BS) node. All the communications performed using the Zigbee interface (IEEE 802.15.4. standard). By considering this model of SF, we formulate the two key problems to address in this paper such as:

  • The communications in precision agriculture are long-distance which consumes more energy for data transmission of IoT nodes. Therefore the energy-efficient required especially in farm fields IoT nodes. The energy- efficiency can be achieved by selecting the optimal CH node and address the energy asymmetry problem.

  • Discovering the data transmission paths with the goal of minimum transmission delay and latency with minimum energy consumption is optimization problem of this work.

Fig. 1
figure 1

Proposed System model of SF

Along with this, proposed system model having some assumptions such as:

  • Network consists of on-field sensor nodes and two Gateway/Sink/BS nodes deployed opposite sides to address the long-distance communication problems.

  • The sensor nodes are temperature, soil moisture, relative humidity, or light intensity to monitor the SF applications.

  • The sensor nodes are homogenous and deployed randomly across the farm field.

  • The sensor nodes are static and having a unique ID with energy constraints.

  • The both sink nodes are outside of the farm field without energy constraints.

  • The multi-hop and symmetric manner communications applying among the sensors in network.

  • After deployment of network, \(K{\text{-}}means\) algorithm used for initial pre-defined \(M\) number clusters formation of network.

  • We assume that each sensor in the IoT node periodically collects the data and fused at the local unit to transmit towards CH node.

Table 1 demonstrates the list of notations with their significance used in CL-IoT protocol.

Table 1 List of notations

3.2 Optimal CH selection

After the portioning of \(N\) number of sensor nodes into the \(M\) number of groups or clusters, the optimal CH selection proposed in this paper. Each cluster consist of Z number of IoT nodes i.e. \({H}^{j}=\{{h}^{1 }, {h}^{2 }, \dots {h}^{Z }\}\), where \({H}^{j}\) is set of IoT nodes belongs to the \({j}{\text{th}}\) cluster. The energy-efficient CH selection and energy asymmetry problem is solved by considering the parameters of different layers. Figure 2 and Algorithm 1 shows the functionality of proposed cross-layer CH selection method. As the sensor nodes are aware about the gateway nodes location information, the CL-IoT protocol initiates the process of CH selection in scattered manner. As showing in figure and Algorithm 1, for each cluster the optimal CH selection process performed periodically by computing the each sensor nodes probability values. By using the parameters from network layer denoted as \({P}_{i}^{1}\), physical layer denoted as \({P}_{i}^{2}\), and MAC layer denoted \({P}_{i}^{3}\), the probability value \({P}_{i}\) computed for each \({i}{\text{th}}\) sensor node in \({j}{\text{th}}\)current cluster. From the network layer, the geographical distance from \({i}{\text{th}}\) sensor node to associated gateway node i.e. sink is computed. From physical layer two parameters computed such as residual energy and Received Signal Strength Indicator (RSSI). From the MAC layer, queue optimization parameter computed. The layer-wise parameters computations elaborated below.

1. Network layer: the shortest geographic distance of current node \({h}^{i}\) towards to the gateway node \(BS\) reduces the energy consumption, network latency, and overall transmission delay. Thus the probability value \({i}{\text{th}}\) sensor node at network layer is computed as:

$${P}_{i}^{1}=1-\left(\frac{dist \left({h}^{i}, BS\right)}{{\text{d}}_{\text{m}\text{a}\text{x}}}\right)$$
(1)

where \({\text{d}}_{\text{m}\text{a}\text{x}}\) any positive maximum distance value. In this work, we set 1000 m as maximum allowable distance. The distance parameter at network layer among sensor node and BS/CH is estimated using Received Signal Strength Indicatory (RSSI) (Kaur et al. 2018; Nayak et al. 2017).

2. Physical layer: For WSNs, two important parameters at physical layer computed for each IoT node such as residual energy and RSSI. Most of clustering protocols are based on sensor nodes energy for CH selection. The higher residual energy of IoT node is given more priority for CH selection. For the computation of remaining energy, we used the principal request radio model. The remaining energy of \({i}{\text{th}}\) node is computed at time \(t\) as:

$${R}_{i}= {E}_{initial}^{i}- {E}_{consumed}^{i}$$
(2)

where \({E}_{initial}^{i}\) and \({E}_{consumed}^{i}\) \({i}{\text{th}}\) node initial energy and currently consumed energy. The remaining energy value computed in range of 0.001 to 0.5 Joules. As the initial energy set is 0.5 Joules for each node.

Along with the energy-efficiency, we want to make sure the efficient Packet Delivery Ratio (PDR), therefore we computed the RSSI value for each IoT node. The threshold based probability value computed for RSSI parameter of each IoT node. The CL-IoT computes the RSSI threshold which is nothing but the average beacon packet receiving rate \(RR\) from \(Y\) number of neighbors at current time \(t\). The RSSI threshold at current time t is computed as:

$${RSSI}_{t}=\left(\frac{{RR}_{t}}{Y}\right)$$
(3)

The RSSI value of \({i}{\text{th}}\) node is compared with \({RSSI}_{t}\) and accordingly the probability value set.

$${RSSI}_{i}= 0.99, \quad if \,\,RSSI\left({h}^{i} \right) > {RSSI}_{t}$$
(4)
$${RSSI}_{i}= 0.25,\quad if \,\, RSSI\left({h}^{i} \right)< {RSSI}_{t}$$
(5)

If the RSSI value is \({h}^{i}\) more than \({RSSI}_{t}\), it mean it will get good PDR performance and hence set the maximum probability value else the minimum probability value set to achieve the reliability in CH selection. Finally, the probability value \({i}{\text{th}}\) node at physical layer is computed as:

$${P}_{i}^{2}= {RSSI}_{i}+ {R}_{i}$$
(6)

3. MAC Layer: To avoid the congestion situations and excessive energy consumption due to such congestions the queue optimization parameter computed from the MAC layer. The MAC layer queue optimization parameter helps to enhance the PDR performance and minimize the energy consumption by measuring the level of congestion at each IoT node. The MAC layer probability value of \({i}{\text{th}}\) node is then computed by means of queue optimization computation as:

$${P}_{i}^{3}= \frac{{PR}_{i}}{BW}$$
(7)

where, \({PR}_{i}\) reception of packets in bytes at \({i}{\text{th}}\) node and \(BW\) is total buffer size in bytes.

Finally, the combined probability value computed as showing in Algorithm 1 by calling function \(getProbability \left(\right)\). The layers probabilities summarized by one probability value showing in Eq. (8). IoT nodes elected as the CHs based on the higher probability value \(P\). The probability value of \({i}{\text{th}}\) node is computed as:

$${P}_{i}=w1\times {P}_{i}^{1}+ w2 \times {P}_{i}^{2}+ w3\times {P}_{i}^{3}$$
(8)

Each IoT nodes computed probability value is in range of [0, 1]. The \(w1-w3\) represents the weighting parameters for network, physical, and MAC layer probability values respectively. Thus during the CH selection process, these weighting factors justify the specific effect while computing the nodes probability values. The summation of all weighting factors should be 1, i.e. \(w1+w2+w3=1.\)

Algorithm 1 further shows that if the first two nodes having the similar probability value at current time t, then the node with higher residual energy is elected as the CH node and broadcast their CH selection status to all other nodes. The remaining all nodes joins as CMs to elected CH once receiving the CH selection status packet. The normal nodes may receive the status packets from more than one IoT nodes and hence those nodes join the CHs with higher RSSI value. After the cluster formation and CH selection process, the unique IDs assigned to each cluster. According to the Time Division Multiple Access (TDMA) channel access schedules, the set of CHs elections periodically announce in network to solve the CH energy asymmetry problem.

Fig. 2
figure 2

Architecture of cross-layer-based optimal CH selection

3.3 Cluster heads updating

As the WSN-assisted SF applications are resource constrained, CL-IoT updating the CHs in dynamically to achieve the uniform energy consumption and load balancing. The process of CH updating performed periodically according to TDMA timeslots by observing:

  • If current CH failed due to natural disasters, then re-election of CH initiated.

  • If current CH probability value suppressed by any other CM probability value in same cluster, then current CH relinquish its role and become the CM, and then CM with highest probability value becomes the new CH as noticed in Algorithm 1.

To reduce the congestion and energy consumption at CH nodes, the CL-IoT protocol checks that if any CH node received the same data packet which already received previously, then it drop that redundant data packet.

figure a

3.4 Data transmission using nature inspired algorithm

After the clustering, the intra-cluster and inter-cluster transmission tasks performed according to TDMA schedules. The key objectives are optimizing the data transmission process by minimizing the inter-cluster and intra-cluster communication costs in terms of energy-efficiency and computational-efficiency. Routing optimization is a multi-objective optimization problem and solved by using the nature-inspired algorithms. Ant Colony Optimization (ACO) is a well-known nature-inspired algorithm. As the ACO has better performance on multi-path optimization problem, it is used to optimize links in intra-cluster and inter-cluster data transmissions in this paper.

In general, ant colony expressed as the colonies of insects with very high capability to examine and utilize their conditions notwithstanding their very limited displacement way i.e. walking compared to other species i.e. flying. The environment utilized by them for storage, processing, and sharing the data among all the ants in the colony. According to this behavior, the ACO algorithm proposed the first time by Dorigo et al. (1999). Many studies proposed recently based on ACO for optimal clustering and multi-objective routing (Domínguez-Medina et al. 2010; Mohajerani et al. 2015; Jiang et al. 2018; Li et al. 2019). The CL-IoT proposed an ACO-based routing scheme to enhance the QoS and minimize the energy consumption for WSN-assisted intelligent manufacturing of smart farming applications.

We proposed new probabilistic decision rule function to improve performance of data transmission by working on more accuracy to make a choice using the cross-layer parameters. Algorithm 2 presents the ACO algorithm basic steps for optimal route selection.

figure b

As noticed in Algorithm 2, the route selection or next-hop selection is based on the probability computation in ACO (Eq. 9). It allows the node \(s\) to evaluate the available choices within its coverage area by computing the cross-layer probability value of each choice. Then node \(s\) select the next node \(h\) with the highest probability value. The algorithm is also depends on the choice of pheromone. In existing cases, initially random routes selected by ants and leave the amount of pheromone \(\tau\)in such routes; however the pheromone quantity is not fixed.

In smart precision agriculture, the periodic events are raised by \(CM\) or \(CH\) nodes for data transmission towards \(CH\) or \(G\) node respectively. On detection of such events, the source node \(s\in CM or CH\) wants to send number packets towards the intended destination \(d \in CH or G\). Each packet is transmitted to next hop via ant. The ants select the next relay node based on two functions such as amount of pheromone and cross-layer probability value of node. The cross-layer probability value is computed similar way as discussed in above section for optimal CH selection (using Eq. 8). Both values computed during the process where ant \(a\) moves from node \(s\) to \(h\) using below proposed probabilistic decision rule function \({DR}_{s,h}^{a}\):

$${DR}_{s,h}^{a}= \left\{\begin{array}{ll}\frac{\left[\tau {\left(s,h\right)}^{\alpha }\right].\left[\mu {\left(s,h\right)}^{\beta }\right] }{\sum _{h\in n}\left[\tau {\left(s,h\right)}^{\alpha }\right].\left[\mu {\left(s,h\right)}^{\beta }\right]} ,&\quad if \,\,a \,\,not \,\,belongs\,\, to\,\, {tabu}^{h}\\ 0,&\quad otherwise\end{array}\right.$$
(9)

where \(\tau (s, h)\) function used to compute the pheromone value among node \(s\) and \(h\)., \(\mu (s, h)\) is the heuristic value related nodes cross-layer probability value, \(n\) is the total sensor nodes inside the range of node \(s\). The relative influence of the heuristic information and pheromone trail is controlled by the parameters of \(\beta\) and \(\alpha\), and \({tabu}^{h}\) is the packet identities already received by \(h\). For each link \((s, h)\), the pheromone trails \(T\) connected with values ranging in between \(\tau \in \left[\text{0,1}\right]\). The second function is related to the heuristic value \(\mu\) of node \(h\) is computed as:

$$\mu \left(s, h\right)= \frac{{\left({P}_{s}\right)}^{-1}}{\sum _{h \in n}{\left({P}_{h}\right)}^{-1}}$$
(10)

where \({P}_{h}\) is probability value of \(h\)node computed using Eq. (8) which is based on the parameters such as geographical distance, residual energy, RSSI value, and MAC layer link optimization parameters. The computation of all the parameters is similar to one used for clustering process except the geographic distance parameter. For route selection, the geographic distance is computed from \(h\) to \(d\) as:

$${P}_{h}^{1}=1-\left(\frac{dist \left(h, d\right)}{\Delta }\right)$$
(11)

where, \(\Delta\) any positive maximum distance value. In this work, we set 1000 m as maximum allowable distance. \({P}_{h}^{1}\) is network layer probability value of node \(h\).

The probability of selecting the next hop is computed by using the cross-layers parameters as discussed above section. This helps to achieve a more accurate and efficient route formation for data transmissions in the network. Using this rule, \(s\) selects the next hop \(h\) to forward current farm information until the intended destination node \(d\). As compared to existing methods, we used a similar ACO solution; however, we optimized the function probabilistic decision rule by computing the heuristic function \(\mu \left(s, h\right)\) using cross-layer parameters rather than just relying on residual energy of node. The proposed route formation algorithm allows selecting the accurate next-hop selection and delivering the optimized results in terms of energy-efficiency, computational-efficiency, and QoS-efficiency.

4 Experimental results and discussions

4.1 Network scenarios

The implementation and evaluation of the proposed CL-IoT protocol for SF was carried out in a network simulator (NS2). The networks were designed with varying numbers of IoT nodes deployed randomly in square farm area of size 1000 × 1000 m. Table 2 gives a list of simulation parameters. The symbols represent the units like m represents meters, nJ represents nanoJule, m/s represents meters per second, kbps is kilo bytes per second, and CBR is constant bit rate.

Table 2 Default network parameters

4.2 CL-IoT evaluations with state-of-arts

The performance of CL-IoT compared with three state-of-art protocols such as LEACH (Heinzelman et al. 2000) as baseline protocol, Energy-Efficient Cntroid-based Routing Protocol (EECRP) (Shen et al. 2017), and FEEC-IIR (Preeth et al. 2018). Along with the conventional LEACH protocol, two recent protocols EECRP and FEEC-IIR considered for the performance evaluation. The functionality of FEEC-IIR already studied in section II. The functionality of EFFC-IIR demonstrated as:

  • After network deployment, the clustering (K-means) applied to initially divide the network into different clusters.

  • For optimal CH selection, adaptive fuzzy-based decision-making technique designed along with TOPSIS. The fuzzy rules designed in this process to select the optimal CH for the current cluster by considering the three main criteria and six sub-criteria.

  • After clustering, the immune-inspired optimization technique introduced for reliable data transmission in within cluster and among the clusters. The data transmission algorithm using this optimization algorithm focused on communication cost reduction.

The EECRP protocol selected for performance evaluation due to its applicability for the long-distance communication-based IoT applications. In brief, the EECRP designed with aim of higher energy efficiency with energy resources management algorithm for WSN-assisted IoT networks. The key functions of EECRP are:

  • The clustering performed using the energy centroid position and nodes residual energy,

  • The design of the optimization algorithm based on CH nodes and total dead nodes proposed, and.

  • The protection technique introduced to minimize the long-distance communications to minimize the CH node’s energy consumption.

The functionality of the FEEC-IIR protocol is similar to the proposed CL-IoT, except the fuzzy logic approach used in the CH selection and IIR optimization algorithm used for data transmission. CL-IoT protocol compared with state-of-art protocols in three performance criteria’s as discussed earlier (energy, computational, and QoS efficiency). Upcoming sub-sections present the simulation results and their analysis.

4.3 Energy efficiency

Energy-efficiency of CL-IoT protocol evaluated using two main performance parameters such as network lifetime and average energy consumption. Before computing the network lifetime, it is required to compute average energy consumption. After end of simulation, first total remaining energy of entire network \({E}^{tot}\) computed as:

$${E}^{tot}= \sum _{i=1}^{N}{E}_{i}^{initial}-{E}_{i}^{consumed}$$
(12)

where \({E}_{i}^{initial}\) represents initial of  \({i}\)th node, \({E}_{i}^{consumed}\) represents consumed energy of \({i}\)th node. Total number of nodes in network represented by \(N\). Using the outcome of Eq. (12), the performance of average energy consumed \({E}^{avg }\) computed as:

$${E}^{avg }= \frac{{E}^{tot}}{N}$$
(13)

Network lifetime and energy consumption parameters are related to each other, hence network lifetime is computed in rounds as:

$$NL=\left|\frac{{R}^{tot}}{\epsilon}\right|$$
(14)

where \({R}^{tot}\) is total remaining energy of network and \(\epsilon\) is control parameter to get the number of rounds.

Energy efficiency performance concerning average energy consumption and network lifetime are demonstrated in Figs. 3 and 4 respectively. Figure 3 proves the CL-IoT energy-efficiency concerning the average energy consumption as compared to all existing methods. Figure 4 demonstrates that CL-IoT protocol prolonged the network lifetime significantly as well, especially high-density networks. This is due to the cross-layer-based and less overhead clustering process of CL-IoT. The CL-IoT protocol uses the local clustering functionality which minimizes the energy consumptions and clustering overhead.

Fig. 3
figure 3

Performance evaluation of average energy consumption

The nature-inspired algorithm of CL-IOT for data transmission makes sure the minimization of overall network cost in CL-IoT. Among the other protocols, the energy efficiency of the FEEC-IIR protocol shows the higher as compared to the other EECRP and LEACH protocols as the fuzzy model used the various parameters to select the optimal CH node. In EECRP only residual energy and centroid location parameters utilized to select the CH node which is not sufficient to reduce the energy consumption; however, its performance is better compared to conventional LEACH protocol. The LEACH protocol selects the CH nodes based only on the energy threshold parameter which is not scalable and energy-efficient for the long-distance communication applications.

Fig. 4
figure 4

Performance evaluation of network lifetime

4.4 QoS-efficiency

Along with energy-efficiency analysis, QoS-efficiency is also the key requirements for SF applications. QoS-efficiency is evaluated using average communication delay and Packet Delivery Ratio (PDR) parameters. The average communication delay parameter calculates the average time among the packet generation time at all sources and time of packet received at the all destination nodes. It is computed as:

$$delay=\frac{\sum _{i=1}^{Z}{d}_{t}^{i}+{d}_{p}^{i}+{d}_{pc}^{i}+{d}_{q}^{i}}{N}$$
(15)

where \(Z\) is number of total transmission links, \({d}_{t}^{i}\) is transmission delay of \({i}\)th link, \({d}_{p}^{i}\) is propagation delay of \({i}\)th link, \({d}_{pc}^{i}\) is processing delay of  \({i}\)th link, and \({d}_{q}^{i}\) is transmission delay of \({i}\)th link.

PDR is also major QoS performance metrics that is computed as the ratio of successfully received packets at all the destinations by total number of generated packets at all the sources during entire simulation period. The PDR is computed as:

$$PDR=\left(\frac{{P}_{r}}{{P}_{g}}\right)\times 100$$
(16)

where \({P}_{r}\) represents total successfully received packets at all destinations and \({P}_{g}\) represents total generated packets at all the sources.

Average end to end delay performance observed in Fig. 5 under a varying number of IoT nodes. The performance of CL-IoT evaluated concerning average communication delay against the existing methods. Delay is a key requirement for IMSF applications, therefore lower the delay better the farm monitoring and productivity. With the increased density, high data traffic, and congestion, the average delay value also increased. But the CL-IoT protocol achieved the lower average communication delay performance compared to state-of-art protocols. The clustering and data transmission algorithms of CL-IoT are based on the optimal selection approach using cross-layer parameters which shows a great impact on average delay performance. The nature-inspired algorithm using novel probabilistic decision rule function in CL-IoT accurately selects precise routes for data forwarding with minimum communication cost and higher PDR (Fig. 6). CL-IoT protocol delivered more robust and consistent data forwarding IoT nodes based on RSSI based link quality parameters along with distance and energy parameters.

Fig. 5
figure 5

Performance evaluation average end-to-end delay

Fig. 6
figure 6

Performance evaluation of PDR

Figure 6 demonstrates the PDR performance measurement and evaluation compared to state-of-art protocols for varying number of IoT nodes. As discussed earlier, the CL-IoT protocol achieved higher PDR performance compared to all methods evaluated. Due to the increased IoT nodes density and network congestions, the performance of PDR decreased, but CL-IoT achieved higher PDR for all network scenarios. This is due to the cross-layer approach used in CL-IoT for the optimal CH selection and data transmission with the main focus on the selection of stable CH nodes and routes for data transmission. Due to the proposed nature-inspired approach the accurate data forwarding nodes selected which leads to reliability of data packets communicated between the intended source and destination pairs in the network compared to existing methods. On the other side, among the existing methods, FEEC-IIR shows better results compared to LEACH and EECRP protocols due to the optimization algorithm designed to achieve higher data reliability with minimum communication overhead. In the EECRP protocol, the distance and energy parameters were used to establish the routes without considering link quality and congestions

4.5 Computational efficiency

The computation efficiency evaluated in terms of average communication cost and communication overhead of protocols under the varying IoT nodes. The communication cost measured in this regards by means of Packet Loss Ratio (PLR). The communication cost (CC) increases in network due to congestions and frequent paths disconnection and hence it is measured as:

$$CC=1-\left(\frac{{P}_{r}}{{P}_{g}}\right)$$
(17)

The Communication Overhead (CO) calculated as the ratio of routing packets to the data packets counted during entire simulation period. It is computed as:

$$CO=\sum _{t}\left(\frac{{RT}^{t}}{{DT}^{t}}\right)$$
(18)

where, \({RT}^{t}\) represents routing packets counted and \({DT}^{t}\) represents data packets counted at time t.

Figure 7 demonstrates the performance evaluation of the CL-IoT protocol against the existing protocols in terms of average communication cost for SF applications. As the density increases, the communication cost performance also significantly increases due to frequent routes disconnections, frequent re-transmissions, and congestions. But as observed in Fig. 8, the CL-IoT reduces the communication cost values compared to other protocols with a significant margin. This is because of appropriate parameter utilization in CL-IoT of IoT nodes while selecting CH or data forwarder compared to other methods. The cross-layer technique in CL-IoT reduces the CH re-election rounds as well as routes disconnections and hence it resulted in reduced communication cost values

Fig. 7
figure 7

Performance evaluation of communication cost

Fig. 8
figure 8

Figure performance evaluation of communication overhead

The performance of communication overhead demonstrated in Fig. 8 with varying density of IoT nodes. The communication overhead of CL-IoT reduced compared to all existing protocols due to the reasons discussed above. The parameters used in CL-IoT minimize the processes required for optimal CH selection and route formation as compared to existing protocols, and hence this leads to reduced communication cost and communication overhead for CL-IoT protocol. The reduced processes of route formations lead to a reduction in frequent route disconnections, re-transmissions, and congestions and hence reduction of unnecessary routing packets as well. Routing packets has increases in the network due to frequent re-clustering and route re-construction tasks. The reduction of routing packets minimizes the overall network communication overhead performance for CL-IoT protocol compared to state-of-art protocols.

Table 3 demonstrates the average performance analysis of all four protocols in terms of energy-efficiency, QoS-efficiency, computational-efficiency using the network lifetime, avg. end-to-end delay, and communication overhead parameters respectively. It is observed in Table 2, the energy-efficiency of CL-IoT protocol improved by 220 rounds. Similarly, QoS-efficiency achieved via the reduction in communication delay by 0.59 ms and computational-efficiency achieved by reduction is communication overhead by 0.43 rate. The performance improvement of CL-IoT is significant by considering the scalable farming applications.

Table 3 Average performance analysis

5 Conclusion and future work

The aim of this paper to present the intelligent manufacturing of IoT enabled SF concerning to energy-efficiency, QoS-efficiency, and computational-efficiency for small to large farming applications. The proposed CL-IoT protocol designed and evaluated against the state-of-arts protocols such as conventional LEACH clustering protocol, recent EECRP, and FEEC-IIR protocols. The CL-IoT focused on two aspects such as optimal CH selection and robust data transmissions using the cross-layer parameters. The existing protocols use energy and distance in general for clustering and data transmissions which did not solve the problems of long-distance communications in farming applications. In CL-IoT, the sensor nodes evaluated by considering network, physical, and MAC layer parameters to achieve more stable and precise clustering as well as data transmissions. For data transmission, we utilized the ACO as a nature-inspired algorithm to establish more reliable routes with the aim of computational, QoS, and energy-efficiency. The experimental results prove that CL-IoT overcome the problems of existing solutions by enhancing the network lifetime and PDR performances and minimizing the average end-to-end delay, average energy consumption, communication cost, and communication overhead performances. For future work, we suggest directions to extend CL-IoT protocol such as (1) designing the appropriate data aggregation solution at CH nodes by considering the real-time farm monitoring application using fuzzy logic rules to keep the important data and discard the redundant data, (2) investigation of CL-IoT by designing the simulation scenarios like simulation time, farm size, data rate, etc., (3) security is another challenge for IoT applications, so the future step for the CL-IoT protocol will be the secure data transmissions of farm data using the lightweight approach in presence of attackers, and (4) re-designing optimal CH selection algorithm using an efficient nature-inspired algorithm to further optimize the performances of CL-IoT protocol.