# Location Prediction-Based Data Dissemination Using Swarm Intelligence in Opportunistic Cognitive Networks

Authors: Jie Li; Xingwei Wang; Jie Jia; Pengfei Wang; Yan Zhou; Zhijie Zhao
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

Swarm intelligence is widely used in the application of communication networks. In this paper we adopt a biologically inspired strategy to investigate the data dissemination problem in the opportunistic cognitive networks (OCNs). We model the system as a centralized and distributed hybrid system including a location prediction server and a pervasive environment deploying the large-scale human-centric devices. To exploit such environment, data gathering and dissemination are fundamentally based on the contact opportunities. To tackle the lack of contemporaneous end-to-end connectivity in opportunistic networks, we apply ant colony optimization as a cognitive heuristic technology to formulate a self-adaptive dissemination-based routing scheme in opportunistic cognitive networks. This routing strategy has attempted to find the most appropriate nodes conveying messages to the destination node based on the location prediction information and intimacy between nodes, which uses the online unsupervised learning on geographical locations and the biologically inspired algorithm on the relationship of nodes to estimate the delivery probability. Extensive simulation is carried out on the real-world traces to evaluate the accuracy of the location prediction and the proposed scheme in terms of transmission cost, delivery ratio, average hops, and delivery latency, which achieves better routing performances compared to the typical routing schemes in OCNs.


---

## Body

## 1. Introduction

Cognitive networks [1] have already been prototyped for many commercial and civilian applications. Combined with the social intelligence, cognitive networks promise to support services like citizen journalism, mobile social networking, environmental monitoring, and traffic monitoring by integrating ubiquitous sensing, large-scale data collection, and cloud computing. Opportunistic network [2] provides an ideal solution for promoting the evolution of communication among human beings and machines. Cognitive network technology can be applied to the communication system of opportunistic networks to provide heuristic schemes on the algorithm design and system implementation. Smart handheld devices (e.g., smart phone or PDA) carried by a large number of participants contribute to opportunistic cognitive networks with their sensing and communication parts [3, 4].Moreover, by including people in the loop, it is now possible to design applications that can dramatically improve daily lives of individuals and communities. The inherent mobility of participants provides unprecedented spatiotemporal coverage and also makes it possible to observe various events. CarTel [5] is a mobile sensor computing system designed to collect, process, deliver, and visualize data from sensors located on mobile units such as automobiles. PEIR [6] is an application that uses location data sampled from everyday mobile phones to calculate personalized estimates of environmental impact and exposure.The opportunistic cognitive network is a kind of delay tolerant networks (DTNs), and it utilizes communication opportunities obtained from node movement to relay packets. Mobile nodes are enabled to communicate with each other even if a route connecting them never exists. The basic routing strategy of opportunistic networks is “store-carry-forward.” Messages are routed between the sender and the destination(s), and any possible node can be used as a relay, provided that it is likely to bring the message closer to the final destination. Message transmission is mainly dependent on intermediate relays, so relay node selection is critical for efficient data dissemination in opportunistic cognitive networks.Since human mobility is mostly unpredictable, conventional routing algorithms for mobile ad hoc networks (MANETs) no longer perform well in the opportunistic cognitive networks. Therefore, new algorithms are required to overcome intermittent connectivity in the opportunistic networks.Stochastic routing protocols, such as Epidemic [7], First Contact (FC) [8], and Direct Delivery (DD) [9], broadcast messages to any encountered node in order to increase the delivery ratio. Epidemic routing diffuses messages similar to the way viruses or bacteria spread in biology. Whenever encountering another node, a node replicates and transfers messages. After receiving messages, a node will move to other places and continuously replicate and deliver the messages to other encountered ones. First Contact sends messages to the first encountered node without copying the messages to other nodes. Direct Delivery comprises the trade-off between Epidemic and First Contact by finding an optimal number of message copies.Creating more copies of a message increases the message delivery but decreases the network lifetime. These stochastic routing approaches usually consider the destinations of messages as nodes rather than locations.Different from stochastic routing, current contact-based routing chooses the most appropriate nodes relaying messages to the destinations based on historical contact information, such as contact times, contact duration, and contact cycle.Probabilistic Routing Protocol using History of Encounters and Transitivity (PRoPHET) [10] is a context-based routing protocol based on the history of encounters. PRoPHET estimates the delivery predictability for each known destination at each node before passing a message. The estimation is based on the history of encounters between nodes. SimBet [11] uses historical contacts to calculate two metrics, similarity, and betweenness. The similarity is calculated by how frequently a node and its destination have met. The betweenness is calculated by how many nodes which a node has met. However, if the utility metrics are equal, SimBet will prevent its forwarding behavior. To improve this flaw, BUBBLE [12] adds the knowledge of community structure to ensure message dissemination. In addition, the betweenness may be useless if the message is near its destination. SimBetAge [13], an improved version of SimBet, was proposed to address these shortcomings. Spray and Wait [14], that uses only a handful of copies per message, can achieve comparable delays to an oracle-based optimal scheme that minimizes delay while using the lowest possible number of transmissions.The work in [15] does routing by simply calculating the delivery probability for a node to be at a location in MobySpace, which is a high-dimensional Euclidean space based on the preknown mobility model. However, the required assumption of that each node has the knowledge about mobility patterns of other nodes in the network makes this work unpractical in realistic scenarios.For the concerns of optimality, robustness, and flexibility, some routing protocols are developed by inspiration from biology [16–21]. Such routing schemes are also well applied in the transportation domain [22–26], which are based on prediction mechanism to improve the performance of transportation systems.BeeHive is developed with inspiration of the foraging principles of honeybees [27]. Communication between real bees is modeled by designing intelligent bee agents, which are able to make routing decisions in large and complex topologies. The simulation results conclude that bee agents occupy smaller bandwidth and require less processor time. Artificial Bee Colony algorithm [17] is developed with scanning strategy for periodic vehicle routing problem. The work in [28] presents a biologically inspired discrete-event modeling approach for simulating alternative computer network protocols. Adaptation and probabilistic specifications are introduced into honeybee (BEE) and Routing Information Protocol (RIP) routing algorithms.The ant colony optimization (ACO) methods have been inspired by operating principles of ants [29], which empower a colony of ants to perform complex tasks such as nest building and foraging [30].Schoonderwoerd [31] first developed ACO-based approach for routing in telecommunication networks. The basic principle in the approach is about the use of stigmergy in multiagents interaction. Randomized ants traverse the network nodes probabilistically and select the highest probability path. The approach is shown to be sufficiently adaptive and demonstrates robustness across difficult network conditions. Yao et al. [19, 20] improved ACO for delivery routing problem and PROMETShop scheduling problems.The aforementioned routing algorithms show good performance on message delivery. However geographic coordinates of nodes have little or no correlation with their contact times, so the algorithms do not perform well when each device frequently appears at different regions, as most people daily do.In this paper, we propose the location-prediction and swarm-intelligence-based data dissemination (LOPSI) algorithm for opportunistic cognitive networks. The LOPSI algorithm is a probabilistic routing protocol combining location prediction and the ant colony optimization. It firstly predicts possible locations of relay nodes and destination(s) in successive time series. The mobile nodes calculate intimacy (contact frequency) with potential relay nodes using ACO and then make a forwarding decision based on node intimacy and probabilities of node mobility.The remainder of this paper is organized as follows. The system model is illustrated in Section2. Section 3 specifies the data dissemination algorithm. Extensive simulations have been done for performance evaluation in Section 4. Section 5 concludes the paper.


## 2. Network Model

As mentioned in Section1, the location-prediction and swarm-intelligence-based data dissemination (LOPSI) algorithm is a probabilistic routing protocol using location and intimacy information of potential relay nodes and destination nodes. The network is a mixture of an opportunistic network and a centralized infrastructure as shown in Figure 1. The centralized infrastructure consists of a number of wireless access points (APs) and a backbone connecting the APs.Figure 1
Network model of data dissemination in opportunistic cognitive networks.Mobile nodes (carrying smart devices) can only access to the network when they are walking into the transmission range of any AP. Each AP periodically uploads connection records of mobile nodes to the location prediction server (LPS) which will eventually maintain a mobility database of all nodes.The data exchanged in this scenario is assumed to be of high magnitude, and data transmission can only occurs between peer counterparts as in normal opportunistic networks. The LPS is merely responsible for storing node mobility records and predicting node location upon receiving query from mobile nodes via one of the APs. The accuracy of the localization prediction algorithm can increase the delivery ratio of the proposed approach.In the proposed system, there exist two major entities: the mobile nodes and the LPS. The mobile nodes work in a decentralized manner, while the LPS is a powerful central unit which collects the trajectories of mobile users and performs complex computation tasks to provide location prediction service to the request mobile users.The mobile nodes only store the encountering information of the contact nodes in the local buffer. Based on the encountering information, each mobile node obtains the intimacy between the contact nodes and the destination node and then refines the forwarding probability to the destination node. The mobile nodes can forward the data message to the next hop by the optimal wireless channel according to its own system state. The mobile nodes can solve the data dissemination locally without the need of coordination with a central server or the other clients. Thus the data dissemination process is decentralized.The LPS is applied to track the movement trajectories of all mobile nodes; thus it needs to collect global movement information predicting the encounter opportunities. Specifically, it uses the long-term trajectory information to construct the Markov chain of a mobile user and to determine the probable mobility trajectory based on partial encountering history. The computations in the server side and in the client side are independent, and their optimization results will not affect each other. Therefore, we have designed three data dissemination algorithms to adapt different infrastructure of the network environment. If the mobile nodes can connect to the LPS, it can obtain the location prediction information to optimize the accuracy of forwarding node selection, whereas the mobile nodes can use the local information, that is, intimacy, to estimate the delivery probability of the contact nodes.The APs are deemed as living and working locations in the system. Nodes can communicate with each other through short-range communication media, for instance, ZigBee, Bluetooth, NFC, or WiFi Direct. Each node migrates from one location to another according to its own mobility model. When encountering other nodes, the mobile node dynamically calculates intimacy with them using ACO. The intimacy truly reflects historical contact information. It accumulates upon each contact and on the other hand decays over time.Once a mobile node would like to send data to a destination node, it firstly consults a nearest AP for its neighbors’ trend of movement. The LPS performs location prediction using Markov process inference and returns back to the query node an ordered list indicating probabilities of the neighbor nodes meeting the destination node in successive time series (usually more than one time slot).The mobile node will compute forwarding probability of its neighbors by considering their intimacy with the destination node and then make a forwarding decision.The mixture network model enhances traditional opportunistic networks with the centralized infrastructure which takes good advantage of existing AP assets but not burdens current network. The data forwarding is a probabilistic scheme guided by location prediction rather than stochastic or trivially probabilistic.By this means, data will be delivered to the destination with higher probability and hence the network efficiency is improved.


## 3. Algorithm Design

In this section, we formulate a data dissemination problem in the network environment lacking contemporaneous end-to-end connectivity. To tackle the problem, we propose a contact-based probability routing algorithm, LOPSI, which implements the data dissemination by calculating the forwarding probability based on location prediction scheme and a swarm intelligence heuristic method. Therefore, LOPSI is fundamentally based on two routing schemes that are Location Prediction-Based Data Dissemination (LOPDAD) and Ant Colony Optimization- (ACO-) Based Data Dissemination (ACODAD). LOPDAD uses location prediction information to calculate the maximum probability of the location where the forwarding nodes and the destination node encounter, which is suitable for the opportunistic environment deploying a centralized infrastructure. ACODAD uses the swarm intelligence mechanism, ACO, to select the forwarding nodes according to the intimacy between the forwarding nodes and the destination node, which is suitable for the fully distributed data dissemination in opportunistic networks. LOPSI combines the merits of the two aforementioned algorithms. Depending on the requirements of applications, researchers can select the suitable algorithm to apply.


### 3.1. Location Prediction-Based Data Dissemination (LOPDAD)

Studies on human mobility patterns have shown that people daily activities exist in a high degree of repeatability. People usually visit several fixed places regularly in each day and do activities in a relatively fixed period. According to mobile trajectories and regular behavior pattern of mobile nodes, it can be used to model the scene based on the location of mobile nodes and use relevant algorithms to predict the probability of the node arriving at a certain position and to estimate the location of the mobile node.Markov chain algorithm is currently the most widely used in location prediction algorithm with high accuracy. Here we use the second-order Markov chain model to predict the location of the mobile node, which has higher accuracy than the first-order Markov chain model according to the simulation.It can use Markov model to describe the application scenario such as Campus, where it is assumed that there arem locations. Location i is the ith status X
i of Markov process, and the state space is E
=
{
X
1
,
X
2
,
…
,
X
m
}. Thus scene mobility model is defined as {
X
,
T
}, and T is time series.For each application scenario, Markov chain model can be used to predict the future location state of each mobile node. Specific modeling and forecasting process is as follows.


#### 3.1.1. Preparation Process

