# Modeling and Analysis of Peer-to-Peer Botnets

Authors: Liping Feng; Xiaofeng Liao; Qi Han; Lipeng Song
Journal: Discrete Dynamics in Nature and Society
 (2012)

---

## Abstract

Peer-to-Peer (P2P) botnets have emerged as one of the most serious threats to Internet security. To effectively eliminate P2P botnets, in this paper, the authors present two novel dynamical models to portray the process of formation of P2P botnets, one of which is called microlevel model, the other is called macrolevel model. Also, the stability of equilibria is investigated along with the analysis of how to prevent the P2P botnet. Furthermore, by analyzing the relationship between infection rate and the proportion of the hosts with countermeasures, we obtain the mathematical expressions of effective immune regions and depict their numerical simulations. Finally, numerical simulations verify the correctness of mathematical analysis. Our results can provide the guidance for security practitioners to defend and eliminate P2P botnet at a cost-effective way.


---

## Body

## 1. Introduction

A botnet is a network of thousands (or more) of compromised hosts under the control of a botnetmaster, which usually recruits new vulnerable computers by running all kinds of malicious software (malware), such as Trojan horses, worms, computer viruses, and so forth [1]. For a variety of nefarious purposes, a botnetmaster who operates a botnet controls remotely those zombie computers to pursuit various malicious activities, such as distributed denial-of-service attacks (DDoS), email spam, password cracking, and so forth [2]. Botnets have been turned out one of the most serious threat to Internet [3].To effectively fight against botnets, researchers have endeavored to explore working mechanisms of botnets from different perspectives in the past few years (see [4–11]). These existing researches provide perfect insight into detection and elimination of botnets. Aiming at describing the dynamical characteristics of botnets, Dagon et al. [12] constructed a Susceptible-Infective-Recovered (SIR) model, which took into account the effect of time and location on malware spread dynamics. The model accurately characterizes the population growth of a botnet. Considering the interactions among botnets, Song et al. [1] presented the interaction game model among botnets to investigate the effect of the cooperation and the competition on the number of botnet individuals.Most previous botnets as shown in Figure1 use Internet relay chat (IRC) as a form of communication for centralized command and control (C&C) structure. Botnets based on C&C structure are easily checked and cracked by defenders; as well as the threats of botnets can be mitigated and eliminated if the central of C&C is unavailable [13]. In comparison, Peer-to-Peer (P2P) betnets as shown in Figure 2 employing a distributed command-and-control structure are more robust and more difficult for the security community to defend. Thus, P2P botnets, such as Trojan.Peacomm, Storm botnet [14], have emerged and gradually escalated in recent years. The threats of P2P botnets to Internet security have drawn widespread attention. Reference [15] presented a stochastic model of Storm Worm P2P botnet to examine how different factors, such as the removal rate and the initial infection rate, impact the total propagation bots. Kolesnichenko et al. developed a mean-field model to analyze P2P botnet behaviors [16]. In their seminal work, Yan et al. [17] mathematically elaborated the performance of a new type of P2P botnet—AntBot from perspectives of reachability, resilience to pollution and scalability. They also developed a P2P botnet simulator to evaluate the effectiveness of analysis. Furthermore, the authors suggested some potential defense schemes for defenders to effectively disrupt AntBot operations.Figure 1
Centralized botnet [18].Figure 2
P2P botnet [18].For security workers to be better prepared for potentially destructive P2P botnets, it is necessary for them to understand deeply factors that influence the formation of P2P botnets. Against this backdrop, in this paper, we utilize mathematical modeling method to investigate how immunizations affect the dynamical actions of P2P botnets. Our key contributions are summarized as follows: (i) we propose novel dynamical models which reflect the formation of P2P botnets; (ii) we derive mathematically the feasible region of immunization and depict their numerical simulations; (iii) we suggest a probable immune method for researchers and security professionals.The remainder of the paper is organized as follows. Section2 elaborates modeling mechanism. In Section 3, we derive the equilibria of models and prove their stabilities. In Section 4, we get the mathematical expressions of immune feasible regions and obtain the results of numerical simulations. In Section 5, we depict the numerical simulations to verify conclusions of Section 4. Section 6 concludes this paper with some conclusions.


## 2. Modeling P2P Botnets

Considering bot candidates and the network a botnet attaches itself to, we roughly divide P2P botnets into three categories [18]: (i) Parasite P2P botnet, in which all bot members are chosen from an existing P2P network; (ii) Leaching P2P botnet, which is a botnet that bot candidates are from vulnerable hosts throughout the Internet, but they will join in and depend on an existing P2P network; (iii) Bot-only P2P botnet, which refers to a botnet that occurs in an unattached network, and there are no nonmalignant peers except bots.For parasite P2P botnet, once a vulnerable host is compromised by botnet malware, it will directly become a bot member and serve for the botmaster without further joining the botnet. Up to this trait, in Section2.1, we present a deterministic mathematical model named “microlevel model” to reflect its dynamical features. However, many botmasters extend their scales to the whole Internet to recruit new zombies because the scale of parasite botnet is limited by the number of peers in an existing P2P network. For constructing this type P2P botnet, there are two steps: the first step is trying to infect new vulnerable hosts throughout the whole Internet, and the second step is new compromised hosts joining into network and connecting with other bots. In Section 2.2, we use a novel mathematical model, which we call “macrolevel model” to characterize their dynamical actions.


