Scalable Cyber-Physical Testbed for Cybersecurity Evaluation of Synchrophasors in Power Systems
Abstract
This paper presents a real-time cyber-physical (CPS) testbed for power systems with different real attack scenarios on the synchrophasors-phasor measurement units (PMU). The testbed focuses on real-time cyber-security emulation with components including a digital real-time simulator, virtual machines (VM), a communication network emulator, and a package manipulation tool. The script-based VM deployment and the software-defined network emulation facilitate a highly-scalable cyber-physical testbed, which enables emulations of a real power system under different attack scenarios such as Address Resolution Protocol (ARP) poisoning attack, Man In The Middle (MITM) attack, False Data Injection Attack (FDIA), and Eavesdropping Attack. The common synchrophasor, IEEE C37.118.2 named pySynphasor has been implemented and analyzed for its security vulnerabilities. The paper also presented an interactive framework of injecting false data into a realistic system utilizing the pySynphasor module. The framework can dissect and reconstruct the C37.118.2 packets, which expands the potential of testing and developing PMU-based systems and their security in detail and benefits the power industry and academia. A case for the demonstration of the FDIA attack on the linear state estimation together with the bad-data detection procedure are presented as an example of the testbed capability.
Index Terms:
Synchrophasor, IEEE C37.118, micro-PMU, Testbed, Smartgrid, Cyber-Physical Testbed, Scapy, Attacks in Grid, FDIA, MITM,I Introduction
The power system is the most extensive interconnected machine made by humans. Modern civilization entirely depends upon electricity. Therefore, any compromise or disturbance of the power system significantly impacts the economy. Hence, real-time monitoring plays a vital role in modern cyber-physical power system[1]. Synchrophasor technology opens a new horizon in power systems by collecting real-time GPS time-stamped current and voltage phasors. A typical synchrophasor technology consists of Phasor Measurement Units(PMU), Phasor Data Concentrator(PDC), communication network, and control center[2].
State estimation is a mathematical tool to compute the current states of the network based on redundant noisy measurements introduced by Fred Schweppe in 1968[3]. Three types of state estimation are commonly used in power systems: AC state estimation, DC state estimation, and linear state estimation. AC state estimation involves finding the buses’ complex voltage by iteratively solving the Weighted Least Square(WSL) optimization problem. So, it is computationally very intensive because of the iterative solution mechanism.
Linear state estimation reduces the computation complexity of AC state estimation by utilizing synchrophasor technology. PMU is an integral part of synchrophasor technology which directly measures current and voltage phasors employing GPS as reference time. PDC receives data from multiple PMUs and then aggregates data based on GSP timestamp[2]. IEEE standard C37.244-2013[4] suggested two communication protocols such as IEEE C37.118.2-2011 and IEC 61850-90-5 for PMU and PDC communication. However, IEEE C37.118.2 became the de-facto communication protocol for synchrophasor communication because of its compact packet size and low bandwidth requirement[5].
The transmission system is primarily balanced, so PMUs built for the transmission system are single phases. PMUs that are used in transmission is not suitable for distribution system due to the cost and technical constraints. Also, distribution systems have many different features, including radial topology, high resistance to reactance ratio, and three-phase unbalanced system[6]. Therefore, PMU was developed, focusing distribution system. It is a high precision synchrophasor device with comparatively low cost that works well in distribution system[7].
Modern power system primarily uses Open System Interconnection (OSI) protocols to communicate with all the control and measurement devices. Making the protocol works flawlessly rather than focusing on security was the only concern at the time of designing these protocols. As a result, many vulnerabilities of these standard protocols, such as man in the middle attack using the vulnerability of ARP cache poisoning and through ICMP packet manipulation [8] , have been enlisted and documented up to date. Moreover, the technology lifetime for cyber-physical power system is around 15-20 years, whereas conventional IT infrastructure changes within 3-5 years[9]. As a result, the power system communication infrastructure is more vulnerable to attack.
Almost any system is vulnerable to attack. OpenSSH project was designed from the ground up with security as the primary concern. Every line of code was written with security as the top priority, and countless developers audited the changes daily. After all these efforts, a project like OpenSSH has a remotely exploitable vulnerability. Now, it is easy to imagine the condition of other systems which were not designed, focusing the security as the primary concern rather than making the system fully functional was the main focus.
Many types of cyber-attack in power systems are listed in the paper[5]. A few attacks already observed are Command manipulation, Code manipulation, malware injection, GPS spoofing, false data injection, denial of service, fuzzing, rouge node, and channel jamming. Still, there might be zero-day attacks. False Data Injection Attack (FDIA) is one of the major attacks on modern power systems where adversary craft fully injects malicious data into the system to compromise a part of the system or whole network. 2015 Ukraine blackout is the real implication of FDIA attack on large scale power system[10]. The attacker used BlackEnergy Version 3 malware to access the system and injected false command, which trips seven 110kV and 233kV substation breakers, resulting in blackout for more than 225k people for 6+ hours[2].
Many widely used major communication protocols have vulnerabilities. Few vulnerabilities of the IEEE C37.118 protocol has been enlisted in the paper[11]; Authentication attack, establishing PMU and PDC communication without any authentication; MITM attack, involves hijacking session, altering, dropping and injecting C37.118.2 packets; Reply attack, involves recording packet and reply it multiple times to hide the real scenario; DoS attack, involves overwhelming target by high speed bulk packets which result in communication loss of PMU, PDC and control center. GPS spoofing attack on the PMU device has been presented in the paper[12]. Unlike military GSP, the civilian GSP signal can be predicted by a low-cost GPS receiver, so it is easy to forge the matched version of the corresponding GPS signal by the attacker. Finally data tampering attack on C37.118.2 protocol has been presented in [13], [14].
The testing of new applications must be done in environments that can characterize both the physical system and the cyber network due to the interconnected nature of the physical and cyber components. Testbeds are used to run strict and reproducible tests to verify new controls and applications and, most importantly, to find out security vulnerabilities. It is vital to understand how an attacker crafts different tools and vulnerabilities to perform a successful attack. Honeypot is the one way to study the attacks. It is used to analyze and learn new malware and generate anti-virus signatures. A low-interaction honeypot for detecting unauthorized traffic for the distribution system has been presented in the paper[15]. The problem with the low-interaction honeypot is that it emulates a small amount of internet protocols and services. For this reason, there is a tension between scalability and fidelity in a honeypot-based intrusion detection system. So, the testbed plays a vital role in this case as it exactly mimics the real system. Hence, fidelity and scalability can both be controlled.
The author in paper[16] designed a testbed in a co-simulation environment for DER focusing on power system performance, security trade-offs, network segmentation, and encryption. The author in the paper[17] investigated on DNP3 for the case of MITM attack in emulation environments. They utilized Scapy extension of DNP3 developed in the paper[18] to design the attack. The testbed paper[19] demonstrated how a hacker could develop a custom-made tool for performing a stealthy MITM attack against a synchrophasor device. Researchers in[20] developed a modular architecture utilizing software-defined network, virtual machine, and pyPMU[21] to monitor data acquisition and closed-loop control in a wide area network. A hardware-based testbed was presented in[22] to develop an intrusion detection system. The testbed was modeled using a real-time digital simulator (RTDS), relays, PMU, PDC, and PC running a Snort intrusion detection system. In the paper[19], the authors developed a testbed scenario for attacking synchrophasor communication. They used Scapy to implement the MITM attack and a custom python script to pack and unpack the IEEE C37.118.2 packets. They have also developed the testbed based on a microgrid scenario with a single PMU device and implemented a management server in Raspberry Pi. The survey paper[23] on smart grid listed a comprehensive review of different aspects of the smart grid, including physical power infrastructure, communication network, security and privacy, smart grid protocol, and cloud computing. A Fuss testing platform was developed in Queen’s University cybersecurity testbed[24] using RTDS, actual IEDs, and merging units for testing IEC 61850 protocol.
It is obvious to understand the significance of testbed in studying power systems holistically. Yet, the majority of testbeds mentioned before were designed to evaluate and verify specific tasks. These testbeds are not practically scalable. Also, these testbeds focus on conventional SCADA-based systems. Moreover, only a few testbed[19, 20, 22] experimented on the IEEE C37.118.2 protocol and synchrophasor technology. However, these testbeds are unsuitable for large system deployment and vulnerability testing of synchrophasor technology. In addition, there are no open-source tools for analyzing the IEEE C37.118 protocol in python, according to our knowledge from literature reviews. Therefore, an emerging need for an IEEE C37.118 open-source tool that can perform different types of vulnerability testing, injection testing, and eavesdropping, false data injection attack on the phasor measurements.
This research will demonstrate scalable cyber-physical system design in a simulation environment using different open-source tools like CORE network emulation, VirtualBox, Scapy, Vagrant, and Scapy. We will also demonstrate how to emulate cyber faults on a synchrophasor-based cyber-physical system. So the main contribution of this research goes to
-
1.
Designing a scalable cyber-physical distribution system that incorporates designing the physical layer, cyber layer, an attacker layer employing different tools like Opal-RT, VirtualBox, Vagrant and CORE network emulator, Scapy, NetfilterQueue, and pyPMU.
-
2.
Implementation of the open-source python module named pySynphasor for IEEE C37.118 protocol on top of Scapy Framework. pySynphasor can dissect and build IEEE C37.118 packet just by a few lines of commands.
-
3.
Demonstration of different cyber attacks such as MITM, FDIA, FCIA, and Eavesdropping in the developed testbed by leveraging pySynphasor.
-
4.
Development of python-based simple PDC module named pyPDC capable of collecting and aggregating data from multiple PMUs.
We will also present linear state estimation-based attack detection techniques for FDIA, enabling the industry stakeholders and researchers to test similar MITM attacks on real systems and find the best detection technique for real scenarios.
II Method
The electric power system is intrinsically a cyber-physical system (CPS), with power flowing in the physical system and information flowing in the cyber network. Therefore, A cyber-physical power system testbed equipped with cyber and physical layers is extremely important for studying the cyber and physical faults in a simulated environment. Due to the enormous nature of the power system, a highly scalable testbed can ideally mimic the real power system with different scenarios. The victim and attacker’s points of view must be considered while designing a smart-grid testbed. The victim’s point of view consists of designing the physical, cyber, and detection layers. The attacker’s point of view consists of designing different attack scenarios on the communication protocols and understanding the network topology to implement attacks effectively. Figure 1 depicts the designed testbed representing both the victim and attacker’s points of view. Therefore, the testbed consists of three layers. (I) Physical Layer (II) Cyber Layer and (III) Attack Layer. The Physical layer consists of IEEE 13-Node Test Feeder, PMU, control center with PDC, and linear state estimation with bad data detection technique. The cyber layer connects all the equipment utilizing a software-defined emulated network. Finally, the attack layer demonstrates deploying different cyber faults in a real system. The attacker layer also demonstrates how to implement FDIA attacks utilizing different vulnerabilities in the smart grid.
II-A Physical Layer Design
The state of a power system can be expressed by the complex voltages of all buses[7]. State-estimation involves solving the network Quasi-Static model to find the states utilizing the digital and analog measurements from the system[25]. Power system measurement data can be expressed with relation to the system states and measurement error .
(1) |
Here, subscript represents the meter and is the measurement function which expresses the relationship between measurements and state, . For AC state estimation, this function is non-linear, requiring an iterative method like Newton-Raphson. On the other hand, this function is linear in the linear state estimation problem. As a result, the solution can be obtained just by matrix multiplication.
A Weighted Least Square(WLS) optimization problem can be formulated to solve this problem. By minimizing , we effectively choose that best ”fits” the measurements.
(2) |
Here, represents the variance of the meter measurement. For linear state estimation, both of the equation can be written in matrix form:
(3) |
(4) |
Here, and The optimization problem can be solved by first order optimal condition. So, the estimated value of can be obtained by [2, 7]
(5) |
Linear state estimate is just a matrix multiplication with contrast to AC state estimation but we need to build the matrix from system network[25].
Here represents voltage measurement bus incident matrix, current measurement bus incident matrix, represents series admittance matrix, shunt admittance matrix. These matrices were formed following the instruction from thesis[26].
One of the main goals of state estimation is to find out the bad meter measurements and eliminate that measurements. As the state estimation problem is intrinsically over-determined, there are more measurements than the state. So, bad measurements can be eliminated. For linear state estimation, the presence of bad data detection problem can be formulated as follows[27]:
(6) |
follows the Chi-Square distribution, . Here, , is known as degree of freedom, where, Number of total measurements and , Number of total states [28]. The presence of bad data can be estimated by checking the condition if , No bad data in the system. , else, Bad data exists. Threshold value, can be obtained from the Chi-Square table utilizing the degree of freedom(d.f) and meter accuracy, .
After detecting the presence of bad data in the measurement, it is also possible to identify the bad or poisoned meter by hypothesis testing.
(7) |
if , it identifies that meter measurement is bad. The same method that is used for bad meter detection can also be utilized to detect false data injection attack on meter measurements.
II-B Design the IEEE 13-Node Test Feeder
We developed the testbed focusing on the IEEE 13 Node test feeder, a three-phase unbalanced distribution system operating in 4.16kV[29]. The distribution system is designed in MATLAB Simulink and deployed in Opal-RT real-time simulator. Placing the PMU is an optimization problem to minimize the number of PMUs. The paper [7] identified the minimum number of PMUs for IEEE 13 node test feeder. Following that, we placed 5 PMUs in nodes 2, 3, 5, 9, and 10. These 5 PMUs measure voltage at five buses and current at nine lines in a total of 13 voltages and 20 current measurements for three phases. One phase is considered in the case of a transmission system due to its balanced nature. However, due to the unbalance in phases, the distribution system poses another challenge. The authors in paper[7] demonstrated that the three-phase unbalanced system could be decoupled into three-state estimation problems and possibly calculated by parallel computing. Figure 2 demonstrates the PMU placement with current and voltage measurements. The red diamond indicates the complex voltage measurements, and the green arrow indicates the complex current measurements. The yellow dashed border indicates the PMU—a single PMU measures multiple complex voltages and multiple line currents. We also added standard normal distributed noise with the simulated PMU measurements to mimic the real behavior.
(8) | ||||
Here, represents the generated noise utilizing the standard normal distribution function , variance and mean . is the noisy measurement that mimics the real meter measurements.
II-C Implement Synchrophasor Devices
Complex voltage and current measurements must be aggregated to the control center to perform linear state estimation. This task is accomplished through synchrophasor technology. it consists of Phasor Measurement Unit(PMU), Phasor Data Concentrator(PDC), communication network and control center[2]. Real-time GPS time-stamped electrical quantities are measured and transmitted to the control center through a suitable communication protocol. The latest synchrophasor standard has been split into two standards, IEEE Std 37.118.1-2011, which covers measurement provision, and IEEE Std 37.118.2™-2011, which covers data communication[30]. IEEE C37.118.2 protocol is an application layer protocol that is accepted by industries for phasor data transferring between PMU and PDC. Although IEEE standard C37.244-2013[4] deals with PDC, it did not impose strictly to use of IEEE C37.118.2 protocol for phasor data transfer. This standard recommended IEEE C37.118.2 or IEC 61850-90-5 for PDC data transfer. Both of the protocols have their unique features and limitations[2].
Four message types are defined in the IEEE C37.118.2 standard[30] such as data, configuration, header, and command. A sample communication scenario of IEEE C37.118.2 protocol has been presented in the figure 5. In the synchrophasor protocol, PMU functions as a server, and PDC functions as a client. In the server-client paradigm, a client initiates communication session. Therefore, PDC starts a session by sending a command that requests the PMU to send configuration message. Without a configuration packet, PDC cannot interpret the data packet. Then After receiving the configuration packet, PDC sends another command to start data transmission. PDC transmits synchrophasor data continuously at a fixed rate until further PDC commands stop data transmission.
We deployed all the PMU, PDC, and network layer on the top of the virtual machine(VM), which gives us the advantage of scaling. So, We need to deploy four types of VMs to develop the whole system. Moreover, different types of VM has separate dependencies and setup mechanism, which is one of the challenges for scaling the system. To scale up and automate the VM deployment process, we leverage the power of Vagrant. It is developed by HashiCorp to create and manage a portable virtual machine environment. Vagrant utilizes Ruby programming language to write instructions for deploying all virtual machines in a single file named Vagrantfile[31].
We leverage an open-source Python library named pyPMU[21] to develop the PMU. All the dependencies have been installed inside the virtual machine to mimic a real PMU. The PMU is performing two significant tasks. First, it collects the phasor measurements from the distribution system that is running inside the Opal-RT; second, pyPMU encodes phasor measurements into the IEEE C37.118.2 packet. Finally, it is waiting for the command from PDC to initiate communication, just like in figure 5. Manual installing many PMUs is a cumbersome process, So we utilized the Vagrant automation tool to automate the virtual machine deployment process.
All the steps of PMU installation is depicted in figure 3(a), and the script of the implementation can be found in the GitHub link: ”https://github.com/shuvangkar”. From VM deployment to dependencies installation, all the steps are handled by the vagrant script. As the Vagrant script is based on the Ruby environment, it supports basic programming syntax like for loop. The support of the loop in the Vagrant script elevates the scaling issue significantly. Hence, we implemented a base PMU device and utilized a ”for loop” to deploy the n number of PMUs. The command sequence of PMU deployment is essential because all the dependencies should be installed before changing the network card. Each PMU requires two network cards to work correctly. One network card works in bridge mode that connects with Opal-RT, and another network card works in internal network mode that connects the PMU with the smart-grid network. Then dependencies for the PMU, such as pyPMU, are installed in the script. Finally, static IP addresses are correctly set into both network cards to connect the physical layer with the cyber layer.
The pySynphasor module can be found in the link: ”https://github.com/shuvangkar”
As the pySynphasor can dissect and build IEEE C37.118.2 packets, we developed a simple PDC application utilizing that. We named the PDC application pyPDC. The pyPDc can receive data from multiple PMUs. The pyPDC is available at the following link: ”https://github.com/shuvangkar” The pyPDC being a python application gives us the advantage of deploying everything in a python environment utilizing vagrant script. The steps for PDC deployment is shown in the figure 3(b).
The vagrant script’s VM setting with dependencies is written down sequentially. Afterward, a simple vagrant command ”vagrant up” deploys the whole testbed except the CORE network. The script installs all the PMUs and PDC with dependencies and necessary setups within a few minutes. This automatic installation opens the real potential of the testing cyber-physical system in a hardware-in-loop and co-simulation environment as it does not require purchasing costly PMU and PDC hardware to test more extensive distribution or transmission systems. Both the PMU and PDC have critical network configurations in the testbed, which will be discussed in the subsection II-D.
II-D Cyber Layer Modeling
Designing a highly scalable cyber-physical system in the virtual environment is one of the main goals of the research. So, a software-defined network that runs in real-time is required to connect all the virtual machines. CORE(Common Open Research Emulator) is an open-source network emulator tool that runs on top of Linux. It runs in real-time and connects many nodes, taking advantage of the Linux network namespace. CORE has python API and a graphical user interface for building the emulated network.
Figure 4 depicts the emulated network designed in the CORE emulator. The network is composed of routers, switches, and RJ45 connectors. Let us consider the router n13. The network under the router n13 is considered the substation network. Under the substation router, a switch connects all the devices in the substation, such as PMU, local PDC, relay, and RJ45 connector. The RJ45 connector is the interface between the virtual network and PMU. Therefore, the RJ45 connector is the main bridge between the independent host and emulated network. The independent host can be any physical or virtual machine like PMU VM.
The VirtualBox network needs to be configured in a particular way to connect any host with the CORE virtual network through the RJ45 connector. For that reason, configuring the network in VirtualBox is one of the crucial factors for modeling the network. VirtualBox has seven network modes such as (1) Not Attached, (2) NAT, (3) NAT Network, (4) Bridge Network, (5) Internal Network, (6) Host-only network, and (7) Generic Network[32]. Different networking modes has different application and different advantages and disadvantages. Internal network mode is suitable for this application as it allows connecting a particular VM with the CORE RJ45 ethernet port. While building the CORE VM, Promiscuous mode must be allowed while configuring the network interface cards.
Promiscuous mode allows the incoming traffic to pass the physical network adapter and reach the CORE virtual network adapter. So, without enabling this mode, CORE will not receive the packet from the rest of the PMU and PDC VMs. The IP address of the PMU VMs has to be set according to the network address of the substation router. Otherwise, the VM cannot connect with the CORE router. For example, the network IP of the link connecting the enpos9 ethernet port is 192.168.0.1. The allowable IP range is 192.168.0.2-192.168.0.255 for the PMU VM connected with the enpos9 RJ45 connector. The same rules apply to all the VM connected with the CORE network through the RJ45 connectors. Also, 192.168.0.1 will be the gateway address of the PMU. The network configuration mentioned above is automated in the Vagrant script. We only have to manually deploy the CORE network and configure and connect the VM with the RJ45 ethernet interface, just like the figure 3(c). It is also possible to automate the CORE VM deployment using CORE python API.
II-E Attacker Modeling
MAC address is the unique identifier assigned to the network interface card (NIC). The IP address is a 32-bit address that identifies a device in a local area network in the IPv4 system. The problem with IP addresses is that they might change depending on the network setting. So, to identify a device in the network, the MAC address plays a vital role because of its uniqueness. ARP protocol resolves MAC address from IP address in the local area network. Therefore, the ARP protocol is the bridge between layer 2(MAC address) and layer 3(IP address).
Consider a scenario in figure 6 where device D1 needs to send data to device D4. D1 only knows the IP address of the device D4. Therefore, D1 needs to know the MAC address of D4 to send data. Then, D1 sends a broadcast message to the local area network asking MAC address of D4. Afterward, all the devices in the local network will get the broadcast request. Only D4 will respond by attaching its MAC address. After receiving the MAC address, D1 caches the MAC address of D4 along with the IP address in its ARP table.

