Zichao Yang
email: zcyang@cse.cuhk.edu.hk

John C S Lui

Security Adoption in Heterogeneous Networks: the Influence of Cyber-insurance Market

Keywords: heterogeneous network, security adoption, cyber-insurance, Bayesian network game

Hosts (or nodes) in the Internet often face epidemic risks such as virus and worms attack. Despite the awareness of these risks and the availability of anti-virus software, investment in security protection is still scare, and hence epidemic risk is still prevalent. Deciding whether to invest in security protection is an interdependent process: security investment decision made by one node can affect the security risk of others, and therefore affect their decisions also. The first contribution of this paper is to provide a fundamental understanding on how "network externality" effect with "nodes heterogeneity" may affect security adoption. We characterize it as a Bayesian network game in which nodes only have the local information, e.g., the number of neighbors, as well as minimum common information, e.g., degree distribution of the network. Our second contribution is in analyzing a new form of risk management called cyber-insurance. We investigate how the presence of competitive insurance market can affect the security adoption.

Introduction

Network security is a major problem in communication networks. One of its most common manifestations is in form of virus, worms and bonnet spreading, which we call the epidemic risk. Epidemic risk is highly damaging, e.g., the Code Red worm [START_REF] Moore | Code-red: a case study on the spread and victims of an internet worm[END_REF] has infected thousands of computers and induced huge financial loss. To counter this risk, there have been great efforts in both the research and industrial fronts to come up with techniques and tools (i.e., anti-virus software, intrusion detection systems, firewalls etc) to detect virus/worms. Despite the sophistication of these tools, only a small percentage of hosts adopt some form of security protection, making epidemic risk still prevalent.

A node's decision on adopting some security measures is not a simple individual and independent process, but rather, depends on the decisions of many other nodes in the network. Nodes which decide not to invest in security protection, also put other nodes at security risk. This network externality effect caused by the spreading of epidemic influences the degree of adoption of security measure. Our first contribution in this paper is to provide a theoretical understanding on how network externality effect with node heterogeneity may influence security adoption in a network of interconnected nodes (i.e., the Internet).

Modeling such decision and security problem requires the combination of epidemic theory and game theory. While extensive studies in traditional literatures have been dedicated to epidemic theory [START_REF] Newman | Networks: an introduction[END_REF], few works have addressed the problems of strategic behavior of security investment. In a realistic situation, nodes which make decision in security investment usually do not have complete information like the network topology or knowledge of other nodes. In this paper, we model the security investment as a Bayesian network game where nodes only have the local information of their degree, as well as the minimum common information of network's degree distribution. In contrast to graphical game [START_REF] Nisan | Algorithmic game theory[END_REF], in which complete topology is given and analysis is complicated, we show that using Bayesian network game, one can elegantly tradeoff using partial topology information while making the analysis tractable. We show how heterogeneous nodes, characterized by their degree, can estimate their epidemic risk and make decisions on security investment with incomplete information. We show that nodes with higher degree are more likely to be infected by epidemic, making the secure measure less effective for them in terms of the reduction in infection probability. Moreover, nodes with higher degrees are more sensitive to externality effect.

While protection measures may limit the spread of virus/worms, another way to manage the epidemic risk is to transfer the risk to a third-party, which is called cyber-insurance [START_REF] Kesan | Cyberinsurance as a market-based solution to the problem of cybersecurity: a case study[END_REF]: nodes pay certain premium to insurance companies in return for compensation in the virus outbreaks. One main challenge in cyber-insurance is moral hazard [START_REF] Hillier | The economics of asymmetric information[END_REF][START_REF] Kesan | Cyberinsurance as a market-based solution to the problem of cybersecurity: a case study[END_REF]. The combination of self-protection and insurance raises the problem of moral hazard, in which nodes covered by insurance may take fewer secure measures. Moral hazard happens when the insurance provider cannot observe the protection level of nodes. In this paper, we investigate the effect of cyber-insurance on security adoption under competitive insurance market without moral hazard 1 . Our second contribution is to show the conditions under which cyber-insurance is an incentive for security adoption. We find that cyber-insurance is an incentive for security adoption if the initial secure condition is poor and the quality of secure measure is not very high. This is the outline of our paper. In Section 2, we present the epidemic and security investment models. In Section 3, we show how heterogeneous nodes can determine their infection probability and decide on proper security investment. In Section 4, we investigate the effect of insurance market without moral hazard on security adoption. Validations and performance evaluations are presented in Section 5. Section 6 gives related work and Section 7 concludes.

Mathematical Models

Our models include: (a) epidemic model: to characterize the spread of virus or malware in a network, (b) investment model: to characterize node's decision in 1 We refer the readers to [START_REF] Yang | Security adoption in heterogeneous networks: the influence of cyber-insurance market[END_REF] for the analysis of the case with moral hazard.

security investment, and (c) Bayesian network game: how nodes make decision under the incomplete information setting. Epidemic Model: The interaction relation of N nodes is denoted by the undirected graph G = (V, E) with the vertex set V , |V | = N and the edge set E. For i, j ∈ V , if (i, j) ∈ E, then nodes i and j are neighbors and we use i ∼ j to denote this relationship. Let S = {healthy, infected} represent the set of states each node can be in. If node i is infected (healthy), then S i = 1 (S i = 0). Each infected node can contaminate its neighbors independently with probability q. Note that this is similar to the bond percolation process [START_REF] Newman | Networks: an introduction[END_REF] in which every edge is occupied with probability q. Each node has an initial state of being infected or not. This can represent whether the node has been attacked by the adversary. Let us denote it by s i where s i = 1 if node i is initially infected and s i = 0 otherwise. Hence, at the steady state, a node is infected either because it is initially attacked, or it contracts virus from its infected neighboring nodes. The final state of node i can be expressed in the following recursive equation:

1 -S i = (1 -s i ) ∀j:j∼i (1 -θ ji S j ) ∀i ∈ V, (1)
where θ ji is a random variable indicating whether the edge (i, j) is occupied or not. Since the infection will incur some financial loss, a node needs to decide whether to invest in self-protection to reduce the potential financial loss. In the following, we present a model which a node can use to make the decision.

Investment Model: Let's say that node i has an initial wealth w i ∈ R + . A node's utility u i (w) is a function of wealth w ∈ R + . We consider nodes are risk averse, i.e., the utility function is strictly increasing and concave in w, i.e., u i (w) > 0 and u i (w) < 0. In this paper, we consider the constant relative risk averse utility function commonly used in the literature [START_REF] Böhme | Modeling cyber-insurance: Towards a unifying framework[END_REF]: u(w) = w 1-σ /(1-σ), for 0 < σ < 1, where σ is a parameter for the degree of risk aversion. The utility function of node i is given by the above utility function with parameter σ i . If node i is infected, then it will incur a financial loss of l i ∈ R + .

