Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

AttributeDescriptionExpected valuesMandatory
namethis identifies the protocol stackiec104client, iec104server, tase2client, tase2server, 61850client, 61850server, etc...Yes
versionversion number of the configuration file2 digits x.y => x = major change, y = minor changeYes
redundancy_groupsarray of redundancy groups
Yes
redundancy_groups.connectionsarray of connections of a given redundancy group
Yes
redundancy_groups.connections.srv_ipIP address to remote IEC 104 serverIP addressYes
redundancy_groups.connections.portport number to remote IEC 104 serverdefault = 2404No
redundancy_groups.connections.connestablish connection at startupTRUE, FALSE, default = TRUENo
redundancy_groups.connections.startstart data transfer at startupTRUE, FALSE, default = TRUENo
redundancy_groups.k_valueMaximum number of outstanding (unacknowledged) APDU's at a given timedefault = 12No
redundancy_groups.connections.w_valueAcknowledge the reception latest after this number of APDU'sdefault = 8No
redundancy_groups.connections.t0_timeouttime out of connection establishmentdefault = 10No
redundancy_groups.connections.t1_timeouttime out for send or test APDU'sdefault = 15No
redundancy_groups.connections.t2_timeouttime out for acknowledges in case of no data messages (t2 < t1)default = 10No
redundancy_groups.connections.t3_timeouttime out for sending test framesdefault = 20No
redundancy_groups.rg_namethis identifies the redundancy group
Yes
redundancy_groups.tlsactivation of TLS (see tls configuration chapter for details)TRUE, FALSE, default = FALSENo
connorig_allestablish all paths within one connection at the same time (=TRUE) or only one (=FALSE)TRUE, FALSE, default = FALSENo
start_allstart communication on all established paths at the same time (=TRUE) or on only one (=FALSE)TRUE, FALSE, default = FALSENo
conn_passvestablish connection even in passive mode (=TRUE) or not (=FALSE)TRUE, FALSE, default = FALSENo
orig_addrOriginator Addressdefault = 0No
ca_asdu_sizesize of "Common Address of ASDU"default = 2 (byte)No
addrOriginator Addressdefault = 0No
ca_asdu_sizesize of "Common Address of ASDU"default = 2 (byte)No
ioaddr_sizesize of 'Information Object Address'default = 3 (byte)No
startup_timetime to wait for startup completiondefault = 180 (seconds)No
asdu_size

maximum ASDU size in transmission direction, if set to "0" => maximum possible value is automatically used.

default = 0 (byte)No
gi_timetime to wait for General Interrogation (GI) completiondefault = 0 (seconds)No
gi_cyclesend General Interrogation (GI) cyclicallyTRUE, FALSE, default = FALSENo
gi_all_casend a separate GI request to every CA; otherwise a broadcast GI request is usedTRUE, FALSE, default = FALSENo
gi_repeat_countrepeat GI for this number of times in case it is incompletedefault = 2No
disc_qualinformation object quality in case of interrupted connectionIV = Invalid, NT = Not Topical, default = NTNo
send_iv_timetime delay before infos are sent as invalid (0 = deactivated)default = 0No
tsivspecifies what to do with a time stamp marked as 'invalid'

remove, process, default = remove

remove: the time stamp will be removed from the information object

process: the time stamp will be processed on regular basis and additionally marked as 'not synchronized'

No
utc_timeUTC timezone (=TRUE) or local timezone (=FALSE) for time conversionTRUE, FALSE, default = FALSENo
comm_wttaguse commands with time tag (=TRUE) or without time tag (=FALSE)TRUE, FALSE, default = FALSENo
comm_parallelmaximum number of commands to be executed at in parallel (0 = unlimited)default = 0No
exec_cycl_testexecute cyclical test requests (C_TS_NA_1/C_TS_TA_1) in monitoring direction (=TRUE) or not (=FALSE)TRUE, FALSE, default = FALSENo
startup_statestartup in active mode (=TRUE) or in passive mode (=FALSE)TRUE, FALSE, default = TRUENo
reverseallow transmission of information objects in reverse direction (=TRUE) or only in standard direction (=FALSE)TRUE, FALSE, default = FALSENo
time_syncperform time synchronization (=TRUE)TRUE, FALSE, default = FALSENo

...

