Stack configuration options

The protocol stack can be configured at build time by setting configuration values in the stack_config.h file. If you change one of these values the complete library has to be rebuilt. Options that are present in stack_config.h but are not mentioned below should not be changed!

General options

DEBUG (client/server) if this option is set debug output will be enabled. This can be useful for debugging the protocol stack. This option should no be used in real applications because it increases code size. This option has also a negative impact on the performance of the protocol stack.

Configuration options for ISO 8073 (COTP) layer

CONFIG_COTP_MAX_TPDU_SIZE (client/server) will set the maximum TPDU (message) size of the COTP protocol layer. This value defaults to 16384 if not set in stack_config.h. The actual TPDU size will be determined in the connection handshake. For the client side this value is used as the proposed value in connection handshake. The server will use this as the maximum size allowed in the handshake phase.

Configuration options for TCP/IP

CONFIG_ACTIVATE_TCP_KEEPALIVE (server only) will activate the transmission of TCP keep-alive messages if set to 1. The TCP keepalive parameters can be set with CONFIG_TCP_KEEPALIVE_IDLE, CONFIG_TCP_KEEPALIVE_INTERVAL and CONFIG_TCP_KEEPALIVE_CNT. You should tune these parameters according to your real-time requirements!

CONFIG_TCP_KEEPALIVE_IDLE (server only) is the time in seconds the connection has to be idle until the first keep-alive message is sent.

CONFIG_TCP_KEEPALIVE_INTERVAL (server only) is the time in seconds between two subsequent keep-alive messages if no ACK response is received.

CONFIG_TCP_KEEPALIVE_CNT (server only) is the number of missing keep-alive responses until the TCP connection is considered dead.

CONFIG_MAXIMUM_TCP_CLIENT_CONNECTIONS (server only, since version 0.7.1) specifies the number of concurrent TCP connection the server accepts. If this values is set to -1 the number of connections is not limited. If not defined the number defaults to 5. Reducing the number of allowed concurrent TCP connections reduces the memory demand of the server.

Configuration options for GOOSE/SV

CONFIG_ETHERNET_INTERFACE_ID is the identifier for the Ethernet interface to be used by GOOSE and Sampled Values. This is plattform dependent. Possible values for Linux are network device names like eth0. In Windows ethernet devices can be selected by a numerical index starting with 0 for the first ethernet device, 1 for the second …

CONFIG_INCLUDE_GOOSE_SUPPORT if set to 1 code for GOOSE support will be included in the build. If GOOSE support is not required the value should be set to 0.

The following configuration options define GOOSE specific settings:

CONFIG_GOOSE_STABLE_STATE_TRANSMISSION_INTERVAL defines the GOOSE retransmission interval for the stable condition. Stable condition is
if no monitored variable has changed. This value is in ms.

The configuration options CONFIG_GOOSE_DEFAULT_PRIORITY, CONFIG_GOOSE_DEFAULT_VLAN_ID, CONFIG_GOOSE_DEFAULT_APPID, and CONFIG_GOOSE_DEFAULT_DST_ADDRESS are used as fallback values if the values are not defined in the SCL file or set by a client via MMS.

CONFIG_GOOSE_DEFAULT_PRIORITY the default value for the priority field of the 802.1Q header (allowed range 0-7) where 7 is the highest priority. In IEC 61850-8-1 a default value of 4 is proposed.

CONFIG_GOOSE_DEFAULT_VLAN_ID the default value for the VLAN ID field of the 802.1Q header – the allowed range is 2-4096 or 0 if VLAN/priority is not used.

CONFIG_GOOSE_DEFAULT_APPID the default value of the 16 bit APPID field in the GOOSE header. The APP-ID can be used by subscribers to distinguish between different applications using GOOSE.

CONFIG_GOOSE_DEFAULT_DST_ADDRESS configures the default destination MAC (Ethernet) address used by GOOSE. The value has to be given as a C array initializer. The default value is {0x01, 0x0c, 0xcd, 0x01, 0x00, 0x01}.