To reduce the potential financial loss, a node can consider adopting some self-protection measures or purchasing insurance. In the first part of this paper, we consider the case of self-protection. In the second part of this paper, we consider both cases and study the influence of insurance market on security protection. A node's investment in self-protection can reduce the probability of being infected initially. For the amount of investment x, the probability of being infected initially is denoted as p(x), which is a continuous differentiable decreasing function of x. In particular, we assumed the effort of security investment is separable with the wealth, which is common in the literature [START_REF] Shetty | Competitive cyberinsurance and internet security[END_REF]. The utility of node i with investment x i in security protection is

p i u i (w i -l i ) + (1 -p i )u i (w i ) -x i , (2)
where p i is the final probability that node i will be infected. p i contains two parts: the probability of being infected initially, given by p(x i ) and the probability of getting infected from neighbor nodes. For simplicity of analysis, we assume that the choice of node i regarding security self-protection is a binary decision: either the node invests unit amount with a cost of c i , or it does not invest at all. The cost may also include the inconvenience caused by the measure. We use the action set A = {S, N } to denote the behavior, where S denotes taking secure measure and N otherwise. If it decides to invest, the node can still be infected with probability p -. Otherwise, it will be infected with probability p + . Obviously we have 0 < p -< p + < 1. Let a = (a 1 , ..., a i , ..., a N )= (a i , a -i ) be an action profile. Given the action profile a -i of other nodes, node i makes the decision by maximizing its expected utility. If node i takes action N , the expected utility is:

p i (N , a -i )u i (w i -l i ) + (1 -p i (N , a -i ))u i (w i )
, where p i (N , a -i ) is the final probability of node i being infected when it initially did not adopt security protection. On the other hand, the expected utility of a node without security protection (or action S) is:

p i (S, a -i )u i (w i -l i ) + (1 -p i (S, a -i ))u i (w i ) -c i
where p i (S, a -i ) is the final probability of a node being infected when it initially subscribed to some self-protection measures with cost c i . Node i will choose to invest in security protection if and only if

c i < (p i (N , a -i ) -p i (S, a -i ))(u i (w i ) -u i (w i -l i )). ( 3
)
Bayesian Network Game: According to Inequality (3), each node needs to have the complete information of the network topology G so as to make the proper decision. However, it is almost impossible in practice for each node to have the complete information of G. Instead, each node can only have some local information, i.e., a node may only know its neighbors, and some cases, only knows the number of neighbors it is to interact with. Secondly, it is impossible to know the exact loss of other nodes in a large network.

In here, we assume that nodes only have the minimum common information, that is, the knowledge of the degree distribution of G, as well as the distribution of financial loss of nodes caused by virus. In this paper, we consider the asymptotic case that N , the number of nodes, tends to infinity and the degree distribution converges to the fixed probability distribution {p k } K K , where K is the maximum degree and K is the minimum degree. For nodes with degree k, the loss distribution is given by the CDF F k (l). We assume that the cost of secure measure is the same for all nodes which have the same degree, and we denoted this as c k . Furthermore, these nodes have the same utility function u k and the same initial wealth w k . Nodes make decision on security investment based on the information of degree and loss.

Analysis for Strategic Security Adoption

Determining the final infection probability is a difficult problem because of the complex network structure. In this work, we assume that a node only knows the degree distribution and consider the network topology as a random graph [START_REF] Newman | Networks: an introduction[END_REF] with a given degree distribution {p k } K K . Although real networks are not random graphs [START_REF] Newman | Networks: an introduction[END_REF] and they have some characteristics, e.g., high clustering coefficient, community structure etc, that are not possessed by random graph, recent study [START_REF] Melnik | The unreasonable effectiveness of tree-based theory for networks with clustering[END_REF] has shown that random graph approximation is very often accurate for real networks. Thus, it is reasonable to assume that the network topology is a random graph, especially here we consider incomplete information. Estimating the Probability: A node can calculate its final infection probability by constructing a local mean field tree [START_REF] Aldous | Survey of max-type recursive distributional equations[END_REF]. Fig. 1 illustrates the local tree structure of node i which has degree k. For the ease of presentation, let's say that none of these nodes will take secure measure, i.e., the initial infection probability is p + for all nodes in this subsection. We will show how to relax this later on. [START_REF] Aldous | Survey of max-type recursive distributional equations[END_REF], for any node i, the local topology of a large random graph G can be modeled as a tree rooted at node i with high probability. In other words, we transform G to a tree rooted at node i. Node i can be independently influenced by each subtree rooted at v c . For every subtree rooted at v c , it consists of its subtrees. Using this recursive structure, one can derive the total infection probability that other nodes in G can impose on node i.

Let us illustrate the derivation. First, we divide nodes into levels. The root node i is at the zero level. The neighbors of node i is at the first level and so on. Let Y j be the final state of node j, j = i, conditioned on its parent in the tree structure is not infected, and y j be the initial state of node j. For the root node i, we use S i to denote its final state and s i to denote its initial state, then

1 -S i = (1 -s i ) ∀j:j∼i (1 -θ ji Y j ). ( 4
)
The above equation indicates the root node i is either initially infected, or it can be infected by its neighbors. The state of its neighbors conditioned on that the root node i is not infected is also determined by the state of the children of the neighbors in the tree structure, or one can express it recursively as:

1 -Y j = (1 -y j ) ∀l:l→j (1 -θ lj Y l ) ∀j = i, (5)
where l → j denotes that l is a child of j in the tree structure. To solve Eq. ( 5), we need to know the degree distribution of a child node. This degree distribution can be expressed as: pk =

kp k K k=K kp k = kp k d
, where d is the average degree of nodes in G. The number of edges of a child excluding the edge connecting to its parents is called the excess degree [START_REF] Newman | Networks: an introduction[END_REF]. Let K = max{0, K-1} and K = max{0, K-1}. The excess degree distribution is

q k = pk+1 = (k + 1)p k+1 / d, ∀k ∈ [K , K ].
As in [START_REF] Aldous | Survey of max-type recursive distributional equations[END_REF], if nodes are at the same level of the tree structure, their states are independent of each other. Let ρ n , n ≥ 1 be the probability that a node at the n th level is infected conditioned on its parent is not infected. By Eq. ( 5),

1 -ρ n = (1 -p + ) K k=K q k (1 -qρ n+1 ) k .
ρ 1 is the average probability that a child node of the root node i will be infected conditioned on the root node is not infected. When we scale up the network (or let n → ∞), define ρ lim n→∞ ρ 1 , then ρ is determined by the solution of the fixed point equation

1 -ρ = (1 -p + ) K k=K q k (1 -qρ) k .
By Eq. ( 4), for a node with degree k, the infection probability is

φ k = 1 -(1 -p + )(1 -qρ) k . (6)
Security Adoption: In the previous subsection, we show how a node can compute the infection probability with incomplete information. The calculation is based on the assumption that none of the nodes take secure adoption, so that the initially infection probability is p + . In here, we show how to use this infection probability for strategy selection. Let λ k be the fraction of nodes with degree k which take action S. Then by applying the method shown above, we have Proposition 1. If λ k fraction of the nodes with degree k take secure measure, ρ is given by the unique solution of the fixed point equation in [0, 1]:

