This project implements the encoder/decoder of GOOSE(Generic Object Oriented Substation Event) protocol defined in IEC61850, with Rust.
To get a local copy up and running follow these simple steps.
-
Rust (>1.5) https://www.rust-lang.org/learn/get-started
-
Pnet Vheck requirement for pnet, especially on Windows platform: https://github.com/libpnet/libpnet/blob/49428d3da6d60b506261269a329ca8e6be79b241/README.md libpnet/libpnet#332 (comment)
-
Clone the repo
git clone https://github.com/orbitdoc/goose_packet.git
-
Build Rust packages
cd goose_packet/ cargo build
There are multile examples in src/bin.
-
Example of encoding and decoding GOOSE frames:
cargo run --bin example_encode_decode
-
Example of sending a GOOSE frame:
cargo run --bin example_tx 'name-of-your-network-interface'Replace
'name-of-your-network-interface'with the network interface to be used for sending GOOSE frame. In Windows, it may be'\Device\NPF_{?????????}'; In Linux, it may be'eth0'. You can also try:cargo run --bin example_tx
The error message will list all available network interfaces. Notice,
sudomay be needed to run the example in Linux:sudo ./target/debug/example_tx 'name-of-your-network-interface' -
Example of receiving GOOSE frame(s):
In first terminal, run the following example to start listening GOOOSE packets.
cargo run --bin example_rx 'name-of-your-network-interface'In the second terminal, run example 2, and there should be update in the first terminal.
Again, when
sudois needed, try:sudo ./target/debug/example_rx 'name-of-your-network-interface'