ModPackQTModPackQT
GlossaryResourcesSign up
HomeResourcesModbus GlossaryMBAP Header
Protocol & FramingModbus Term

MBAP Header

The 6-byte header prepended to every Modbus TCP request and response.

Definition

The MBAP (Modbus Application Protocol) header is the 6-byte wrapper used exclusively in Modbus TCP. It contains a transaction identifier (2 bytes, echoed in the response for request/response matching), a protocol identifier always set to 0x0000 (2 bytes), a length field indicating remaining bytes (2 bytes), and the unit identifier (slave address). The length field tells the receiver exactly how many bytes follow, making Modbus TCP framing deterministic.

Quick Facts

Total size6 bytes
Transaction IDBytes 1–2
Protocol IDBytes 3–4 (always 0x0000)
LengthBytes 5–6
Unit IDByte 7 (last header byte)

Example

00 01  00 00  00 06  01
├──┤  ├──┤  ├──┤  │
│     │     │     Unit ID
│     │     Length (6 more bytes follow)
│     Protocol ID (always 0x0000)
Transaction ID (1)

Related Terms

Try it in ModPackQT

See MBAP Header in action — poll registers, write values, and explore function codes in a free browser-based Modbus tool.

Was this definition helpful?

Back to full Modbus Glossary (49 terms)

ModPackQT Modbus Glossary · Updated 2026