Code Block
languagejs
{
   "protocol_stack":{
      "name":"iec104client",
      "version":"1.0",
      "transport_layer":{
         "redundancy_groups":[
            {
               "connections":[
                  {
                     "srv_ip":"192.168.0.10",
                     "port":2404,
                     "conn":true,
                     "start":true,
                     "k_value":12},
                     "w_value":8,{
                     "t0srv_timeoutip":10"192.168.0.11",
                     "t1_timeout":15port":2404,
                     "t2_timeoutconn":10true,
                     "t3_timeoutstart":20false
                  },
                  {],
                     "srv_ip":"192.168.0.11"rg_name":"red-group-1",
                     "port"tls":2404false,
                     "connk_value":true12,
                     "startw_value":false8,
                     "kt0_valuetimeout":1210,
                     "wt1_valuetimeout":815,
                     "t0t2_timeout":10,
                     "t1t3_timeout":15,20
               },
      "t2_timeout":10,
      {
               "t3_timeoutconnections":20[
                  }{
               ]      "srv_ip":"192.168.0.12",
               "rg_name":"red-group-1",
      "port":2404,
                     "tlsconn":false,
            },
         "start":false
   {
               "connections":[},
                  {
                     "srv_ip":"192.168.0.1213",
                     "port":2404,
                     "conn":false,
                     "start":false,
                     "k_value":12,}
                     "w_value":8],
                     "t0_timeout":10"rg_name":"red-group-2",
                     "t1_timeout"tls":15false,
                     "t2k_timeoutvalue":1012,
                     "t3w_timeoutvalue":208,
                  }"t0_timeout":10,
                  {
 "t1_timeout":15,
                    "srvt2_iptimeout":"192.168.0.13"10,
                     "portt3_timeout":2404,20
            }
         "conn":false,]
      },
       "application_layer":{
         "startorig_addr":false0,
         "ca_asdu_size":2,
            "kioaddr_valuesize":123,
            "startup_time":180,
         "wasdu_valuesize":80,
            "gi_time":60,
         "t0gi_timeoutcycle":10false,
            "gi_all_ca":false,
         "t1gi_repeat_timeoutcount":152,
            "disc_qual":"NT",
         "t2send_iv_timeouttime":100,
         "tsiv":"REMOVE",
            "t3_timeout"utc_time":20false,
         "comm_wttag":false,
         }"comm_parallel":0,
               ],
  "exec_cycl_test":false,
             "rgstartup_namestate":"red-group-2"true,
               "tlsreverse":false,
            }"time_sync":false
      }
   ]}
}

IEC 104 datapoint representation

This is the Datapoint representation of an IEC 104 ASDU.

Code Block
languagejs
{
   "data_object":{
   },
      "applicationdo_layertype":{
 "type_id",
        "origdo_addrca":0"ca",
         "cado_asdu_sizeoa":2"oa",
         "ioaddrdo_sizecot":3"cot",
         "startupdo_timetest":180"istest",
         "asdudo_sizenegative":0"isnegative",
         "gido_timeioa":60"ioa",
         "gido_cyclevalue":false"value",
         "gi_all_ca":falsedo_quality":"quality_desc",
         "gi_repeat_count":2do_ts":"time_marker",
         "disc"do_ts_qual":"NTisinvalid",
         "senddo_iv_time":0,
         "tsiv":"REMOVE",
         "utcts_sum_time":false,
         "comm_wttag":false,"isSummerTime"
         "comm_parallel":0,
         "exec_cycl_test":false,
         "startup_state":true,
         "reverse":false,
         "time_sync":false
      }
   }
}

IEC 104 datapoint representation

This is the Datapoint representation of an IEC 104 ASDU.

Code Block
languagejs
{
   "data_object":{
      "do_type":"type_id",
      "do_ca":"ca",
      "do_oa":"oa",
      "do_cot":"cot",
      "do_test":"istest",
      "do_negative":"isnegative",
      "do_ioa":"ioa",
      "do_value":"value",
      "do_quality":"quality_desc",
      "do_ts":"time_marker",
      "do_ts_qual":"isinvalid",
      "do_ts_sum_time":"isSummerTime"
   }
}

Path exploration

...

In redundant network configuration or generally in cases where several communication paths exist between one client and one server, the path checking exploration mechanism allows the client to try all the paths one by one without making any difference between them. The client uses the first available path. On disconnection this procedure starts again from the beginning.

TLS configuration

The CS 104 standard can also be used with TLS to realize secure and authenticated connections.

3 parameters are needed to set up the TLS secured connection:

  • private key file
  • server certificate
  • root certificate (CA)

Fledge's certificate store allows certificates to be stored and used by the south plugins.

