NDIS IM driver

Hi, I’ve been trying to adapt my NDIS IM Driver which was working on NT4 to
2k. May I know what I need to change? I’ve noticed that some entries in
the registry like netrules and linkage have disappeared. Is this going to
affect me in anyway? Do I need to change any of the codes?

I remember reading an article somewhere that says drivers working on NT
should have no problem functioning on 2k because 2k can somehow detect if
the driver was written for NT. This obviously didn’t work for me. My
driver crashed the system on boot(DRIVER_POWER_STATE_FAILURE). I tried
adding new IRPs but it couldn’t compile using the old compiler. Is there
something I’m doing wrong or I don’t know that is causing the NT driver to
fail on 2k?

Thank you

Zelin
xxxxx@singnet.com.sg


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hi Zelin

Had a similar experiance, but due to the fact that the registry stuff is
completly different had to move to use the passthru.sys sample from the 2000
DDK. A lot of the code can be “ported” across to this template fairly
quickly… You can then just use the new “inf” files to install. This may
help!!

Steve


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Anyone tried the similiar on Pocket PC? does it work?

Qiang

-----Original Message-----
From: Steve Pratt [mailto:xxxxx@bemac.com]
Sent: Thursday, June 21, 2001 10:30 AM
To: NT Developers Interest List
Subject: [ntdev] Re: NDIS IM driver

Hi Zelin

Had a similar experiance, but due to the fact that the registry stuff is
completly different had to move to use the passthru.sys sample from the
2000
DDK. A lot of the code can be “ported” across to this template fairly
quickly… You can then just use the new “inf” files to install. This may
help!!

Steve


You are currently subscribed to ntdev as: xxxxx@ecutel.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

For sure you should use the Windows 2000 DDK passthru driver sample as a
baseline and port your implementation-specific code to it. Better yet, start
with the Windows XP DDK passthrough driver sample.

In addition to the registry setting differences there are substantial
differences related to PnP and power management - not present at all in an
NT 4.0 NDIS IM driver.

At that point, if your driver does anything more then passthru and block,
then you will encounter other problems not hinted at in the DDK samples. One
of the most confusing concerns NDIS Task Offload. Others concern different,
more sophisticated, use of NDIS packet reserved areas. Tracking down these
problems can cause substantial delay and frustration - at least it did for
me.

Some hints to the problems PCAUSA encountered are on the NDISIN FAQ at:

http://www.pcausa.com/resources/ndisimfaq.htm

Good luck,

Thomas F. Divine

PCAUSA - Toolkits & Resources For Network Software Developers
NDIS Protocol - NDIS Intermediate - TDI Client
http: - http:

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Thursday, June 21, 2001 12:00 AM
Subject: [ntdev] NDIS IM driver

> Hi, I’ve been trying to adapt my NDIS IM Driver which was working on NT4
to
> 2k. May I know what I need to change? I’ve noticed that some entries in
> the registry like netrules and linkage have disappeared. Is this going to
> affect me in anyway? Do I need to change any of the codes?
>
> I remember reading an article somewhere that says drivers working on NT
> should have no problem functioning on 2k because 2k can somehow detect if
> the driver was written for NT. This obviously didn’t work for me. My
> driver crashed the system on boot(DRIVER_POWER_STATE_FAILURE). I tried
> adding new IRPs but it couldn’t compile using the old compiler. Is there
> something I’m doing wrong or I don’t know that is causing the NT driver to
> fail on 2k?
>
> Thank you
>
> Zelin
> xxxxx@singnet.com.sg
>


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:>

Hi all. Thanks for your reply.

I don’t wanna use the passthru code first because I might be adding more
features to my present NT version, so keeping the same set of codes might
enable me to move the features over a little easier.

Are you saying that XP drivers will work on 2k too? If so, its definitely
smarter to start from XP. :slight_smile:

Thanks, I’m aware of the PnP and pwr mgt features. I think I can just use
some kind of dummy to handle the PnP IRPs right?

I’ve traced my codes and found that they failed at the
CreateNotificationEvent(). The event handle I passed in was NULL. This
handle was given by the device object’s DeviceExtension handle from
IoCreateDevice(). I’m stuck now. How do I troubleshoot? :frowning:

Zelin

