Skip to content

IEC 60870-5-104 probe

The IEC 60870-5-104 probe acts as the controlling station. It opens one TCP connection to a controlled station (an RTU or a substation gateway), drives the STARTDT handshake and then runs one or several operations on that connection, recording every exchange with what was sent, what came back and the cause the station gave for it. VirtuProbe speaks the protocol directly, implemented from open documentation of the telegram structure rather than wrapped around a telecontrol library, so you can send a frame a conforming library would refuse (an undefined type, an APDU that ends inside an information object, a frame whose length field is wrong) and see exactly what the station did with it.

A probe is a connection, a common address and an ordered list of operations. One send opens the connection, runs the operations in order on it and closes it again. A read is sent freely. Anything that changes the station is held back until the probe is armed.

The IEC 60870-5-104 probe editor: a connection to a controlled station on port 2404 at common address 1, the Write arm switch set to read-only and an operation list holding a station interrogation, a measured-point read and a single command marked as modifying the target.

FieldDescription
HostThe address of the controlled station
PortThe TCP port (default: 2404, the registered port)
Common addressThe common ASDU address, the station address every operation uses unless it sets its own (default: 1)
Originator addressThe originator placed in the cause-of-transmission field, for a link where more than one controlling station is present (default: 0)

There is no security or identity to configure. The base IEC 60870-5-104 profile carries neither, so the probe has no TLS field and no credential. Secure 104 over TLS is out of this version.

An IEC 60870-5-104 probe holds an ordered list of operations rather than a line of free text, because 104 is a binary telecontrol protocol: each operation is a named action plus the typed arguments that action needs. Add operation appends one, a checkbox enables or disables it without deleting it, and the first operation of a new probe is a station interrogation. Each operation also takes a Label for the record and an optional Common address (override) when one operation addresses a different station than the rest.

The actions that only read the station:

OperationWhat it doesFields
STARTDT / STOPDT / TESTFRThe unnumbered session controls: start data transfer, stop it, test the linknone
INTERROGATIONA general or group interrogation, the usual way to ask a station for its current pictureQualifier of interrogation (QOI) (20 is the whole station, 21 to 36 are groups 1 to 16)
COUNTER_INTERROGATIONAsks for the integrated totals (counters)Qualifier of counter interrogation (QCC)
READReads one information object by its addressInformation object address (IOA)
TEST_COMMANDA test command the station echoesnone
DELAY_ACQUISITIONMeasures the station’s acquisition delayDelay (ms)
FILE_READReads a file from the stationName of file (NOF), File IOA
DIRECTORYLists the files the station offersFile IOA

The actions that change the station, every one of which has to be armed:

OperationWhat it doesFields
SINGLE_COMMANDA single-point command (one bit on or off)IOA, On, Select (not execute), Qualifier of command (QU)
DOUBLE_COMMANDA double-point commandIOA, State (1=off, 2=on), Select, QU
REGULATING_STEPA regulating-step commandIOA, Step (1=lower, 2=higher), Select, QU
SETPOINT_NORMALIZEDA set-point in the normalized rangeIOA, Normalized value (-1..1), Select, Qualifier (QL / QPM)
SETPOINT_SCALEDA scaled set-pointIOA, Scaled value, Select, QL / QPM
SETPOINT_FLOATA short-float set-pointIOA, Short float value, Select, QL / QPM
BITSTRINGA 32-bit bitstring commandIOA, Bitstring (32-bit)
PARAM_NORMALIZED / PARAM_SCALED / PARAM_FLOATA parameter of a measured valueIOA, the value, QL / QPM
PARAM_ACTIVATIONActivates or deactivates a parameterIOA, Parameter activation (QPA)
CLOCK_SYNCSets the station clockTime (ISO-8601, blank = now)
RESET_PROCESSResets the processQualifier of reset (QRP)
RAWSends an APDU exactly as you write it, the escape hatch for a malformed or undefined frameAPDU bytes (hex)

A command carries the select-and-execute bit. With Select (not execute) on, the operation sends the select phase only, so you can watch a station accept or reject a command without carrying it out.

Controlled stations switch breakers and move set-points, so an operation that changes the station is sent only when writes are enabled for the workspace in Settings > Advanced, the probe is Armed for writes and, from the editor, you confirm the send. In a chain, a headless run or a run over MCP there is nobody to confirm, so the first two conditions decide. With no write policy in force at all, nothing that changes the station is sent.

The connection row shows a write-arm switch and a chip that reads Armed for writes or Read-only (disarmed). A read never needs the arm. An operation that changes the station carries a modifies target chip in the list, so what mutates is visible before the send. Every control command, every parameter command, the clock set and the process reset change the station. A RAW operation always counts as a write: an arbitrary frame of unknown effect has to pass the gate.

A blocked operation is a visible, failed exchange that was never sent. It shows a Blocked chip with the reason:

ReasonMissing
WORKSPACE_WRITES_DISABLEDWrites are not enabled for the workspace
PROBE_NOT_ARMEDArmed for writes is off

A send from the editor that you decline is stopped the same way, before any frame leaves, so it too becomes a blocked exchange rather than an error. The rest of the run goes on: a later read in the same probe still runs.

The result shows how the conversation ended and how long it took. A connection that was made ends as OK, READ_TIMEOUT, CONNECTION_RESET or EOF. One that was not ends as CONNECT_REFUSED, CONNECT_TIMEOUT or RESOLVE_FAILED. A probe that could not be sent shows BLOCKED. A probe that is not valid or a send that fails on an open connection shows ERROR.

