Kernel simple network client

Dear friends
Hello

I want to write a simple network client that connect to a remote server
program(simple http server for example) and send files and data to it and
receive files or data from it.

As I saw the DDK documentation 2008 , for windows vista , the kernel socket
has defined.Should I use TDI to implement my driver in windows xp?

I am confused about protocol implementation in kernel mode.what should I do
for file trasfering?

Please help me
Cheers
Jack

Jack sa wrote:

Dear friends
Hello

I want to write a simple network client that connect to a remote server
program(simple http server for example) and send files and data to it
and receive files or data from it.

As I saw the DDK documentation 2008 , for windows vista , the kernel
socket has defined.Should I use TDI to implement my driver in windows xp?

Yes, pre-Vista you need to implement your own interface using TDI.

I am confused about protocol implementation in kernel mode.what should I
do for file trasfering?

This is up to you … if you have control over both ends of the
connection then you can implement whatever mechanism you want. For
instance, send a small block over with a file identifier, offset and
length of the read and the server will return the data content. Of
course if you don’t have control over the server side then you will have
to match the server protocol for issuing requests.

Pete

Please help me
Cheers
Jack — NTFSD is sponsored by OSR For our schedule of debugging and
file system seminars (including our new fs mini-filter seminar) 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


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

Why do you want it in kernel mode?

Well, as if I’ve to sign something !
Prokash Sinha
http://prokash.squarespace.com
Success has many fathers, but failure is an orphan.

----- Original Message -----
From: Jack sa
To: Windows File Systems Devs Interest List
Sent: Sunday, March 29, 2009 1:04 AM
Subject: [ntfsd] Kernel simple network client

Dear friends
Hello

I want to write a simple network client that connect to a remote server program(simple http server for example) and send files and data to it and receive files or data from it.

As I saw the DDK documentation 2008 , for windows vista , the kernel socket has defined.Should I use TDI to implement my driver in windows xp?

I am confused about protocol implementation in kernel mode.what should I do for file trasfering?

Please help me
Cheers
Jack — NTFSD is sponsored by OSR For our schedule of debugging and file system seminars (including our new fs mini-filter seminar) 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

>As I saw the DDK documentation 2008 , for windows vista , the kernel socket has defined.

WSK is not like the user-mode sockets at all. It is actually more like TDI.

Anyway TDI, WSK and the user-mode sockets are 3 different interfaces.

I do not think that implementing WSK client is easier then a TDI client.

Should I use TDI to implement my driver in windows xp?

Yes, TDI is the only way to write the kernel-mode TCP/IP client in pre-Vista.

Since you need TDI for pre-Vista anyway, I would not even bother WSK and would wrote the TDI client for all range of OSes.


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

Maxim S. Shatskih wrote:

> As I saw the DDK documentation 2008 , for windows vista , the kernel socket has defined.

WSK is not like the user-mode sockets at all. It is actually more like TDI.

Anyway TDI, WSK and the user-mode sockets are 3 different interfaces.

I do not think that implementing WSK client is easier then a TDI client.

Are you kidding? WSK is orders of magnitude easier to establish a socket
connection to a remote system.

> Should I use TDI to implement my driver in windows xp?

Yes, TDI is the only way to write the kernel-mode TCP/IP client in pre-Vista.

Since you need TDI for pre-Vista anyway, I would not even bother WSK and would wrote the TDI client for all range of OSes.

Using the TDI ‘interface’ on Vista and above contributes a performance
overhead ranging from 5-20%, though I have not encountered any overhead
of more than 5-7%. As well, MSFT will be obsoleting the TDI interface in
some future revision of the OS, it was actually an after thought in
Vista once they realized how many firewalls were broken when they
removed it.

Pete


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

> Using the TDI ‘interface’ on Vista and above contributes a performance

overhead ranging from 5-20%, though I have not encountered any overhead
of more than 5-7%.

Overhead in what? CPU time? connection performance? on pre-Vista, it was easily possible to saturate the 100Mb (never tried 1Gb or more) Ethernet via TDI.

Network stack in Windows is very fast (if used properly) and TDI can get a maximum of it.

Also note that around half of the MS’s kernel-mode TCP/IP clients are still TDI.

