A Real-Time and Efficient MAC Protocol for Smart Grid Wireless Communications

Communication and information technologies play crucial roles in the smart grid system. Wireless communications offer many unique features to utilities. Real-time capability and high efficiency under heavy load are vital capabilities for smart grid wireless communications. However, the existing medium access control (MAC) protocols for low-rate and short-range wireless transfer in the literature mainly aim to achieve the objectives of low energy consumption and self-configuration and rarely address these requirements under heavy traffic intensity. This paper presents a real-time, efficient, and lightweight MAC (RE-MAC) protocol to support smart grid applications, based on priority node polling and a hybrid scheme. The upper bounds of packet delay are determined using the embedded Markov chain method, and the simulation results demonstrate that the protocol can achieve predictable, real-time, and efficient performance.


Introduction
Over the last few years, the smart grid has gained wide attention for its potential to address the challenges in the traditional power grid, such as increasing load demands, quickly aging components, domino-effect failures, renewable energy sources, and improving grid security [1,2]. Communication and information technologies play crucial roles in the smart grid system. Wireless communications offer many unique features to utilities [3,4]. For example, wireless networks can accommodate condition-monitoring applications due to their ability to work in extreme environmental conditions. Wireless technologies can be widely applied to the smart grid, including power generation, power delivery, and power utilization [5]. In contrast to wired networks, wireless networks support flexible addition and removal of devices and reduce installation costs. In addition, wireless nodes can be mounted on mobile devices and high-voltage equipment and can fulfill monitoring and control tasks [6]. In detailed scenarios, condition-monitoring of transformers, circuit breakers, and power lines in substations is a very important task, including monitoring temperature, voltage, and current.
Wireless networks make monitoring these parameters more easy and efficient. However, when domino-effect failures occur, a great deal of data emerge, and wireless networks must tolerate the heavy load and transfer information in real time.
However, many challenges must be overcome to use wireless communications in the smart grid, including network performance, suitability, and security [7]. The length of the communication delay is the most important requirement for supporting smart grid applications, and these delay requirements range from 8 ms to more than 1 s. It is difficult to satisfy the delay requirement over a wireless network even for less challenging delay requirements, such as 500 ms for phase measurement [8]. However, the efficiency of wireless communications over shared media is a key metric when processing the heavy and dynamic load in emergencies.
Medium access control (MAC) protocols play a vital role in message delay and communication efficiency characteristics. However, few MAC protocols allow for a real-time smart grid. In general, the MAC protocols of wireless networks for low-rate and short-distance applications consider the energy efficiency as an important aspect. However, higher energy efficiency typically results in a noticeable message delay.
MAC protocols for low-rate and short-distance applications can be categorized into contention-based, schedulebased, and hybrid schemes. In contention-based MAC protocols, nodes compete to acquire the channel for random access, which may result in unpredictable delays arising from collisions. To mitigate unpredictable delays, the RT-MAC protocol maximizes spatial channel reuse by avoiding the false blocking problem of RTS/CTS exchange within one source and sink node pair [9]; however, this protocol still suffers from the interference of multistream communications. The MaxMAC protocol utilizes additional wake-ups to achieve a low delay and high throughput according to the rate of incoming packets [10]. ENCO imposes an approximate value of the optimum contention window size to minimize the channel access delay [11]. QoS-MAC for IEEE 802. 15.4 implements QoS support based on the IEEE 802.15.4 unslotted carrier sense multiple access with collision avoidance (CSMA/CA) scheme by utilizing differentiated service for data traffic with different priorities. The QoS-MAC protocol is designed for smart grid distribution monitoring [12]. DRX is another MAC protocol for smart grid applications, and it is based on delay-estimation and data-prioritization steps that are performed by the application layer, in addition to the MAC layer parameters responding to the delay requirements of the smart grid application and the network condition [13]. Although many protocols based on contention can mitigate delays, it remains difficult to eliminate the effect caused by collisions.
Currently, schedule-based MAC protocols generally support deterministic delays. WRT-Ring is a distributed realtime MAC protocol and operates in the slotted virtual ring network [14]. Based on a control signal that circulates into the virtual ring and CDMA, WRT-Ring supports real-time and generic applications. Because the control signal distributes while traveling, addressing the urgent alarm transmission is complicated. Point coordination function (PCF) is one of the two medium access mechanisms in IEEE 802.11, and PCF is a polling scheme that provides a shorter delay in medium access applications than the distributed coordination function (DCF) mechanism, even under heavy loads [15]. Timedivision multiple access (TDMA) is an important schedulebased MAC protocol. A tree-based TDMA protocol, which is based on a tree topology and the TDMA scheme [16], has been designed for home area networks in the smart grid; however, TDMA-based protocols lack the flexibility to respond to fluctuations in the traffic load.
Hybrid schemes are developed to overcome the drawbacks of a single scheme by combining multiple schemes. IEEE 802.15.4 works as a hybrid of CSMA/CA and TDMA when using a superframe structure and guaranteed time slot. Because of the limited number of available slots and congestion of the contention access period under intensive data exchanges, this scheme does not appear to be applicable for high-performance, time-critical smart grid applications [17]. WirelessHART is also based on a CSMA/CA and TDMA-based hybrid scheme regarded as a paradigm shifter in the process control industry [18]. WirelessHART satisfies the strict timing requirements and high security concerns for industrial control using time synchronization, channel Device node N · · · · · · · · · · · · · · · · · · · · · · · · t n i i . . hopping, and mesh networking. However, CSMA/CA and TDMA suffer from low efficiency under heavy loads and load changes, respectively. EQ-MAC provides QoS support by combining a hybrid medium access scheme with service differentiation for cluster-based single-hop sensor networks [19]; however, it still suffers from congestion because it uses contention-based medium access for control messages. Applications for smart grid wireless communications, such as condition monitoring, must exhibit high real-time capability, high efficiency under heavy loads, and low complexity. Furthermore, the gateway nodes of such applications must have an unlimited power supply. We study the wireless medium access in this scenario and present a real-time, efficient, and lightweight MAC protocol: RE-MAC.

