Tiza Group

Home / Guides / Testing, commissioning and faults

Modbus TCP Device That Stops Responding on the Network

What to check when a Modbus TCP device stops answering: IP conflict, exhausted connections, network, port 502 or physical link. We configure it remotely.

By Shadai García, CEO and protection engineer at Tiza Group.

Short answer

A Modbus TCP device that stops responding almost always falls into one of four families: the network layer (cable, switch port, duplicated IP address or VLAN), the device server (exhausted connections or a restart), the client (open connections that are never closed) or a gateway with a failing serial bus behind it. They are separated with a ping test, a connection attempt to port 502 and a minimal read from a second client.

Symptom

A device that used to read fine over Modbus TCP stops answering: the SCADA marks the data as bad quality, the master reports a timeout, or each read takes several seconds to fail. Sometimes it is permanent; other times it is intermittent: it answers for a while after the device or the client is restarted and then goes quiet again. This guide orders the causes by likelihood and gives the test sequence, from cheapest to most costly. To understand how the protocol works, see the Modbus RTU and TCP guide.

The key is to tell which layer stopped responding. Modbus TCP is a request and a response over a TCP connection to port 502, the port assigned to Modbus; a fault can occur in the physical link, in the IP network, in the TCP connection, in the device’s Modbus server or, if there is a gateway, in the serial bus behind it. Each layer leaves a different trace in the test that follows.

Likely causes, from most to least likely

CauseHow to recognize itWhat confirms or rules it out
Exhausted connections on the device (clients that open and never close)It worked until a new client was added or a master was restarted; ping answers, the connection to 502 does notThe device shows all its connections busy, or it recovers when the old clients are restarted
Duplicated IP addressIntermittency: it answers for a few minutes and goes quiet; two devices “fight” over the addressThe client’s ARP table changes MAC address when the query is repeated
Network layer: cable, switch port, negotiation, VLANPing does not answer either, or drops packetsPort error counters, link indicator, test with another cable or port
Modbus server stopped or device restartingPing sometimes answers and the device restarts on its ownDevice log, uptime, power supply
Filter between client and device (firewall, route, VLAN) after a network changeThe problem appeared together with a network interventionA query from a computer on the same VLAN as the device does work
Gateway with a failing serial busDevices on the same serial output fail together; exception 0BOne serial device works and another does not behind the same gateway
Client misconfigured after a changeOnly one client fails; another client reads fineAddress, port, unit identifier or timeout changed

How to diagnose it

Always work from the lower layer to the higher one. Each step answers one question and tells you which one to go to next.

  1. Is there a physical link? Look at the link indicator on the device and on the switch port. With no link, the problem is the cable, connector, port or device power supply; everything else is beside the point.
  2. Does ping answer? Run it from the same computer or server that runs the Modbus client, not from your laptop, because a filter or a VLAN may let one through and block the other. If there is no answer, go to “network”. If it answers, continue.
  3. Does the TCP connection to port 502 open? Use a connection test tool from the client. Three possible results: the connection is established (the server accepts); it is refused immediately (the device is active but not listening or refusing because of a limit); or it gets no response until it times out (something on the path drops the packets, or the device is hung).
  4. Does a minimal read answer? With a test client, read a single register that you know exists, with the same unit identifier the SCADA uses. If it reads, the device is fine and the problem is the original client or the load it imposes. If the device answers with an exception, the server is alive: the address or the function is wrong (exception 01 or 02), or the device is busy.
  5. Does it change with a second client? If a new client from another point on the network reads without problems, the device and the network of that segment are fine; check the original client, its route or its connections.
  6. Is it a gateway? Compare a device that fails with one that does not, both behind the same gateway. Exception 0B indicates that the gateway got no answer from the serial device; 0A, that it could not route the request. In both cases the fault is not in Ethernet.

IP address conflict

Two devices with the same address produce the most puzzling failure: everything seems normal but the device only answers sometimes. Repeat a query several times and watch the MAC address associated with that IP in the client’s ARP table: if it changes, there are two devices. Modern systems detect the conflict with ARP probes before using an address, as RFC 5227 describes, but an industrial device with a fixed address may not do so. If there is duplication, the fix is to correct the addressing plan; see two IEDs with the same IP address on the station network and the IP and VLAN addressing plan.

Exhausted connections

Many devices limit the number of simultaneous Modbus connections; the manufacturer’s manual gives the exact figure. If a SCADA, a gateway, a historian and a maintenance client open connections and one of them does not close them properly after an outage, the limit fills with dead connections and the next client cannot get in. What gives it away is the pattern: it worked until a client was added or until a master restarted badly, and it recovers when the guilty client is restarted or when the device closes idle connections. Make each client keep one stable connection and reopen it only after an error, not a new one per query.

Illustrative example

A SCADA reads six relays over Modbus TCP, each with a limit of four simultaneous connections. A new historian is configured to open one connection for each group of data it reads: three per relay. With the SCADA (one connection) and the historian (three), the relay reaches its four. When the network drops for a minute, the SCADA reopens its connection while the previous one is still held open in the relay; the limit is exceeded and the relay refuses the new client. Ping answers the whole time, and the symptom disappears when the historian is reduced to one connection per relay. The figures are made up to illustrate the mechanism; each device has its own limit.

