2.2.17.1 Coalesced Payloads

Coalesced payloads are a special form of payload within standard DFRAMEs. When the PACKET_CONTROL_COALESCE flag is set on the outer DFRAME header bControl field of the TRANS_USERDATA_HEADER packet, the payload is interpreted using this format. Frames with coalesced payloads MUST have the PACKET_COMMAND_NEW_MSG and PACKET_COMMAND_END_MSG flags set on the outer DFRAME header bCommand field.

Between 1 and 32 two-byte headers are placed at the beginning of the buffer. The buffer MUST NOT contain more than 32 coalesce headers. If there is an odd number of coalesce headers, two extra bytes of zero padding MUST be added at the end to align the subsequent data on a 32-bit boundary. The last non-padded coalesce header MUST have the PACKET_COMMAND_END_COALESCE flag set in its bCommand field.

Following the headers are 1 to 32 payloads where the sizes of each are indicated in the corresponding headers that were added in the same order. If the payload size is not a multiple of 32 bits, and it is not the last payload in the message, one to three bytes of zero padding MUST be added to align the beginning of the next payload on a 32-bit boundary. The sizes indicated in the coalesce headers MUST NOT include any padding so as to preserve the message size as originally sent. The receiver MUST infer alignment padding when processing the payloads, and SHOULD indicate the messages to the consumer using the unpadded size.

The following is an example of a standard DFRAME for a coalesced payload.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

bSize 1

bCommand 1

bSize 2 (optional)

bCommand 2(optional)

bSize n-1 (optional)

bCommand n-1 (optional)

bSize n (optional)

bCommand n (optional)

payload 1 (variable)

payload 2 (optional, variable)

payload n-1 (optional, variable)

payload n (optional, variable)

In the preceding example, the following field types are represented.

bSize 1 through bSize n: The least significant 8 bits of the size of the coalesced payload. The value is combined with the optional PACKET_COMMAND_COALESCE_BIG_1, PACKET_COMMAND_COALESCE_BIG_2, and PACKET_COMMAND_COALESCE_BIG_3 flags to determine the actual size of the payload. This MUST NOT be larger than what can fit in a standard DFRAME, including any size already used to store previous coalesce headers and payloads.

bCommand 1 through bCommand n: The command field for the coalesced message. The PACKET_COMMAND_USER_1 flag MUST be set. All other flags are optional.

Value

Meaning

0x01

PACKET_COMMAND_END_COALESCE (Indicates that this is the final coalesced payload in the frame).

0x02

PACKET_COMMAND_RELIABLE (Specifies that the payload SHOULD be delivered reliably).

0x04

PACKET_COMMAND_SEQUENTIAL (Specifies that the payload SHOULD be indicated sequentially).

0x08

PACKET_COMMAND_COALESCE_BIG_1 (Represents bit 9 of the coalesced payload size).

0x10

PACKET_COMMAND_COALESCE_BIG_2 (Represents bit 10 of the coalesced payload size).

0x20

PACKET_COMMAND_COALESCE_BIG_3 (Represents bit 11 of the coalesced payload size, which is the most significant bit).

0x40

PACKET_COMMAND_USER_1 (Indicates that the payload is an internal session management message).

payload 1 through payload n: Contains the consumer payload data.