On 06/21/01, ““Thomas F. Divine” ” wrote:
> For sure you should use the Windows 2000 DDK passthru driver sample as a
> baseline and port your implementation-specific code to it. Better yet, start
> with the Windows XP DDK passthrough driver sample.
>
> In addition to the registry setting differences there are substantial
> differences related to PnP and power management - not present at all in an
> NT 4.0 NDIS IM driver.
>
> At that point, if your driver does anything more then passthru and block,
> then you will encounter other problems not hinted at in the DDK samples. One
> of the most confusing concerns NDIS Task Offload. Others concern different,
> more sophisticated, use of NDIS packet reserved areas. Tracking down these
> problems can cause substantial delay and frustration - at least it did for
> me.
>
> Some hints to the problems PCAUSA encountered are on the NDISIN FAQ at:
>
> http://www.pcausa.com/resources/ndisimfaq.htm
>
> Good luck,
>
> Thomas F. Divine
>
> PCAUSA - Toolkits & Resources For Network Software Developers
> NDIS Protocol - NDIS Intermediate - TDI Client
> http: - http:
>
>
> ----- Original Message -----
> From:
> To: “NT Developers Interest List”
> Sent: Thursday, June 21, 2001 12:00 AM
> Subject: [ntdev] NDIS IM driver
>
>
> > Hi, I’ve been trying to adapt my NDIS IM Driver which was working on NT4
> to
> > 2k. May I know what I need to change? I’ve noticed that some entries in
> > the registry like netrules and linkage have disappeared. Is this going to
> > affect me in anyway? Do I need to change any of the codes?
> >
> > I remember reading an article somewhere that says drivers working on NT
> > should have no problem functioning on 2k because 2k can somehow detect if
> > the driver was written for NT. This obviously didn’t work for me. My
> > driver crashed the system on boot(DRIVER_POWER_STATE_FAILURE). I tried
> > adding new IRPs but it couldn’t compile using the old compiler. Is there
> > something I’m doing wrong or I don’t know that is causing the NT driver to
> > fail on 2k?
> >
> > Thank you
> >
> > Zelin
> > xxxxx@singnet.com.sg
> >
>
>
>
> —
> You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:>

> ----------

From: xxxxx@singnet.com.sg[SMTP:xxxxx@singnet.com.sg]
Reply To: NT Developers Interest List
Sent: Thursday, June 21, 2001 11:59 PM
To: NT Developers Interest List
Subject: [ntdev] Re: NDIS IM driver

I don’t wanna use the passthru code first because I might be adding more
features to my present NT version, so keeping the same set of codes might
enable me to move the features over a little easier.

Use conditional compilation and make clever code organization – move OS
independent code to separate modules. I had one set of NDIS IM driver
sources for NT4 miniport and NT 3.51 full MAC driver. Currently, I share
most of code between NT4, w2k and all w9x versions.

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hello,

To encrypt/decrypt packets which sample is a good starting point:
Passthru or Imsamp. Its targeted for 98,2k and later…

Thanks
Daniel


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Passthru; others recommend XP version even for w2k. Seach list archives for
this subject. Recently, somebody from microsoft posted here INF script for
w9x which you’ll need.

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


From: Pradeep Daniel[SMTP:xxxxx@cranite.com]
Reply To: NT Developers Interest List
Sent: Wednesday, July 18, 2001 7:54 PM
To: NT Developers Interest List
Subject: [ntdev] Ndis IM driver

Hello,

To encrypt/decrypt packets which sample is a good starting point:
Passthru or Imsamp. Its targeted for 98,2k and later…

Thanks
Daniel


You are currently subscribed to ntdev as: xxxxx@rkk.cz
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Use PASSTHRU. The sample in the new Windows XP DDK has been updated
with additional comments, etc. I’ve ported the passthru sample back to
Win98/ME and last week sent out a laundry list of issues to be aware of
when porting NDIS drivers back to Windows 9x/ME. Look for “[ntdev]
cont… Intermediate NDIS Driver”

Bryan

-----Original Message-----
From: Pradeep Daniel [mailto:xxxxx@cranite.com]
Sent: Wednesday, July 18, 2001 10:55 AM
To: NT Developers Interest List
Subject: [ntdev] Ndis IM driver

Hello,

To encrypt/decrypt packets which sample is a good starting point:
Passthru or Imsamp. Its targeted for 98,2k and later…

Thanks
Daniel


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Is it possible that my IM driver can get the MAC header spread over 2
Buffer descriptors in either the send or Rx handler???

