Please I need your help.

Dear ALL,
I am new to driver programming. Actually I need your advices ONLY before getting started in driver programming. All what I need is to implement a pseudo NIC that forwards the received packets to IPv6 stack instead of IPv4 stack. Please guide me what kind of drivers I need to know in NDIS? Miniport? Intermediate? Protocol Driver? Or all of them?
It is possible to make the packet forwarded to other stack or not? The last question is: can we make this layer to communicate with raw_socket?
thank you very much

>stack instead of IPv4 stack. Please guide me what kind of drivers I need to know in NDIS? Miniport?

Intermediate? Protocol Driver? Or all of them?

MUX IM, i.e. a protocol and a miniport in the same binary.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Thnx for the reply… You mean I have to implement those two drivers and create a communication links “send/receive” between them?

This is not really my thing, but, no, I’m pretty sure that is not what Maxim means.

I think that he was describing the functionality of a MUX Intermediate NDIS driver.

You might want to take a look at the ‘mux’ sample in the wdk.

Before that, however, if you haven’t already installed the 7.1.7600.0 WDK, you should do so. It is available both on connect.microsoft.com (WDK connection) and MSDN (subscriber downloads). It is called the ‘Windows Driver Kit 7.1.0’ in both places, however the name of the actual download is different.

CONNECT: GRMWDK_EN_7600_1.ISO
MSDN: en_windows_driver_kit_version_7.1.0_x86_x64_ia64_dvd_496758.iso (under Operating Systems/Windows 7)

So, assuming that you have installed THAT wdk into directory , the sample will be located in:

/src/network/ndis/mux

Good luck,

mm

What do you mean “forwards” IPV4 packets to IPV6. Like a tunnel of some
kind? Win7 (and maybe some earlier versions) already include IPV4/IPV6
interop support. You should look at those and be sure you don’t want to
reinvent what’s already there.

To me it sounds like you need something rather different than a MUX driver,
which talks Ethernet packets on both the top and bottom. You need to take
the IPV4 packets, and encapsulate them or something as IPV6 datagrams. This
sounds like a IPV6 VPN, which passes IPV4 Ethernet traffic.

Do you want to wrap IPV4 datagrams (which will not have Ethernet MAC
headers)? Or Ethernet packets which contain IPV4 datagrams?

If I were you, I’d get squeaky clear about what you want to do. Do you want
the final traffic to look like:

MAC header–IPV6 header–IPV4 header–TCP header–app data

Or something different like:

MAC header–IPV6 header–UDP header–with a UDP payload of IPV4 header–TCP
header–app data

Or

MAC header–IPV6 header–UDP header–with a UDP payload of MAC header–IPV4
header–TCP header–app data

Jan

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-411346-
xxxxx@lists.osr.com] On Behalf Of xxxxx@vub.ac.be
Sent: Saturday, May 15, 2010 11:13 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Please I need your help.

Dear ALL,
I am new to driver programming. Actually I need your advices ONLY
before getting started in driver programming. All what I need is to
implement a pseudo NIC that forwards the received packets to IPv6 stack
instead of IPv4 stack. Please guide me what kind of drivers I need to
know in NDIS? Miniport? Intermediate? Protocol Driver? Or all of them?
It is possible to make the packet forwarded to other stack or not? The
last question is: can we make this layer to communicate with
raw_socket?
thank you very much


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

No, 1 driver, which is both a protocol and a miniport.

Look at MUX sample in the DDK.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Thnx for the reply… You mean I have to implement those two drivers and create a communication links “send/receive” between them?
>

First of all I would like to thank you all for your kind assistant. I really appreciate that…

mm Thank you for your reply. I have already installed WDK 7.1.7600.0 and I found the example.

Jan really you are soooo kind. Thank you very much…
Please let me explain you a little bit what do I mean:
I need to develop a driver that wrap the outgoing IPv6 traffic into IPv4 datagrams so the outgoing traffic will look like:
MAC header–IPV4 header–IPV6 header–TCP header–app data
Similarly, the driver should strip off the IPv4 header from the received IPv4 datagrams and forward them to the IPv6 stack. So it always should use the IPv6 stack to communicate with higher levels “APIs” as well as it should use the IPv4 stack to transmit the IPv6 datagrams to the network after encapsulating them into IPv4 datagrams…
What shall I do? Which NDIS drivers should I use? Do you think NDIS can do tunneling ? Thank you again brother…

What you describe is a IPV6 tunnel over IPV4. There are a couple different
flavors of this built into the Win 7 networking system, based on Internet
standards.

You should look at http://technet.microsoft.com/en-us/library/bb726951.aspx
to see flavors of IPV6 over IPV4 tunneling that come built in from
Microsoft.

Jan

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-411363-
xxxxx@lists.osr.com] On Behalf Of xxxxx@vub.ac.be
Sent: Saturday, May 15, 2010 3:52 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Please I need your help.

First of all I would like to thank you all for your kind assistant. I
really appreciate that…

mm Thank you for your reply. I have already installed WDK 7.1.7600.0
and I found the example.

