3.1.1.1.5.1 Sending RDP-UDP2 Packet

Before an RDP-UDP2 packet is sent over the UDP transport by the sender, it MUST be transformed to include the PacketPrefixByte using the procedure outlined below. After the procedure is completed, the payload can be sent over the UDP transport and the PacketPrefixByte will always be the eighth byte in the transmitted payload.

  1. Generate a valid PacketPrefixByte (section 3.1.1.1.5).

  2. If the size of the RDP-UDP2 Packet Layout is less than 7 bytes, then it MUST be padded to be of length of 7 bytes and the original length in bytes MUST be set in the Short_Packet_Length field of the PacketPrefixByte structure. Otherwise, the Short_Packet_Length field of the PacketPrefixByte structure MUST be set to 7.

  3. Prefix the PacketPrefixByte (section 2.2.1.3) structure to the RDP-UDP2 Packet Layout. After this step, the first byte in the payload is the PacketPrefixByte, followed by the RDP-UDP2 Packet Layout.

  4. Swap the first byte of the payload, which is the PacketPrefixByte, with the eighth byte of the payload.

Example:

An RDP-UDP2 packet has the following 10 bytes: 0x30, 0x35, 0x56, 0x78, 0xa2, 0x36, 0x73, 0xee, 0x68, 0xf2.

Step1: PacketPrefixByte = 0x10.

Step 2: This step is skipped because the RDP-UDP2 packet size is larger than 7 bytes and padding is not needed.

Step 3: The payload is prefixed with the PacketPrefixByte: 0x10, 0x30, 0x35, 0x56, 0x78, 0xa2, 0x36, 0x73, 0xee, 0x68, 0xf2.

Step 4: Swap the first and eighth byte to generate the final payload that can be sent over UDP: 0x73, 0x30, 0x35, 0x56, 0x78, 0xa2, 0x36, 0x10, 0xee, 0x68, 0xf2.