Opal-RT Support for IEC 61850 User Guide Table of Contents Table of Contents .......................................................................................................................................... 1 1.

Introduction .......................................................................................................................................... 3 1.1

Purpose ......................................................................................................................................... 3

1.2

Software Requirements ................................................................................................................ 3

1.2.1

Linux Target – The Packet Capture Library ........................................................................... 3

1.2.2

RT-LAB ................................................................................................................................... 3

1.3

2.

Minimum Hardware requirements ............................................................................................... 4

1.3.1

Ethernet adapters ................................................................................................................. 4

1.3.2

Processors Number ............................................................................................................... 5

Configure the System ............................................................................................................................ 5 2.1

Hardware Setup ............................................................................................................................ 5

2.2

IEC61850 Blocks Configuration ..................................................................................................... 6

2.2.1

GOOSE Subscriber ................................................................................................................. 6

2.2.2

GOOSE Publisher ................................................................................................................... 7

2.2.3

Merging Unit ......................................................................................................................... 8

3.

Operation .............................................................................................................................................. 8

4.

Troubleshooting .................................................................................................................................... 8 4.1

Opal IEC 61850 .............................................................................................................................. 8

4.2

Merging Unit ................................................................................................................................. 9

4.2.1

Tcpdump ............................................................................................................................... 9

4.2.2

Wireshark .............................................................................................................................. 9

4.3

802.1Q Virtual LAN (VLAN) ......................................................................................................... 10

4.4

Process to configure the NETGEAR Ethernet Smart Switch ........................................................ 11

4.4.1

VLAN Configuration............................................................................................................. 12

4.4.2

VLAN Membership Configuration ....................................................................................... 13

4.4.3

Port VLAN ID Configuration ................................................................................................ 15

Opal-RT Support for IEC61850 User Guide 5.

Current Known Limitations ................................................................................................................. 17 5.1

Common ...................................................................................................................................... 17

5.1.1

GOOSE Subscriber ............................................................................................................... 17

5.1.2

Merging Unit ....................................................................................................................... 17

5.1.3

GOOSE Publisher ................................................................................................................. 17

5.1.4

QNX ..................................................................................................................................... 17

6.

Revision Log ........................................................................................................................................ 18

7.

References .......................................................................................................................................... 19

Figure 1: Example network topology ........................................................................................................... 4 Figure 2: Example of GOOSE Subscriber output (GoID 1 in icd61850.icd).................................................... 6 Figure 3: Example of GOOSE Publisher output (GoID 5 and 6 in icd61850.icd)............................................ 7 Figure 4: Example of tcpdump output. ......................................................................................................... 9 Figure 5: Example of Wireshark capture..................................................................................................... 10 Figure 6: Smart Control Center application. ............................................................................................... 11 Figure 7: Configuration Web Interface. ...................................................................................................... 12 Figure 8: VLAN configuration. ..................................................................................................................... 13 Figure 9: VLAN ID 10 Membership. ............................................................................................................. 14 Figure 10: VLAN ID 1 Membership. ............................................................................................................. 15 Figure 11: Port PVID Configuration. ............................................................................................................ 16

Page 2

Opal-RT Support for IEC61850 User Guide 1. Introduction 1.1 Purpose This manual describes how to configure and use the RT-LAB support for IEC 61850 standard. RT-LAB provides all the tools through a Matlab/Simulink library rtio_iec61850.mdl composed of three blocks:   

Opal IEC61850 GOOSE Subscriber Opal IEC61850 GOOSE Publisher Opal IEC61850 Merging Unit

The blocks are intended to help a user to test an Intelligent Electronic Device (IED). For more detailed information about Opal support for IEC61850 protocol, please refer to the document IEC61850_RTLAB_PIXIT_v1 3.pdf that could be found in the help directory of the example model.

1.2 Software Requirements 1.2.1 Linux Target – The Packet Capture Library Opal-IEC61850 driver uses the Packet Capture Library pcap to send and receive messages over the network. Hence the libpcap rpm package must be installed on the target PC. The package libpcap-0.9.4-12.el5 is installed by default on all Opal Linux installations. Execute the following command in order to verify if the package was installed on your target: # rpm –q libpcap The output of this command should be: # libpcap-0.9.4-12.el5 1.2.2 RT-LAB Install an RT-LAB version which includes support for IEC61850 protocol (i.e. 10.2_pr2 or later). Make sure the following files are available: -

-

Libraries : 1. Simulink/libRxxxxx/redhawk/ libOpalIec61850Rxxxx.a 2. common/lib/redhawk/libOpalIec61850Driver.a. 3. Simulink/libRxxxxx/win32/ libOpalIec61850Rxxxxx.lib Library Simulink/libRxxxxx/rtio_iec61850.mdl M files : 1. Simulink/m/iec61850_cb.m, 2. Simulink/m/iec61850_mu.m, 3. Simulink/m/iec61850_goose_subscriber_cb.m, 4. Simulink/m/iec61850_goose_publisher_cb.m 5. Simulink/m/iec61850_GoPubli_mask_display.m

Page 3

Opal-RT Support for IEC61850 User Guide

-

6. Simulink/m/ie61850_GoSubs_mask_display.m, 7. Simulink/m/iec61850_scl_configure_path.m, 8. Simulink/m/iec61850_scl_matlab_get_value.m Mexw32: 1. Simulink/libRxxxxx/sfun_iec61850_merging_unit.mexw32 2. Simulink/libRxxxxx/sfun_iec61850_goose_subscriber.mexw32 3. Simulink/libRxxxxx/sfun_iec61850_goose_publisher.mexw32

Where: “xxxxx” signifies the Simulink version. Support for IEC 61850 is distributed for all Simulink versions supported on the current RT-LAB release.

1.3 Minimum Hardware requirements 1.3.1 Ethernet adapters For performance purposes, the target must be equipped with at least 2 Ethernet adapters: 1. One Ethernet adapter enables the RT-LAB command station to control and monitor the target nodes 2. One Ethernet adapter is used for IEC 61850 communications.

The initial IEC 61850 standardization work with regard to substation communication suggested architecture on three levels using: -

One process bus – for high priority Sampled Values messages One station bus – for other messages (GOOSE, GSE, MMS…)

Figure 1: Example network topology However, the IEC 61850 standard does not restrict the communication topology. Generally, if there are not too many connected electronic devices, the two busses may use the same physical Ethernet communication link.

Page 4

Opal-RT Support for IEC61850 User Guide Note: We have been successfully using off-the-shelf Intel Gigabit Ethernet Controller and 3Com cards (speed 100Mb/s). 1.3.2 Processors Number A model that includes IEC61850 blocks, with only two subsystems (console and master) requires 3 processors to run: CPU0 is used by the operating system and by the communications threads between the command station and the target node(s). - A second CPU is used by the IEC 61850 driver thread. Regardless of the number of subsystems in the model that contains IEC61850 blocks, this is a unique thread that handles the communications between the IEC61850 blocks and the Ethernet driver through a shared memory buffer. - A third CPU is used by the model executable. Additional subsystems in the model may require additional processors. -

Note: The term processor refers to physical CPU or to core in a multi-core CPU topology.

2. Configure the System 2.1 Hardware Setup Assuming one adapter is already configured for communication with the RT-LAB command station, the user must configure the second adapter with an IP address that allows it to communicate with an Intelligent Electronic Device (IED) in the IEC61850 network. Start by identifying the name of the Ethernet device that will be used for IEC61850 communication. Run the command in a console or a terminal: #ifconfig Choose from the output, the name of a free Ethernet adapter. Configure the adapter using the command: #ifconfig eth1 192.168.1.1 up Note: We assumed here that: -

the free Ethernet interface is eth1 the IED IP address is in the range 192.168.1.0 – 192.168.1.255 and the IP address 192.168.1.1 is not used.

Page 5

