1 Introduction

Internet of Things (IoT) paradigm represents various objects that are computing devices such as sensors and actuators connected on networks. Interconnection among the objects shares information and generates knowledge and then creates intelligent behaviors. IoT is inevitable technology to implement ubiquitous computing environment and various smart services for humanity are enabled through the IoT technology [1,2,3,4,5]. The importance of IoT is expanding into various fields, and particularly in industrial fields, IoT improves the efficiency of production and responds quickly to emergencies, leading to the next generation of manufacturing industry. In IoT applications, a wireless sensor network (WSN) gathers information from objects (e.g., sensor or actuator devices) and deliver the information to a server in the Internet cloud [6,7,8,9,10,11,12,13,14]. Afterwards, services are provided through Peer-To-Peer (P2P) networking between a mobile sink and an object in the sensor field.

For various IoT applications such as industrial monitoring, mobile sink nodes are exploited for application services. When mobile sink nodes appear in a sensor field, the sensing information of IoT devices can be delivered to a network server and service users are provided with their services through them. Moreover, a mobile sink node can be a mobile terminal of users and connects to the WSN using P2P networking. For this to function, delay-tolerant functionality should be included to the P2P network. Network connectivity of the delay-tolerant industrial network is intermittently maintained by the mobile sink nodes. Thus gateway nodes among IoT devices which employ delay-tolerant capability are necessary. They gather sensing information from neighbor IoT devices and deliver the information when they meet mobile sink nodes. That is to say, a delay-tolerant network (DTN) fulfills the role of an opportunistic network. They store sensing information until new encounters (i.e., mobile sink nodes) join to the sensor filed [15]. Figure 1 represents the delay-tolerant IoT network.

Fig. 1
figure 1

An IoT delay-tolerant network

Because the transmission efficiency in the delay-tolerant network depends on the data-forwarding scheme, a proper data forwarding scheme considering energy consumption should be provided. Although gateway nodes meet mobile sink nodes as new encounters of the sensor field, data transmission during bad wireless conditions consumes more transmission energy and reduces transmission efficiency. For the energy saving, gateway nodes need to avoid unnecessary data transmission in bad network conditions; to achieve this, estimating network status is needed. In general, DTNs have two types of data forwarding schemes: oblivious-based and delegation-based. In oblivious schemes, gateway nodes do not exploit any knowledge for the network status whereas they do in delegation-based scheme [16]. The proposed method takes advantage of the delegation-based scheme by maintaining the statistics on network connectivity as previously obtained information and decides on whether to transmit data or not using a naïve Bayesian classifier based on them. Applying the learning algorithm such as naïve Bayesian classifier to the data transmission leads to the efficient decision making. By this learning process, the proposed data forwarding scheme can estimate the status of the network connectivity and can be reduced unnecessary data transmission in bad network condition.

The remainder of this paper is organized as follows. In Section 2, related work on IoT DTNs is described, and the proposed data-forwarding method is presented in Section 3. Section 4 contains a performance evaluation, and finally, Section 5 covers conclusions on this study.

2 Related works

WSNs are used for monitoring environments of IoT services in various areas. Most IoT applications want to collect information even though network infrastructures are broken or network connectivity is frequently lost, thus WSNs try to deliver data in the conditions. However, when the network connectivity is lost, the sensing data of a sensor field cannot transmit to a network server in the internet cloud and P2P networking services are also not provided. This scenario can happen in various applications and this is the reason that delay-tolerant capability is needed. Particularly, an application that needs intermittent communication should adopt the delay-tolerant capability [17].

In DTNs, data-forwarding has been raised as major topic and several methods for this have been proposed: direct delivery, first contact and epidemic routing. In direct delivery method, source nodes only deliver the collected information to a destination node. If source nodes do not meet a destination node, they store information and do not transmit the information. Therefore, this method can minimize resource consumption for information delivery [18]. First contact method transmits information to other nodes which do not receive the sent information. In this method, large number of messages can be issued and if a node tries to send messages frequently, energy consumption of the node will become higher [19]. In epidemic routing, every node issues replicated messages and there are no limitations. Because whole messages can be forwarded to every mobile sink node, probability of successful delivery of the messages may be increased but residual energy of the node will sharply drop [20].