Field checklist

  • Link indicator on at the device and at the switch.
  • Ping from the same server that runs the Modbus client.
  • ARP table: the MAC address for that IP is always the same.
  • TCP connection to port 502 opens, is refused or times out: write it down.
  • Read of a known register from a test client.
  • The same device answers a second client at another location.
  • Error and discard counters on the switch port.
  • Number of clients with an open connection to the device.
  • Device log or restart counter.
  • Recent changes on the network (VLAN, routes, firewall) or on the client.

What to do

  • Exhausted connections: reduce the connections per client, restart only the client that left them open and add reasonable timeouts so the device closes idle ones. This is a correction that can be done on site or remotely, without intervening in the substation.
  • Duplicated IP: identify the second device by its MAC address and reassign a free address according to the plan. Remove the intruding device first if it is a maintenance or test device.
  • Cable or port: replace the cable and test another port; if the error counter drops, it was the link. If the switch port is on the wrong VLAN, correct it with the network administrator.
  • Device restarts: if the device restarts on its own, check its power supply first; if it persists, it is a firmware or hardware matter for the manufacturer.
  • Gateway or serial bus: follow the serial bus guide of the parent topic: termination, biasing, and the same parity and speed on all devices on the bus.
  • Misconfigured client: compare port, unit identifier, address and timeout with those of a client that works.

If the device is critical for operation, keep an alternative reading by another means at hand (the relay’s local panel) while diagnosing. Modbus readings should not be the only source for operating decisions.

What not to do

  • Do not change the device IP in operation without notifying the other clients; it will leave them without data.
  • Do not restart a protection device just to “unstick” the communication without coordinating with operations: it loses protection while it restarts.
  • Do not increase the timeout blindly to hide a connection or network problem.
  • Do not open port 502 to external networks to test from outside: Modbus does not authenticate who queries or who writes. For remote access use the installation’s secure channels.
  • Do not connect a computer to a port on the protection network without authorization: it can introduce duplicated addresses or unwanted traffic.
  • Do not treat exceptions as if they were network failures. An exception indicates that the device responded; the network is fine.

When to call us

Call us if the diagnosis points to the communications network configuration, a messy addressing plan, a gateway with many devices or a SCADA that opens too many connections, or if you cannot reproduce the fault. With the traffic capture and the client and device parameters we locate the cause. We configure it remotely: ask for help with the configuration.

Common problems

The protection relay stops responding over the network

How it presents. The SCADA or the configuration software loses a protection relay, sometimes while the device and its protection keep operating normally. A relay has a limited communications processor, and usually keeps it separate from the protection function. For that reason losing the network does not mean the protection has failed, but do not assume the opposite either: check on the front panel that the relay is healthy and has no internal alarm.

Likely causes, in order.

  1. Communication stack saturation: a client that opens many sessions, polling that is too fast, or a network sweep (device discovery, port scanning) done from a laptop. The relay answers slowly or stops answering and recovers when the load ceases.
  2. Exhausted sessions or associations: the device’s simultaneous client limit is full because of connections left open.
  3. Security lockout: the relay locks the account or the service after failed attempts, or an allowed-address list no longer includes the client after a network change.
  4. Communication service disabled or restarted after a settings or firmware change.
  5. Network: port, switch or VLAN, as in the rest of this guide.

How to diagnose. Compare the moment of the loss with the connection of a tool or with a network sweep. Test from a single client, with a simple read, and see whether the device recovers when the others are disconnected. Read the relay log: account lockouts, rejected sessions, communications module restart.

What to do. Reduce clients and polling frequency, unblock or correct the allowed-address list, and document each relay’s session limit. For secure maintenance access, see Relays that lose the network when a laptop is connected; for the security framework, Cybersecurity of substations and plants. Do not run sweeps or scans on relays in service.

References

  • Modbus Organization, MODBUS Application Protocol Specification V1.1b, and MODBUS Messaging on TCP/IP Implementation Guide V1.0b.
  • IETF, RFC 5227, IPv4 Address Conflict Detection.
  • Manufacturer’s manual for each device: maximum number of Modbus connections and behavior with idle connections.

Frequently asked questions

Why does the device answer ping but not Modbus?

Ping only tests the IP layer. If ping answers and the TCP connection to port 502 is refused or gets no response, the device is alive but its Modbus server is not accepting more connections, is restarting its application, or there is a filter between you and the port. Compare with a second client from another point on the network.

How many clients can a Modbus TCP device serve?

It depends on each device and its firmware: the manufacturer's manual sets the maximum number of simultaneous connections. When that limit fills up with stale connections, the next client is refused or gets no response. That is why each client should reuse one connection and close it when finished.

What does it mean when the gateway returns exception 0B?

That the gateway received the request and forwarded it, but the serial device behind it did not answer. The fault is in the serial bus or in the device behind, not in the Ethernet network. If it answers 0A, the gateway could not route the request, which normally points to a misconfiguration or an overload of the gateway itself.

WhatsApp