A SIR-based model for contact-based messaging applications supported by permanent infrastructure

In this paper we focus on the study of coupled systems of ordinary differential equations (ODE's) describing the diffusion of messages between mobile devices. Communications in mobile opportunistic networks take place upon the establishment of ephemeral contacts among mobile nodes using direct communication. SIR (Sane, Infected, Recovered) models permit to represent the diffusion of messages using an epidemiological based approach. The question we analyse in this work is whether the coexistence of a fixed infrastructure can improve the diffusion of messages and thus justify the additional costs. We analyse this case from the point of view of dynamical systems, finding and characterising the admissible equilibrium of this scenario. We show that a centralised diffusion is not efficient when people density reaches a sufficient value. This result supports the interest in developing opportunistic networks for occasionally crowded places to avoid the cost of additional infrastructure.


Marina Murillo-Arcila
Institut Universitari de Matemàtiques i Aplicacions de Castelló (IMAC) Escuela Superior de Tecnología y Ciencias Experimentales Universitat Jaume I, Spain Abstract. In this paper we focus on the study of coupled systems of ordinary differential equations (ODE's) describing the diffusion of messages between mobile devices. Communications in mobile opportunistic networks take place upon the establishment of ephemeral contacts among mobile nodes using direct communication. SIR (Sane, Infected, Recovered) models permit to represent the diffusion of messages using an epidemiological based approach. The question we analyse in this work is whether the coexistence of a fixed infrastructure can improve the diffusion of messages and thus justify the additional costs. We analyse this case from the point of view of dynamical systems, finding and characterising the admissible equilibrium of this scenario. We show that a centralised diffusion is not efficient when people density reaches a sufficient value.
This result supports the interest in developing opportunistic networks for occasionally crowded places to avoid the cost of additional infrastructure.
1. Introduction. In this paper, we are concerned with the study of coupled systems of ordinary differential equations (ODE's) that describe the diffusion of messages between mobile devices. We base our model on Population Processes, a method commonly used to model the dynamics of biological population [12], more concretely, we use the so-called SIR (Susceptible, Infectious and Recovered) models which are used to describe the spreading of human epidemical diseases. The study of the symptotic stability of the disease-free and the endemic equilibrium is an active recent area of research, see for instance [6,10,14].
These biological models have a strong connection with message spreading and they have been recently widely studied. Under the formulation of a system of ODE's, Haas and Small in [8] developed a model based on epidemiological processes for a network that used animals (whales) as data carriers to store and transfer messages. Zhang et al. [17] stated a rigorous, unified framework to study epidemic routing and its variations. The authors of [5] introduced a mathematical approach for messages diffusion in opportunistic networks using the Epidemic protocol. One of the main conclusions of their analysis (mathematical model and its respective simulation) is that SIR models are quite accurate for the average behaviour of Epidemical DTN (Delay Tolerant Networks). In [16] the authors proposed a detailed analytical model to study the epidemic information dissemination in mobile social networks. It was based on SIR models including rules related to the user's behaviour, especially when their interests change according to the information type, and these changes can affect the dissemination process. Other approaches for modeling P2P communications can be found in [11].
Our research is motivated by the recent development of new contact-based messaging applications. As a example, we can find, Firechat, a messaging application meant for festivals which became popular in 2014 in Iraq due to the government restrictions on Internet use 1 , and after that during the Hong Kong protests 2 . There are other examples such as the secure messaging application Briar (see https://briarproject.org) or CoCam [13], an application for image sharing in events. The experience shows that these messaging applications seem to be operative in open places with a moderate to high density of people. Nevertheless, it still has to be tied to audits of cloud data storage [15].
In our paper, we propose new interesting models that describe a class of contactbased messaging applications which are based on establishing a short-range communication directly between mobile devices, and on storing the messages in these devices to achieve their full dissemination. For these models we studied their equilibrium and obtained analytical expressions for their resolution. Moreover, we performed numerical simulation to validate our results. The evaluations show that these models can reproduce the dynamics of message diffusion.
The paper is organised as follows: in Section 2 we introduce some preliminaries about dynamical systems and the basic epidemic model. The diffusion of messages following an epidemic model for an open area where the people can enter and leave is described in Section 3. The case where the birth and death rates coincide is discussed with full details. In Section 4, we introduce a fixed infrastructure that contributes to the diffusion of the messages and a parallel study to the one in the previous section is conducted. The performance evaluation of the previous two models is shown in Section 5, and in Section 6 we summarise the main conclusions of the work.

2.
Preliminaries. In this section we recall some notions of dynamical systems and we formally introduce the basic epidemic model in which we base our approach. A time dynamical system is given byẋ = f (x(t)) with a function f : Ω ⊆ R n → Ω. Given x 0 ∈ Ω, we can define its orbit by the dynamical system as the solution to the corresponding Cauchy Problem with initial condition x(0) = x 0 . We will pay special attention to the case when f : [0, N ] → [0, N ] is a continuous function which is also differentiable in ]0, N [, with N > 0.
For the sake of completeness, we recall some basic fundamentals on dynamical systems. We say that x * is a fixed point or an equilibrium point if f (x * ) = 0, which yields a constant orbit for x * , x(t) = x * for all t ≥ 0.
An equilibrium point is said to be stable if for all > 0 there exists δ > 0 such that for all x 0 ∈ [0, N ] such that |x 0 − x * | < δ we have that |x(t) − x * | < for all t ≥ 0. We say that x * is an attractor if there exists some δ > 0 such that for all We recall that an equilibrium point is hyperbolic if |f (x * )| = 0, otherwise x * is a non hyperbolic point. It is well-known that a hyperbolic equilibrium point is an attractor if f (x * ) < 0 and it is a repulsor point if f (x * ) > 0. Further information on dynamical systems can be found in [4].
First, we present our basic epidemic model in which we base our research, that has been already introduced in the present frame in [9]. It is given by: for all t ≥ 0, where I(t) denotes the class of infected nodes at time t and S(t) the class of susceptible nodes to be infected, and λ > 0 stands for the rate growth in which the number of infected nodes increases proportionally to the number of infected and non-infected ones. This shows that the transmission of messages follows epidemic diffusion, a concept similar to the spreading of infectious diseases, where an infected node (the one that has a message) contacts another node to infect it (transmit the message) [1]. Each node has a limited buffer where the messages in transit can be stored and when two nodes establish a pair-wise connection, they exchange the messages they have in their buffer, and check whether some of the newly received messages are suitable for notification to the user. It is important to point out that we assume that all nodes which have the messaging application store and forward messages and that the contact between the two nodes lasts long enough for transferring the whole message. We will assume that the population remains constant under the time: N 0 = S(t) + I(t), t ≥ 0. This permits to reduce this system to the one-dimensional logistic equation: Once we discretized the derivative for some h > 0 small, we get the following difference equation A similar description can be given for the nodes which are susceptible of receiving the message. The discretized models will be needed to perform numerical simulations.

Epidemic model for an open area.
In this section, we extend the model given in (1) to take into account that people can enter and leave an open area (e.g., a public square, a shopping mall, etc.). This model is further extended in the following section to considering a dual message diffusion model, that is, a contact based diffusion and centralised diffusion. Contact-based messaging applications considered in this work are based on establishing a short-range communication directly between mobile devices and storing the messages in these devices to achieve their full dissemination. Nodes move freely in a given area with a given contact rate between pairs λ > 0, and new nodes come to the place with an arrival rate β > 0 and a newly arrived node is a susceptible node (it does not have the message). We suppose that nodes leave the place with an exit rate of δ > 0. These are equivalent to the birth and death rates of the epidemical models. Thus, the number of nodes (population) in the place at time t, N (t), depends on the initial number of nodes in the place, N (0), and the rates of arrival and exit. We assume a short-range communication scope (for example, Bluetooth), so network congestion and interferences do not have a strong impact.
In our model, we consider that either susceptible and infected nodes can leave the area, as if it was a natural mortality in a SIR model, see for instance [2,3].
Therefore, the final exit rate at each one of these classes is proportional to the relative number of susceptible and infected nodes. Thus, the number of nodes is not constant over the time and it can be obtained as The system can be expressed using a deterministic model based on the following system of coupled ODE's: for all t ≥ 0, with initial conditions S(0) = S 0 , I(0) = I 0 , and N (0) = N 0 tied to S 0 + I 0 = N 0 .

3.1.
Dynamics for the epidemic model in an open area. Figure 1 represents the evolution of the infected nodes I(t) and the number of nodes N (t) as a function of time for different values of the arrival and exit rates. They have been obtained by using Euler method with step h = 0.001. All plots start with the same number of nodes N 0 = 100, one infected node I 0 = 1, and contact rate λ = 0.001. Analyzing the dynamics of this system, we see that, when there is no arrival and exit rate (β = δ = 0) we have the basic epidemic model, so the system is stable and all nodes get the message, as we can see in Figure 1a. In contrast, when the system has the same arrival and exit rate (figure 1c with β = δ = 1), the system reaches a fixed point, but not all the nodes get the message (I(t) < N (t)). If β > δ, then the number of nodes increases indefinitely as shown in Figure 1b. Finally, when β < δ, all the nodes leave the place, and N (t) falls to 0 as shown in Figure 1d.
We now proceed to study analytically the equilibrium points of the model. When the system reaches an equilibrium point at time t s , this implies that S(t), I(t), N (t) are constant for t > t s , so their derivatives are 0. From equations (4), we get β = δ and the number of nodes N (t) remains constant to N 0 for all t ≥ 0. In this case, there is a renewal of nodes, with rate β = δ. If we consider the I (t) equation The solution of this differential equation when I(0) = 1, i.e. a single device mobile with the message, is: We can obtain the delivery time T d , that is the time when the message arrives to a given number of nodes M . Using equation (6), setting I(t) = M and solving for t, we have: We can also obtain the number of infected nodes when the system reaches the equilibrium. From equation (4), we can study the equilibrium points (S e , I e ) of the unidimensional dynamical system obtained when taking into account that in the equilibrium β = δ and I(t) + S(t) = N 0 for all t ≥ 0.
In order to calculate the fixed points of equilibrium we solve the following quadratic equation, with solution S e = N 0 or S e = β λN0 . If we can study the behaviour near the fixed points S e = N 0 and S e = β λN0 . Computing the derivative of f we have f . As a consequence, if the following condition holds then N 0 is repulsor point, and if λN 2 0 − β < 0, then N 0 is an attractor. When λN 2 0 = β, then f (N 0 ) = 0 and we cannot conclude anything based on the former results. Nevertheless, a weaker criterion based on the values of the derivative can be used, and since f (S) < 0 for all S < N 0 , then we also get that N 0 is an attractor in this case. On the other hand, for S e = β λN0 we have f β λN0 = β−λN0 2

N0
. We recall that this second fixed point only appears when (10) holds, and here we get that it is an attractor. Thus, if (10) does not hold we have a unique fixed point at N 0 that is an attractor, and when λN 2 0 = β it bifurcates into two fixed points: N 0 , that is a repulsor, and β λN0 that is now the attractor. In both cases, the basin of attraction of the attractor point is the whole interval [0, N 0 ].
From this one-dimensional analysis of the behaviour on the variable S, and due to the tie S(t) + I(t) = N 0 for all t ≥ 0, we can directly extend these results to the two-dimensional case. As a consequence, (N 0 , 0) is the unique attractor if (10) does not hold, and if it holds, we have that (N 0 , 0) is a repulsor and is an attractor whose basin of attraction is all the points (S, I) ∈ [0, N 0 ] 2 satisfying S + I = N 0 .

Epidemic model for an open area with fixed nodes.
In this model we assume the same hypothesis as in the previous one but we now add a new consideration on it, the existence of fixed nodes with greater communication range (for example, WiFi), that can store and send the messages in the place. The number of fixed nodes will depend on the place area and nodes' communication range. All nodes sent the message with a given rate ρ, that will depend on message size and bandwidth. The nodes that are in the place, can receive the message from these fixed nodes, so the number of infected nodes increases with rate ρ. To design our model we take into account the following transitions: • (→ S, β): new nodes enter the place with β rate.
• (S → I, λSI): new nodes get the message when contacts occurs.
• (S → I, ρ): new nodes receive the message from the fixed nodes.
• (I →, δI/(I + S)): nodes with the message leave the place and the system can be expressed using a deterministic model based on ODE's: We point out that coefficients β and δ can be obtained, for instance, from turnstiles or cameras at control access points. Clearly, all new nodes arriving at a rate β will be included in the category of S(t). However, nodes leaving the place at rate δ can either be carrying the message or not. The factors δS(t)/N (t) and δI(t)/N (t) separate nodes leaving the place into both categories, proportionally to the number of existing nodes of each category in the place.

Dynamics for the epidemic model for an open area with fixed nodes.
As in the previous model, we proceed to study (12) in depth. It is clear that when the system reaches the equilibrium N (t) = N 0 , so β = δ. In this case, if we consider the I (t) equation from (12), and replace N (t) with N 0 and S(t) with N 0 − I(t), we have: which is a Riccati differential equation. To simplify the notation we denote b = λN 0 − β N0 . The general solution of (13) will be given by I(t) = I p (t) + 1 z(t) , where I p denotes a particular solution of (13) defined as: On the other hand, z(t) denotes the solution of the linear differential equation z (t) = (2λI p −b)z(t)+λ. Solving this equation and considering the initial condition I(0) = 1 we get: with Using this equation we can obtain the delivery time T d for M nodes setting I(t) = M and solving for t: We now study the equilibrium of the model. From equation (13), we can find the equilibrium points (S e , I e ) of the discrete unidimensional system obtained when taking into account that in the equilibrium β = δ and I(t) + S(t) = N 0 . The equilibrium points are given as solutions of that is, To simplify the notation let d = λN 0 − β N0 2 + 4λρ. Then the equilibrium points are given by Finally, we analyse the behaviour of the fixed points S 1 and S 2 . The derivative of f is given by f (S) = 1+h 2λS − λN 0 − β N0 . First, for S 1 we have f (S 1 ) = 1+hd. As a consequence, |f (S 1 )| > 1 and then S 1 is a repulsor point. On the other hand, f (S 2 ) = 1 − hd. As a consequence, |f (S 2 )| < 1 and then S 2 is an attractor.
As in the previous model and due to the fact that S(t) + I(t) = N 0 for all t ≥ 0, we can directly extend these results to the two-dimensional case. As a consequence and since in our model S(t), I(t) ≥ 0, the only equilibrium point that will exist is the one obtained from S 1 , that is the equilibrium point is given by: It is important to remark, that this point will only make sense when ρ ≤ β. We now evaluate this equilibrium point depending on ρ > 0 comparing these results with the dynamic evaluation of the system in Figure 2, that shows the evolution of the infected nodes I(t) and the number of nodes N (t) as a function of time. All graphs start with the same number of nodes, N 0 = 100, and one infected node, I 0 = 1. We also plot in each graph, I(t) when ρ = 0 (that is, the model analysed in Section 3) and when λ = 0, that is, when there are no contacts and the diffusion of the message is strictly performed by the fixed nodes. Thus, we have the following cases (omitting the previously studied case ρ = 0): • When 0 < ρ < β, the equilibrium point has S e > 0 and I e > 0 and, as it can be observed in Figure 2a, the number of infected nodes is always positive and it stabilises in I e . • When ρ = β, the equilibrium point is (S e , I e ) = (0, N 0 ), that is, all nodes are infected, confirming the experimental evaluation of the equation (see Figure  2b). • If ρ > β then (S e , I e ) will not appear but S (t) < 0 and then S(t) is a strictly decreasing function. Then the number of infected nodes will increase until it attain the value N 0 as it can be observed in Figure 2c. When ρ is higher (as in Figure 2c), we can see that the diffusion is mainly performed by fixed nodes.
Summing up, we can see two important effects when ρ increases: first, a reduction on the diffusion time, and, second, the final number of nodes that get the message is increased. Moreover, when ρ ≥ β, all nodes finally receive the message. Thus, introducing fixed nodes in a place we can get a full diffusion of a message even when nodes can enter and leave the place.
5. Performance evaluation. The models introduced in Section 3 and 4 allow us to evaluate the dynamics of messages diffusion in a bounded area. When the system reaches an equilibrium point we can obtain characteristic parameters such as the number of infected nodes and the diffusion time. Here, our evaluation considers that the system is in an equilibrium state, that is, we assume that the arrival and exit rates are the same. From now on, we will jointly refer to both rates as the renewal rate.
We consider a bounded rectangular area with size l = 100m with N 0 initial individuals that can move freely, entering and leaving the place with a renewal rate β = δ and carrying a mobile device that can establish pair-to-pair connection using short-range communications. In order to make the experiments independent of both the number of nodes and the area size, we chose to use the factor people density obtained as N 0 /l 2 .
In a bounded area, as shown in [7], the contact rate λ ≈ 2.7366rE[V ] l 2 when r << l, where r denotes the communication range and E[V ] the mean speed of the nodes. In our model, we will consider r = 7.5m and E[V ] = 0.5m/s obtaining a contact rate λ = 0.001s −1 , that is, a pairwise contact rate of about 3.6 contacts/h. The diffusion rate of the fixed notes is set to ρ = 1 messages per second.
We first evaluate the message coverage of the diffusion. We define message coverage as the final percentage of nodes that receive the message when the system reaches the equilibrium. This value is obtained evaluating the factor 100 · I e /N 0 using expressions (11) and (21). Figure 3 includes two contour plots of the message coverage depending of people density and renewal percentage. The (relative) renewal percentage (RR) is defined as the percentage of nodes that are renewed in the place every second RR = 100 · β/N 0 . In Figure 3a where we plot the results for contact-based distribution only, we can clearly see the impact of people density. When density increases, the percentage of nodes that receive the message increases, as the effect that the fixed renewal percentage is reduced, reaching practically 100% of nodes when density is very high. For low densities and higher renewal percentages the diffusion is reduced to values below 50% of nodes.
In Figure 3b we can see the results for contact-based and fixed nodes diffusion for ρ = 1. We observe the effect of fixed nodes diffusion when people density is low, increasing the coverage of the diffusion compared to the results of the only contactbased diffusion. Nevertheless, this effect is vanished when people density increases. We can see that, when the renewal percentage is less than ρ = 1, the message reaches 100% of the nodes. Summing up, a centralized diffusion is not efficient when people density is high, so a contact-based diffusion is a better approach.
We now evaluate the delivery time of a message using expressions (7) and (17). In Figure 4 we plot the delivery time depending on people density and for several renewal rates. As reaching 100% nodes is only possible when ρ > β we plot the delivery time for lower message coverages (95% and 75% concretely). In Figure 4a, we can see that using fixed nodes reduce the delivery time when people density is low. Specifically, for the case when the renewal rate is 1 and it is equal to ρ (that is, δ = β = ρ = 1), we have, that when density is very low, we obtain a very reduced delivery time (note also, that for these densities, the number of nodes in the place are very low, so a centralised approach can quickly disseminate the message). When, the density increases, all the curves converge to the same delivery time, so the effect of ρ and the renewal rate are vanished. The results for a lower message coverage (Figure 4b) show a similar pattern, although the values are lower, as they represent the time when the message reaches less nodes. 6. Conclusions. In this paper we focused on the study of coupled systems of ordinary differential equations (ODE's) to describe the diffusion of messages between mobile devices. The question we analysed was whether the coexistence of a fixed infrastructure can improve the diffusion of messages and thus justify the additional costs. We analysed this case from the point of view of dynamical systems, finding and characterising the admissible equilibrium of this scenario. We showed that a centralised diffusion is not efficient when people density reaches a sufficient value.
This result supports the interest in developing opportunistic networks for occasionally crowded places to avoid the cost of additional infrastructure. The performance of contact-based diffusion depends mainly on people density and the renewal ratio. Using only contact-based diffusion, when people density is low, the message coverage is low and the diffusion time high. Introducing fixed nodes diffusion, we can increase the performance of the diffusion. Nevertheless, a centralised diffusion is not efficient when people density is higher, so a contact-based diffusion is a better approach.
Funding. This work was partially supported by Ministerio de Economia y Competitividad, Spain (Grants TEC2014-