User Data Header (UDH)
The User Data Header is a block of octets that is added to the beginning of the user data part of an
SMS message. Due to the way an
SMS message is limited to a maximum size of 140 bytes, the available user data length is reduced when a
UDH is included.
Its purpose is to inform the mobile handset of the type of data and data length of the user data part of an
SMS message. Generally, the
UDH is either used in combination with
binary content known as
smart messaging for ringtones, operator logos, WAP Push and vCards, or it is used for
concatenated long sms. Binary content can also span across multiple message parts and therefore the
UDH may contain both a smart message and a
concatenation header.
See
common User Data Headers.
Example
User Data Header:
0B0504158200000003AA0301
The first byte
0B defines how many more bytes follow in the
UDH. In this case, it is 11 (0B is hex for 11).
The next bytes are one or more Information Elements. The first byte of each Information Element tells the handset how to process the user data part. Generally, the Information Element is either
05, meaning a port address, or
00 meaning
concatenation. This byte is known as the
Information Element Identifer (IEI).
The second byte of the Information Element is the
Information Element Data Length (IEDL). This defines how many of the following bytes belong to the current Information Element. The example
UDH above has 2 Information Elements:
050415820000 Length: 04
0003AA0301 Length: 03
The handset distinguishes between multiple Information Elements by counting the number of bytes as defined by the IEDL. If the IEDL of the current Information Element plus 1 byte for the IEI is less than the value of the first byte in the
UDH (in this case 11), then the handset knows that the next byte is an IEI of the next Information Element.
The subsequent number of bytes (as defined by the IEDL) contain the Information Element specific data. This is generally either a destination and source port address, or concatenation information. These bytes are called the
Information Element Data (IED).
The
UDH 0B0504158200000003AA0301 is broken down as follows:
| Byte(s) | Purpose |
| 0B | UDH bytes to follow 11 |
| 05 | Information Element Identifier Port Addressing |
| 04 | Information Element Data Length 4 |
| 1582 | Information Element Data Port 1582 |
| 0000 | Information Element Data Port 0000 |
| 00 | Information Element Identifer Concatenation |
| 03 | Information Element Data Length 3 |
| AA | Information Element Data Concatenation Reference |
| 03 | Information Element Data Concatenation Total Parts |
| 01 | Information Element Data Concatenation Part Number |
Note that if these 2 Information Elements could be on their own in a
UDH as follows:
Binary Operator Logo
UDH:
06050415820000
Concatenated SMS:
050003AA0301