Closing IDLE Network Connections ( Configure Keep Alives)How can i be sure that my Digi device will close the network connection to it's serial port after a network outage ?
You can enable Keep Alives. They are explained below.
This document explains the concept of the TCP keep alive. It will then explain how they work in context with Digi products and the Realport driver.
DIGI TCP Keep Alive concept
For examples sake lets assume we have a Digi Connect ME on a network.
This ME has it's serial port setup to use the Realport driver. Let's also assume a PC is running the Realport driver and has a connection (TCP port 771) to the ME.
Now, the ME with it's Keep Alives enabled, is going to note when it stops receiving traffic on that specific TCP connection (from the PC running the Realport driver). If, after a period of time passes (the Keep Alive_idle value) and it does not receive any additional traffic on that TCP connection, it will then start it's keep alive process.
The Keep Alive process involves the ME sending out "probe" messages to the PC in hopes of getting a response. After it sends a probe it's going to wait for a period of time (the probe interval value). After this time has elapsed it will then send out an additional "probe" message and wait again. It will do this a number of times (equal to the probe count value). If it doesn't receive any response after this it will then finally close the TCP socket on it's end.
TCP Keep Alives in Digi Connect ME and Realport.
Keep alives are a 2 way process. The Realport driver can also run it's own keep alive.
In the above example the ME can only close the connection on it's end. The PC on the other end may or may not close it's connection. If it does close it's connection, great. If it doesn't, then as far as it's concerned, the connection is still open. It might then try to send data to the ME. If that were to happen the ME would refuse the data because, as far as it's concerned, the connection is closed.
It also good to add that TCP Keep Alives can be setup in the Realport driver; although you don't have control over the idle timeout, probe count, or probe interval.
The Reaport driver uses default values that can't be changed.
Find enclosed a copy of the Digi Connect Command Reference. It will explain some of what was said in this Knowledge base article. Look under the section for "set network" command. You can see Keep Alive items listed there.
How to change Keep Alives settings in a Digi device.
Open a telnet connection to the Digi device. Log into the module.
You can configure the Keep Alives with the set network command (see screenshot below).
For review, here is a list of relavent Keep Alive settings:
KEEPALIVE IDLE: The amount of time that must pass before beginning the Keep Alive process to close the connection.
PROBE COUNT: The number of probes to send out on an idle connection, to see if it's still alive.
PROBE INTERVAL: How long to wait before sending the next probe request.