Opal-RT Support for IEC61850 User Guide 2.2 IEC61850 Blocks Configuration Open the example model provided in the directory Examples\IO\_Generic_\IEC61850\simulink and configure the IEC61850 blocks according to your setup (i.e. the IED that has to be tested and the IEC61850 network it is connected to). 2.2.1 GOOSE Subscriber Use the block GOOSE Subscriber to receive GOOSE messages from an IEC61850 IED. Every simulation step, the block checks its segment in the shared memory buffer it shares with the Opal IEC61850 driver. If a new message arrived, the block decodes it and updates its outputs with new info. To configure the block, in the block’s mask: -

Specify the name of the Ethernet adapter that will be used. If the target only has 2 Ethernet adapters, this is the name of the adapter identified at Hardware Setup Specify the name of the Intelligent Electronic Device that sends the messages under monitoring Select the SCL file that describes the messages sent on the IEC 61850 network. This is the SCL file describing the relay under test and must be available1 Select the GoID parameter from the pop-up menu that is populated with available choices after the block parses the SCL file2. This describes the type of the GOOSE message the block receives and decodes.

Figure 2: Example of GOOSE Subscriber output (GoID 1 in icd61850.icd)

Note: refer to the block help for detailed information.

1

It is important to verify that the chosen relay is capable to send GOOSE messages. If using Matlab R2009, the user may be forced to close the mask and to re-open it, in order to access the list with available GoIDs. 2

Page 6

Opal-RT Support for IEC61850 User Guide 2.2.2 GOOSE Publisher Use the block GOOSE Publisher to transmit GOOSE messages over the network. Every simulation step, the block shall determine if the input data have changed, if yes , block shall send the new data to the shared memory buffer it shares with the Opal IEC61850 driver, if not the block shall let the Opal IEC61850 driver to transmit the next message, incrementing only the sqNum parameter indicating that no data changed by a new messages is issued with previous data. To configure the block, in the block’s mask: -

-

Specify the name of the Ethernet adapter that will be used. If the target only has 2 Ethernet adapters, this is the name of the adapter identified at Hardware Setup Specify the name of the Intelligent Electronic Device that used desires to emulate using the block GOOSE Publisher. Select the SCL file that describes the messages sent on the IEC 61850 network. This is the SCL file of relay or IED that user desires to emulate. Select the GoID parameter from the pop-up menu that is populated with available choices after the block parses the SCL file3. This describes the type of the GOOSE message the block shall publish. The output of block OP IEC 61850 Publisher consists of a vector or 3 elements organized as follows: [stNum, sqNum, StatusPublisher]

Figure 3: Example of GOOSE Publisher output (GoID 5 and 6 in icd61850.icd) ASN.1 Boolean representation There is an environmental variable called OP61850_BOOLTRUE that controls the way in which an ASN.1 Boolean value is encoded following the next rules. 1. OP61850_BOOLTRUE = 0xFF or 0xff shall encode an ASN.1 Boolean TRUE value as 83 01 FF 2. OP61850_BOOLTRUE = 0x01 shall encode an ASN.1 Boolean TRUE value as 83 01 01 3. OP61850_BOOLTRUE is not defined shall encode an ASN.1 Boolean TRUE value as 83 01 01 Note: refer to the block help for detailed information. 3

If using Matlab R2009 or later, the user may be forced to close the mask and to re-open it, in order to access the list with available GoIDs.

Page 7

Opal-RT Support for IEC61850 User Guide 2.2.3 Merging Unit Use the block Merging Unit to send Sampled Values into an IEC61850 network. Every simulation step, the block updates its segment in the shared memory buffer it shares with the Opal IEC 61850 driver, with the voltage, current and QA values from its input. The Opal IEC61850 driver combines those values into a Sampled Value message and sends it into the IEC 61850 network where the target node is connected. The message is intended to the Intelligent Electronic Device that shares the same name and multi-cast address as those specified in the block mask. -

