4.1.1 On the Sender when sending the packet
The Sender constructs a packet layout by first prepending an incremental channel sequence number to the data blob and then buffers a copy of the packet to the Sender reliability controller for a possible retransmission if it is later declared lost (section 3.1.1.2.4.1).
The Sender increments by 1 the circular upper bound of the active range of the Sender window buffer, and obtains the newest sequence number to use for this packet. The state of the new node in the buffer is set to Pending (section 3.1.1.2.1).
The Sender prepares the packet header (section 2.2.1). It must include a DATA payload (both DataHeader (section 2.2.1.2.5) and DataBody (section 2.2.1.2.7) portions). It may check if other optional payloads need to be packed into this packet, including:
If there is any outstanding acknowledgment of the opposite connection waiting to be sent (section 2.2.1.2.1).
If there is any acknowledgment vector payloads of the opposite connection that should be sent (section 2.2.1.2.6).
If there is any AckOfAcks payload for the Sender (section 2.2.1.2.4).
If there are any other payloads to include, such as OverheadSize payload (section 2.2.1.2.2), DelayedAckInfo payload (section 2.2.1.2.3), logWindowSize update, and so on.
The Sender encodes the header flag and all the optional payload data according to the packet layout described in section 2.2.1.
The Sender converts the resulting packet layout to the OnWire version (section 3.1.1.1.5.1) in preparation for sending.