### 2.1. The Microlevel Model

In this subsection, we employ the classicalSIR model, which has been widely used by many researchers to study Internet malware propagation [19–24], to characterize the dynamical behavior of parasite P2P botnets. Let S^(t),I^(t), and R^(t) be the numbers of hosts at time t in stats S,I, and R, respectively. Let N^ be the total number of hosts in a P2P network and be relatively stable, then we have
(2.1)S^(t)+I^(t)+R^(t)=N^.
That is, given a P2P network with a total of N^ hosts, any host in the network will be at a state of either S^,I^, or R^, and the sum of all hosts in these states equals N^. In addition, unlike the traditional SIR model, our model includes the impact of real-time immunization to virus propagation.As a result, the model we employ is as follows:(2.2)dS^(t)dt=μ^N^-β^I^(t)S^(t)N^-(μ^+r^s)S^(t),dI^(t)dt=β^I^(t)S^(t)N^-(μ^+r^i)I^(t),dR^(t)dt=r^sS^(t)+r^iI^(t)-μ^R^(t),
where μ^ is the replacement rate of the hosts per hours; β^ is infection rate per hour; r^s is the state transition rate from S^ to R^ due to real-time immune measures; r^i is the recovery rate from infected state I^ to R^ due to antivirus measures. It is easy to verify that the positive cone R+3 is a positive invariant set with respect to system (2.2), where R+3={(S^,I^,R^)∈R3:S^>0,I^>0,R^>0}.In what follows, we consider the effect of immunization on computer virus propagation in the P2P network. In reality, it is reasonable for us to assume that some hosts have immune measures, others have not. Hence, in our model the total hosts can be partitioned into two subclasses: immune and no immune hosts. Letf be the proportion of the hosts with immune measures (0≤f≤1). We make a simple assumption that immunization has no effect on the infected time. So, we need only to change infection rate β^. Let β^1 be the proportion of hosts with immune measures infected by infective hosts, and let β^2(β^1≤β^2) be the proportion of hosts without immune measures infected by infective hosts. Therefore rewrite infection rate β^ as
(2.3)β-=fβ^1+(1-f)β^2.
Hence, the new differential equation model can be expressed as follows:
(2.4)dS^(t)dt=μ^N^-β-I^(t)S^(t)N^-(μ^+r^s)S^(t),dI^(t)dt=β-I^(t)S^(t)N^-(μ^+r^i)I^(t),dR^(t)dt=r^sS^(t)+r^iI^(t)-μ^R^(t).


### 2.2. The Macrolevel Model

In this subsection, we use a two-stageSIR model to depict the dynamical action of leeching P2P botnets, in which botmasters recruit new bots from the whole Internet. The model monitors the four populations of susceptible (S), stage-1-infected (I1) hosts that are compromised but not connect with other bots, and stage-2-infected (I2) hosts that are indeed bots and recovered (R). We assume that the number of hosts on Internet is relatively stable, which is often adopted in other existing efforts [25, 26]. Let N be the total number of hosts on Internet. Then our model can be formulated as follows:
(2.5)dS(t)dt=μN-(α1I1(t)+α2I2(t))S(t)N-(μ+rs)S(t),dI1(t)dt=(α1I1(t)+α2I2(t))S(t)N-(μ+r1+δ)I1(t),dI2(t)dt=δI1(t)-(μ+r2)I2(t),dR(t)dt=rsS(t)+r1I1(t)+r2I2(t)-μR(t),
where μ is the replacement rate of the hosts per hours, α1 and α2 is infection rate per hour, respectively, and rs is the state transition rate from S to R due to real-time immune measures, ri(i=1,2) is the recovery rate from infected state I1 and I2 due to antivirus measures, respectively.It is easy to verify the positive coneR+4  that is a positive invariant set with respect to system (2.5), where R+4={(S,I1,I2,R)∈R4:S>0,I1>0,I2>0,R>0,S(t)+I1(t)+I2(t)+R(t)=N}.In what follows, we analyze the effect of immunization on dynamical characteristics of P2P botnets. Letg be the proportion of the hosts that have immune measures (0≤g≤1).  We make a simple assumption that immunization has no effect on the infected time. So, we need only to change infection rate α1 and α2. Let α11 be the proportion of hosts with immune measures in S state infected by infective hosts I1; let α21 be the proportion of hosts with immune measures in S state infected by infective hosts I2; let α12 (α11≤α12) be the proportion of hosts without immune measures in S state infected by infective hosts I1, and let α22  (α21≤α22) be the proportion of hosts without immune measures in S state infected by infective hosts I2. Therefore rewrite infection rate α1 and α2 as
(2.6)α-1=gα11+(1-g)α12,α-2=gα21+(1-g)α22.
Hence, the new macrolevel differential equation model is
(2.7)dS(t)dt=μN-(α-1I1(t)+α-2I2(t))S(t)N-(μ+rs)S(t),dI1(t)dt=(α-1I1(t)+α-2I2(t))S(t)N-(μ+r1+δ)I1(t),dI2(t)dt=δI1(t)-(μ+r2)I2(t),dR(t)dt=rsS(t)+r1I1(t)+r2I2(t)-μR(t).


