QoS Model of WSNs Communication in Smart Distribution Grid

This paper presents an integrated modeling method providing superior Quality of Service (QoS) for wireless sensor networks (WSNs) which is suitable for smart distribution grid (SDG) communication. Traditional QoS model based on IEEE802.15.4 protocol cannot meet the communication requirements of multipriority data in smart distribution grid. In order to meet the specification of power system communication, a new QoS-enabled medium access control (MAC) model based on unfair competition channel access mechanism (UCCAM) is developed in this paper. The proposed model can ensure that the communication system of WSN provides different Qualities of Service for different priority data. According to different requirements for the communication time, the data of SDG are divided into three types: high priority, middle priority, and low priority data. The state transition of buffering queue data in node is described by a three-dimensional Markov chain model. Delay time, effective throughput rate, and channel collision rate models are developed, respectively, to evaluate communication performance of WSN applied in smart distribution grid. The simulation results show that the proposed model can provide different Qualities of Service for different priority data and is more efficient than the IEEE802.15.4e standard and the traditional methods.


Introduction
Smart grid can be regarded as a power system that uses two-way communication and information technology to realize power generation, delivery, and consumption, where real-time monitoring, advanced sensing, communication, analysis, and control are integrated and applied to ensure the safety, reliability, and efficiency of the power system [1]. Therefore, obtaining real-time and reliable information is a key factor to ensure stable delivery of power energy from the generation units to the end users in the smart grid [2].
Many core technologies need to be developed to enable the features of smart grid. Among them, one critical technology is real-time monitoring and control of power system [3][4][5]. Because of low power consumption, fast self-organization, and superior cooperation characteristics, WSNs have extensive application prospects in remote monitoring of equipment, fault diagnosis, and remote wireless meter reading [6][7][8][9][10].
Sensor Network Design for a Secure National Electric Energy Infrastructure sponsored by National Science Foundation, USA, Integrating the Physical with the Digital World of the Network in the Future sponsored by European Seventh Framework Programme, and Researches on Wireless Sensor Networks in Power Grid Communication sponsored by National Natural Science Foundation of China have all conducted research on the application of wireless sensor network in power system since 2004. In 2010, "NIST Framework and Roadmap for Smart Grid Interoperability Standards" listed IEEE802.15.4 as one of recommended standards. According to IEEE802.15.4 standard, communication data stored in buffer queue of node have the same priority and obey first come first serve rule [11]. In fact, communication data have different requirements for communication time according to the power system specification, where they are divided into three types: the data requiring shorter communication time, the data requiring longer time to complete communication process, and the data having not any requirement for communication time [12,13]. If communication data are sent according to rules based on IEEE802.15.4 standard, it may induce the data requiring shorter communication time to wait for a longer time which exceeds the upper limit 2 International Journal of Distributed Sensor Networks of transmission time specified by power system standard. Thus, IEEE802.15.4 protocol cannot meet the requirement of SDG communication and directly be applied to this field. In order to meet the different requirements of transmission time for different types of communication data, a new QoS-MAC model based on unfair competition channel access mechanism is developed and the following aspects need to be noticed in this paper: (1) Remote communication, remote adjustment, remote control, and telemetry data are divided into three types: high priority, middle priority, and low priority in accordance with different requirements of communication time.
(2) According to the Markov chain model, the probabilities that node sends different priority data are expressed, respectively. The probability is also expressed for WSN with nodes, where 0 nodes send the high priority data, 1 nodes send the middle priority data, 2 nodes send the low priority data, and 3 nodes have no data to be sent.
(3) According to different requirements for communication time, MAC layer channel access model based on unfair competition protocol is developed and the proposed model can ensure that data with higher requirement of communication time possess higher ability to occupy channel and interrupt communication process of the data with lower requirement of communication time.
The problem for WSNs applied in SDG communication is how to establish the MAC-QoS model based on unfair competition channel access mechanism and to ensure that all the data can be transmitted effectively when WSN is unsaturated state and higher priority data can maintain good communication quality when WSN is under saturated or supersaturated states. The rest of this paper is organized as follows: some related works are summarized in Section 2 and the proposed scheme design is elaborated in Sections 3 and 4 showing the simulation results and analysis. Conclusion of the paper with open issues is in Section 5.