Lightweight, Real-Time Hybrid Scheme
A gateway node must communicate with several device nodes (the sensor and actuator nodes) for condition-monitoring applications in the smart grid. The sensor nodes send regular and urgent data to the gateway node, which then transmits control commands to the actuator nodes. These applications require real-time ability, even under heavy loads, and the gateway node is powered by an unlimited power supply. Tailored to this type of scenario, the lightweight polling scheme, priority node scheme, and hybrid MAC method form a promising hybrid scheme.
RE-MAC is a hybrid scheme of the polling scheme and TDMA. The polling scheme provides high efficiency even under high traffic, and TDMA is used to transmit emergency data during the sleeping period. First, the nodes are divided into clusters. Each cluster has one gateway node and several sensor and actuator nodes in a star topology. The gateway node has an unlimited power supply; thus, the energy consumption of wireless communications can be ignored for the gateway node. The nodes in a cluster utilize the hybrid scheme to share the channel, as shown in Figure 1. Considering the importance of the control commands and configuration data transmitted by the gateway node, the gateway node is prioritized over the other nodes and transmits data first during each polling period. Figure 2 shows a flow chart of the RE-MAC protocol. Initially, all of the device nodes turn on their radios to listen, and the gateway node begins to transmit its data, if any exist. Then, the gateway node sends a polling Device node i node i sends the device data for this node is available packet containing the length of the sleeping duration to a certain device node, such as device node in Figure 2. That node sends a reply that indicates whether it has data to be sent and, if so, the length of the data. Then, the device node sends its data, if any, and goes to sleep. If the device node has no data, it goes to sleep directly for the sleeping duration.
On the other hand, the other device nodes listen and receive the reply packet from the polled device node and obtain the length of the data to be sent by the polled device node. Thus, the other device nodes will sleep for a period that includes the data transmission period for the polled node and the sleeping duration. When the sleeping period is complete, the gateway node will poll the next device node. Each device node owns two queues, one for regular device data and the other for urgent device data. When a device node is polled to transmit data, it will send regular device data. During the sleeping period, the device node can wake up and send urgent device data to the active gateway by the TDMA (1) = 0; N = Number of device nodes; (2) if has data to transmit then (3) Transmit the data; (4) Send a polling packet containing the length of the sleeping duration to device node ; (5) Receive the reply packet of device node ; (6) if the reply packet indicates device node has data to transmit then (7) Receive the data of device node ; (8) Begin the sleeping duration (9) Receive urgent data in the slot for device node 1; (10) Receive urgent data in the slot for device node 2; (11) ⋅ ⋅ ⋅ (12) Receive urgent data in the slot for device node N; Algorithm 1: Gateway node processing of RE-MAC.
(1) Turn on the radio to listen; (2) Receive the polling packet with the sleeping duration ; (3) if the polling packet is for this device node then (4) Send the reply for the polling packet; (5) if this device node has data to transmit then (6) Transmit the data; Set the length of sleeping for this node with ; (7) Else (8) Wait to receive the reply for the polling packet; (9) Get the data length from the reply packet; (10) Set the length of sleeping for this node with and ; (11) Go to sleep (12) if this is slot for urgent data of this node then (13) Transmit urgent data; (14) End of the sleeping duration; (15) Goto Step 1; Algorithm 2: Device node processing of RE-MAC. method as shown in Figures 1 and 2. Each device node has one slot for transmitting urgent device data in each sleeping period, and these slots follow the duration of regular device data one by one, as shown in Figure 1. The device node sleeps until the slot for sending urgent device data for this node is available, and then that device node sends the urgent data, if any exist, and goes to sleep. If the device node has no urgent device data, it goes to sleep directly.
Algorithm 1 describes the gateway node processing of RE-MAC in detail. During one polling period, the gateway node will send its data first and then poll device nodes to receive the data; finally, the gateway node will receive the urgent device data by the TDMA method.
Device node processing of RE-MAC is shown as Algorithm 2. The device node will receive the polling packet and obtain the sleeping duration for the polling packet. If this node is the polled node, it will transmit its data. Otherwise, it will wait to receive the reply for the polling packet from the polled node and obtain the transmitted data length from the reply packet. Finally, the device node will send urgent data by the TDMA method.
We illustrate the RE-MAC protocol with an example. There are 10 device nodes from DN 1 to DN 10 and one gateway node, GN, in a cluster. At the beginning, all 10 of the device nodes turn on their radios to listen. GN transmits its data if any exists. Then, GN sends a polling packet containing the length of the sleeping duration 1 to DN 1. DN 1 receives the polling packet and returns a reply with the length of data 1 to be sent. If DN 1 has data to be sent, it transmits the data to GN at once. Then, DN 1 goes to sleep for 1 . The other device nodes receive the polling packet to DN 1 and the reply packet of DN 1, set the sleeping period referring to and , and then go to sleep. During the sleeping period, DN 1 to DN 10 send urgent device data to GN one by one using TDMA slots at the beginning of the sleeping period. At the end of the sleeping period, all of the device nodes wake up to listen. GN begins polling DN 2, with the same protocol as for polling DN 1. After polling DN 10, GN polls DN 1 to access the wireless channel.
In summary, there are three types of data for this RE-MAC hybrid scheme: gateway data, urgent device data, and regular device data. We utilize the priority node scheme and TDMA scheme in each sleeping period to provide realtime processing capability for the gateway node and device nodes, respectively. RE-MAC is also highly efficient for device nodes. The device nodes work under a polling scheme and TDMA; therefore, device nodes using the RE-MAC protocol gain better transmission efficiency and energy efficiency than CSMA/CA protocols, which suffer contention, especially under a heavy load. In addition, device nodes will go to sleep when there is no work to do within the polling duration, which will greatly reduce the energy consumption of device nodes and extend the life time of device nodes.

