Packets Passed by Calling NdisMIndicateReceivPacket
Are Ignored
(TCP/IP ReceivePacket Handler Bug)
Windows 2000 and Higher

Summary

There are situations where a packet passed to TCP/IP via a call to NdisMIndicateReceivePacket is apparently ignored by TCP/IP.

 

Discussion

Although there may be a variety of reasons for this behavior, there are also two (2) known bugs in the TCP/IP stack that must be accounted for.

These bugs effect how your miniport or NDIS IM miniport edge constructs a NDIS_PACKET to be indicated upwards as received data. If the packet is not constructed as necessary to accommodate these bugs, then the TCP/IP ReceivePacketHandler will essentially ignore the packet.

 

Resolution

Problem 1: Constraint On Characteristics Of First NDIS Buffer

The TCP/IP ReceivePacketHandler does not handle the case where the virtual memory that would represent the LookAheadBuffer area spans multiple NDIS_BUFFERs (MDLs).

You must make sure that the first NDIS_BUFFER (MDL) in the NDIS_PACKET you indicate for reception (using old or new function does matter) has at least the MAC Header plus the LookAhead size (OID_GEN_CURRENT_LOOKAHEAD) packet data.

When constructing a NDIS_PACKET to be indicated upwards as received data, insure that the first NDIS_BUFFER describes:

bulletMAC Header - Media-specific.
bulletLookaheadData - Consistent with the information returned by OID_GEN_CURRENT_LOOKAHEAD.

As far as known, this bug is present in Windows 2000 through at least SP1 as well as Windows XP. This bug will never be fixed and has become part of the NDIS specification.

 

Problem 2: Must Set Packet Status To NDIS_STATUS_RESOURCES When Indicating Multiple Buffers

The TCP/IP ReceivePacketHandler has a stack problem associated with handling multiple NDIS buffers.

You need to set the packet status to NDIS_STATUS_RESOURCES if you are indicating a packet up with more than one chained NDIS_BUFFER. This forces TCP/IP to copy data from the indicated buffer descriptors and bypasses the stack problem.

This problem may be fixed in Windows Server 2003. But, since it is not fixed in earlier NDIS 5 systems, who cares...

 

See Also

Another cause of apparently ignored packets is related to handling of NDIS Task Offload.

See the topic Why doesn't my NDIS Intermediate (IM) driver work on adapters that support NDIS task-offload?

 

Topic Status

December 10, 2003 Renamed this topic to make it easier to notice when the problem is encountered.
February 18, 2003 Added comment about required use of NDIS_STATUS_RESOURCES.
January 2, 2003 Moved to NDIS.com.
January 6, 2001 Information posted.
 

PCAUSA Home · Privacy Statement · Products · Ordering · Support · Utilities · Resources
Mailing Lists  · PCAUSA Newsletter · PCAUSA Discussion List
Rawether for Windows, Rawether .NET, WinDis 32 and NDIS Press are trademarks of Printing Communications Assoc., Inc. (PCAUSA)
Microsoft, MS, Windows, Windows Vista, Windows 95, Windows 98, Windows Millennium, Windows 2000, and Win32 are registered trademarks and Visual C++ and Windows NT are trademarks of the Microsoft Corporation.
Copyright © 1996-2007 Printing Communications Assoc., Inc. (PCAUSA)
Last modified: January 20, 2007