Related Works
Research on QoS model of WSN applied in SDG communication is an active area. This point has been witnessed from the extensive literatures on this subject since Ye et al. proposed the classic S-MAC protocol [14], where S-MAC protocol uses periodic sleep-wake mechanism by dividing the time axis into periodic fixed length and making the same node within the cluster maintain the same time scheduling. A self-adaptive sleep S-MAC protocol is proposed in which the adjustable short sleep mechanism is used to replace the fixed short sleep mechanism [15]. In order to effectively shorten the waking time, Polastre et al. propose asynchronous B-MAC protocol based on carrier detection, where the protocol uses idle channel assessment technology for channel ruling without sharing scheduling information [16]. Z-MAC protocol which combines CSMA and TDMA access mechanisms is proposed, where CSMA channel access mode is used to improve the channel utilization rate and reduce time delay under low flow condition, and TDMA channel access mode is used to reduce the conflict and cross talk under high flow condition [17]. According to the priority and weight, Q-MAC protocol based on QoS protocol of multipriority data is first proposed, where data are selected from a plurality of priority queues within the nodes [18]. An improved QoS-MAC protocol is proposed for multimedia sensor networks, where the transmission time delay in multimedia data communication is optimized by adjusting the listen-sleep time and contention window time periodically according to the main type of communication data in the network [19]. A PQ-MAC protocol which can provide different QoS services for different priority data is proposed, in which the proposed protocol provides double protection mechanisms which can significantly reduce transmission time delay of the high priority data between nodes [20]. The T-MAC protocol can adjust time for activities according to the dynamic network communication flows [21]. A medium access control scheme based on coordinated and adaptive wake-up mechanism is proposed, where an improved technique is used to reduce energy consumption and message overhead rates [22]. In order to utilize the burst nature of the communication for the WSN to prevent energy waste through advertisements and reservations for data slots, literature [23] combines the advantages of contention-based and TDMA-based protocols to form distributed advertisement-based TDMA protocol (ATMA), where contention-based protocol employs static or variable duty cycles to minimize energy dissipated in idle listening and TDMA-based protocol uses reservation and scheduling to minimize energy loss.
In order to promote flexibility of network communication to adapt to traffic and topology changes, ER-MAC protocol is designed as a hybrid of the TDMA and CSMA approaches, where the proposed method can guarantee fairness over the packet's sources and offer a synchronized and loose slot structure to allow nodes to join or leave the communication network [24].
In literatures [14][15][16], periodic sleep easily causes the accumulation of communication delay time and is not suitable for SDG communication which requires higher real-time transmission. In [17][18][19][20][21], the algorithms based on QoS optimization and using channel competition access for multipriority data cannot completely solve the random delay problem of channel access. In [22], the ahead sleeping problem affects communication property of WSN because of asymmetric communication. In [23], the ATMA only considers energy loss, where requirements of real time and reliability are ignored. In [24], leaving of nodes may cause congestion and loss of communication packets. From above analysis, all the protocols cannot provide perfect QoS-MAC model for different priority data in smart distribution grid communication.
The QoS algorithm based on multipriority data is proposed, where the SDG communication data are divided into two types: real-time data and non-real-time data [25]. However, communication data actually need to be divided into 3.1. Scheduling Model of Multipriority Data. According to the communication standard of power system, the communication data are divided into four types: remote communication, telemetry, remote control, and remote adjustment [12,13]. Requirements of delay time and correct rate are listed in Table 1 for four types of communication data. From Table 1, we learn that delay time of remote communication data is the shortest among four types of data and it is no more than 10 ms; remote control and remote adjustment data have the same requirements for communication time and they cannot exceed 20 ms to complete communication process; telemetry data has no requirement for communication time.
In traditional 802.15.4 standard, MAC layer supposes two types of channel access ways including slotted CSMA-CA channel access mechanism and unslotted CSMA-CA channel access mechanism, where all the communication data have the same priority and fair opportunity to use channel and obey first come first serve rule.
Communication standard of power system stipulates that the data with higher demand of communication time should be transmitted first and the data with lower demand of communication time should be serviced at last, whether WSN is under unsaturated or saturated state. Therefore, the traditional QoS-MAC model based on 802.15.4 standard cannot provide service of classified transmission for different types of communication data. Moreover, the channel access mechanism based on fair competition cannot ensure that all the data are transmitted effectively even if WSN is unsaturated state.
In general, the activity in which data disorderly occupy channel easily induces uncertainty of the communication delay between neighbor nodes. If IEEE802.15.4 protocol cannot be improved, the uncertainty of delay time may induce serious consequences; for example, (1) decreases opportunity to send higher priority data and efficiency of power generation and transmission. What is more serious is that if channel is always occupied by lower priority data, some important data are lost and some important operations for smart distribution grid cannot be carried out in time. (2) The disordered competition may induce two types of data always colliding with each other and the other data cannot obtain an opportunity to use channel. Data loss is just one part of the puzzle; the other part is that the collision increases possibilities of channel congestion and network congestion, which may cause distribution grid to separate itself from the main grid, malfunction of power system happens, and large area blackout occurs which results in serious trouble and economic loss.
Thus, it is very important to improve the QoS MAC model based on 802.15.4 standard and realize classified transmission for different types of communication data in smart distribution grid.
Before the QoS MAC model is established, the communication data of smart distribution grid need to be reclassified. According to requirements of communication time, remote communication, remote control (remote adjustment), and telemetry data can be expressed as high priority, middle priority, and low priority data in accordance with different requirements of communication time, respectively. Thus, research on SDG communication can be converted to study feature of WSN communication and the conversion makes it more convenient to analyze scheduling model of data, calculate the probabilities nodes, send different types of data, and analyze the performance of WSN. In the following sections, remote communication, remote control (remote adjustment), and telemetry data are replaced with high priority, middle priority, and low priority data, respectively.
In order to guarantee that the communication data can be sent according to their priorities and positions in the queue, the following tasks need to be completed. The first step is to classify communication data into three types: high priority, middle priority, and low priority data, where three types of data are stored in their respective buffer queues. The second step is to sort the same priority data in the buffering queue according to length of their remaining effective time to accomplish data transmission.
Based on the above two steps, the problem of disordered competition for multipriority data can completely be solved. However, traditional IEEE802.15.4 standard cannot, by itself, solve the problems of communication data ordination and classification according to length of their remaining effective time.
In order to accomplish data transmission based on different requirements of communication time, high priority,  middle priority, and low priority data must obey the following rules during communication process of data transmission.
Rule 1. High priority, middle priority, and low priority data are stored in corresponding buffering queues and the positions that data belong to the same priority are arranged according to remaining effective time to accomplish communication process. It means, in the same priority queue, data with the shortest remaining time are sent first and data with the longest remaining time are finally sent.