Theoretical Analysis
We analyze the performance of priority node polling for RE-MAC and then verify the theoretical results and investigate the entire protocol using simulations.
We assume that a cluster includes + 1 nodes, where one node is the gateway node and the other nodes are device (sensor and actuator) nodes. The gateway node polls device nodes in cyclic order 1, 2, . . . , , such that node is followed by node 1. Each node has two queues of the first-come-firstserve type, and the capacity of each queue is unlimited. The service of all nodes is of the gating type, namely, the node sends only those packets that were waiting in the queue when the transmission began. For the device nodes, the arriving packets of node i ( = 1, 2, . . . , ) follow a Poisson process with an arrival rate ; the service time for each node to transmit packets is independent of the other nodes with a general distribution, and the distribution function is ( ).
expresses the queue of the gateway node; the input is a Poisson process with an arrival rate ; the service time has a general distribution; and the distribution function is ( ). From node to node + 1, the polling time has a general distribution and the distribution function is ( ); the sleeping time has a negative exponential distribution; and the distribution function is ( ). ( ) and ( ) are the number of packets of node and gateway arriving within duration, respectively. In the equilibrium state, when the polling arrives at node , the probability of node ( = 1, 2, . . . , , ) having packets waiting is ( 1 , 2 , . . . , , ). We define the generation function as follows: 2 , . . . , , ) . (1) In the device nodes, assume that the instant of the start of service at one of the device nodes is . . . , , +1 , . . ., as shown in Figure 1; then ⋅ ⋅ ⋅ < < +1 < ⋅ ⋅ ⋅ . is defined as the sequence { }. Define random variables ( ) as the number of packets in node at instant and as the node identifier of the polling arriving at instant . Thus, at instant , the system state is ( , (1), (2)  The necessary and sufficient condition for existence of the equilibrium state is given by where ℎ and ℎ are the mean service time of a packet in the device node and in the gateway node, respectively. and are the traffic intensity of node and gateway, respectively. The above equation yields the equilibrium condition that the total traffic intensity must be less than one.
International Journal of Distributed Sensor Networks 5 We define ( ) as the service time of the gateway node data at any one instant , and there are packets in the gateway node. During the period from to +1 , the service time for the gateway node is ( (G)). Therefore, at instant +1 , the gateway node and device nodes own the following numbers of packets: where ( ), ( ), and ( ) are the polling time, service time, and sleeping time for device node from to +1 , respectively. When the system attains the state of statistical equilibrium, the probability distribution generation function of Pr ( + 1, +1 (1), +1 (2), . . . , +1 ( ), +1 ( )) is . . , * ( ) , . . . , , * ( )) .

