trailer field values of each layer are encoded each layer being encoded using its own separate context the header field values and the trailer field values are encoded for each layer and encoding may begin with the user layer layer n and terminate at the physical layer layer 1 the second loop l 12 is iterated for each layer until all layers in the message are processed the operation of the second loop l 12 will now be discussed from the u201c no u201d output in step s 32 the processing continues with step s 42 using the same context as started in step s 28 the message length field in the header is computed if required from the initial buffer position and the header body length for the user data layer layer n the body length is zero 0 the header field values of the layer being processed the u201c current u201d layer in the second loop l 12 are encoded in step s 44 during encoding the current layer 39 s header field values are moved to the message stream to be formatted in step s 46 the current buffer position is incremented by the sum of the length of the header field values in the current layer or the total header length of the current layer in step s 48 the crc fcs field for the trailer is computed if required using the initial buffer position and the header body length to provide the starting point and range over which to apply the.