Rule 2.
High priority data use the shortest fixed back-off time and the most back-off times among three types of data; middle priority data use shorter fixed back-off time and more back-off times than low priority data in Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA) channel competition access mechanism. Low priority data adopts random back-off time and the least back-off times which are stipulated by the IEEE802.15.4 standard.

Rule 3.
In the Clear Channel Assessment (CCA) channel detection of CSMA/CA, channel detection time must meet the requirements: the node sending high priority data should be set as the shortest channel detection time; the node sending middle priority data should be set as longer channel detection time than the sum of the fixed back-off time and the CCA channel detection time of node sending high priority data; the node sending low priority data should be set as the longest channel detection time which is longer than total sum of the back-off time and the channel detection time of nodes sending high priority data and middle priority data. According to above three rules, the architecture of MAC model based UCCAM is established and shown in Figure 1, where it is used to describe process that three types of priority data occupy channel and obtain an opportunity to use channel. From Figure 1, we know that high priority data have more opportunities to use channel than middle priority and low data. Low priority data have the least opportunity to use channel among three types of communication data. Middle priority and low priority data have no opportunity to be sent as long as there are the high priority data in queue. Even if higher priority data does not exist, low priority data have no opportunity to be sent, as long as there are middle priority data in data queue. According to MAC model based on UCCAM, we can further establish scheduling model of multipriority data shown in Figure 2. From Figure 2, we can know that collected data in local node and received data from neighbor nodes are initially disordered, where they obey first come first serve rule and are usually sent according to their positions in buffering queue. After adjustment of the queue scheduling model, data are rearranged in a certain order and sent according to types and remaining effective time, where the uncertainty of delay time is eliminated or decreased distinctly. By using scheduling model, higher priority data possess the higher priority to occupy channel and the ability to interrupt communication process, in which channel sends lower priority data. Thus, the queue scheduling model can improve the transmission efficiency and transmission reliability of the communication data for WSN applied in smart distribution grid whether communication network is unsaturated or saturated state.

