TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Device Drivers

USB RNDIS

Microsoft Device Drivers

 
 
Thread Tools Display Modes
Unread 04-12-2007, 12:21 PM   #1
Stefan Busch
Guest
 
Posts: n/a
USB RNDIS

Hi Folks,

i hope you could help me.

Problem Description:
I have a device that i want to connect with my HomePC using an USB RNDIS
Connection. Setting up the inf File is not that Problem, the Inf File works
and Windows sets up an Network Device that i can use for this Connection.
After configuring the netzworkdevice (IP-Adress, etc.) everything works fine.
But:
Can i configure the Networkdevice automatically after Installation? That
means that after the correct driver is installed, the networkdevice should
have an IP-Adress.

Can i configure the IP of the connected Device remotely? (For testing
purpose i have set the Ip-Adress of the device manually..)


Thanks for advice
Stefan
 
Unread 04-12-2007, 12:22 PM   #2
Stefan Busch
Guest
 
Posts: n/a
RE: USB RNDIS

oh.. i have forgotten to tell you that this should work with windows xp/2000
and vista(if possible)

"Stefan Busch" wrote:

> Hi Folks,
>
> i hope you could help me.
>
> Problem Description:
> I have a device that i want to connect with my HomePC using an USB RNDIS
> Connection. Setting up the inf File is not that Problem, the Inf File works
> and Windows sets up an Network Device that i can use for this Connection.
> After configuring the netzworkdevice (IP-Adress, etc.) everything works fine.
> But:
> Can i configure the Networkdevice automatically after Installation? That
> means that after the correct driver is installed, the networkdevice should
> have an IP-Adress.
>
> Can i configure the IP of the connected Device remotely? (For testing
> purpose i have set the Ip-Adress of the device manually..)
>
>
> Thanks for advice
> Stefan

 
Unread 04-12-2007, 12:25 PM   #3
chris.aseltine@gmail.com
Guest
 
Posts: n/a
Re: USB RNDIS

On Oct 15, 2:56 am, Stefan Busch <Stefan
Bu...@discussions.microsoft.com> wrote:

> Can i configure the Networkdevice automatically after Installation? That
> means that after the correct driver is installed, the networkdevice should
> have an IP-Adress.


I have to assume there's some convention in RNDIS for accomplishing
this. In the CDC Ethernet world, I embedded a small DHCP server into
my NDIS driver, and then communicated the TCP/IP settings (IP,
netmask, gateway, DNS) to my device via endpoint zero control requests.

 
Unread 04-12-2007, 12:32 PM   #4
Stefan Busch
Guest
 
Posts: n/a
Re: USB RNDIS

But how can i serve an IP to my Networkcard? (not to the device plugged to my
pc via usb, but to my simulated networkcard?)

"chris.aseltine***********" wrote:

> On Oct 15, 2:56 am, Stefan Busch <Stefan
> Bu...@discussions.microsoft.com> wrote:
>
> > Can i configure the Networkdevice automatically after Installation? That
> > means that after the correct driver is installed, the networkdevice should
> > have an IP-Adress.

>
> I have to assume there's some convention in RNDIS for accomplishing
> this. In the CDC Ethernet world, I embedded a small DHCP server into
> my NDIS driver, and then communicated the TCP/IP settings (IP,
> netmask, gateway, DNS) to my device via endpoint zero control requests.
>
>

 
Unread 04-12-2007, 12:40 PM   #5
chris.aseltine@gmail.com
Guest
 
Posts: n/a
Re: USB RNDIS

On Oct 16, 2:32 am, Stefan Busch
<StefanBu...@discussions.microsoft.com> wrote:

> But how can i serve an IP to my Networkcard? (not to the device plugged to my
> pc via usb, but to my simulated networkcard?)


Like I said, I did this in my NDIS miniport using a miniature DHCP
server inside the driver which responded to DHCP discover and request
packets...

If you are using the generic RNDIS driver then I have no idea, but
like I said, there's gotta be a way...

 
Unread 04-12-2007, 12:44 PM   #6
Maxim S. Shatskih
Guest
 
Posts: n/a
Re: USB RNDIS

> But how can i serve an IP to my Networkcard? (not to the device plugged to my
> pc via usb, but to my simulated networkcard?)


Either you rely on a user which will set it in the Control Panel.