Code Block
languagejs
{
  "tls_conf:": {
    "private_key": "server-key.pem",
    "server_cert": "server.cer",
    "ca_cert": "root.cer"
  }
}

IEC 104 north plugin (server/slave)

IEC 104 redundancy server modes

Multiple redundancy groups

The MZ Automation lib60870 server provides 3 different modes regarding the support of redundant connections and events queue handling:

  • The default mode (CS104_MODE_SINGLE_REDUNDANCY_GROUP) allows only a single active client connection.
  • The second mode (CS104_MODE_CONNECTION_IS_REDUNDANCY_GROUP) allows multiple active client connections.
  • The third mode (CS104_MODE_MULTIPLE_REDUNDANCY_GROUPS) allows multiple active client connections while preserving events when no client is connected.

In the case of this design, the south plugin will be implemented with CS104_MODE_MULTIPLE_REDUNDANCY_GROUPS server mode.

This mode allows multiple active client connections while preserving events when no client is connected. In this mode clients can be assigned to specific redundancy groups. The assignment is based on the IP address of the client. A redundancy group can have multiple simultaneous connections but only one of these connections can be active. The number of activated connections is restricted by the number of redundancy groups. Each redundancy group has a dedicated event queue.

It can be set with the CS104_Slave_setServerMode function:

Code Block
languagecpp
CS104_Slave_setServerMode(slave, CS104_MODE_MULTIPLE_REDUNDANCY_GROUPS);

Multiple redundancy groups example

...

}
}

Path exploration

draw.io Diagram
bordertrue
diagramNamefp_path_exploring
simpleViewerfalse
linksauto
tbstyletop
lboxtrue
diagramWidth343
revision3

In redundant network configuration or generally in cases where several communication paths exist between one client and one server, the path checking exploration mechanism allows the client to try all the paths one by one without making any difference between them. The client uses the first available path. On disconnection this procedure starts again from the beginning.

TLS configuration

The CS 104 standard can also be used with TLS to realize secure and authenticated connections.

3 parameters are needed to set up the TLS secured connection:

  • private key file
  • server certificate
  • root certificate (CA)

Fledge's certificate store allows certificates to be stored and used by the south plugins.


Code Block
languagejs
{
  "tls_conf:": {
    "private_key": "server-key.pem",
    "server_cert": "server.cer",
    "ca_cert": "root.cer"
  }
}

IEC 104 north plugin (server/slave)

IEC 104 redundancy server modes

Multiple redundancy groups

The MZ Automation lib60870 server provides 3 different modes regarding the support of redundant connections and events queue handling:

  • The default mode (CS104_MODE_SINGLE_REDUNDANCY_GROUP) allows only a single active client connection.
  • The second mode (CS104_MODE_CONNECTION_IS_REDUNDANCY_GROUP) allows multiple active client connections.
  • The third mode (CS104_MODE_MULTIPLE_REDUNDANCY_GROUPS) allows multiple active client connections while preserving events when no client is connected.

In the case of this design, the south plugin will be implemented with CS104_MODE_MULTIPLE_REDUNDANCY_GROUPS server mode.

This mode allows multiple active client connections while preserving events when no client is connected. In this mode clients can be assigned to specific redundancy groups. The assignment is based on the IP address of the client. A redundancy group can have multiple simultaneous connections but only one of these connections can be active. The number of activated connections is restricted by the number of redundancy groups. Each redundancy group has a dedicated event queue.

It can be set with the CS104_Slave_setServerMode function:

Code Block
languagecpp
CS104_Slave_setServerMode(slave, CS104_MODE_MULTIPLE_REDUNDANCY_GROUPS);

Multiple redundancy groups example

draw.io Diagram
bordertrue
diagramNamefp_multi_redundancy_groups
simpleViewerfalse
linksauto
tbstyletop
lboxtrue
diagramWidth601
revision3

In this example, 2 control centers, center A and B, are establishing communication with the server.

Both centers have an active and a stand-by gateway for failover management. 

Center A has two simultaneous connections, one active and one stand-by, assigned to redundancy group 1.

Center B has only one active connection, assigned to redundancy group 2.

IEC 104 Protocol stack configuration

The IEC 104 protocol stack configuration specifies communication parameters and is a collection of entries containing information about OSI Transport and OSI Application layers objects.

Each entry is comprised of attributes that describe the object. All the configuration data are structured using JSON.

Each entry shall be mapped with the corresponding configuration function in the chosen implementation protocol library.

Attributes definition