QoS Modeling of WSNs Communication System.
In this section, the MAC-QoS modeling is discussed for WSN communication system based on the scheduling model of multipriority data. Consider a general wireless sensor network with one coordinator node and terminal/routing nodes, where all nodes affect the usage of the wireless channels and every node can communicate with any other nodes. States of buffering queue data always change, because nodes of WSN constantly receive and send data. The Markov chain is a stochastic process with the Markov property. It can thus be used to describe systems that follow a chain of linked events, where what happens in next state depends only on the current state of the system. In smart distribution grid, the data generation rate and traffic rate have the Markov property. From [12], there are different traffic rates in SDG communication, such as 0.6 kpbs, 1.2 kpbs, 2.4 kpbs, 4.8 kpbs, 9.6 kpbs, and 19.2 kpbs. So, change of traffic rate is exponential function. Thus, Markov chain model can be used to describe transition process of data states in node.
The transition process and the related probabilities can be expressed and calculated with the help of Markov chain model shown in Figure 3. In Figure 3, state ( 0, 1, 2) 1 k0, 0, 0 k0, 0, 1 k0, 0, n k0, 0, k2 k0, 1, 0 k0, 1, 1 k0, 1, n k0, 1, k2 k0, k1, 0 k0, k1, 1 k0, k1, n k0, k1, k2 1, 0, 0 1, 0, 1 1, 0, n 1, 0, k2 0, k1, 0 0, k1, 1 0, k1, n 0, k1, k2 represents that there are 0 high priority, 1 middle priority, and 2 low priority data packets in buffering queue of the node. 0 , 1 , and 2 , respectively, represent the production rates of the high priority, middle priority, and low priority data, respectively. 0 , 1 , and 2 , respectively, represent the traffic rates of the high priority, middle priority, and low priority data. 0, 1, and 2, respectively, represent maximum quantities of high priority, middle priority, and low priority data in buffering queue of the node. From Figure 3, we know that quantities of middle priority and low priority data can only increase or remain unchanged but not reduce when there are high priority data in the buffering queue. That is to say, when 0 > 0, 1 and 2 can only increase or remain unchanged not reduce, until 0 = 0. When there are only middle priority data and low priority data in the buffering queue, quantity of low priority data can only increase or remain unchanged.
Suppose 0, 1, 2 represents the probability of the state ( 0, 1, 2), which is only related to former and latter states of buffering queue in the node. When there are no high priority data in buffering queue ( 0 = 0), 0, 1, 2 can be described as  ] . (1) The first term of right hand side of (1) represents states which are associated with states of left hand side and the second term of right hand side of (1) represents influence degree to states of left hand side. When the number of high priority data is 6 International Journal of Distributed Sensor Networks larger than zero and less than the upper bound 0, all the expressions of 0, 1, 2 can be described as   ] . (2) The first term of right hand side of (2) represents states which are associated with states of left hand side and the second term of right hand side of (2) represents influence degree to states of left hand side. When the number of high priority data reaches the upper bound 0, all the expressions of 0, 1, 2 can be described as  ] . (3) The first term of right hand side of (3) represents states which are associated with states of left hand side and the second term of right hand side of (3) represents influence degree to states of left hand side. Notice that values of the index notations including 0, 1, and 2 in right hand sides of (1)-(3) should be coincident with the left hand sides. For example, according to (1), we can deduce Because 1 = 0 and 2 = 0 in the left hand side of (4), 1 and 2 in the right hand side of equation should be replaced with zero, respectively. Thus, (4) can be simplified as From all the expressions related to 0, 1, 2 , we know that there are altogether four situations that may occur in one node: high priority data are sent, middle priority data are sent, low priority data are sent, or there are no data to be sent.
Probabilities of four situations can be expressed by 0 , 1 , 2 , and 3 , respectively, and they can further be described as For the WSN with nodes, any one node maybe sends the low priority data, the middle priority data, or high priority data. Of course, it is likely that there are no data to be sent at current moment. When the total number of possible combinations is considered, probability of the state where 0 nodes send the high priority data, 1 nodes send the middle priority data, 2 nodes send the low priority data, and 3 nodes send no data can be described as where = 0 + 1 + 2 + 3.