The connection opens on the first operation that needs it and the STARTDT handshake runs once before any data flows. A handshake the station does not acknowledge ends the run there, since no data would come back, rather than letting each operation time out in turn.

Below the outcome, every exchange is listed in order. Each row names the operation, marks whether it succeeded and carries chips for what came back: Confirmed for a positive activation confirmation, Negative for one with the P/N bit set, Blocked with its reason for an operation the gate refused and Cause for the cause of transmission of the station’s answer. A command counts as a success when it is confirmed and not negative; a read counts when it returns data.

An IEC 60870-5-104 response: the STARTDT handshake, the station interrogation and the measured-point read confirmed with their cause of transmission, the single command held back with the reason WORKSPACE_WRITES_DISABLED because writes are not armed.

A row expands to the detail: the ASDU Type, a Decoded table of the monitoring data (one row per information object with its address, its rendered value and a quality chip when the value is not good), the reply in full and the raw hex of every frame exchanged. A value’s quality reads GOOD or a set of flags from INVALID, NOT_TOPICAL, SUBSTITUTED, BLOCKED and OVERFLOW.

A text expression names one exchange by a case-insensitive prefix of its summary (for example INTERROGATION). A blank expression means the last exchange. For a decoded value the expression is an information object address instead, matched across every exchange. A blank expression takes the first decoded object. A miss returns an empty text rather than failing the chain.

ExtractorReturns
IEC104_SUCCESStrue when the whole probe passed, otherwise false. Takes no expression
IEC104_VALUEA decoded monitoring value. The expression is the information object address; blank is the first decoded object
IEC104_QUALITYThe quality of a decoded value: GOOD or the set flags joined by /. The expression is the information object address
IEC104_COTThe cause of transmission of an exchange’s answer, by name
IEC104_TYPE_IDThe ASDU type id of an exchange, such as M_ME_NC_1
IEC104_REPLYThe reply of an exchange, as it reads in the record
IEC104_TRANSPORT_OUTCOMEHow the conversation ended, such as OK, READ_TIMEOUT or CONNECT_REFUSED. With an exchange named, how that exchange ended

IEC 60870-5-104 is a chain step. {{variable}} placeholders resolve into the host and into the text fields of an operation (its label, a clock-sync time, the raw APDU hex) before the probe is sent; the numeric addressing fields are literal. One pattern is to interrogate a station, extract a point with IEC104_VALUE and assert on it. Another is to send a set-point, then read the same address back and compare.

An operation that changes the station has to be armed to run in a chain, because a chain step confirms nothing. Unarmed, that operation becomes a blocked exchange with the reason PROBE_NOT_ARMED and nothing is sent, while any read in the same step still runs.

Through the proxy, a 104 session is read frame by frame. Each APDU is decoded as far as it parses (its format as I, S or U, the ASDU type, the cause and the common address) and passed on unchanged in both directions, so a malformed or fuzzed frame reaches the other end as it was.

A MOCK rule turns the session into a virtual outstation. The proxy then answers the controlling station itself and never relays, since a 104 session is stateful and the handshake it answered never reached a real station. A rule matches on three structured fields:

Match fieldDescription
hostThe station the rule answers for. Blank matches any
typeIdThe request’s ASDU type, by name such as C_IC_NA_1 or by its numeric type id. Blank matches any
caThe common ASDU address, numeric. Blank matches any

The MOCK action describes the answer:

Action fieldDescription
outcomeFor a command, whether the activation confirmation is positive or negative
dataTypeFor an interrogation or a read, the ASDU type of the monitoring point returned
ioaThe information object address of that point
valueThe value of that point
qualityIts quality: GOOD, a raw descriptor octet or flag tokens from OV, BL, SB, NT, IV
cotAn optional cause of transmission for the data, by name or number
responseBytesA raw ASDU as hex, the escape hatch that carries any type verbatim

The handshake confirmations are automatic and carry no fields. A general or counter interrogation and a read are answered with the monitoring point; a command is answered with the activation confirmation the outcome names; a raw ASDU goes back verbatim. A request a virtualized session has a matching rule for but cannot answer is shown as a blocked frame and never relayed to a real station. So is any request such a session has no rule for.

The same MOCK rule also answers VirtuProbe’s own probes, chains and scripts. When a rule matches an operation, the operation is answered from the rule and is never sent to the station: its exchange is marked as mocked.

A probe file written by hand or over MCP is shaped like this.

  • The connection fields are host, port, commonAddress and originatorAddress. The write arm is writeArmed, off unless set. An absent key takes the default a person would have chosen in the editor. An absent writeArmed never turns writes on.
  • operations is an ordered list. Each operation is a type (an operation name such as INTERROGATION, SINGLE_COMMAND or RAW) plus the fields that type reads; the rest are ignored. An absent enabled means enabled.
{
"host": "{{station}}",
"commonAddress": 1,
"operations": [
{"type": "INTERROGATION", "qoi": 20},
{"type": "READ", "ioa": 4001}
]
}

An operation may also set its own commonAddress, a label for the record and a windowMs to wait longer or shorter than the default for the station’s answers. The numeric qualifiers (qoi, qcc, qrp, qualifier, qpm, qpa), the command values (state, doublePointState, stepState, normalizedValue, scaledValue, floatValue, bits), the select flag, a time for a clock sync and dataHex for a raw APDU each belong to the operations that read them.

  • TLS and IEC 62351. The base profile has no transport security. Secure 104 over TLS is out of this version.
  • Authentication. The base profile has none, so the probe sends none.
  • Redundant connection groups. A probe drives one connection to one station.
  • Acting as a real controlled station. The probe is the controlling station. The virtual outstation lives in the proxy and answers only what a mock rule describes.