## 2.1. The Microlevel Model

In this subsection, we employ the classicalSIR model, which has been widely used by many researchers to study Internet malware propagation [19–24], to characterize the dynamical behavior of parasite P2P botnets. Let S^(t),I^(t), and R^(t) be the numbers of hosts at time t in stats S,I, and R, respectively. Let N^ be the total number of hosts in a P2P network and be relatively stable, then we have
(2.1)S^(t)+I^(t)+R^(t)=N^.
That is, given a P2P network with a total of N^ hosts, any host in the network will be at a state of either S^,I^, or R^, and the sum of all hosts in these states equals N^. In addition, unlike the traditional SIR model, our model includes the impact of real-time immunization to virus propagation.As a result, the model we employ is as follows:(2.2)dS^(t)dt=μ^N^-β^I^(t)S^(t)N^-(μ^+r^s)S^(t),dI^(t)dt=β^I^(t)S^(t)N^-(μ^+r^i)I^(t),dR^(t)dt=r^sS^(t)+r^iI^(t)-μ^R^(t),
where μ^ is the replacement rate of the hosts per hours; β^ is infection rate per hour; r^s is the state transition rate from S^ to R^ due to real-time immune measures; r^i is the recovery rate from infected state I^ to R^ due to antivirus measures. It is easy to verify that the positive cone R+3 is a positive invariant set with respect to system (2.2), where R+3={(S^,I^,R^)∈R3:S^>0,I^>0,R^>0}.In what follows, we consider the effect of immunization on computer virus propagation in the P2P network. In reality, it is reasonable for us to assume that some hosts have immune measures, others have not. Hence, in our model the total hosts can be partitioned into two subclasses: immune and no immune hosts. Letf be the proportion of the hosts with immune measures (0≤f≤1). We make a simple assumption that immunization has no effect on the infected time. So, we need only to change infection rate β^. Let β^1 be the proportion of hosts with immune measures infected by infective hosts, and let β^2(β^1≤β^2) be the proportion of hosts without immune measures infected by infective hosts. Therefore rewrite infection rate β^ as
(2.3)β-=fβ^1+(1-f)β^2.
Hence, the new differential equation model can be expressed as follows:
(2.4)dS^(t)dt=μ^N^-β-I^(t)S^(t)N^-(μ^+r^s)S^(t),dI^(t)dt=β-I^(t)S^(t)N^-(μ^+r^i)I^(t),dR^(t)dt=r^sS^(t)+r^iI^(t)-μ^R^(t).


## 2.2. The Macrolevel Model

In this subsection, we use a two-stageSIR model to depict the dynamical action of leeching P2P botnets, in which botmasters recruit new bots from the whole Internet. The model monitors the four populations of susceptible (S), stage-1-infected (I1) hosts that are compromised but not connect with other bots, and stage-2-infected (I2) hosts that are indeed bots and recovered (R). We assume that the number of hosts on Internet is relatively stable, which is often adopted in other existing efforts [25, 26]. Let N be the total number of hosts on Internet. Then our model can be formulated as follows:
(2.5)dS(t)dt=μN-(α1I1(t)+α2I2(t))S(t)N-(μ+rs)S(t),dI1(t)dt=(α1I1(t)+α2I2(t))S(t)N-(μ+r1+δ)I1(t),dI2(t)dt=δI1(t)-(μ+r2)I2(t),dR(t)dt=rsS(t)+r1I1(t)+r2I2(t)-μR(t),
where μ is the replacement rate of the hosts per hours, α1 and α2 is infection rate per hour, respectively, and rs is the state transition rate from S to R due to real-time immune measures, ri(i=1,2) is the recovery rate from infected state I1 and I2 due to antivirus measures, respectively.It is easy to verify the positive coneR+4  that is a positive invariant set with respect to system (2.5), where R+4={(S,I1,I2,R)∈R4:S>0,I1>0,I2>0,R>0,S(t)+I1(t)+I2(t)+R(t)=N}.In what follows, we analyze the effect of immunization on dynamical characteristics of P2P botnets. Letg be the proportion of the hosts that have immune measures (0≤g≤1).  We make a simple assumption that immunization has no effect on the infected time. So, we need only to change infection rate α1 and α2. Let α11 be the proportion of hosts with immune measures in S state infected by infective hosts I1; let α21 be the proportion of hosts with immune measures in S state infected by infective hosts I2; let α12 (α11≤α12) be the proportion of hosts without immune measures in S state infected by infective hosts I1, and let α22  (α21≤α22) be the proportion of hosts without immune measures in S state infected by infective hosts I2. Therefore rewrite infection rate α1 and α2 as
(2.6)α-1=gα11+(1-g)α12,α-2=gα21+(1-g)α22.
Hence, the new macrolevel differential equation model is
(2.7)dS(t)dt=μN-(α-1I1(t)+α-2I2(t))S(t)N-(μ+rs)S(t),dI1(t)dt=(α-1I1(t)+α-2I2(t))S(t)N-(μ+r1+δ)I1(t),dI2(t)dt=δI1(t)-(μ+r2)I2(t),dR(t)dt=rsS(t)+r1I1(t)+r2I2(t)-μR(t).