Thanks
Daniel


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

AFAIK there is nothing in the (current) NDIS documentation that would
prohibit that. However, I would doubt that one would ever see such a break
in practice.

On sends I have seen the 14-byte MAC header in one NDIS buffer with payload
in three additional following buffers (ICMP PING).

There are as yet undocumented constraints in NDIS buffer breaks that make it
even more unlikely that you would see such a break. See the Topic “Building
A NDIS_PACKET For NdisMIndicateReceive” near the middle of the page at:

http://www.pcausa.com/resources/ndispacket.htm#InterpretingPacket

OTOH, it is sometime useful to systematically use “safe” packet data access
routines, such as the UTILReadOnPacket function, instead of guessing or
making assumptions.

UTILReadOnPacket is described at the URL:

http://www.pcausa.com/resources/readonpacket.htm

Good luck,

Thomas F. Divine

PCAUSA - Toolkits & Resources For Network Software Developers
NDIS Protocol - NDIS Intermediate - TDI Client
http: - http:

----- Original Message -----
From: “Pradeep Daniel”
To: “NT Developers Interest List”
Sent: Wednesday, July 18, 2001 11:20 PM
Subject: [ntdev] RE: Ndis IM driver

Is it possible that my IM driver can get the MAC header spread over 2
Buffer descriptors in either the send or Rx handler???

Thanks
Daniel


You are currently subscribed to ntdev as: xxxxx@pcausa.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:>

Actually, I have seen this occur frequently in practice - typically, Ethernet II packet headers are received in one header buffer (14 bytes), but on NT and Win 2K (I don’t know about Win 9x), 802.3 SNAP headers are broken across the 14 byte boundary - the header buffer is indicated as 14 bytes, and the remaining part of the 802.3 SNAP header is in the lookahead buffer (6 bytes, if I recall correctly). This can be duplicated by setting the registry value

HKLM\SYSTEM\CCS\Services\Tcpip\Parameters\ArpUseEtherSNAP to REG_DWORD “1”

This forces the system to use 802.3 SNAP framing rather than the default Ethernet II framing - if you set up 2 machines this way, and ping between them, you should see the headers indicated in your ReceiveHandler split between the header buffer and the lookahead buffer.

Regards,

Ed Lau

MidCore Software, Inc.
www.midcore.com

----- Original Message -----
From: Thomas F. Divine
To: NT Developers Interest List
Sent: Wednesday, July 18, 2001 11:54 PM
Subject: [ntdev] RE: Ndis IM driver

AFAIK there is nothing in the (current) NDIS documentation that would
prohibit that. However, I would doubt that one would ever see such a break
in practice.

On sends I have seen the 14-byte MAC header in one NDIS buffer with payload
in three additional following buffers (ICMP PING).

There are as yet undocumented constraints in NDIS buffer breaks that make it
even more unlikely that you would see such a break. See the Topic “Building
A NDIS_PACKET For NdisMIndicateReceive” near the middle of the page at:

http://www.pcausa.com/resources/ndispacket.htm#InterpretingPacket

OTOH, it is sometime useful to systematically use “safe” packet data access
routines, such as the UTILReadOnPacket function, instead of guessing or
making assumptions.

UTILReadOnPacket is described at the URL:

http://www.pcausa.com/resources/readonpacket.htm

Good luck,

Thomas F. Divine

PCAUSA - Toolkits & Resources For Network Software Developers
NDIS Protocol - NDIS Intermediate - TDI Client
http: - http:

----- Original Message -----
From: “Pradeep Daniel”
To: “NT Developers Interest List”
Sent: Wednesday, July 18, 2001 11:20 PM
Subject: [ntdev] RE: Ndis IM driver

Is it possible that my IM driver can get the MAC header spread over 2
Buffer descriptors in either the send or Rx handler???

Thanks
Daniel


You are currently subscribed to ntdev as: xxxxx@pcausa.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@midcore.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:>

Interesting.

The ordginal poster was asking specifically about the MAC header. Both your observations and mine are that the 14-byte MAC header in always in one NDIS buffer descriptor.

I have seen the rest of the MAC payload broken into multiple NDIS buffers as you described on send, but not on receive. MS has indicated that on receive at least some versions of the TCP/IP stack require everyting through the Lookahead data to be in one NDIS buffer. I wonder what the real requirement is…

