> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/rt-lab/example-models/cyber-physical-example-models/hv-transmission-system-with-ieee-c37.118.md).

# HV Transmission System with IEEE C37.118

## Description

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-2c4a288f8d98d741e0bdf1c5a66f918d3ccce81d%2Fcyber-physical-example.png?alt=media" alt=""><figcaption></figcaption></figure>

The **HV Transmission System with IEEE C37.118** example can be created by starting a new RT‑LAB project. From the menu bar, select **File > New > RT‑LAB Project**. Enter a name and location for your project, then click **Next**. From the available templates list, navigate to **Cyber Physical** and select **Cyber\_Physical\_HVAC6Bus**, then click **Finish**.

The model represents a transmission system in which voltage and current measurements from bus WES7 are acquired by a simulated phasor measurement unit (PMU). The PMU converts the measurements into synchrophasors and transmits them to a controller using the IEEE C37.118 protocol.

The communication architecture consists of:

* A **C37.118 slave**, representing the simulated PMU.
* A **C37.118 master**, representing the controller.
* An **EXata CPS network model** through which the IEEE C37.118 traffic is routed.
* An **overcurrent protection function** in the controller that can trip circuit breaker Di1 when an overcurrent is detected.

Both the C37.118 master and slave run on the same OPAL-RT simulator. Instead of communicating directly, their traffic is routed through EXata CPS using virtual Ethernet interfaces and mapped to corresponding EXata CPS nodes.

### Protection logic

The master controller performs two main functions:

1. **Data acquisition**\
   Receives the voltage and current synchrophasors transmitted by the C37.118 slave.
2. **Overcurrent protection**\
   Converts the received phase A current magnitude to per unit and compares it with a pickup threshold. If the overcurrent condition persists for 5 seconds, the controller sends a trip command to circuit breaker Di1.

The protection element resets after 40 seconds. If the overcurrent condition is still present after the reset, the protection can trip the breaker again.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-77bbbcb85cc44b1facefcce656bfca09ef019750%2Fcyber-physical-example-trip-logic.png?alt=media" alt=""><figcaption></figcaption></figure>

The model can therefore be used to observe how communication behavior directly affects the operation of the simulated electrical system.

### Cyber-physical scenarios

EXata CPS provides the emulated communication network between the PMU and controller. The example demonstrates normal system operation as well as communication disturbances that affect the measurements received by the controller.

The included scenarios demonstrate:

* Normal IEEE C37.118 communication
* A single-phase fault
* C37.118 master node deactivation
* Packet modification that alters the received phase A current magnitude
* The resulting effect of these communication disturbances on the protection logic and transmission system

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-e89c921a59eae917dde497bc5a5c4532136b4cc2%2Fcyber-physical-example-overview.png?alt=media" alt=""><figcaption></figcaption></figure>

### Model overview

The `sm_computation` subsystem contains the 6-bus HVAC transmission system. Voltage and current measurements are acquired from bus **WES7**. Circuit breaker **Di1** can isolate the affected portion of the system when the protection logic detects an overcurrent.

A configurable single-phase fault is also included to validate the protection sequence.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-9eb65f3bb52b1f761bb8079c90b8dfce1cd83315%2Fcyber-physical-example-model.png?alt=media" alt=""><figcaption></figcaption></figure>

The simulated PMU is implemented by the `C37_slave_PMU` subsystem. It acquires voltage and current signals, converts them to magnitude and phase-angle phasors, and exposes the signals to the RT-LAB IEEE C37.118 I/O interface using `OpOutput` blocks.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-9d4b74d4b3a41688d012108d80d6316dd551bd8a%2Fcyber-physical-example-simulated-pmu.png?alt=media" alt=""><figcaption></figcaption></figure>

The controller receives the transmitted synchrophasors through the C37.118 master. `OpInput` blocks connect the values received by the I/O interface to the controller model.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-8b43dc7dfb494479c8abae1f554c149ed5672481%2Fcyber-physical-example-opinputs.png?alt=media" alt=""><figcaption></figcaption></figure>

### Dashboards

The example includes two dashboards accessible from the Project Explorer.

The **Concise Panel** provides a single-line view of the system with the main controls and measurements, including:

* Fault enable command
* Fault status
* Di1 and Di2 breaker states
* C37.118 slave phase A current
* C37.118 master phase A current
* Master phase A current in per unit

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-a99e7c5b57d4249014fabccac0f192b2311a6628%2Fcyber-physical-example-concise-panel.png?alt=media" alt=""><figcaption></figcaption></figure>

The **Detailed Panel** provides additional measurements and scopes, including:

* WES7 voltage and current
* Comparison of C37.118 slave and master phase A current
* Fault detection and breaker trip timing
* Voltage and current magnitudes and angles at the PMU and controller
* Master phase A current in per unit

The fault can be enabled from either dashboard.

<figure><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-75e37d0e90496c1c579cc100f8fda53d217f9299%2Fcyber-physical-example-detail-panel.png?alt=media" alt=""><figcaption></figcaption></figure>

### IEEE C37.118 configuration

The PMU operates as the IEEE C37.118 slave and the controller as the IEEE C37.118 master.

The example uses the following configuration:

| Parameter                 | IEEE C37.118 Slave | IEEE C37.118 Master                      |
| ------------------------- | ------------------ | ---------------------------------------- |
| **PMU ID**                | 1                  | 1                                        |
| **Protocol**              | TCP                | TCP                                      |
| **TCP port**              | 4712               | 4712                                     |
| **NIC name**              | `veth12`           | `veth11`                                 |
| **IP address**            | `10.10.1.47`       | Master: `10.10.1.33` Slave: `10.10.1.47` |
| **Phasor representation** | Polar              | Polar                                    |
| **Phasor format**         | Float              | Float                                    |

The virtual interfaces replace the physical network interface normally used by the IEEE C37.118 communication. This allows the packets to pass through the EXata CPS emulated network before reaching the other communication endpoint.

After compiling the model, connect the `OpInput` and `OpOutput` signals to the corresponding C37.118 data points.

### EXata CPS configuration

The EXata CPS model represents the C37.118 communication network:

* **Node 1:** C37.118 slave / simulated PMU
* **Node 2:** C37.118 master / controller
* **Network:** `10.10.1.0`
* **Node 1 address:** `10.10.1.47`
* **Node 2 address:** `10.10.1.33`

The nodes are connected through a simulated network switch.

In the RT-LAB I/O interface, configure the **EXata Network Interface** with the simulator Ethernet interface assigned to EXata CPS. For the original example setup, this interface is `eno2`.

When RT-LAB loads the model, the required virtual Ethernet interfaces are created and the selected physical interface is made available to EXata CPS.

## Requirements

This example requires RT-LAB and EXata CPS to run together on the OPAL-RT simulator.