## 3. Model Analysis

To achieve the effective region off and g, we first obtain the stable equilibria for systems (2.4) and (2.7).


### 3.1. The Microlevel Model Analysis

In this subsection, we will solve the equilibria of system (2.4) and investigate their stability.The first two equations in system (2.4) do not depend on the third equation, and therefore this equation may be omitted without loss of generality. Hence, system (2.4) can be rewritten as
(3.1)dS^(t)dt=μ^N^-β-I^(t)S^(t)N^-(μ^+r^s)S^(t),dI^(t)dt=β-I^(t)S^(t)N^-(μ^+r^i)I^(t).
Now, we analyze system (3.1) by finding its equalibria. Steady states of system (3.1) satisfy the following equation:
(3.2)dS^(t)dt=dI^(t)dt=0.
Solving the system (3.2), we can conclude that system (3.1) always has a virus-free equilibrium (DFE) E0=(μ^N^/(μ^+r^s),0). Furthermore, define
(3.3)R^0=β-μ^(μ^+r^s)(μ^+r^i).R^0 is called the basic reproduction number. If R^0>1, then system (3.1) has a virus-epidemic equilibrium E1=(S^1,I^1)=(((μ^+r^i)/β¯)N^,(μβ--(μ^+r^s)(μ^+r^i)/β-(μ^+r^i))N^).Lemma 3.1.
DFEE0 is locally asymptotically stable when R^0<1 and unstable when R^0>1.Proof.
The characteristic equation of system (3.1) near E0 is
(3.4)det(-(μ^+r^s)-λ-β-μ^μ^+r^s0β-μ^-(r^i+μ^)(μ^+r^s)μ^+r^s-λ)=0.
Solving (3.4), we can get λ1=-(μ^+r^s),λ2=(β-μ^-(r^i+μ^)(μ^+r^s))/(μ^+r^s)≡(r^i+μ^)(R^0-1). Obviously, DFE is locally asymptotically stable when R^0<1 and unstable when R^0>1.Further, we have the following theorem.Theorem 3.2.
DFEE0 is global asymptotically stable if  R^0≤1.Proof.
Learn from the first equation of system (3.1)
(3.5)S^˙(t)≤μ^N^-(μ^+r^s)S^(t).
Thus,
(3.6)S^(t)≤μ^N^μ^+r^s+(S^(0)-μ^Nμ^+r^s)exp[-(μ^+r^s)t].
When t→∞, one can get
(3.7)S^(t)≤μ^N^μ^+r^s.
We choose Lyapunov function to be the form
(3.8)V(t)=I^(t).
The time derivative of V(t) along system (3.1) is given by
(3.9)V˙(t)=I^˙(t)=β-I^(t)S^(t)N^-(μ^+r^i)I^(t)≤[β-μ^μ^+r^s-(μ^+r^i)]I^(t)=(μ^+r^i)(R^0-1)≤0.
The theorem is proven.Next, we will analyze the stability of virus-epidemic equilibriumE1 of system (3.1).Theorem 3.3.
IfR^0>1, then the virus-epidemic equilibrium E1 of system (3.1) is locally asymptotically stable.Proof.
The characteristic equation of system (3.1) at E1 is given by
(3.10)det(-β-I^1N^-(μ^+r^s)-λ-β-S^1N^β-I^1N^β-S^1N^-(μ^+r^i)-λ)=0,
which equals
(3.11)λ2+aλ+b=0,
where a=(μ^+r^s)R^0,b=(μ^+r^s)(μ^+r^i)(R^0-1)+r^s(1-μ^). Obviously, in accordance with the relationship between roots and coefficients of quadratic equation, all eigenvalues of (3.11) have negative real parts. Thus, E1 is locally asymptotically stable when R^0>1.Theorem 3.4.
IfR^0>1, then the virus-epidemic equilibrium E1 is globally asymptotically stable.Proof.
Consider the following Lypunov function [26]
(3.12)V=∫S^1S^x-s^1xdx+∫I^1I^x-I^1xdx,
which is always positive in R+2. Moreover, the function satisfies
(3.13)V˙=S^-S^1S^S^′+I^-I^1I^I^′=(1-S^1S^)[μ^N^-β^I^S^N^-(μ^+r^s)S^]+(1-I^1I^)[β^I^S^N^-(μ^+r^i)I^]=-μ^S^S^1(S^1S^-1)2≤0.
Thus, we prove that the endemic equilibrium E1 is globally asymptotically stable.


### 3.2. The Macrolevel Model Analysis