This re-enforces guidance to never make any assumptions concerning how NDIS buffers might be chained in any NDIS packet that you did not create yourself…

Regards,

Thomas F. Divine

PCAUSA - Toolkits & Resources For Network Software Developers
NDIS Protocol - NDIS Intermediate - TDI Client
http: - http:

----- Original Message -----
From: Ed Lau
To: NT Developers Interest List
Sent: Thursday, July 19, 2001 9:41 AM
Subject: [ntdev] RE: Ndis IM driver

Actually, I have seen this occur frequently in practice - typically, Ethernet II packet headers are received in one header buffer (14 bytes), but on NT and Win 2K (I don’t know about Win 9x), 802.3 SNAP headers are broken across the 14 byte boundary - the header buffer is indicated as 14 bytes, and the remaining part of the 802.3 SNAP header is in the lookahead buffer (6 bytes, if I recall correctly). This can be duplicated by setting the registry value

HKLM\SYSTEM\CCS\Services\Tcpip\Parameters\ArpUseEtherSNAP to REG_DWORD “1”

This forces the system to use 802.3 SNAP framing rather than the default Ethernet II framing - if you set up 2 machines this way, and ping between them, you should see the headers indicated in your ReceiveHandler split between the header buffer and the lookahead buffer.

Regards,

Ed Lau

MidCore Software, Inc.
www.midcore.com

----- Original Message -----
From: Thomas F. Divine
To: NT Developers Interest List
Sent: Wednesday, July 18, 2001 11:54 PM
Subject: [ntdev] RE: Ndis IM driver

AFAIK there is nothing in the (current) NDIS documentation that would
prohibit that. However, I would doubt that one would ever see such a break
in practice.

On sends I have seen the 14-byte MAC header in one NDIS buffer with payload
in three additional following buffers (ICMP PING).

There are as yet undocumented constraints in NDIS buffer breaks that make it
even more unlikely that you would see such a break. See the Topic “Building
A NDIS_PACKET For NdisMIndicateReceive” near the middle of the page at:

http://www.pcausa.com/resources/ndispacket.htm#InterpretingPacket

OTOH, it is sometime useful to systematically use “safe” packet data access
routines, such as the UTILReadOnPacket function, instead of guessing or
making assumptions.

UTILReadOnPacket is described at the URL:

http://www.pcausa.com/resources/readonpacket.htm

Good luck,

Thomas F. Divine

PCAUSA - Toolkits & Resources For Network Software Developers
NDIS Protocol - NDIS Intermediate - TDI Client
http: - http:

----- Original Message -----
From: “Pradeep Daniel”
To: “NT Developers Interest List”
Sent: Wednesday, July 18, 2001 11:20 PM
Subject: [ntdev] RE: Ndis IM driver

Is it possible that my IM driver can get the MAC header spread over 2
Buffer descriptors in either the send or Rx handler???

Thanks
Daniel


You are currently subscribed to ntdev as: xxxxx@pcausa.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@midcore.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@pcausa.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:></http:></http:>

> ----------

From: Thomas F. Divine[SMTP:xxxxx@pcausa.com]
Reply To: NT Developers Interest List
Sent: Thursday, July 19, 2001 5:13 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Ndis IM driver

The ordginal poster was asking specifically about the MAC header. Both
your observations and mine are that the 14-byte MAC header in always in
one NDIS buffer descriptor.

Mine too. I believe breaking MAC header between multiple buffers is really
perverted idea and such a packet can be ignored. Of course, driver should
test this possibilty and don’t crash.

I have seen the rest of the MAC payload broken into multiple NDIS buffers
as you described on send, but not on receive. MS has indicated that on
receive at least some versions of the TCP/IP stack require everyting
through the Lookahead data to be in one NDIS buffer. I wonder what the
real requirement is…

I recall something like this. Maybe the requirement wasn’t for whole
lookahead buffer but for the first 128 bytes only. It was in some KB
article…

This re-enforces guidance to never make any assumptions concerning how
NDIS buffers might be chained in any NDIS packet that you did not create
yourself…

Sure, this is the best advice. We should write a filter or protocol driver
which would use one NDIS buffer for every single byte. It should be easy to
change passhtu sample this way on send path. I wonder if any below layered
driver survives :wink:

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> On sends I have seen the 14-byte MAC header in one NDIS buffer with
payload

in three additional following buffers (ICMP PING).

