IP Packet Redirector Driver Sample
NDIS 5 IM & NDIS 6 LWF
Windows XP - Windows 7

 

IP Packet Redirector Sample

Conceptually the IP Packet Redirector is simple. It provides a way to insert a user-mode application into the Windows network “stack” in a way that allows it to examine and modify each IP packet being sent or received by the Windows host. This sort of driver can ne described as a "NDIS tap". The concept is illustrated in Figure 1 below:

 

Figure 1 - IP Packet Redirector Conceptual Block Diagram

 

Implementation Overview

Of course the concept doesn’t actually fit the reality of the actual implementation. Win32 applications simply cannot exist in the kernel architecture.

Instead a NDIS filter driver called IPRedir is inserted into the kernel networking stack. The user-mode application and the kernel-mode driver transfer packet data using ordinary Win32 ReadFile and WriteFile methods. This is illustrated in Figure 2 below:

 

Figure 2 - IP Packet Redirector Simplified Block Diagram

The current IPRedir samples can be used on Windows platforms ranging from Windows XP through Windows 7. However, the XP and the post- XP Windows’s kernel-mode networking architecture and implementations are vastly different. In order to accommodate the differences there are two IPRedir NDIS drivers:

bulletNDIS 5 – A NDIS 5 Intermediate (IM) Driver for Windows XP.
bulletNDIS 6 – A NDIS 6 Lightweight Filter (LWF) Driver for Windows Vista and later Windows versions (x86 and x64).

Both drivers will be referred to as “filter drivers”.

Even though the details of the two drivers are different there is a single user-mode API. This means that a common user-mode application can be used on all of the supported Windows platforms

 

Intended Audience

bulletApplication Developers - Most of the work involved in using IPRedir will be in user-mode. Even though most of the NDIS details are hidden from user ode, the developer must have a thorough knowledge of the structure and use of network packets.
bulletNDIS Driver Developers - May be interested in the techniques illustrated in this sample. In addition, there may be some need to customize the driver to fit some particular purpose.

 

Detailed Documentation

You can download the complete documentation provided with the product here.

 

Download Sample Executables

You can download the IP Redirector sample filter drivers and sample application executables for evaluation.

These sample executables are provided:

bulletIMUtil
bulletVirtualEcho
bulletUMTxRxLoop
bulletUmTxRxLoopEx - Asynchronous I/O

The download is a Windows Installer MSI package.

Remember that these are Windows console applications. After installation you will find the sample executables in the Program Files\PCAUSA\IPRedir folder.

The MSI package installs the NDIS filter driver appropriate for the host platform. The sample software and drivers can be uninstalled using the standard Windows Uninstall Programs facility.

Download IP Redirector Sample Executables for Windows XP through Windows 7 (x86).
V4.00.07.08 of August 29, 2010 - 1.78 MB (1,871,872 bytes)

Download IP Redirector Sample Executables for Windows XP through Windows 7 (x64).
V4.00.07.08 of August 29, 2010 - 1.78 MB (1,871,872 bytes)

Other Information

Licensing

The samples are licensed intellectual property of PCAUSA. However, PCAUSA sample driver products are provided with a royalty-free license that is intended to allow customers to derive their own products using all or parts of the samples. The royalty-free license applies strictly to the distribution of product in binary (executable) form; there are quite naturally restrictions on distribution of sample source code.

The complete license can be found here.

[IP Redirector Q&A with Thomas F. Divine...]
(PCAUSA NetBug Reporter interviews Thomas...)

Purchasing Information

Pricing for this product and ordering information can be found on Ordering Information page.

 

Release Notes

Release Overview

V4.00.07.08 August 29, 2010 Fixed some bugs overlooked in V4.00.07.07. Also some improvements to the UmTxRxLoopEx application.
V4.00.07.07 August 27, 2010 1.) Fixed three serious bugs.
2.) Added sample user-mode applications that illustrate higher performance I/O methods.
V4.00.07.06 May 15, 2010 1.) Now build NDIS 5 x64 driver.
2.) Added IPRedir 64-bit Edition installer project.
V4.00.07.05 March 25, 2010 1.) Fixed bad bug in Ndf_IoCsqPurgePendingIrps.
2.) Modified Ndf_DebugPrint so it compiles to nothing in free build.
3.) Improved notation for an increment operation in IMFilter_MakeLogRecord.
4.) Moved from WDK 7600.16385.0 to WDK 7600.16385.1.
5.) Additional annotations to define roles needed to run Static Driver
verifier.
V4.00.07.04 February 9, 2010 1.) Now free g_AdapterListLock in NDIS 5 driver PCASIMUnloadDriver callback.
2.) In NDIS 5 driver CLUnbindAdapterHandler routine now set correct flag.
3.) In NDIS 5 and NDIS 6 drivers the check for possible unbind or detach operation was not made before queuing read IRPs.
4.) Eliminated a few PREfast warnings from WDK 7600.16385.0.
V4.00.07.03 January 18, 2010 1.) Added CopyInf directive to Windows XP service INF file.
2.) Updated driver build to use Windows 7 WDK (7600.16385.0).
V4.00.07.02 November 17, 2009 1.) Reinstated support for NDIS WAN on NDIS 5 and NDIS 6.
2.) Small bug fix to console adapter chooser key press logic that made sample applications exit prematurely.
V4.00.07.01 November 15, 2009 Initial release of new NDIS 5/6 filter samples.

[Detailed Release Notes]

Hit Counter11/11/09

 

 

 

 

PCAUSA Home · Privacy Statement · Products · Ordering · Support · Utilities · Resources
Mailing Lists  · PCAUSA Newsletter · PCAUSA Discussion List
 
Rawether for Windows and WinDis 32 are trademarks of Printing Communications Assoc., Inc. (PCAUSA)
Microsoft, MS, Windows, 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.
Send mail to webmaster@pcausa.com with questions or comments about this web site.
Copyright © 1996-2010 Printing Communications Assoc., Inc. (PCAUSA)
Last modified: February 04, 2010