Or you write the user-mode code which will do the same by calling IP Helper API
or INetCfg.

Or you implement the fake DHCP server in your driver.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

 
Unread 04-12-2007, 12:51 PM   #7
Stefan Busch
Guest
 
Posts: n/a
Re: USB RNDIS

dear chris,

how did you manage to respond to the dchp discover/request messages the
"Client" has sent?

i can only recieve them when i have a ip-address assigned :-(

1. The New NIC Adapter is installed
2. The New Adapter tries to get an DHCP IP Address by sending DCHP Discover
Messages to ipv4 broadcast 255.255.255.255
3. I try to fetch the DHCPDiscover Messages by listening to the UDP Port 67,
but i cant fetch them because i havent an IP-Address yet..
4. The NIC (from 1) gets an APIPA Address assigned
5. The NIC retries to get an DHCP IP -Adress (like 2)
6. I can fetch the DHCPDiscover Message because now my interface has an
APIPA IP
7. The Interface gets the New IP I have configured through my "DHCP"

but how can i directly assign an address without using the APIPA Address?


Thanks a lot!


"chris.aseltine***********" wrote:

> On Oct 16, 2:32 am, Stefan Busch
> <StefanBu...@discussions.microsoft.com> wrote:
>
> > But how can i serve an IP to my Networkcard? (not to the device plugged to my
> > pc via usb, but to my simulated networkcard?)

>
> Like I said, I did this in my NDIS miniport using a miniature DHCP
> server inside the driver which responded to DHCP discover and request
> packets...
>
> If you are using the generic RNDIS driver then I have no idea, but
> like I said, there's gotta be a way...
>
>

 
Unread 04-12-2007, 12:57 PM   #8
chris.aseltine@gmail.com
Guest
 
Posts: n/a
Re: USB RNDIS

On Oct 17, 4:49 am, Stefan Busch
<StefanBu...@discussions.microsoft.com> wrote:

> how did you manage to respond to the dchp discover/request messages the
> "Client" has sent?
>
> 1. The New NIC Adapter is installed
> 2. The New Adapter tries to get an DHCP IP Address by sending DCHP Discover
> Messages to ipv4 broadcast 255.255.255.255
> 3. I try to fetch the DHCPDiscover Messages by listening to the UDP Port 67,
> but i cant fetch them because i havent an IP-Address yet..


I think you're saying you have some user mode DHCP server, if you are
using terminology like "listening on UDP Port 67".

My approach is totally different -- I'm inside the network driver
itself, so I can see and identify the very first DHCP discover packet
-- instead of sending it to my device, I complete the discover packet,
construct a new OFFER (and then ACK) packet, and send it back to NDIS
on the fly.

 
Unread 04-12-2007, 01:06 PM   #9
Stefan Busch
Guest
 
Posts: n/a
Re: USB RNDIS

yes youre right chris, i have programmed a small dhcp server, and tried to
fake DHCP Offer/Ack packages...

But this won't help me :-) i can only send dhcp offer/ack packages when the
Network adapter has already an ip ..

so.. i´ve never written an driver on my own, is ist possible to modify the
USB RNDIS driver with the DriverDevelopmentKit in that way you did, or do i
have to write the whole rndis driver on my own ?

thanks a lot for your advice chris!

"chris.aseltine***********" wrote:

> On Oct 17, 4:49 am, Stefan Busch
> <StefanBu...@discussions.microsoft.com> wrote:
>
> > how did you manage to respond to the dchp discover/request messages the
> > "Client" has sent?
> >
> > 1. The New NIC Adapter is installed
> > 2. The New Adapter tries to get an DHCP IP Address by sending DCHP Discover
> > Messages to ipv4 broadcast 255.255.255.255
> > 3. I try to fetch the DHCPDiscover Messages by listening to the UDP Port 67,
> > but i cant fetch them because i havent an IP-Address yet..

>
> I think you're saying you have some user mode DHCP server, if you are
> using terminology like "listening on UDP Port 67".
>
> My approach is totally different -- I'm inside the network driver
> itself, so I can see and identify the very first DHCP discover packet
> -- instead of sending it to my device, I complete the discover packet,
> construct a new OFFER (and then ACK) packet, and send it back to NDIS
> on the fly.
>
>

 
 

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 05:00 AM.


vBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2013, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional