Ping Only Proves 84 Bytes Crossed, Not That Your SCADA Link Works
Narrowing a SCADA comms failure: the blind spot in each check, the three answers TCP gives, Modbus exception 0x0B, and the 50 seconds a legacy STP reconvergence costs you.
A PLC in the pump house went Bad quality. I ran ping -c 100. Zero loss, 0.4 ms average. The Modbus TCP reads kept timing out. I spent two hours on the PLC side. The cause was a duplex mismatch on the switch port.
All the ping had proved was that one 84-byte packet made the round trip. What was breaking was the response carrying 125 holding registers — 299 bytes as an IP packet. The order of these checks matters, but not because the layers stack bottom to top. Each check has a fixed blind spot, and you can only pick the next check if you can name the blind spot in the last one.
What ping proves
The default ping payload is 56 bytes. Add the 8-byte ICMP header (RFC 792) and the 20-byte IPv4 header and 84 bytes go on the wire. Linux tells you outright:
PING 10.20.3.11 (10.20.3.11) 56(84) bytes of data.
84 bytes is small. Something that size gets through a duplex mismatch, a bad crimp, or a run past 100 m almost every time. What breaks is the full-size packet.
Read 125 holding registers with Modbus TCP FC3 — the ceiling in MODBUS Application Protocol Specification V1.1b3 §6.3 — and the response is 250 data bytes plus a byte count, a function code, and the 7-byte MBAP header: 259 bytes. Add TCP 20 and IP 20 and you have a 299-byte IP packet. A link that carries 84 bytes and drops 299 is a real thing.
So before I report a ping result, I run one more line:
ping -s 1472 -M do 10.20.3.11 # 1472 + 8 + 20 = 1500, no fragmentation
If that fails and the plain ping passes, it is the link or the MTU. The check takes 30 seconds, and in my experience it ends half of all "ping works but comms don't" calls right there.
After that, counters instead of guesses. Read FCS errors and late collisions on the switch port. When IEEE 802.3 Clause 28 auto-negotiation only completes on one side, one end stays full duplex and the other half duplex, and late collisions pile up on the half-duplex end. A non-zero counter clears the PLC. Industrial Ethernet switch commissioning lists what to record per port.
TCP answers in three ways
Writing a port check down as open/not-open throws away half the information. There are three answers.
| Result | Meaning | Next action |
|---|---|---|
| Connected | the service is up | move to the protocol layer |
| RST (connection refused) | host is alive, service is not | check the service on the device |
| Silence | something discards it | firewall, VLAN, routing |
RST is good news. The host is alive, the IP is right, the path is open, and all that is left is a service that is not running or a different port. Silence is the bad one.
Silence is expensive in time. With the Linux default net.ipv4.tcp_syn_retries = 6, SYNs go out at 1, 2, 4, 8, 16, 32, and 64 second intervals and connect() fails after 127 seconds. If the SCADA driver timeout is 3 seconds, the driver repeats "device not present" for all 127 of them. The device was fine; one firewall rule said DROP. A boundary firewall is right to drop by policy, so during commissioning ask whoever owns the rule whether it is DROP or REJECT instead of guessing — firewall rule commissioning has more of this.
There are not many ports to check: Modbus TCP 502, OPC UA opc.tcp 4840 (OPC UA Part 6), MQTT 1883 and TLS 8883, DNP3 20000 (IEEE 1815), EtherNet/IP explicit messaging 44818.
Here is a one-liner that separates the three answers with nothing but bash:
IP=10.20.3.11
for p in 502 4840 1883; do
timeout 3 bash -c "</dev/tcp/$IP/$p" 2>/dev/null \
&& echo "$p connected" \
|| { [ $? -eq 124 ] && echo "$p silent - discarded" || echo "$p RST - host alive"; }
done
timeout returning exit code 124 is what divides silence from RST.
Where an open port is still the wrong answer
From here on, these are not network faults, but they get reported as network faults.
A Modbus gateway tells you it is sick. Exception code 0x0A Gateway Path Unavailable and 0x0B Gateway Target Device Failed To Respond (MODBUS Application Protocol Specification V1.1b3 §7) are exactly that. A 0x0B means the Ethernet side worked end to end and the serial device behind the gateway did not answer. A wrong unit id arrives as the same code. Reading exception codes and gateway unit id routing are how you separate the two.
Ask for 130 registers at once and get 0x03 Illegal Data Value, and that is not the network either — it is the 125-register ceiling in V1.1b3 §6.3. Poll block optimisation covers how to cut the blocks.
OPC UA falls over once more after TCP connects. In the Hello/Acknowledge exchange of OPC UA Part 6, if the EndpointUrl the client sent is not a name the server knows itself by, the connection ends with Bad_TcpEndpointUrlInvalid. Port 4840 is open and ping works the whole time. On the certificate side it arrives as Bad_CertificateUntrusted or Bad_CertificateTimeInvalid. Endpoint and ApplicationUri mismatch and security policy and trust store each have the recovery order.
In all three cases one line of driver log ends two hours of guessing. Opening the driver log before the Bad quality on the screen is worth more than the rest of this article.
When several devices drop together, look at the clock
If a whole line went Bad in the same instant rather than one device, do not look at devices. Look at timestamps.
The classic spanning tree defaults in IEEE 802.1D are Hello 2 s, Max Age 20 s, Forward Delay 15 s. Worst case, a port passes no traffic for 20 + 15 + 15 = 50 seconds. RSTP finishes the same transition in under a second. A driver with a 3-second timeout and 3 retries goes Bad at 9 seconds, so one legacy STP reconvergence takes the entire line Bad — and once it recovers, the network side keeps no trace of it.
That is why the only usable evidence in an intermittent fault is when. Put the switch log, the driver log, and the start of the historian's Bad span on one clock. If all three name the same second, the cause is in what they share. Bad quality spans and interpolation shows how that span looks in a trend, which makes the timestamps easier to read.
This is the point where you want to raise the driver timeout. I would not. Keep the timeout at what the process can tolerate and cut the reconvergence time with RSTP instead. Push the timeout to 60 seconds and STP disappears — so does a genuine device failure, for 60 seconds. Polling timeouts puts numbers on that trade.
Next thing to check
Ports open, no exception codes, timestamps that do not line up, and values still arriving late now and then: the next step is a packet capture. That is where guessing stops. Industrial network packet capture covers where to hang the SPAN port and what to filter.