From RS485 to the Cloud: How Many Protocols Work Together in One Industrial Data Collection Process?
If you work on industrial device networking projects, these two questions will be familiar. Many engineers are familiar with terms like Modbus RTU, MQTT, and TCP/IP, but when problems occur on-site, they often can't tell whether the fault lies at the physical layer, link layer, network layer, or application layer. A serial port tool can read data, but a gateway can't; everything works fine on the local LAN, but fails over a 4G connection. The root cause is an insufficiently systematic understanding of the dependencies within the industrial communication protocol stack. I. The Four Layers of Industrial Communication: Not Seven, but FourEngineers working on industrial projects don't need to memorize the OSI seven-layer model. The most commonly used framework in practice is the TCP/IP four-layer model, which we can map directly to industrial scenarios:
Core concept: upper-layer protocols must be "encapsulated" into lower-layer protocols to be transmitted. This is the fundamental logic for understanding all communication faults. II. The Encapsulation Relationship: How Upper-Layer Messages Are Packaged Layer by LayerThe most important concept is "encapsulation." Let's use a common industrial scenario to illustrate: Scenario: A temperature controller that only supports Modbus RTU connects to an industrial gateway via RS485. The gateway then reports the data to a cloud platform using the MQTT protocol over a 4G network. What encapsulation process does this data go through from the application to the physical medium? Step 1: Application Layer – The MQTT Message is Born The gateway's acquisition program reads a temperature value of
This MQTT message is the application-layer data. Step 2: Transport Layer – TCP Segment Encapsulation MQTT is based on TCP. The operating system places the MQTT message into a TCP segment, adding a TCP header:
At this point, the TCP segment performs the first encapsulation of the MQTT message. TCP is responsible for "end-to-end reliable transmission" —it doesn't care about the final route, only that data is delivered without loss or disordering from the gateway to the MQTT broker. Step 3: Network Layer – IP Packet Routing The TCP segment is then encapsulated into an IP packet. The IP header adds:
The core responsibility of the IP layer is "addressing and routing." It determines the path this packet takes from the gateway, through base stations, the carrier core network, internet exchange points, and finally to the cloud server. If there is an issue here—like the gateway not getting an IP, incorrect routing table configuration, or NAT mapping failure—a TCP connection cannot be established, no matter how reliable TCP is. Step 4: Link Layer – The Frame is Transmitted on the Medium The IP packet must finally become a link-layer frame to be transmitted over the physical medium. In a 4G scenario, this is handled by the 4G module:
If the gateway connects to the cloud via wired Ethernet, it is directly encapsulated into an Ethernet frame, which includes MAC addresses:
The link layer handles "data transmission between adjacent nodes." If a cable is loose, RS485 A/B wires are reversed, or the 4G signal strength is below -110 dBm—the problem is at this layer. Step 5: Physical Medium – The Bitstream's Final Form The link-layer frame is finally converted into a bitstream and transmitted over a physical medium:
Encapsulation Process Summary [MQTT Message]
↓ encapsulated into
[TCP Segment: port 1883]
↓ encapsulated into
[IP Packet: src 10.45.0.12 → dst 47.102.x.x]
↓ encapsulated into
[Ethernet Frame / 4G Radio Frame]
↓ converted into
[Electrical/Optical/Electromagnetic Signals] → Transmission over physical mediumThe golden rule for troubleshooting: check from the bottom layer up. Once the physical layer is clear, check the link layer; once the link layer is clear, check the network layer (can you ping?); once the network layer is clear, check the transport layer (are ports open?); once the transport layer is clear, check the application layer (is the protocol format correct?). III. Pre-Services: The "Preparation Work" That Must Be Done Before Communication BeginsBefore communication starts, some parsing or configuration work must be completed. In industrial networks, three pre-services are critical: 3.1 DNS: Domain Name Resolution Isn't Just for Browsing Many engineers think DNS is only for web browsing. In fact, when an industrial gateway connects to a cloud platform using a domain name (e.g., Common On-Site Issues:
Engineering Suggestion: For critical projects, configure domain name + IP dual-insurance on the gateway, or enable local Hosts mapping to avoid DNS as a single point of failure. 3.2 ARP: The "Address Inquiry" for LAN Communication When a gateway and a PLC/SCADA server are on the same LAN, the gateway knows the target IP but not its MAC address. It needs to send an ARP request (Address Resolution Protocol):
After the target device replies with an ARP response, the gateway can encapsulate the correct Ethernet frame. Common On-Site Issues:
3.3 DHCP: The "Double-Edged Sword" of Auto-IP Assignment When an industrial gateway connects to a client's internal network, it often uses DHCP to get an IP automatically. This simplifies configuration but introduces uncertainty:
Engineering Suggestion: For critical gateway devices, prefer static IP or DHCP reserved addresses (IP-MAC binding) to avoid data acquisition interruptions due to IP changes. IV. Ancillary Control: They Don't Carry Data, But Communication Can't Happen Without ThemThese protocols don't carry business data, but they provide essential support like parsing, error reporting, path building, and routing. 4.1 ICMP: The Network Layer's "Diagnostic Tool" The most common application of ICMP (Internet Control Message Protocol) is In industrial settings, ping is the primary tool for checking network layer connectivity:
Note: ICMP only tests network layer connectivity. A successful ping does not guarantee the application layer is working. The target device's TCP port 1883 might be blocked by a firewall, but ICMP might still be allowed, leading to the classic "ping works but MQTT can't connect" scenario. 4.2 Routing Protocols: The "Path Selection Logic" in Industrial Settings In large factory or multi-site projects, industrial networks often involve multiple subnets. Routing protocols (static routes, OSPF, etc.) determine the forwarding path for IP packets. Common Industrial Routing Scenarios:
Routing errors are among the hardest to diagnose in industrial settings, as symptoms are often "some things work, others don't" – connectivity to certain IPs works, but not to others – essentially because the routing table doesn't cover the target subnets. 4.3 NAT: The "Mandatory Path" for Internal Devices to Reach the Cloud The IP address an industrial gateway gets via 4G/5G dial-up is often a carrier-private address (like 10.x.x.x or 172.x.x.x), which is a private IP and cannot be directly accessed from the public internet. When the gateway actively connects to a cloud platform as a client, it uses SNAT (Source Network Address Translation) – the gateway's private IP is translated to a public IP by the carrier's router, allowing internet access. Common On-Site Issues:
V. Conditional Dependencies: Protocol Choices Vary Completely by ScenarioDifferent versions, protocols, or scenarios present different choices. This is particularly critical in industrial communication. 5.1 TCP vs UDP: The Reliability vs. Timeliness Trade-off
Selection Recommendations:
5.2 Modbus RTU vs Modbus TCP: Not a Replacement, but Different Encapsulation Many engineers mistakenly think Modbus TCP is an "upgrade" to Modbus RTU. In fact:
This means: the core job of a protocol conversion gateway is to take the RTU frame, remove the CRC, add the MBAP header, and place it in a TCP segment – and vice versa. Understanding this clarifies why some "protocol conversion" issues are actually TCP connection problems, not Modbus issues. 5.3 HTTP/1.1 vs HTTP/2 vs HTTP/3: Evolution in Industrial Edge Computing With the rise of industrial edge computing and web-based SCADA, HTTP is entering industrial scenarios:
Industrial Implication: For projects involving web SCADA, RESTful API calls, or OTA firmware downloads, prioritizing solutions that support HTTP/3 can improve transmission stability in weak network environments. VI. Control and Routing ProtocolsCorrecting a common misconception: not all network protocols run on top of TCP or UDP. This is equally true in industrial networking. 6.1 Protocols Running Directly on IP
6.2 Protocols Running Directly on the Data Link Layer
Engineering Insight: When you're configuring OSPF or troubleshooting STP loops on industrial switches, don't think in terms of "TCP ports" – these protocols don't use them. VII. Practical BreakdownLet's connect all the concepts above by walking through a complete industrial data acquisition communication flow. Scenario Setup:
Phase 1: Gateway Startup and Network Preparation
At this point, the "communication highway" from the gateway to the platform is open. Phase 2: Field Device Data Acquisition
Phase 3: Data Encapsulation and Reporting
Phase 4: Connection Maintenance
A failure at any step in this process will cause data interruption. For example:
VIII. Protocol Dependency Chain Troubleshooting6 Common Misconceptions (Industrial Edition):
Core Principle: Validate layer by layer, from the bottom up. Don't skip layers. When ping fails, don't start adjusting MQTT QoS. When RS485 doesn't work, don't suspect the cloud firewall. Industrial IoT projects are growing more complex, with more protocol types, but the underlying logic remains unchanged – layering, encapsulation, and dependencies.
Add to this the pre-services like DNS, ARP, DHCP, ancillary controls like ICMP, routing protocols, NAT, and conditional choices like TCP vs UDP, RTU vs TCP conversion, HTTP version evolution – a seemingly simple "device-to-cloud" connection relies on a sophisticated network of cooperating protocols. As engineers, we don't need to be protocol experts, but we must understand the boundaries and dependencies of each layer. When a fault occurs, being able to quickly identify "which layer is the problem" is more valuable than memorizing any product's specifications.
|