AttributeDescriptionExpected valuesMandatory
namethis identifies the protocol stackiec104client, iec104server, tase2client, tase2server, 61850client, 61850server, etc...Yes
versionversion number of the configuration file2 digits x.y => x = major change, y = minor changeYes
redundancy_groupsarray of redundancy groups
Yes
redundancy_groups.connectionsarray of connections of a given redundancy group
Yes
redundancy_groups.connections.clt_ipaddress to local IEC 104 clientIP addressYes
redundancy_groups.rg_namethis identifies the redundancy group
Yes
bind_on_ipbind on a dedicated local IP addressTRUE, FALSE, default = FALSENo
srv_ipServer IP addressIP address, machine's default IP for a given interfaceNo
portThis defines the TCP/IP port to be used by the server.default = 2404No
tlsactivation of TLS (see tls configuration chapter for details)TRUE, FALSE, default = FALSENo
k_valueMaximum number of outstanding (unacknowledged) APDU's at a given timedefault = 12No
w_valueAcknowledge the reception latest after this number of APDU'sdefault = 8No
t0_timeouttime out of connection establishmentdefault = 10No
t1_timeouttime out

In this example, 2 control centers, center A and B, are establishing communication with the server.

Both centers have an active and a stand-by gateway for failover management. 

Center A has two simultaneous connections, one active and one stand-by, assigned to redundancy group 1.

Center B has only one active connection, assigned to redundancy group 2.

IEC 104 Protocol stack configuration

The IEC 104 protocol stack configuration specifies communication parameters and is a collection of entries containing information about OSI Transport and OSI Application layers objects.

Each entry is comprised of attributes that describe the object. All the configuration data are structured using JSON.

Each entry shall be mapped with the corresponding configuration function in the chosen implementation protocol library.

Attributes definition

AttributeDescriptionExpected valuesMandatory
namethis identifies the protocol stackiec104client, iec104server, tase2client, tase2server, 61850client, 61850server, etc...Yes
versionversion number of the configuration file2 digits x.y => x = major change, y = minor changeYes
bind_on_ipbind on a dedicated local IP addressTRUE, FALSE, default = FALSENo
srv_ipServer IP addressIP address, machine's default IP for a given interfaceNo
portThis defines the TCP/IP port to be used by the server.default = 2404No
tlsactivation of TLS (see tls configuration chapter for details)TRUE, FALSE, default = FALSENo
k_valueMaximum number of outstanding (unacknowledged) APDU's at a given timedefault = 12No
w_valueAcknowledge the reception latest after this number of APDU'sdefault = 8No
t0_timeouttime out of connection establishmentdefault = 10No
t1_timeouttime out for send or test APDU'sdefault = 15No
t2_timeouttime out for acknowledges in case of no data messages (t2 < t1)default = 10No
t3_timeouttime out for sending test framesdefault = 20No
orig_addrOriginator Addressdefault = 0No
ca_asdu_sizesize of "Common Address of ASDU"default = 2 (byte)No
ioaddr_sizesize of 'Information Object Address'default = 3 (byte)No
asdu_size

maximum ASDU size in transmission direction, if set to "0" => maximum possible value is automatically used.

default = 0 (byte)No
time_syncIf set on "TRUE" this parameter allows to synchronize the clock of the local computer by the server. If set on "FALSE", the clock is not synchronized.TRUE, FALSE, default = FALSENo
comm_exec_timeoutDefines the command execution monitoring timeout in milliseconds. The default setting is 20 seconds.default = 20 seconds (20 000 ms)No
comm_recv_timeoutThis parameter defines the highest allowable deviation of received command time tag and local clock. If the difference is too big, command is ignored.default = 0 (disabled)No
tsivspecifies what to do with a time stamp marked as 'invalid'

ignore, process, default = ignore

ignore: the time stamp quality 'not synchronized' will be ignored and the time stamp will be processed on regular basis. IV-bit will remain 0

process: the time stamp will be send with IV-bit set to 1

No
resetreset/restart the system on C_RP_NA_1 ASDU (=TRUE) or not (=FALSE)TRUE, FALSE, default = FALSENo
filter_origaccept commands only originated from an authorized originator (=TRUE) or accept all originators (=FALSE)TRUE, FALSE, default = FALSEfilter_listList of Authorized OriginatorsNo

Configuration JSON structure

_asdu_sizesize of "Common Address of ASDU"default = 2 (byte)No
ioaddr_sizesize of 'Information Object Address'default = 3 (byte)No
asdu_size

