The UDH is an optional header at the start of an SMS payload that carries control information, most commonly the concatenation reference and part number of a multi-part message.
The user data header sits inside the 140-byte payload, ahead of the text, and a flag tells the phone it is there: the TP-UDHI bit in the network's own message format, or a bit in the esm_class field when the message travels over SMPP. The header opens with one byte giving its length, followed by one or more information elements, each made of a type, a length and a value. The best-known element is concatenation: a reference number shared by every part of a message, the total number of parts and the index of the current one. Other elements address a message to a particular application port on the phone or carry operator features.
Because the header lives inside the payload, every byte it uses is a byte the text cannot. The common concatenation header takes 6 bytes, which is where the figures of 153 GSM-7 and 67 UCS-2 characters per part come from. A less common variant with a 16-bit reference takes 7 bytes and leaves 152 or 66.
For a hypothetical message in three parts, the first part's header could read 05 00 03 4A 03 01: header length 5, element type 0 (concatenation with an 8-bit reference), element length 3, reference 4A, three parts in total, part 1. The other two parts carry the same bytes except the last, which becomes 02 and then 03. The phone groups parts by sender and reference, then puts them in order by index.
Senders never write the UDH themselves through a modern API; the gateway builds it. The mistakes happen around that boundary:
- Pasting header bytes into the text of an API that takes plain text. They arrive as stray characters, not as a header.
- Splitting a long text into separate messages instead of letting it be concatenated. With no header, the phone has nothing to reassemble.
- Reusing one reference number for two long messages sent to the same phone at the same time, which can mix their parts.
At SMSMeteor: concatenation headers are generated for you. You submit the whole text in one request, the platform splits it and numbers the parts, up to 6, and the API returns the resulting segments and encoding in the message object.
