Packet Delay and Energy Consumption in Non-homogeneous Networks

This paper studies whether a packet will ultimately succeed in reaching a given destination, how long this will take and how much energy may be expended, in the context of a network with imperfect routing tables and non-homogeneous network characteristics. It also investigates the effect of non-cooperative routers that may actually choose to drop certain packets if they view them to be dangerous for destination nodes, as when packets may be carrying worms, viruses or malware, and when certain packets have been identified as being part of a Denial of Service attack. The approach we take is to construct a probability model for packet travel from a source to destination node in a large non-homogeneous multiple hop network. The randomness models the lack of precise routing information at each of the network hops, and randomness in routing can also be used to model networks where one wishes to explore alternate paths in a network to discover the more reliable paths, or those that may have other desirable characteristics such as lower delay or lower packet loss. We assume that each packet has the same time out: when the time-out elapses, the packet is dropped if it has not yet reached the destination, and some time later the source will retransmit a duplicate packet. A numerical–analytical solution is developed to compute the average travel time of the packet from source to destination and to estimate its total energy consumption. Two applications of these results are then presented. In the first one, the packet is an 'attack' packet (e.g. a Denial of Service packet, or some malware) and as it approaches the destination node it is being frequently inspected by routers that may decide to drop it if they correctly detect that it is a threat. The second example considers a wireless network where areas which are remote from the source and destination nodes have poorer wireless coverage so that packet losses become more frequent as the packet 'unknowingly'(due to poor routing tables errors) meanders away from the main coverage area. Other applications in wireless networks are also provided and a simulation study is performed to validate the analytical model.