In this subsection, we will solve the equilibria of system (2.7) and investigate their stability.The first two equations in system (2.7) do not depend on the third equation, and therefore this equation may be omitted without loss of generality. Hence, system (2.7) can be rewritten as
(3.14)dS(t)dt=μN-(α-1I1(t)+α-2I2(t))S(t)N-(μ+rs)S(t),dI1(t)dt=(α-1I1(t)+α-2I2(t))S(t)N-(μ+r1+δ)I1(t),dI2(t)dt=δI1(t)-(μ+r2)I2(t).
The equalibria of system (3.14) are determined by setting dS(t)/dt=dI1(t)/dt=dI2(t)/dt=0. There is always a virus-free equilibrium (DFE) Q0=((μ/(μ+rs))N,0,0). Furthermore, define
(3.15)R0=μ[α-1(μ+r2)+α-2δ](δ+μ+r1)(μ+rs)(μ+r2).
If R0>1, system (3.14) has a virus-epidemic equilibrium Q1=(S*,I1*,I2*), where
(3.16)S*=(δ+μ+r1)(μ+r2)α-1(μ+r2)+α-2δN,I1*=(μ+r2)(μ+rs)α-1(μ+r2)+α-2δ(R0-1)N,I2*=δ(μ+rs)α-1(μ+r2)+α-2δ(R0-1)N.Lemma 3.5.
DFEQ0 of system (3.14) is locally asymptotically stable when R0<1 and unstable when R0>1.Proof.
The characteristic equation of system (3.14) near DFE Q0 can be written as follows:
(3.17)det(-(μ+rs)-λ-α-1μμ+rs-α-2μμ+rs0α-1μ-(δ+r1+μ)(μ+rs)μ+rs-λα-2μμ+rs0δ-(μ+r2)-λ)=0.
The above equation has a negative real part characteristic root λ=-(μ+rs) and roots of
(3.18)[-(μ+rs)-λ](λ2+cλ+d)=0,
where c=μ+r2-(α-1μ/(μ+rs))+δ+μ+r1,d=(μ+r2)(δ+μ+r1)(1-R0).
It is easy to verify thatc is always positive. Obviously, when R0<1,d is positive. In accordance with the relationship between roots and coefficients of quadratic equation, there are no positive real roots of (3.18). Hence, DFE Q0 of system (3.14) is locally asymptotically stable when R0<1 and unstable when R0>1.Further, the following theorem holds.Theorem 3.6.
DFEQ0 of system (3.14) is global asymptotically stable if R0≤1.Proof.
From the first equation of system (3.14), we obtain
(3.19)S˙(t)≤μN-(μ+rs)S(t).
Thus,
(3.20)S(t)≤μNμ+rs+(S(0)-μNμ+rs)exp[-(μ+rs)t].
When t→∞, we have
(3.21)S(t)≤μμ+rsN.
Consider the Lyapunov function
(3.22)V(I1,I2)=(μ+r2)I1+μα-2μ+rsI2,
which is always positive in R+2 where R+2={(I1,I2)∈R2:I1>0,I2>0}. Moreover, in the case of system (3.14), the function satisfies
(3.23)V˙(I1,I2)=(μ+r2)(α-1I1+α-2I2)SN-(μ+r2)(μ+r1+δ)I1+μα-2δμ+rsI1-μα-2(μ+r2)μ+rsI2≤(μ+r2)(α-1I1+α-2I2)μμ+rs-(μ+r2)(μ+r1+δ)I1+μα-2δμ+rsI1-μα-2(μ+r2)μ+rsI2=μ[α-1(μ+r2)+α-2δ]-(μ+r2)(μ+r1+δ)(μ+rs)μ+rsI1=(μ+r2)(μ+r1+δ)(R0-1)I1.≤0
So, the DFE Q0 is globally attractive. Combining Lemma 3.5, we have DFE Q0 is globally asymptotically stable.Next, we will analyze the stability of virus-epidemic equilibriumQ1 of system (3.14).The characteristic equation of system (3.14) near endemic equilibrium Q1 is given by
(3.24)det(-(α-1I1*+α-2I2*)-(μ+rs)-λ-α-1S1-α-2S1α-1I1*+α-2I2*α-1S-(μ+r1+δ)α-2S10δ-(μ+r2)-λ)=0,
which corresponds to
(3.25)λ3+(g3+g5+g6-g7)λ2+(g3g5+g3g6+g5g6-g3g7-g4S*-g6g7+g1g7)λ+g3g5g6-g3g7g6-g4g6S*+g1g3g7+g4g1S*=0,
where g1=α-1I1*+α-2I2*,g2=μ+rs,g3=μ+r2,g4=α-2δ,g5=μ+r1+δ,g6=α-1I1* + α-2I2*+μ+rs,g7=α-1S*.According to Hurwitz criteria(3.26)H1=g3+g5+g6-g7=3μ+r1+r2+rs+δ+α-1I1*+α-1I2*-α-1S*>2μ+r2+rs+α-1I1*+α-1I2*>0,H2=(g3+g5+g6-g7)(g3g5+g3g6+g5g6-g3g7-g4S*-g6g7+g1g7)-(g3g5g6-g3g7g6-g4g6S*+g1g3g7+g4g1S*),H3=(g3g5g6-g3g7g6-g4g6S*+g1g3g7+g4g1S*)H2.
Hence, we can get the following theorem.Theorem 3.7.
LetR0>1. if H2>0 and H3>0 hold, then the virus-epidemic equilibrium Q1 of system (3.14) is locally asymptotically stable.


## 3.1. The Microlevel Model Analysis