On sends, I usually saw:

  • first buffer - Ethernet header
  • second - TCP and IP headers
  • third - the payload.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I don’t think such a packet (with part of the MAC header in the lookahead buffer) can be ignored - I see them routinely on our LAN (not necessarily TCP/IP, though). What I have seen in practice is that the header buffer contains 14 bytes of the 802.3 SNAP header, and the remainder is in the lookahead buffer (I have never seen a header buffer of less than 14 bytes). The 802.3 SNAP header has the following layout:

typedef struct _E8023SNAPHDR
{
CHAR TargetAddr[ETH_LENGTH_OF_ADDRESS];
CHAR SourceAddr[ETH_LENGTH_OF_ADDRESS];
HWORD DataLength;
BYTE LLCDSAP;
BYTE LLCSSAP;
BYTE LLCCTL;
BYTE SNAPOID[3];
HWORD PacketType;
} E8023SNAPHEADER;

(an HWORD is simply a WORD - 2 bytes)

Since you can’t determine the packet type from the first 14 bytes, I don’t believe it is a safe assumption to just throw it away, even if you’re only interested in certain protocols such as TCP/IP - just my 2 cents worth -

Ed Lau

MidCore Software, Inc.
www.midcore.com

----- Original Message -----
From: Michal Vodicka
To: NT Developers Interest List
Sent: Thursday, July 19, 2001 2:28 PM
Subject: [ntdev] RE: Ndis IM driver


From: Thomas F. Divine[SMTP:xxxxx@pcausa.com]
Reply To: NT Developers Interest List
Sent: Thursday, July 19, 2001 5:13 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Ndis IM driver

The ordginal poster was asking specifically about the MAC header. Both
your observations and mine are that the 14-byte MAC header in always in
one NDIS buffer descriptor.

Mine too. I believe breaking MAC header between multiple buffers is really
perverted idea and such a packet can be ignored. Of course, driver should
test this possibilty and don’t crash.

I have seen the rest of the MAC payload broken into multiple NDIS buffers
as you described on send, but not on receive. MS has indicated that on
receive at least some versions of the TCP/IP stack require everyting
through the Lookahead data to be in one NDIS buffer. I wonder what the
real requirement is…

I recall something like this. Maybe the requirement wasn’t for whole
lookahead buffer but for the first 128 bytes only. It was in some KB
article…

This re-enforces guidance to never make any assumptions concerning how
NDIS buffers might be chained in any NDIS packet that you did not create
yourself…

Sure, this is the best advice. We should write a filter or protocol driver
which would use one NDIS buffer for every single byte. It should be easy to
change passhtu sample this way on send path. I wonder if any below layered
driver survives :wink:

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


You are currently subscribed to ntdev as: xxxxx@midcore.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You are absolutely correct in your comment.

Several of us use the “simple-minded NDIS-oriented definition” of a MAC header size as being the universally-constant 14-bytes (for Ethernet) on Windows. This can be calculated by making NDIS queries for TotalSize and MaximumFrameSize and taking the diffference; I’ve never seen anything other then 14 as the HeaderSize calculated this way (for Ethernet), and I’m sure a lot of stuff would break if the first 14 bytes weren’t in one NDIS buffer.

In the case of SNAP the first-level decision can be made looking at the DataLength. If it is less than 1500 bytes then you know that DataLength is the first WORD of Netware RAW, 802.3 w/LLC Header or 802.3 w/LLC SNAP Extension that is continued after DataLength.

Regards,

Thos
----- Original Message -----
From: Ed Lau
To: NT Developers Interest List
Sent: Thursday, July 19, 2001 4:20 PM
Subject: [ntdev] RE: Ndis IM driver

I don’t think such a packet (with part of the MAC header in the lookahead buffer) can be ignored - I see them routinely on our LAN (not necessarily TCP/IP, though). What I have seen in practice is that the header buffer contains 14 bytes of the 802.3 SNAP header, and the remainder is in the lookahead buffer (I have never seen a header buffer of less than 14 bytes). The 802.3 SNAP header has the following layout:

typedef struct _E8023SNAPHDR
{
CHAR TargetAddr[ETH_LENGTH_OF_ADDRESS];
CHAR SourceAddr[ETH_LENGTH_OF_ADDRESS];
HWORD DataLength;
BYTE LLCDSAP;
BYTE LLCSSAP;
BYTE LLCCTL;
BYTE SNAPOID[3];
HWORD PacketType;
} E8023SNAPHEADER;

