Regarding USB Virtual Device.

Hi All,

I am evaluating some of the USB Virtual device sharing in the market and
it’s called as UB Over IP/USB Over Ethernet. In this case how is it possible
to remove the local drivers and redirect it to the remote device??? Say if
we replace it with a virtual bus driver then how is it possible for devices
like composite (webcam and headset…) any suggestion would be of great
help.

In simple how is possible to Redirect USB Devices and any idea of how this
can be implemented in Windows???
Thanks,
-Kashi.

Usb Protocol wrote:

I am evaluating some of the USB Virtual device sharing in the market
and it’s called as UB Over IP/USB Over Ethernet. In this case how is
it possible to remove the local drivers and redirect it to the remote
device??? Say if we replace it with a virtual bus driver then how is
it possible for devices like composite (webcam and headset…) any
suggestion would be of great help.

In simple how is possible to Redirect USB Devices and any idea of how
this can be implemented in Windows???

With great difficulty. If you read the archives of this mailing list,
you will see that we have had several people in the past few months
trying to implement just such a thing. Essentially, you have to write
your own USB host controller driver, and find a way to forward all of
the requests and responses from one side to the other. Since the host
controller driver interface is not exhaustively documented, this can be
a frustrating experience.

As to how it would work, just sit back and think about how the USB host
controller currently works. When a new USB device arrives, the host
controller just uses the normal plug-and-play device relations calls to
report that a new device arrived, and it advertises the device ID using
the familiar USB\VID_xxxx&PID_xxxx.… naming scheme. There no magic in
that. Any driver can report a new device ID like that, and when you do,
the I/O subsystem will load a USB driver to handle it. The USB driver
doesn’t know who is underneath it handling the URBs. As long as someone
is listening for and responding to URBs, it all works.

However, I want to reiterate that it isn’t easy. Further, experience
has already shown that isochronous pipes have difficult in this
situation because of the increased latency.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Tim,

The below description of what you explained holds good for redirecting on to
the server where there is no device, but i am wondering how can client
whichever has the actual device allows to share this device remotely???

Does DDK provide any routines inorder to override the current drivers and
allow this to be controlled by someother driver (say some XYZ which will
simply forward the requests from the server and reply back.)

How abt taking control of Composite devices on the client side??? Say in a
normal system a composite driver comes in and he forwards the requests to
the particular FDO’s, but in case if we need to redirect these kind of
devices how to handle these cases, any suggestions would be great.

Server - System where the USB device is virtually redirected.
Client - System where the Physical USB device is pluggedin.

Thanks,
-Kashi.

On Thu, May 15, 2008 at 3:35 PM, Tim Roberts wrote:

> Usb Protocol wrote:
>
>> I am evaluating some of the USB Virtual device sharing in the market and
>> it’s called as UB Over IP/USB Over Ethernet. In this case how is it possible
>> to remove the local drivers and redirect it to the remote device??? Say if
>> we replace it with a virtual bus driver then how is it possible for devices
>> like composite (webcam and headset…) any suggestion would be of great
>> help.
>> In simple how is possible to Redirect USB Devices and any idea of how
>> this can be implemented in Windows???
>>
>
> With great difficulty. If you read the archives of this mailing list, you
> will see that we have had several people in the past few months trying to
> implement just such a thing. Essentially, you have to write your own USB
> host controller driver, and find a way to forward all of the requests and
> responses from one side to the other. Since the host controller driver
> interface is not exhaustively documented, this can be a frustrating
> experience.
>
> As to how it would work, just sit back and think about how the USB host
> controller currently works. When a new USB device arrives, the host
> controller just uses the normal plug-and-play device relations calls to
> report that a new device arrived, and it advertises the device ID using the
> familiar USB\VID_xxxx&PID_xxxx.… naming scheme. There no magic in that.
> Any driver can report a new device ID like that, and when you do, the I/O
> subsystem will load a USB driver to handle it. The USB driver doesn’t know
> who is underneath it handling the URBs. As long as someone is listening for
> and responding to URBs, it all works.
>
> However, I want to reiterate that it isn’t easy. Further, experience has
> already shown that isochronous pipes have difficult in this situation
> because of the increased latency.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Usb Protocol wrote:

The below description of what you explained holds good for redirecting
on to the server where there is no device, but i am wondering how can
client whichever has the actual device allows to share this device
remotely???

I suspect you could do it with an upper filter driver on the host
controller, or perhaps by replacing the USB hub driver.

Does DDK provide any routines inorder to override the current drivers
and allow this to be controlled by someother driver (say some XYZ
which will simply forward the requests from the server and reply back.)

Not directly, no.

How abt taking control of Composite devices on the client side??? Say
in a normal system a composite driver comes in and he forwards the
requests to the particular FDO’s, but in case if we need to redirect
these kind of devices how to handle these cases, any suggestions would
be great.

If you do it right, the composite driver will never get loaded on the
client. You’ll just route the composite device’s ID over to the server,
and when you advertise the composite device, plug-and-play will load the
composite driver and the individual interface drivers there. Requests
from the interface drivers will be routed to the composite driver, which
will forward them on to your fake host controller. You’ll route them to
the client, and send them to the real host controller. It doesn’t need
to know that the rest of the driver stack lives on another machine.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

On Thu, May 15, 2008 at 5:03 PM, Tim Roberts wrote:

> Usb Protocol wrote:
>
>> The below description of what you explained holds good for redirecting on
>> to the server where there is no device, but i am wondering how can client
>> whichever has the actual device allows to share this device remotely???
>>
>
> I suspect you could do it with an upper filter driver on the host
> controller, or perhaps by replacing the USB hub driver.

