**3.1 Definition of variables**

1. In any time slot, the process of information packets arriving at each station is subject to the independent and identically distributed Poisson process, and the probability generating function and mean value of its distribution in ordinary stations are *Ai*ð Þ *zi* and *λ<sup>i</sup>* ¼ *A*<sup>0</sup> ð Þ *zi* respectively. The probability generating function and mean value of the distribution of at the center site are *Ah*ð Þ*z* and *λ<sup>h</sup>* ¼ *Ah* 0 ð Þ*z* respectively.

state under the condition of P*<sup>N</sup>*

function in the steady state is defined as:

*DOI: http://dx.doi.org/10.5772/intechopen.93507*

*Research on Polling Control System in Wireless Sensor Networks*

*Gi <sup>z</sup>*1*; <sup>z</sup>*2*;* … *; zi* <sup>ð</sup> *;* … *; zN; zh*Þ ¼X<sup>∞</sup>

*Gih <sup>z</sup>*1, *<sup>z</sup>*2, <sup>⋯</sup>, *zi* <sup>ð</sup> , <sup>⋯</sup>*zN*, *zh*Þ ¼ lim*<sup>t</sup>*!<sup>∞</sup> *<sup>E</sup>* <sup>Y</sup>

*Gi*þ<sup>1</sup>ð*z*1, *<sup>z</sup>*2, <sup>⋯</sup>, *zN*, *zh*Þ ¼ lim*<sup>n</sup>*!∞*<sup>E</sup>* <sup>Y</sup>

¼ *Gih z*1, *z*2, ⋯, *zi*, ⋯, *zN*, *Bh*

Definition: The average queue length *gi*

*gi*

stored in node *j* when node *i* receives service at *tn* time.

ð Þ¼*<sup>j</sup>* lim *<sup>x</sup>*1, *<sup>x</sup>*2, *::xN*, *xh*!<sup>1</sup>

*gi* ðÞ¼ *i*

The average queue length of the central station is:

� �*Ah*ð Þ *zh* " #

system state variable is:

Y *N*

*A <sup>j</sup> z <sup>j</sup>*

*j*¼1

at *tn*þ<sup>1</sup> time is as follows:

2 4

**3.3 Average queue length**

central site is respectively:

**181**

¼ *Ri*

*x*1¼0

� *z*1 *<sup>x</sup>*<sup>1</sup> *z*<sup>2</sup>

X∞ *x*2¼0 …X<sup>∞</sup> *xi*¼0

*<sup>x</sup>*<sup>2</sup> … , *zi*

According to Eqs. (12) and (14), when the two-level polling system provides services to the central site at *tn* <sup>∗</sup> time, the probability generating function of the

*N*

*i*¼1 *z <sup>ξ</sup><sup>i</sup> <sup>n</sup>*<sup>∗</sup> ð Þ *<sup>i</sup> z*

The probability generating function of the system serving the ordinary site *i* + 1

*N*

*j*¼1 *z ξ <sup>j</sup>*ð Þ *n*þ1 *<sup>j</sup> z*

Y *N*

0 @

*A <sup>j</sup> z <sup>j</sup>*

*j*¼1

The average queue length of ordinary stations calculated by Eqs. (15)–(17) is:

*λi* P*<sup>N</sup> <sup>j</sup>*¼<sup>1</sup>*<sup>γ</sup> <sup>j</sup>*

*gih*ð Þ¼ *<sup>h</sup> <sup>λ</sup>hγ<sup>i</sup>* <sup>1</sup> � *<sup>ρ</sup><sup>h</sup>* ð Þ <sup>1</sup> � *<sup>ρ</sup><sup>h</sup>* � <sup>P</sup>*<sup>N</sup>*

When *λ*<sup>1</sup> ¼ *λ*<sup>2</sup> ¼ ⋯*λi*⋯ ¼ *λ<sup>N</sup> β*<sup>1</sup> ¼ *β*<sup>2</sup> ¼ ⋯*βi*⋯ ¼ *β<sup>N</sup> γ*<sup>1</sup> ¼ *γ*<sup>2</sup> ¼ ⋯*γi*⋯ ¼ *γN*, the system is symmetrical and the average queue length of the ordinary site and the

<sup>1</sup> � *<sup>ρ</sup><sup>h</sup>* � <sup>P</sup>*<sup>N</sup>*

� *Gi z*1, *z*2, ⋯, *zi*�1, *Bi*

*<sup>i</sup>*¼1*λiβ<sup>i</sup>* <sup>þ</sup> *<sup>λ</sup>hβ<sup>h</sup>* <sup>&</sup>lt;1, and the probability generating

X∞ *xh*¼0

*xh* �

*xi* … , *zNxN zh*

*<sup>ξ</sup><sup>h</sup> <sup>n</sup>*<sup>∗</sup> ð Þ *h*

> Y *N*

*A <sup>j</sup> z <sup>j</sup>* � � !, <sup>⋯</sup>, *zn*, *zh* " # (15)

*j*¼1