Mathematical Model of Wireless Channel Competition among Adjacent Nodes.
In WSNs, the current moment state of communication channel is related to the previous moment channel state. Therefore, calculating the probability channel keeps idle at the current time; previous moment state should be considered. Stipulate that represents probability channel which keeps idle at the current moment and it can be written as where / / / represents probabilities that channel is idle at the current moment under the premise that channel is idle/busy at the previous moment. Suppose that the average transmission time of data packet in node is . / is reciprocal relationship with and it can be described as Substituting (9) into (8) and considering / = 1 − / , can be obtained International Journal of Distributed Sensor Networks 7 According to (10), the probability that different priority data detect that channel is idle can be described as where = 0, 1, 2. Notice that / ( = 0, 1, 2) represents the probability that different priority data detect the channel which keeps idle during two continuous time units and it is equal to the probability that the remaining nodes have no opportunity to occupy channel. According to definition of conditional probability, the probability of high priority data detecting the channel which keeps idle during two continuous time units can be defined as ratio between the probabilities that some nodes transmit high priority data and they do not occupy the channel and probabilities that are high priority data are sent in the transmission channel. For the given 0, 1, and 2, the probability of high priority data detecting the channel which keeps idle during two continuous time units can be described as where 0 represents the probabilities that there are high priority data which are transmitted. 0 , 1 , and 2 represent that probabilities channel is occupied by high priority data, middle priority data, and low priority data. When considering all the possible values for 0, 1, and 2, 0 / can further be rewritten as Similarly, 1 / and 2 / can be described as where 1 and 2 represent the probabilities that nodes send middle priority and low priority data. Combining (7) and considering all the possible values for 0, 1, and 2, 0 , 1 , and 2 can, respectively, further be expressed as In (13a)-(13c), ( = 0, 1, 2) mainly consists of two parts: one probability is that node occupies channel at current time under the premise that node obtains the opportunity to use channel and transmit corresponding priority data at the previous moment; the other one is that node obtains the opportunity to use channel and transmits corresponding priority data at current time under the premise that node has no opportunity to use channel and transmit corresponding priority data at the previous moment.
For different priority data, the probability that data packets obtain channel after back-off times can be expressed as (1 − ) ⋅ ( = 0, 1, 2). Stipulate that ( = 0, 1, 2) represents the maximum back-off times of different priority data packets; ( = 0, 1, 2) represents the average transmission time of different priority data packets; ( = 0, 1, 2) represents the channel detection time of different priority data packets.
The time that node obtains the opportunity to use channel and transmit corresponding priority data after back-off times can be described as ∑ =0 ( + ) + , which is a reciprocal relationship to the transmission rate of the corresponding data packets. For given , the first part can be described as ((1 − ) ⋅ ⋅ ( + 1))/(∑ =0 ( + ) + ), which represents that node occupies channel at current time under the premise that node obtains the opportunity to use channel and transmit corresponding priority data at the previous moment. When considering all the possible values for , the first part can be described as ∑ −1 =0 (((1 − ) ⋅ ⋅ ( + 1))/(∑ =0 ( + ) + )). Similarly, the second part can further be described as ((1 − ) ⋅ )/ ∑ −1 =0 ( + ), which represents that node obtains the opportunity to use channel and transmit corresponding priority data at current time under the premise that node has no opportunity to use channel and transmit corresponding priority data at the previous moment. Therefore, can be described as where = 0, 1, 2.
Consumption of data transmission time mainly includes CSMA-CA back-off and transmission time in MAC layer protocol based on IEEE802.15.4 standard. When calculating data transmission time, two cases need to be considered. One is that node obtains opportunity to send corresponding priority data; the other one is that node has no opportunity to send corresponding priority data. From above analysis, we know that [∑ =0 ( + ) + ] represents waiting time that nodes sending different priority data obtain opportunity to use communication channel before the back-off times arriving at the maximum value . Taking into account the occurrence probability for the situation, the waiting time that nodes sending different priority data obtain opportunity to use communication channel before the back-off times arriving at the maximum value can be described as  . When all the possible values are considered for , the waiting time that nodes sending different priority data obtain opportunity to use communication channel before the back-off times arriving at the maximum value can further be described as Similarly, the waiting time that node has no chance to send corresponding priority data before the back-off times arriving at the maximum value can be described as (1 − ) ⋅ ∑ −1 =0 ( + ). Thus, the average time that nodes send different priority data packets can be expressed as Notice that all the parameters and variables, respectively, belong to high priority, middle priority, and low priority data when takes 0, 1, and 2 from (11) to (16).

The Model of WSN in SDG Communication.
In WSN with nodes, each node affects communication qualities of other ones during the process of data transmission. These effects mainly include delay time, effective throughput rate, and channel collision rate.

Mathematical
Model of Delay Time. The transmission delay time 0 of high priority data in the WSN for SDG communication mainly includes the waiting and transmitting time of data in high priority buffering queue. 0 can be described as 0 ⋅ 0 and it is only related to 0 quantity of high priority data in buffering queue for a given state. However, the position of existing high priority data in buffering queue needs to be considered when calculating 0 .
0⋅ 0 is only one of all possible situations. For given 0, 1, and 2, 0 can be described as When all the possible values are considered for 0, 1, and 2, 0 can be rewritten as The transmission delay time 1 of middle priority data in the WSN of SDG communication has similar form and can be described as The first term of the right hand side of (19) represents transmission delay time of the high priority data including high priority buffering queue at the current moment, and newly generated ones during the process that node sends high priority and middle priority data, where 1/(1 − 0 ⋅ 0 ) represents influence coefficient of newly generated high priority data. The second term of the right hand side of the equation represents the waiting and transmission time of data in middle priority buffering queue. In (19), 1 is not only related to quantity and the position of existing middle priority data in buffering queue, but also related to existing high priority data in buffering queue and newly generated ones including collected data in local node and received data from neighbor nodes.
The transmission delay time 2 of low priority data in the WSN of SDG communication can be described as The first term of the right hand side of (20) represents transmission delay time of the high priority data including high priority buffering queue and newly generated ones during the process that node sends low priority, middle priority, and high priority data. The second term of the right hand side of (20) represents transmission delay time of the middle priority data including middle priority buffering queue and newly generated ones during the process that node sends high, middle, and low priority data, where 1/(1 − 0 ⋅ 0 ) and 1/(1− 1 ⋅ 1 ), respectively, represents influence coefficients of newly generated high priority and middle priority data. The third term of the right hand side of (20) represents waiting and transmitting time of data in low priority buffering queue. From (20), we can know that 2 is not only related with quantity and the position of existing low priority data in buffering queue, but also related to existing high priority and middle data in buffering queue and newly generated ones.