ρ = 1 - K k=K q k (1 -p + + λ k+1 (p + -p -))(1 -qρ) k . (7)
For a node with degree k, if it decides to take secure measure, then by Eq. ( 6), the infection probability is

φ k (S, λ K , ..., λ K ) = 1 -(1 -p -)(1 -qρ) k . If it does not invest in protection measure, the probability for this node to get infected is φ k (N , λ K , ..., λ K ) = 1 -(1 -p + )(1 -qρ) k .
The infection probability reduction for a node with degree k by taking secure measure is

φ k (N ) -φ k (S) = (p + -p -)(1 -qρ) k . ( 8
)
Note that infection probability reduction decreases as degree increases. This implies that higher degree nodes have less incentive to invest in protection measure.

Corollary 1. ρ, given by the solution of fixed point Eq. ( 7), has a unique solution in [0, 1], and ρ(λ K , ..., λ K ) is a decreasing function of λ k , ∀k ∈ K, K .

Sensitivity Analysis: Nodes with different degrees have different sensitivity to the externality effect. Define

φ k = φ k (N ) -φ k (S) = (p + -p -)(1 -qρ) k .
Assume ρ decreases by a small amount ∆ρ, then ∆ φ k = (p +p -)(1qρ) k-1 kq∆ρ, and the relative change is given by ∆ φ k φ k = kq∆ρ (1-qρ) , indicating that sensitivity to the network externality effect is proportional to the degree.

A node with degree k will invest if and only if the utility with secure measure is higher than that without secure measure, or

c k < (p + -p -)(1 -qρ) k (u k (w k ) -u k (w k -l)).
Note that the loss distribution of nodes with degree k is F k (l). Since the infection probability varies with the fraction of security adopters, we consider the self-fulfilling expectations equilibrium [START_REF] Easley | Networks, crowds, and markets: Reasoning about a highly connected world[END_REF] in analyzing the final adoption extent. Nodes form a shared expectation that the fraction of the nodes has adopted security measure and if each of them makes decision based on this expectation, then the final fraction is indeed the initial expectation. Let l * k be the minimum value that satisfies the above inequality in the equilibrium, then λ * k , the fraction of node of degree k taking the secure measure, is given by the equation

λ * k = 1 -F k (l * k ).
Summarizing the previous analysis, we have the following proposition.

Proposition 2. Nodes with degree k will take the secure measure if their loss is greater than l * k . The final fraction of nodes with degree k that invest in selfprotection is λ * k . l * k and λ * k are solutions of the following fixed point equations:

λ * k = 1 -F k (l * k ), (9)
c k = (p + -p -)(1 -qρ * ) k (u k (w k ) -u k (w k -l * k )), ( 10
)
where ρ * is given by the solution of the following equation

ρ * = 1 - K k=K q k (1 -p + + λ * k+1 (p + -p -))(1 -qρ * ) k . ( 11
)
Corollary 2. Fixed point equations ( 9)-( 11) has at least one solution.

Corollary 3. The equilibrium points given by fixed point equations ( 9)-( 11) are monotone, i.e., if

Λ * 1 = (λ * 1 K , ..., λ * 1 k , ..., λ * 1 K ) and Λ * 2 = (λ * 2 K , ..., λ * 2 k , ..., λ * 2 K ) are two equilibrium points, then we have either Λ * 1 ≥ Λ * 2 or Λ * 1 ≤ Λ * 2 and there exists at least one k ∈ [K, K] such that λ * 1 k = λ * 2 k .

Analysis for Cyber-insurance Market

Supply of Insurance: Let's say the insurance provider offers insurance at the price of π < 1. Nodes which buy insurance at the premium of πX from the insurance provider will be compensated X for the loss incurred if they are infected. Given the price π, node will choose to buy the amount of insurance that maximizes its utility. Define φ k (S)(φ k (N )) as the probability that a node with degree k is infected if it subscribes (does not subscribe) to a secure measure.

In this paper, we consider cyber-insurance without adverse selection, in which the insurance provider can observe the degree of a node, hence the risk type of a node (high degree indicates high risk level). Thus, in the following, we drop the subscript k where the meaning is clear for general presentation. A node will choose the amount of insurance that maximizes

U (π, X)= φu(w-l + (1 -π)X)+(1 -φ)u(w-πX) -x, ( 12
)
where x is the cost of security protection. When a node chooses N (or S), φ becomes φ(N )(or φ(S)), x = 0(or c). Assume the insurance provider is risk neutral, so they only care about the expected wealth. If a node buys X amount of insurance, then the profit of the insurance is (πφ)X. In here, we consider a competitive market so the insurance provider has to offer the insurance at the price π = φ, or the actuarially fair price [START_REF] Ehrlich | Market insurance, self-insurance, and self-protection[END_REF].

Lemma 1. When the insurance is offered at the actuarially fair price, the optimal insurance coverage is a full insurance coverage, i.e., a node will buy insurance amount equal to the loss l. The maximal expected utility is u(wφl)x.

Remark: Lemma 1 shows that the expected utility with insurance market is

u(w -φl) -x > φu(w -l) + (1 -φ)u(w) -x.
The utility of a node is improved by the insurance market with the fair price.

One problem with the combination of insurance and self-protection is moral hazard, which happens when the insurance provider cannot observe the protection level of a node. Insurance coverage may discourage the node to take self-protection measure to prevent the losses from happening. In here, we examine the effect of the insurance market on the self-protection level. In this paper, we consider the case without moral hazard, where the insurance provider can observe the protection level of a node. We refer the reader to [START_REF] Yang | Security adoption in heterogeneous networks: the influence of cyber-insurance market[END_REF] for the analysis of the case with moral hazard, where insurance provider does not have any information about the protection level of a node. Without the moral hazard, the insurance provider can discriminate against the nodes with protection measure and those without protection measure. We investigate whether the insurance market will help to incentivize nodes to take secure measure. Security Adoption with Cyber-insurance Market: Because the insurance provider can observe the protection level of a node, the insurance provider will offer insurance price of φ(S) (or φ(N )) for those nodes with (or without) security protection. According to Lemma 1, nodes will buy the full insurance regardless of its protection level. As a result, the expected utility for nodes without protection is u(wφ(N )l) and the expected utility for nodes with protection is u(wφ(S)l)c. Thus, with insurance market, a node will invest in security protection if and only if c < g(l, ρ) u(wφ(S)l)u(wφ(N )l).

Here g(l, ρ) is a function of ρ because φ(S) and φ(N ) can be expressed in ρ.

Lemma 2. g(l, ρ) u(w -φ(S)l) -u(w -φ(N )l) = u(w -(1 -(1 -p -)(1 - qρ) k )l) -u(w -(1 -(1 -p + )(1 -qρ) k )l) increases with l, decreases with ρ.
Lemma 2 indicates that nodes with higher loss are more likely to invest in security. It also shows that positive network externality still exists even in the presence of insurance market. Incentive Analysis: According to previous analysis, a node will take secure measure if c < c NI (φ(N )φ(S))(u(w)u(wl)), where c NI is the threshold without insurance market. With insurance market, nodes will take secure measure if and only if c < c I u(wφ(S)l)u(wφ(N )l), where c I denotes the threshold with insurance market. In order for insurance market to be a good incentive for self-protection, we should have c NI < c I , i.e.,