In this subsection, we will solve the equilibria of system (2.4) and investigate their stability.The first two equations in system (2.4) do not depend on the third equation, and therefore this equation may be omitted without loss of generality. Hence, system (2.4) can be rewritten as
(3.1)dS^(t)dt=μ^N^-β-I^(t)S^(t)N^-(μ^+r^s)S^(t),dI^(t)dt=β-I^(t)S^(t)N^-(μ^+r^i)I^(t).
Now, we analyze system (3.1) by finding its equalibria. Steady states of system (3.1) satisfy the following equation:
(3.2)dS^(t)dt=dI^(t)dt=0.
Solving the system (3.2), we can conclude that system (3.1) always has a virus-free equilibrium (DFE) E0=(μ^N^/(μ^+r^s),0). Furthermore, define
(3.3)R^0=β-μ^(μ^+r^s)(μ^+r^i).R^0 is called the basic reproduction number. If R^0>1, then system (3.1) has a virus-epidemic equilibrium E1=(S^1,I^1)=(((μ^+r^i)/β¯)N^,(μβ--(μ^+r^s)(μ^+r^i)/β-(μ^+r^i))N^).Lemma 3.1.
DFEE0 is locally asymptotically stable when R^0<1 and unstable when R^0>1.Proof.
The characteristic equation of system (3.1) near E0 is
(3.4)det(-(μ^+r^s)-λ-β-μ^μ^+r^s0β-μ^-(r^i+μ^)(μ^+r^s)μ^+r^s-λ)=0.
Solving (3.4), we can get λ1=-(μ^+r^s),λ2=(β-μ^-(r^i+μ^)(μ^+r^s))/(μ^+r^s)≡(r^i+μ^)(R^0-1). Obviously, DFE is locally asymptotically stable when R^0<1 and unstable when R^0>1.Further, we have the following theorem.Theorem 3.2.
DFEE0 is global asymptotically stable if  R^0≤1.Proof.
Learn from the first equation of system (3.1)
(3.5)S^˙(t)≤μ^N^-(μ^+r^s)S^(t).
Thus,
(3.6)S^(t)≤μ^N^μ^+r^s+(S^(0)-μ^Nμ^+r^s)exp[-(μ^+r^s)t].
When t→∞, one can get
(3.7)S^(t)≤μ^N^μ^+r^s.
We choose Lyapunov function to be the form
(3.8)V(t)=I^(t).
The time derivative of V(t) along system (3.1) is given by
(3.9)V˙(t)=I^˙(t)=β-I^(t)S^(t)N^-(μ^+r^i)I^(t)≤[β-μ^μ^+r^s-(μ^+r^i)]I^(t)=(μ^+r^i)(R^0-1)≤0.
The theorem is proven.Next, we will analyze the stability of virus-epidemic equilibriumE1 of system (3.1).Theorem 3.3.
IfR^0>1, then the virus-epidemic equilibrium E1 of system (3.1) is locally asymptotically stable.Proof.
The characteristic equation of system (3.1) at E1 is given by
(3.10)det(-β-I^1N^-(μ^+r^s)-λ-β-S^1N^β-I^1N^β-S^1N^-(μ^+r^i)-λ)=0,
which equals
(3.11)λ2+aλ+b=0,
where a=(μ^+r^s)R^0,b=(μ^+r^s)(μ^+r^i)(R^0-1)+r^s(1-μ^). Obviously, in accordance with the relationship between roots and coefficients of quadratic equation, all eigenvalues of (3.11) have negative real parts. Thus, E1 is locally asymptotically stable when R^0>1.Theorem 3.4.
IfR^0>1, then the virus-epidemic equilibrium E1 is globally asymptotically stable.Proof.
Consider the following Lypunov function [26]
(3.12)V=∫S^1S^x-s^1xdx+∫I^1I^x-I^1xdx,
which is always positive in R+2. Moreover, the function satisfies
(3.13)V˙=S^-S^1S^S^′+I^-I^1I^I^′=(1-S^1S^)[μ^N^-β^I^S^N^-(μ^+r^s)S^]+(1-I^1I^)[β^I^S^N^-(μ^+r^i)I^]=-μ^S^S^1(S^1S^-1)2≤0.
Thus, we prove that the endemic equilibrium E1 is globally asymptotically stable.


## 3.2. The Macrolevel Model Analysis

