Skip to main content

IEC 104 Inbound Connector

What Is It?

The IEC 104 Inbound Connector brings data from external industrial control systems into the ALP-CONNEX platform. It acts as a client that actively connects to remote IEC 104 servers — such as RTUs, substations, or other SCADA systems — and reads their process data using the IEC 60870-5-104 standard.

In short: the IEC 104 Inbound Connector is the inbound gateway that pulls data from IEC 104 systems into your platform.

This is the counterpart to the IEC 104 Connector, which operates as a server. The Inbound Connector operates as a client.

How It Works

  1. The connector establishes a TCP connection to a remote IEC 104 server.
  2. It sends a General Interrogation request to receive a full snapshot of all current data points.
  3. After the initial snapshot, it continuously receives live updates as values change on the remote server.
  4. Each received data point is written to the central data store — both as a current value and as a stream event.
IEC 104 Server (RTU / SCADA) → IEC 104 Inbound Connector → Data Store → REST / other connectors

Connection Details

SettingDefault
ProtocolTCP/IP
Port2404
ModeClient (connects to a remote server)

The connector only operates as a client. It connects to remote IEC 104 servers — it does not accept incoming connections.

IEC 104 Addressing

Every data point in the IEC 104 protocol is identified by two addresses:

AddressWhat It MeansRange
CASDUStation address — identifies a group or location0–65,535
IOAData point address — identifies a specific measurement0–16,777,215

The combination of CASDU and IOA must be unique across the system. Think of CASDU as the "building" and IOA as the "sensor" within that building.

Example:

  • CASDU 100, IOA 200 → Voltage at Substation A
  • CASDU 100, IOA 201 → Current at Substation A
  • CASDU 200, IOA 200 → Voltage at Substation B

Supported Data Types

The connector supports all IEC 104 data types recognized by the platform's IEC 104 core library. The most commonly used types are:

Monitoring types (inbound data):

TypeNameUsed ForExamples
Type 1Single PointOn/off statesBreaker open/closed, alarm active/inactive
Type 3Double PointTwo-bit statesBreaker open/closed/transit/invalid
Type 13Measured NormalizedNormalized measurementsProportional values, percentages
Type 30Single Point with TimestampOn/off states with timeSwitch state changes with exact time
Type 31Double Point with TimestampTwo-bit states with timeBreaker state changes with exact time
Type 32Step Position with TimestampTransformer tap positions-64 to 63
Type 36Float with TimestampMeasurementsTemperature, voltage, current, humidity

Command types (outbound control):

TypeNameUsed ForExamples
Type 45Single CommandOn/off commandstrue/false
Type 46Double CommandOpen/close/stop commands03
Type 47Regulating Step CommandStep up/down commands03
Type 50Set-point NormalizedAnalog set-point valuesFloating-point set-points

Unsupported ASDU types received from the remote server are logged to the error stream and rejected with a negative confirmation.

Configuration

The connector is configured in two ways:

  1. Management UI / API — The primary method. When you create an IEC 104 Inbound connector in the Management UI, the configuration (server address, protocol parameters) is stored in the database and automatically pushed to the connector via the data store.
  2. Command-line / TOML file — For initial startup parameters (connector ID, data store connection, remote server address, log level). A TOML configuration file can be generated with the config-gen subcommand.

Startup Parameters

These parameters are passed via command line or TOML file when starting the connector:

ParameterDescriptionRequiredDefault
--idUnique connector ID (from the Management UI)Yes
--log-levelLog verbosity (trace, debug, info, warning, error, critical, off)Noinfo
--configPath to a TOML configuration fileNo

Client subcommand — Connection to the remote IEC 104 server:

ParameterDescriptionDefault
--hostRemote IEC 104 server hostname127.0.0.1
--portRemote IEC 104 server port2404
--t0Connection establishment timeoutProtocol default
--t1Send/test APDU timeoutProtocol default
--t2Acknowledge timeout (no data)Protocol default
--t3Test frame timeout (long idle)Protocol default
-kMaximum unacknowledged I-frames (send window)Protocol default
-wAcknowledge after receiving w I-framesProtocol default

All protocol timing parameters are validated against the allowed IEC 104 ranges.

