...
IEC 104 south plugin (client/master)
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.
Code Block | ||
---|---|---|
| ||
{
"protocol_stack":{
"name":"iec104master",
"version":"1.0",
"transport_layer":{
"connection":{
"path":[
{
"srv_ip":"192.168.0.10",
"clt_ip":"",
"port":2404
},
|
...
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 | ||
---|---|---|
| ||
CS104_Slave_setServerMode(slave, CS104_MODE_MULTIPLE_REDUNDANCY_GROUPS); |
Multiple redundancy groups example
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.
IEC 104 Master (client) Protocol stack configuration
Code Block | ||
---|---|---|
| ||
{ "protocol_stack":{ "name":"iec104master", "version":"1.0", "transport_layer":{ "connection":{ "path":[ { "srv_ip":"192.168.0.1011", "clt_ip":"", "port":2404 }, ], { "tls":"NONE" "srv_ip":"192.168.0.11"}, "k_value":12, "cltw_ipvalue":""8, "t0_timeout":10, "portt1_timeout":240415, }"t2_timeout":10, ]"t3_timeout":20, "tls":"NONE""all_conn":true, }"all_start":false, "kpassive_valueconn":12,false }, "wapplication_valuelayer":8,{ "t0orig_timeoutsize":101, "t1orig_timeoutaddr":15"", "t2ca_asdu_timeoutsize":102, "t3ioaddr_timeoutsize":203, "allstartup_conntime":true180, "allasdu_startsize":false0, "passivegi_conntime":false60, }, "applicationgi_layercycle":{0, "origgi_all_sizeca":1false, "origgi_repeat_addrcount":""2, "cadisc_asdu_sizequal":2"NT", "ioaddrsend_iv_sizetime":30, "startup_timetsiv":180"REMOVE", "asdu_sizetz":0"UTC", "gitz_timesource":60"system", "gicomm_cyclewttag":0false, "gicomm_all_caparallel":false0, "giexec_repeatcycl_counttest":2false, "discstartup_qualstate":"NTactive", "send_iv_time":0,} "tsiv":"REMOVE", "tz":"UTC", "tz_source":"system", "comm_wttag":false, } } |
IEC 104 exchanged ASDU configuration
In this chapter we will describe the configuration of the exchanged ASDU. This configuration allow to specify a list of supported ASDU types and a list of ASDU objects. The protocol plugin is expected to make some controls against each entry of the configuration to check:
- if CA of ASDU is known otherwise throw an error message.
- if IOA is known otherwise throw an error message.
- if type of ASDU is known otherwise an error message.
- The label attribute shall be used to populate the Fledge's DataPoint Asset Name attribute.
Code Block | ||
---|---|---|
| ||
{ "exchanged_data_layer":{ "comm_parallelname":0"iec104master", "exec_cycl_test":false"version":"1.0", "startupasdu_statelist":"active"[ } } } |
IEC 104 Slave (server) Protocol stack configuration
Code Block | ||
---|---|---|
| ||
{{ "protocol_stack": { "name": "iec104slave", "versionca": "1.041025", "transport_layer": { "bindtype_on_ipid": "FALSE"M_ME_NA_1", "port": 2404, "tsecuritylabel": "NONETM-1", "k_value": 12, "w_valueioa": 8, "4202832" "t1_timeout": 15 }, "t2_timeout": 10, { "t3_timeout": 20, "open_new_pathca": "TRUE41025", "bind_on_active "type_id": "FALSE"M_ME_NA_1", "disc_on_iframe "label": "TRUETM-2", }, "application_layer": { "orig_sizeioa": 1, "4202852" "orig_addr": "0" }, "ca_asdu_size": 2, { "ioaddr_size": 3, "struct_addrca": "FALSE41025", "asdutype_sizeid": 0"M_SP_TB_1", "default_class": "CLASS1", "time_synclabel": "FALSETS-1", "comm_exec_timeout": 20000, "comm_recv_timeoutioa": 5000, "4206948" "auto_comm_actcon": "FALSE", } "auto_comm_actterm": "TRUE", "cmd_block_sel": "FALSE", "abs_time": "TRUE", "tzsource": "OS",] } } |
IEC 104 to pivot format translation
IEC 104 ASDU data model
Reference: NF EN 60870-5-101 § 7.3.1.22
TYPE IDENT 30: M_SP_TB_1
DATA UNIT IDENTIFIER
TYPE IDENTIFICATION
VARIABLE STRUCTURE QUALIFIER
CAUSE OF TRANSMISSION
COMMON ADDRESS OF ASDU
INFORMATION OBJECT 1
INFORMATION OBJECT ADDRESS
SIQ
CP56Time2a
INFORMATION OBJECT i
INFORMATION OBJECT ADDRESS
SIQ
CP56Time2a
IEC 104 to pivot format conversion configuration model
Code Block | ||
---|---|---|
| ||
{ "protocol_translation_layer":{ "set_wdayname": "TRUEiec104_to_pivot", "tsivversion": "IGNORE1.0", "spon_in_passivemapping": "TRUE", { "resetdata_object_header": "TRUE", { "filterdoh_origtype": "FALSEtype_id", "lifeact "doh_ca": "TRUEca", "startup "doh_oa": "FALSEoa", "active "doh_cot": "TRUEcot", } "doh_test":"istest", "doh_negative":"isnegative" } } |
IEC 104 exchanged ASDU configuration
In this chapter we will describe the configuration of the exchanged ASDU. This configuration allow to specify a list of supported ASDU types and a list of ASDU objects. The protocol plugin is expected to make some controls against each entry of the configuration to check:
- if CA of ASDU is known otherwise throw an error message.
- if IOA is known otherwise throw an error message.
- if type of ASDU is known otherwise an error message.
- The label attribute shall be used to populate the Fledge's DataPoint Asset Name attribute.
Code Block | ||
---|---|---|
| ||
{ "exchanged_data_layer":{, "data_object_item":{ "doi_ioa":"ioa", "doi_value":"value", "name "doi_quality":"iec104masterquality_desc", "version":"1.0", "asdudoi_listts":[ { "ca":"41025""time_marker", "typedoi_ts_idflag1":"M_ME_NA_1isinvalid", "labeldoi_ts_flag2":"TM-1isSummerTime", "ioadoi_ts_flag3":"4202832isSubstituted" }, } { } } |
Conversion process
draw.io Diagram | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
NB: The conversion process shall produce as many pivot format objects as information objects in the source ASDU.
Pivot format resulting object
Code Block | ||
---|---|---|
| ||
{ "data_object_header":{ "ca":"41025", "doh_type":"some_value", "typedoh_idname":"M_ME_NA_1not_populated", "doh_ca":"some_value", "labeldoh_oa":"TM-2some_value", "ioadoh_cot":"4202852some_value", }"doh_test":"some_value", { "doh_negative":"some_value", "ca"doh_version":"41025some_value", "type_id"doh_src_prot":"M_SP_TB_1",some_value" }, "data_object_item":{ "labeldoi_ioa":"TS-1some_value", "ioa"doi_value":"4206948some_value", "doi_qual_class":"not_populated", } "doi_quality":"some_value", ] } } |
IEC 104 to pivot format translation
IEC 104 ASDU data model
Reference: NF EN 60870-5-101 § 7.3.1.22
TYPE IDENT 30: M_SP_TB_1
DATA UNIT IDENTIFIER
TYPE IDENTIFICATION
VARIABLE STRUCTURE QUALIFIER
CAUSE OF TRANSMISSION
COMMON ADDRESS OF ASDU
INFORMATION OBJECT 1
INFORMATION OBJECT ADDRESS
SIQ
CP56Time2a
INFORMATION OBJECT i
INFORMATION OBJECT ADDRESS
SIQ
CP56Time2a
IEC 104 to pivot format conversion configuration model
Code Block | ||
---|---|---|
| ||
{ "protocol_translation_layer":{"doi_current_src":"not_populated", "doi_normal_src":"not_populated", "doi_normal_value":"not_populated", "doi_ts_class":"not_populated", "doi_ts":"some_value", "namedoi_ts_qual":"iec104some_to_pivotvalue", "versiondoi_ts_sum_time":"1.0some_value", "mappingdoi_ts_subs":{ "data_object_header":{"some_value", "doh_type"doi_cov_class":"typenot_idpopulated", "doh_ca"doi_cov_counter":"canot_populated", } } |
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 | ||
---|---|---|
| ||
CS104_Slave_setServerMode(slave, CS104_MODE_MULTIPLE_REDUNDANCY_GROUPS); |
Multiple redundancy groups example
IEC 104 Protocol stack configuration
Code Block | ||
---|---|---|
| ||
{ "protocol_stack": { "name": "iec104slave", "version": "1.0", "transport_layer": { "bind_on_ip": "FALSE "doh_oa":"oa", "doh_cot":"cot", "doh_test":"istest", "doh_negative":"isnegative" }, "data_object_item":{ "doi_ioa":"ioa", "doi_value":"value", "doi_quality":"quality_desc", "doi_ts":"time_marker", "port": 2404, "doi_ts_flag1tsecurity": "isinvalidNONE", "k_value": 12, "doiw_ts_flag2value":"isSummerTime" 8, "doi_ts_flag3":"isSubstituted""t1_timeout": 15, }"t2_timeout": 10, } } } |
Conversion process
...
NB: The conversion process shall produce as many pivot format objects as information objects in the source ASDU.
Pivot format resulting object
Code Block | ||
---|---|---|
| ||
{"t3_timeout": 20, "dataopen_objectnew_headerpath":{ "TRUE", "dohbind_on_typeactive":"some_value", "FALSE", "disc_on_iframe": "TRUE" }, "dohapplication_name":"not_populated"layer": { "orig_size": 1, "dohorig_caaddr": "some_value0", "dohca_asdu_oasize":"some_value" 2, "dohioaddr_cotsize":"some_value" 3, "dohstruct_testaddr": "some_valueFALSE", "dohasdu_negativesize":"some_value" 0, "dohdefault_versionclass": "some_valueCLASS1", "dohtime_src_protsync": "some_valueFALSE", }, "datacomm_objectexec_itemtimeout":{ 20000, "doicomm_recv_ioatimeout":"some_value" 5000, "doiauto_comm_valueactcon": "some_valueFALSE", "doiauto_qualcomm_classactterm": "not_populatedTRUE", "doicmd_block_qualitysel": "some_valueFALSE", "doiabs_current_srctime": "not_populatedTRUE", "doi_normal_srctzsource": "not_populatedOS", "doiset_normal_valuewday": "not_populatedTRUE", "doi_ts_classtsiv": "not_populatedIGNORE", "doispon_in_tspassive": "some_valueTRUE", "doi_ts_qualreset": "some_valueTRUE", "doi_ts_sum_timefilter_orig": "some_valueFALSE", "doi_ts_subslifeact": "some_valueTRUE", "doi_cov_classstartup": "not_populatedFALSE", "doi_cov_counteractive": "not_populatedTRUE" } } } |
Pivot format to IEC 104 translation
...