Is it a good idea to replace the USB Hub Driver, say incase the
server/client doesn’t want all the devices to be redirected in which case
the local hub driver has to take care of the devices locally. How about a
virtual Bus driver on the client and an application which can control what
devices has to be controlled by the virtual bus driver and release them to
the local Hub driver whenever not required??? Do you think this works??? Or
an application forcely overrides the current/existing drivers using routines
like UpdateDriverForPlugAndPlayDevices () provided by DDK??? But in this
case if we stop sharing will the original drivers get loaded
automatically??? So i am not sure as to which one is the best practice to
follow… As per the understanding from DDK filter drivers are more for
trapping/changing/modifying the request but not to control the devices…so
i am not sure what you meant by upper filter driver…

>
>
> Does DDK provide any routines inorder to override the current drivers and
>> allow this to be controlled by someother driver (say some XYZ which will
>> simply forward the requests from the server and reply back.)
>>
>
> Not directly, no.
>
>
> How abt taking control of Composite devices on the client side??? Say in a
>> normal system a composite driver comes in and he forwards the requests to
>> the particular FDO’s, but in case if we need to redirect these kind of
>> devices how to handle these cases, any suggestions would be great.
>>
>
> If you do it right, the composite driver will never get loaded on the
> client. You’ll just route the composite device’s ID over to the server, and
> when you advertise the composite device, plug-and-play will load the
> composite driver and the individual interface drivers there. Requests from
> the interface drivers will be routed to the composite driver, which will
> forward them on to your fake host controller. You’ll route them to the
> client, and send them to the real host controller. It doesn’t need to know
> that the rest of the driver stack lives on another machine.

Yeah as explained above i don’t want to replace the HUB Driver and always
control the device by these components to redirect, instead it would be good
to load the devices as local and them based on which one to be redirected
then redirect those devices alone.

Thanks again!!!

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Usb Protocol wrote:

Is it a good idea to replace the USB Hub Driver, say incase the
server/client doesn’t want all the devices to be redirected in which
case the local hub driver has to take care of the devices locally. How
about a virtual Bus driver on the client and an application which can
control what devices has to be controlled by the virtual bus driver
and release them to the local Hub driver whenever not required??? Do
you think this works??? Or an application forcely overrides the
current/existing drivers using routines like
UpdateDriverForPlugAndPlayDevices () provided by DDK??? But in this
case if we stop sharing will the original drivers get loaded
automatically??? So i am not sure as to which one is the best practice
to follow…

It is not clear to me that your goal can be achieved. Brainstorming
here, I suppose you could implement a lower filter to the USB hub driver
on the client side. When you decide you want to redirect a device, you
could cycle power on the port, then intercept the re-enumeration and
start redirecting.

Well-documented? No. Easy? No. Good idea? Probably not.

As per the understanding from DDK filter drivers are more for
trapping/changing/modifying the request but not to control the
devices…so i am not sure what you meant by upper filter driver…

I don’t know what you mean here. A filter driver is in the driver
stack, just like any other driver. It can do whatever the main function
driver can do.

Yeah as explained above i don’t want to replace the HUB Driver and
always control the device by these components to redirect, instead it
would be good to load the devices as local and them based on which one
to be redirected then redirect those devices alone.

Remember that every driver expects to be given a virgin, uninitialized
device. Once you allow the local driver to initialize, you can’t just
start redirecting. You have to reset the device, so the new driver on
the other side can redo the initialization.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Tim,

Do we have any Virtual USB Hub sample in DDK??? or any reference as to what
driverentry points this need to have in the virtual USB Hub driver???
Thanks,
-Kashi.
On Fri, May 16, 2008 at 10:16 AM, Tim Roberts wrote:

> Usb Protocol wrote:
>
>>
>> Is it a good idea to replace the USB Hub Driver, say incase the
>> server/client doesn’t want all the devices to be redirected in which case
>> the local hub driver has to take care of the devices locally. How about a
>> virtual Bus driver on the client and an application which can control what
>> devices has to be controlled by the virtual bus driver and release them to
>> the local Hub driver whenever not required??? Do you think this works??? Or
>> an application forcely overrides the current/existing drivers using routines
>> like UpdateDriverForPlugAndPlayDevices () provided by DDK??? But in this
>> case if we stop sharing will the original drivers get loaded
>> automatically??? So i am not sure as to which one is the best practice to
>> follow…
>>
>
> It is not clear to me that your goal can be achieved. Brainstorming here,
> I suppose you could implement a lower filter to the USB hub driver on the
> client side. When you decide you want to redirect a device, you could cycle
> power on the port, then intercept the re-enumeration and start redirecting.
>
> Well-documented? No. Easy? No. Good idea? Probably not.
>
>
> As per the understanding from DDK filter drivers are more for
>> trapping/changing/modifying the request but not to control the devices…so
>> i am not sure what you meant by upper filter driver…
>>
>
> I don’t know what you mean here. A filter driver is in the driver stack,
> just like any other driver. It can do whatever the main function driver can
> do.
>
>
> Yeah as explained above i don’t want to replace the HUB Driver and always
>> control the device by these components to redirect, instead it would be good
>> to load the devices as local and them based on which one to be redirected
>> then redirect those devices alone.
>>
>
> Remember that every driver expects to be given a virgin, uninitialized
> device. Once you allow the local driver to initialize, you can’t just start
> redirecting. You have to reset the device, so the new driver on the other
> side can redo the initialization.
>
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Usb Protocol wrote:

Do we have any Virtual USB Hub sample in DDK???

No, naturally not. Such a thing is far too specialized.

or any reference as to what driverentry points this need to have in
the virtual USB Hub driver???

A USB hub driver needs to support the requests that USB drivers submit.
How do USB drivers communicate?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.