The above data forwarding methods in IoT DTNs try to transmit data when the mobile sink node appears in a sensor field. Gateway nodes connect to the mobile sink node and start data transmission if the network connection with the mobile sink node is established. In this scenario, the quality of the network connection is not guaranteed, and although the gateway nodes connect to the mobile sink node, successful data transmission cannot be assured if network connectivity conditions are bad. Gateway nodes will try to retransmit data and energy consumption for data transmission will be increased.

For the efficient data-forwarding in IoT DTNs, it is necessary to consider the quality of the network connection between gateway nodes and a mobile sink nodes. Thus, the proposed data-forwarding scheme takes the quality of the network connectivity into account. Through a learning algorithm, the proposed scheme predicts the network connectivity status and tries to deliver data if the connectivity status is good, thereby reducing unnecessary data transmission and improving energy saving by the gateway nodes.

3 The proposed data forwarding method

A DTN consists of sensor nodes (i.e., IoT devices), gateway nodes and mobile sink nodes. Sensor nodes periodically transmit collected data to gateway nodes, which employ the delay tolerant capability, wait for the mobile sink node to transmit data to a network server in the Internet cloud. The gateway nodes search the mobile sink nodes in a sensor field, and if they make contact with the mobile sink nodes, they try to create sessions for data transmission. Before making data sessions, the proposed data-forwarding scheme estimates wireless status for the network connectivity between the gateway nodes and the mobile sink nodes, and to estimates this, it employs a naïve Bayesian classifier. From the results of the learning algorithm, the proposed scheme decides whether to deliver data to the mobile sink node or not. As shown in Fig. 2, it operates a delay tolerant function that performs wireless status estimation and data-forwarding, through which the proposed method can maintain a stable data session for transmission.

Fig. 2
figure 2

A system architecture for the proposed method

3.1 Wireless connection status estimation

In general, supervised learning is widely exploited for wireless networks in order to estimate the variance of wireless resource and network conditions [21,22,23]. A naïve Bayesian classifier is a well-known supervised learning algorithm that uses Bayes’ rule. If there are priori statistics, most possible state can be predicted through the probability based on the priori information. It computes the probability of each state using Bayes’ rule and then decides the state which has the largest probability as the most possible. The naïve Bayesian classifier can be represented as

$$ {\displaystyle \begin{array}{l}v=\arg \underset{Y}{\max \limits }P\left(Y|X\right)=\arg \underset{Y}{\max \limits}\frac{P\left(X|Y\right)P(Y)}{P(X)}\\ {}\kern8.25em =\arg \underset{Y}{\max \limits }P\left(X|Y\right)P(Y),\end{array}} $$
(1)

where X are attributes and Y are available states. For estimating the posterior probability is obtained as P(Y|X), the probability can be changed to P(X|Y)P(Y)/P(X) by Bayes’ rule. The naïve Bayesian classifier finds the most possible state with the largest probability as the posterior probability for Y. Subsequently, naïve Bayesian classifier can be described as argmax Y P(X|Y)P(Y).

Because the attributes X are conditionally independent for Y, Eq. (1) can be rewritten as

$$ {\displaystyle \begin{array}{l}v=\arg \underset{Y}{\max \limits }P\left(X|Y\right)P(Y)\\ {}\kern0.5em =\arg \underset{Y}{\max \limits }P\left({x}_1|Y\right)P\left({x}_2|Y\right)\cdots P\left({x}_n|Y\right)P(Y)\\ {}\kern0.5em =\arg \underset{Y}{\max \limits}\prod \limits_{i=1}^nP\left({x}_i|Y\right)P(Y).\end{array}} $$
(2)

The proposed data-forwarding scheme estimates quality of the network connectivity between the gateway node and the mobile sink node through Eq. (2). It uses two attributes: transmission rate for received data (x 1) and received signal strength (x 2). The attributes are measured at the gateway nodes. Both x 1 and x 2 are statistical information managed by gateway nodes, which through the information, can estimate the network connectivity status (Y).

The classifier counts the attribute values at each wireless status to calculate statistical probability. In good or bad status, x 1 and x 2 are counted and these are represented by the indicator function {∙}, which counts 1 if the given attribute conditions are satisfied. Subsequently, through the m training set as priori statistical information about the attribute values, the probabilities of each network status (i.e., good or bad) can be obtained as

