Modbus TCP
▮ Overview
What you'll learn
MBAP, unit identifiers, ports, and what changes (and doesn't) moving from RTU.
Sections
12
Labs
1
Quiz
7 Qs
What you'll be able to do
- Parse the 7-byte MBAP header from a capture.
- Explain when Unit ID matters and when 0xFF is fine.
- Predict what a Modbus TCP frame for FC 03 looks like end-to-end.
Why you'll need this
- "A capture shows transaction IDs jumping from 0x0001 to 0x0F2A — concerning or not?"
Three things people get wrong
- 1.Appending a CRC over TCPFix TCP handles integrity. No CRC bytes belong in a Modbus TCP frame.
- 2.Hard-coding Unit ID 1Fix Through a gateway, Unit ID picks the serial address. Hard-coding 1 breaks multi-drop topologies.
- 3.Ignoring MBAP lengthFix Length covers Unit ID + PDU. Mis-calculating it confuses servers that strictly validate.
From the field
Port 502 is not magic
An IT team blocked port 502 'because it's unencrypted' without realizing the SCADA box used it for every poll. Production trends went flat for an hour. The eventual compromise was a Modbus Security gateway on 802 and a documented allowlist — same protocol, different posture.
Cited sources
Primary sources come from protocol and standards publishers. Secondary sources provide supporting tool, vendor, or reference context.
- Primary sourceModbus Messaging on TCP/IP V1.0b ↗MBAP header — section 4.1
This module is paginated — step through the sections, run the labs, then take the quiz. Progress is saved locally.
Print one-pager →