Before running the example, become familiar with [Cybersecurity with EXata CPS](https://www.opal-rt.com/docs/rt-lab/model-and-simulation/cybersecurity-with-exata-cps.md):

* Installing and licensing EXata CPS on the workstation and simulator
* Configuring EXata CPS remote execution
* Configuring the RT-LAB EXata CPS I/O interface

### EXata CPS license

The EXata CPS license must include at least 5 communication nodes.

### RT-LAB license

The RT-LAB license installed on the simulator must include the following features:

| Feature Name         | Required Status      | Description                                                                    |
| -------------------- | -------------------- | ------------------------------------------------------------------------------ |
| DP\_C37\_118\_SLAVE  | enabled              | Enables C37118 Slave                                                           |
| DP\_C37\_118\_MASTER | enabled              | Enables C37118 Master                                                          |
| DP\_TOTAL\_NUMBER    | 50 enabled (or more) | Number of activated I/O data points for Ethernet-based communication protocols |

## Simulation and results

{% stepper %}
{% step %}

### Start the RT-LAB simulation

1. Open `Cyber_Physical_HVAC6Bus` in RT-LAB.
2. Assign the appropriate OPAL-RT simulator to the model.
3. Compile the model.
4. Load the model on the simulator.
5. Open the Dashboards and verify that the fault is disabled.
6. Execute the model.

During the load operation, RT-LAB configures the network interface used by EXata CPS and creates the required virtual Ethernet interfaces.

Optionally, connect to the simulator through SSH and run `ifconfig` to verify the virtual interfaces.
{% endstep %}

{% step %}

### Start the EXata CPS simulation

1. Open EXata CPS.
2. Open the `Cyber_Physical_HVAC6Bus` network model provided in the `EXata_CPS` directory of the RT-LAB model.
3. Verify that **Remote Execution** is configured for the same simulator running the RT-LAB model.
4. Open **Table View** and verify the network and interface addresses:
   * Network: `10.10.1.0`
   * Node 1: `10.10.1.47`
   * Node 2: `10.10.1.33`
5. Verify the CPS configuration and mapping between the EXata CPS nodes and the OPAL-RT virtual interfaces.
6. Start the emulation.
7. Start the EXata CPS scenario.

Once communication is established, EXata CPS displays traffic between the C37.118 slave, switch, and C37.118 master.
{% endstep %}

{% step %}

### Observe steady-state operation

With the fault disabled, observe the measurements in the RT-LAB Dashboards.

The expected results are:

* The C37.118 master reproduces the phasor measurements transmitted by the slave.
* Voltage and current remain at their nominal operating values.
* The fault status remains inactive.
* Circuit breaker Di1 remains closed.

This establishes the reference behavior for comparison with the fault and cyber-attack scenarios.
{% endstep %}

{% step %}

### Enable a single-phase fault

From either RT-LAB dashboard, enable the fault at WES7.

After the fault is applied:

1. Phase A current increases.
2. The C37.118 slave transmits the new measurement through EXata CPS.
3. The C37.118 master receives the increased current magnitude.
4. The overcurrent protection detects that the configured threshold has been exceeded.
5. After the configured 5-second delay, the controller trips Di1.
6. The breaker opens and isolates the affected part of the system.

Disable the fault to return the system toward its normal operating condition.
{% endstep %}

{% step %}

### Deactivate the C37.118 Master node

This scenario demonstrates the effect of interrupting communication with the C37.118 master.

In EXata CPS, deactivate Node 2 using either:

* **Node 2 > Deactivate Node**, or
* The Human in the Loop command `D 2`.

With Node 2 disabled, enable the electrical fault from the RT-LAB Dashboard.

Although the actual current increases because of the fault, the controller no longer receives updated C37.118 measurements. Its received measurements therefore do not represent the new electrical state, and the expected overcurrent trip does not occur.

As a result, Di1 remains closed while the fault is present.

To restore communication:

* Select **Node 2 > Activate Node**, or
* Enter `A 2` in the Human in the Loop command area.

After communication is restored, verify that the master measurements again follow the measurements transmitted by the slave and that the protection logic responds to the system state.
{% endstep %}

{% step %}

### Perform packet modification first scenario

This scenario demonstrates how modifying IEEE C37.118 traffic can affect the protection system.

In EXata CPS, configure a packet modification on Node 2 targeting the bytes corresponding to the phase A current magnitude.

For this example:

* C37.118 uses the transport layer.
* TCP port `4712` carries the communication.
* Phase A current magnitude occupies 4 bytes in the C37.118 payload.
* Its starting byte is `16`.
* The example uses a 32-bit floating-point value for the targeted measurement.

Once the packet modification is active, observe the phase A current received by the C37.118 master in the RT-LAB Dashboard.

When the fault is enabled, the actual current becomes high, but the manipulated value received by the controller can remain below the overcurrent threshold. Consequently, the protection logic does not trip Di1 even though the electrical fault is present.

Stop the packet modification and verify that the C37.118 master again receives the expected measurement.
{% endstep %}

{% step %}

### Perform packet modification second scenario

The final scenario demonstrates the opposite behavior: modifying the received measurement so that the controller detects an overcurrent when no electrical fault is present.

Configure a packet modification on Node 2 that increases the phase A current magnitude. In the provided scenario, the targeted measurement begins at byte `16`, and a 16-bit integer value is used for the modification.

Observe the master phase A current in the RT-LAB Dashboard.

The manipulated measurement exceeds the protection threshold even though the transmission system itself is not experiencing a fault.

After the configured 5-second protection delay, Di1 opens.

This demonstrates how manipulated communication data can cause an unnecessary protection operation and disconnect part of the simulated transmission network.

Stop the packet modification and verify that:

* The received current returns to its expected value.
* The overcurrent condition clears.
* Di1 returns to its normal state after the protection logic resets.
  {% endstep %}

{% step %}

### Stop the simulation

Stop the simulations in the following order:

1. Stop the EXata CPS emulation.
2. Return EXata CPS to Design mode.
3. Reset the RT-LAB simulation.

When RT-LAB resets the model, it removes the virtual Ethernet interfaces and restores the physical network interface assigned to EXata CPS.
{% endstep %}
{% endstepper %}

### Automatic EXata CPS execution

The example can also use the EXata CPS API to automatically start and stop EXata CPS with the RT-LAB simulation.

In **Simulation Tools**, enable:

* **Auto-run EXata-CPS simulation**
* **Close EXata-CPS GUI on stop simulation**

For EXata CPS 8.1.3, configure the executable by selecting `EXataGUI.exe`. With the default installation location, it is located under:

`C:\Program Files\Scalable\exata-cps\8.1.3\bin`

Select **From Config** and provide the `.config` file included with the example's EXata CPS network model.

With automatic execution enabled:

1. Load and execute the RT-LAB model.
2. EXata CPS opens the configured network model and starts the emulation.
3. Run the steady-state, fault, and cyber-physical scenarios described above.
4. When finished, reset the model in RT-LAB to stop the simulation and EXata CPS emulation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/rt-lab/example-models/cyber-physical-example-models/hv-transmission-system-with-ieee-c37.118.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