$$ {\displaystyle \begin{array}{l}P\left({x}_i|Y=1\right)=\frac{\sum_{j=1}^m1\left\{{x}_i^{(j)}=1,{y}^{(j)}=1\right\}}{\sum_{j=1}^m1\left\{{y}^{(j)}=1\right\}}\\ {}P\left(Y=1\right)=\frac{\sum_{j=1}^m1\left\{{y}^{(j)}=1\right\}}{m},\end{array}} $$
(3)
$$ {\displaystyle \begin{array}{l}P\left({x}_i|Y=0\right)=\frac{\sum_{j=1}^m1\left\{{x}_i^{(j)}=1,{y}^{(j)}=0\right\}}{\sum_{j=1}^m1\left\{{y}^{(j)}=0\right\}}\\ {}P\left(Y=0\right)=\frac{\sum_{j=1}^m1\left\{{y}^{(j)}=0\right\}}{m}.\end{array}} $$
(4)

However, if there are no priori information in the classifier, P(X|Y) is 0 and the probability of the network connectivity status cannot be obtained. Thus, Laplace smoothing is applied to Eqs. (3) and (4) to calculate the probabilities without any priori statistical information [22]. The Laplace smoothing adds 1 to the numerator and adds k to the denominator. Because k means the number of states of Y, it becomes 2.

$$ {\displaystyle \begin{array}{l}P\left({x}_i|Y=1\right)=\frac{\sum_{j=1}^m1\left\{{x}_i^{(j)}=1,{y}^{(j)}=1\right\}+1}{\sum_{j=1}^m1\left\{{y}^{(j)}=1\right\}+2}\\ {}P\left(Y=1\right)=\frac{\sum_{j=1}^m1\left\{{y}^{(j)}=1\right\}+1}{m+2},\end{array}} $$
(5)
$$ {\displaystyle \begin{array}{l}P\left({x}_i|Y=0\right)=\frac{\sum_{j=1}^m1\left\{{x}_i^{(j)}=1,{y}^{(j)}=0\right\}+1}{\sum_{j=1}^m1\left\{{y}^{(j)}=0\right\}+2}\\ {}P\left(Y=0\right)=\frac{\sum_{j=1}^m1\left\{{y}^{(j)}=0\right\}+1}{m+2}.\end{array}} $$
(6)

By Eqs. (2), (5) and (6), the status of the network connectivity can be predicted and this information is used to deliver data from a gateway node to a mobile sink node. If the network connectivity is not good, the gateway node does not forward data and stores it instead until the status has changed. Through this delay-tolerant manner, the gateway nodes can reduce unnecessary communication and save residual energy.

3.2 Data-forwarding algorithm

The aim of the proposed data-forwarding algorithm is to provide most reliable and energy efficient data transmission by considering the specific challenge of IoT DTNs. The proposed algorithm depends on the estimated network status and determines whether to forward data or not. With a good network status, it either tries to transmit data or selects other behaviors to reduce energy consumption.

Figure 3 represents the system model of the proposed algorithm. Sensor nodes periodically transmit collected data to a gateway node that stores the received data if there are no mobile sink nodes. When one appears in the sensor filed, the gateway node connects it but does not create a data session for data transmission. Instead, it estimates quality of the network connection, and if it is considered as good, the gateway node makes a data session and forwards data traffic to the mobile sink node, which delivers the data traffic to cloud via a cellular network. Because the data transmission in the cellular network is considered as very reliable, we do not deal with the data transmission between the mobile sink node and the network server in the internet cloud.

Fig. 3
figure 3

System model I of the proposed data forwarding method

During data-forwarding from the gateway node, a connectivity check is periodically performed. If the quality of the network connection is considered as bad, the gateway node does not transmit data might be better for efficiency. If another mobile sink node is found, the gateway node checks the connection to the mobile sink node, and if the quality of the network connection is good, releases the data session and creates a new one for the new mobile sink node. Subsequently, it forwards data traffic using the newly created data session. Figure 4 shows the system model when there are several mobile sink nodes in the sensor field.

Fig. 4
figure 4

System model II of the proposed data forwarding method