Preparation before prediction process includes the following steps.(
1) Determination of State Set. According to the collection of mobile nodes trajectories from the system server, the location elements in the collecting data are counted, which is denoted as set L. As set L contains a number of location elements, the locations of higher visiting frequency are chosen as state space of the system, denoted as set E, E
⊂
L.(2) Discretization of Data Set. Statistical data of all users related to state set E is made. Then the dataset of each user is processed to be discrete set of the fixed time period, so the set after discretization is denoted as follows:
(1)
{
(
t
k
,
X
i
)
}
,
k
=
1,2
,
3
,
…
,
i
∈
{
1,2
,
3
,
…
,
m
}
.


#### 3.1.2. Location Prediction Algorithm Based on O2MM

Order-1 Markov chain model (O1MM) uses the state transition matrix and the initial distribution to predict, which is simple and intuitive [16]. However, as the indeterminacy of the state transition probabilities is unscientific division of the initial state of the system, the prediction result of this method tends to produce larger errors.Unlike the first order, a Markov chain of higher order is a Markov model with memory, that is, a Markov chain that depends on not only the current state, but also onn
-
1 states before, where n is the order and n is finite [17]. The chain is dependent on where it is right now and also where it was in the last occasion. Order-2 Markov chain model (O2MM) is used to improve the accuracy of prediction method. Compared with the prediction based on order-1 Markov chain, order-2 Markov chain model can be more complete and rational use of information and effectively integrated with correlation analysis, so as to improve prediction accuracy. O2MM depends on the current state and also the just visited state.The finite state space of O2MM is(2)
E
=
{
X
1
,
X
2
,
…
,
X
r
,
X
i
,
X
j
,
…
,
X
m
}
,
i
=
1,2
,
…
,
m
,
h
h
h
h
h
h
h
h
i
h
i
h
h
h
h
h
h
r
=
1,2
,
…
,
m
,
j
=
1,2
,
…
,
m
and if the conditional probability is
(3)
P
{
X
(
t
n
)
=
X
j
}
=
P
{
X
(
t
n
)
=
X
j
∣
X
(
t
n
-
1
)
=
X
i
,
X
(
t
n
-
2
)
=
X
r
}
,
the transition probability of the node located at X
j at time slice t
n under the condition that the node is located at X
i at time slice t
n
-
1 and X
r at time slice t
n
-
2 is
(4)
P
r
i
j
{
X
(
t
n
)
=
X
j
}
=
∑
i
=
1
,
r
=
1
m
P
{
X
(
t
n
)
=
X
j
∣
X
(
t
n
-
1
)
=
X
i
,
X
(
t
n
-
2
)
=
X
r
}
.
Formula (4) approximately equals the frequency that the node visits the location X
j when the state space tends to infinity [18]:
(5)
p
r
i
j
=
∑
r
=
1
,
i
=
1
r
=
m
,
i
=
m
c
r
i
j
∑
k
=
1
m
c
r
i
k
,
where c
r
i
j is the number of times that the observation node visits location X
j by records statistics, ∑
k
=
1
m
c
r
i
k is the total number of times that the node visits all the locations in E, and then the probability of the node to visit location X
j and the location state of the node at current time slice and also the just visited state is, respectively, X
i and X
r.If there arem location states in state space set, one-step transition probability matrix is a m
×
m
2 matrix:
(6)
P
=
[
p
111
p
112
⋯
p
11
(
m
-
1
)
p
11
m
p
211
p
212
⋯
p
21
(
m
-
1
)
p
21
m
⋮
⋮
⋱
⋮
⋮
p
m
11
p
m
12
⋯
p
m
1
(
m
-
1
)
p
m
1
m
p
m
21
p
m
22
⋯
p
m
2
(
m
-
1
)
p
m
2
m
⋮
⋮
⋱
⋮
⋮
p
m
m
1
p
m
m
2
⋯
p
m
m
(
m
-
1
)
p
m
m
m
]
︷
}
m
m
2
.
The description of the location prediction algorithm based on O2MM is as shown in Algorithm 1.Algorithm 1:
L
_
Markov
(
N
c
,
t
n
): location prediction based on O2MM.
(1)
input: State Space Set E
=
{
X
i
,
i
∈
{
1,2
,
3
,
…
,
m
}
}, Nodes Set N
=
{
N
j
,
j
∈
{
1,2
,
3
,
…
,
n
}
}, the initial
probability distribution is P
(
n
-
1
,
n
-
2
)
=
{
p
r
i
,
r
,
i
∈
{
1,2
,
3
,
…
,
m
}
};
(2)
Discretization of data set: Statistical data of all users related to state set E is made. Then the data set of each
user is processed to be discrete set of the fixed time slice, so the set after discretization is denoted as
follow: {
(
t
k
,
X
i
)
}, k
∈
N
+, i
∈
{
1,2
,
3
,
…
,
m
};
(3)calculate the probability of the node to visit location X
j according to (5) where the location state of the node
at current time slice and also the just visited state is respectively X
i and X
r.
(4)Calculate one step transition probability matrix according to (6);
(5)Calculate the probability of each state at time slice t
n
(a)P
(
n
)
=
P
(
n
-
1
,
n
-
2
)
P
(6)the location state at time slice t
n is
(b)X
j
=
arg
⁡
max
⁡
{
P
j
(
n
)
}
(7)
return
X
j;According to Algorithm1, given the initial probability distribution of the node at time slice n
-
1, n
-
2, we can recurrence the probability distribution at time slice t
n by O2MM. The state set E
=
{
X
1
,
X
2
}, m
=
2, the initial state is {
(
t
n
-
2
,
X
1
)
,
(
t
n
-
1
,
X
2
)
}, and the initial probability distribution is
(7)
P
(
n
-
1
,
n
-
2
)
=
(
p
11
(
n
-
1
,
n
-
2
)
,
p
12
(
n
-
1
,
n
-
2
)
,
p
21
(
n
-
1
,
n
-
2
)
,
p
22
(
n
-
1
,
n
-
2
)
)
=
(
0,1
,
0,0
)
.The transition matrix for Markov chain of order two is(8)
P
=
[
p
111
p
112
p
121
p
122
p
211
p
212
p
221
p
222
]
.
Here the first two numbers of the index representing the current state and the last number represent the next state. And the probability distribution at time slice n is
(9)
P
(
n
)
=
P
(
n
-
1
,
n
-
2
)
P
=
{
p
1
(
n
)
,
p
2
(
n
)
}
.The location state is obtained by the location prediction server at time slicen is
(10)
X
j
=
arg
⁡
max
⁡
{
p
1
(
n
)
,
p
2
(
n
)
}
.In our system the location prediction server gathers the location data of the mobile nodes by the APs. The server executes Algorithm1 to predict the trajectory of each node according to the discrete time slice.


#### 3.1.3. Transmission Probability of LOPDAD

The data dissemination mechanism can use the result of the location prediction algorithm using O2MM. At a certain time slice, the data forwarding probability equals the probability of the forwarding node visiting the location where a destination node is, which is given by(11)
p
L
d
=
p
X
j
d
(
n
)
,
where X
j
d is the location state of destination node N
d at time slice t
n, and p
X
j
d
(
n
) is the probability that node N
c visits the location X
j
d at time slice t
n.Algorithm2 describes the process of the location-based data dissemination algorithm, which obtained the forwarding probability p
L
d of N
c to the destination node N
d.Algorithm 2:
P
_
Markov
(
N
c
,
t
n
): data dissemination probability based on location prediction.
Input:
State Space Set E
=
{
X
i
,
i
∈
{
1,2
,
3
,
…
,
m
}
}, N
d, N
c, the initial probability
distribution isP
(
n
-
1
,
n
-
2
)
=
{
p
r
i
,
r
,
i
∈
{
1,2
,
3
,
…
,
m
}
};
Output:
p
L
d
(1) X
j
d
=
L
_
Markov(N
d
,
t
n)
(2–5)Algorithm 1 steps 1–5;
(6) calculation of forwarding probability according to (11)
(7) return p
L
d;


#### 3.1.4. The Execution of Location Prediction

The LPS predicts the locations where the destination node and the forwarding nodes will encounter at the future time slices. The threshold of time slices isl. At time slice, t
n, when the LPS receives the service request information REQ(
C
{
N
f
}
,
N
d
) which includes the destination node N
d and the encounter nodes set C
{
N
f
}, from the data carrier node N
s, the LPS calculates the location state set X
=
{
X
(
N
d
,
t
l
)
} of N
d in the time slice t
n
+
1
,
t
n
+
2
,
…
,
t
n
+
l:
(12)
{
X
(
N
d
,
t
l
)
}
=
{
(
t
1
,
X
i
)
,
(
t
2
,
X
j
)
,
…
,
(
t
l
,
X
p
)
}
⊆
{
(
t
k
,
X
i
)
}
,
h
h
h
h
h
h
h
h
h
h
h
k
∈
N
+
,
i
,
j
,
p
∈
{
1,2
,
3
,
…
,
m
}
.And the LPS also calculates the forwarding probability F. P of each nodeN
f in the set C
{
N
f
}. The forwarding nodes setF.N in which the node N
f will visit the location where the destination node N
d locates at the same time slice, and the encounter time slice is recorded inF.T. Finally, the server sends the service information SEI(
F
{
(
N
f
,
P
,
T
)
}
,
{
X
(
N
d
,
t
n
)
}
) to the node N
s. The execution process is described in Algorithm 3.Algorithm 3:LoP_Service(C
{
N
f
}
,
N
d): the location prediction service in the LPS.
(1)
N
s
→
LPS: REQ
(
C
{
N
f
}
,
N
d
)
i
=
0
,
j
=
0
,
k
=
0
,
l
=
3;
(2)
for all
n
∈
[
1
,
l
]
do
(3)
X
(
N
d
,
t
n
)
=
L
_Markov(
N
d
,
t
n
);
(4)
for all
N
f
∈
C
{
N
f
}
do
(5)
X
(
N
f
,
t
n
)
=
L
_Markov(
N
f
,
t
n
); //calculate the location state of N
f at t
n
(6)    if
(
X
(
N
f
,
t
n
)
=
=
X
i
(
N
d
,
t
n
)
)
then//N
f and N
d encounter at t
n
(7)      F
.
N
[
j++]
=
N
f; //N
f is stored as the forwarding node in set F
.
N
(8)      F
.
P
[
i++]
=
P
_Markov(
N
f
,
t
n
); //The probability of N
f meets N
d is stored in set F
.
P
(9)      F
.
T
[
k++]
=
n; //the encounter time slice of N
f
(10)     end if
(11)
end for
(12) end for
(13)
LPS
→
N
s: SEI(
F
{
(
N
f
,
P
,
T
)
}
,
{
X
(
N
d
,
t
n
)
}
);


#### 3.1.5. The Selection Mechanism of the Forwarding Nodes Set

When the data carrierN
s receives the SEI from the predictive server, considering the cache management and the load of the network, the number of copies of the forwarding data is a fixed value, COPY, which is decided by the average buffer size of each node and the current load of the network. If N
s finds that the location of N
d is the same as N
s during the threshold time slice, it only transmits to the nodes which can encounter N
d at earlier time slice than N
s. Otherwise, if the number of nodes in the forwarding nodes set is less than COPY, N
s transmits the data to the nodes in the forwarding nodes set and delete the data in its own buffer. If the number of nodes in the forwarding nodes set is more than COPY, N
s transmits the data only to the nodes having maximum probability no more than COPY, according to the following:
(13)
P
L
s
f
d
=
{
P
_
Markov
(
N
f
,
t
n
)
n
,
N
f
∈
F
,
t
n
∈
T
,
n
∈
[
1
,
l
]
}
,
where P
_
Markov
(
N
f
,
t
n
) is the forwarding probability which is equal to the probability that N
f encounters N
d at time slice t
n, where n is the number of time slice intervals when N
f meets N
d. The larger the number of time slice intervals is, the lower the probability of forwarding node is. And the forwarding nodes set F
′ which is selected by N
s:
(14)
F
′
⊆
F
,
F
′
{
N
f
}
=
argmax
f
≤
COPY
{
P
L
s
f
d
}
.


### 3.2. Swarm Intelligence Heuristic Data Dissemination (ACODAD)

The inspiring source of ACO is the pheromone trail laying and following behavior of real ants which use pheromones as a communication medium. Artificial ants used in ACO are stochastic solution construction procedures that probabilistically build a solution by iteratively adding solution components to partial solutions by taking into account (i) heuristic information on the problem instance being solved, if available, and (ii) (artificial) pheromone trails which change dynamically at run-time to reflect the agents’ acquired search experience [19]. In our algorithm, ACO is improved to be applied in data dissemination in opportunistic cognitive networks.


#### 3.2.1. Ant Colony Optimization- (ACO-) Based Data Dissemination in OCN (ACODAD)

