2.2.1.1.2 Version 2 (DYNVC_CAPS_VERSION2)

The DYNVC_CAPS_VERSION2 PDU is sent by the DVC server manager to indicate that it supports version 2 of the Remote Desktop Protocol: Dynamic Virtual Channel Extension.<3>


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

cbId

Sp

Cmd

Pad

Version

PriorityCharge0

PriorityCharge1

PriorityCharge2

PriorityCharge3

cbId (2 bits): Unused. MUST be set to 0x00.

Sp (2 bits): Unused. SHOULD be set to 0x00.<4>

Cmd (4 bits): MUST be set to 0x05 (Capabilities).

Pad (1 byte): An 8-bit unsigned integer. Unused. MUST be set to 0x00.

Version (2 bytes): A 16-bit unsigned integer. MUST be set to 0x0002.

PriorityCharge0 (2 bytes): A 16-bit unsigned integer. Specifies the amount of bandwidth that is allotted for each priority class, in accordance with the following algorithm.

PriorityCharge1 (2 bytes): A 16-bit unsigned integer. Specifies the amount of bandwidth that is allotted for each priority class, in accordance with the following algorithm.

PriorityCharge2 (2 bytes): A 16-bit unsigned integer. Specifies the amount of bandwidth that is allotted for each priority class, in accordance with the following algorithm.

PriorityCharge3 (2 bytes): A 16-bit unsigned integer. Specifies the amount of bandwidth that is allotted for each priority class, in accordance with the following algorithm.

The PriorityCharge fields determine how much bandwidth is allocated for each priority class. The percentage is calculated using the following formula.

 Base = PriorityCharge0 * PriorityCharge1 *
     PriorityCharge2 * PriorityCharge3 /
     (PriorityCharge1 * PriorityCharge2 * 
     PriorityCharge3 + PriorityCharge0 *
     PriorityCharge2 * PriorityCharge3 + 
    PriorityCharge0 * PriorityCharge1 * PriorityCharge3 + 
     PriorityCharge0 * PriorityCharge1 *
     PriorityCharge2)
            
 BandwidthPriority0 = Base / PriorityCharge0
 BandwidthPriority1 = Base / PriorityCharge1
 BandwidthPriority2 = Base / PriorityCharge2
 BandwidthPriority3 = Base / PriorityCharge3

Where BandwidthPriorityX is a number between 0 and 1, and the total sum of all BandwidthPriorityX values is equal to 1. If PriorityChargeX is set to 0, the priority formula is not used and the data is sent immediately; remaining bandwidth is shared among channels with non-zero PriorityChargeX values, as described in the formula.

To calculate priority charges from given priorities the formula is as follows.

 PriorityCharge0 = 65536 / (BandwidthPriority0 * 100)
 PriorityCharge1 = 65536 / (BandwidthPriority1 * 100)
 PriorityCharge2 = 65536 / (BandwidthPriority2 * 100)
 PriorityCharge3 = 65536 / (BandwidthPriority3 * 100)

Where BandwidthPriorityX is a number between 0 and 1, and the total sum of all BandwidthPriorityX values is equal to 1.

For example, to have distribution for priority 0 to 3 be 70%, 20%, 7%, and 3%, the priority charges numbers are as follows.

 PriorityCharge0 = 65536 / (0.70*100) = 936
 PriorityCharge1 = 65536 / (0.20*100) = 3276
 PriorityCharge2 = 65536 / (0.07*100) = 9362
 PriorityCharge3 = 65536 / (0.03*100) = 21845

Calculating the priority from priority charges, as follows.

 Base = 936 * 3276 * 9362 * 21845 /
     (3276 * 9362 * 21845 + 936 * 9362 * 
     21845 + 936 * 3276 * 21845 + 936 * 
     3276 * 9362) = 655
            
 BandwidthPriority0 = 655/936 = 70%
 BandwidthPriority1 = 655/3276 = 20%
 BandwidthPriority2 = 655/9362 = 7%
 BandwidthPriority3 = 655/21845 = 3%