ClearSCADA performs Client-Server communication through what are termed 'Links' and 'Advises'.
Links are established from the client to the server to perform long or short running tasks or requests. DBServer will respond to these tasks or requests directly using the link. The client application may establish multiple links simultaneously to the same ClearSCADA server. By default links are established from any available port on the client to port 5481 on the server.
The ClearSCADA may establish an Advise connection to the client. Advise connections are used to send unsolicited updates to the client, such as alarm data and updates for Mimics. Only one advise connection is made to each client application. By default the advise connection will be established from any available port on the server to a port in the range 5500-5509 on this client allowing up to 10 client applications to be run per client machine.
Information about the currently active Links and Advises are available from the Server Status window and are recorded in the snapshots:
Notice in the above screenshot that:
The Server Icon uses 1 link and 1 advise
Link ID 1:01 which is associated with Advise 1:01
The Server Status window uses 1 link and 1 advise
Link ID 2:01 which is associated with Advise 2:01
A ViewX client is current using 5 links and 1 advise
Link ID 1:02 which is associated with Advise 1:01
Link ID 1:05
Link ID 1:06
Link ID 2:03 which is associated with Advise 1:01
Link ID 2:04 which is associated with Advise 1:01
Link Threads and Advise Threads
DBServer uses 'Link Threads' and 'Advise Threads' to handle and process communications through the link and advise connections. Details about the currently active Links Threads and Advise Threads are available from the the Server Status window.
Link threads, referred to in DBServer Logs as [SVRTHR], handle up to 16 links at a time. Advise threads, referred to in logs as [SVRADVTHR], handle up to 16 advises at a time. As an example, 10 link threads and 5 advise threads would imply that there are up to 240 (ie, 10*16 + 5*16) simultaneous TCP connections between the server and its clients.
Additional information about these threads can be found on the General-Threads tab of the Server Status window
This includes information such as how long the thread has been running and how many minutes of processor time have been dedicated to them.
DBServer Log Analysis includes an example showing a new incoming connection being accepted, assigned to a link thread and being assigned a new Link Id
Example Analysis - Links example 1
The activity of Links Threads is split into two different types of messages:
[SVR] - relating to initial processing of incoming connections.
[SVRTHR] - relating to the Link Thread itself and assignment of ids to incoming links.
This example outlines the basic process.
The Link Thread accepts a new incoming connection.
26-MAY-2010 21:20:39.776 19B4 [SVR] Accepted connection 4 from 192.168.0.101:4502 to 192.168.0.1:5481...26-MAY-2010 21:20:39.776 19B4 [SVR] ... Connection 4: Type 1, client version 0x6440DA4 (6.68.3492), (Uncompressed,Client Licence,ViewX)26-MAY-2010 21:20:39.776 19B4 [SVR] ... Connection 4 confirmed, link version 6.68.3616, client name 'Unknown'
The Link Thread assigns the incoming line the alias "[SCX] 11:01" (where 11:01 indicate that this is Link 01 of the 11th Link Thread).
26-MAY-2010 21:20:39.776 19B4 [SVRTHR] 11 AddClient from 192.168.0.101:4502, link is [SCX] 11:01
From this point on activity related to this particular link can be tracked through the alias "[SCX] 11:01".
Every 5 seconds a timeout is triggered for the link thread.
We can see that just over 60 hours ago DBServer received a flood of incoming links. The latest thread has a Run Time of '60:24:14', so at that time all 255 existing link threads were at capacity (255*16 = 4080 links) and a new link thread was required.
Investigating the Links and Advises tabs of the Server Status (or Snapshots) as above will provide details about the associated links if they are still active. If the associated client application has been disconnected, the links may already have been closed.
In this above example, investigation of the Links tab of the Server Status identified that a single Source IP address was responsible for the large number of links. A fault in some network monitoring software had caused it to make thousands of simultaneous connections to ClearSCADA.
Example Analysis - Advises
The activity of Advise Threads is split into two different types of messages:
[SVRADVTHR] - relating to the Advise Thread itself
[SVRADVISE] - relate to the advise process for individual clients
This example outlines the basic process.
Advise Threads, in this case 1A50, time out every 5 seconds.