Header and data length are present in response and request messages between Zabbix components. It is required to determine the length of message.
To not exhaust memory (potentially) Zabbix protocol is limited to accept only 128MB in one connection.
Here are code snippets showing how to add Zabbix protocol header to the
data you want to send in order to obtain
packet you should send to Zabbix so it is interpreted correctly.