In this subsection, we will solve the equilibria of system (2.7) and investigate their stability.The first two equations in system (2.7) do not depend on the third equation, and therefore this equation may be omitted without loss of generality. Hence, system (2.7) can be rewritten as
(3.14)dS(t)dt=μN-(α-1I1(t)+α-2I2(t))S(t)N-(μ+rs)S(t),dI1(t)dt=(α-1I1(t)+α-2I2(t))S(t)N-(μ+r1+δ)I1(t),dI2(t)dt=δI1(t)-(μ+r2)I2(t).
The equalibria of system (3.14) are determined by setting dS(t)/dt=dI1(t)/dt=dI2(t)/dt=0. There is always a virus-free equilibrium (DFE) Q0=((μ/(μ+rs))N,0,0). Furthermore, define
(3.15)R0=μ[α-1(μ+r2)+α-2δ](δ+μ+r1)(μ+rs)(μ+r2).
If R0>1, system (3.14) has a virus-epidemic equilibrium Q1=(S*,I1*,I2*), where
(3.16)S*=(δ+μ+r1)(μ+r2)α-1(μ+r2)+α-2δN,I1*=(μ+r2)(μ+rs)α-1(μ+r2)+α-2δ(R0-1)N,I2*=δ(μ+rs)α-1(μ+r2)+α-2δ(R0-1)N.Lemma 3.5.
DFEQ0 of system (3.14) is locally asymptotically stable when R0<1 and unstable when R0>1.Proof.
The characteristic equation of system (3.14) near DFE Q0 can be written as follows:
(3.17)det(-(μ+rs)-λ-α-1μμ+rs-α-2μμ+rs0α-1μ-(δ+r1+μ)(μ+rs)μ+rs-λα-2μμ+rs0δ-(μ+r2)-λ)=0.
The above equation has a negative real part characteristic root λ=-(μ+rs) and roots of
(3.18)[-(μ+rs)-λ](λ2+cλ+d)=0,
where c=μ+r2-(α-1μ/(μ+rs))+δ+μ+r1,d=(μ+r2)(δ+μ+r1)(1-R0).
It is easy to verify thatc is always positive. Obviously, when R0<1,d is positive. In accordance with the relationship between roots and coefficients of quadratic equation, there are no positive real roots of (3.18). Hence, DFE Q0 of system (3.14) is locally asymptotically stable when R0<1 and unstable when R0>1.Further, the following theorem holds.Theorem 3.6.
DFEQ0 of system (3.14) is global asymptotically stable if R0≤1.Proof.
From the first equation of system (3.14), we obtain
(3.19)S˙(t)≤μN-(μ+rs)S(t).
Thus,
(3.20)S(t)≤μNμ+rs+(S(0)-μNμ+rs)exp[-(μ+rs)t].
When t→∞, we have
(3.21)S(t)≤μμ+rsN.
Consider the Lyapunov function
(3.22)V(I1,I2)=(μ+r2)I1+μα-2μ+rsI2,
which is always positive in R+2 where R+2={(I1,I2)∈R2:I1>0,I2>0}. Moreover, in the case of system (3.14), the function satisfies
(3.23)V˙(I1,I2)=(μ+r2)(α-1I1+α-2I2)SN-(μ+r2)(μ+r1+δ)I1+μα-2δμ+rsI1-μα-2(μ+r2)μ+rsI2≤(μ+r2)(α-1I1+α-2I2)μμ+rs-(μ+r2)(μ+r1+δ)I1+μα-2δμ+rsI1-μα-2(μ+r2)μ+rsI2=μ[α-1(μ+r2)+α-2δ]-(μ+r2)(μ+r1+δ)(μ+rs)μ+rsI1=(μ+r2)(μ+r1+δ)(R0-1)I1.≤0
So, the DFE Q0 is globally attractive. Combining Lemma 3.5, we have DFE Q0 is globally asymptotically stable.Next, we will analyze the stability of virus-epidemic equilibriumQ1 of system (3.14).The characteristic equation of system (3.14) near endemic equilibrium Q1 is given by
(3.24)det(-(α-1I1*+α-2I2*)-(μ+rs)-λ-α-1S1-α-2S1α-1I1*+α-2I2*α-1S-(μ+r1+δ)α-2S10δ-(μ+r2)-λ)=0,
which corresponds to
(3.25)λ3+(g3+g5+g6-g7)λ2+(g3g5+g3g6+g5g6-g3g7-g4S*-g6g7+g1g7)λ+g3g5g6-g3g7g6-g4g6S*+g1g3g7+g4g1S*=0,
where g1=α-1I1*+α-2I2*,g2=μ+rs,g3=μ+r2,g4=α-2δ,g5=μ+r1+δ,g6=α-1I1* + α-2I2*+μ+rs,g7=α-1S*.According to Hurwitz criteria(3.26)H1=g3+g5+g6-g7=3μ+r1+r2+rs+δ+α-1I1*+α-1I2*-α-1S*>2μ+r2+rs+α-1I1*+α-1I2*>0,H2=(g3+g5+g6-g7)(g3g5+g3g6+g5g6-g3g7-g4S*-g6g7+g1g7)-(g3g5g6-g3g7g6-g4g6S*+g1g3g7+g4g1S*),H3=(g3g5g6-g3g7g6-g4g6S*+g1g3g7+g4g1S*)H2.
Hence, we can get the following theorem.Theorem 3.7.
LetR0>1. if H2>0 and H3>0 hold, then the virus-epidemic equilibrium Q1 of system (3.14) is locally asymptotically stable.


## 4. Control Strategies of P2P Botnets

