Skip to content
IEC 60870-5-104

IEC 60870-5-104

Telecontrol between grid control centres, substations and generation or storage assets.

Transport
TCP, optional TLS
Security
TLS (IEC 62351-3), IEC 62351-5
Default port
2404
Library
go-iec60870-5 (iec104)
CLI
iec104ctl
Interop
iec60870-5-interop v0.5.0

IEC 60870-5-104 (IEC 104) is the TCP/IP telecontrol protocol of power system SCADA, and the most widely deployed member of the IEC 60870-5 family. It carries the data model of IEC 101 over TCP instead of a serial link. A controlling station (the control centre) talks to controlled stations (substations, RTUs, generation and storage assets) on TCP port 2404. Each station has a common address, and each data point an information object address. The control centre runs interrogations, receives spontaneous events, and sends commands, often with select-before-operate.

Where you meet it

  • Links between grid control centres and substations
  • Solar parks, wind farms and battery storage connected to a grid operator
  • RTUs and gateways in distribution and transmission networks

Quickstart

From the command line

Install iec104ctl with curl -fsSL https://get.otfabric.io/iec104ctl | sh, or on Windows irm https://get.otfabric.io/iec104ctl.ps1 | iex (all install options). No station at hand? Start a simulated one:

Terminal window
iec104ctl server start

and talk to it from another terminal:

Terminal window
# What does this station hold? (general interrogation)
iec104ctl client interrogate --ip 127.0.0.1 --ca 1
# Watch events and measured values as they arrive, until Ctrl-C
iec104ctl client monitor --ip 127.0.0.1 --interrogate
# Operate a disconnector with select-before-operate
iec104ctl client command --ip 127.0.0.1 --type double --ioa 5001 --value off --mode sbo
# Is the link alive, and how fast?
iec104ctl client ping --ip 127.0.0.1

With IEC 62351-5, both ends authenticate with certificates and every ASDU is authenticated, or encrypted with AES-256-GCM:

Terminal window
iec104ctl server start --secure --security-cert station.pem --security-key station.key \
--security-trust scada.pem --roles viewer
iec104ctl client interrogate --ip 127.0.0.1 --secure --security-cert scada.pem \
--security-key scada.key --security-trust station.pem --dpa aes-256-gcm

From Go

Terminal window
go get github.com/otfabric/go-iec60870-5

Connect, interrogate and synchronize the clock:

main.go
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/otfabric/go-iec60870-5/asdu"
"github.com/otfabric/go-iec60870-5/iec104/client"
)
func main() {
ctx := context.Background()
// Dial connects and sends STARTDT. Every ASDU the station sends
// reaches the handler, in order.
c, err := client.Dial(ctx, "10.0.0.5:2404",
client.WithReconnect(client.Reconnect{}),
client.WithHandler(client.HandlerFunc(func(a *asdu.ASDU) {
for _, obj := range a.Objects {
if m, ok := obj.(asdu.MeasuredFloat); ok {
fmt.Printf("%s ioa=%d value=%g quality=%s\n", a.Cause, m.IOA, m.Value, m.Quality)
}
}
})))
if err != nil {
log.Fatal(err)
}
defer c.Close()
// General interrogation of station 1.
data, err := c.Interrogate(ctx, 1, asdu.QOIStation)
if err != nil {
log.Fatal(err)
}
fmt.Printf("interrogation returned %d ASDUs\n", len(data))
if err := c.ClockSync(ctx, 1, time.Now()); err != nil {
log.Fatal(err)
}
}

What go-iec60870-5 and iec104ctl support

Roles Controlling station (client) and controlled station (server)
Client STARTDT/STOPDT, general and counter interrogation, read, clock sync, commands with select-before-operate, test command, automatic reconnect
Server Many sessions, routing by type identification, redundancy groups with an acknowledged event queue
Link layer Full APCI state machine: I/S/U frames, k/w windows, t0–t3 timers
Security TLS (IEC 62351-3), and the IEC 62351-5 A-Profile of IEC TS 60870-5-7:2025: station association with X.509 certificates, session keys, every ASDU authenticated (HMAC) or encrypted (AES-256-GCM), role-based access control. Alone or combined with TLS
Files Download, upload and the file directory, in both roles
Dependencies Go standard library only

Interoperability

iec60870-5-interop runs five independent IEC 104 stacks in containers: MZ Automation lib60870-C, OpenMUC j60870, wendy512/iec104, cB-Sigma/iec60870 and pascaldekloe/part5. go-iec60870-5’s IEC 104 client and server pass independent runs against all five. cB-Sigma is the only open-source implementation of IEC 62351-5 in its 2023 edition, and the application-layer security is tested against it in both directions; mutual TLS (IEC 62351-3), file transfer, interrogation groups and redundancy groups are tested against several of the stacks. That makes IEC 62351-5 interoperable with cB-Sigma, not conformance-tested: no certified test equipment has been used, so keep TLS with client certificates where both ends support it.

OT Fabric projects for IEC 60870-5-104

go-iec60870-5

The IEC 60870-5 telecontrol family in one module: IEC 101 on serial lines, IEC 102 for meter readings, IEC 103 for protection relays and IEC 104 over TCP/IP, each as controlling and controlled station, on shared FT 1.2, link-layer and time-tag packages. IEC 104 keeps TLS, IEC 62351-5, file transfer and redundancy groups. Pure Go, standard library only.

go get github.com/otfabric/go-iec60870-5
  • IEC 101
  • IEC 102
  • IEC 103
  • IEC 104
GitHub

iec104ctl

Interrogate, monitor and command IEC 104 stations over TLS or IEC 62351-5, transfer files, discover stations, or simulate an RTU from YAML. Part of iec60870ctl.

iec60870-5-interop

Independent IEC 60870-5 implementations in containers behind one contract, per companion standard: IEC 101 (lib60870-C, cB-Sigma, digitalpetri), IEC 102 (gisce/iec870ree, REE profile), IEC 103 (vitusdong, ARIEC103, Open103, go-iecp5 cs103) and IEC 104 (lib60870-C, OpenMUC j60870, wendy512, cB-Sigma, part5). OT Fabric's own go-iec60870-5 stack is published behind the same contract, one image per standard, for testing your stack against.

  • IEC 101
  • IEC 102
  • IEC 103
  • IEC 104
GitHub

Who is behind IEC 60870-5-104

The organizations that publish, test, certify or host open-source work for IEC 60870-5-104. Listed for reference, not as partners. Compare membership and fees.