Figure 5 represents the proposed data-forwarding algorithm. As mentioned earlier, the gateway node tries to forward data traffic if it is connected to a mobile sink node. At first, the gateway node checks stability of the current connection and estimates its quality using the attributes statistics X1 and X2 (line 1–2). If the quality of the network connection is bad and the connected connection is unstable, the gateway node finds another mobile sink node. If there are no other mobile sink nodes in the sensor field, the gateway node forwards data traffic when its transmission rate is greater than STOP_CONDITION. If there exist several mobile sink nodes in the sensor field, the gateway node migrates to another mobile sink node with a good network connection and then forwards data traffic (line 3–17). If the connection quality in the stable network is bad or that in the unstable network is good, double checking is performed for accurate decision making. Even though the quality of the network connection is not good, the gateway checks it again after a given time (DOUBLE_CHECK_INTERVAL) and then determines whether to stop data-forwarding or not (line 18–30). If there are no proper mobile sink nodes in the sensor field, the gateway stores data from sensor nodes and waits for new encounters to deliver data traffic to the server in the Internet cloud.

Fig. 5
figure 5

The proposed data forwarding algorithm

In general, wireless devices try to repeat transmission if they lose data packets during transmission over a bad network connection. In that situation, IoT DTNs should suppress data transmission to reduce energy consumption by the repeated transmission. The proposed method performs data-forwarding at a gateway node according to the network status, and thus can avoid unnecessary data transmission when it is bad, thereby leading to energy efficient data-forwarding.

4 Performance evauation

4.1 Network model

Sensor and gateway nodes are deployed in a sensor field for IoT services. A gateway node periodically collects data from the sensor nodes and forwards the collected data to a network server in the cloud through a mobile sink node, which connects to the cloud through a cellular network. The connectivity quality of the cellular network is always assumed as good. For performance evaluation, there are two mobile sink nodes in the sensor field. As represented in Fig. 6, mobile sink nodes are activated at different time during the activation period. Because the activation time of the two mobile sink nodes is different, the gateway node is in one of the following situations: 1) there are no mobile sink nodes, 2) mobile sink node 1 appears in the sensor field, 3) both mobile sink nodes 1 and 2 appears in the sensor field, or 4) mobile sink node 2 appears in the sensor field. In these situations, the gateway node tries to find a proper mobile sink node and connect to it, and then determines whether to forward data packets or not.

Fig. 6
figure 6

Network model for the performance evaluation

4.2 Channel model

A wireless channel of an industrial DTN is denoted as good or bad and its state can change between the two. The transition of the wireless channel can be represented by a probability model such as a two-state Markov chain. Given the transition probability from a good to a bad state (p) and the transition probability from a bad to a good state (q), the wireless channel can be modeled as shown in Fig. 7.

Fig. 7
figure 7

A two-state Markov chain for the wireless channel

The wireless channel model can be represented by a matrix of transition probabilities. The stationary probabilities for the good and bad states are obtained from the limiting probability of the Markov chain [24,25,26] as

$$ {\displaystyle \begin{array}{l}P\left(X= Good\right)=\frac{q}{p+q},\\ {}P\left(X= Bad\right)=\frac{p}{p+q}.\end{array}} $$
(7)

Given the packet error rate (PER), a probability of successful data transmission can be computed as

$$ {P}_s=\left(1- PER\right)P\left(X= Good\right). $$
(8)

In Eq. (8), the PER is assumed to be 1%. According to the channel model, the wireless channel status is determined by the transition probabilities p and q.

4.3 Simulation environments

The performance was verified with computer simulations implemented using the SMPL event-driven library based on the C programming language [27]. Simulation time was set to 10,000,000 s and gateway nodes in the sensor field operated according to the network model in Section 4.1. In the network model, the activation period was 4000 s and the activation time 2000 s. In addition, both mobile sink node 1 and 2 were activated together for 1000 s. The wireless channel based on Section 4.2 was changed every 300 s. For wireless communication, IEEE 802.15.4 was adopted for the gateway nodes [28] with 250 Kbps as the maximum data rate and 30 KB traffic generated per sec. In the simulation, we assumed that the data rate was determined by multiplying the probability of successful data transmission (P s ) and the maximum data rate. In addition, the gateway node retransmitted up to 3 times if packet loss happened.