(an HWORD is simply a WORD - 2 bytes)

Since you can’t determine the packet type from the first 14 bytes, I don’t believe it is a safe assumption to just throw it away, even if you’re only interested in certain protocols such as TCP/IP - just my 2 cents worth -

Ed Lau

MidCore Software, Inc.
www.midcore.com

----- Original Message -----
From: Michal Vodicka
To: NT Developers Interest List
Sent: Thursday, July 19, 2001 2:28 PM
Subject: [ntdev] RE: Ndis IM driver


> From: Thomas F. Divine[SMTP:xxxxx@pcausa.com]
> Reply To: NT Developers Interest List
> Sent: Thursday, July 19, 2001 5:13 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Ndis IM driver
>
> The ordginal poster was asking specifically about the MAC header. Both
> your observations and mine are that the 14-byte MAC header in always in
> one NDIS buffer descriptor.
>
Mine too. I believe breaking MAC header between multiple buffers is really
perverted idea and such a packet can be ignored. Of course, driver should
test this possibilty and don’t crash.
>
> I have seen the rest of the MAC payload broken into multiple NDIS buffers
> as you described on send, but not on receive. MS has indicated that on
> receive at least some versions of the TCP/IP stack require everyting
> through the Lookahead data to be in one NDIS buffer. I wonder what the
> real requirement is…
>
I recall something like this. Maybe the requirement wasn’t for whole
lookahead buffer but for the first 128 bytes only. It was in some KB
article…
>
> This re-enforces guidance to never make any assumptions concerning how
> NDIS buffers might be chained in any NDIS packet that you did not create
> yourself…
>
Sure, this is the best advice. We should write a filter or protocol driver
which would use one NDIS buffer for every single byte. It should be easy to
change passhtu sample this way on send path. I wonder if any below layered
driver survives :wink:

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]

>


You are currently subscribed to ntdev as: xxxxx@midcore.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@pcausa.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I meant only first 14 bytes by MAC header (for Ethernet) i.e. two addresses
and data length. Remainder of 802.3 SNAP header isn’t part of MAC header.
This is the way I understand RFC 1042. Following is copied from this memo:

Header Format
Header

…--------±-------±-------+
MAC Header | 802.{3/4/5} MAC
…--------±-------±-------+

±-------±-------±-------+
| DSAP=K1| SSAP=K1| Control| 802.2 LLC
±-------±-------±-------+

±-------±-------±--------±-------±-------+
|Protocol Id or Org Code =K2| EtherType | 802.2 SNAP
±-------±-------±--------±-------±-------+

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


From: Ed Lau[SMTP:xxxxx@midcore.com]
Reply To: NT Developers Interest List
Sent: Thursday, July 19, 2001 10:20 PM
To: NT Developers Interest List
Subject: [ntdev] RE: Ndis IM driver

I don’t think such a packet (with part of the MAC header in the lookahead
buffer) can be ignored - I see them routinely on our LAN (not necessarily
TCP/IP, though). What I have seen in practice is that the header buffer
contains 14 bytes of the 802.3 SNAP header, and the remainder is in the
lookahead buffer (I have never seen a header buffer of less than 14
bytes). The 802.3 SNAP header has the following layout:

typedef struct _E8023SNAPHDR
{
CHAR TargetAddr[ETH_LENGTH_OF_ADDRESS];
CHAR SourceAddr[ETH_LENGTH_OF_ADDRESS];
HWORD DataLength;
BYTE LLCDSAP;
BYTE LLCSSAP;
BYTE LLCCTL;
BYTE SNAPOID[3];
HWORD PacketType;
} E8023SNAPHEADER;

(an HWORD is simply a WORD - 2 bytes)

Since you can’t determine the packet type from the first 14 bytes, I don’t
believe it is a safe assumption to just throw it away, even if you’re only
interested in certain protocols such as TCP/IP - just my 2 cents worth -

Ed Lau

MidCore Software, Inc.
www.midcore.com

----- Original Message -----
From: Michal Vodicka
To: NT Developers Interest List
Sent: Thursday, July 19, 2001 2:28 PM
Subject: [ntdev] RE: Ndis IM driver