*ξh*ð Þ *n*þ1 *h*

*j*¼1

*<sup>∂</sup>G z*ð Þ 1, *<sup>z</sup>*2, <sup>⋯</sup>*zN*, *zh ∂z j*

*<sup>j</sup>*¼<sup>1</sup>*<sup>ρ</sup> <sup>j</sup>*

*<sup>j</sup>*¼<sup>1</sup>*<sup>ρ</sup> <sup>j</sup>*

*A <sup>j</sup> z <sup>j</sup>* � � !

*i*

ð Þ*j* of the system is the average packets

1 A

3 5

" #

� �*F* Y *N*

" #

½*π<sup>i</sup> x*1*; x*2*;* … *; xi* ð Þ *;* … *; xN; xh*

(14)

(16)

(17)

(18)

(19)

lim*n*!<sup>∞</sup>*<sup>P</sup> <sup>ξ</sup>i*ð Þ¼ *<sup>n</sup> xi* <sup>½</sup> ; *<sup>i</sup>* <sup>¼</sup> 1, 2, … *<sup>N</sup>*, *<sup>h</sup>*� ¼ *<sup>π</sup>i*ð Þ *<sup>x</sup>*1, *<sup>x</sup>*2, … *xi* … *xN*, *xh* (13)

… <sup>X</sup><sup>∞</sup> *xN*¼0


Define the following variables:

*ui*: the time when the server moved from the ordinary site *i* to the central site. *vi*: the service time for the server to provide gated service to the ordinary site *i*. *vh*: the service time for the server to provide exhaustive service to the central site h.

*μh*ð Þ *ui* : the number of information packets entering the central site within *ui* time.

*ηh*ð Þ *vi* : the number of information packets entering the central site within *vi* time.

*μi*ð Þ *ui* : the number of information packets entering site *i* within *ui* time.

*μ <sup>j</sup>*ð Þ *ui* : the number of information packets entering site *j* within *ui* time.

*η j* ð Þ *vi* : the number of information packets entering site *j* within *vi* time.

According to the principle of the model, the state variables of the system at each time satisfy the following relations:

$$\begin{cases} \xi\_j(n\*) = \xi\_j(n) + \mu\_j(u\_i) + \eta\_j(v\_i), j = \mathbf{1}, 2, \cdots, N, h; j \neq i \\\xi\_i(n\*) = \mu\_j(u\_i) + \eta\_i(v\_i) \\\ \xi\_j(n+1) = \xi\_j(n\*) + \eta\_j(v\_h), j = \mathbf{1}, 2, \cdots, N, h \\\ \xi\_h(n+1) = 0 \end{cases} \tag{12}$$

#### **3.2 Probability generating function**

Assuming that the storage capacity of each ordinary site and the central site is large enough, the information packets will not be lost, and the information packets will be served in the order of first-come-first-served. The system reaches a steady

**3.1 Definition of variables**

*λ<sup>h</sup>* ¼ *Ah* 0

respectively.

site h.

time.

time.

*μ j*

*η j*

**180**

stations are *Ai*ð Þ *zi* and *λ<sup>i</sup>* ¼ *A*<sup>0</sup>

ð Þ*z* respectively.

*Wireless Sensor Networks - Design, Deployment and Applications*

of the distribution are *Bi*ð Þ *zi* , *β<sup>i</sup>* ¼ *Bi*

Define the following variables:

time satisfy the following relations:

8 >>><

>>>:

*ξi*ð Þ¼ *n* ∗ *μ <sup>j</sup>*ð Þþ *ui ηi*ð Þ *vi*

*ξh*ð Þ¼ *n* þ 1 0

**3.2 Probability generating function**

1. In any time slot, the process of information packets arriving at each station is subject to the independent and identically distributed Poisson process, and the probability generating function and mean value of its distribution in ordinary

function and mean value of the distribution of at the center site are *Ah*ð Þ*z* and

2.The service time of an information packet of any site is subject to independent and identically distributed probability distribution. In the ordinary sites, the probability generating function, mean value and second-order origin moment

probability generating function, mean value and second order origin moment

3.After any ordinary station completes transmission service, the transfer time to the query center site is subject to an independent and identically distributed probability distribution, whose probability generating function, mean value

respectively. When the central site is converted to the ordinary site, the parallel control strategy is adopted, i.e., the server queries the next ordinary

*ui*: the time when the server moved from the ordinary site *i* to the central site. *vi*: the service time for the server to provide gated service to the ordinary site *i*. *vh*: the service time for the server to provide exhaustive service to the central

*μh*ð Þ *ui* : the number of information packets entering the central site within *ui*

*ηh*ð Þ *vi* : the number of information packets entering the central site within *vi*

*μi*ð Þ *ui* : the number of information packets entering site *i* within *ui* time.

ð Þ *ui* : the number of information packets entering site *j* within *ui* time.

ð Þ *vi* : the number of information packets entering site *j* within *vi* time.

According to the principle of the model, the state variables of the system at each