Theorems3.2 and 3.6 indicate that P2P botnets will be eliminated if reasonable antivirus strategies are taken (represented by the formulations of R^0 and R0). Here, we will investigate effective methods eliminating P2P botnets by deriving the feasible region of  fand g.First, we derive the feasible region off. Substituting (2.3) into (3.3), we have
(4.1)R^0=μ^[fβ^1+(1-f)β^2](μ^+r^s)(μ^+r^i).
According to the meaning of  R^0, we can quantify the lower limit for an effective immunity f. When R^0=1, it is easy to get
(4.2)fe=(μ^+r^s)(μ^+r^i)-β^2μ^(β^1-β^2)μ^.
We define the “immune effective region” f as follows
(4.3)0≤fe<f≤1.Corollary 4.1.
If0<fe<1 and f satisfies fe<f≤1, then it is possible to eliminate botnets within P2P networks. Otherwise, if fe>1 or fe>f, then immunization can only reduce the scale of P2P botnets.Similarly, one will get the feasible region ofg. Substituting (2.6) into (3.15), one can obtain
(4.4)R0=μ{[gα11+(1-g)α12](μ+r2)+δ[gα21+(1-g)α22]}(δ+μ+r1)(μ+rs)(μ+r2).According to the meaning ofR0, one can quantify the lower limit for an effective immunization g. When R0=1, one has
(4.5)ge=(μ+r2)(μ+rs)(δ+μ+r1)-μ[(μ+r2)α12+δα22]μ[(μ+r2)(α11-α12)+δ(α21-α22)].
Define “immune effective region” g as follows. 						(4.6)0≤ge<g≤1.Corollary 4.2.
If0<ge<1 and g satisfies ge<g≤1, then it is possible to eliminate P2P botnets on Internet. Otherwise, if ge>1 or ge>g, then immunization can only reduce the scale of P2P botnets.The numerical solution offe obtained from (4.2) is plotted with different value of β1 and fixed values of μ=2.28×10-4,β2=0.8,r^s=0.0059, and r^i=0.0059 in Figure 3. Similarly, Figure 4 depicts the numerical solution of ge obtained from (4.5) with different value of α21 and fixed  values of μ=2.28×10-4,δ=0.5,rs=0.015,r1=0.0059,r2=0.0059,α12=0.5,α11=0.1, and  α22=0.7.Figure 3
The theoretical immune feasible regionf.Figure 4
The theoretical immune feasible regiong.


## 5. Numerical Simulations

To validate the accuracy offe obtained from (4.2), we simulate system (2.4) with the following parameters:  N=100000,μ=2.28E-4,β2=0.8,rs=0.0059,ri=0.0059,β1=0.1, and (i) f=0.95, where f>fe=0.9079; (ii) f=0.6, where f<fe=0.9079. Initial values are set to S(0)=99998,I(0)=10, and R(0)=0, respectively. Figures 5 and 6 show the simulation results with the above two sets of parameters, respectively, which are consistent with theoretical prediction.Figure 5
The virus propagation result whenf>fe.Figure 6
The virus propagation result whenf<fe.Similarly, we verify the accuracy ofge obtained from (4.5) by simulating system (2.7). The following parameter values are adopted:  μ=2.28E-4,α11=0.1,α12=0.5,α21=0.3,α22=0.7,  δ=0.5,rs=0.015,r1=r2=0.0059, and (i) g=0.9, where g>ge=0.7221; (ii) g=0.2, where g<ge=0.7221. Initial values are set to S(0)=99996,I1(0)=2,I2(0)=2, and R(0)=0, respectively. Simulation results in Figures 7 and 8 are consistent with theoretical prediction.Figure 7
The result of virus propagation wheng>ge.Figure 8
The result of virus propagation wheng<ge.For investigating the effect of different replacement rateμ^ on f, we depict simulation results of fe in Figure 9, in which we set μ^=1.14E-4,2.28×10-4,3.42E-4, and 4.57E-4, that is, replacement time is one year, nine months, a half year, and three months. Other parameters are the same to Figure 3.Figure 9
The effect of differentμ on fe.Similarly, for investigating the effect ofμ on g, we set μ=1.14E-4,2.28×10-4, 3.42E-4, and 4.57E-4; other parameters are the same to Figure 4. The simulation result is depicted in Figure 10.Figure 10
The effect of differentμ on ge.Figures9 and 10 reflect the fact that decreasing the replacement rate of computers can enhance the effectiveness of immunizations. This finding contributes to management and maintenance of networks at a cost-effective way.


## 6. Conclusions

As a kind of new form of botnets, P2P botnets have attracted considerable attention. In this paper, the authors explore two novel dynamical models. The first is a micro-level model which describes the dynamical behavior ofParasite P2P botnets. The Second is the macro-level model which characterizes the dynamical action of Leaching P2P botnet. Throughout the paper, we focus on the effect of immunization on dynamics of P2P botnets. Through detailed mathematical analysis, the feasible region of immunization has been derived. In addition, we simulate the feasible region of immunization by using different parameter values. Furthermore, the correctness of feasible region has been verified.The thresholds of immunizations have demonstrated that antivirus strategies have great influence on the dynamics of P2P botnets. More specifically, in feasible regions of immunizations, the spread of computer viruses will be stopped, and the botnet will be cracked. In contrary, immune measures merely decrease the scale of hosts infected by computer viruses, and the botnet will survive. In addition, our results also show that the replacement rate of computers will affect the threshold of immunizations.Our investigations can provide insight on the effectiveness of various antivirus measures (e.g., antivirus products and user education). According to the thresholds of (4.2) and (4.5), secure organizations can make cost-effective countermeasures to work well in practice. Our study is only limited to unstructured P2P networks, such as Gnutella. Taken a step further, our models are adapted to topology-independent malware, such as file-sharing worms, viruses, Trojans, and so on. In the future, we will concentrate our attentions on the propagation model of topology-aware malware.



---

*Source: 865075-2012-11-05.xml*