Specify the name of the Ethernet adapter that will be used. . If the target only has 2 Ethernet adapters, this is the name of the adapter identified at Hardware Setup. Specify the name of the Logical Device it represents. The name must be at least 10 characters length. Make sure that the chosen name is recognized by the relay the message is intended to. Specify the multicast MAC address Select the Sample rate Select the Nominal Frequency Select the extrapolation method to be used

Note: refer to the block help for detailed information.

3. Operation If the blocks have been correctly configured, the model may be compiled and loaded. Execute the model. If the model initialized properly it must end up into the “Pause” state. Enable the IEC61850 blocks. So far the user should see the following behaviour: -

-

The output of the GOOSE Subscriber block changes depending on the GoID parameter. Regardless of the GoID selected, the block always has an output named StNum which shall display an increasing count of the received packets. The IED must detect the Sampled Values messages sent by the MergingUnit block.

4. Troubleshooting 4.1 Opal IEC 61850 The environment variable: OP61850_TRACE=ON provides tracing information upon driver and blocks calls and return values.

Page 8

Opal-RT Support for IEC61850 User Guide 4.2 Merging Unit 4.2.1 Tcpdump The command tcpdump may be used to dump the header of the Ethernet packets on a specific Ethernet interface. Assuming the block MergingUnit uses the interface eth1, run the following command to detect if Sampled Values messages are sent onto the network: # tcpdump –i eth1

Figure 4: Example of tcpdump output.

4.2.2 Wireshark4 If a second Ethernet adapter is available in the command station or in a different Windows PC, Wireshark may be used to detect the correct behaviour of the MergingUnit blocks. Configure its IP address in the same range as the target and the IED. Download Wireshark (free) from the web, install it and start capturing packets on the newly configured interface.

4

http://www.wireshark.org/download.html

Page 9

Opal-RT Support for IEC61850 User Guide

Figure 5: Example of Wireshark capture

4.3 802.1Q Virtual LAN (VLAN) Support for virtual LAN is available by default in Opal-RT IEC61850 driver. In some cases this feature is not supported by default for several brands of Ethernet smart switches, in particular for Opal-RT, is the standard smart switch brand used with all its real time simulators; this smart switch by default removes the VLAN id field from Ethernet frames passing through since the factory configuration affects every port as UNTAGGED, this means, if a VLAN tagged Ethernet frame enters a port the VLAN id accompanying the frame shall serve only to accept/discard the frame but this field shall be removed. On the other hand with an Ethernet frame is going out a port it shall never have a VLAN id within frame (untagged). But how is this related to IEC61850 protocol? Some protection relays compatible with IEC61850 protocol require that incoming messages (IEC61850-9-2 sample values or IEC61850-8-1 GOOSE) have a VLAN associated to them, so the configuration of the Ethernet smart switch is important since this could lead

Page 10

Opal-RT Support for IEC61850 User Guide us to send messages lacking of VLAN id field or to have messages that shall not reach the protection relay since they are blocked by the Ethernet switch. In addition there is an environmental variable (OP61850_VLAN) that can be used to build an Ethernet frame including VLAN field (OP61850_VLAN=ON or Not defined) or build it without this field (OP61850_VLAN=OFF). So this scenario leads us to have the two possibilities: 1. When working with Ethernet smart switches that does not need configuration for VLAN, this variable could be used to generate messages with or without VLAN field. 2. In case of using an Ethernet smart switch that needs configuration like NETGEAR smart switches, it shall be the switch itself that will control the transmission of Ethernet frames with or without VLAN field. If situation two is present it is recommended that the environmental variable OP61850_VLAN must be set to ON or even not to exist, which would be better; both cases lead to the same behaviour.

4.4 Process to configure the NETGEAR Ethernet Smart Switch First of all it would be recommended to install the application Smart Control Center from NETGEAR to identify the Ethernet smart switch to configure; Application can be downloaded from http://support.netgear.com/product/GS716Tv2 or obtained from the installation CDs coming along with the equipment.

Figure 6: Smart Control Center application.

