Introduction

The RediGate provides a Network Monitor option (beginning June 2018), allowing various actions to be taken based on changes in network conditions. See the RediGate Configuration Manual for general instructions on configuring the Network Monitor object.

This page details several examples of using the Network Monitor for different applications.

Redundancy Application

Primary/Secondary Route Handling (ping)

In this application, a RediGate might have two networks (such as satellite connection via Ethernet port, and a cellular modem connection) for redundancy.

This example requires two Network Monitor configuration objects

  1. The first NetMon instance does a ping (only when on Path 0, primary) and checks for a number of failed pings on ALL Ping Addresses as the criteria for switching to Path 1.
    The ACTION is one or more 'route' commands that are necessary when on the secondary network.
  2. The second NetMon instance does a ping (only when on Path 1, secondary) and checks for a number of consecutive successful pings to ANY of the Ping Addresses as the criteria for switching back to Path 0.
    The ACTION is, again, one or more 'route' commands that are necessary when on the primary network.
Instance 1Instance 2

 NOTES:


Primary/Secondary Route Handling (register)

As in the previous application, a RediGate might have two networks (such as satellite connection via Ethernet port, and a cellular modem connection) for redundancy. In this case, the route is switchable by writing a 0 or 1 to a control register.

This application (two additional instances of NetMon configuration objects) might be combined with the previous application to allow pings to primarily control the routing, but also allow SCADA to override the setting by writing to a register.

  1. The first NetMon instance checks the route status register (40003; only when on Path 0).
    If the value has been changed to 1, then run SCRIPT to switch to Path 1.
  2. The second NetMon instance checks the route status (40003; only when on Path 1).
    If the value has been changed to 0, then run SCRIPT to switch back to Path 0.

Instance 1

Instance 2

 NOTES:

Network Status Monitoring

Check whether TCP port is connected

In this example, the RediGate can check whether or not a TCP socket (such as MQTT or Terminal Client) is currently established. If not, it might indicate a problem with the Ethernet connection, and we can try to restart the Ethernet networking to attempt a recovery.

This example requires two Network Monitor configuration objects:

  1. The first NetMon instance checks the established connections on a numbered port (e.g. 1883). If the number of connections is greater than VALUE, it runs a SCRIPT (just a Linux 'sleep' command), which increments a heartbeat counter in register 40012. The increasing value represents a good condition.
  2. The second NetMon instance checks the heartbeat counter in Channel/RTU, register 40012. If the register stops increasing, then restart the Ethernet ports.
    This instance needs to run at a MONITOR Interval that is more than the interval of the first instance, to ensure the count will have increased normally.
    (To restart just a single Ethernet port instead of all ports, the Instance 2 Action could be a SCRIPT, with Action Text:
    ifdown eth0; sleep 1; ifup eth0   #(use the correct eth_ port number)

Instance 1

Instance 2

(Note that this example could have combined the condition of ESTABLISHED ports with the Restart of Ethernet ports in a single NetMon instance. But that could cause the Ethernet network to restart even when there is a natural reconnection of the TCP socket. By using an increasing heartbeat counter in Instance 1, and configuring Instance 2 to read the counter several times slower than Instance 1, it will avoid premature restarts of the network.)

Also note that a 3rd NetMon instance could be added, which looks at the register value of 40012 (heartbeat counter) at a much less frequent interval, for instance 10 minutes or an hour. If the heartbeat counter doesn't increase more than a small amount, this indicates that the Ethernet restarts (NetMon instance 2) aren't working, and the Action could be to reboot the RediGate as a more drastic effort to recover communication, if possible.