c I -c NI =u(w -φ(S)l) + φ(S)(u(w) -u(w -l)) -[u(w -φ(N )l) + φ(N )(u(w) -u(w -l))] > 0.
Define r(p) u(wpl) + p(u(w)u(wl)), then the above condition becomes r(φ(S)) > r(φ(N )). Next we investigate under what condition the above inequality will hold. Consider the function r(p), we have the following lemma. Lemma 3. r(p) is a concave function of p and has a unique maximum at p * . Proposition 3. If the infection probability without secure measure φ(N ) is greater than p * and the quality of self-protection is not too high, i.e., φ(N )φ(S) is bounded, insurance will be a good incentive for self-protection.

Remark: If φ(N ) is smaller than p * , cyber-insurance is not a positive incentive for security. If φ(N ) is greater than the p * and φ(S) is within the region [φ * , φ(N )], where φ * be the minimum value such that r(φ * ) = r(φ(N )), then cyber-insurance is a positive incentive. From the analysis, we can see that insurance will be more likely to be a positive incentive with large φ(N ) and small φ(N )φ(S). Hence, if the initial secure situation is bad and the protection quality of secure measure is not too high, then insurance market is a positive incentive for self-protection; otherwise, insurance market is a negative incentive.

Simulation and Numerical Results

Validating Final Infection Probability: We consider a large graph with power-law degree distribution [START_REF] Faloutsos | On power-law relationships of the internet topology[END_REF]. We want to verify the accuracy of using the mean field on these power law graphs. We use the popular Generalized Linear Preference (GLP) method to generate power law graphs [START_REF] Bu | On distinguishing between internet power law topology generators[END_REF]. Parameters were selected so that the power law exponent γ = -3. We generate graphs with 10, 000 nodes and approximately 30, 000 edges. The minimum degree is 3 and the maximum degree is approximately 200. The result is shown in Fig. 2. Initially, every node is infected with the same probability p and every edge is occupied with probability q. We calculate the probability that nodes with certain degree is infected. Fig. 2 shows the simulation verifies the theoretical results. Security Adoption: In here we investigate how parameters can influence the fraction of adopters with different degrees. We consider a graph G with power law distribution with γ = -3, minimum and maximum degree are 3 and 13. Here maximum degree is set small for the convenience of selecting other parameters without affecting the result in general case. With very large maximum degree, even a small q will make the final infection probability in Eq. ( 6) very big because of the power relationship. We set σ = 0.5 for all nodes. The initial wealth of nodes with degree k is w k = 10 * k + 50. The loss follows uniform distribution from 0 to half of the initial wealth. The cost of secure measure of all nodes is c = 0.3. Initially, all nodes without (with) secure measure are infected initially with probability p + = 0.3 (p -= 0.2). Having fixed the above parameters, we choose to change q to calculate the fraction of adopters with different degrees because nodes with different degrees are mainly differentiated via the term (1qρ) k .

We show the initial fraction and final fraction of adopters in Fig. 3. Here the initial fraction means that every node assumes that other nodes will not adoption secure measure and makes its decision on this assumption. Final fraction means the fraction given by the minimum equilibrium point in Proposition 2. Due to the positive externality effect, final fraction is greater than initial fraction. We plot them to examine the externality effect. In Fig. 3a and Fig. 3b, we set q to be 0.05 and 0.10 respectively. In Fig. 3a, the adoption fraction increases with degree, in Fig. 3b, the adoption fraction initially increases, then decreases with degree. Comparing the two figures, we see that there is no general rule regarding the fraction of adopters as a function of the degree. It greatly depends on the parameters. However, in both figures the gap between the final fraction and the initial fraction increases with degree, which agrees with our previous result that higher degree nodes are more sensitive to the externality effect.

Related Work

Recently there has been growing research in the economic of information security [START_REF] Anderson | Why information security is hard-an economic perspective[END_REF][START_REF] Anderson | The economics of information security[END_REF]. Some models consider the security investment game without incor-porating the effect of network topology, i.e., [START_REF] Grossklags | Secure or insecure? a game-theoretic analysis of information security games[END_REF][START_REF] Heal | The vaccination game[END_REF][START_REF] Kunreuther | Interdependent security[END_REF]. Others assume that the graph topology is given [START_REF] Jiang | Efficiency of selfish investments in network security[END_REF][START_REF] Miura-Ko | Security investment games of interdependent organizations[END_REF][START_REF] Omic | Protecting against network infections: A game theoretic perspective[END_REF]. [START_REF] Lelarge | A local mean field analysis of security investments in networks[END_REF][START_REF] Lelarge | Network externalities and the deployment of security features and protocols in the internet[END_REF] are closely related to our work. The network topology is modeled as a Poisson random graph while real networks are with power law distribution. Also, they fail to consider the interaction among those nodes. In contrast, we consider the interaction of nodes by studying a Bayesian network game. Our modeling result provides significant insight on the influence of node heterogeneity on the adoption extent, sensitivity to network externality and cyber-insurance as an incentive. [START_REF] Yang | Investigating the effect of node heterogeneity and network externality on security adoption[END_REF] is our previous extended abstract in considering network heterogeneity, which is defined by setting degree thresholds to divide the nodes into classes. Insurance was studied in the economic literature long time ago [START_REF] Ehrlich | Market insurance, self-insurance, and self-protection[END_REF] [START_REF] Shavell | On moral hazard and insurance[END_REF]. But these literatures lack to consider many characteristics specific to computer network, such as the interdependence of security, heterogeneity considered in this work. Cyber-insurance was proposed to manage security risk [START_REF] Medvinsky | Endorsements, licensing, and insurance for distributed system services[END_REF] but is only modeled recently [START_REF] Kesan | Cyberinsurance as a market-based solution to the problem of cybersecurity: a case study[END_REF][START_REF] Lelarge | Economic incentives to increase security in the internet: The case for insurance[END_REF][START_REF] Shetty | Competitive cyberinsurance and internet security[END_REF]. A key concern is whether cyber-insurance is an incentive for security adoption. In [START_REF] Lelarge | Economic incentives to increase security in the internet: The case for insurance[END_REF], the authors do not consider the heterogeneity in modeling cyber-insurance. [START_REF] Shetty | Competitive cyberinsurance and internet security[END_REF] assume the effort on security protection is continuous and do not consider the network topology.

Conclusion

Modeling strategic behavior in security adoption helps us to understand what are the factors that could result in under investment. In this paper, we show, via a Bayesian network game formulation, how "network externality" with "node heterogeneity" can affect security adoption in a large communication network. We also investigate the effect of cyber-insurance on protection level. We establish the conditions under which cyber-insurance is a positive incentive for security adoption. This work provides the fundamental understanding on the economic aspect of security adoption, and sheds light on a new Internet service which is economically viable.