(5)
In the above equation, * ( ) and * ( ) ( = 1, 2, . . . , ) are the Laplace-Stieltjes transform of the polling time and sleeping time probability distribution, respectively, when the gateway node polls from device node to + 1; * ( ) is the busy period probability distribution Laplace-Stieltjes transform of the device node queue with a Poisson input; and * ( ) is the busy period probability distribution Laplace-Stieltjes transform of the gateway node queue with a Poisson input. and are as follows: Thus, ( 1 , 2 , . . . , , ) is described in functional equation form using the recursive formula of (5); however, the explicit representation of ( 1 , 2 , . . . , , ) cannot be derived. The mean queue length in node at the start-ofservice instant at node is denoted by ( ); then, we have From (5), we obtain (1, 1, . . . , 1, 1) = as a constant when = 1, 2, . . . , . Therefore, for (5), we can perform differential operations with respect to , , and . When → 1 ( = 1, 2, . . . , , ), the following expressions are obtained: where and are the mean polling time and mean sleeping time for device node i, respectively. With the third equation in equation set (8), we obtain the expression for ( ) because The mean queue length of gateway node is Then, we can obtain the mean cyclic time of polling as cyclic = ⋅ [ + + ℎ + ℎ ( )] We ignore the radio propagation delay here because the nodes are relatively close to each other. A device node will wait for one cycle time to transmit a packet in the worst case, and thus, the mean upper bound of the device node packet delay is given by The gateway node has a higher priority than the device node, and it will have the opportunity to send packets at every service start instant. Therefore, the mean upper bound of the gateway node data packet delay is given by

Simulation Results
In this section, we present simulation results to verify the theoretical results and illustrate the advantage of the RE-MAC algorithm compared to wirelessHART and DRX.
The mean upper bounds of regular device data packet delay and gateway data packet delay are obtained from (11)- (13). To verify these analytical results, we established  the RE-MAC simulation scenario based on ns-2 as follows. Systems with five or 10 device nodes were applied. The total traffic intensity was set to the range of 0.05 to 0.80, and the step was 0.05. The data inputs of the device nodes and gateway node have symmetrical distributions, the data packet lengths are all 400 bits, the polling packet length is 32 bits, the link rate is 250 Kbps, the mean value of the sleeping time is 0.2 s, and the simulation running time is 200 s. Figure 3 illustrates that the simulation results of the mean cyclic time agree with the theoretical analysis, thus verifying that the theoretical analysis is correct. The simulation results indicate that at least 99.0063% of the packet delays satisfied the mean upper bounds of the packet delay.
We developed a wirelessHART (wHART) simulation scenario and added the urgent device data to RE-MAC and wirelessHART. The regular device data and the urgent device data utilize the contention access period slots and contention-free period slots, respectively, and the gateway data use the contention-free period for the wirelessHART simulation. In addition, we developed a DRX simulation scenario and set the delay threshold to 0.4 second for the regular device data and the gateway data. Figure 4 illustrates that the gateway data delays are all less than 200 ms when the total traffic intensity is less than 0.35, and RE-MAC, DRX, and wirelessHART all present good real-time performance. However, the gateway data delay of DRX and wirelessHART increases rapidly when the total traffic intensity is greater than 0.4 and 0.7, respectively. Figure 5 shows that the urgent device data delays are all less than 200 ms when the total traffic intensity is less than 0.35, and RE-MAC and wirelessHART both present good real-time performance. With the growth of the total traffic intensity, the urgent device data delays of RE-MAC show a slow rise; however, the data delays of DRX increase quickly when the total traffic intensity is greater than 0.4.
According to the regular device data delay results shown in Figure 6, the RE-MAC data delay slowly increases with  total traffic intensity growth, and the data delay of DRX and wirelessHART rapidly rises when the total traffic intensity is more than 0.4 and 0.5 for = 5 and = 10, respectively. RE-MAC is based on a polling scheme, and the polling scheme could provide this traffic-adaptive ability. In addition, using the priority node method and TDMA, RE-MAC exhibits better efficiency than DRX and wirelessHART under heavy load conditions.

Conclusion
This paper presented a real-time, efficient, and lightweight MAC protocol, RE-MAC, based on priority node polling and a hybrid scheme. The mean upper bounds of the gateway data packet delay and regular device data packet delay were determined. The gateway data and regular device data present outstanding real-time performance, even under heavy traffic. Additionally, the urgent messages of the device nodes can be transmitted in real time using TDMA scheduling.