Marcio Cunha

Slow Modbus TCP? How to fix latency and packet loss

Learn how to structure a secure Modbus TCP network on the factory floor, avoiding freezes, packet drops, and critical communication delays.

Marcio Cunha•4 min
Also available in:PortuguêsEspañol
Summary
  • Physical and logical traffic separation prevents administrative network bursts from freezing the main industrial bus.
  • Proper timeout tuning stops controllers from entering fault states during minor network micro-interruptions.
  • Packet prioritization ensures emergency stop commands arrive ahead of secondary telemetry data.
  • Traffic segmentation drastically reduces collision rates and packet drops inside industrial switches.
  • Accurate timing and buffer configuration guarantee continuous protocol stability in harsh environments.

Why does Modbus TCP suffer from delays on the factory floor?

The Modbus TCP protocol is widely used in industry due to its simplicity and ease of integration between sensors, PLCs (Programmable Logic Controllers, which are robust industrial computers used to automate machines), and SCADA systems. However, because it runs over conventional Ethernet networks, it inherits classic data traffic issues like congestion and latency (the delay between sending a command and receiving a device response). When a factory floor grows without proper planning, office computers, security cameras, and corporate systems start competing for the same cables, creating unacceptable delays and packet loss.

In practice, this means a simple command to start or stop a conveyor belt can take hundreds of milliseconds to arrive, or worse, get lost along the way due to a data collision. To prevent unwanted line stoppages and ensure data arrives precisely when the production process needs it, it is essential to redesign the network infrastructure by applying segmentation and packet prioritization concepts. Before tweaking any software settings, remember that physical or logical isolation is the first step to shield the industrial bus against external interference, something that can be reinforced by learning how to configure VLANs on Mikrotik and isolate your network to separate critical automation traffic from corporate data.

How to structure VLANs and isolate industrial traffic

One of the most common causes of packet loss in Modbus TCP networks is the broadcast storm, which happens when network devices send simultaneous messages to all other nodes, flooding the communication channel. To solve this, engineers use VLANs (Virtual Local Area Networks, which act as virtual partitions dividing a single physical network into several isolated segments). With VLANs configured on factory switches, office traffic, file shares, and web browsing are completely separated from automation data.

In practice, isolating the Modbus TCP bus in a dedicated VLAN prevents a heavy file download on an engineering workstation from causing delays in temperature readings from a furnace or pressure monitoring in a boiler. Moreover, to handle the heavy load of thousands of requests per second coming from sensors and HMIs (Human-Machine Interfaces, the touchscreens where operators command the process), it is crucial to dimension industrial switches for high-load networks featuring managed ports and adequate memory buffers to absorb traffic spikes without dropping packets.

Tuning timeouts and preventing packet loss

Modbus TCP operates on a client-server model, where the master supervisory system or PLC sends a request and waits for the slave's response. If the configured waiting time—known as timeout—is too short, the master will assume the slave is dead and trigger a false communication fault alarm, even if the packet was only slightly delayed in the queue. On the other hand, if the timeout is too long, the system will take too long to detect a real machine stoppage.

To fine-tune this parameter, you must analyze the average network latency using diagnostic tools and define a safety margin that absorbs minor variations without compromising the overall response time. Another critical factor is handling corrupted or lost packets: using shielded cables away from heavy electromagnetic interference sources, such as frequency inverters and large motors, is essential to prevent electrical noise from destroying TCP packets along the physical path.

Integrating with higher systems without losing determinism

Many companies make the mistake of connecting Business Intelligence (BI) systems and corporate databases directly to the bus where PLCs communicate via Modbus TCP. This overloads the controllers' CPUs with excessive queries, raising response times and causing packet loss due to resource exhaustion. The correct approach is to use intermediary gateways or lightweight integration platforms that collect data in optimized batches and forward them to the cloud or office asynchronously.

When we need to unify different industrial protocols and extract data for modern supervisory platforms, flexible tools make all the difference, such as how to integrate industrial PLCs with Node-RED via Modbus and OPC UA, allowing engineers to build efficient data pipelines that relieve direct processing on PLCs and maintain the stability of the main factory bus.

Final Thoughts

Designing a secure, fast, and lossless Modbus TCP bus requires much more than simply crimping network cables and plugging equipment into outlets. The engineering behind a reliable industrial network relies on strict traffic separation through VLANs, the use of appropriate hardware to handle peak loads, and the precise parametrization of response times and timeouts.

By applying these latency mitigation guidelines, the factory floor gains operational reliability, eliminating ghost stoppages and ensuring the productive flow runs without interruptions. Investing time in network layer planning and choosing the right components guarantees that industrial automation will operate at its maximum potential without unpleasant surprises.