Fig. 1 :

 1 Fig. 1: Local mean field tree for node i with degree k

Fig. 3 :

 3 Fig. 2: Verifying local mean field


T V Prabhakar

S N Akshay

Uttama Nambi

R Venkatesha Prasad

S Shilpa

K Prakruthi
email: kprakruthi@cedt.iisc.ernet.inr.r.venkateshaprasad

Ignas Niemegeers
email: i.g.m.m.niemegeers@tudelft.nl

A Distributed Smart Application for Solar Powered WSNs

Keywords: Energy Harvested Wireless Sensor Network (EHWSN), multicriteria optimization, distributed smart application

Energy harvesting (EH) is a major step in solving the critical issue of availability of energy for sensor nodes. However, it throws many challenges. The applications built on the sensor networks powered by EH need to adapt their operations yet serve the purpose. We propose a distributed smart application for a multihop sensor network and in general in the future Internet of Things (IoT) where a network node executes an optimal number of policies to minimize the difference between available energy and consumed energy (called residual energy) for the execution of an application policy. We formulate this as a multi-criteria optimization problem and solve it using linear programming Parametric Analysis. We demonstrate our approach on a testbed with solar panels. We also use a realistic solar energy trace with a three year seasonality database. The smart application is capable of adapting itself to its current energy level as well as that of the network. Our analytical results show a close match with the measurements conducted over testbed.

Introduction

Recently Energy Harvesting Wireless Sensor Network (EHWSN) is a reality making WSNs independent of batteries. This is paving way to rapid growth of interesting applications for sensing and control. The "ZigBee Green" [1] is specifically designed to run on energy harvesting (EH) sources. Recent advancements in material science and MEMS research have made harvesting using Thermo Energy Generators (TEGs) and vibration (unusable till recently) as potential energy sources. Moreover, energy storage in thin film batteries and low leakage super capacitors with several thousand charge-discharge cycles offer efficient energy storage which is fueling the enormous growth. Thus our aim in this work is to make the best possible use of all these positive developments. EHWSN are used wherever remote monitoring and control are required over a wide spectrum of scenarios. One end of this spectrum is an intrusion detection system deployed in a wireless tripwire paradigm for monitoring an international border, and the other end is a simple wireless switch. While the former application requires an energy storage buffer, the latter application requires energy generation and its usage on the fly. Moreover, we could see that they cover multihop and singlehop settings respectively. Other applications are intelligent transportation, smart buildings, pollution monitoring, agriculture and climate change, health care including body area networks and other similar applications covering the complete domain of Internet of Things (IoT). For outdoor applications, photovoltaic panels offer significantly higher power compared to other harvesting sources, which use reflected light or even a partial shade. This is specifically used in intrusion detection settings where an intruder cannot camouflage as a sensor node himself. Additionally, e.g., seasonal variation in sunlight plays an important role in ensuring continuous and untethered operation of solar EHWSN nodes. Thus, applications have to continuously adjust to varying instantaneous power and yet accomplish their primary assigned task. Usually EHWSN nodes are wide spread and the communication range is limited. Thus multihop operations are sought within acceptable performance deterioration. There are significant differences between battery driven Wireless Sensor Networks (WSNs) and EHWSNs. In WSNs it is sought to: (a) reduce the energy consumption to increase the battery life, and (b) have a network wide policy to support a network lifetime of about "X" (say) number of hours or to support the largest partitioned network for a longer duration. A large body of work in WSN is limited to maximizing the policy subject to a given energy constraint or minimizing energy consumption to satisfy a network policy requirement. In direct contrast, for an energy harvested network, the objective is to maximize the application policies and also maximize the energy consumption. In other words, minimize the residual energy between the available and consumed energy in each discrete time slot and maximize the application policy (in turn usage of EHWSNs). In nodes with EH, if energy is not utilized properly, it would be lost due to leakage or lack of storage capacity, thus the goal is to minimize residual energy. Our work in this paper uses a multi-criteria optimization approach to find an optimal application policy versus residual energy curve. The significance of optimal application policy versus residual energy curve is to show the trade-off between global perspectives of application policy and residual energy while using EH.

In this paper, the goal is to implement an example of a distributed smart application for environment monitoring application where the nodes are powered with EH, esp. Solar power. Fig. 1 shows the parameters to be controlled at different layers to achieve maximization of application policy and minimization of residual energy. Results obtained using analysis followed by our testbed implementation are encouraging and even "near real time" applications can perform optimally.

Related work

Literature on EHWSN networks is mostly limited to a single hop network or extensive simulation studies. Several energy harvesting sources like thermal, mechanical, solar, acoustic, wind and wave for embedded systems are discussed in [START_REF] Chalasani | A survey of energy harvesting sources for embedded systems In: Southeastcon[END_REF]. Improvement in life time is shown in [START_REF] Jiang | Perpetual environmentally powered sensor networks In[END_REF] where supercapacitor and battery are together charged from a solar panel. The applications can survive for several years by adjusting their duty cycle. Solar energy predictions using simple time series such as Exponential Weighted Moving Average (EWMA) is commonly used [START_REF] Kansal | Power Management in Energy Harvesting Sensor Networks[END_REF]. In [START_REF] Audet | Scheduling recurring tasks in energy harvesting sensors[END_REF] a three state markov chain model is used to predict the solar energy source and their transition probabilities are restricted for day time only. Energy samples from a simulation model are also generated from the model. Several optimization techniques have been discussed in literature for battery driven multihop WSN's in the past where the objective is to maximize the network lifetime by minimizing energy consumption [START_REF] Khodaian | Delay-constrained utility maximisation in multihop random access networks In[END_REF], [START_REF] Palomar | A tutorial on decomposition methods for network utility maximization In: Selected Areas in Communications[END_REF]. With a view on utilizing the harvested energy in an optimized manner, adapting the performance of an application while respecting the limited and time-varying amount of available power in EHWSN is discussed in [START_REF] Moser | Adaptive Power Management for Environmentally Powered Systems In: Computers[END_REF]. A formal model that actively adapts application parameters such as "rate of sensing" is used to optimize the performance. The simulation study does not consider network related parameters or network wide energy levels. A "Lazy Scheduling Algorithm" is proposed and tested for its effectiveness by assigning several power values to the system in [START_REF] Moser | Lazy scheduling for energy harvested sensor nodes In: Conference on Distributed and Parallel Embedded Systems[END_REF]. Task admittance and future energy prediction is carried out with energy variability characterization curves generated by modeling the power source. Dynamic adaptation of the duty cycle of a node to ensure energy neutral operation by observing deviations in EH from an estimated model is discussed in [START_REF] Hsu | Adaptive Duty Cycling for Energy Harvesting Systems[END_REF]. Adaptive control theory to formulate a linear-quadratic optimal tracking problem for maximizing task performance and minimal duty cycle variations is proposed in [START_REF] Vigorito | Adaptive Control of Duty Cycling in Energy-Harvesting Wireless Sensor Networks[END_REF]. A comparison of several energy harvesting based routing protocols in a simulation setup is in [START_REF] Hasenfratz | Analysis, Comparison, and Optimization of Routing Protocols for Energy Harvesting Wireless Sensor Networks In: Sensor Networks[END_REF]. We demonstrate a distributed smart application which optimizes the necessary parameters to ensure maximization of application policy and minimization of residual energy. Contrasting to the work in literature, we believe performing energy neutral operations based on node's own energy is not optimal. Instead we propose to derive the optimal number of operations and the residual energy based on currently available energy at the node, predicted energy and network energy (i.e., neighbouring nodes). Particularly, we tune the duty cycle factor, transmission power factor and the application morphing factor to achieve optimal performance. Amongst the rich literature on EHWSN, inter alia, we position our work based on these attributes: (a) Harvested energy is the only available source; (b) EHWSN nodes are deployed in a testbed with MAC layer contention and adaptive duty cycling; (c) Inter-node distance of about 25-30ft with a realistic channel where Wi-Fi and other 2.4GHz radios are present; (d) Energy prediction from physical solar trace data including seasonality over a three year database is used; and (e) A smart application which morphs itself into several forms based on the energy level of the node as well as its network in a manner where performance deterioration is within acceptable limits.