> ----------
> From: Thomas F. Divine[SMTP:xxxxx@pcausa.com]
> Reply To: NT Developers Interest List
> Sent: Thursday, July 19, 2001 5:13 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Ndis IM driver
>
> The ordginal poster was asking specifically about the MAC header. Both
> your observations and mine are that the 14-byte MAC header in always in
> one NDIS buffer descriptor.
>
Mine too. I believe breaking MAC header between multiple buffers is really
perverted idea and such a packet can be ignored. Of course, driver should
test this possibilty and don’t crash.
>
> I have seen the rest of the MAC payload broken into multiple NDIS
buffers
> as you described on send, but not on receive. MS has indicated that on
> receive at least some versions of the TCP/IP stack require everyting
> through the Lookahead data to be in one NDIS buffer. I wonder what the
> real requirement is…
>
I recall something like this. Maybe the requirement wasn’t for whole
lookahead buffer but for the first 128 bytes only. It was in some KB
article…
>
> This re-enforces guidance to never make any assumptions concerning how
> NDIS buffers might be chained in any NDIS packet that you did not create
> yourself…
>
Sure, this is the best advice. We should write a filter or protocol driver
which would use one NDIS buffer for every single byte. It should be easy
to
change passhtu sample this way on send path. I wonder if any below layered
driver survives :wink:

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]

>
>


You are currently subscribed to ntdev as: xxxxx@midcore.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@rkk.cz
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> -----Original Message-----

From: Michal Vodicka [mailto:xxxxx@veridicom.cz.nospam]
Sent: 19 July 2001 19:28
To: NT Developers Interest List
Subject: [ntdev] RE: Ndis IM driver

Mine too. I believe breaking MAC header between multiple
buffers is really
perverted idea and such a packet can be ignored. Of course,
driver should
test this possibilty and don’t crash.
>

Michal,
I have to take issue with this. It would seem a perfectly reasonable
thing for a protocol to build the MAC header from 3 separate areas.
e.g. SA from local MIB info, DA from connection data and length/type
from packet data. This could be very efficient, as SA and DA are
invariant for a connection. I have never seen it in practice, but
I would certainly like to have the option when writing a protocol stack.

I have found that one of the biggest problems with Windows is the
amount of software that makes unwarranted assumptions outside the
specifications. It doesn’t matter what the current TCP/IP
implementation does, because it might change in the next release.
And, there are other protocols! (Honest! Remember IPX?)

My advice is to stick to what the DDK specifies and make your software
flexible enough to cope with all possibilities within that.

Regards,
Evan


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Evan,

I take this point and take my note back; it wasn’t a good idea at all. In
the meantime I checked the code of my IM drivers and all handle this case
corrently :wink:

On the other hand I don’t think it is a good idea for a protocol driver to
break MAC header this way. Every NDIS buffer is a MDL on NT and the memory
overhead would be huge. I believe copying 14 bytes to prealocated buffer is
faster than allocating and chaining three NDIS buffers. Anyway, there is
nothing what would prevent protocol or filter from doing this if a developer
thinks it is a good idea and our drivers should handle it correctly as you
pointed out.

Best regards,

Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]


From: Evan Lloyd[SMTP:xxxxx@eicon.com]
Reply To: NT Developers Interest List
Sent: Friday, July 20, 2001 11:11 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Ndis IM driver

> -----Original Message-----
> From: Michal Vodicka [mailto:xxxxx@veridicom.cz.nospam]
> Sent: 19 July 2001 19:28
> To: NT Developers Interest List
> Subject: [ntdev] RE: Ndis IM driver
>
> Mine too. I believe breaking MAC header between multiple
> buffers is really
> perverted idea and such a packet can be ignored. Of course,
> driver should
> test this possibilty and don’t crash.
> >
>

Michal,
I have to take issue with this. It would seem a perfectly reasonable
thing for a protocol to build the MAC header from 3 separate areas.
e.g. SA from local MIB info, DA from connection data and length/type
from packet data. This could be very efficient, as SA and DA are
invariant for a connection. I have never seen it in practice, but
I would certainly like to have the option when writing a protocol stack.

I have found that one of the biggest problems with Windows is the
amount of software that makes unwarranted assumptions outside the
specifications. It doesn’t matter what the current TCP/IP
implementation does, because it might change in the next release.
And, there are other protocols! (Honest! Remember IPX?)

My advice is to stick to what the DDK specifies and make your software
flexible enough to cope with all possibilities within that.

Regards,
Evan


You are currently subscribed to ntdev as: xxxxx@rkk.cz
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com