2.2.3 Coalesced Payloads

Coalesced payloads are a special form of payload within standard data frames (DFRAME). When the PACKET_CONTROL_COALESCE flag is set on the outer DFRAME header bControl field, the payload is interpreted by 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 2-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 nonpadded 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, 1 to 3 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 total size of the DFRAME with coalesced payloads SHOULD NOT be larger than the maximum transmission unit (MTU) of the underlying protocol and network. Each individual payload MUST NOT be larger than what is fit in the coalesced DFRAME.


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

bCommand

bSize 2 (optional)

bCommand 2 (optional)

...

bSize n-1 (optional)

bCommand n-1 (optional)

bSize n (optional)

bCommand n (optional)

payload (variable)

...

payload 2 (variable)

...

payload n-1 (variable)

...

payload n (variable)

...

bSize (1 byte): 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 as an 11-bit value. The payload is constructed as follows:

  • A left-bitwise-shift operation by 5 bits is performed on the contents of the bCommand field masked by the flags. This forms the 3 most significant bits in the actual payload.

  • A bitwise OR operation with the value of bSize forms the lower 8 bits in the actual payload.

The actual size of the payload 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 byte): Command field for the coalesced message containing zero or more flags from the following table.

Value

Meaning

0x01

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

0x02

PACKET_COMMAND_RELIABLE (payload is delivered reliably).

0x04

PACKET_COMMAND_SEQUENTIAL (payload is indicated sequentially).

0x08

PACKET_COMMAND_COALESCE_BIG_1 (bit 9 of the coalesced payload size).

0x10

PACKET_COMMAND_COALESCE_BIG_2 (bit 10 of the coalesced payload size).

0x20

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

0x40

PACKET_COMMAND_USER_1 (first consumer-controlled flag).

0x80

PACKET_COMMAND_USER_2 (second consumer-controlled flag).

bSize 2 (1 byte): See bSize earlier in this topic.

bCommand 2 (5 bytes): See bCommand earlier in this topic.

bSize n (1 byte): See bSize earlier in this topic.

bCommand n (1 byte): See bCommand earlier in this topic.

payload (variable): Consumer payload data.

payload 2 (variable): See payload earlier in this topic.

payload n (variable): See payload earlier in this topic.