Smart Application -The model

We argue that node based task scheduling and pre-emption is perhaps not best suited for multihop EHWSN. For instance, it is possible that low priority tasks located at the head of the queue gets executed during energy stress disregarding network's requirement and energy budgets. We propose that applications have to be "smart". A typical WSN application comprises of operations such as sense, compute, store and communicate. These operations are required to be executed based on a policy over several time slots. Communication comprises of packet transmission and reception. Packet forwarding refers to relaying i.e., reception and transmission. Transmission power control is mandated due to energy considerations. Smart application design and its successful implementation require several parameters such as: (a) Available energy in the storage buffer called "real energy" (E A ). (b) Predicted energy that is possibly harvested in the next two or three time slots -"virtual energy" (E P ). (c) The "network energy" (E N ) which is essentially the energy available in the neighbouring nodes (or energy available along a route). Thus our smart application has to exploit the energy in the slot to the maximum such that the "residual energy" between the available energy and consumed energy in a slot is minimum. Since energy replenishment occurs in EHWSN, energy utilization should be such that maximum number of tasks or operations should be completed. As one can observe, Packet Reception Ratio (PRR) and application performance depends on accurate measurement of the above parameters. Since available energy is stored in a super-capacitor, we calculate the real energy by sensing the voltage across the capacitor. We use Holt-Winters model to predict the virtual energy in a node. We leverage on the RSSI values contained in routing messages for periodic update on the energy level in the network. Since available energy on each node varies, the application morphs itself into several forms in a manner that performance deterioration is within acceptable limits. For the purposes of ease of implementation, we discretize the available energy levels into 4 levels represented by

E i , i ∈ {0, 1, 2, 3}. E 0 , E 1 ,
A(k)(n) = E S(k)(n) + E H(k)(n) and E A(k)(n) ≤ E max .

The Base Application and Morphing

We call a 'base application' to essentially mean a set of policies which would be executed if available energy is high. At the beginning of each time slot, the application checks the available energy, virtual energy and the policy that requires to be executed. If there is sufficient harvested energy, the node initiates network support for its policy and prepares itself to execute the corresponding policy, else, the application on the node decides to morph into a slower versions (lesser functionalities than the base application that is specified apriori ) in as many steps as energy is quantified. For example, when ensuing two time slots reports the virtual energy for the node is low and current energy level is low, the application morphs to a lower version by partial execution of the policy with a few operations backlogged for later execution. A partial fulfillment for a specific policy is necessary to ensure that priority for certain operations in the policy has soft guarantees. For instance, when the node is high on own energy and virtual energy (i.e. both the energy values are at E 3 ), the node can complete its policy execution in the current time slot including any backlog operations. This energy expenditure is possible only when the network provides the necessary support. With its completion, the node may move to either E 1 or E 0 depending on the level of energy depletion. At the same time, if the future time slots predict a low energy, the base application chooses to morph to a slower form and thus deplete lesser energy and move to say either to E 2 or E 1 . In essence,

E A(k+1)(n) = E i , ∀i ∈ {0, 1, 2, 3}

Policy Models

Policy Model -Operation Set: The operation set includes both node and network related operations. Basic operations may include sensing, computing, communication and storage. Each element is associated with fixed energy consumptions, where, transmission of 128 bytes @ 0dBm consumes 0.314mJ, reception of 128 bytes packet consumes 0.4 mJ, reading and writing 1 byte data to flash consumes 0.3 µJ and 1.23 µJ respectively.

Policy Model -Policy Set (P):

A policy set P defines the set of operations and their order of execution obtained from an operation vector that a sensor node n has to follow. Typically, a sensor node might be associated with two or more policies, and the specific set of policy to be executed in a particular time slot is defined as part of the base application. Thus the policy set for a node can be defined as,

P = {P1, P2, P3, , Px}. (1)
A typical policy on a sensor node D can be P d = {P 1 , P 2 , P 3 } where, P 1 = {Sense, Transmit}, P 2 = {Sense, Compute, Write} and P 3 ={Read, Compute, Transmit}. For example, a relay node R may have the policy set P r = {P 4 , P 5 , P 6 } where, P 4 = {Receiving, Forwarding}, P 5 = {Read, Compute, Forward} and P 6 = {Receive, Write}. At each time slot, the node decides to execute subset of policy set denoted by P ′ . The energy required for policy execution in time slot k is given by,