*ξ <sup>j</sup>*ð Þ¼ *n* ∗ *ξ <sup>j</sup>*ð Þþ *n μ <sup>j</sup>*ð Þþ *ui η <sup>j</sup>*ð Þ *vi* , *j* ¼ 1, 2, ⋯, *N*, *h*; *j* 6¼ *i*

Assuming that the storage capacity of each ordinary site and the central site is large enough, the information packets will not be lost, and the information packets will be served in the order of first-come-first-served. The system reaches a steady

*ξ <sup>j</sup>*ð Þ¼ *n* þ 1 *ξ <sup>j</sup>*ð Þþ *n* ∗ *η <sup>j</sup>*ð Þ *vh* , *j* ¼ 1, 2, ⋯, *N*, *h*

site that needs service while serving the central site, which saves the conversion time and improves the service efficiency of the system.

0

of the distribution at the center station are *Bh*ð Þ*z* , *β<sup>h</sup>* ¼ *Bh*

and second-order origin moment are *Ri*ð Þ *zi* , *γ<sup>i</sup>* ¼ *Ri*

ð Þ *zi* respectively. The probability generating

ð Þ<sup>1</sup> and *<sup>v</sup><sup>β</sup>* <sup>¼</sup> *Bi*″ð Þ<sup>1</sup> respectively. The

0

0

ð Þ<sup>1</sup> and *<sup>v</sup><sup>γ</sup>* <sup>¼</sup> *Ri*″ð Þ<sup>1</sup>

ð Þ<sup>1</sup> and *vh* <sup>¼</sup> *Bh*″ð Þ<sup>1</sup>

(12)

state under the condition of P*<sup>N</sup> <sup>i</sup>*¼1*λiβ<sup>i</sup>* <sup>þ</sup> *<sup>λ</sup>hβ<sup>h</sup>* <sup>&</sup>lt;1, and the probability generating function in the steady state is defined as:

$$\lim\_{n \to \infty} P[\xi\_i(n) = \mathbf{x}\_i; i = \mathbf{1}, \mathbf{2}, \dots N, h] = \pi\_i(\mathbf{x}\_1, \mathbf{x}\_2, \dots \mathbf{x}\_i \dots \mathbf{x}\_N, \mathbf{x}\_h) \tag{13}$$

$$\mathbf{G}\_{i}(\mathbf{z}\_{1}, \mathbf{z}\_{2}, \dots, \mathbf{z}\_{i}, \dots, \mathbf{z}\_{N}, \mathbf{z}\_{h}) = \sum\_{\mathbf{x}\_{1}=0}^{\infty} \sum\_{\mathbf{x}\_{2}=0}^{\infty} \dots \sum\_{\mathbf{x}\_{N}=0}^{\infty} \dots \sum\_{\mathbf{x}\_{N}=0}^{\infty} \sum\_{\mathbf{x}\_{h}=0}^{\infty} \left[ \pi\_{i}(\mathbf{x}\_{1}, \mathbf{x}\_{2}, \dots, \mathbf{x}\_{i}, \dots, \mathbf{x}\_{N}, \mathbf{x}\_{h}) \right] \tag{14}$$
 
$$\cdot \mathbf{z}\_{1}^{\mathbf{x}\_{1}} \mathbf{z}\_{2}^{\mathbf{x}\_{2}} \dots \mathbf{z}\_{i}^{\mathbf{x}\_{i}} \dots \mathbf{z}\_{N}^{\mathbf{x}\_{N}} \mathbf{z}\_{h}^{\mathbf{x}\_{h}} \tag{14}$$

According to Eqs. (12) and (14), when the two-level polling system provides services to the central site at *tn* <sup>∗</sup> time, the probability generating function of the system state variable is:

$$\begin{split} \operatorname{G}\_{ih}(\boldsymbol{z}\_{1}, \boldsymbol{z}\_{2}, \cdots, \boldsymbol{z}\_{i}, \cdots \boldsymbol{z}\_{N}, \boldsymbol{z}\_{h}) &= \lim\_{t \to \infty} \operatorname{E} \left[ \prod\_{i=1}^{N} \boldsymbol{z}\_{i}^{\xi\_{i}(n^{\*})} \boldsymbol{z}\_{h}^{\xi\_{h}(n^{\*})} \right] \\ = \operatorname{R}\_{i} \left[ \prod\_{j=1}^{N} A\_{j}(\boldsymbol{z}\_{j}) A\_{h}(\boldsymbol{z}\_{h}) \right] \cdot \operatorname{G}\_{i} \left[ \boldsymbol{z}\_{1}, \boldsymbol{z}\_{2}, \cdots, \boldsymbol{z}\_{i-1}, \boldsymbol{B}\_{i} \left( \prod\_{j=1}^{N} A\_{j}(\boldsymbol{z}\_{j}) \right), \cdots, \boldsymbol{z}\_{n}, \boldsymbol{z}\_{h} \right] \end{split} \tag{15}$$

The probability generating function of the system serving the ordinary site *i* + 1 at *tn*þ<sup>1</sup> time is as follows:

$$\begin{aligned} G\_{i+1}(z\_1, z\_2, \dots, z\_N, z\_h) &= \lim\_{n \to \infty} E\left[\prod\_{j=1}^N z\_j^{\xi\_j(n+1)} z\_h^{\xi\_h(n+1)}\right] \\ &= G\_{ih}\left[z\_1, z\_2, \dots, z\_i, \dots, z\_N, B\_h\left(\prod\_{j=1}^N A\_j(z\_j) F\left(\prod\_{j=1}^N A\_j(z\_j)\right)\_i\right)\right] \end{aligned} \tag{16}$$

#### **3.3 Average queue length**

Definition: The average queue length *gi* ð Þ*j* of the system is the average packets stored in node *j* when node *i* receives service at *tn* time.

$$\mathbf{g}\_i(j) = \lim\_{\mathbf{x}\_1, \mathbf{x}\_2, \dots, \mathbf{x}\_N, \mathbf{x}\_k \to 1} \frac{\partial G(\mathbf{z}\_1, \mathbf{z}\_2, \dots, \mathbf{z}\_N, \mathbf{z}\_h)}{\partial \mathbf{z}\_j} \tag{17}$$

The average queue length of ordinary stations calculated by Eqs. (15)–(17) is:

$$\mathbf{g}\_i(i) = \frac{\lambda\_i \sum\_{j=1}^{N} \mathbb{1}\_j}{\mathbf{1} - \rho\_h - \sum\_{j=1}^{N} \rho\_j} \tag{18}$$

The average queue length of the central station is:

$$\mathbf{g}\_{ih}(h) = \frac{\lambda\_h \mathbf{y}\_i (\mathbf{1} - \rho\_h)}{\mathbf{1} - \rho\_h - \sum\_{j=1}^{N} \rho\_j} \tag{19}$$

When *λ*<sup>1</sup> ¼ *λ*<sup>2</sup> ¼ ⋯*λi*⋯ ¼ *λ<sup>N</sup> β*<sup>1</sup> ¼ *β*<sup>2</sup> ¼ ⋯*βi*⋯ ¼ *β<sup>N</sup> γ*<sup>1</sup> ¼ *γ*<sup>2</sup> ¼ ⋯*γi*⋯ ¼ *γN*, the system is symmetrical and the average queue length of the ordinary site and the central site is respectively:

*Wireless Sensor Networks - Design, Deployment and Applications*

$$\mathbf{g}\_{i}(i) = \frac{N\lambda\_{i}\mathbf{y}\_{i}}{1 - \rho\_{h} - N\rho\_{i}} \tag{20}$$

*E w*ð Þ¼*<sup>i</sup>*

*gih*ð Þ *h*, *h*

The average waiting time at the central site is:

*Research on Polling Control System in Wireless Sensor Networks*

*E w*ð Þ¼ *<sup>h</sup>*

*DOI: http://dx.doi.org/10.5772/intechopen.93507*

**4. Experimental analysis**

working conditions.

distribution.

**Figure 5.**

**183**

3.The polling system satisfies P*<sup>N</sup>*

**4.1 Symmetrical two-level polling system**

1 þ *ρ<sup>i</sup>* ð Þ*gi*

<sup>2</sup>*λhgih*ð Þ *<sup>h</sup>* � <sup>1</sup> � <sup>2</sup>*ρ<sup>h</sup>* ð Þ*Ah*″ð Þ<sup>1</sup> 2*λ*<sup>2</sup>

Based on the above two-level priority polling service model, theoretical value calculation and experimental simulation are carried out according to the following

*<sup>i</sup>*¼<sup>1</sup>*λiβ<sup>i</sup>* <sup>þ</sup> *<sup>λ</sup>hβ<sup>h</sup>* <sup>¼</sup> <sup>P</sup>*<sup>N</sup>*

**Figures 5** and **6** show the change of average queue length and average waiting delay between the ordinary station and the central station with the arrival rate. It can be seen from the Figures that when the arrival rate is increasing, the average queue length and average waiting delay of information packets also increase. The queue length and delay of central station are much smaller than those of ordinary sites, which indicates that the model has strong ability to distinguish business.

**Figures 7** and **8** show the comparison between the average queue length and the

average waiting delay of the exhaustive-gated two-level polling system and the single-level gated polling system. It can be seen that in the case of the same network size, the queue length and delay of the two-level model are less than that of the

*Relationship between average queue length and arrival rate of symmetrical systems.*

1.The data communication process is ideal and the data will not be lost.

2.The data entering each station in any time slot satisfies the Poisson

2*λigi*

ð Þ *i*, *i*

*<sup>h</sup>* <sup>1</sup> � *<sup>ρ</sup><sup>h</sup>* ð Þ <sup>þ</sup>

ð Þ*<sup>i</sup>* (27)

2 1 � *<sup>ρ</sup><sup>h</sup>* ð Þ (28)

*<sup>λ</sup>hBh*″ð Þ<sup>1</sup>

