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
- The connector establishes a TCP connection to a remote IEC 104 server.
- It sends a General Interrogation request to receive a full snapshot of all current data points.
- After the initial snapshot, it continuously receives live updates as values change on the remote server.
- Each received data point is written to the central data store (Valkey) — both as a current value and as a stream event.
IEC 104 Server (RTU / SCADA) → IEC 104 Inbound Connector → Valkey → REST / other connectors
Connection Details
| Setting | Default |
|---|---|
| Protocol | TCP/IP |
| Port | 2404 |
| Mode | Client (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:
| Address | What It Means | Range |
|---|---|---|
| CASDU | Station address — identifies a group or location | 0–65,535 |
| IOA | Data point address — identifies a specific measurement | 0–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, IOA200→ Voltage at Substation A - CASDU
100, IOA201→ Current at Substation A - CASDU
200, IOA200→ 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:
| Type | Name | Used For | Examples |
|---|---|---|---|
| Type 1 | Single Point | On/off states | Breaker open/closed, alarm active/inactive |
| Type 13 | Measured Normalized | Normalized measurements | Proportional values, percentages |
| Type 30 | Single Point with Timestamp | On/off states with time | Switch state changes with exact time |
| Type 36 | Float with Timestamp | Measurements | Temperature, voltage, current, humidity |
Unsupported ASDU types received from the remote server are rejected with a negative confirmation.
Configuration
The connector is configured in two ways:
- 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 Valkey.
- Command-line / TOML file — For initial startup parameters (connector ID, Valkey connection, remote server address, log level). A TOML configuration file can be generated with the
config-gensubcommand.
Startup Parameters
These parameters are passed via command line or TOML file when starting the connector:
| Parameter | Description | Required | Default |
|---|---|---|---|
--id | Unique connector ID (from the Management UI) | Yes | — |
--log-level | Log verbosity (trace, debug, info, warning, error, critical, off) | No | info |
--config | Path to a TOML configuration file | No | — |
Client subcommand — Connection to the remote IEC 104 server:
| Parameter | Description | Default |
|---|---|---|
--host | Remote IEC 104 server hostname | 127.0.0.1 |
--port | Remote IEC 104 server port | 2404 |
--t0 | Connection establishment timeout | Protocol default |
--t1 | Send/test APDU timeout | Protocol default |
--t2 | Acknowledge timeout (no data) | Protocol default |
--t3 | Test frame timeout (long idle) | Protocol default |
-k | Maximum unacknowledged I-frames (send window) | Protocol default |
-w | Acknowledge after receiving w I-frames | Protocol default |
All protocol timing parameters are validated against the allowed IEC 104 ranges.
Redis subcommand — Connection to Valkey:
| Parameter | Description | Default |
|---|---|---|
--host | Valkey host (with optional port, e.g., valkey:6379) | 127.0.0.1 |
--port | Valkey port (overrides port in --host) | 6379 |
--pwd | Valkey password | — |
--stream-max-length | Maximum length of the Redis stream | 1000 |
--in-stream | Stream name for data updates | process: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.
| Setting | Description |
|---|---|
| Host | Remote IEC 104 server hostname |
| Port | Remote IEC 104 server port |
| Log Level | Override logging level |
These values override the corresponding CLI/file options at startup.
Protocol Timing Parameters
| Setting | Description | Default |
|---|---|---|
| T0 | Connection establishment timeout | Protocol default |
| T1 | Timeout for sent messages awaiting acknowledgment | Protocol default |
| T2 | Timeout for sending an acknowledgment | Protocol default |
| T3 | Idle timeout before a test message is sent | Protocol default |
| K | Maximum number of unacknowledged I-frames | Protocol default |
| W | Number of received I-frames before an acknowledgment is sent | Protocol 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 Valkey. 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 Valkey 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 addressioa— Information Object Addresssource— The connector IDdata— 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 Valkey under:
connectors:{CONNECTOR_ID}:config — connector settings (host, port, log level)
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:
| Timer | Purpose | On Timeout |
|---|---|---|
| T0 | Connection establishment timeout | Cancel connection attempt |
| T1 | Pending acknowledgment timeout | Close connection (triggers reconnect) |
| T2 | Unacknowledged received frames | Send supervisory frame |
| T3 | Idle connection keepalive | Send test frame |
If the remote server does not respond within the configured timeouts, the connection is considered lost and the reconnection cycle begins.