INTRODUCTION
Search for recognizable objects in large random or imprecisely known environments is common in many scientific and technological contexts.This includes robotic search for mines in a minefield [1], search for information in the web or in large databases with uncertain or approximately represented data [2], motion of a particle or molecule in a medium until it can lock onto a receptor site (such as an oppositely charged location), animals that search for food or prey [3,4], and automatic theorem proving where portions of proofs have to be sought by sifting through a large database.This paper focuses on the travel of a packet from a given source to a destination which is at distance D from the packet, but whose whereabouts are unknown, or imprecisely known.
Errors in routing information can be due to node failures, infrequent routing table updates which do not keep up with changes in the state of links and nodes, intermittent effects in wireless links that disable certain one-step connections and invalidate the routing tables, and node mobility which can easily invalidate previous routing information.In such circumstances, one can view routers as probabilistic entities [5,6], and specific schemes for discovering viable paths have been developed The Computer Journal, Vol.55 No. 8, 2012 by guest on July 10, 2015 http://comjnl.oxfordjournals.org/Downloaded from Non-homogeneous Packet Networks 951 to deal with these circumstances [7].Furthermore, when the network is very large, the packet may end up being dropped by its own finite time-out, and it is also more likely to be lost due to an error or failure in the communication layer or due to buffer overflows in some router.
Despite the large body of literature on characterizing the performance of large-scale networks, most existing work has focused on spatially homogeneous environments.In many practical settings, however, routing accuracy and packet loss rate vary over the distance from a source to a destination.For example, spatial non-homogeneity may arise in wireless sensor networks due to non-uniform node deployment [8] or when some parts of a uniform network become faulty or degraded while the rest of the network is operating properly.Thus, the network's operational quality may be quite good close to the source node, but it may become less reliable when the packet moves far away from it.Another example of a nonhomogeneous medium occurs when a packet progresses more rapidly as it approaches its destination node, for instance, when directional information such as a radio signature becomes more accurate.The converse is also possible if the packet is designed to carry some form of attack, such as a virus or a worm, on the destination node which is being protected from such packets by the intermediate nodes, so that as the packet approaches the destination it is more likely to be dropped or re-routed.
We, therefore, study whether a packet ultimately succeeds in reaching its designated destination, how long this will take, and how much energy may be expended, in the context of a network with imperfect routing tables, and non-homogeneous network characteristics.We also investigate the effect of non-cooperative routers which may inspect packets and drop those that they view as being dangerous or harmful either for the network as a whole or for the destination node, as when packets may be carrying worms, viruses or malware, and when certain packets have been identified as being part of a Denial of Service attack.
Probability models of computer algorithms and networked systems [9,10] have long been applied fruitfully, and this paper takes a similar approach extending previous work in [6,[11][12][13][14].In [6,11], the time it takes a packet to travel from a source node to a destination node in an infinitely large homogeneous network was analysed using a mixed discrete and Brownian motion model.It was shown that the travel time is finite on average even with inaccurate routing information and packet losses, provided that a time-out mechanism is inserted to destroy the ongoing packet after a predetermined time and to replace it with a new packet that starts at the same source and proceeds at random and independently of its predecessor.Since the network is infinite, the time-out also protects the packet from spending an unreasonably long time in remote areas from which it may never return.By using a randomly different travel path, the new packet takes a distinct path from its previous incarnation, increasing its chances of reaching the destination.The analysis was generalized [12] to multiple packets which are simultaneously, but independently, sent out in the quest for the same destination node; both the total average travel time and the energy expended were obtained.The travel time is typically composed of a random number of new attempts to forward the packet, due to packet loss and time-out effects, and the energy consumption also includes the cumulative effect of all of these attempts.
In [13], we developed a numerical-analytical solution to the Brownian motion model to address non-homogeneity.The approach allowed us to compute an exact expression for the average time and energy that it takes a searcher to eventually find its target, based on a finite but unbounded number of internally homogeneous segments.We then presented in [14] two applications of these results in non-homogeneous packet networks.In the first, the searcher is a packet which carries a form of attack for the network or the destination, so that as it approaches the destination node it is more frequently inspected by routers and dropped by a router which assesses it as containing a threat or being a threat (as a Denial of Service packet, for instance).The second example considers a wireless network where areas which are remote from the source and destination nodes have poorer wireless coverage so that packet losses become more frequent as the packet 'unknowingly' (due to poor routing tables errors) meanders away from the main coverage area.
The time-dependent solution for the travel time in a nonhomogeneous network was studied in [15] where, differently from our approach [14], losses and retransmissions occur at specific distances from the destination that represent specific intermediate nodes.Thus, Brownian motion is used in [15] as a model of packet propagation from one hop to another, whereas we use it more generally to represent the route followed by a packet from source to destination, which may include several retransmissions by intermediate and source nodes.
The present paper extends our preliminary results [14] in the following respects: (i) we obtain a closed-form expression for the average travel time when packet losses do not occur and no time-out mechanism is employed by the source node; (ii) we develop a simple approximation for the average travel time when errors in routing occur infrequently; (iii) we provide a simulation study to validate the analytical model and to illustrate how the model's parameters can be obtained in a multi-hop network; (iv) we show how the model can capture the edge effect in symmetric networks such as the ones considered in [16][17][18]; (v) in the context of network security, we show that a form of phase transition can be observed concerning the eventual success of an attack depending on the relative speed of approach of the dangerous traffic and the intensity of protections which block the attacker's progress and (vi) we provide an extensive review of related work on the application of random walk and Brownian motion techniques to the analysis of packet traversal of large networks.We also present the model in more details than in [14] to provide the reader with a self-contained presentation.
The remainder of this paper is organized as follows.In Section 2, we model a packet's motion towards a destination node in an infinite random non-homogeneous network, with packet drops that will stop the packet's progress resulting in a subsequent time-out retransmission of the packet from the source.We obtain an exact expression for the average time and energy that it takes the packet to eventually find the destination node, based on a non-homogeneous Brownian motion model enhanced with some useful point processes representing the relaunch of an aborted or interrupted search.The results are applied in Section 3 to investigate the effect of using deep packet inspection and packet drops in protecting a critical node from malicious packets, showing that a packet (and its successive replicas) can be effectively impeded from ever reaching the destination node by a judiciously chosen rate of inspection.Section 4 presents some applications in wireless networks and provides a simulation study to validate the theoretical results.A review of related work is provided in Section 5. Finally, we present our concluding remarks in Section 6.

AN ANALYTICAL MODEL FOR NON-HOMOGENEOUS PACKET TRAVEL
Following the approach in [12,14], let Y t be the packet's distance from the destination node at time t ≥ 0. The packet starts at distance Y 0 = D and the travel process ends at some time T defined by We model the distance {Y t : t ≥ 0} as a diffusion process [19,20] which is a continuous time Markov process with continuous state space in which small changes occur during small intervals of time, i.e. for small t, > 0 and Y t = z the process satisfies the condition: Furthermore, the instantaneous mean and variance of the change in Y (t) per unit time, conditional on Y (t) = z, are given by where we assume that the process is time-homogeneous.When b(z) < 0, on average the packet gets closer over time to the destination node, but b(z) ≥ 0 is also possible.(ii) W: the packet's life-span has ended, and so has its travel.This can happen because the packet was destroyed or became lost, and the source was informed via the time-out which is assumed to be exponential with parameter r.After an additional exponentially distributed delay of parameter μ, a new packet is placed at the source and a new travel immediately begins.We write W (t) = Pr[s(t) = W]; (iii) L: the packet is lost, and the travel is interrupted until a new packet can be sent out; for small t and Y t = z > 0, this happens with probability λ(z) t +o( t), where λ(z) ≥ 0 is the packet loss rate at distance z.Information about the loss of the packet will be available through the time-out effect; thus, the time spent in this state is exponentially distributed with parameter r, after which the travel process enters state W. We denote L(t) = Pr[s(t) = L]; (iv) P: the packet has reached its destination and the travel process ends.However, as an artefact to construct an indefinitely repeating recurrent process in order to simplify the computation of E[T ], it is assumed that after one time unit the travel process restarts at the source and a new packet is sent out.We will use the notation Figure 1 shows a high-level diagram of the model illustrating the different states that a packet can be in during its travel from a source to a destination.In this abstract representation, the diffusion parameters b(z) and c(z) capture quality of routing as well as packet losses that can be repaired by intermediate network nodes (e.g.due to interference).On the other hand, the loss parameter λ(z) represents packet losses that require retransmission by the source node, for instance, due to node failure, buffer overflow or packet dropping by a malicious relay node.
Note that P is a fictitious state that we use to create a recurrent random process which indefinitely repeats itself.The average total travel time E[T ] is the average time that it takes from any successive start of the travel until the first instance when state Thus, we can compute E[T ] by solving the model for P , then applying the above equation.

Equations in the non-homogeneous medium
We model the packet's movement in a non-homogeneous network by the probability density function f (z, t) that represents the distance of the packet at time t ≥ 0, and assume that it satisfies a modified version of the distancedependent diffusion equation [19,20] to take account of the discrete probabilities.Such models have been used previously to represent traffic in communication systems and transportation systems [21][22][23][24].
We write the equations that the probability density function f (z, t) dz, z > 0, and the probability masses L(t), W (t) and P (t), t ≥ 0 will satisfy where the distance-dependent behaviour of the packet is captured in the drift b(z), instantaneous variance c(z) as well as loss parameter λ(z).In effect, this is equivalent to also letting the time-out parameter r be distance dependent because its distance-dependent part could be included in λ(z).On the other hand, if the time-out has operated, then the delay (of average value 1/μ) before the travel process is started again is independent of the location where the time-out occurred.Note that in practice the time-out is incorporated in the packet itself so that intermediate nodes can discard the packet if the time-out has elapsed, and similarly the source will know the time-out value and eventually it will retransmit a packet whose time-out has elapsed.

Piece-wise approximation for non-homogeneity
We simplify the model of a non-homogeneous medium by considering a finite but unbounded number of 'segments' that have different parameters for the Brownian motion describing the packet's movement as a function of its distance to the destination node, while within each segment the parameters are the same.The first segment is in the immediate proximity of the destination node, starting at distance z = 0.Each segment may have a different size, and we assume that there are a total of m < ∞ segments.By choosing as many segments as we wish, and letting each segment be as small as we wish (all segments need not be of the same length), we can approximate as closely as needed any physical situation that arises where the packet's motion characteristics vary over the distance of the packet to the destination node.We also show that this discrete representation leads to a neat algebraic 'product form' representation of the average search time, and that it thus provides a useful analytic form that offers a more intuitive representation of the analytical results.
We denote by 0 ≤ Z k < ∞ the boundary between the kth and (k + 1)th segments with Z 0 = 0.The last segment goes from Z m−1 to +∞, and we assume that both m and Z m−1 are finite but unbounded.Thus, for greater accuracy in representing the medium we can take as many segments as we wish, and they may be as small as needed, but they are all finite except the last segment.Thus, for 0 ≤ k ≤ m, the kth segment represents the range of distances Z k−1 ≤ z < Z k , and let S k = Z k − Z k−1 denote its size.We use n to denote the segment number in which the source node is located, i.e.Z n−1 < D ≤ Z n .The piece-wise approximation is illustrated in Fig. 2.
If we write the parameters of the diffusion model for the kth segment as then the differential equation for the stationary solution of the distance-dependent diffusion equation for The Computer Journal, Vol.55 No. 8, 2012

954
O.H. Abdelrahman and E. Gelenbe while the equation for the segment where the source is located is We also have and the normalization condition

Computing average travel time
Result 2.1.The total average travel time, which is obtained by solving for P so that E[T ] = P −1 − 1, is given by where u k and v k are, respectively, the positive and negative real roots of the characteristic polynomial of the stationary differential equation for the kth segment (2) The remaining parameters in (8) are computed as follows.Define Then set Ā1 = 1 and B1 = −1 and for Then set Fm = 0 and Ḡm = e v m Z m , and start another computation at Proof.The general solution has the form Thus, there are 2m + 2 constants to be determined from (i) the boundary conditions at 0 and +∞, (ii) the continuity condition of the probability density function at D and at the boundaries between segments and (iii) conditions obtained by integrating the defining differential equation around D and the boundaries between segments.First, consider the case or equivalently Furthermore, integrating the differential equation ( 2) from z = Z k−1 − to z = Z k−1 + and taking the limit as tends to 0 yields Solving ( 13) and ( 14), we can write (10).The above linear equations can be written in a matrix form From the boundary condition lim z→0 + f 1 (z) = 0, we have , then we can compute Āk and Bk recursively using the matrix multiplication in (11).Moreover, the stationary solution of the differential equation for Next consider a segment k where z ≥ D and write the constants F k and G k in terms of F k+1 and G k+1 by solving boundary conditions similar to (13) and (14) is a probability density function, we must have lim z→∞ f m (z) = 0 which implies that F m = 0, and the solution for max(D, where Fk and Ḡk are computed using (12).Note that Ḡm = e v m Z m yields the desired solution for the last segment, that is, z .To determine A 1 and G m , consider the nth segment and apply the continuity condition of Also, integrating the differential equation ( 3) from z = D − to z = D + and taking the limit as tends to 0 yields From ( 6), the probability P is given by Substituting ( 5) into (7) yields Now solving the system of linear equations ( 17)−( 20), we can determine A 1 and where Substituting A 1 in (19) yields P from which the average travel time follows directly.

Remark 1.
With n being the index of the discretization segment that includes the source node at D, it is interesting to see that E[T ] only depends on a set of parameters that are computed for values of k = 1, k = n, and on two sets of algebraic iterations between k = 1 and k = n and k = m down to k = n.
Remark 2. When the source node is located in the last segment, we have m = n, and the average travel time takes the much simpler form Ān e u n (D−Z n−1 ) − 1 .
(22) For a homogeneous medium m = n = 1 and as we would expect from [12].
Result 2.2.In the special case without packet losses and without a time-out (λ k = 0, r = 0), the average travel time for b m < 0 is where Proof.One may attempt to derive (23) by substituting λ k = 0, ∀k in (8) and evaluating the limit as r tends to 0 using l'Hôspital's rule, but this approach seems to be difficult given the recursive nature of the expression.Hence, the proof is similar to that of Result 2.1 and we omit it.

Energy consumption
If energy is consumed only when a packet is actually being forwarded through the network, while during wait times for retransmissions the packet (which remains stored at the source until final successful delivery) consumes only negligible energy, then the average energy consumption E[J ] until the packet reaches its destination is There may be circumstances where the packet storage plays a significant role in energy consumption, in which case this can be estimated as being proportional to the total delivery time for the packet.This case will not be considered in the present work.

APPLICATIONS IN NETWORK SECURITY
In this section, we present some applications of the proposed model in the context of network security.

Retarding an attacking packet
An example of practical interest arises when the packet that we are modelling contains some form of attack on the destination node, such as a virus or a worm.We also suppose that the network protects this particular node by introducing a capability at intermediate nodes to detect the contents of the packet and to drop it.However, the sender will then, after a time-out, send the attacking packet again.The question is then whether it is possible to block the attack indefinitely or whether to the contrary the attacking packet will eventually reach the destination node that is being defended.We examine this problem in the context of a wired network that uses shortest path routing.Thus, if the distance D refers to the number of hops from source to destination, and if the routers are operating properly, we will have a drift b = −1 and a variance c = 0 throughout the network.More generally, if there is no uncertainty in routing c k = 0 and b k < 0, and it can be shown that the total average travel time does not depend on the network's parameters for z > D (25) Furthermore, if the routers are perfect and always provide shortest distance routing, we have b k = −1 and Now let us introduce a non-homogeneous packet drop effect by choosing an integer n to create an acceleration in the packet drop effect and let S k = D/(n − 1) so that which yields the following result.
Result 3.1.If lim n→∞ ( n−1 k=1 λ k /(n − 1)) = +∞, then the packet will never reach the destination node.Otherwise, it will reach it in a time which is finite on average, and with probability 1.
Figure 3 illustrates the above result by showing that even with a small excess, represented by a > 1, above the O(n) rate of increase for the loss rate λ k the attacking packet's progress will be indefinitely impeded by the drops, despite the subsequent time-outs.

A phase transition effect
The destruction of the packet and the time-out, both relaunch the search for the destination node and allow the attacker to improve its chances to find it.Figure 4 shows that if the node is heavily defended when the attacking packet gets very close to it, then the attack may never take place.Specifically, if log λ k = 1/kρ, then as ρ becomes very small E[T ] and E[J ] tend to infinity despite the fact that near the origin the travel speed is greater and its randomness is smaller, b k = −0.25+0.5(k−1)/(m−1) and c k = 0.5 + 0.5(k − 1)/(m − 1).
However, it is interesting to see that if the packet's speed of approach to the destination grows faster than the rate at which the packet may be destroyed, then both E[T ] and E[J ] (which is not shown on the graph) remain finite and may tend to zero, while in the opposite case they will tend to infinity, as shown in Fig. 5, presenting a form of phase transition.

A neighbourhood with traps
As another related example suppose that routers in the neighbourhood of the destination node within a distance S contains 'traps' that can identify the attacking packet and drop it.Accidental drops of the packet (due to transmission errors or buffer overflows) may also occur at a lower rate.Thus, we take m = n = 2, so that E[T ] is obtained from (22) as  Figure 6 shows the manner in which E[T ] sharply increases with λ 1 , for S ranging between 10 and 15, D = 100, b 2 = b 1 = 0.25, c 1 = c 2 = 1 and λ 2 = 0. Also μ = 0.1 and r is set to the value that minimizes E[T ] when S = 10. Figure 7, with S = 10 and the same set of parameters, shows that even small increases (more negative) in average speed at which the packet approaches its objective can reduce average travel time by an order of magnitude, yet E[T ] is still very large.
Figures 8 and 9 question how S and λ 1 may be selected together to maximize the protection offered to the destination node.If we keep the same set of parameters as previously but take λ 1 to be inversely proportional to S in Fig. 8    average number of protecting nodes λ 1 ∝ 1/S, and the ratio of time rate to spatial rate will remain constant for any fixed value of b 1 which is the speed of motion.Figure 8 shows that there is indeed an optimum size of protection space S = S * that maximizes the delay before the attacking packet can reach the destination node, and that it varies with the speed b 1 of the packet inside the protected neighbourhood.Here we take b 1 < b 2 , assuming that when the attacker detects that it is being inspected, its uncertainty about the location of the destination node reduces.As the speed increases, the optimum size of the neighbourhood gets smaller.This may be counterintuitive but it follows from the fact that we have taken λ 1 ∝ 1/S: a smaller size implies a higher 'rate of protection' and hence more frequently occurring destructions of the packet which compensate for the higher speed of the packet.However, the corresponding maximum values of E[T ] do become smaller as the packet's speed increases.In Fig. 9, we set b 1 = b 2 = 0.25 and is varied in λ 1 = /S 2 .The results are similar to the previous ones.
For the examples of Figs 8 and 9, the average energy expenditure is closely proportional to dz 1 so that we omit showing the numerical results for the energy.

Greater loss in remote areas
Another interesting case arises when a packet that moves far away from its initial point and from the destination node, has a greater chance of being lost or destroyed.This could represent a multi-hop wireless network deployed in a very large area, as the packet moves to remote areas far from the region where the source and destination are located, the nodes that the packet might visit are less likely to handle it and more likely to just discard it.This can also represent a network where there are fewer nodes in remote areas and inter-node communications in such areas are less reliable.As an example consider 100 segments with S = 1 and a loss rate that increases with distance: λ k = k , > 0, 1 ≤ k ≤ 99, λ 100 = 100 .If average speed of the packet's motion and its second moment remain constant with b k = 0 and c k = 1 for 1 ≤ k ≤ 100, the results with D = 10 in Fig. 10 show that a relatively short time-out is needed to optimize the average travel time, but that the resulting optimum is nevertheless very large.
Figures 11 and 12 show the locus of E[T ] and E[J ] when the average time-out 1/r is varied.The effect of varying the distance D between the source and destination nodes is illustrated in Fig. 11.It is interesting to note that when the time-out is small, energy consumption decreases because the packet spends less time travelling, while delay increases because many potentially successful search attempts will be interrupted by the time-out.On the other hand, large time-outs increase both delay and energy consumption since the source node will spend a significant time before realizing that a search attempt is unsuccessful.These results indicate that both delay and energy consumption are strongly influenced by the time-out, since a smaller value of D does not necessarily guarantee better performance.In Fig. 12, the loss rate increases with distance according to λ k = 10 improving the speed at which the packet reaches the destination, energy decreases because less time is spent in actual motion, while delay increases because in proportion more time is spent waiting and then restarting after the packet is lost.Note that with high-enough loss rates (S = 0.15) the minimum travel time does not coincide with minimum energy consumption.

Comparison with simulation
In this section, we illustrate how the parameters of the diffusion model can be obtained in a multi-hop network, and we present simulation results to validate the analytical predictions.Specifically, we revisit the simulation example considered in [11], extend it by incorporating packet drops at relay nodes, and show that the non-homogeneous diffusion model provides a good approximation for the performance of unbiased random walk routing over a regular topology under constant time-out and Bernoulli packet loss.
We simulate a grid network (Fig. 13) in which wireless nodes are placed in the i − j plane at points (i, j ) where |i| + |j | = 2n, n = 0, 1, 2, . .., and nodes have a fixed wireless range d = √ 2 so that a node (i, j ) can communicate with exactly four neighbours (i ± 1, j ± 1).Packets are transmitted from a source which is a given point in the network to a fixed destination which is taken as the origin, and packet routing is performed according to an unbiased random walk whereby at each step the next hop is selected uniformly at random among neighbours.We assume that packets do not experience queueing delays so that the traversal of a node only takes a unit time step.Thus, the distance between a node (i, j ) and the destination is the minimum number of hops that separates them, which is simply max(|i|, |j |).Furthermore, unlike the model, we assume the time-out and retransmission delay to be constant since in practice the source sets a fixed value for the time-to-live field in the packet's header.We assume that the time-out mechanism can operate while the packet is at any node in the network except at the destination itself.Packet loss is assumed to occur according to a non-homogeneous Bernoulli model whereby at any node which is k steps from the destination, the packet is dropped with probability π k or it is successfully transmitted to the next hop with probability 1 − π k , where π k = q 1/k and 0 ≤ q < 1 so that the packet loss increases with distance.
We can analyse the above example approximately using a non-homogeneous diffusion model with a sufficiently large number of segments m and a constant segment size S k = 1 for k < m, where the kth segment represents the set of nodes that are k steps from the destination.In addition, the mean and the variance of the distance travelled per unit time when the packet is at node (i, j ) are b(i, j ) = Here the diffusion parameters in the case |i| = |j | follow from the fact that only one of the neighbours of node (i, j ) is closer to the destination node while the other neighbours are further away from the destination.On the other hand, when |i| = |j |, the next hop of a packet currently at (i, j ) is equally likely to be closer to or further away from the destination.Since there are in total 4k nodes that are k steps from the destination and only 4 of them are located at points (±k, ±k), we can approximate the diffusion parameters for segment k by taking the average of the above two cases, yielding Since λ k denotes the average loss rate that a packet experiences when it is k steps from the destination, we take λ k = π k .Figure 14 depicts analytical predictions, obtained with m = 100, and simulation results for the average travel time and energy consumption in the grid topology when the initial packet's distance D = 10 and the loss parameter q = 10 −4 .Note that the time-out in the simulation cannot be smaller than D time slots; otherwise, the packet's travel process is interrupted prematurely and the average travel time tends to infinity.This restriction is not present in the analytical results because of the randomness in the time-out, but nevertheless the model provides reasonable approximations that can be useful in estimating the optimum time-out.

A network with small routing errors
Consider a network in which routing tables are reliable except for some errors that occur infrequently.Hence, most of the time, the packet moves towards its destination at the top speed allowed via the shortest path.We can model this case with the following parameters If we substitute the above approximation in (9), we obtain Thus, the total average travel time can be approximated by where Note that the accuracy of the above approximation improves as errors in routing (i.e.δ b and δ c ) become smaller.If there is no uncertainty in routing, then ξ = 1 and we arrive at the expression in (26).

Search in a bounded environment
As a final example, consider a wireless sensor network in which nodes are distributed over a finite area of radius R ≥ D, and all packets are routed to a centrally located sink [16][17][18].If the network is sufficiently dense, then we can approximate packet routing by a continuous diffusion process.To further simplify matters, assume a homogeneous medium so that the average travel time can be obtained by first substituting n = 1, m = 2 and S 1 = R into (8) yielding Next we need to capture the edge effect.Since packets cannot pass beyond a distance R, we place a reflecting boundary by substituting c 2 = 0 and b 2 < 0 leading to

RELATED WORK
The analysis we conducted in this paper is related to first passage times of random walks.In this area, there are many results for special cases of network graphs.In [25], the mean and variance of the hitting time were obtained for a torus-lattice network graph when the next node visited is selected at random among all neighbours leading to an unbiased walk.The analysis indicates that with these assumptions and in such networks, the probability distribution of packet delivery time is approximately geometrically distributed.In [26], the probability of an unbiased traveller visiting a particular node in a given step was derived for a 2D grid-based sensor network.Random walks on random geometric graphs were considered in [27,28] to study the effect of bias on delivery performance in wireless networks with uniform node distribution and fixed transmission range.The results show that unbiased routing achieves poor performance because the walker may 'orbit' around the target node for a long time before attaining it.Scaling properties of hitting times for a circular target area located at the centre of a larger circle with reflecting boundaries were derived in [18].The analysis suggests that when the source node is close to the target, a random walk scheme proposed in [29] achieves a mean hitting time on the same order as a random direction forwarding approach; otherwise, the latter achieves better performance.In [30], different random walkbased search strategies over a sensor network were analysed, and it was concluded that a source-and-sink-driven 'sticky search', where both the source and destination send probes into the network that leave trails, can match the delivery success probability of a spatial periodic caching scheme without requiring much memory or infrastructure support.The first passage time for multiple independent and unbiased random walks on a connected network was considered in [31], and it was shown that the mean first passage time converges to the shortest path between the source and the destination as the number of walkers approaches infinity.
Search problems have also been studied in physics, biology and ecology and some of the work done in these areas can be applied to communication networks.In [32], bounds and approximations were derived for the average travel time of a single searcher that alternates between local diffusive search and fast directed relocation in order to find any of the Poisson distributed targets.The results show that the travel time can be minimized by appropriately choosing the waiting times in the slow and fast regimes.In [33], it was shown that an inverse square power-law distribution of jump lengths (known as Lévy flights) is optimal for searching sparsely and randomly distributed revisitable targets, and that Brownian movement is sufficiently efficient for locating abundant targets.Such intermittent search mechanisms, which avoid oversampling [34,35] in the sense that already visited sites are not revisited continuously, have been observed in animals' hunting patterns [36,37], confirming the Lévy flight foraging hypothesis [38].In the context of wireless networks, a random walk with jumps was used in [39] to represent a network in which a node may decide to increase its transmission power to reach a neighbour beyond its nominal transmission range so as to explore different regions of the network [40].The effects of the jump probability on the hitting time and energy consumption for different network graphs were investigated in [39].In other contexts, such as navigation in small-world networks [41] and transport systems [42], studies have shown that efficient routing can be performed by links having a few long-range Lévy connections in addition to regular short-range connections.
Another related work [43] in biophysics investigates the first passage time distribution of a diffusing particle which may overshoot its destination, i.e. it diffuses away before being absorbed.The analysis indicates that there are two basic regimes: diffusion dominated where most of the travel time is spent delivering the particle by diffusion; and absorption dominated where the travel time is spent mostly wandering around the target and waiting for successful absorption.This model could be applicable to a wireless sensor network in which nodes are periodically put into a sleep mode, to reduce energy consumption, which causes the unavailability of the nodes and in turn the possibility of a packet overshooting its destination.This could capture, for instance, the case where a route discovery fails because the destination node is asleep.
Random walk techniques need to make assumptions about the network structure, physical medium, packet loss and routing policy, and their analysis is generally difficult when one studies large and non-homogeneous Markov chains.On the other hand, the use of Brownian motion approximations can simplify the analysis considerably, but this merely shifts the difficulty from deriving explicit analytical results to obtaining the parameters of a model from the network characteristics, as demonstrated by our simulation study.

CONCLUSIONS
We have constructed a Brownian motion model to represent a packet's travel to a destination node in a very large nonhomogeneous network.A mixed analytical-numerical method has been developed to compute the average time to reach the destination, including recurrent retransmission by the source after time-outs, and the average energy expended by the packet while moving through the network.We have shown that the model is able to capture the effects of increased loss rate in areas remote from the source and destination, variable rate of advancement towards destination over the route, as well as of defending against malicious packets within a certain distance from the destination.We observe that the degree of non-homogeneity of the network will significantly affect the average travel time and energy consumed.The role of timeouts to optimize these quantities has been exhibited, and several examples have been detailed.
In the context of network security, we modelled an attacking packet which may be detected and destroyed as it approaches a critical node, but in turn the attacking packet may progress more rapidly as it approaches the destination, for instance, because a directional routing being used may become more accurate.Comparing the increasing speed of approach of the packet with the possible steeper defenses of the destination node, we have observed that there may be conditions whereby despite the use of time-outs the attacking packet may never make it to the destination node, while in other circumstances the attack will be successful.The model was also applied to solve the design problem of firewall placement, and it was shown that when protection resources are limited there is an optimum size of protection space around the destination which maximizes the delay before the attack takes place.
We then considered wireless networks where packet losses (for instance due to insufficient wireless network coverage) increase as the packet reaches areas which are remote from the source and destination nodes.By varying the value of the time-out and studying the locus of the energy expended versus the time taken by the search, we have noted desirable operating areas where both of these parameters of interest are minimized.We also showed how the diffusion model can be applied to analyse the performance of a random forwarding scheme with constant time-out over a grid network with Bernoulli packet losses, and we presented simulation results to validate the analytical predictions.Finally, we illustrated how the model can be used to capture specific environments such as networks with small routing errors and bounded search spaces.
The work presented in this paper can be extended in several directions.For instance, we have not considered the problem of how the parameters of the model can be obtained when a specific routing protocol is deployed over a complex topology.To go beyond a purely theoretical impact, realistic examples of translating the assumed loss and advancement rates into existing environments and protocols will be considered in future work.Similarly, we have presented a theoretical analysis of how network attacks can be prevented through the use of deep packet inspection and packet drops.We addressed the question of whether such a defense mechanism can effectively stop an attack, but further research is required to develop mapping techniques that can accurately capture the network parameters of interest.Parameters such as the number of nodes performing packet filtering, the percentage of packets that undergo inspection, the type of attack and the mechanism employed to detect a malicious packet would all affect average detection rates.Finally, it would be interesting to apply the diffusion model to other search problems, such as robotic search for mines and animals' foraging patterns, and try to relate its findings to real-world experiments.

FIGURE 2 .
FIGURE 2. Illustration of the piece-wise approximation of a nonhomogeneous packet travel.

FIGURE 6 .
FIGURE 6.Average travel time E[T ] versus loss rate λ 1 in the protected neighbourhood S for S between 10 and 15 with a step size of 1.

FIGURE 7 .
FIGURE 7. E[T ] (logarithmic scale) versus travel speed b 1 inside the protected neighbourhood for different values of loss rate λ 1 .
Figure6shows the manner in which E[T ] sharply increases with λ 1 , for S ranging between 10 and 15, D = 100, b 2 = b 1 = 0.25, c 1 = c 2 = 1 and λ 2 = 0. Also μ = 0.1 and r is set to the value that minimizes E[T ] when S = 10.Figure7, with S = 10 and the same set of parameters, shows that even small increases (more negative) in average speed at which the packet approaches its objective can reduce average travel time by an order of magnitude, yet E[T ] is still very large.Figures8 and 9question how S and λ 1 may be selected together to maximize the protection offered to the destination node.If we keep the same set of parameters as previously but take λ 1 to be inversely proportional to S in Fig.8so that the The Computer Journal, Vol.55 No. 8, 2012

FIGURE 8 .
FIGURE 8. E[T ]versus size of protected neighbourhood S when the loss rate λ 1 = 10/S for different values of travel speed b 1 .The optimum protection space needed becomes smaller so that λ 1 increases when the packet's speed increases.

FIGURE 9 .
FIGURE 9. E[T ]versus size of protected neighbourhood S when the loss rate λ 1 = /S 2 for = 0.1-0.5 with a step size of 0.1.The protection area needed to maximize the travel time decreases as increases.

FIGURE 10 .FIGURE 11 .
FIGURE 10.E[T ](logarithmic scale) versus the average time out 1/r when loss rates increase linearly with the segment number and the total number of segments m = 100.

FIGURE 12 .
FIGURE 12.The locus of E[T ] and E[J ] when the average time out 1/r is varied for different values of S k = S, D = 10 and μ = 0.05.

FIGURE 13 .
FIGURE 13.The topology of the simulated network where darker shades represent lower packet loss rates.

FIGURE 14 .
FIGURE 14.Comparison of analytical and simulation predictions for the average travel time and energy expenditure versus the time-out when retransmission delay 1/μ = 10, loss parameter q = 10 −4 and initial packet's distance D = 10.