Page 11

Opal-RT Support for IEC61850 User Guide

Figure 6 shows the list of NETGEAR smart switches connected to the network; by looking at the MAC address it is possible to identify the correct switch. Click on Web Browser Access button to open the configuration web interface. Default password is: “password”.

Figure 7: Configuration Web Interface. The following sections are taken from GS716T and GS724T Smart Switches Software Administration Manual [1] from NETGEAR, they describe the process to create, configure, and assign specific Ethernet ports to VLANs. 4.4.1 VLAN Configuration Use the VLAN Configuration page to define VLAN groups stored in the VLAN membership table. The GS716T and GS724T support up to 64 VLANs. VLAN 1 is created by default, and all ports are untagged members. To display the VLAN Configuration page, click: Switching > VLAN > Basic > VLAN Configuration. To configure VLANs: 1. To add a VLAN, configure the VLAN ID, name, and type, and then click Add.  VLAN ID. Specify the VLAN Identifier for the new VLAN. (You can enter data in this field only when you are creating a new VLAN.) The range of the VLAN ID is 1–4093.

Page 12

Opal-RT Support for IEC61850 User Guide 

2. 3. 4. 5.

VLAN Name. Use this optional field to specify a name for the VLAN. It can be up to 32 alphanumeric characters long, including blanks. The default is blank. VLAN ID 1 is always named Default.  VLAN Type. This field identifies the type of the VLAN you are configuring. You cannot change the type of the default VLAN (VLAN ID = 1) because the type is always Default. When you create a VLAN on this page, its type will always be Static. To delete a VLAN, select the check box next to the VLAN ID and click Delete. You cannot delete the default VLAN. To modify settings for a VLAN, select the check box next to the VLAN ID, change the desired information, and then click Apply. Configuration changes occur immediately. Click Cancel to cancel the configuration on the screen and reset the data on the screen to the latest value of the switch. To reset the VLAN settings on the switch to the factory defaults, select the Reset Configuration check box, and click OK in the popup message to confirm. If the Management VLAN is set to a nondefault VLAN (VLAN 1), it is automatically set to 1 after a Reset Configuration.

Figure 8: VLAN configuration. Figure 8 shows a new VLAN created named IEC61850 with ID 10d. 4.4.2 VLAN Membership Configuration Use this page to configure VLAN Port Membership for a particular VLAN. You can select the Group operation through this page. To display the VLAN Membership Configuration page, click: Switching > VLAN > Advanced > VLAN Membership.

Page 13

Opal-RT Support for IEC61850 User Guide To configure VLAN membership: 1. 2. 3. 4.

From the VLAN ID field, select the VLAN to which you want to add ports. Click the orange bar below the VLAN Type field to display the physical ports on the switch. Click the lower orange bar to display the LAGs on the switch. To select the port(s) or LAG(s) to add to the VLAN, click the square below each port or LAG. You can add each interface as a tagged (T) or untagged (U) VLAN member. A blank square means that the port is not a member of the VLAN.  Tagged: Frames transmitted from this port are tagged with the port VLAN ID.  Untagged: Frames transmitted from this port are untagged. Each port can be an untagged member of only one VLAN. By default, all ports are an untagged member of VLAN 1.

Figure ports 1 and 9 which are used for IEC61850 communications are TAGGED members of VLAN ID 10, this means that all messages sent over these ports shall be tagged with VLAN ID 10.

Figure 9: VLAN ID 10 membership. Note: Remember to remove these ports from VLAN ID 1 to confine IEC61850 communications to ports belonging to VLAN ID 10. Figure 10 shows how VLAN ID 1 should look like after removing this ports from it.

Page 14

Opal-RT Support for IEC61850 User Guide

Figure 10: VLAN ID 1 Membership. 4.4.3 Port VLAN ID Configuration The Port PVID Configuration screen lets you assign a port VLAN ID (PVID) to an interface. There are certain requirements for a PVID:   

