1.3 Protocol Overview (Synopsis)

The Remote Desktop Protocol: USB Devices Virtual Channel Extension is used to transfer USB packets from a terminal server to a terminal client. The client forwards the USB packets to a physical device. Then the client returns the results after the physical device reassembles the packets.

Because this protocol can redirect a USB device, the implementer has to provide a way for the client to specify the USB devices that are redirected using this protocol, or the devices that will use an alternative method or the devices that are not redirected at all. When the device is redirected it cannot be used on the client. Examples:

  • A USB mouse is attached to the client. If redirected using this protocol the mouse cannot be used on the client locally. However, if the client doesn't have a driver for the USB mouse, or if this is a second USB mouse, then this is an appropriate scenario to redirect a USB mouse using this protocol.

  • Flash drive: Alternative methods for redirecting the drive, such as the one described in [MS-RDPEFS]; might or might not be more successful because that protocol is optimized for drives.

The examples can become complicated if composite devices are behind one USB device, because there are several different devices that can be used. As a result there isn't one definitive answer to what method can be used; as a result, this protocol is not trying to enforce any decision. The implementer of this protocol can consider enough provisions to give the user flexibility to choose whether or not to redirect a device, and can attempt to prevent the user from losing control of a USB device that the user doesn't want to be redirected. Examples of such provisions are: group policies, notifications, User Interface for selecting the right device, and so on.

The following diagram describes the event sequences in relation to the hardware USB device and the USB driver stack on the server.

USB stack flow

Figure 1: USB stack flow

When a USB device is plugged in, the client sends to the server the Add Virtual ChannelĀ  Message as described in section 1.3.1.2. The server in response sends the Channel Create Message described in section 2.2.5.1 and waits for the same message to arrive from the client. The server then creates a USB driver stack that will represent the device to the system. Immediately after the client has sent the Channel Create Message, the client then sends the Add Device Message as described in section 1.3.1.2. After that point, the server and the client are ready to exchange I/O packets as described in section 1.3.1.3.

When the device is unplugged from the client, it closes the channel to the server on which the I/O is sent for that particular device. This destroys the driver stacks and stops any further I/O between the client and the server.