The pheromone in ACODAD is the intimacy between two nodes. The more frequency and continuous the contact between two nodes is, the higher the value of intimacy is. It means that the higher the pheromone is. The data carrier node tends to choose the node which has high intimacy value with the destination nodes to forward the data. It means that the data forwarding probability of the node having high intimacy with the destination node is high. The comparison of the characteristics between ACODAD and ACO is shown in Table1.Table 1
Comparison of characteristics between ACODAD and ACO.
Characteristics
ACODAD
ACO
Transmission process of data
Data dissemination based on the encounter of two nodes
Artificial ants move from one location to the neighbor one
Transition probability
The probability that the forwarding node encounters the destination node
The state transition probabilities that are from one location to the next
Pheromone
Intimacy between two nodes
Pheromone trail laying by ants
Path length
The interval of time slices that two nodes encounter
The distance between two locations
Pheromone evaporation
No contact between the two nodes during threshold time
As time goes by the pheromone evaporates


#### 3.2.2. Intimacy between Two Nodes in OCN

Each node in opportunistic cognitive networks maintains a relationship table with other nodes using the value of intimacy.For example, at time slicet
s, the data carrier node N
s arrives at location X
i and senses all the other nodes within the communication range via the communication channels (such as ZigBee, Bluetooth, NFC, and other short-range communication protocols). Those nodes are added in encounter nodes set C
{
N
f
} of N
s and are recorded in the relationship table with the calculation results of intimacy.The intimacy between two nodesN
i and N
j depends on the frequency of two nodes in connection based on contact times n
i
j, lasting time of one connection Δ
D
i
j
c, and the encounter intervals between two contacts Δ
I
i
j
c. The mathematical description of intimacy is as follows, where R
i
j
(
t
) is the intimacy of N
i and N
j at time slice t:
(15)
R
i
j
(
t
)
=
{
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
,
∀
Δ
I
i
j
c
<
k
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
×
(
1
-
ρ
)
e
,
∃
Δ
I
i
j
c
>
k
0
,
Δ
I
i
j
c
>
T
,
over
the
system
running
time
,
where ρ is the evaporation rate, k is the threshold of encounter time intervals of two nodes, and e is the times when the time intervals is more than k.Although the intimacy is defined in consideration of encounter time intervals, if the two nodes are not in connection for a long time (more than a certain time threshold valuek), it enables the intimacy evaporation mechanism to ensure the most frequently contact nodes with a high degree of intimacy. If the encounter time intervals are beyond the system running time T, the value of intimacy is zero.When two nodes encounter, they, respectively, compute the intimacy based on records of encounter timet
s and the departure time t
e at the contact times c. Each node records the time according to its own time clock. When c
=
1, Δ
I
i
j
c equals the encounter time of the first contact. The algorithm of intimacy is as shown in Algorithm 4.Algorithm 4:
Intimacy
(
N
i
,
N
j
) computes the intimacy value between two nodes at encounter time T.
Input:
N
i, N
j
Output:
R
i
j
(
T
)
(1)
define
T the system running time
(2)L encounter time interval threshold
(3)    Contact vector arrayM
i
j
→(c, t
s, t
e)
(4) initialization:M
i
j
→
[
0
]
=
(
0,0
,
0
), R
i
j(0) = 0, k
=
L
,
f
l
a
g
=
1;
(5)
forall
t
=
0
:
T;
(6) if
N
i recieve HELLO from N
j
(7)   n
i
j = ++c;
(8)   for all
c
=
1
:
n
i
j
(9)    Δ
D
i
j
c
[
c
]
=
t
e
-
t
s;
(10)    D
i
j
c += Δ
D
i
j
c;
(11)    Δ
I
i
j
c
[
c
]
=
t
s
-
t;
(12)    I
i
j
c += Δ
I
i
j
c;
(13)    t
=
t
e;
(14)    if(Δ
I
i
j
c
[
c
]
>
k)
(15)
e++;
(16)
f
l
a
g
=
0;
(17)    end if
(18)
end for
(19)
end if
(20)
end for
(21)
if(f
l
a
g
=
=
0)
(22) return
R
i
j
(
T
)
=
(
(
n
i
j
×
D
i
j
c
)
/
I
i
j
c
)
×
(
1
-
ρ
)
e
(23)
else
(24)
return
R
i
j
(
T
)
=
(
n
i
j
×
D
i
j
c
)
/
I
i
j
c
(25)
end ifAlgorithm4 captures the essence of (15). The intimacy between two nodes is used to compute the forwarding probability in ACODAD.The intimacy updates during the time durationΔ
t; the variation of the intimacy is given by
(16)
R
i
j
(
t
+
Δ
t
)
=
R
i
j
(
t
)
+
Δ
R
i
j
(
t
)
,
Δ
R
i
j
(
t
)
=
{
(
n
i
j
+
Δ
n
i
j
)
×
∑
c
=
1
(
n
i
j
+
Δ
n
i
j
)
Δ
D
i
j
c
∑
c
=
1
(
n
i
j
+
Δ
n
i
j
)
Δ
I
i
j
c
-
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
,
Δ
n
i
j
>
0
,
∀
Δ
I
i
j
c
<
k
-
ρ
×
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
Δ
n
i
j
=
0
,
Δ
t
>
k
,
∀
Δ
I
i
j
c
<
k
0
,
otherwise
.


#### 3.2.3. Transmission Probability of ACODAD

When the data carrier nodeN
s encounters the nodes in set C
{
N
f
} and chooses the forwarding nodes from C
{
N
f
} to the destination N
d based on the intimacy between the node in C
{
N
f
} and N
d, the forwarding probability is defined as the following equation:
(17)
p
R
s
f
d
=
{
1
j
=
d
0
Intimacy
(
N
f
,
N
d
)
<
Intimacy
(
N
i
,
N
d
)
[
R
f
d
(
t
)
]
α
·
[
η
f
d
(
t
)
]
β
∑
N
f
∈
allowd
d
R
j
d
α
·
η
j
d
β
N
f
∈
allowd
d
,
where allowd
d is given by
(18)
allowd
d
t
=
F
{
N
f
∣
(
R
f
d
(
t
)
>
R
i
d
(
t
)
)
}
,
allowd
d
t
∈
F
{
N
f
}
,
allowd
d
=
allowd
d
t
-
tabu
d
,
where tabu
d is the node set including those nodes which have already carried the transmission data copy and also the node had the copy before. Such nodes will not be selected as the forwarding nodes.The parametersα and β control the relative importance of the pheromone versus the heuristic information, η
f
d, which is given by
(19)
η
f
d
=
1
L
f
d
,
where L
f
d is the time slice intervals that N
f and N
d will encounter which is an estimation value given by the records in the contact vector.A heuristic valueη, respectively, represents a priori information about the problem instance definition or run-time information provided by a source different from the ants. In many cases η is the cost, or an estimate of the cost, of extending the current state. These values are used by the ants’ heuristic rule to make probabilistic decisions on how to move on the graph [32].In our algorithm, the heuristic value is defined as the distance betweenN
f and N
d. As the location state of nodes is discretized by the time slice. And the delay of data forwarding between the two nodes is not decided by the absolute path length or the distance between the two nodes but by calculating the number of time slice intervals between forwarding node and the destination node to meet with each other.The data carrier nodeN
s chooses the forwarding nodes from set C
{
N
f
} according to the forwarding probability based on intimacy. Considering the cache management, our algorithms set the maximum copy quantity of a unique data message. If the data forwarding operation is executed, N
s will transmit the data to the nodes in set C
′
{
N
f
}, which is given by (20), and the quantity of nodes, denoted by f, is no more than COPY. Finally, N
s will delete the data stored in its buffer:
(20)
C
′
⊆
C
{
N
f
}
,
C
′
{
N
f
}
=
argmax
f
≤
COPY
{
P
R
s
f
d
}
.


### 3.3. Location Prediction Based Data Dissemination Using Swarm Intelligence (LOPSI)

The data dissemination algorithm LOPSI considers not only the intimacy between the forwarding node and the destination node, but also the location where the two nodes may encounter. According to the location prediction algorithm, the set of forwarding nodes,F
{
N
f
}, which visit the location where the destination node will be during the threshold time slices, can be obtained. And the data carrier node N
s only sends message to nodes in F
{
N
f
} and compares the intimacy between N
d and N
f
∈
F
{
N
f
}. Combined with the prediction results from LOPDAD and ACODAD, the transmission probability from node N
s to the forwarding node N
f is calculated by the weight formula
(21)
p
s
f
d
=
γ
*
p
R
s
f
d
+
δ
*
p
L
s
f
d
,
γ
+
δ
=
1
,
where p
R
s
f
d is the forwarding probability obtained from ACODAD, p
L
s
f
d is the forwarding probability obtained from LOPDAD, and parameters γ and δ are the weights of the two probabilities.In our campus environment the mobile node can communicate to the location prediction server anywhere and anytime. The prediction server provides only location prediction service and no other services. Algorithm5 describes the whole execution process of LOPSI. LOSI_Sec is part of Algorithm 5, which is a function that the data message transfers from the current node to the forwarding node set. When the source node N
s wants to send the data message to the destination node N
d, N
s will choose the potential nodes by location prediction schemes and then obtain the intimacy between the potential nodes and the destination node. Thus the forwarding node set will be determined. The execution process of LOPSI is described in Algorithm 5.Algorithm 5:
LOPSI
(
N
s
,
N
d
).
(1)
Initialization: node set N
=
{
N
i
,
i
=
1,2
,
…
,
k
,
k
∈
N
+
}, state space E
=
{
X
j
,
j
=
1,2
,
…
,
m
,
m
∈
N
+
}, time
slice set T
=
{
t
n
,
n
=
0,1
,
2
,
…
,
l
,
l
∈
N
+
} Maximum data copies: COPY;
(2)
for
n
=
0
:
l
// the system running time
// the function executes the one hop data dissemination to the forwarding node set
(3)LOPSI_Sec(N
s)
(4)
for
∀
N
f
∈
F
′
{
N
f
}
(5)execution of LOPSI_Sec
(
N
f
);
(6)
end for
(7)
end forFor any nodeN
i carrying data message, LOPSI_Sec(N
i) will determine the forwarding node set. The description of LOPSI_Sec(N
i) is given as shown in Algorithm 6.Algorithm 6:LOPSI_Sec(N
i): the function executes one-hop data dissemination to the forwarding node set.
(1)
N
i senses the contact nodes set C
{
N
f
};
(2)for
∀
N
f
∈
C
{
N
f
}
(3)update intimacy(N
i
,
N
f);
(4)
end for
/* the source node deliver the data directly to the destination node if the destination node is in the contact
nodes set C
{
N
f
} and update the node set tabu
d
/
*
(5)
if
N
d
∈
C
{
N
f
}
(6)  N
i transmits data to N
d;
(7)
tabu
d
←
{
N
i
,
N
d
};
(8)
break the Algorithm
5;
(9)else
(10)
N
s sends REQ(
C
{
N
f
}
,
N
d
) to the server;
(11)the server executes LoP_Service(C
{
N
f
}
,
N
d);
(12)
N
s receives SEI;
(13)
N
s sends N
d to the nodes in F
{
N
f
};
(14)
for
∀
N
f
∈
F
{
N
f
}
(15)    Send intimacy(N
f
,
N
d) to N
s;
(16)
end for
(17)
N
s calculates p
s
f
d according to (21);
(18)
if(f
≤
COPY)   //f is the number of forwarding nodes
(19)   F
′
{
N
f
}
=
F
{
N
f
};
(20)
else
(21)   F
′
{
N
f
}
=
{
arg
⁡
max
f
≤
COPY
⁡
(
p
s
f
d
)
}
(22)
end if
(23)
N
i sends data to F
′
{
N
f
};
(24)
tabu
d
←
{
N
i
,
F
′
{
N
f
}
};
(25)
N
i delete the data copy in its buffer;
(26)
end ifAlgorithm5 describes the essence of LOPSI. Each data has a TTL, which indicates how long the data can live in the network. It is set by the provider at the time of data generation. In Algorithm 5 the length of time slices l equals TTL. The data carried by each node within TTL duration cannot be forwarded and then be automatically discarded.


## 3.1. Location Prediction-Based Data Dissemination (LOPDAD)

Studies on human mobility patterns have shown that people daily activities exist in a high degree of repeatability. People usually visit several fixed places regularly in each day and do activities in a relatively fixed period. According to mobile trajectories and regular behavior pattern of mobile nodes, it can be used to model the scene based on the location of mobile nodes and use relevant algorithms to predict the probability of the node arriving at a certain position and to estimate the location of the mobile node.Markov chain algorithm is currently the most widely used in location prediction algorithm with high accuracy. Here we use the second-order Markov chain model to predict the location of the mobile node, which has higher accuracy than the first-order Markov chain model according to the simulation.It can use Markov model to describe the application scenario such as Campus, where it is assumed that there arem locations. Location i is the ith status X
i of Markov process, and the state space is E
=
{
X
1
,
X
2
,
…
,
X
m
}. Thus scene mobility model is defined as {
X
,
T
}, and T is time series.For each application scenario, Markov chain model can be used to predict the future location state of each mobile node. Specific modeling and forecasting process is as follows.


### 3.1.1. Preparation Process

Preparation before prediction process includes the following steps.(
1) Determination of State Set. According to the collection of mobile nodes trajectories from the system server, the location elements in the collecting data are counted, which is denoted as set L. As set L contains a number of location elements, the locations of higher visiting frequency are chosen as state space of the system, denoted as set E, E
⊂
L.(2) Discretization of Data Set. Statistical data of all users related to state set E is made. Then the dataset of each user is processed to be discrete set of the fixed time period, so the set after discretization is denoted as follows:
(1)
{
(
t
k
,
X
i
)
}
,
k
=
1,2
,
3
,
…
,
i
∈
{
1,2
,
3
,
…
,
m
}
.


### 3.1.2. Location Prediction Algorithm Based on O2MM

Order-1 Markov chain model (O1MM) uses the state transition matrix and the initial distribution to predict, which is simple and intuitive [16]. However, as the indeterminacy of the state transition probabilities is unscientific division of the initial state of the system, the prediction result of this method tends to produce larger errors.Unlike the first order, a Markov chain of higher order is a Markov model with memory, that is, a Markov chain that depends on not only the current state, but also onn
-
1 states before, where n is the order and n is finite [17]. The chain is dependent on where it is right now and also where it was in the last occasion. Order-2 Markov chain model (O2MM) is used to improve the accuracy of prediction method. Compared with the prediction based on order-1 Markov chain, order-2 Markov chain model can be more complete and rational use of information and effectively integrated with correlation analysis, so as to improve prediction accuracy. O2MM depends on the current state and also the just visited state.The finite state space of O2MM is(2)
E
=
{
X
1
,
X
2
,
…
,
X
r
,
X
i
,
X
j
,
…
,
X
m
}
,
i
=
1,2
,
…
,
m
,
h
h
h
h
h
h
h
h
i
h
i
h
h
h
h
h
h
r
=
1,2
,
…
,
m
,
j
=
1,2
,
…
,
m
and if the conditional probability is
(3)
P
{
X
(
t
n
)
=
X
j
}
=
P
{
X
(
t
n
)
=
X
j
∣
X
(
t
n
-
1
)
=
X
i
,
X
(
t
n
-
2
)
=
X
r
}
,
the transition probability of the node located at X
j at time slice t
n under the condition that the node is located at X
i at time slice t
n
-
1 and X
r at time slice t
n
-
2 is
(4)
P
r
i
j
{
X
(
t
n
)
=
X
j
}
=
∑
i
=
1
,
r
=
1
m
P
{
X
(
t
n
)
=
X
j
∣
X
(
t
n
-
1
)
=
X
i
,
X
(
t
n
-
2
)
=
X
r
}
.
Formula (4) approximately equals the frequency that the node visits the location X
j when the state space tends to infinity [18]:
(5)
p
r
i
j
=
∑
r
=
1
,
i
=
1
r
=
m
,
i
=
m
c
r
i
j
∑
k
=
1
m
c
r
i
k
,
where c
r
i
j is the number of times that the observation node visits location X
j by records statistics, ∑
k
=
1
m
c
r
i
k is the total number of times that the node visits all the locations in E, and then the probability of the node to visit location X
j and the location state of the node at current time slice and also the just visited state is, respectively, X
i and X
r.If there arem location states in state space set, one-step transition probability matrix is a m
×
m
2 matrix:
(6)
P
=
[
p
111
p
112
⋯
p
11
(
m
-
1
)
p
11
m
p
211
p
212
⋯
p
21
(
m
-
1
)
p
21
m
⋮
⋮
⋱
⋮
⋮
p
m
11
p
m
12
⋯
p
m
1
(
m
-
1
)
p
m
1
m
p
m
21
p
m
22
⋯
p
m
2
(
m
-
1
)
p
m
2
m
⋮
⋮
⋱
⋮
⋮
p
m
m
1
p
m
m
2
⋯
p
m
m
(
m
-
1
)
p
m
m
m
]
︷
}
m
m
2
.
The description of the location prediction algorithm based on O2MM is as shown in Algorithm 1.Algorithm 1:
L
_
Markov
(
N
c
,
t
n
): location prediction based on O2MM.
(1)
input: State Space Set E
=
{
X
i
,
i
∈
{
1,2
,
3
,
…
,
m
}
}, Nodes Set N
=
{
N
j
,
j
∈
{
1,2
,
3
,
…
,
n
}
}, the initial
probability distribution is P
(
n
-
1
,
n
-
2
)
=
{
p
r
i
,
r
,
i
∈
{
1,2
,
3
,
…
,
m
}
};
(2)
Discretization of data set: Statistical data of all users related to state set E is made. Then the data set of each
user is processed to be discrete set of the fixed time slice, so the set after discretization is denoted as
follow: {
(
t
k
,
X
i
)
}, k
∈
N
+, i
∈
{
1,2
,
3
,
…
,
m
};
(3)calculate the probability of the node to visit location X
j according to (5) where the location state of the node
at current time slice and also the just visited state is respectively X
i and X
r.
(4)Calculate one step transition probability matrix according to (6);
(5)Calculate the probability of each state at time slice t
n
(a)P
(
n
)
=
P
(
n
-
1
,
n
-
2
)
P
(6)the location state at time slice t
n is
(b)X
j
=
arg
⁡
max
⁡
{
P
j
(
n
)
}
(7)
return
X
j;According to Algorithm1, given the initial probability distribution of the node at time slice n
-
1, n
-
2, we can recurrence the probability distribution at time slice t
n by O2MM. The state set E
=
{
X
1
,
X
2
}, m
=
2, the initial state is {
(
t
n
-
2
,
X
1
)
,
(
t
n
-
1
,
X
2
)
}, and the initial probability distribution is
(7)
P
(
n
-
1
,
n
-
2
)
=
(
p
11
(
n
-
1
,
n
-
2
)
,
p
12
(
n
-
1
,
n
-
2
)
,
p
21
(
n
-
1
,
n
-
2
)
,
p
22
(
n
-
1
,
n
-
2
)
)
=
(
0,1
,
0,0
)
.The transition matrix for Markov chain of order two is(8)
P
=
[
p
111
p
112
p
121
p
122
p
211
p
212
p
221
p
222
]
.
Here the first two numbers of the index representing the current state and the last number represent the next state. And the probability distribution at time slice n is
(9)
P
(
n
)
=
P
(
n
-
1
,
n
-
2
)
P
=
{
p
1
(
n
)
,
p
2
(
n
)
}
.The location state is obtained by the location prediction server at time slicen is
(10)
X
j
=
arg
⁡
max
⁡
{
p
1
(
n
)
,
p
2
(
n
)
}
.In our system the location prediction server gathers the location data of the mobile nodes by the APs. The server executes Algorithm1 to predict the trajectory of each node according to the discrete time slice.


### 3.1.3. Transmission Probability of LOPDAD

The data dissemination mechanism can use the result of the location prediction algorithm using O2MM. At a certain time slice, the data forwarding probability equals the probability of the forwarding node visiting the location where a destination node is, which is given by(11)
p
L
d
=
p
X
j
d
(
n
)
,
where X
j
d is the location state of destination node N
d at time slice t
n, and p
X
j
d
(
n
) is the probability that node N
c visits the location X
j
d at time slice t
n.Algorithm2 describes the process of the location-based data dissemination algorithm, which obtained the forwarding probability p
L
d of N
c to the destination node N
d.Algorithm 2:
P
_
Markov
(
N
c
,
t
n
): data dissemination probability based on location prediction.
Input:
State Space Set E
=
{
X
i
,
i
∈
{
1,2
,
3
,
…
,
m
}
}, N
d, N
c, the initial probability
distribution isP
(
n
-
1
,
n
-
2
)
=
{
p
r
i
,
r
,
i
∈
{
1,2
,
3
,
…
,
m
}
};
Output:
p
L
d
(1) X
j
d
=
L
_
Markov(N
d
,
t
n)
(2–5)Algorithm 1 steps 1–5;
(6) calculation of forwarding probability according to (11)
(7) return p
L
d;


### 3.1.4. The Execution of Location Prediction

The LPS predicts the locations where the destination node and the forwarding nodes will encounter at the future time slices. The threshold of time slices isl. At time slice, t
n, when the LPS receives the service request information REQ(
C
{
N
f
}
,
N
d
) which includes the destination node N
d and the encounter nodes set C
{
N
f
}, from the data carrier node N
s, the LPS calculates the location state set X
=
{
X
(
N
d
,
t
l
)
} of N
d in the time slice t
n
+
1
,
t
n
+
2
,
…
,
t
n
+
l:
(12)
{
X
(
N
d
,
t
l
)
}
=
{
(
t
1
,
X
i
)
,
(
t
2
,
X
j
)
,
…
,
(
t
l
,
X
p
)
}
⊆
{
(
t
k
,
X
i
)
}
,
h
h
h
h
h
h
h
h
h
h
h
k
∈
N
+
,
i
,
j
,
p
∈
{
1,2
,
3
,
…
,
m
}
.And the LPS also calculates the forwarding probability F. P of each nodeN
f in the set C
{
N
f
}. The forwarding nodes setF.N in which the node N
f will visit the location where the destination node N
d locates at the same time slice, and the encounter time slice is recorded inF.T. Finally, the server sends the service information SEI(
F
{
(
N
f
,
P
,
T
)
}
,
{
X
(
N
d
,
t
n
)
}
) to the node N
s. The execution process is described in Algorithm 3.Algorithm 3:LoP_Service(C
{
N
f
}
,
N
d): the location prediction service in the LPS.
(1)
N
s
→
LPS: REQ
(
C
{
N
f
}
,
N
d
)
i
=
0
,
j
=
0
,
k
=
0
,
l
=
3;
(2)
for all
n
∈
[
1
,
l
]
do
(3)
X
(
N
d
,
t
n
)
=
L
_Markov(
N
d
,
t
n
);
(4)
for all
N
f
∈
C
{
N
f
}
do
(5)
X
(
N
f
,
t
n
)
=
L
_Markov(
N
f
,
t
n
); //calculate the location state of N
f at t
n
(6)    if
(
X
(
N
f
,
t
n
)
=
=
X
i
(
N
d
,
t
n
)
)
then//N
f and N
d encounter at t
n
(7)      F
.
N
[
j++]
=
N
f; //N
f is stored as the forwarding node in set F
.
N
(8)      F
.
P
[
i++]
=
P
_Markov(
N
f
,
t
n
); //The probability of N
f meets N
d is stored in set F
.
P
(9)      F
.
T
[
k++]
=
n; //the encounter time slice of N
f
(10)     end if
(11)
end for
(12) end for
(13)
LPS
→
N
s: SEI(
F
{
(
N
f
,
P
,
T
)
}
,
{
X
(
N
d
,
t
n
)
}
);


### 3.1.5. The Selection Mechanism of the Forwarding Nodes Set

When the data carrierN
s receives the SEI from the predictive server, considering the cache management and the load of the network, the number of copies of the forwarding data is a fixed value, COPY, which is decided by the average buffer size of each node and the current load of the network. If N
s finds that the location of N
d is the same as N
s during the threshold time slice, it only transmits to the nodes which can encounter N
d at earlier time slice than N
s. Otherwise, if the number of nodes in the forwarding nodes set is less than COPY, N
s transmits the data to the nodes in the forwarding nodes set and delete the data in its own buffer. If the number of nodes in the forwarding nodes set is more than COPY, N
s transmits the data only to the nodes having maximum probability no more than COPY, according to the following:
(13)
P
L
s
f
d
=
{
P
_
Markov
(
N
f
,
t
n
)
n
,
N
f
∈
F
,
t
n
∈
T
,
n
∈
[
1
,
l
]
}
,
where P
_
Markov
(
N
f
,
t
n
) is the forwarding probability which is equal to the probability that N
f encounters N
d at time slice t
n, where n is the number of time slice intervals when N
f meets N
d. The larger the number of time slice intervals is, the lower the probability of forwarding node is. And the forwarding nodes set F
′ which is selected by N
s:
(14)
F
′
⊆
F
,
F
′
{
N
f
}
=
argmax
f
≤
COPY
{
P
L
s
f
d
}
.


## 3.1.1. Preparation Process

Preparation before prediction process includes the following steps.(
1) Determination of State Set. According to the collection of mobile nodes trajectories from the system server, the location elements in the collecting data are counted, which is denoted as set L. As set L contains a number of location elements, the locations of higher visiting frequency are chosen as state space of the system, denoted as set E, E
⊂
L.(2) Discretization of Data Set. Statistical data of all users related to state set E is made. Then the dataset of each user is processed to be discrete set of the fixed time period, so the set after discretization is denoted as follows:
(1)
{
(
t
k
,
X
i
)
}
,
k
=
1,2
,
3
,
…
,
i
∈
{
1,2
,
3
,
…
,
m
}
.


## 3.1.2. Location Prediction Algorithm Based on O2MM

Order-1 Markov chain model (O1MM) uses the state transition matrix and the initial distribution to predict, which is simple and intuitive [16]. However, as the indeterminacy of the state transition probabilities is unscientific division of the initial state of the system, the prediction result of this method tends to produce larger errors.Unlike the first order, a Markov chain of higher order is a Markov model with memory, that is, a Markov chain that depends on not only the current state, but also onn
-
1 states before, where n is the order and n is finite [17]. The chain is dependent on where it is right now and also where it was in the last occasion. Order-2 Markov chain model (O2MM) is used to improve the accuracy of prediction method. Compared with the prediction based on order-1 Markov chain, order-2 Markov chain model can be more complete and rational use of information and effectively integrated with correlation analysis, so as to improve prediction accuracy. O2MM depends on the current state and also the just visited state.The finite state space of O2MM is(2)
E
=
{
X
1
,
X
2
,
…
,
X
r
,
X
i
,
X
j
,
…
,
X
m
}
,
i
=
1,2
,
…
,
m
,
h
h
h
h
h
h
h
h
i
h
i
h
h
h
h
h
h
r
=
1,2
,
…
,
m
,
j
=
1,2
,
…
,
m
and if the conditional probability is
(3)
P
{
X
(
t
n
)
=
X
j
}
=
P
{
X
(
t
n
)
=
X
j
∣
X
(
t
n
-
1
)
=
X
i
,
X
(
t
n
-
2
)
=
X
r
}
,
the transition probability of the node located at X
j at time slice t
n under the condition that the node is located at X
i at time slice t
n
-
1 and X
r at time slice t
n
-
2 is
(4)
P
r
i
j
{
X
(
t
n
)
=
X
j
}
=
∑
i
=
1
,
r
=
1
m
P
{
X
(
t
n
)
=
X
j
∣
X
(
t
n
-
1
)
=
X
i
,
X
(
t
n
-
2
)
=
X
r
}
.
Formula (4) approximately equals the frequency that the node visits the location X
j when the state space tends to infinity [18]:
(5)
p
r
i
j
=
∑
r
=
1
,
i
=
1
r
=
m
,
i
=
m
c
r
i
j
∑
k
=
1
m
c
r
i
k
,
where c
r
i
j is the number of times that the observation node visits location X
j by records statistics, ∑
k
=
1
m
c
r
i
k is the total number of times that the node visits all the locations in E, and then the probability of the node to visit location X
j and the location state of the node at current time slice and also the just visited state is, respectively, X
i and X
r.If there arem location states in state space set, one-step transition probability matrix is a m
×
m
2 matrix:
(6)
P
=
[
p
111
p
112
⋯
p
11
(
m
-
1
)
p
11
m
p
211
p
212
⋯
p
21
(
m
-
1
)
p
21
m
⋮
⋮
⋱
⋮
⋮
p
m
11
p
m
12
⋯
p
m
1
(
m
-
1
)
p
m
1
m
p
m
21
p
m
22
⋯
p
m
2
(
m
-
1
)
p
m
2
m
⋮
⋮
⋱
⋮
⋮
p
m
m
1
p
m
m
2
⋯
p
m
m
(
m
-
1
)
p
m
m
m
]
︷
}
m
m
2
.
The description of the location prediction algorithm based on O2MM is as shown in Algorithm 1.Algorithm 1:
L
_
Markov
(
N
c
,
t
n
): location prediction based on O2MM.
(1)
input: State Space Set E
=
{
X
i
,
i
∈
{
1,2
,
3
,
…
,
m
}
}, Nodes Set N
=
{
N
j
,
j
∈
{
1,2
,
3
,
…
,
n
}
}, the initial
probability distribution is P
(
n
-
1
,
n
-
2
)
=
{
p
r
i
,
r
,
i
∈
{
1,2
,
3
,
…
,
m
}
};
(2)
Discretization of data set: Statistical data of all users related to state set E is made. Then the data set of each
user is processed to be discrete set of the fixed time slice, so the set after discretization is denoted as
follow: {
(
t
k
,
X
i
)
}, k
∈
N
+, i
∈
{
1,2
,
3
,
…
,
m
};
(3)calculate the probability of the node to visit location X
j according to (5) where the location state of the node
at current time slice and also the just visited state is respectively X
i and X
r.
(4)Calculate one step transition probability matrix according to (6);
(5)Calculate the probability of each state at time slice t
n
(a)P
(
n
)
=
P
(
n
-
1
,
n
-
2
)
P
(6)the location state at time slice t
n is
(b)X
j
=
arg
⁡
max
⁡
{
P
j
(
n
)
}
(7)
return
X
j;According to Algorithm1, given the initial probability distribution of the node at time slice n
-
1, n
-
2, we can recurrence the probability distribution at time slice t
n by O2MM. The state set E
=
{
X
1
,
X
2
}, m
=
2, the initial state is {
(
t
n
-
2
,
X
1
)
,
(
t
n
-
1
,
X
2
)
}, and the initial probability distribution is
(7)
P
(
n
-
1
,
n
-
2
)
=
(
p
11
(
n
-
1
,
n
-
2
)
,
p
12
(
n
-
1
,
n
-
2
)
,
p
21
(
n
-
1
,
n
-
2
)
,
p
22
(
n
-
1
,
n
-
2
)
)
=
(
0,1
,
0,0
)
.The transition matrix for Markov chain of order two is(8)
P
=
[
p
111
p
112
p
121
p
122
p
211
p
212
p
221
p
222
]
.
Here the first two numbers of the index representing the current state and the last number represent the next state. And the probability distribution at time slice n is
(9)
P
(
n
)
=
P
(
n
-
1
,
n
-
2
)
P
=
{
p
1
(
n
)
,
p
2
(
n
)
}
.The location state is obtained by the location prediction server at time slicen is
(10)
X
j
=
arg
⁡
max
⁡
{
p
1
(
n
)
,
p
2
(
n
)
}
.In our system the location prediction server gathers the location data of the mobile nodes by the APs. The server executes Algorithm1 to predict the trajectory of each node according to the discrete time slice.


## 3.1.3. Transmission Probability of LOPDAD

The data dissemination mechanism can use the result of the location prediction algorithm using O2MM. At a certain time slice, the data forwarding probability equals the probability of the forwarding node visiting the location where a destination node is, which is given by(11)
p
L
d
=
p
X
j
d
(
n
)
,
where X
j
d is the location state of destination node N
d at time slice t
n, and p
X
j
d
(
n
) is the probability that node N
c visits the location X
j
d at time slice t
n.Algorithm2 describes the process of the location-based data dissemination algorithm, which obtained the forwarding probability p
L
d of N
c to the destination node N
d.Algorithm 2:
P
_
Markov
(
N
c
,
t
n
): data dissemination probability based on location prediction.
Input:
State Space Set E
=
{
X
i
,
i
∈
{
1,2
,
3
,
…
,
m
}
}, N
d, N
c, the initial probability
distribution isP
(
n
-
1
,
n
-
2
)
=
{
p
r
i
,
r
,
i
∈
{
1,2
,
3
,
…
,
m
}
};
Output:
p
L
d
(1) X
j
d
=
L
_
Markov(N
d
,
t
n)
(2–5)Algorithm 1 steps 1–5;
(6) calculation of forwarding probability according to (11)
(7) return p
L
d;


## 3.1.4. The Execution of Location Prediction

The LPS predicts the locations where the destination node and the forwarding nodes will encounter at the future time slices. The threshold of time slices isl. At time slice, t
n, when the LPS receives the service request information REQ(
C
{
N
f
}
,
N
d
) which includes the destination node N
d and the encounter nodes set C
{
N
f
}, from the data carrier node N
s, the LPS calculates the location state set X
=
{
X
(
N
d
,
t
l
)
} of N
d in the time slice t
n
+
1
,
t
n
+
2
,
…
,
t
n
+
l:
(12)
{
X
(
N
d
,
t
l
)
}
=
{
(
t
1
,
X
i
)
,
(
t
2
,
X
j
)
,
…
,
(
t
l
,
X
p
)
}
⊆
{
(
t
k
,
X
i
)
}
,
h
h
h
h
h
h
h
h
h
h
h
k
∈
N
+
,
i
,
j
,
p
∈
{
1,2
,
3
,
…
,
m
}
.And the LPS also calculates the forwarding probability F. P of each nodeN
f in the set C
{
N
f
}. The forwarding nodes setF.N in which the node N
f will visit the location where the destination node N
d locates at the same time slice, and the encounter time slice is recorded inF.T. Finally, the server sends the service information SEI(
F
{
(
N
f
,
P
,
T
)
}
,
{
X
(
N
d
,
t
n
)
}
) to the node N
s. The execution process is described in Algorithm 3.Algorithm 3:LoP_Service(C
{
N
f
}
,
N
d): the location prediction service in the LPS.
(1)
N
s
→
LPS: REQ
(
C
{
N
f
}
,
N
d
)
i
=
0
,
j
=
0
,
k
=
0
,
l
=
3;
(2)
for all
n
∈
[
1
,
l
]
do
(3)
X
(
N
d
,
t
n
)
=
L
_Markov(
N
d
,
t
n
);
(4)
for all
N
f
∈
C
{
N
f
}
do
(5)
X
(
N
f
,
t
n
)
=
L
_Markov(
N
f
,
t
n
); //calculate the location state of N
f at t
n
(6)    if
(
X
(
N
f
,
t
n
)
=
=
X
i
(
N
d
,
t
n
)
)
then//N
f and N
d encounter at t
n
(7)      F
.
N
[
j++]
=
N
f; //N
f is stored as the forwarding node in set F
.
N
(8)      F
.
P
[
i++]
=
P
_Markov(
N
f
,
t
n
); //The probability of N
f meets N
d is stored in set F
.
P
(9)      F
.
T
[
k++]
=
n; //the encounter time slice of N
f
(10)     end if
(11)
end for
(12) end for
(13)
LPS
→
N
s: SEI(
F
{
(
N
f
,
P
,
T
)
}
,
{
X
(
N
d
,
t
n
)
}
);


## 3.1.5. The Selection Mechanism of the Forwarding Nodes Set

When the data carrierN
s receives the SEI from the predictive server, considering the cache management and the load of the network, the number of copies of the forwarding data is a fixed value, COPY, which is decided by the average buffer size of each node and the current load of the network. If N
s finds that the location of N
d is the same as N
s during the threshold time slice, it only transmits to the nodes which can encounter N
d at earlier time slice than N
s. Otherwise, if the number of nodes in the forwarding nodes set is less than COPY, N
s transmits the data to the nodes in the forwarding nodes set and delete the data in its own buffer. If the number of nodes in the forwarding nodes set is more than COPY, N
s transmits the data only to the nodes having maximum probability no more than COPY, according to the following:
(13)
P
L
s
f
d
=
{
P
_
Markov
(
N
f
,
t
n
)
n
,
N
f
∈
F
,
t
n
∈
T
,
n
∈
[
1
,
l
]
}
,
where P
_
Markov
(
N
f
,
t
n
) is the forwarding probability which is equal to the probability that N
f encounters N
d at time slice t
n, where n is the number of time slice intervals when N
f meets N
d. The larger the number of time slice intervals is, the lower the probability of forwarding node is. And the forwarding nodes set F
′ which is selected by N
s:
(14)
F
′
⊆
F
,
F
′
{
N
f
}
=
argmax
f
≤
COPY
{
P
L
s
f
d
}
.


## 3.2. Swarm Intelligence Heuristic Data Dissemination (ACODAD)

The inspiring source of ACO is the pheromone trail laying and following behavior of real ants which use pheromones as a communication medium. Artificial ants used in ACO are stochastic solution construction procedures that probabilistically build a solution by iteratively adding solution components to partial solutions by taking into account (i) heuristic information on the problem instance being solved, if available, and (ii) (artificial) pheromone trails which change dynamically at run-time to reflect the agents’ acquired search experience [19]. In our algorithm, ACO is improved to be applied in data dissemination in opportunistic cognitive networks.


### 3.2.1. Ant Colony Optimization- (ACO-) Based Data Dissemination in OCN (ACODAD)

The pheromone in ACODAD is the intimacy between two nodes. The more frequency and continuous the contact between two nodes is, the higher the value of intimacy is. It means that the higher the pheromone is. The data carrier node tends to choose the node which has high intimacy value with the destination nodes to forward the data. It means that the data forwarding probability of the node having high intimacy with the destination node is high. The comparison of the characteristics between ACODAD and ACO is shown in Table1.Table 1
Comparison of characteristics between ACODAD and ACO.
Characteristics
ACODAD
ACO
Transmission process of data
Data dissemination based on the encounter of two nodes
Artificial ants move from one location to the neighbor one
Transition probability
The probability that the forwarding node encounters the destination node
The state transition probabilities that are from one location to the next
Pheromone
Intimacy between two nodes
Pheromone trail laying by ants
Path length
The interval of time slices that two nodes encounter
The distance between two locations
Pheromone evaporation
No contact between the two nodes during threshold time
As time goes by the pheromone evaporates


### 3.2.2. Intimacy between Two Nodes in OCN

Each node in opportunistic cognitive networks maintains a relationship table with other nodes using the value of intimacy.For example, at time slicet
s, the data carrier node N
s arrives at location X
i and senses all the other nodes within the communication range via the communication channels (such as ZigBee, Bluetooth, NFC, and other short-range communication protocols). Those nodes are added in encounter nodes set C
{
N
f
} of N
s and are recorded in the relationship table with the calculation results of intimacy.The intimacy between two nodesN
i and N
j depends on the frequency of two nodes in connection based on contact times n
i
j, lasting time of one connection Δ
D
i
j
c, and the encounter intervals between two contacts Δ
I
i
j
c. The mathematical description of intimacy is as follows, where R
i
j
(
t
) is the intimacy of N
i and N
j at time slice t:
(15)
R
i
j
(
t
)
=
{
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
,
∀
Δ
I
i
j
c
<
k
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
×
(
1
-
ρ
)
e
,
∃
Δ
I
i
j
c
>
k
0
,
Δ
I
i
j
c
>
T
,
over
the
system
running
time
,
where ρ is the evaporation rate, k is the threshold of encounter time intervals of two nodes, and e is the times when the time intervals is more than k.Although the intimacy is defined in consideration of encounter time intervals, if the two nodes are not in connection for a long time (more than a certain time threshold valuek), it enables the intimacy evaporation mechanism to ensure the most frequently contact nodes with a high degree of intimacy. If the encounter time intervals are beyond the system running time T, the value of intimacy is zero.When two nodes encounter, they, respectively, compute the intimacy based on records of encounter timet
s and the departure time t
e at the contact times c. Each node records the time according to its own time clock. When c
=
1, Δ
I
i
j
c equals the encounter time of the first contact. The algorithm of intimacy is as shown in Algorithm 4.Algorithm 4:
Intimacy
(
N
i
,
N
j
) computes the intimacy value between two nodes at encounter time T.
Input:
N
i, N
j
Output:
R
i
j
(
T
)
(1)
define
T the system running time
(2)L encounter time interval threshold
(3)    Contact vector arrayM
i
j
→(c, t
s, t
e)
(4) initialization:M
i
j
→
[
0
]
=
(
0,0
,
0
), R
i
j(0) = 0, k
=
L
,
f
l
a
g
=
1;
(5)
forall
t
=
0
:
T;
(6) if
N
i recieve HELLO from N
j
(7)   n
i
j = ++c;
(8)   for all
c
=
1
:
n
i
j
(9)    Δ
D
i
j
c
[
c
]
=
t
e
-
t
s;
(10)    D
i
j
c += Δ
D
i
j
c;
(11)    Δ
I
i
j
c
[
c
]
=
t
s
-
t;
(12)    I
i
j
c += Δ
I
i
j
c;
(13)    t
=
t
e;
(14)    if(Δ
I
i
j
c
[
c
]
>
k)
(15)
e++;
(16)
f
l
a
g
=
0;
(17)    end if
(18)
end for
(19)
end if
(20)
end for
(21)
if(f
l
a
g
=
=
0)
(22) return
R
i
j
(
T
)
=
(
(
n
i
j
×
D
i
j
c
)
/
I
i
j
c
)
×
(
1
-
ρ
)
e
(23)
else
(24)
return
R
i
j
(
T
)
=
(
n
i
j
×
D
i
j
c
)
/
I
i
j
c
(25)
end ifAlgorithm4 captures the essence of (15). The intimacy between two nodes is used to compute the forwarding probability in ACODAD.The intimacy updates during the time durationΔ
t; the variation of the intimacy is given by
(16)
R
i
j
(
t
+
Δ
t
)
=
R
i
j
(
t
)
+
Δ
R
i
j
(
t
)
,
Δ
R
i
j
(
t
)
=
{
(
n
i
j
+
Δ
n
i
j
)
×
∑
c
=
1
(
n
i
j
+
Δ
n
i
j
)
Δ
D
i
j
c
∑
c
=
1
(
n
i
j
+
Δ
n
i
j
)
Δ
I
i
j
c
-
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
,
Δ
n
i
j
>
0
,
∀
Δ
I
i
j
c
<
k
-
ρ
×
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
Δ
n
i
j
=
0
,
Δ
t
>
k
,
∀
Δ
I
i
j
c
<
k
0
,
otherwise
.


### 3.2.3. Transmission Probability of ACODAD

When the data carrier nodeN
s encounters the nodes in set C
{
N
f
} and chooses the forwarding nodes from C
{
N
f
} to the destination N
d based on the intimacy between the node in C
{
N
f
} and N
d, the forwarding probability is defined as the following equation:
(17)
p
R
s
f
d
=
{
1
j
=
d
0
Intimacy
(
N
f
,
N
d
)
<
Intimacy
(
N
i
,
N
d
)
[
R
f
d
(
t
)
]
α
·
[
η
f
d
(
t
)
]
β
∑
N
f
∈
allowd
d
R
j
d
α
·
η
j
d
β
N
f
∈
allowd
d
,
where allowd
d is given by
(18)
allowd
d
t
=
F
{
N
f
∣
(
R
f
d
(
t
)
>
R
i
d
(
t
)
)
}
,
allowd
d
t
∈
F
{
N
f
}
,
allowd
d
=
allowd
d
t
-
tabu
d
,
where tabu
d is the node set including those nodes which have already carried the transmission data copy and also the node had the copy before. Such nodes will not be selected as the forwarding nodes.The parametersα and β control the relative importance of the pheromone versus the heuristic information, η
f
d, which is given by
(19)
η
f
d
=
1
L
f
d
,
where L
f
d is the time slice intervals that N
f and N
d will encounter which is an estimation value given by the records in the contact vector.A heuristic valueη, respectively, represents a priori information about the problem instance definition or run-time information provided by a source different from the ants. In many cases η is the cost, or an estimate of the cost, of extending the current state. These values are used by the ants’ heuristic rule to make probabilistic decisions on how to move on the graph [32].In our algorithm, the heuristic value is defined as the distance betweenN
f and N
d. As the location state of nodes is discretized by the time slice. And the delay of data forwarding between the two nodes is not decided by the absolute path length or the distance between the two nodes but by calculating the number of time slice intervals between forwarding node and the destination node to meet with each other.The data carrier nodeN
s chooses the forwarding nodes from set C
{
N
f
} according to the forwarding probability based on intimacy. Considering the cache management, our algorithms set the maximum copy quantity of a unique data message. If the data forwarding operation is executed, N
s will transmit the data to the nodes in set C
′
{
N
f
}, which is given by (20), and the quantity of nodes, denoted by f, is no more than COPY. Finally, N
s will delete the data stored in its buffer:
(20)
C
′
⊆
C
{
N
f
}
,
C
′
{
N
f
}
=
argmax
f
≤
COPY
{
P
R
s
f
d
}
.


## 3.2.1. Ant Colony Optimization- (ACO-) Based Data Dissemination in OCN (ACODAD)

The pheromone in ACODAD is the intimacy between two nodes. The more frequency and continuous the contact between two nodes is, the higher the value of intimacy is. It means that the higher the pheromone is. The data carrier node tends to choose the node which has high intimacy value with the destination nodes to forward the data. It means that the data forwarding probability of the node having high intimacy with the destination node is high. The comparison of the characteristics between ACODAD and ACO is shown in Table1.Table 1
Comparison of characteristics between ACODAD and ACO.
Characteristics
ACODAD
ACO
Transmission process of data
Data dissemination based on the encounter of two nodes
Artificial ants move from one location to the neighbor one
Transition probability
The probability that the forwarding node encounters the destination node
The state transition probabilities that are from one location to the next
Pheromone
Intimacy between two nodes
Pheromone trail laying by ants
Path length
The interval of time slices that two nodes encounter
The distance between two locations
Pheromone evaporation
No contact between the two nodes during threshold time
As time goes by the pheromone evaporates


## 3.2.2. Intimacy between Two Nodes in OCN

Each node in opportunistic cognitive networks maintains a relationship table with other nodes using the value of intimacy.For example, at time slicet
s, the data carrier node N
s arrives at location X
i and senses all the other nodes within the communication range via the communication channels (such as ZigBee, Bluetooth, NFC, and other short-range communication protocols). Those nodes are added in encounter nodes set C
{
N
f
} of N
s and are recorded in the relationship table with the calculation results of intimacy.The intimacy between two nodesN
i and N
j depends on the frequency of two nodes in connection based on contact times n
i
j, lasting time of one connection Δ
D
i
j
c, and the encounter intervals between two contacts Δ
I
i
j
c. The mathematical description of intimacy is as follows, where R
i
j
(
t
) is the intimacy of N
i and N
j at time slice t:
(15)
R
i
j
(
t
)
=
{
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
,
∀
Δ
I
i
j
c
<
k
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
×
(
1
-
ρ
)
e
,
∃
Δ
I
i
j
c
>
k
0
,
Δ
I
i
j
c
>
T
,
over
the
system
running
time
,
where ρ is the evaporation rate, k is the threshold of encounter time intervals of two nodes, and e is the times when the time intervals is more than k.Although the intimacy is defined in consideration of encounter time intervals, if the two nodes are not in connection for a long time (more than a certain time threshold valuek), it enables the intimacy evaporation mechanism to ensure the most frequently contact nodes with a high degree of intimacy. If the encounter time intervals are beyond the system running time T, the value of intimacy is zero.When two nodes encounter, they, respectively, compute the intimacy based on records of encounter timet
s and the departure time t
e at the contact times c. Each node records the time according to its own time clock. When c
=
1, Δ
I
i
j
c equals the encounter time of the first contact. The algorithm of intimacy is as shown in Algorithm 4.Algorithm 4:
Intimacy
(
N
i
,
N
j
) computes the intimacy value between two nodes at encounter time T.
Input:
N
i, N
j
Output:
R
i
j
(
T
)
(1)
define
T the system running time
(2)L encounter time interval threshold
(3)    Contact vector arrayM
i
j
→(c, t
s, t
e)
(4) initialization:M
i
j
→
[
0
]
=
(
0,0
,
0
), R
i
j(0) = 0, k
=
L
,
f
l
a
g
=
1;
(5)
forall
t
=
0
:
T;
(6) if
N
i recieve HELLO from N
j
(7)   n
i
j = ++c;
(8)   for all
c
=
1
:
n
i
j
(9)    Δ
D
i
j
c
[
c
]
=
t
e
-
t
s;
(10)    D
i
j
c += Δ
D
i
j
c;
(11)    Δ
I
i
j
c
[
c
]
=
t
s
-
t;
(12)    I
i
j
c += Δ
I
i
j
c;
(13)    t
=
t
e;
(14)    if(Δ
I
i
j
c
[
c
]
>
k)
(15)
e++;
(16)
f
l
a
g
=
0;
(17)    end if
(18)
end for
(19)
end if
(20)
end for
(21)
if(f
l
a
g
=
=
0)
(22) return
R
i
j
(
T
)
=
(
(
n
i
j
×
D
i
j
c
)
/
I
i
j
c
)
×
(
1
-
ρ
)
e
(23)
else
(24)
return
R
i
j
(
T
)
=
(
n
i
j
×
D
i
j
c
)
/
I
i
j
c
(25)
end ifAlgorithm4 captures the essence of (15). The intimacy between two nodes is used to compute the forwarding probability in ACODAD.The intimacy updates during the time durationΔ
t; the variation of the intimacy is given by
(16)
R
i
j
(
t
+
Δ
t
)
=
R
i
j
(
t
)
+
Δ
R
i
j
(
t
)
,
Δ
R
i
j
(
t
)
=
{
(
n
i
j
+
Δ
n
i
j
)
×
∑
c
=
1
(
n
i
j
+
Δ
n
i
j
)
Δ
D
i
j
c
∑
c
=
1
(
n
i
j
+
Δ
n
i
j
)
Δ
I
i
j
c
-
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
,
Δ
n
i
j
>
0
,
∀
Δ
I
i
j
c
<
k
-
ρ
×
n
i
j
×
∑
c
=
1
n
i
j
Δ
D
i
j
c
∑
c
=
1
n
i
j
Δ
I
i
j
c
Δ
n
i
j
=
0
,
Δ
t
>
k
,
∀
Δ
I
i
j
c
<
k
0
,
otherwise
.


## 3.2.3. Transmission Probability of ACODAD

When the data carrier nodeN
s encounters the nodes in set C
{
N
f
} and chooses the forwarding nodes from C
{
N
f
} to the destination N
d based on the intimacy between the node in C
{
N
f
} and N
d, the forwarding probability is defined as the following equation:
(17)
p
R
s
f
d
=
{
1
j
=
d
0
Intimacy
(
N
f
,
N
d
)
<
Intimacy
(
N
i
,
N
d
)
[
R
f
d
(
t
)
]
α
·
[
η
f
d
(
t
)
]
β
∑
N
f
∈
allowd
d
R
j
d
α
·
η
j
d
β
N
f
∈
allowd
d
,
where allowd
d is given by
(18)
allowd
d
t
=
F
{
N
f
∣
(
R
f
d
(
t
)
>
R
i
d
(
t
)
)
}
,
allowd
d
t
∈
F
{
N
f
}
,
allowd
d
=
allowd
d
t
-
tabu
d
,
where tabu
d is the node set including those nodes which have already carried the transmission data copy and also the node had the copy before. Such nodes will not be selected as the forwarding nodes.The parametersα and β control the relative importance of the pheromone versus the heuristic information, η
f
d, which is given by
(19)
η
f
d
=
1
L
f
d
,
where L
f
d is the time slice intervals that N
f and N
d will encounter which is an estimation value given by the records in the contact vector.A heuristic valueη, respectively, represents a priori information about the problem instance definition or run-time information provided by a source different from the ants. In many cases η is the cost, or an estimate of the cost, of extending the current state. These values are used by the ants’ heuristic rule to make probabilistic decisions on how to move on the graph [32].In our algorithm, the heuristic value is defined as the distance betweenN
f and N
d. As the location state of nodes is discretized by the time slice. And the delay of data forwarding between the two nodes is not decided by the absolute path length or the distance between the two nodes but by calculating the number of time slice intervals between forwarding node and the destination node to meet with each other.The data carrier nodeN
s chooses the forwarding nodes from set C
{
N
f
} according to the forwarding probability based on intimacy. Considering the cache management, our algorithms set the maximum copy quantity of a unique data message. If the data forwarding operation is executed, N
s will transmit the data to the nodes in set C
′
{
N
f
}, which is given by (20), and the quantity of nodes, denoted by f, is no more than COPY. Finally, N
s will delete the data stored in its buffer:
(20)
C
′
⊆
C
{
N
f
}
,
C
′
{
N
f
}
=
argmax
f
≤
COPY
{
P
R
s
f
d
}
.


## 3.3. Location Prediction Based Data Dissemination Using Swarm Intelligence (LOPSI)

The data dissemination algorithm LOPSI considers not only the intimacy between the forwarding node and the destination node, but also the location where the two nodes may encounter. According to the location prediction algorithm, the set of forwarding nodes,F
{
N
f
}, which visit the location where the destination node will be during the threshold time slices, can be obtained. And the data carrier node N
s only sends message to nodes in F
{
N
f
} and compares the intimacy between N
d and N
f
∈
F
{
N
f
}. Combined with the prediction results from LOPDAD and ACODAD, the transmission probability from node N
s to the forwarding node N
f is calculated by the weight formula
(21)
p
s
f
d
=
γ
*
p
R
s
f
d
+
δ
*
p
L
s
f
d
,
γ
+
δ
=
1
,
where p
R
s
f
d is the forwarding probability obtained from ACODAD, p
L
s
f
d is the forwarding probability obtained from LOPDAD, and parameters γ and δ are the weights of the two probabilities.In our campus environment the mobile node can communicate to the location prediction server anywhere and anytime. The prediction server provides only location prediction service and no other services. Algorithm5 describes the whole execution process of LOPSI. LOSI_Sec is part of Algorithm 5, which is a function that the data message transfers from the current node to the forwarding node set. When the source node N
s wants to send the data message to the destination node N
d, N
s will choose the potential nodes by location prediction schemes and then obtain the intimacy between the potential nodes and the destination node. Thus the forwarding node set will be determined. The execution process of LOPSI is described in Algorithm 5.Algorithm 5:
LOPSI
(
N
s
,
N
d
).
(1)
Initialization: node set N
=
{
N
i
,
i
=
1,2
,
…
,
k
,
k
∈
N
+
}, state space E
=
{
X
j
,
j
=
1,2
,
…
,
m
,
m
∈
N
+
}, time
slice set T
=
{
t
n
,
n
=
0,1
,
2
,
…
,
l
,
l
∈
N
+
} Maximum data copies: COPY;
(2)
for
n
=
0
:
l
// the system running time
// the function executes the one hop data dissemination to the forwarding node set
(3)LOPSI_Sec(N
s)
(4)
for
∀
N
f
∈
F
′
{
N
f
}
(5)execution of LOPSI_Sec
(
N
f
);
(6)
end for
(7)
end forFor any nodeN
i carrying data message, LOPSI_Sec(N
i) will determine the forwarding node set. The description of LOPSI_Sec(N
i) is given as shown in Algorithm 6.Algorithm 6:LOPSI_Sec(N
i): the function executes one-hop data dissemination to the forwarding node set.
(1)
N
i senses the contact nodes set C
{
N
f
};
(2)for
∀
N
f
∈
C
{
N
f
}
(3)update intimacy(N
i
,
N
f);
(4)
end for
/* the source node deliver the data directly to the destination node if the destination node is in the contact
nodes set C
{
N
f
} and update the node set tabu
d
/
*
(5)
if
N
d
∈
C
{
N
f
}
(6)  N
i transmits data to N
d;
(7)
tabu
d
←
{
N
i
,
N
d
};
(8)
break the Algorithm
5;
(9)else
(10)
N
s sends REQ(
C
{
N
f
}
,
N
d
) to the server;
(11)the server executes LoP_Service(C
{
N
f
}
,
N
d);
(12)
N
s receives SEI;
(13)
N
s sends N
d to the nodes in F
{
N
f
};
(14)
for
∀
N
f
∈
F
{
N
f
}
(15)    Send intimacy(N
f
,
N
d) to N
s;
(16)
end for
(17)
N
s calculates p
s
f
d according to (21);
(18)
if(f
≤
COPY)   //f is the number of forwarding nodes
(19)   F
′
{
N
f
}
=
F
{
N
f
};
(20)
else
(21)   F
′
{
N
f
}
=
{
arg
⁡
max
f
≤
COPY
⁡
(
p
s
f
d
)
}
(22)
end if
(23)
N
i sends data to F
′
{
N
f
};
(24)
tabu
d
←
{
N
i
,
F
′
{
N
f
}
};
(25)
N
i delete the data copy in its buffer;
(26)
end ifAlgorithm5 describes the essence of LOPSI. Each data has a TTL, which indicates how long the data can live in the network. It is set by the provider at the time of data generation. In Algorithm 5 the length of time slices l equals TTL. The data carried by each node within TTL duration cannot be forwarded and then be automatically discarded.


## 4. Performance Evaluation

In this section, we present the simulation results to demonstrate the performance of proposed data dissemination algorithms. Note that the recent work studying the nature of human mobility has proved that suitable movement models can sufficiently present the behavior of human mobility [33]. The model of mobility pattern deployed in our platform is SPMBM model [34], which is a mobility model that integrates temporal and spatial relationships and selects the shortest path for the node randomly walking in the map area.


### 4.1. Simulation Settings

The data sets to evaluate the location prediction algorithm based on O2MM are obtained from wireless topology discovery (WTD) [35], which are employed in our simulation. The accuracy of the location prediction algorithms based on O1MM and O2MM can be obtained from our previous work [36], which is given in Table 2.Table 2
The accuracy of location prediction algorithms based on O1MM and O2MM.
O1MM
O2MM
Prediction accuracy
0.5610
0.8030
Time complexity
O
(
N
)
O
(
N
2
)
Storage space
O
(
N
2
)
O
(
N
3
)The simulation is based on a realistic campus scenario shown in Figure2. There are 40 locations and each one installed a WiFi access point, which can cover the campus area. The mobile nodes can be cars and pedestrians with smart phones. The location prediction server can communicate with mobile nodes via WiFi and only provide location prediction service and no other services. The only way to exchange and obtain data is through the contact of two nodes. If the communication range increases and is out of the range of APs, the mobile devices can exchange data by the ACODAD without using location prediction scheme by different wireless communication techniques including WiFi Direct, Bluetooth, and ZigBee. In order to evaluate the performance of the proposed data dissemination algorithms, we conduct a series of experiments under the parameters in Table 3. The First In First Out is applied on buffer management. In order to avoid the heavy traffic load and cache load, each data is set a TTL, and the maximum copies of each data is a fixed constant in the system.Table 3
Simulation parameters.
Parameter
Value
Scene features
Simulation time
12 h
Field area
4500 m * 3400 m
Scene
NEU Campus
APs
40
Node features
Mobility model
SPMBM
Movement speed for cars
2.7–13.9 m/s
Movement speed for pedestrians
0.5–1.5 m/s
Transmission rate
250 KB/s
Maximum transmission range
10 m
Transmission mode
Broadcast
Cache size
10 MB/1 G
Message features
Packet size
500 KB–1 MB at random
Frequency of creating packets
From 25 s to 35 s at random
Number of copies
8
TTL
5 hoursFigure 2
The simulation based on a realistic campus scenario.With the above settings, the three data dissemination algorithms proposed in our work LOPDAD, ACODAD, and LOPSI are evaluated and compared with well-known opportunistic routing protocols: PRoPHET and Spray and Wait.


### 4.2. Evaluation Metrics

Four metrics are used to evaluate the performance requirements of the aforementioned data dissemination algorithms: average hops, delivery ratio, average latency, and transmission cost.Average Hop
H. This hop-count metric is to assess the delivery cost in time and in cache. N denotes the total number of forwarding nodes of every transmission of data including both successful and failure delivery. Y is the total number of created unique data messages. H is given by
(22)
H
=
N
Y
.Delivery Ratio
R. This metric is to evaluate the effectiveness and utility of the algorithm. S is the total number of successfully delivered unique data messages. R is given by
(23)
R
=
S
Y
.Average Latency
L [35]. The average latency of a unique message is calculated by the following equation:
(24)
L
=
1
Y
∑
i
=
1
Y
(
T
d
i
-
T
s
i
)
,
where T
s
i is the moment that a unique data message i is originated, and T
d
i is the time when the first replicate of unique message i arrives at the destination. The replicate is a copy of a unique message. The number of replicates depends on the methodology of the routing algorithm, single or multiple copies [35].Transmission Cost
C. It is a key metric to characterize the resource consumption and evaluate the data dissemination algorithms in OCNs. The total number of copies of unique data messages to deliver in the system, denoted by Q, is divided by the number of copies of successfully delivered messages, denoted by P:
(25)
C
=
Q
P
.


### 4.3. Influence on Performance with the Variation of Total Number of Nodes

Average Hops. As shown in Figure 3(a), with the increasing of numbers of nodes, due to the hop limitation of Spray and Wait, the average hops are relatively small; PRoPHET has no restrictions in this respect; the frequency of nodes encountering increases, resulting in an increase in the average hops. Our algorithms are proposed to consider the management of cache space and limit the maximum number of copies of the nodes in the network, which constrains the hops of data messages transmission. LOPDAD and LOPSI especially set a time threshold on executing location prediction, which guaranteed the data message delivery to the destination node within the time threshold. The location state is discrete by the time slices, so threshold of time slices corresponds to the number of hops. Therefore, the average hops of our algorithms are relatively small.(a) Average hops variation with the increase of the number of nodes. (b) Delivery ratio variations with the increase of the number of nodes. (c) Average latency variations with the increase of the number of nodes. (d) Transmission cost variations with the increase of the number of nodes.
(a)
(b)
(c)
(d)Delivery Ratio. As shown in Figure 3(b), whether for Spray and Wait, PRoPHET, and our data distribution algorithms, the delivery ratio significantly increases with the increase of the nodes. LOPDAD, ACODAD, LOPSI, and Spray and Wait have constrained the number of copies of the data messages transmitted in the network. Even if the number of nodes and the amount of data messages increases, the storage space and the network overhead maintain a good status, avoiding data transmission failure by the heavy load of cache and network resources depletion. Therefore, delivery ratio is better than the PRoPHET transmission. LOPDAD selects forwarding nodes which are most likely to complete the task based on location prediction. ACODAD selects the best forwarding nodes by high intimacy. LOPSI tends to make more “assertive” options to select the forwarding nodes based on the two aforementioned factors, so the delivery ratio has been significantly improved.Average Latency. As shown in Figure 3(c), the average latency is reduced with the increase of the nodes, indicating that our data distribution algorithms are assertive to select the forwarding nodes which are more likely to contact with the destination node. The data transfer of LOPDAD occurs at the location that can connect with AP points, not at any other encounter places, so the average delay is longer than that of ACODAD and LOPSI. The forwarding nodes selection mechanism of LOPSI is better than that of ACODAD, which has less transmission operation but high delivery ratio, so the average latency is lower than that of ACODAD.Transmission Cost. Figure 3(d) shows the transmission cost of our proposed algorithm and some existing algorithms. LOPSI has the lowest transmission cost since it only transfers messages to the nodes with the highest forwarding probability to the destination and the quantity of copies of the message is a constant which equals the hops estimated by the location prediction algorithm. With the increase of number of nodes, the opportunity of forwarding messages to the potential nodes increases, which leads to increase of the delivery ratio, and also the average hops decrease (as shown in Figure 3(a)). PRoPHET has the highest transmission cost since it has no consideration in the cache management. The transmission cost is at the value of more than 1100, much more than the transmission cost of the other four algorithms. Thus the curve of transmission cost of PRoPHET cannot be drawn in the scale of the graph. The transmission costs of the other three algorithms are lower than that of PRoPHET since they constrained the quantity of copies, but not better than LOPSI because the selection schemes of potential forwarding nodes are no better than that of LOPSI.


### 4.4. Influence on Performance with the Variation of TTL

In this scenario, in order to illustrate the influence on performance by the variation of TTL, the simulation parameter of the number of nodes is set to be 200.Average Hops. As shown in Figure 4(a), with the increase of TTL, the data messages live long in the network, which will increase the load of cache and the network. However, LOPDAD and LOPSI have little change in the average hops since the most data messages are successfully delivered to the destination in the time threshold according to the accuracy of O2MM being 80%. During the TTL, if the data dissemination is failure in the first time threshold period, then start the second time threshold to deliver the data message; the average hops may be doubled; however, the probability of that condition is less than 20%. The average hops of ACODAD are more than LOPDAD and LOPIS, as it has no consideration of location where the destination node will be, only by random encounter of two nodes. With the increase of the network load, the average hops will increase.(a) Average hops variations with the increase of TTL. (b) Delivery ratio variations with the increase of TTL. (c) Average latency variations with the increase of TTL. (d) Transmission cost variations with the increase of TTL.
(a)
(b)
(c)
(d)Delivery Ratio. As shown in Figure 4(b), with the increase of TTL, the delivery ratio of LOPDAD changes little. According to the characteristic of Markov chain prediction, the future status of long-time prediction tends to be stabilized, which means that the prediction accuracy is reduced. If the time threshold is set too big, then delivery ratio will decrease. The delivery ratio of ACODAD and LOPIS increase since the copy of data message in the network is not changed but the opportunistic of encounter is increased.Average Latency. As shown in Figure 4(c), with the increase of TTL, the average latency of those five algorithms will increase since the network load is heavy and the total number of data messages increases, which makes the buffer overcrowded. Since the algorithms except PRoPHET constrain the copies of messages to avoid the traffic loads, the latency is lower than that of PRoPHET which transfers the message to any potential nodes without copies constraint.Transmission Cost. As shown in Figure 4(d), with the increase of TTL, the transmission cost of LOPSI and LOPDAD decreases since the delivery ratio is higher (as shown in Figure 4(b)) and the number of copies of a unique message is slightly changed. It results in that LOPSI and LOPDAD estimate the optimal path and then determine the number of copies of a unique message. Spray and Wait and ACODAD constrain the number of copies, so the variation of transmission cost is slight. As regards PRoPHET, since it does not constrain the copies of a unique message, the transmission cost is much higher than the transmission cost of the other four algorithms and at a more than thousand value. Thus the curve of transmission cost of PRoPHET cannot be drawn in the scale of the graph.


## 4.1. Simulation Settings

The data sets to evaluate the location prediction algorithm based on O2MM are obtained from wireless topology discovery (WTD) [35], which are employed in our simulation. The accuracy of the location prediction algorithms based on O1MM and O2MM can be obtained from our previous work [36], which is given in Table 2.Table 2
The accuracy of location prediction algorithms based on O1MM and O2MM.
O1MM
O2MM
Prediction accuracy
0.5610
0.8030
Time complexity
O
(
N
)
O
(
N
2
)
Storage space
O
(
N
2
)
O
(
N
3
)The simulation is based on a realistic campus scenario shown in Figure2. There are 40 locations and each one installed a WiFi access point, which can cover the campus area. The mobile nodes can be cars and pedestrians with smart phones. The location prediction server can communicate with mobile nodes via WiFi and only provide location prediction service and no other services. The only way to exchange and obtain data is through the contact of two nodes. If the communication range increases and is out of the range of APs, the mobile devices can exchange data by the ACODAD without using location prediction scheme by different wireless communication techniques including WiFi Direct, Bluetooth, and ZigBee. In order to evaluate the performance of the proposed data dissemination algorithms, we conduct a series of experiments under the parameters in Table 3. The First In First Out is applied on buffer management. In order to avoid the heavy traffic load and cache load, each data is set a TTL, and the maximum copies of each data is a fixed constant in the system.Table 3
Simulation parameters.
Parameter
Value
Scene features
Simulation time
12 h
Field area
4500 m * 3400 m
Scene
NEU Campus
APs
40
Node features
Mobility model
SPMBM
Movement speed for cars
2.7–13.9 m/s
Movement speed for pedestrians
0.5–1.5 m/s
Transmission rate
250 KB/s
Maximum transmission range
10 m
Transmission mode
Broadcast
Cache size
10 MB/1 G
Message features
Packet size
500 KB–1 MB at random
Frequency of creating packets
From 25 s to 35 s at random
Number of copies
8
TTL
5 hoursFigure 2
The simulation based on a realistic campus scenario.With the above settings, the three data dissemination algorithms proposed in our work LOPDAD, ACODAD, and LOPSI are evaluated and compared with well-known opportunistic routing protocols: PRoPHET and Spray and Wait.


## 4.2. Evaluation Metrics

Four metrics are used to evaluate the performance requirements of the aforementioned data dissemination algorithms: average hops, delivery ratio, average latency, and transmission cost.Average Hop
H. This hop-count metric is to assess the delivery cost in time and in cache. N denotes the total number of forwarding nodes of every transmission of data including both successful and failure delivery. Y is the total number of created unique data messages. H is given by
(22)
H
=
N
Y
.Delivery Ratio
R. This metric is to evaluate the effectiveness and utility of the algorithm. S is the total number of successfully delivered unique data messages. R is given by
(23)
R
=
S
Y
.Average Latency
L [35]. The average latency of a unique message is calculated by the following equation:
(24)
L
=
1
Y
∑
i
=
1
Y
(
T
d
i
-
T
s
i
)
,
where T
s
i is the moment that a unique data message i is originated, and T
d
i is the time when the first replicate of unique message i arrives at the destination. The replicate is a copy of a unique message. The number of replicates depends on the methodology of the routing algorithm, single or multiple copies [35].Transmission Cost
C. It is a key metric to characterize the resource consumption and evaluate the data dissemination algorithms in OCNs. The total number of copies of unique data messages to deliver in the system, denoted by Q, is divided by the number of copies of successfully delivered messages, denoted by P:
(25)
C
=
Q
P
.


## 4.3. Influence on Performance with the Variation of Total Number of Nodes

Average Hops. As shown in Figure 3(a), with the increasing of numbers of nodes, due to the hop limitation of Spray and Wait, the average hops are relatively small; PRoPHET has no restrictions in this respect; the frequency of nodes encountering increases, resulting in an increase in the average hops. Our algorithms are proposed to consider the management of cache space and limit the maximum number of copies of the nodes in the network, which constrains the hops of data messages transmission. LOPDAD and LOPSI especially set a time threshold on executing location prediction, which guaranteed the data message delivery to the destination node within the time threshold. The location state is discrete by the time slices, so threshold of time slices corresponds to the number of hops. Therefore, the average hops of our algorithms are relatively small.(a) Average hops variation with the increase of the number of nodes. (b) Delivery ratio variations with the increase of the number of nodes. (c) Average latency variations with the increase of the number of nodes. (d) Transmission cost variations with the increase of the number of nodes.
(a)
(b)
(c)
(d)Delivery Ratio. As shown in Figure 3(b), whether for Spray and Wait, PRoPHET, and our data distribution algorithms, the delivery ratio significantly increases with the increase of the nodes. LOPDAD, ACODAD, LOPSI, and Spray and Wait have constrained the number of copies of the data messages transmitted in the network. Even if the number of nodes and the amount of data messages increases, the storage space and the network overhead maintain a good status, avoiding data transmission failure by the heavy load of cache and network resources depletion. Therefore, delivery ratio is better than the PRoPHET transmission. LOPDAD selects forwarding nodes which are most likely to complete the task based on location prediction. ACODAD selects the best forwarding nodes by high intimacy. LOPSI tends to make more “assertive” options to select the forwarding nodes based on the two aforementioned factors, so the delivery ratio has been significantly improved.Average Latency. As shown in Figure 3(c), the average latency is reduced with the increase of the nodes, indicating that our data distribution algorithms are assertive to select the forwarding nodes which are more likely to contact with the destination node. The data transfer of LOPDAD occurs at the location that can connect with AP points, not at any other encounter places, so the average delay is longer than that of ACODAD and LOPSI. The forwarding nodes selection mechanism of LOPSI is better than that of ACODAD, which has less transmission operation but high delivery ratio, so the average latency is lower than that of ACODAD.Transmission Cost. Figure 3(d) shows the transmission cost of our proposed algorithm and some existing algorithms. LOPSI has the lowest transmission cost since it only transfers messages to the nodes with the highest forwarding probability to the destination and the quantity of copies of the message is a constant which equals the hops estimated by the location prediction algorithm. With the increase of number of nodes, the opportunity of forwarding messages to the potential nodes increases, which leads to increase of the delivery ratio, and also the average hops decrease (as shown in Figure 3(a)). PRoPHET has the highest transmission cost since it has no consideration in the cache management. The transmission cost is at the value of more than 1100, much more than the transmission cost of the other four algorithms. Thus the curve of transmission cost of PRoPHET cannot be drawn in the scale of the graph. The transmission costs of the other three algorithms are lower than that of PRoPHET since they constrained the quantity of copies, but not better than LOPSI because the selection schemes of potential forwarding nodes are no better than that of LOPSI.


## 4.4. Influence on Performance with the Variation of TTL

In this scenario, in order to illustrate the influence on performance by the variation of TTL, the simulation parameter of the number of nodes is set to be 200.Average Hops. As shown in Figure 4(a), with the increase of TTL, the data messages live long in the network, which will increase the load of cache and the network. However, LOPDAD and LOPSI have little change in the average hops since the most data messages are successfully delivered to the destination in the time threshold according to the accuracy of O2MM being 80%. During the TTL, if the data dissemination is failure in the first time threshold period, then start the second time threshold to deliver the data message; the average hops may be doubled; however, the probability of that condition is less than 20%. The average hops of ACODAD are more than LOPDAD and LOPIS, as it has no consideration of location where the destination node will be, only by random encounter of two nodes. With the increase of the network load, the average hops will increase.(a) Average hops variations with the increase of TTL. (b) Delivery ratio variations with the increase of TTL. (c) Average latency variations with the increase of TTL. (d) Transmission cost variations with the increase of TTL.
(a)
(b)
(c)
(d)Delivery Ratio. As shown in Figure 4(b), with the increase of TTL, the delivery ratio of LOPDAD changes little. According to the characteristic of Markov chain prediction, the future status of long-time prediction tends to be stabilized, which means that the prediction accuracy is reduced. If the time threshold is set too big, then delivery ratio will decrease. The delivery ratio of ACODAD and LOPIS increase since the copy of data message in the network is not changed but the opportunistic of encounter is increased.Average Latency. As shown in Figure 4(c), with the increase of TTL, the average latency of those five algorithms will increase since the network load is heavy and the total number of data messages increases, which makes the buffer overcrowded. Since the algorithms except PRoPHET constrain the copies of messages to avoid the traffic loads, the latency is lower than that of PRoPHET which transfers the message to any potential nodes without copies constraint.Transmission Cost. As shown in Figure 4(d), with the increase of TTL, the transmission cost of LOPSI and LOPDAD decreases since the delivery ratio is higher (as shown in Figure 4(b)) and the number of copies of a unique message is slightly changed. It results in that LOPSI and LOPDAD estimate the optimal path and then determine the number of copies of a unique message. Spray and Wait and ACODAD constrain the number of copies, so the variation of transmission cost is slight. As regards PRoPHET, since it does not constrain the copies of a unique message, the transmission cost is much higher than the transmission cost of the other four algorithms and at a more than thousand value. Thus the curve of transmission cost of PRoPHET cannot be drawn in the scale of the graph.


## 5. Conclusion and Future Work

In this paper we consider the efficient data dissemination mechanism in opportunistic cognitive networks. We propose a swarm intelligence heuristic data dissemination algorithm based on location prediction. The algorithm can select the efficient forwarding nodes with the maximum probability to encounter the destination node at the location where they most likely to encounter and a high value of intimacy with the destination node. Moreover the algorithm considers the cache management and has good performances in the transmission cost and delivery ratio and simultaneously decreases the average hops and delivery delay. The algorithm has good scalability, which can consider credibility, incentives, energy control, and buffer management mechanism in the future work. Furthermore, the swarm intelligence scheme can also be used in group construction of the mobile nodes, which can promote the application performance in opportunistic cognitive networks.



---

*Source: 453564-2014-09-25.xml*