All ports must have a defined PVID. If no other value is specified, the default VLAN PVID is used. If you want to change the port’s default PVID, you must first create a VLAN that includes the port as a member.  Use the Port VLAN ID (PVID) Configuration page to configure a virtual LAN on a port. To access the Port PVID Configuration page, click: Switching > VLAN > Advanced > Port PVID Configuration. To configure PVID information: 1. To configure PVID settings for a physical port, click PORTS. 2. To configure PVID settings for a Link Aggregation Group (LAG), click LAGS. 3. To configure PVID settings for both physical ports and LAGs, click ALL. 4. Select the check box next to the interfaces to configure. You can select multiple interfaces to apply the same setting to the selected interfaces. Select the check box in the heading row to apply the same settings to all interfaces. 5. Configure the PVID to assign to untagged or priority tagged frames received on this port. 6. Specify how you want the port to handle untagged and priority tagged frames. Whichever you select, VLAN tagged frames will be forwarded in accordance with the IEEE 802.1Q VLAN standard. The factory default is Admit All.  VLAN Only: The port will discard any untagged or priority tagged frames it receives.

Page 15

Opal-RT Support for IEC61850 User Guide  7.

8. 9. 10.

Admit All: Untagged and priority tagged frames received on the port will be accepted and assigned the value of the Port VLAN ID for this port. Specify how you want the port to handle tagged frames:  Enable: A tagged frame will be discarded if this port is not a member of the VLAN identified by the VLAN ID in the tag. In an untagged frame, the VLAN is the Port VLAN ID specified for the port that received this frame.  Disable: All frames are forwarded in accordance with the IEEE 802.1Q VLAN standard. The factory default is Disable. Specify the default 802.1p priority assigned to untagged packets arriving at the port. Possible values are 0–7. Click Cancel to cancel the configuration on the screen and reset the data on the screen to the latest value of the switch. If you make any changes to this page, click Apply to send the updated configuration to the switch. Configuration changes take place immediately.

Figure 11 shows how ports 1 and 9 were configured to be associated to VLAN ID 10 so the Ethernet frames sent out of port 1 or 9 must contain a VLAN ID 10 with a priority 4.

Figure 11: Port PVID Configuration.

Page 16

Opal-RT Support for IEC61850 User Guide 5. Current Known Limitations 5.1 Common  

It is the user responsibility to verify that the MAC addresses respect the multi-cast standard. Support for QNX is not yet available

5.1.1

GOOSE Subscriber  Algorithms to decode string and timestamps types are not yet implemented  Cannot receive two identical messages on two different networks.  FCDA element can only use definitions of objects of data attributes defined within the same LD to which the FCDA belongs to.

5.1.2

Merging Unit  256 Sampled Values rate is not yet available

5.1.3

GOOSE Publisher  FCDA element can only use definitions of objects of data attributes defined within the same LD to which the FCDA belongs to.

5.1.4 

QNX Support for QNX is not yet available.

Page 17

Opal-RT Support for IEC61850 User Guide 6. Revision Log Revision 1.0 1.1

Owner Cristina Olariu David Grajeda

Date 12/01/2011 12/01/2011

1.2

Cristina Olariu

13/01/2011

1.3

David Grajeda

10/09/2012

1.4

David Grajeda

29/05/2013

1.5

David Grajeda

19/06/2013

1.6

David Grajeda

31/07/2013

Page 18

Description Initial Revision Changed Revision table location to the end of the file Added detail to GOOSE Subscriber section Paraphrased several sentences. Update based on Antoine’s comments. Updated with GOOSE Publisher information. Created 802.1Q Virtual LAN (VLAN) section. Updated Current Known limitation section. Added description of usage of environmental variable OP61850_BOOLTRUE to change the way of encoding an ASN.1 Boolean value. Typo and section numbering errors correction.

Opal-RT Support for IEC61850 User Guide 7. References Manuals: 1. [1] NETGEAR©, “GS716T and GS724T Smart Switches Software Administration Manual”, v1.0, February 2012.

Page 19