Redis subcommand — Connection to the data store:

ParameterDescriptionDefault
--hostData store host (with optional port, e.g., datastore:6379)127.0.0.1
--portData store port (overrides port in --host)6379
--pwdData store password
--stream-max-lengthMaximum length of the data stream1000
--in-streamStream name for data updatesprocess:updates

Managed Settings (via Management UI)

The following settings are configured through the Management UI and pushed to the connector automatically. You do not need to set them manually.

SettingDescription
HostRemote IEC 104 server hostname
PortRemote IEC 104 server port
Log LevelOverride logging level

These values override the corresponding CLI/file options at startup.

Protocol Timing Parameters

SettingDescriptionDefault
T0Connection establishment timeoutProtocol default
T1Timeout for sent messages awaiting acknowledgmentProtocol default
T2Timeout for sending an acknowledgmentProtocol default
T3Idle timeout before a test message is sentProtocol default
KMaximum number of unacknowledged I-framesProtocol default
WNumber of received I-frames before an acknowledgment is sentProtocol default

In most cases, the default timing parameters do not need to be changed. Only adjust them if the remote server operator recommends specific values.

Dynamic Configuration Updates

When you change a connector's settings in the Management UI, the backend pushes the updated configuration to the data store. The connector detects the change and automatically restarts its client connection with the new configuration — no manual restart required.

Data Store Integration

The connector writes data points to the central data store. For each received data point, two operations are performed:

Current value (key-value):

process:image:casdu:{CASDU}:ioa:{IOA}

Stores the latest JSON-serialized data point value.

Event stream:

process:updates

Appends an entry with the following fields:

  • casdu — Common ASDU address
  • ioa — Information Object Address
  • source — The connector ID
  • data — JSON-serialized data point

The stream is capped at a configurable maximum length (default: 1000 entries) to prevent unbounded growth.

The backend publishes connector configuration to the data store under:

connectors:{CONNECTOR_ID}:config     — connector settings (host, port, log level, streams)

The connector's data streams (output, error) are configured via the Management UI and included in the published configuration. The output stream name and maximum stream length can also be overridden via CLI parameters (--in-stream, --stream-max-length). The error stream receives unsupported ASDU type notifications and client errors.

Error Reporting

The connector writes error entries to the configured error stream when it encounters issues:

ErrorDescription
Unsupported ASDU typeA data point with an unrecognized IEC 104 type was received from the remote server
Client connection errorA protocol or network error occurred on the client connection

Error entries include the connector ID, timestamp, and details about the failure.

Connector Health Reporting

The connector publishes its operational state to the central data store, enabling the Management UI to display real-time health information:

StateMeaning
StartingThe connector is initializing and loading configuration
RunningThe connector is connected and processing data normally
ErrorConfiguration loading failed or a critical error occurred
StoppedThe connector is shutting down gracefully

The connector also reports its software version at startup, which is visible in the Management UI.

Connection Behavior

Initial Data Request

On successful connection, the connector sends a General Interrogation command to the remote server. This retrieves a complete snapshot of all available data points, ensuring the data store starts with a full picture of the current system state.

Live Updates

After the initial interrogation, the connector receives updates in real time as values change on the remote server. Each update is immediately written to the data store and published to the event stream.

Automatic Reconnection

If the connection to the remote server is lost — due to network issues, server restart, or protocol errors — the connector automatically detects the connection failure and retries every 2 seconds until the connection is re-established. Once reconnected, it performs a new General Interrogation to resynchronize.

The connector also handles edge cases such as:

  • TCP connection failures that are not immediately reported by the operating system
  • T0 timeout — if the initial TCP connection cannot be established within the configured timeout, the attempt is canceled and retried

Connection Monitoring

The connector uses IEC 104 protocol timers to monitor the health of the connection:

TimerPurposeOn Timeout
T0Connection establishment timeoutCancel connection attempt
T1Pending acknowledgment timeoutClose connection (triggers reconnect)
T2Unacknowledged received framesSend supervisory frame
T3Idle connection keepaliveSend test frame

If the remote server does not respond within the configured timeouts, the connection is considered lost and the reconnection cycle begins.