As well, MSFT will be obsoleting the TDI interface in
some future revision of the OS, it was actually an after thought in
Vista once they realized how many firewalls were broken when they
removed it.

  1. Firewalls are broken anyway, since TDI filters will not filter all traffic in Vista+ and are useless.
  2. Since several kernel-mode modules by MS themselves are still TDI, I think they just could not finish the move to WSK in Vista timeframe.


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

I don’t remember all of it, but when I tried to see how simple it is to
exercise the boilerplate code that comes with the WDK, it was heck a easy

I just compiled, started the service on demand ( opened the cports utility
to see it is listening to the port as stated ), changed couple lines of an
user mode echoclient ( to make it from bsd style to winsock style), fire it
up, and here you go… Seriously, I think one can get a WSKclient up and
running in a week, as far as I could recall …

Well, as if I’ve to sign something !
Prokash Sinha
http://prokash.squarespace.com
Success has many fathers, but failure is an orphan.

----- Original Message -----
From: “Maxim S. Shatskih”
Newsgroups: ntfsd
To: “Windows File Systems Devs Interest List”
Sent: Sunday, March 29, 2009 7:24 AM
Subject: Re:[ntfsd] Kernel simple network client

>As I saw the DDK documentation 2008 , for windows vista , the kernel socket
>has defined.

WSK is not like the user-mode sockets at all. It is actually more like TDI.

Anyway TDI, WSK and the user-mode sockets are 3 different interfaces.

I do not think that implementing WSK client is easier then a TDI client.

>Should I use TDI to implement my driver in windows xp?

Yes, TDI is the only way to write the kernel-mode TCP/IP client in
pre-Vista.

Since you need TDI for pre-Vista anyway, I would not even bother WSK and
would wrote the TDI client for all range of OSes.


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


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) 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

Maxim S. Shatskih wrote:

> Using the TDI ‘interface’ on Vista and above contributes a performance
> overhead ranging from 5-20%, though I have not encountered any overhead
> of more than 5-7%.

Overhead in what? CPU time? connection performance? on pre-Vista, it was easily possible to saturate the 100Mb (never tried 1Gb or more) Ethernet via TDI.

Network stack in Windows is very fast (if used properly) and TDI can get a maximum of it.

Also note that around half of the MS’s kernel-mode TCP/IP clients are still TDI.

TDI in Vista and above platforms is implemented as a translation layer
sitting above WSK. This translation layer was added as an after thought
in Vista once MSFT realized how many TDI clients and filters were broken
without the TDI layer. Here is one of many articles stating the
performance degradation.

http://blogs.msdn.com/wndp/archive/2006/10/19/tdi-client-to-winsock-kernel-wsk-porting-survey.aspx

Pete

> As well, MSFT will be obsoleting the TDI interface in
> some future revision of the OS, it was actually an after thought in
> Vista once they realized how many firewalls were broken when they
> removed it.

  1. Firewalls are broken anyway, since TDI filters will not filter all traffic in Vista+ and are useless.
  2. Since several kernel-mode modules by MS themselves are still TDI, I think they just could not finish the move to WSK in Vista timeframe.


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

The latest WDK docum release (03202009) states that
“TDI will not be available in Microsoft Windows versions after Vista”.
So, it won’t be available in Win7 RTM?

– pa

Maxim S. Shatskih wrote:

> Using the TDI ‘interface’ on Vista and above contributes a performance
> overhead ranging from 5-20%, though I have not encountered any overhead
> of more than 5-7%.

Overhead in what? CPU time? connection performance? on pre-Vista, it was easily possible to saturate the 100Mb (never tried 1Gb or more) Ethernet via TDI.

Network stack in Windows is very fast (if used properly) and TDI can get a maximum of it.

Also note that around half of the MS’s kernel-mode TCP/IP clients are still TDI.

> As well, MSFT will be obsoleting the TDI interface in
> some future revision of the OS, it was actually an after thought in
> Vista once they realized how many firewalls were broken when they
> removed it.

  1. Firewalls are broken anyway, since TDI filters will not filter all traffic in Vista+ and are useless.
  2. Since several kernel-mode modules by MS themselves are still TDI, I think they just could not finish the move to WSK in Vista timeframe.