Mathematical Model of Effective Throughput
Rate. In (11), represents probabilities of different priority data detecting that channel is idle. Thus, 1 − represents probabilities of different priority data detecting that the channel is busy. And ⋅ [1 − (1 − ) ] ⋅ can be regarded as bytes that different priority data are sent successfully. 1/ can be regarded as traffic rate. Considering all the possible values for 0, 1, and 2, the throughput rate for different priority data packets can be rewritten as where ( = 0, 1, 2) represents the length of different priority data packets.
In the WSN for SDG communication, we usually use the effective throughput rate to describe the ratio between throughput amount of effective transmission data and total output data, and it is one of the important indicators to measure whether the transmission performance of WSN is excellent or not. The effective throughput rate is more direct to describe the successful rate of data transmission than throughput rate.
Throughput effective rate by which node sends different priority data packets can be described as where represents the number of WSN nodes and represents the total production rate of single node for different priority data. Notice that all the parameters and variables, respectively, belong to high priority, middle priority, and low priority data when takes 0, 1, and 2 in (21) and (22).

Mathematical Model of Collision Rate.
In the WSN, there are generally multiple nodes to seize one channel, which causes occurrence of collision among communication data and transmission failure because some data cannot obtain physical channel before back-off times reaching maximum value.
According to the definition of , we know that 1 − represents the probability of different priority data detecting that the channel is busy and it also represents probability of different priority data that do not occupy channel when backoff times add one.
We can use collision rate to describe failure probability of data transmission, where some data cannot obtain physical channel before back-off times reaching maximum value . Based on above analysis, collision rates of WSN for different priority data can be described as where = 0, 1, 2. Notice that all the parameters and variables, respectively, belong to high, middle, and low priority data when takes 0, 1, and 2 in (23).

The Model of WSN in SDG Communication.
Because there are multiple variables from (13a) to (13c), it is difficult to obtain the solutions by solving equations directly. Therefore, an iterative algorithm is adopted to replace scheme solving the multivariate equations directly. There is a certain error between actual result and one of iterative algorithm. However, we can compensate for the deficiency of the iterative algorithm by setting the error accuracy. If the error between calculation results for two consecutive time units is less than the specified value, we think the solutions of the multivariate equations are obtained. The proposed algorithm is shown in Algorithm 1.
There are two states for change bit rate traffic of low priority and middle priority data according to functional specification of distribution automation system.
The whole simulation mainly includes two parts: the first part is to validate that the proposed mode can provide different QoS for different priority data and the second part is to compare the performance of the proposed QoS mode to IEEE802.15.4e standard and literature [24]. The reason is that literature [24] published in 2013 represents one of the latest findings and IEEE802.15.4e can provide a wide range of industrial applications because of low power operation and high reliability.
In order to realize that different priority data have different types of priorities to use channel, a multiqueue priority policy is established and it is implemented by the queuing manager module as described in Algorithm 2. Three separate queues are used to store packets from the high priority queue to low one. The high priority queue, HQ, is used by high priority packets, the middle priority queue, MQ, is used by middle priority packets, and the low priority queue, LQ, is used by low packets.
To validate the performance of our proposed QoS model, we have evaluated it through extensive simulations with Matlab/Simulink. Each value of simulation results is the average of sixteen measurements with a 95 percent of confidence interval for output waveforms, where the average of sixteen measurements can be considered as a mathematical expectation and the standard variance is replaced by the sample variance. symbols, and 1 = 10 symbol. The back-off time 2 of low priority data takes random value which is between two and four. The maximum back-off times 0 , 1 , and 2 are set as 10, 6, and 3, respectively. Stipulate that individual packet of high, middle, and low priority data have the same length, 0 = 1 = 2 = 92 bytes.
Traffic rates and production rates are set according to functional specification of distribution automation system in [12].
For the second part of simulation, the following four cases are investigated: case (iv), low production rate where communication network is in an unsaturated state and there are only low priority data in communication network.
Case (v) is low production rate where communication network is in an unsaturated state and there are low priority and middle priority data in communication network.
Case (vi) is moderate production rate where communication network is in saturated state and there are three types of priority data in communication network.
Case (vii) is high production rate where communication network is in supersaturated state and three are three types of priority data in communication network.
The remaining parameters have the same value with the first part of simulation.

Simulation
Results. The performance evaluation of the proposed QoS mode is illustrated in Figures 4-6 for case (i), case (ii), and case (iii), respectively. Figure 4 shows that all the communication data can be transmitted effectively, where communication data rarely have the opportunity to collide with each other and do not need to waste too much time to wait for transmission because communication network is in an unsaturated state.
From Figures 4(a)-4(c), the delay times of three types of priority data begin to increase with growth of 1 and 2 . Delay times of three types of priority data are less than 6.5 ms when 0 , 1 , and 2 simultaneously reach 4.8 kbps. However, the maximum delay time of high priority is less than ones of middle priority and low priority data, and the maximum delay time of low priority data is the longest among three types of priority data. From Figures 4(d)-4(f),   Figure 5: Results of performance evaluation using proposed QoS mode for case (ii): (a) delay time of high priority data, (b) delay time of middle priority data, (c) delay time of low priority data, (d) collision rate of high priority data, (e) collision rate of middle priority data, (f) collision rate of low priority data, (g) effective throughput rate of high priority data, (h) effective throughput rate of middle priority data, and (i) effective throughput rate of low priority data. collision rates of three types of priority data are close to zero initially. When 1 and 2 suddenly increase from 2.4 kbps to 4.8 kbps, collision rates of three types of priority data have a sharp increase. But the maximum collision rate of high priority is less than ones of middle priority and low priority data, and collision rate of low priority data is the highest among three types of priority data. From Figures 4(g)-4(h), initially effective throughput rates of three types of priority data are close to 1. When 1 and 2 simultaneously increase to 4.8 kbps, effective throughput rate of high priority data almost remains unchanged; there is a slight decrease for effective throughput rate of middle priority data; and effective throughput rate of low priority data falls from 0.94 to around 0.91. Therefore, the proposed model can provide different QoS for different priority data in case (i), where WSN is in an unsaturated state.
Simulation results are shown in Figure 5 for case (ii), where WSN is in the saturated state. There are two stages in this experiment. During the first stage, 1 and 2 gradually increase from 0.6 kbps to 4.8 kbps, which can be regarded as the normal operation of smart distribution grid. 1 and 2 suddenly increase from 4.8 kbps to 9.6 kbps in the second stage, which represents that there are some faults in power system.
Comparing Figure 5 to Figure 4, delay time of three types of priority data increases as the production rates of three types of priority data increase. There are different increasing degrees for three types of priority data in case (ii). Delay time of high priority data increases to around 6.3 ms. However, delay time of middle priority and low priority data increases from 5.5 ms to 32 ms and from 6.4 ms to 36 ms, respectively. The delay time of high priority data is the shortest among three types of priority data, and the delay time of low priority data is longer than ones of middle priority data. Results show that communication speed of high priority data is quicker than ones of middle priority and low priority data. Collision rates of three types of priority data continually increase with growth of 1 and 2 in case (ii), where the collision rate of high priority data is far less than ones of low and middle priority data. The collision rate of middle priority data reaches 0.23 and the collision rate of low priority data reaches around 0.33, when 1 and 2 simultaneously increase to 9.6 kbps. Results show that high priority data hardly have opportunity to collide with each other or with low and middle priority data.
High priority data maintains a high effective throughput rate and its value exceeds 0.95, even if the production rates of low priority, middle priority, and high priority data simultaneously reach to 9.6 kbps. However, effective throughput rates of low and middle priority data fall to 0.7 and 0.63, respectively, when 1 and 2 suddenly increase from 4.8 kbps to 9.6 kbps. Results show that the high priority data are almost sent effectively. Some low and middle priority data are discarded during communication period.
From simulation results of the case (ii), we can know that the proposed model can provide different QoS for different priority data when the WSN is in saturated state.
Simulation results are shown in Figure 6 for case (iii). In this experiment, network communication of WSN is in the supersaturated state. In case (iii), delay time of high priority data almost remains unchanged and only increases from 6.2 ms to 7.1 ms; delay time of middle priority data has obvious augmentation and its value increases to 41 ms; delay time of low priority data increases sharply from 32 ms to 57 ms when 0 = 19.2 kbps; 1 and 2 increase from 4.8 kbps to 9.6 kbps simultaneously.
The maximum collision rate of high priority data remains rather low value and is around 0.11, but ones of middle  priority and low priority data, respectively, exceed 0.32 and 0.53 when production rates of three types of priority data simultaneously reach the maximum values. Results show that collision probability of high priority data is far lower than ones of low and middle priority data. Effective throughput rate of high priority data still exceeds 0.9. However, minimum effective throughput rates of middle priority and low priority fall to 0.5 and about 0.3, respectively. From simulation results of the case (iii), the proposed model can provide different QoS for different types of data, even if the WSN is in supersaturated state.
Therefore, the proposed QoS model can provide different QoS for different priority data in any case.
The proposed model can ensure that all the data are effectively transmitted when WSN is unsaturated state and the higher priority data are transmitted first and the lower  priority data are serviced at last, when WSN is under supersaturated or saturated state.
In the second part of simulation, the comparative results of three different methods including the proposed model, IEEE802.15.4e standard, and the hybrid MAC model mentioned in [24] are analyzed and illustrated.
Simulation results are shown in Figure 7 for case (iv). When production rate of data grows, all the average delay  time for three algorithms increases in Figure 7(a). The average delay times of proposed method increase to around 4.8 ms and are less than the hybrid MAC protocols. The average delay time of IEEE802.15.4e standard is shortest among three methods.
In Figure 7(b), the variation of collision rate with growth of 2 is shown. Before 2 reaches 9.6 kbps, collision rates of three different methods maintain zero, because there are only a small amount of data in the network, where they hardly have an opportunity to collide with each other. After 2 suddenly reaches 19.6 kbps, collision rates of three protocols begin to increase. Collision rate of the proposed method is lower than the hybrid MAC protocol and higher than IEEE802.15.4e standard.
In Figure 7(c), effective throughput rates of three methods have little change before 2 reaches 9.6 kbps.  reaches 9.6 kbps, all the effective throughput rates of three protocols begin to increase with sudden increase of 2 . The effective throughput rate of IEEE802.15.4e standard is the highest and one of the hybrid MAC protocols is the lowest among three methods in case (iv).
In the case (iv), the simulation results including average delay, collision rate, and effective throughput rate show that the proposed method has the better performance than the hybrid MAC protocol and lower performance than IEEE802.15.4e standard when there is only one type of data in the queue of node where WSN is in an unsaturated state.
The reason is that there is only one type of communication data in the communication network and advantage of the proposed model cannot be displayed and IEEE802. 15.4e standard has a routing advantage than the proposed model. Simulation results are shown in Figure 8 for case (v), where the total production rates remain unchanged, but the types of data are increased. From Figure 8(a), we know that delay time of three methods keeps increasing as production rates of middle priority and low priority data increase. Delay time of the proposed model is the shortest among three methods and less than 5 ms. In Figure 8(b), collision rate of the proposed model is the lowest among three methods and is around 0.02 when 1 and 2 simultaneously reach 9.6 kbps. In Figure 8(c), the effective throughput rate of the proposed model is the highest among three methods and more than 0.99. Effective throughput rates of hybrid MAC protocol and IEEE802.15.4e standard l fall to 0.97 and 0.985 when 1 and 2 simultaneously reach 9.6 kbps. The proposed model has the better performance than the other two methods in case (v). The advantage of IEEE802.15.4e standard decreases as the type of transmission data increases.
Simulation results are shown in Figure 9 for case (vi), where there are three types of priority data in WSN. The delay time of three protocols increases with the growth of 22 International Journal of Distributed Sensor Networks production rate and type of data further in Figure 9(a). The average delay time of proposed method increases to around 11 ms and less than ones of the other two methods, when 0 , 1 , and 2 reach to 9.6 kbps simultaneously. In Figure 9(b), the collision rate of proposed method almost increases to around 0.15 and is still the lowest among three protocols. In Figure 9(c), effective throughput rate of proposed method only falls to about 0.85 and still keeps the maximum value among three protocols, when 0 , 1 , and 2 simultaneously increase to maximum values.
In case (vii), production rate of high priority data increases further to 19.2 kbps, where WSN is under supersaturated state. Simulation results are shown in Figure 10 for case (vii). In Figure 10(a), average delay time of the proposed model increases to around 15 ms and is still lower than ones of IEEE802.15.4e standard and hybrid MAC protocol. In Figure 10(b), the collision rate of proposed method almost increases to around 0.35. However, the collision rates of IEEE802.15.4e standard and hybrid MAC protocol increase to 0.52 and 0.7, when the production rates of three types of data simultaneously increase to maximum value.
In Figure 10(c), effective throughput rate of proposed method falls to around 0.62 and is far higher than ones of IEEE802.15.4e standard and hybrid MAC protocol.
Successful sending rates of the proposed model are shown in Figure 11, where output waveforms with a 95 percent of confidence interval are used to describe the stabilities of communication for high priority, middle priority, and low priority data for case (vi) and case (vii).
Comparing Figures 11(a), 11(b), and 11(c), we know that successful sending rates of high priority data are higher than ones of middle priority and low priority data. Successful sending rates of low priority data are the lowest among three types of data in case (vi) and case (vii).
From simulation results for case (iv), case (v), case (vi), and case (vii), we can know that advantage of the proposed model is more and more obvious with growth of the type of data and production rate.

Concluding Remarks
In this paper, a MAC-QoS model of WSN communication system based on IEEE802.15.4 protocol is developed to support SDG communication where the proposed model can provide different QoS for different communication data studied. The main contributions include the following: (1) Remote communication, remote adjustment, remote control, and telemetry data are divided into three types: high priority data, middle priority, and low priority data according to difference of the communication time. The state transitions among high priority data, middle priority data, and low priority data in buffering queue of node are built by Markov chain model.
(2) To solve uncertainty of transmission time delay induced by channel fair access mechanism which leads to disordered channel competition among different priority data, the QoS-MAC protocol based on UCCAM to realize transmission of multipriority data is proposed. Moreover, any extra communication overhead is not added in the proposed model.
(3) The mathematical models including the time delay, the channel collision rate, and the effective throughout rate for the WSN applied in SDG communication are constructed to measure the transmission feature of the proposed model. The simulation results show that the proposed mathematical model can provide different transmission services for different priority data in SDG communication in any case.
(4) We cannot realize evaluating performance of the proposed model by network emulator. In the next work, we are further going to improve our model and evaluate performance of the improved QoS mode by NS-3 simulator or QualNet simulator.