ARP protocol does not verify the responder address before caching into the ARP table. So, any device can send an ARP reply message without a query. That means it is not mandatory for D1 to ask for the D4 MAC address to get an ARP reply. Any host in the local area network can generate an ARP reply without inquiry. The adversary uses this vulnerability to pretend to be someone in the network. In the figure 7, attacker D3 sends an ARP reply to device D1, attaching the IP address of device D4 and MAC address of its own without any initial inquiry from device D1. So, the attacker, D3, is pretending to be D4. As a result, the ARP table of D1 will be poisonous. This technique is known as ARP poisoning. Because of ARP poisoning, whenever D1 sends any packet to D4, it will be forwarded to the attacker machine(D3).
Now, all the packets from D1 to D4 pass to the attacker machine(D3) after deploying the ARP poisoning script. We have written an ARP poisoning script in Scapy. The aprspoof is another ARP poisoning tool with the built-in command to perform ARP poisoning. Both tools work according to the mentioned method in figure 7. After deploying the ARP poisoning script, all the packets from D1(Alice) to D4(Bob) will be passed to the D3(Attacker). However, Bob(D4) will not receive the packet unless the Attacker enables the packet forwarding. Therefore, Alice and Bob can establish communication after enabling packet forwarding in the attacker machine. In the case of the Man in The Middle(MITM) attack, the attacker convinces two victims that they are directly transferring data with each other[11]. In this way, the MITM attack has been implemented in our testbed.
FDIA attack is the most dangerous attack that can disrupt the regular operation and lead to blackout, just like the 2015 Ukraine attack. In this attack, the adversary craft fully changes the meter measurement. We utilized Linux iptables, NetfilterQueue, and pySynphasor to implement FDIA in our testbed. The iptables is the basic firewall program of the Linux operating system. We developed a python script that combines all the tools and automates the FDIA attack process. The packet filtering mechanism provided by iptables is organized into three different kinds of structures; (1)tables, (2)chains, and (3)targets. The table allows processing packets in specific ways. Filter table decides whether a packet should be allowed to reach the destination, Mangle table allows to alter packet header, NAT table allows to route packet to different hosts on NAT network, Raw table is a stateful firewall. Tables have a chain attached to them, and the chain inspects traffic at a different point. Prerouting chain applies when a packet arrives. The input chain applies just before the local process. Forward chain applies to the packet that are routed through the current host. The Postrouting chain applies when the packet leaves the network interfaces. Finally, the target decides the fate of a packet, such as allowing, rejecting packets, or passing the packet to a queue. We created iptables rules such as way so that any packet passing through the FORWARD chain; will pass to the NetfilterQueue buffer(NFQ) just like depicted in figure 8(a).
After reading the packet from the NFQ buffer, the attacker inject false data in the measurements. As the pySynphasor module can intuitively build and dissect the IEEE C37.118.2 packet, It plays a vital role in injecting false data. It reads the network packet and builds an internal object structure in the Scapy framework. That is known as the internal representation of the packet. The internal representation is helpful in the Scapy framework as it allows the user to modify and redesign the packet. After modifying the packet, Scapy again builds the packet for the network. This network representation is the machine representation of a packet in Scapy terminology. Another critical point while rebuilding the packet after the injection is updating the packet fields that hold the packet’s signature in some form, such as IP length, TCP length, TCP checksum, and IEEE C37.118.2 CRC value.
Figure 8(a) depicts the direction and flow of the packet in Linux kernel space and user space. The red line indicates the path of the synchrophasor packets while passing through the attacker’s machine. Figure 8(b) presented the flowchart of the script that we have developed for implementing the FDIA attack in the synchrophasor system. The script begins with preparing the FDIA environment that includes (1) enabling packet forwarding, (2) resetting iptables (3) adding new iptables rules. Then, the script filters the TCP packet that is aimed at the target machine. Afterward, the script injected false measurements. The next part is a little tricky. As the packet changes after the injection, a few fields such as IP length, TCP length, IP checksum, TCP checksum, and IEEE C37.118.2 CRC need to recalculate again. Otherwise, the receiver machine will discard the packet. For a successful FDIA, the steps are (1) Capture packet from Linux Forward chain and pass it to NetfilerQueue buffer, (2) When packets are available on the buffer, accept them and inject false data using pySynphasor. (3) Recalculate checksum as packets are changing after injecting false measurements. (4) Release the packet to the Linux Forward chain.
III Results
III-A State Estimation in Normal Conditions
The distribution system is intrinsically unbalanced. This unbalanced system can be realized as the three separate equations[7] for designing state estimation estimation problem. These three separate equations can be solved by parallel processing, reducing computation time. So, we formulated the three-state estimation problems and calculated the voltages and phase angles of the individual phases. Figure 9(a) and 9(b) presents the estimated and actual bus voltage and phase angle of phase A for IEEE 13 node test feeder. The results were generated based on the following scenarios. For phase A, buses 5,6 and 11 are not present. Therefore, 4 PMU measurements were used while calculating states. Seven current and four voltage measurements are comprised in total of measurements. Bus 7 and 8 are connected with a breaker, and bus 12 has no load. So, we need to estimate the voltage for bus 2,3,4,7,9,10,13. Therefore, the total number of states to estimate is . The noise was added with the meter measurement utilizing the equation 8. and mean were considered while adding noise for this result.
For detecting presence of bad data, we utilized the equation 6 and Chi-square distribution table. For degree of freedom and , the threshold value obtained from the Chi-square distribution table. Figure 9(c) represents the meter error for all 11 measurement calculated using the hypothesis testing equation 7. The calculated value of , that indicates there is no bad data in meter measurement. Also hypothesis testing results for detecting bad meter was presented in figure 9(c). For all 11 meters, the value of that indicates all meter measurements are good. It also concludes that there is no attack on meter measurement in this case.
III-B pySynphasor Packet Building and Dissection
pySynphasor module is built on top of Scapy. Scapy is an interactive packet manipulation program based on python. It has three types of packet representation: internal, machine, and human. Machine representation is the actual raw packet that will be sent through the network. Using internal representation Scapy manipulates the packet. Human representation is the human-readable representation in plain text. So, this representation is easy to deal with for injecting packets. Figure 10 represents the human-readable representation of IEEE C37.118.2 data packets. These packets were collected using the Wireshark tool. Wireshark stores these packets from PMU and PDC communication in a pcap file format. Then, pySynphasor reads the pcap file and dissects the packet just by one line of code. The figure 10 demonstrates that the packet dissection is done just by applying show() method on packet. It presents the packet in a human-readable format. The data packet has five sub-segments: an Ethernet Header, IP header, TCP header, IEEE C37.118.2 common frame, and IEEE C37.118.2 data frame. Data frame represent the phasors measurements in complex number format. Similarly, pySynphasor is capable of dissecting command, configuration, and header packet of IEEE C37.118.2 protocol.
The module is also capable of building the IEEE C37.118.2 packet from raw phasor measurements. The figure 11 demonstrated an example of intuitively building the IEEE C37.118.2 data packet just using a few lines of the python script.
III-C CORE Network Connection Result
The figure 12 presents an example of how CORE connects the PMU and PDC that were deployed in the virtual machine. Figure 12(a) depicts a sample CORE network deployed in VM for connecting PMU and PDC. Figure 12(b) presents PMU deployed in a VM that transfers phasor measurement after a specific interval. The PMU device deployed here is built using the pyPMU python module. This VM is connected to the RJ45 ethernet interface enp0s8 in the CORE network. Figure 12(c) is another VM connected with the enp0s10 RJ45 network interface. PMU Connection Tester application is deployed in this VM for verifying the connection with PMU through the CORE network. PMU Connection Tester plotted four phasors measurements when it received data from the PMU device. All the phasors measurements are flat, because PMU sends a constant value. So these results verify the successful connection of PMU and PDC through the CORE virtual network in our proposed testbed.
III-D ARP Poisoning Result
ARP poisoning mechanism is used to implement MITM attack in our smart-grid testbed. The primary technique of this type of implementation is that the attacker has to poison two victims’ ARP table. The figure 13 presents the results of ARP poisoning where PMU and PDC are deployed in a local network in two separate VMs. The figure 13 presents the ARP table of both victims before and after the poisoning. If we look into the ARP table of the PMU device, The IP address of PDC is 10.0.2.7, and the MAC address is 08:00:27:69:58:64 before the attack. The MAC address changed to 08:00:27:a7:1b:c3 in the PMU ARP table after the poisoning; that is the MAC address of the attacker machine. That means the PMU ARP table is poisoned, and all packets from PMU to PDC will go through the attacker machine. The same thing happened to the PDC ARP table.
III-E C37.118.2 FDIA Results
After ARP poisoning, the attacker machine has access to the victim packet. It created a temporary queue for manipulating and forwarding the packet afterward. In the figure 8, we explained how the attacker gets access to the synchrophasor data from Linux kernel space to the user space through NetfilterQueue and iptables package. Afterward, utilizing the pySynphasor module, the attacker dissects the synchrophasor packet. The figure 14 presents scenarios of MITM and FDIA attack. Here, PMU and PDC are transferring packets normally. The left VM represents the PMU, and the right side represents the PDC and Center VM, which is the attacker machine. PMU and PDC are transferring data normally. By poisoning the PMU and PDC ARP table, the attacker now steals the session of the PMU and PDC. After deploying the attack script, it has access to the synchrophasor data. In this way, the attacker is eavesdropping on the synchrophasor packet.The center VM in figure 14 presents dissection of one of the synchrophasor data packet. pySynphasor module paved the way for real-time dissection of synchrophasor packets. The figure 14 also presents a scenario of false data injection attack. In the attacker VM, we can observe that the phasor measurements were [(2453+2444j), (2954+2780j), (2922+2079j)] before the attack, and after the attack, it was injected to [(2402+0j), (58218+ 2860j),(58218+12675j)]. The packet injection mechanism is just a few lines of pySynphasor commands, just like the figure in 11. As the packet contents are changing, it is mandatory to update the fields that keep track of the packet signature, such as TCP and IP packet length, checksum, and IEEE C37.118.2 CRC value. Updating of these signature fields is performed in the script. After the injection, the script forwards the packet to the PDC. This is how the testbed smoothens the different attack scenarios for testing large system deployment.
III-F Attack Detection
The testbed paves the way for testing different types of cyber attack detection in smart grid systems. The detection mechanism can be classified into packet-based and physics-based. Linear state estimation-based bad data detection technique is physics-based attack detection. Figure 9(d), 9(e) and 9(f) represents one of the scenarios of linear state estimation based bad data detection technique. Where the meter 1 measurement was poisoned by the attacker and bad data detection algorithms were performed in the control center. We mentioned earlier that for the degree of freedom and The threshold value, . But in the figure 9(f), the value of . That indicates that there is bad data present in the measurement. The 9(f) also demonstrates the result of hypothesis testing on meter measurements. The error value for meter 1. It proves that the attacker poisoned the meter 1 measurement.
IV Discussion
Our main goal was to present a scalable cyber-physical testbed for smart grid system so that the testbed can be utilized to experiment different detection mechanisms for bigger system that will prevent future attack just like 2015 blackout in Ukraine due to the False Command Injection Attack(FCIA) [10]. In the method section, we described how to develop such high fidelity testbed that can mimic a real system. We not only focused on designing the testbed but also demonstrated how to design real-time attack on the testbed so that the system can be studied from both the attacker’s point of view and the victim’s point of view. Another major part of the testbed was the demonstration of the pySynphasor module. It can be utilized in many ways because of its complete capabilities of building and dissecting the IEEE C37.118.2 protocol. We developed a simple PDC named as pyPDC utilizing the module; we also designed an FDIA attack utilizing the module. It is also possible to design different types of attacks in IEEE C37.118.2 protocols. One of the potential testings might be implementing fuzz testing on synchrophasor devices. Therefore, pySynphasor has many usage cases to explore in future research.
Then, in the result section, we presented how the whole testbed works. In the III-A subsection, state estimation and bad data detection results for IEEE 13 node test feeder has been presented. In the III-C subsection, we presented how software emulated the network connecting the whole testbed. The whole smart grid is ready and equipped with a cyber layer and physical layer.In the III-B subsection, we presented how pySynphasor can build and dissect IEEE C37.118.2 protocol intuitively. Performing cyber attacks was one of the main goals of the testbed. In the III-D subsection, we presented how to access the PMU data packet by applying the ARP poisoning mechanism. In the III-E subsection, we presented how to inject false data on the phasor measurements utilizing the pySynphasor module. Finally, we focused on the detection mechanism. So, subsection III-F presented how linear estate estimation based bad data detection can identify false data injection attack on synchrophasor data.
The synchrophasor standard suggested IEEE C37.118.2-2011 and IEC 61850-90-5 protocols for PMU and PDC communication. But, we only explored the IEEE C37.118.2 protocol and did not address IEC 61850-90-5 protocol in the testbed.
V Conclusion
The development of a scalable cyber-physical testbed for smart grid has been presented. The effectiveness of such testbed has been demonstrated to identify the best detection mechanism for a more extensive system. We also presented the mechanism of building and dissection synchrophasor network packets that is also useful in detecting packet-based detection. Finally, we presented a physics-based detection mechanism such as state estimation and bad data detection. Although the system is highly scalable, it can be more robust than the virtual machine by the docker container. So building the whole testbed on top of the docker container will be follow-up research. Designing the testbed around IEC61850 will be another improvement of current research.
References
- [1] M. S. Prabhu and P. K. Nayak, “A state-of-the-art review on synchrophasor applications to power network protection,” vol. 436, pp. 531–541.
- [2] R. Khan, P. Maynard, K. McLaughlin, D. Laverty, and S. Sezer, “Threat analysis of BlackEnergy malware for synchrophasor based real-time control and monitoring in smart grid,” pp. 1–11.
- [3] F. F. Wu, “Power system state estimation: A survey,” vol. 12, no. 2, pp. 80–87. [Online]. Available: https://www.sciencedirect.com/science/article/pii/014206159090003T
- [4] IEEE Power and Energy Society, “IEEE Std C37.244™-2013,” pp. 1–65.
- [5] R. Khan, K. Mclaughlin, D. Laverty, . Sezer, R. Khan, K. Mclaughlin, D. Laverty, and S. Sezer, “Analysis of IEEE C37. 118 and IEC 61850-90-5 synchrophasor communication frameworks,” p. 2016. [Online]. Available: https://ieeexplore.ieee.org/abstract/document/7741343/
- [6] H. Wang and N. Schulz, “A revised branch current-based distribution system state estimation algorithm and meter placement impact,” vol. 19, no. 1, pp. 207–213.
- [7] X. Chen, K. J. Tseng, and G. Amaratunga, “State estimation for distribution systems using micro-synchrophasors,” in 2015 IEEE PES Asia-Pacific Power and Energy Engineering Conference (APPEEC), pp. 1–5.
- [8] G. N. Nayak and S. G. Samaddar, “Different flavours of Man-In-The-Middle attack, consequences and feasible solutions,” vol. 5, pp. 491–495.
- [9] Y. Yang, K. McLaughlin, T. Littler, S. Sezer, E. G. Im, Z. Q. Yao, B. Pranggono, and H. F. Wang, “Man-in-the-middle attack test-bed investigating cyber-security vulnerabilities in smart grid SCADA systems,” vol. 2012.
- [10] G. Liang, S. R. Weller, J. Zhao, F. Luo, and Z. Y. Dong, “The 2015 Ukraine Blackout: Implications for False Data Injection Attacks,” vol. 32, no. 4, pp. 3317–3318.
- [11] R. Khan, K. McLaughlin, D. L. . C. o. I. …, and u. 2016, “IEEE C37.118-2 Synchrophasor Communication Framework Overview, Cyber Vulnerabilities Analysis and Performance Evaluation.”
- [12] X. Fan, L. Du, D. D. I. T. o. S. Grid, and u. 2017, “Synchrophasor data correction under GPS spoofing attack: A state estimation-based approach.” [Online]. Available: https://ieeexplore.ieee.org/abstract/document/7839276/
- [13] S. Paudel, P. Smith, T. Z. f. I. . S. C. S. …, and u. 2016, “Data integrity attacks in smart grid wide area monitoring.” [Online]. Available: https://www.scienceopen.com/hosted-document?doi=10.14236/ewic/ICS2016.9
- [14] V. Singh, A. O. . N. A. …, and u. 2016, “Stealthy cyber attacks and impact analysis on wide-area protection of smart grid.” [Online]. Available: https://ieeexplore.ieee.org/abstract/document/7747927/
- [15] K. Kołtyś and R. Gajewski, “SHaPe: A Honeypot for Electric Power Substation,” pp. 37–43. [Online]. Available: https://www.infona.pl//resource/bwmeta1.element.baztech-dd7fe369-6682-4a1e-bd10-e89d3723cbb6
- [16] J. Johnson, I. Onunkwo, P. C. I. C.-P. …, and u. 2020, “Assessing DER network cybersecurity defences in a power-communication co-simulation environment.”
- [17] P. Wlazlo, A. Sahu, Z. Mao, H. Huang, A. Goulart, K. Davis, and S. Zonouz, “Man-in-The-Middle Attacks and Defense in a Power System Cyber-Physical Testbed.” [Online]. Available: http://arxiv.org/abs/2102.11455
- [18] N. R. Rodofile, K. Radke, and E. Foo, “Real-Time and Interactive Attacks on DNP3 Critical Infrastructure Using Scapy.”
- [19] R. Khan, K. McLaughlin, J. H. D. Laverty, H. David, and S. Sezer, “Demonstrating Cyber-Physical Attacks and Defense for Synchrophasor Technology in Smart Grid.”
- [20] H. Cui, F. Li, K. T. I. E. S. Integration, and u. 2020, “Cyber‐physical system testbed for power system monitoring and wide‐area control verification.”
- [21] S. Šandi, B. Krstajić, T. P. . t. Telecommunications, and u. 2016, “Pypmu—open source python package for synchrophasor data transfer.” [Online]. Available: https://ieeexplore.ieee.org/abstract/document/7818916/
- [22] U. Adhikari, T. Morris, S. P. . I. P. G. Meeting, and u. 2014, “A cyber-physical power system test bed for intrusion detection systems.” [Online]. Available: https://ieeexplore.ieee.org/abstract/document/6939262/
- [23] M. Cintuglu, O. Mohammed, K. A. . S. . Tutorials, and u. 2016, “A survey on smart grid cyber-physical system testbeds.” [Online]. Available: https://ieeexplore.ieee.org/abstract/document/7740849/
- [24] Y. Yang, H. Jiang, K. McLaughlin, L. G. . I. P. . …, and u. 2015, “Cybersecurity test-bed for IEC 61850 based smart substations,” pp. 1–5. [Online]. Available: https://ieeexplore.ieee.org/abstract/document/7286357/
- [25] A. Monticelli, “Electric power system state estimation,” vol. 88, no. 2, pp. 262–282.
- [26] A. Tarali, “Bad data detection in two stage estimation using phasor measurements.” [Online]. Available: http://hdl.handle.net/2047/d20002926
- [27] L. Zhang, A. Bose, A. Jampala, V. Madani, and J. Giri, “Design, Testing, and Implementation of a Linear State Estimator in a Real Power System,” vol. 8, no. 4, pp. 1782–1789. [Online]. Available: http://ieeexplore.ieee.org/document/7373664/
- [28] C. E. Bandak, “POWER SYSTEMS STATE ESTIMATION.”
- [29] W. Kersting, “Radial distribution test feeders,” in 2001 IEEE Power Engineering Society Winter Meeting. Conference Proceedings (Cat. No.01CH37194), vol. 2, pp. 908–912 vol.2.
- [30] I. P. a. E. Society, “IEEE Std C37.118.1™-2011,” pp. 1–61.
- [31] M. Hashimoto, Vagrant: Up and Running: Create and Manage Virtualized Development Environments. [Online]. Available: https://books.google.com/books?hl=en&lr=&id=7rJqqKCvdagC&oi=fnd&pg=PR2&dq=vagrant+up+and+running&ots=qDzDYo9MI5&sig=8NYhVHLCyNsW6ojyHL39KO4p5S8
- [32] VirtualBox. Chapter 6. Virtual Networking. [Online]. Available: https://www.virtualbox.org/manual/ch06.html