Automation Glossary • DNP3 TCP Connection Drops

How to Fix DNP3 over TCP Connection Drops

Merobix Engineering • • 6 min read

The symptom: the DNP3 session connects fine, runs for a while, then drops - and reconnects, and drops again, on a rhythm that fills the comms log and pokes holes in the historian. DNP3 itself rarely causes this; the protocol rides on TCP, and it is almost always the TCP path - firewalls, NAT, cellular address churn - or a connection-management mismatch between master and outstation doing the damage. This guide works the causes in the order they usually occur.

Back to Blog

DNP3 TCP Connection Drops in one line: When DNP3 over TCP keeps disconnecting, the leading causes are network middleboxes silently dropping idle connections, half-open sessions left behind when a cellular link changes address, and connection-management conflicts such as two masters competing for an outstation that accepts one connection. The fixes are keepalive traffic more frequent than the shortest idle timeout in the path, and one deliberately configured connection owner per outstation.

First Checks

Establish the shape of the failure before touching configuration. Which side closes the connection - does the master see a reset, a timeout, or a graceful close? Do the drops happen at a suspiciously constant interval after the last data (the signature of an idle timeout in a firewall or NAT device), at random (radio or cellular instability), or immediately after connect (an endpoint conflict)? The comms log on the master plus a packet capture at one end answers this in minutes.

Also separate transport drops from application silence: a session that stays connected while polls time out is a different problem - device or link - and shows up as a comms-fail alarm with the TCP session still up. This guide is for the case where the TCP connection itself is dying.

Idle Timeouts in Firewalls and NAT

The most common cause on segmented and cellular networks: a firewall or NAT gateway in the path holds state per connection and quietly discards entries that stay idle past a threshold. DNP3 designs that rely on unsolicited reporting can legitimately go quiet for long stretches - no polls, no events, no traffic - and the middlebox forgets the connection. The next time either end transmits, the packets die at the stateless hole, and the session eventually errors out and reconnects.

Test by comparing the observed idle-time-before-drop against the timeout settings of every firewall and carrier NAT in the path; the match is usually exact. Fix by ensuring some traffic flows more often than the shortest timeout: a slow supervisory poll, TCP keepalives enabled at the endpoints, or DNP3 link-layer status requests used as heartbeats. On carrier-grade NAT you do not control the timer, so the heartbeat must simply be faster than it - and the interval you choose becomes part of the link budget discussed in round-trip time and SCADA polling.

Half-Open Connections After Address Changes

Cellular endpoints change IP addresses - on tower handoffs, carrier re-grants, or modem resets - and when that happens mid-session, one end keeps a connection the other end no longer has. The outstation may believe its old session is alive and refuse a new one, or the master reconnects while its old socket lingers, and you get connect-drop-connect churn or an outstation that appears deaf until someone power-cycles it.

The defense is aggressive dead-connection detection on both ends: TCP keepalives tuned so a dead peer is detected in minutes rather than hours, and outstation settings that allow a new connection to displace a stale one where the device supports it. When specifying hardware for cellular sites, that displacement behavior is worth an explicit line in the requirements - the deployment patterns in connecting DNP3 to cloud SCADA lean on exactly this to survive address churn gracefully.

Endpoint Conflicts and Connection Direction

If drops happen at or immediately after connect, suspect two clients contending for one server. Many outstations accept a single master connection on the standard port; a forgotten test tool, a redundant master both instances of which think they are active, or a misconfigured second poller will bump the legitimate session each time it connects, producing a metronomic connect-drop pattern. Audit what is actually connecting - the outstation's connection log or a capture at the outstation end shows the competing source addresses plainly.

Also verify the connection direction design: DNP3 over TCP deployments variously have the master connect to the outstation, the outstation dial out to the master, or dual endpoints where either may initiate. If both ends are configured to initiate, or a dial-out outstation meets a firewall that only permits inbound-to-outstation, sessions form and collapse unpredictably. Pick one direction deliberately, configure both ends and the firewall rules to match, and document it.

When to Escalate

Escalate to the network or carrier side with evidence: a capture showing the connection dying from your end, the measured idle-before-drop interval, and timestamps to correlate against firewall logs. Ask the specific question - what is the state timeout for this path, and can this rule be exempted or extended - rather than reporting that SCADA keeps dropping. For carrier NAT behavior, the practical answer is usually adapting your heartbeat rather than changing the carrier.

Escalate to the outstation vendor when the device mishandles reconnection - refuses new sessions while holding a dead one, or needs a power cycle to recover. That is a firmware behavior with the half-open scenario as the reproducible test case, and a capture of the refusal alongside the stale-session state makes the defect report concrete.

Frequently Asked Questions

What port does DNP3 over TCP use?

The registered port is 20000, for both TCP and UDP transports, though deployments can and do configure alternatives. When troubleshooting, confirm the port actually in use at both ends and in every firewall rule along the path before assuming the standard - a mismatch here produces a connection that never establishes rather than one that drops, but mixed configurations after migrations produce both symptoms.

Are TCP keepalives enough, or do I need application heartbeats?

TCP keepalives keep NAT state alive and detect dead peers at the transport layer, but they prove nothing about the DNP3 application above it. A slow supervisory poll or link-status request does both jobs: it refreshes middlebox state and confirms the outstation is actually responding. Many operators run both - keepalives tuned for fast dead-peer detection, plus an application-level heartbeat at a longer interval.

Why does the outstation go deaf until power-cycled after a network blip?

Classic half-open connection: the outstation still holds the old session as alive and, if it only accepts one connection, refuses all newcomers. Without keepalives it may hold that dead session indefinitely. Enable keepalive-based dead-connection detection on the outstation, and prefer devices or firmware that let a new master connection displace a stale one, so recovery never requires a site visit.

Sources and verification

This page references the protocol specifications published by the organizations below. Editions, product capabilities, and documentation change over time - confirm current requirements and specifications directly with the source.

Merobix is not affiliated with, endorsed by, or sponsored by these organizations; their names are used only to identify the standards and products discussed.

More in Industrial Protocols
Fix EtherNet/IP connection timeouts  •  DNP3 Serial vs TCP  •  Diagnose EtherNet/IP I/O Connection Fault  •  Fix Modbus TCP reading zeros  •  Fix Modbus TCP reading wrong device  •  All Industrial Protocols →
Free SCADA operator training
Merobix University - 70 video lessons & 261 quiz questions, from first login to compliance reporting. No demo call required.
Start free →