maximum ASDU size in transmission direction, if set to "0" => maximum possible value is automatically used.

default = 0 (byte)No
time_syncIf set on "TRUE" this parameter allows to synchronize the clock of the local computer by the server. If set on "FALSE", the clock is not synchronized.TRUE, FALSE, default = FALSENo
comm_exec_timeoutDefines the command execution monitoring timeout in milliseconds. The default setting is 20 seconds.default = 20 seconds (20 000 ms)No
comm_recv_timeoutThis parameter defines the highest allowable deviation of received command time tag and local clock. If the difference is too big, command is ignored.default = 0 (disabled)No
tsivspecifies what to do with a time stamp marked as 'invalid'

ignore, process, default = ignore

ignore: the time stamp quality 'not synchronized' will be ignored and the time stamp will be processed on regular basis. IV-bit will remain 0

process: the time stamp will be send with IV-bit set to 1

No
resetreset/restart the system on C_RP_NA_1 ASDU (=TRUE) or not (=FALSE)TRUE, FALSE, default = FALSENo
filter_origaccept commands only originated from an authorized originator (=TRUE) or accept all originators (=FALSE)TRUE, FALSE, default = FALSE
filter_listList of Authorized Originators
No

Configuration JSON structure

Code Block
languagejs
{
   "protocol_stack":{
      "name":"iec104server",
      "version":"1.0",
      "transport_layer":{
Code Block
languagejs
{
   "protocol_stack":{
      "name":"iec104server",
      "version":"1.0",
      "transport_layer":{
         "redundancy_groups":[
            {
               "connections":[
                  {
                     "clt_ip":"192.168.0.10",
                     "port":2403
                  },
                  {
                     "clt_ip":"192.168.0.11",
                     "port":2404
                  },
                  {
                     "clt_ip":"10.152.1.10",
                     "port":2405
                  },
                  {
                     "clt_ip":"10.152.1.11",
                     "port":2406
                  }
               ],
			   "rg_name":"red-group-1",
               "tls":false,
               "k_value":12,
               "w_value":8,
               "t0redundancy_timeoutgroups":10,[
               "t1_timeout":15,{
               "t2_timeoutconnections":10,[
                  "t3_timeout":20
{
              },
         "clt_ip":"192.168.0.10"
   {
               "connections":[},
                  {
                     "clt_ip":"192.168.0.1011",
                     "port":2403},
                  },{
                  {
   "clt_ip":"10.152.1.10"
                  "clt_ip":"192.168.0.11"},
                  {
   "port":2404
                  },"clt_ip":"10.152.1.11"
                  {}
                  ],
			   "cltrg_ipname":"192.168.0.12",red-group-1"
             },
        "port":2405
    {
               },"connections":[
                  {
                     "clt_ip":"192.168.0.1410",
                     "port":2406},
                  },{
                  {
   "clt_ip":"192.168.0.11"
                  "clt_ip":"10.152.1.10"},
                  {
   "port":2403
                  },"clt_ip":"192.168.0.12"
                  {},
                     "clt_ip":"10.152.1.11",{
                     "portclt_ip":2404"192.168.0.14"
                  },
                  {
                     "clt_ip":"10.152.1.12",10"
                  },
                  {
                     "portclt_ip":2405"10.152.1.11"
                  },
                  {
                     "clt_ip":"10.152.1.1312",
                  },
   "port":2406
               {
   }
               ],
			   "rgclt_nameip":"red-group-2",
10.152.1.13"
                  "tls":false,}
               "k_value":12,],
			   "rg_name":"red-group-2"
            }
   "w_value":8,
      ],
         "t0bind_on_timeoutip":10false,
               "t1srv_timeoutip":15"0.0.0.0",
         "port":2404,
      "t2_timeout   "tls":10false,
               "t3k_timeoutvalue":2012,
            }"w_value":8,
         ]"t0_timeout":10,
         "bindt1_on_iptimeout":false15,
         "srvt2_iptimeout":"0.0.0.0"10,
         "portt3_timeout":240420
      },
      "application_layer":{
         "orig_addr":"0",
         "ca_asdu_size":2,
         "ioaddr_size":3,
         "asdu_size":0,
         "time_sync":false,
         "comm_exec_timeout":20000,
         "comm_recv_timeout":5000,
         "tsiv":"IGNORE",
         "reset":false,
         "filter_orig":false,
         "filter_list":[
            {
               "orig_addr":1
            },
            {
               "orig_addr":2
            }
         ]
      }
   }
} 

...