*<sup>i</sup>*¼<sup>1</sup>*ρ<sup>i</sup>* <sup>þ</sup> *<sup>ρ</sup><sup>h</sup>* <sup>&</sup>lt;1.

$$\log\_{ih}(h) = \frac{\lambda\_h \chi\_i(\mathbf{1} - \rho\_h)}{\mathbf{1} - \rho\_h - N\rho\_i} \tag{21}$$

#### **3.4 Average cycle**

The average cycle of the polling system is expressed as the time interval between two consecutive visits to the same queue by the server, which is the statistical average of the time taken by the server to serve *N* + 1 sites according to the prescribed service rules. The calculation is as follows:

$$E[\theta] = \frac{\sum\_{i=1}^{N} \mathbb{Y}\_i}{1 - \rho\_h - \sum\_{i=1}^{N} \rho\_i} \tag{22}$$

#### **3.5 Second-order characteristics**

The joint moment of central site random variable *x <sup>j</sup>*, *xk* � � is defined as *gih*ð Þ *<sup>j</sup>*, *<sup>k</sup>* , and the joint moment of ordinary site random variable *x <sup>j</sup>*, *xk* � � is defined as *gi* ð Þ *j*, *k* , which is obtained by the property of probability generating function.

$$\mathbf{g}\_i(j,k) = \lim\_{\mathbf{z}\_1,\mathbf{z}\_2,\cdots,\mathbf{z}\_N,\mathbf{z}\_h \to 1} \frac{\partial^2 G\_i(\mathbf{z}\_1,\mathbf{z}\_2,\cdots,\mathbf{z}\_i,\cdots,\mathbf{z}\_N,\mathbf{z}\_h)}{\partial \mathbf{z}\_j \partial \mathbf{z}\_k} \tag{23}$$

It can be calculated from the Eqs. (15) and (23):

$$\mathbf{g}\_{i}(i,i) = \frac{\lambda\_{i}^{2}}{\sum\_{k=1}^{N} \rho\_{k} (\mathbf{1} + \rho\_{k})} \left[ \sum\_{k=1}^{N} \frac{\rho\_{k}}{\lambda\_{k}} (\mathbf{1} + \rho\_{k}) \mathbf{g}\_{k}(k,k) - \theta \sum\_{k=1}^{N} \frac{\rho\_{k}}{\lambda\_{k}} (\mathbf{1} + \rho\_{k}) A\_{k}{}^{\prime}(\mathbf{1}) \right] \tag{24}$$

$$\mathbf{g}\_{ih}(h,h) = \lambda\_h^2 \mathbf{R}\_i''(i) + \chi\_i \mathbf{A}\_h''(\mathbf{1}) + \left[2\lambda\_h^2 \beta\_i \chi\_i + \lambda\_h^2 \mathbf{B}\_i''(\mathbf{1}) + \beta\_i \mathbf{A}\_h''(\mathbf{1})\right] \mathbf{g}\_i(i,i) + \lambda\_h^2 \beta\_i^2 \mathbf{g}\_i(i,i) \tag{25}$$

When the system is symmetrical:

$$\begin{split} g\_{i}(i,i) &= \frac{N}{(1-\rho\_{h}+\rho)(1-\rho\_{h}-N\rho)} \left\{ \lambda^{2} \mathbf{R}''(\mathbf{1}) + \gamma \mathbf{A}''(\mathbf{1}) - \rho\_{h} \gamma \mathbf{A}''(\mathbf{1}) \\ &+ (N-\mathbf{1})\lambda^{2} \boldsymbol{\gamma}^{2} + \frac{\mathbf{1}}{\mathbf{1}-\rho\_{h}-N\rho} \left[ N(N+\mathbf{1}) \lambda^{2} \rho \boldsymbol{\gamma}^{2} - \rho \rho\_{h} \gamma \mathbf{A}''(\mathbf{1}) \\ &+ N\lambda^{3} \boldsymbol{\gamma} \mathbf{B}''(\mathbf{1}) + \rho \gamma \mathbf{A}''(\mathbf{1}) - (N-\mathbf{1}) \lambda^{2} \rho \rho\_{h} \boldsymbol{\gamma} + (N-\mathbf{1}) \lambda^{2} \rho \gamma \\ &+ \lambda^{2} \rho\_{h}^{2} \gamma \mathbf{A}''\_{h}(\mathbf{1}) + \lambda^{2} \lambda\_{h} \gamma \mathbf{B}''\_{h}(\mathbf{1}) - 2\lambda^{2} \rho\_{h}^{2} \gamma \right\} \end{split} \tag{26}$$

#### **3.6 Average waiting delay**

Definition: The average delay of the polling system is the time it takes for an information packet to arrive at the site until the information packet is sent. According to the approximate expressions of *gi* ð Þ *i*, *i* and *gih*ð Þ *h*, *h* calculated above, the average waiting delay can be obtained by substituting the following two expressions respectively.

The average waiting time for ordinary site is:

*Research on Polling Control System in Wireless Sensor Networks DOI: http://dx.doi.org/10.5772/intechopen.93507*

$$E(w\_i) = \frac{(1 + \rho\_i)\mathbf{g}\_i(i, i)}{2\lambda\_i \mathbf{g}\_i(i)}\tag{27}$$

The average waiting time at the central site is:

$$E(w\_h) = \frac{\mathbf{g}\_{ih}(h, h)}{2\lambda\_h \mathbf{g}\_{ih}(h)} - \frac{(\mathbf{1} - \mathbf{2}\rho\_h)A\_h''(\mathbf{1})}{2\lambda\_h^2(\mathbf{1} - \rho\_h)} + \frac{\lambda\_h B\_h''(\mathbf{1})}{2(\mathbf{1} - \rho\_h)}\tag{28}$$

#### **4. Experimental analysis**

*gi*

*Wireless Sensor Networks - Design, Deployment and Applications*

prescribed service rules. The calculation is as follows:

**3.5 Second-order characteristics**

*gi*

*i*

*<sup>k</sup>*¼<sup>1</sup>*ρ<sup>k</sup>* <sup>1</sup> <sup>þ</sup> *<sup>ρ</sup><sup>k</sup>* ð Þ

When the system is symmetrical:

<sup>þ</sup> ð Þ *<sup>N</sup>* � <sup>1</sup> *<sup>λ</sup>*<sup>2</sup>

ð Þ¼ *<sup>i</sup>; <sup>i</sup> <sup>N</sup>*

<sup>þ</sup> *<sup>N</sup>λ*<sup>3</sup>

<sup>þ</sup> *<sup>λ</sup>*<sup>2</sup> *β*2

**3.6 Average waiting delay**

expressions respectively.

**182**

*gi*

ð Þ¼ *<sup>i</sup>*, *<sup>i</sup> <sup>λ</sup>*<sup>2</sup> P

*gih*ð Þ¼ *<sup>h</sup>*, *<sup>h</sup> <sup>λ</sup>*<sup>2</sup>

*gi*

*N*

**3.4 Average cycle**

ðÞ¼ *<sup>i</sup> <sup>N</sup>λiγ<sup>i</sup>*

*gih*ð Þ¼ *<sup>h</sup> <sup>λ</sup>hγ<sup>i</sup>* <sup>1</sup> � *<sup>ρ</sup><sup>h</sup>* ð Þ

The average cycle of the polling system is expressed as the time interval between

P*<sup>N</sup> <sup>i</sup>*¼1*γ<sup>i</sup>* <sup>1</sup> � *<sup>ρ</sup><sup>h</sup>* � <sup>P</sup>*<sup>N</sup>*

*<sup>i</sup>*¼<sup>1</sup>*ρ<sup>i</sup>*

*Gi z*1, *z*2, ⋯*zi* ð Þ , ⋯*zN*, *zh ∂z <sup>j</sup>∂zk*

> X *N*

" #

*hBi*″ð Þþ <sup>1</sup> *<sup>β</sup>iAh*″ð Þ<sup>1</sup> � �*gi*

*N N*ð Þ <sup>þ</sup> <sup>1</sup> *<sup>λ</sup>*<sup>2</sup>

*ρ*2 *hγ* �� *βk λk*

*k*¼1

*<sup>R</sup>*″ð Þþ <sup>1</sup> *<sup>γ</sup>A*″ð Þ� <sup>1</sup> *<sup>ρ</sup>hγA*″ð Þ<sup>1</sup> �

*ργ*<sup>2</sup> � *ρρhγA*″ð Þ<sup>1</sup> �

*ρρh<sup>γ</sup>* <sup>þ</sup> ð Þ *<sup>N</sup>* � <sup>1</sup> *<sup>λ</sup>*<sup>2</sup>

two consecutive visits to the same queue by the server, which is the statistical average of the time taken by the server to serve *N* + 1 sites according to the

*E*½ �¼ *θ*

The joint moment of central site random variable *x <sup>j</sup>*, *xk*

which is obtained by the property of probability generating function.

*∂*2

1 þ *ρ<sup>k</sup>* ð Þ*gk*ð*k*, *k*Þ � *θ*

*λ*2

1 1 � *ρ<sup>h</sup>* � *Nρ*

*<sup>λ</sup>hγB*″*<sup>h</sup>*ð Þ� <sup>1</sup> <sup>2</sup>*λ*<sup>2</sup>

Definition: The average delay of the polling system is the time it takes for an

information packet to arrive at the site until the information packet is sent.

the average waiting delay can be obtained by substituting the following two

*<sup>γ</sup>B*″ð Þþ <sup>1</sup> *ργA*″ð Þ� <sup>1</sup> ð Þ *<sup>N</sup>* � <sup>1</sup> *<sup>λ</sup>*<sup>2</sup>

*<sup>h</sup>βiγ<sup>i</sup>* <sup>þ</sup> *<sup>λ</sup>*<sup>2</sup>

and the joint moment of ordinary site random variable *x <sup>j</sup>*, *xk*

ð Þ¼ *<sup>j</sup>*, *<sup>k</sup>* lim *<sup>z</sup>*1, *<sup>z</sup>*2, <sup>⋯</sup>*zN*, *zh*!<sup>1</sup>

X *N*

*βk λk*

*k*¼1

*hRi*″ðÞþ*<sup>i</sup> <sup>γ</sup>iAh*″ð Þþ <sup>1</sup> <sup>2</sup>*λ*<sup>2</sup>

ð Þ 1 � *ρ<sup>h</sup>* þ *ρ* ð Þ 1 � *ρ<sup>h</sup>* � *Nρ*

*<sup>h</sup>γA*″*<sup>h</sup>*ð Þþ <sup>1</sup> *<sup>λ</sup>*<sup>2</sup>

According to the approximate expressions of *gi*

The average waiting time for ordinary site is:

*<sup>γ</sup>*<sup>2</sup> <sup>þ</sup>

It can be calculated from the Eqs. (15) and (23):

1 � *ρ<sup>h</sup>* � *Nρ<sup>i</sup>*

1 � *ρ<sup>h</sup>* � *Nρ<sup>i</sup>*

(20)

(21)

(22)

ð Þ *j*, *k* ,

(23)

(24)

(26)

� � is defined as *gih*ð Þ *<sup>j</sup>*, *<sup>k</sup>* ,

� � is defined as *gi*

<sup>1</sup> <sup>þ</sup> *<sup>ρ</sup><sup>k</sup>* ð Þ*Ak*″ð Þ<sup>1</sup>

ð Þþ *<sup>i</sup>*, *<sup>i</sup> <sup>λ</sup>*<sup>2</sup>

*ργ*

ð Þ *i*, *i* and *gih*ð Þ *h*, *h* calculated above,

*hβ*2 *i gi* ð Þ *i*, *i* (25)

Based on the above two-level priority polling service model, theoretical value calculation and experimental simulation are carried out according to the following working conditions.


#### **4.1 Symmetrical two-level polling system**

**Figures 5** and **6** show the change of average queue length and average waiting delay between the ordinary station and the central station with the arrival rate. It can be seen from the Figures that when the arrival rate is increasing, the average queue length and average waiting delay of information packets also increase. The queue length and delay of central station are much smaller than those of ordinary sites, which indicates that the model has strong ability to distinguish business.

**Figures 7** and **8** show the comparison between the average queue length and the average waiting delay of the exhaustive-gated two-level polling system and the single-level gated polling system. It can be seen that in the case of the same network size, the queue length and delay of the two-level model are less than that of the

**Figure 5.** *Relationship between average queue length and arrival rate of symmetrical systems.*

**Figure 6.** *Relationship between average waiting delay and arrival rate of symmetric systems.*

**Figure 7.** *Comparison of average queue length of two polling systems.*

single-level model. It shows that the model not only distinguishes different priority business, but also optimizes the queue length and delay of ordinary sites, and improves the quality of service of the polling system.

the priority of the polling system is well distinguished. In addition, the growth rate of the average queue length of the central station of 1 to h and 2 to h is relatively small compared with other sites. The main reason is that the arrival rate of each queue is different, which is consistent with the theoretical analysis. It can be seen from Eq. (19) that the queue length of the central station is directly proportional to the arrival rate, so when the arrival rate of the two stations is small, the impact on

*Relationship between average queue length and service time of ordinary sites in asymmetric systems.*

As can be seen from **Figures 11** and **12**, when the number of cycles selected is large, the theoretical value of the average waiting time is consistent with the experimental value. For the same system, when the service time of the system increases, the average waiting time also increases accordingly. In the case of the same load, the average waiting time of the central site is less than that of the ordinary sites, which indicates that it is effective to distinguish the business priority by using the mixed polling service mode. The performance of the system has been optimized as a

the queue length of the central station is small.

*Comparison of average waiting delay of two polling systems.*

*Research on Polling Control System in Wireless Sensor Networks*

*DOI: http://dx.doi.org/10.5772/intechopen.93507*

whole.

**185**

**Figure 9.**

**Figure 8.**

#### **4.2 Asymmetric two-level polling system**

In WSNs, different stations handle different business, and the arrival rate of information packets, service time and polling conversion time are also different. To distinguish the business of different sites, an asymmetric two-level polling system is used to provide services. The performance analysis of the asymmetric system is shown below.

As can be seen in **Figures 9** and **10**, the average queue length of the ordinary sites and the central site is obviously affected by the service time, and the queue length increases with the service time. Similarly, the average queue length of the two stations with different priorities has a great difference, which shows that *Research on Polling Control System in Wireless Sensor Networks DOI: http://dx.doi.org/10.5772/intechopen.93507*

**Figure 9.** *Relationship between average queue length and service time of ordinary sites in asymmetric systems.*

the priority of the polling system is well distinguished. In addition, the growth rate of the average queue length of the central station of 1 to h and 2 to h is relatively small compared with other sites. The main reason is that the arrival rate of each queue is different, which is consistent with the theoretical analysis. It can be seen from Eq. (19) that the queue length of the central station is directly proportional to the arrival rate, so when the arrival rate of the two stations is small, the impact on the queue length of the central station is small.

As can be seen from **Figures 11** and **12**, when the number of cycles selected is large, the theoretical value of the average waiting time is consistent with the experimental value. For the same system, when the service time of the system increases, the average waiting time also increases accordingly. In the case of the same load, the average waiting time of the central site is less than that of the ordinary sites, which indicates that it is effective to distinguish the business priority by using the mixed polling service mode. The performance of the system has been optimized as a whole.

single-level model. It shows that the model not only distinguishes different priority business, but also optimizes the queue length and delay of ordinary sites, and

In WSNs, different stations handle different business, and the arrival rate of information packets, service time and polling conversion time are also different. To distinguish the business of different sites, an asymmetric two-level polling system is used to provide services. The performance analysis of the asymmetric system is

As can be seen in **Figures 9** and **10**, the average queue length of the ordinary sites and the central site is obviously affected by the service time, and the queue length increases with the service time. Similarly, the average queue length of the two stations with different priorities has a great difference, which shows that

improves the quality of service of the polling system.

*Relationship between average waiting delay and arrival rate of symmetric systems.*

*Wireless Sensor Networks - Design, Deployment and Applications*

**4.2 Asymmetric two-level polling system**

*Comparison of average queue length of two polling systems.*

shown below.

**184**

**Figure 7.**

**Figure 6.**

**Table 1** shows the comparison of the average queue length and average delay (ordinary sites) between different models and the model proposed in this chapter, where the system is assumed to be symmetrical. It can be seen that whether compared with the single-level models or the other two-level models, the average queue length and delay of users in this model are smaller. It shows that the model proposed in this chapter not only distinguishes different priority business, but also has

**Single-level exhaustive**

ð Þ*i E w*½ � *gi*

0.01 0.0555 2.9467 0.0546 2.3211 0.0465 1.8293 0.0416 1.8024 0.02 0.1249 3.508 0.1206 2.7340 0.1075 2.2556 0.0960 2.2030 0.03 0.2143 4.2232 0.2018 3.2375 0.1736 2.7979 0.1611 2.6721 0.04 0.3342 5.1808 0.3071 3.9326 0.2517 3.4716 0.2453 3.3598 0.05 0.5013 6.5171 0.4482 4.8729 0.3723 4.6839 0.3600 4.2734

**The model of literature [15]**

ð Þ*i E w*½ � *gi*

**Two levels of exhaustive-gated**

ð Þ*i E w*½ �

In this book chapter, we adopt a prioritized polling system which combines exhaustive service with gated service, i.e., gated service is used in ordinary sites with low priority, and exhaustive service is used at central sites with high priority. Then a two-level priority service model is constructed by using the service mechanism of parallel pattern. The average queue length and average waiting delay of the service model are accurately analyzed by using embedded Markov chain and probability generating function, and verified by simulation experiments. The results show that the system can distinguish the business with different priorities, the average queue length and average waiting delay of users are lower, and the quality

This work was supported by the National Natural Science Foundation of China

better performance.

**Arrival rate (***λ***) Single-level**

*gi*

*DOI: http://dx.doi.org/10.5772/intechopen.93507*

**gated**

ð Þ*i E w*½ � *gi*

*Research on Polling Control System in Wireless Sensor Networks*

*Comparison of queue length and delay of three models (N* ¼ 5, *β* ¼ 2, *γ* ¼ 1*).*

of service of the system is higher.

under Grant No. 61461054 and No. 61461053.

**Acknowledgements**

**187**

**5. Conclusion**

**Table 1.**

**Figure 10.**

*Relationship between average queue length and service time of central site in asymmetric systems.*

**Figure 11.** *Relationship between average waiting delay and service time of ordinary sites in asymmetric systems.*

**Figure 12.** *Relationship between average waiting delay and service time of central site in asymmetric systems.*


*Research on Polling Control System in Wireless Sensor Networks DOI: http://dx.doi.org/10.5772/intechopen.93507*

**Table 1.**

**Figure 10.**

**Figure 11.**

**Figure 12.**

**186**

*Relationship between average queue length and service time of central site in asymmetric systems.*

*Wireless Sensor Networks - Design, Deployment and Applications*

*Relationship between average waiting delay and service time of ordinary sites in asymmetric systems.*

*Relationship between average waiting delay and service time of central site in asymmetric systems.*

*Comparison of queue length and delay of three models (N* ¼ 5, *β* ¼ 2, *γ* ¼ 1*).*

**Table 1** shows the comparison of the average queue length and average delay (ordinary sites) between different models and the model proposed in this chapter, where the system is assumed to be symmetrical. It can be seen that whether compared with the single-level models or the other two-level models, the average queue length and delay of users in this model are smaller. It shows that the model proposed in this chapter not only distinguishes different priority business, but also has better performance.
