Control Parameters

IEC 104 data communication is bidirectional, i.e. both client and server can be sender and receiver of messages, which is divided into three set of frames which serves different purposes:

  • I-frames (Information Frames): payload that contains data (measurements, commands, etc) and incremental sequence number (sq);
  • S-frames (Supervisory Frames): used primarily for management and control of I-frames (Receive Ready for receipt and indicate the receiver is ready to accept more I-frames);
  • U-frames (Unnumbered Frames): used to test network connectivity (TESTFR_ACT, TESTFR_CON).

The transmission is regulated with a set of link control parameters: K,W,T0-T3, ref Properties

Connection Establishment

Parameters: T0
Used by: client
Usage: Ensuring that the client does not indefinitely wait for a respons.
Value: Typically the T0 timer is set to about 30 seconds, providing a reasonable window to accommodate network delays and server processing times.

Example:

  1. Client connects to the server and waits for T0 for server to accept connection request;
  2. Client aborts after T0 timeout;

Data Transmission

Parameters: K, W, T1, T2
Used by: client and server
Usage: Ensures all I-frames are received orderly and processed by the receiver
Values: The sender will stop sending I-frames and wait for S-frame either when number of I-frames sent before last received S-frame reach K or T1 timeout. The receiver will send S-frame when number of received I-frames reach W or T2 timeout. To avoid the sender to wait for S-frames from the receiver, W and T2 for the receiver should be less than K and T1 for the sender, typically 1/2.

Example:

  1. Server sends up to K number of I-frames before stopping and waiting for ack (S-frame);
  2. Server resends the I-frames sent after last received ack if no acknowledment is received before T1 timeout;
  3. Client sends the ack after it has received W number of I-frames or T2 has timed out.
  4. Server resets the K counter and T1 timer when receiving ack and continue sending I-frames;

Example 2:

  1. Client has X number of command items where X > Server value of W
  2. Client tries to send a command item for all items at once
  3. Client will only be able to send X - Server value of W commands before the Server has processed and sent ack (S-frame)
  4. Client will in Apis see good quality for the first successfully sent Server value of W command items and bad quality for the rest

Connection Integrity

Parameters: T3
Used by: client and server
Usage: Ensures connection is alive
Values: Typically to avoid unnecessary sending of U-frames, T3 should be greater than the other timers, typically set to 20 seconds.

Example:

  1. Client receives no I-frames within T3 timeout peroid;
  2. Client sends an U-frame (TESTFR_ACT) to test connection;
  3. Server sends an U-frame (TESTFR_CON) back to Client to confirm connection;

Choosing Client Values Based On Server Values

Calculating client parameters from server parameters

Formula and example values for calculating client side parameters:

ParameterServer ValueClient FormulaServer ExampleClient Example
KK_SW_S * 21216
WW_SK_S / 286
T030s30s
T1T1_ST2_S * 216s20s
T2T2_ST1_S / 210s8s
T320s20s

Choosing Server Values or Client Values With Unknown Server Values

Considerations for choosing K

Setting the "k" parameter has significant implications for the performance and efficiency of the network communication. The choice of a low vs. a high "k" value affects several aspects of the protocol's operation:

Low k Value (e.g., k=1):

  1. Increased Acknowledgments: A low "k" value means that each I-frame must be acknowledged before the next one can be sent. This can significantly increase the number of acknowledgment messages (S-frames), adding to the overhead in the communication.
  2. Lower Throughput: The need for frequent acknowledgments limits the number of I-frames that can be sent in a given period, potentially reducing the overall throughput of application data.
  3. Higher Sensitivity to Latency: The communication becomes more sensitive to network latency. Each I-frame's transmission depends on the round-trip time (RTT) for the acknowledgment of the previous frame, making the data transfer rate more susceptible to delays.
  4. Improved Error Recovery: On the positive side, a low "k" value can lead to faster error detection and recovery since any lost or unacknowledged frame will halt the transmission more quickly, allowing for prompt retransmission.

High k Value (e.g., k=1000):

  1. Reduced Acknowledgments: A higher "k" value allows more I-frames to be sent before an acknowledgment is required, reducing the overhead caused by acknowledgment messages and potentially making the communication more efficient.
  2. Higher Throughput: More I-frames can be "in-flight" before an acknowledgment is needed, which can significantly increase the data transmission rate, especially in networks with high latency.
  3. Buffer and Memory Considerations: Both the client and server must have sufficient buffer space to handle the higher number of unacknowledged I-frames. This requires careful resource management, especially in systems with limited memory.
  4. Delayed Error Recovery: With more unacknowledged frames allowed, it may take longer to detect and recover from errors. Lost or corrupted frames might only be identified after more frames have been sent, potentially complicating error recovery processes.

The choice between a low and high "k" value depends on the specific requirements of the application and the characteristics of the network. A low "k" may be preferred in networks where minimizing latency and quick error recovery are critical, albeit at the cost of throughput. A high "k" might be advantageous in stable networks with high latency or where maximizing throughput is desired, provided that the system can handle the increased memory and processing requirements for managing a larger number of unacknowledged frames. Balancing these factors is key to optimizing the performance and reliability of IEC 104 communications.

A commonly used range for "k" in many implementations is between 12 and 128. This range is considered to provide a good balance between throughput and the ability to quickly recover from errors in a variety of network conditions. However, the optimal value within this range, or even outside of it, should be determined based on testing and evaluation in the specific network environment and application context where it will be used.

Considerations for choosing W

A common recommendation is to set W to approximately half of K. This guideline helps to ensure that acknowledgments are received and processed before reaching the maximum number of unacknowledged I-frames, thus reducing the risk of transmission stops and enhancing data integrity.

For example, if `K = 32`, then `W` might effectively be set to around 16.

This ratio helps in managing network traffic more smoothly and prevents the scenario where the sender has to stop sending frames and wait for acknowledgments too frequently (which would happen if W is too low) or too infrequently (which risks data overflow and errors if W is too high).

Considerations for choosing T0

Recommended Setting: Typically, T0 is set to 30 seconds. This provides sufficient time for connection attempts even over slower or less reliable networks.

Considerations for choosing T1

Recommended Setting: T1 is usually set to around 15 seconds. This duration is enough to cover most transmission delays that might occur in typical network conditions.

Considerations for choosing T2

Recommended Setting: T2 is generally set shorter than T1, around 10 seconds. It should be less than T1 to ensure that a test frame can be sent and acknowledged before the T1 timeout for data frames.

Considerations for choosing T3

Recommended Setting: T3 is commonly set to 20 seconds. This setting should be longer than T1 and T2 to allow sufficient time for the test frames to be acknowledged under normal conditions.

Additional Considerations

Network Characteristics: These recommended settings can serve as a good starting point, but optimal values might vary based on specific network performance characteristics and requirements. Considerations include network latency, reliability, bandwidth, and the criticality of the application.
Adjustments and Testing: It is advisable to adjust and test these timers in the specific deployment environment to find the best settings that ensure reliable communication while minimizing unnecessary traffic.
Consistency with Standards: If there are industry-specific standards or regulations that dictate timer settings, those should take precedence to ensure compliance and interoperability.

These settings help balance the performance and reliability of the IEC 60870-5-104 communication by efficiently managing the connection lifecycle and error recovery processes. Adjustments based on actual network conditions and system performance are crucial for maintaining optimal operations.