E R(k) = m ∑ i=1 EiPi ′ , { m = x, P ′ i = P m < x, P ′ i ⊂ P (2)
where, P ′ is the subset of the policy set, x the maximum number of policies and E i is the energy consumed for i th policy set.

Solar Energy Prediction Model

One of the key requirements of our approach is accurate prediction of virtual energy at each node. We used solar energy trace database with data collected over three years by Lowry range solar station [START_REF] Range | Colarado State Land Board[END_REF] from year May 2008 to August 2011 with three data sets corresponding to direct, reflected, and diffused sunlight. We applied these spatio-temporal data sets across the complete network as shown in Fig. 3. We evaluated two energy prediction models viz Exponentially Weighted Moving Average (EWMA) prediction model [START_REF] Kansal | Power Management in Energy Harvesting Sensor Networks[END_REF], and the Holt-Winters (HW) time series prediction model for these data sets. Since solar energy output can have seasonal variations, intelligent prediction algorithms should exploit the trend and seasonality available within the data sets. We applied Holt-winters (HW) time series prediction model commonly used for forecasting in stock markets, and is given by,

EP (k) = ϵ ES(k) I(k -1) + (1 -ϵ)(EP (k -1) + b(k -1)), (3)
where, E P (k) is the predicted value at k th time slot, E S (k) is the stored energy value, ϵ is the weight factor. Further, b(k) = γ(E P (k)-E P (k-1))+(1-γ)b(k-1) and

I(k) = β ES (k) EP (k) +(1-β)I(k-1
). The terms ϵ, β, γ are the weighting, trend and seasonality factors respectively. These are constants whose values are estimated such that their LMSE is minimized and their estimates are found to be 0.906, 0.1 and 0.650. We compared the real solar data with virtual solar data obtained from EWMA and HW prediction models for five days of a month. We found that maximum error percentage of about 45% for EWMA prediction model and around 7% for HW energy prediction model.

Multi-criteria Optimization Problem

The difference between available energy and consumed energy should be minimized for a given real, virtual and network energy to use the energy as much as possible. The problem is to find an optimal policy execution. We cast this problem as multi-criteria optimization with two objectives: (a) Maximizing application policy execution, and (b) Minimizing residual energy.

Maximizing application policy

In each time slot k, the objective is to maximize P ′ policies executed by a node. Thus the application policy utility U is given by,

U = m ∑ i=1 αiPi ′ s.t. 0 ≤ αi ≤ 1, (4)
where, Pi ′ is the set of policies to be executed and αi indicates the morphing factor for the i th policy set. When αi = 1, the entire policy set P is executed (i.e., Pi ′ = P ).

Minimizing residual energy

Let X k be the total available energy in time slot k. This is a function of E A(k) , E P (k) and E N (k) . Let Y k be the energy required to execute the policies in time slot k as given by Eq. 2 and Z k is the energy required for operation of the node with a duty cycle factor of δ. In the event of

X k <[Y k -Z k ], we have Ŷk = f (Y k , α k ) s.t. 0 ≤ α k ≤ 1; Z k = f (EDC , δ k ) s.t. 0 ≤ δ k ≤ 1; (5)
Ŷk is the consumed energy to execute the set of policies based on the morphing factor 'α k ' and Z k is the energy required for adaptive duty cycle based on harvested energy in each time slot. We define the residual energy utility, V , as

V = [X k -Ŷk -Z k ]s.t. X k ≤ Emax, [X k -Ŷk -Z k ] ≥ E ′ 0 ; (6)
where E ′ 0 is the lowest survivable residual energy level required for the system to be operational. Now, our multi-criteria optimization problem is formulated as,

MOPT: max U = m ∑ i=1 αi * Pi ′ (7) and min V = [X k -Ŷk -Z k ]
First we consider a single objective optimization problem for a given V (i.e., fixing one of the objectives).

OPT(V ) max U = m ∑ i=1 αi * Pi ′ ; s.t. [X k -Ŷk -Z k ] = V (8)
For all possible values of V ∈ [E ′ 0 , E ′ 3 ] we obtain their corresponding OPT(V ), optimal points in application policy versus residual energy curve. This gives a mapping from V to U , which is denoted as f : V → U , where for each point (U, V ), U = f (V ) is the maximum application policy utility that can be obtained.

Solution

The solution to OPT(V ) is obtained by using the special structure of linear programming such as the Parametric Analysis (PA). The overall approach is to obtain f (V ) by solving a finite number of linear programs to provide the morphing factor "α", transmission power factor and duty cycle factor "δ". These values ensure minimization of residual energy and maximization of application policies. Using PA, we study the perturbation of V and its effect on the optimality of OPT(V ) to obtain the perturbation factor λ. We use boldface to denote matrices and vectors. For a given V , the current optimal basis of OPT(V ) could still be optimal when there is a perturbation on V . Thus, the range [E ′ 0 , E ′ 3 ] can be partitioned into consecutive small intervals, each corresponding to a different optimal basis. For a given V , let the optimal basis matrix be B and the non-basic matrix be N. Let the optimal solution to OPT(V ) is (x B , x N ), where xB and xN denote the values of basic and non-basic variables respectively. Further, let c B and c N denote the coefficient vectors of the objective function of application policy utility U for the basic and non-basic variables respectively. b is the vector with coefficients of V . The corresponding canonical equations are:

U + (c B B -1 N -c N )x N = c B B -1 b x B + B -1 Nx N = B -1 b
Let the perturbation on parameter V be V + λ. Then the vector b is replaced by b + λb ′ with vector c B B -1 Nc N unchanged. Now B -1 b will be replaced by

B -1 (b+λb ′
) and accordingly the objective becomes c B B -1 (b+λb ′ ). As long as

B -1 (b+λb ′
) is non-negative, the current basis remains the optimal basis. The value of λ for another basis to become optimal can be determined as follows: Let

S = {i : b i ′ < 0} where b i ′ = B -1 b ′ . If S = ∅, then the current basis is optimal for all values of λ ≥ 0. Otherwise, let λ = min i∈S b i -b i ′ . ( 9
)
Let λ 1 = λ, then the current optimal basis is optimal for λ ∈ [0, λ 1 ], where x B = B -1 (b+λb ′ ) and the optimal objective is c B B -1 (b+λb ′ ). When λ > λ 1 , the basis B is no longer optimal. Thus, we need to choose a variable x r to leave the basis, where the minimum in Eq.( 9) is attained for i = r. x s is chosen by the dual simplex method rule [START_REF] Bazaraa | Linear Programming and Network Flows[END_REF] and we update the canonical equations based on the new optimal basis obtained and get (U, V ) pair as defined earlier for OPT(V ). The process is repeated to find the range [λ 1 , λ 2 ] over which the new basis is optimal. Thus, starting from V = E ′ 0 , we repeat the steps iteratively to find different bases until we reach E ′ 3 . The series of λ for these bases will partition [E ′ 0 , E ′ 3 ] into small intervals. Thus, by executing the above steps repeatedly, we obtain a series of (U, V ) pairs, each corresponding to an optimal basis. We obtain the application policy versus residual energy optimal curve by connecting these endpoints consecutively. Fig. 2(I) shows the simulation results where x-axis represents the residual energy (V) between the available and the consumed energy and y-axis represents the total number of operations executed by the node i.e., U . Fig. 2(I) shows the optimal curve for a node when available energy is E 3 and its neighbour node energy is either E 1 or E 2 or E 3 . Curves 1 and 2 indicate the optimal curve when the energy prediction for future slots is high and low respectively. When the available energy on the node was E 3 , the morphing factor α obtained were 0.9890, 0.6269, 0.2797 for residual energy of E ′ 0 , E ′ 1 and E ′ 2 respectively. Similar curves are obtained for other available energy levels i.e., E 2 , E 1 on the source node. Fig. 2(II) shows the time series of residual energy against the number of operations performed by the source node obtained via simulation and implementation. The source node runs the diffused energy profile from the LRSS. We can see that. the simulation result closely matches the implementation. The difference in number of operations between simulation and implementation is around 6% due to error in prediction. For instance, at time slot 3 of Fig. 2(II), the available energy at the source node was wrongly predicted and hence the node performed more operations compared to the simulation result.

Experimental Setup and Results

Implementation and Deployment Scenario

Each node in the network is equipped with α, δ factors for various values of available, predicted and network energy (E A , E P and E N ) as part of the application initialization. For our experiments we used a time slot of 2s where the application is designed to "read" a sensor value multiple times and "compute" an average value. This value is then stored in memory using a "write" operation and also schedule a packet for "transmission". The packet size containing the sensor value is 128 bytes with base station as the specified destination address. Our setup was tested with 4 nodes in a tree topology with one node requiring at least two hops to reach the base station as shown in Fig. 3. We used solar energy harvesters with varying energy profile across the network. Since we require realistic spatio-temporal varying power across all the network nodes, the solar trace database available from [START_REF] Range | Colarado State Land Board[END_REF] is replicated over the experimental setup. The three year database with trend and seasonality has power output for direct, diffused and reflected sunlight. We built our own customized hardware motes using TI's MSP430 microcontroller and Chipcon's IEEE 802.15.4 standard CC2520 radio. We broadly divided the network into data collecting sensor nodes and data relaying communication/relay nodes. From Fig. 3, Nodes B, C are communicating nodes and Node D is the sensor node. Communication nodes have the task of forwarding packets to the base station. Node A is utility powered and it is configured as the base station or data sink node for the network. In Fig. 3, Node B runs on direct sunlight profile, Node C runs on reflected sunlight profile and Node D runs on diffused sunlight profile. The power output from the solar panels was varied by switching "on" and "off" electrical lamps placed above solar panels. We scaled down the power output obtained from Lowry Range Solar Station (LRSS) to match the laboratory solar harvesters. Note that various other combination of the solar power pattern is possible, however we found that using the model from the source is tractable for repetition of the scenarios. We also omit here the details of minor modifications to MAC and other protocols (such as exchange of energy information) due to paucity of space. Each node in the network has two modes of operation viz, (a) active mode and (b) sleep mode. While, in active mode, a node can transmit and receive packets, in sleep mode, node turns off the radio transceiver to reduce the energy consumption and its duration is dictated by duty cycle factor δ.

Application

We show the performance of the distributed smart application running on sensor Node D (in Fig. 3) associated with a diffused energy profile. The solar emulator placed above Node D generates the diffused energy profile where most of the time either (E 1 ) or (E 2 ) amount of harvested energy is available. The sensor node uses the Holt-Winters energy prediction algorithm in every time slot to obtain the virtual energy. For generating a reference, we exposed Node D to a constant high energy profile to fix E 3 . Fig. 4(I) shows the behaviour of the morphed application on sensor Node D. The plot shows the comparison for two cases: Case-1 is the reference (E 3 ) energy level and Case-2 when the node is subjected to the diffused energy profile. In Case-1, the source and the neighbour's energy was always high at E 3 and thus Node D could perform all the policies associated with the energy level E 3 . This can be considered as the best case and serve as a reference for the distributed smart application. In Case-2, the source is associated with diffused energy profile and the neighbour node's energy profile is reflected. Fig. 4(I) shows the results of application morphing under energy fluctuation. We captured these fluctuations as events and enumerated them as: (a) when the energy of node is low and predicted energy for future time slots is high and vice-versa; (b) when energy level of the node is high but the network's energy level is low and vice-versa. In Fig. 4(I), several regions namely p, q, r, s, t show energy level transitions as well as application morphing. The region 'p' indicates the change in energy level from E 3 to E 2 on the source node. The region 'q' indicates the morphing of the application in one time slot before the change in energy level on the source node. The application morphed to a slower version of the base application as shown in region 'q' where the number of operations performed by the source node was significantly less compared to the previous time slot. This morphing improves the available energy on the energy buffer. The region 'r' shows the low energy profile E 1 on the source node and finally region 's' shows the application morphing to a slower version of the base application. This application morphing event is due to source node energy level being low and future time slot energy level is high. However, in the next time slot it can be clearly seen that Node D morphed to a faster version towards the base application as the future energy level is E 3 and region 't' indicates the increase in number of operations performed by the sensor Node D. Fig. 4(II) shows the implementation result of application morphing on the source node for various energy profiles obtained from LRSS. The neighbouring node was running reflected energy profile. As expected, it can be clearly seen that application morphing was enabled even when the source node was running on direct energy profile. In summary, the upper bound on application performance is dependant on source node's own energy as well as network's energy. Application performance when source node runs other energy profiles is also shown. Further, when the source node has diffused energy profile and neighbour has reflected profile, the source performed 354 node operations and 172 network operations. The source node performed 475, 656 node operations and 190, 212 network operations for reflected and directed energy profiles respectively.

Conclusions and Future Work

We have implemented a multihop EHWSN using solar energy. The efficacy of the proposed optimization algorithm was studied by evaluating node and network operations for various energy profiles. Clearly, the predicted, network and available energy contribute to the working of the distributed application. The smart application was able to maximize its operations by adjusting its application policy (rate) to satisfy the least residual energy criteria. In this work the number of hops is limited and we have only showed possible way of building application morphing also considering available energy in the nodes of the network rather than source node alone. We are encouraged by the results and propose to extend the network to include more number of hops and entire routes to study the scalability of our scheme. To the best of our knowledge this is the first implementation of a multihop energy harvested WSN, albeit two hops. We believe that our results are a step forward towards larger EHWSN deployments. We plan to generalize this work by proposing a cognitive networking stack for EHWSNs. The idea here is to provide hooks that consider EH including predictions at every layer of the networking stack. Moreover, we propose to study the distributed algorithms also with handles such as dynamically varying available voltage and possible frequency scaling.

Fig. 1 .

 1 Fig. 1. Optimal Parameters for Application, Routing and MAC Layer.

Fig. 2 .

 2 Fig. 2. (I) Optimal application policy versus residual energy when available energy is E3; (II) Plot of time series residual energy versus number of operations.

Fig. 3 .

 3 Fig. 3. Experimental Setup.

Fig. 4 .

 4 Fig. 4. (I) Morphed application on the source node for diffused and constant energy profile. (II) Morphed application on the source node for various energy profiles.

  E 2 and E 3 correspond to Lowest survivable, Minimum, Intermediate and High energy levels respectively. Similarly, the residual energy levels are rep-Intermediate and Higher residual energy levels respectively. Let the stored energy, harvested energy, predicted (virtual) energy at time slot k on node 'n' be represented by E S(k)(n) , E H(k)(n) and E P (k)(n) respectively. Let E N (k)(s) be the energy available on neighbouring node 's' at time slot k and E DC(k)(n) denotes the minimum energy required for the node for one duty cycle. We denote the maximum energy capacity of a supercapacitor as E max . The harvested energy for node n is E H(k)(n) ≥ 0. The available energy at each time slot k on node n is represented by E

	survivable, Minimum,
	resented by E ′ i , i ∈ {0, 1, 2, 3}, where E ′ 0 , E ′ 1 , and E ′ 2 , E ′ 3 correspond to Lowest

Acknowledgements

We thank iCore project. This article describes work partially undertaken in the context of the iCore project, Internet Connected Objects for Reconfigurable Ecosystems (http://www.iot-icore.eu/). iCore is an EU Integrated Project funded within the European 7th Framework Programme, contract number: 287708. The contents of this publication are the sole responsibility of iCore project and can in no way be taken to reflect the views of the European Union.