Parameters (p and q) for the wireless channel had uniform distribution in the given ranges. For mobile sink node 1, the distribution range of p was placed between 0.6 and 0.8, and that of q between 0.2 and 0.4. In contrast, for mobile sink node 2, p was distributed between 0.3 and 0.5, and q between 0.6 and 0.8. In addition, the signal strength of the mobile sink nodes was randomly determined according to the wireless channel status. In the case of mobile sink node 2, if the channel status was good, the signal strength was determined between −65 and −45 dBm, else between −85 and −65 dBm. In the case of mobile sink node 1, if the channel status was good, the signal strength was determined between −80 and −65 dBm, else between −90 and −75 dBm. That is to say, the wireless channel conditions of mobile sink node 2 were better than those of mobile sink node 1.

For the proposed data-forwarding method, gateway nodes in delay-tolerant WSNs monitor the network status of mobile sink nodes per NET_MONITOR_INTERVAL sec. They wait for DOUBLE_CHECK_INTERVAL sec to double check the network status. In addition, if the data rate is lower than STOP_CONDITION of the maximum data rate for data transmission, they try to disconnect the current network connections. When a data session between the gateway node and a mobile sink node is created for data forwarding, the gateway node generates 30 KB traffic per sec. Table 1 represents the system parameters for the simulations.

Table 1 System parameters

4.4 Simulation results

The proposed data-forwarding method was compared with a typical data forwarding method, where the typical data forwarding method delivers data traffic when a gateway node connects to a mobile sink node regardless of the quality of the network connection. At first, an evaluation was performed with respect to the amount of received traffic at the network server, and Fig. 8 shows the results. We can see that the network server gathered more data traffic in the proposed method than the typical method. The reason is that the gateway node in the proposed method tried to carry out data forwarding when the wireless channel status was good or migrated the current data path to another if the network status of the current data path was not good. As mentioned earlier, the wireless channel conditions in the sensor field can frequently change between good and bad, and so if the gateway node forwards data traffic when the wireless channel status is bad, a lot of data traffic could be lost during data transmission.

Fig. 8
figure 8

The amount of received traffic at the network server

Figure 9 shows transmission and retransmission counts at the gateway node. Evidently, the typical data-forwarding method had less transmission counts and more retransmission counts because it tries to transmit data regardless of the wireless channel conditions when the gateway node meets a mobile sink node, leading to more retransmission for successful data transmission. In contrast, the proposed data-forwarding method shows more transmission and less retransmission counts than the typical method because it performs data transmission in better wireless channel conditions, thus its successful traffic delivery rate was higher and retransmission retries were lower than the typical method. The higher retransmission counts in the typical method means more energy is consumed for successful data transmission.

Fig. 9
figure 9

Transmission and retransmission counts at the gateway node

Figure 10 presents the total transmission counts at the gateway node when the network server received 30,000,000 KB data traffic. As shown, the proposed method spent less transmission counts than the typical method in order to deliver the same data traffic to the network server, which means that the typical data-forwarding scheme consumed more energy. In bad network conditions, it is necessary to hold data transmission until network conditions improved in order to save energy. If the gateway node performs data transmission according to network status, as determined by the proposed method, it can avoid unnecessary data transmission expected to result in transmission failure. In addition, the operation of the gateway node led to improved energy efficiency for data transmission.

Fig. 10
figure 10

Total transmission counts to deliver the given traffic of 30,000,000 KB

5 Conclusions

These days, IoT paradigm is causing many changes in IT technology. Particularly, various IoT services are based on monitoring applications and P2P networking. Furthermore, mobile sink nodes in the IoT services can be more useful than fixed sink node and to support them, wireless networks employ delay-tolerant capability. Because DTNs deliver data traffic intermittently, they can cause energy wastage according to data-forwarding methods, and so data-forwarding in good connection conditions is needed, which can reduce the energy consumption for transmissions by reducing retransmissions.

In the IoT DTNs, the network conditions are easily changed, and so for the energy efficient data forwarding, an appropriate data transmission time should be considered. Thus, in this paper, we propose a data-forwarding method which exploits statistical information about the connection status of mobile sink nodes. The proposed method determined data-forwarding conditions according to judgement of the quality of the network connection using a naïve Bayesian classifier with the statistical information. The proposed method showed superior performance over a typical method because the typical data-forwarding method does not consider the network connection status, causing more retransmissions and high energy consumption. In contrast, the proposed method leads to less retransmissions and reduced energy consumption, which makes it an appropriate data-forwarding method in IoT DTN.