Jan really you are soooo kind. Thank you very much…
Please let me explain you a little bit what do I mean:
I need to develop a driver that wrap the outgoing IPv6 traffic into
IPv4 datagrams so the outgoing traffic will look like:
MAC header–IPV4 header–IPV6 header–TCP header–app data
Similarly, the driver should strip off the IPv4 header from the
received IPv4 datagrams and forward them to the IPv6 stack. So it
always should use the IPv6 stack to communicate with higher levels
“APIs” as well as it should use the IPv4 stack to transmit the IPv6
datagrams to the network after encapsulating them into IPv4 datagrams…
What shall I do? Which NDIS drivers should I use? Do you think NDIS can
do tunneling ? Thank you again brother…


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

Yes Jan I know all these stuff… But my driver should do many tasks one of them is the tunneling. Specially tunneling will be used in some circumstances (depending on the network type) and not all the time. So I should implement this in the driver itself. I don’t know if there are predefined functions to use in NDIS to do this.

I tried to illustrate my idea in the following diagram, the NDIS driver will receive the IPv6 datagrams, then tunnel them into IPv4 packets finally forwards them to IPv4 stack for transmission, similarly , the received IPv4 datagrams should be decapsulated and forwarded to the IPv6 stack. Please let me know if that possible in NDIS or not? Also If I want the NDIS driver to forward all the traffic to the tunneling/detunneling server “like raw_socket server running on the same host” is that possible? What type of drivers needed to implement this, MUX or something else?
Knowing that I have no background on NDIS programming yet, so I need to know whether it is possible to do this or not prior start reading about driver programming.
Thank you

| |
| |
-+±
±–+ \ /
±-v–+ | ±----+
| TCP | | | TCP |
| UDP | | |UDP |
| IPv4 | | |IPv6 |
±-±-+ | ±-^-+
| | |
| | ±-v-----------+
| +>|NDIS Driver |
| ±--------------+
|
±------>network

Do you really need encapsulate IP4 in IP6 in each Ethernet packet?
If so, you could face one problem when you decide implement your design in a NDIS driver. Receiving a Ethernet packet in already encapsulated IP4 is not a problem. You could simple remove IP6 header. But sending such packet could be not easy. Your MUX NDIS driver gets already prepared Ethernet frame and you need insert IP6 header. But Ethernet packet may not have extra space. You would need to allocate another Ethernet packet. It creates overhead of sending data.
If you could insert IP6 header only in beginning IP datagram your design should be simpler. In this case you need to filter IP data somewhere higher than NDIS stack.

Igor Sharovar

Yes, it is quite possible.

Your ‘tunnel’ adapter would typically be bound only to IP6. It would
receive packets from IP6, strip the MAC framing, and send them into an IP4
endpoint via either TDI or WSK (or WFP). This depends on the platform you
are targeting (NT5 or NT6).

As was pointed out earlier, both 4-to-6 and 6-to-4 have been implemented on
Windows for quite some time.

It sounds like you are trying to invent “Yet another VPN” or some sort.

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@vub.ac.be
Sent: Sunday, May 16, 2010 2:45 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Please I need your help.

I tried to illustrate my idea in the following diagram, the NDIS driver will
receive the IPv6 datagrams, then tunnel them into IPv4 packets finally
forwards them to IPv4 stack for transmission, similarly , the received IPv4
datagrams should be decapsulated and forwarded to the IPv6 stack. Please let
me know if that possible in NDIS or not? Also If I want the NDIS driver to
forward all the traffic to the tunneling/detunneling server “like raw_socket
server running on the same host” is that possible? What type of drivers
needed to implement this, MUX or something else?
Knowing that I have no background on NDIS programming yet, so I need to know
whether it is possible to do this or not prior start reading about driver
programming.
Thank you

| |
| |
-+±
±–+ \ /
±-v–+ | ±----+
| TCP | | | TCP |
| UDP | | |UDP |
| IPv4 | | |IPv6 |
±-±-+ | ±-^-+
| | |
| | ±-v-----------+
| +>|NDIS Driver |
| ±--------------+
|
±------>network


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

Thnx Igor and Dave for your comments…

No Igore, I need to tunnel IPv6 packets into IPv4 and send them to the NT4. Similarly, de-tunnel the received IPv4 packets “the resultant packets are IPv6” and forwards them upwards to the IPv6 stack.

I need this driver to be enabled after certain conditions have been satisfied. Can we implement a driver with different behaviors? I meant, depending on some conditions “like case or If statements” the driver will do tunneling, but if these conditions are NOT satisfied it will NOT do tunneling?

Dave: Would you please give me more hints, from where I should start reading? What is the best tutorial or reference to do this? Which sample source code to use in the help?

Thank you

Sorry guys I forget to ask you if anybody has a sample code that illustrates the communication between NDIS driver and raw sockets.

Look for Winsock Kernel (WSK) in the WDK Help file.

Thomas F. Divine
http://www/pcausa.com


From:
Sent: Monday, May 17, 2010 7:02 AM
To: “Windows System Software Devs Interest List”
Subject: RE:[ntdev] Please I need your help.

> Sorry guys I forget to ask you if anybody has a sample code that
> illustrates the communication between NDIS driver and raw sockets.
>
> —
> 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