Testing Network Drivers with The Ndis Test Tool

xiaoxiao2021-03-14  192

Copyright © 2003 by Stephan Wolf. All Rights Reserved

Any Device Driver That You Write Has The Potential Risk Of Crashing The System. Thus, You Should Intensively Test Your Driver BEFORE Shipping IT.

Network drivers only cause about 1% of all Windows system crashes for good reason: The official Microsoft NDISTest Tool is the acid test for all "lower edge" NDIS network drivers such as NDIS miniport and NDIS intermediate drivers.

If you write an NDIS driver, you should use NDISTest at any stage during your driver development to verify the driver's integrity and stability. Not only will NDISTest find bugs in your driver that cause system crashes, but it will also help you to write a fully NDIS Conformant Driver With Respect To All of the Following:

Replies to get and set requests for mandatory as well as optional OIDs Handling of unexpected NDIS failure replies Indication of cable connect and disconnect events Driver halt / restart and unload / reload Adapter reset request Send and receive path and send packet cancellation Receive filter including multicast frames , promiscuous mode etc. Task Offload Such AS TCP / IP CHECKSUM OFFLOAD AND ipsec offload ... and more

Which Ndis Drivers CAN I Test with ndistest?

NDistest Can Test All of the Following Ndis Drivers:

Ndis MiniPort Drivers for the Following Physical Network Adapter Types:

Ethernet Token Ring FDDI ATM ISDN Modem IrDA WLAN WWAN (some WWAN devices have known troubles with the send / recv and load / unload tests) SAN (the SAN tests require extra scripts that are shipped in the HCT but are not part of the standalone NDISTest Download Ndis Intermediate (IM) Drivers That Implement Virtual Network Adapters

What Equipment Do I NEED TO TEST MY NDIS DRIVER?

Although you can run NDISTest with just a single network card in one machine (see "one card tests" below), I recommend using two computers, four network cards, and two hubs to run NDISTest, as shown in Figure One.Figure One Recommended Full Ndistest Hardware Setup

It's a good idea to use non-intelligent hubs or repeaters instead of intelligent switches for the test network. Some tests may fail or show warnings when switches are used because they filter the network traffic. If your network adapters so permit, you can connect them Back-to-back directly (using a crossover cable) and omit the switch or hub.

An easy way to setup NDISTest with only one machine and two network cards is shown in Figure Two. If you have only one network card available, you can even omit the second network adapter and still run NDISTest.

Figure TWO Simple Ndistest Hardware Setup

NDistest Offers you the folload test categories, Which you can combine as desired. Each test category Requires Some or all of the hardware i jobst described.

1C - One Card Tests

Install the "

Test Device "NetWork Adapter That your Driver Requires in the client machine, and you are ready to run the one card (1c) Tests. i Colored The Test Device Blue in

Figures one and two. This is the minimal test setup.

2C - Two Card Tests

For the Two Card (2C) Tests, Install An AdditionalAl

Support device "NetWork Adapter in The Client Machine. Connect It to Test Device On A Private"

Test NetWork ". This support device is colorled Orange in

Figure two.

2M - Two Machine Tests

Add a server machine for the two machine (2m) tests. Equip the server with a "support device" (orange) network adapter and connect it to the same private test network as the test device of the client as shown inFigure One. The support Device in The Server Takes over The Role of The Support Device in The Client, SO

The Support Device Is No Longer Required In The Client Machine.

For the communication channel between the server and the client add a "message device" (green) network adapter to both the client and the server machine. The two message devices can be anything that allows for TCP / IP to run on top of them. For Instance, IF Your Test and Support Devices Are Wireless Lan Adapters, The Message Devices CAN Be Standard Ethernet Adapters.

Connect the two message devices to a "message network" that is separate from the private test network. Note that the message network does not need to be a private network and you may also connect other machines to it. If the message devices are the adapter Cards That You Ordinarily Use To Connect The Client and Server Machines To your Office lan, and if you're Using TCP / IP As The Network Protocol, You'VE ALREADY DONE THIS STEP.

Alternatively, you may also connect the two message devices to the test network, but i recomment Test And Message Networks.

In order to achieve an optimal test coverage, you should run NDISTest on two machines with all of the available 1c, 2c, and 2m tests enabled. If available, you should use a multi-processor machine as the client.

WHERE Do I get the NDIS TEST TOOL?

NDISTest is part of the Microsoft Hardware Compatibility Test (HCT). But it is also available as a stand-alone tool coming in a self-extracting archive file, which you can download from the Microsoft Windows Hardware & Driver Central (WHDC) at the NDIS Test Tool pageNote: The HCT is required to run the official WHQL tests, which qualify a device for the "Designed for Windows" logo you can download the complete HCT in the WHQL Network Testing section (several hundred MB!) If you.. Have Msdn Universal Subscription, Then the Hct Is Included in Your Distribution CDS. After Installing The Hct You Will Find Ndistest in

" / testbin / ndistest"

.

Can I Test On Windows 98 or Windows ME?

The current version of NDISTest (at the time of this writing) runs on Windows 2000, Windows XP, and Windows 2003. It does not run on Windows 98 or Windows ME. An older version of NDISTest does run on these older systems, namely version 3.91 and IT IS Available from Microsoft WHQL (Windows Hardware Quality Labs) In Their Network Testing Section as file "NDT391.exe".

Note that you will find the term "trusted card" being used in earlier NDISTest versions, which is similar to what is now known as a "support device". However, with older NDISTest versions you need one trusted card in both the client and the Server Whereas Newer Ndistest Versions Require Only One Support Device In Either The Client or The Server.

How do i install the ndis test tool?

Installation of NDISTest is a fairly easy task: Simply run the downloaded self-extracting archive file and unzip the contained NDISTest files to a directory of your choice Install NDISTest once on the client machine and once on the server machine.Note:. Once you extract the archived files, you can use the batch file "ndsetup.bat" to create further installation copies of NDISTest For instance, to create the new directory. "n: / ndistest" and copy a new installation of NDISTest there, open a command prompt In The Current Installation Directory of Ndistest and Enter the Following Command:

NDSETUP N: / NDISTEST

What else do I NEED?

I Recommend Connecting a Debugger to your client machine for several reasons:

NDISTest prints a lot of messages to the debugger console. They will help you better understand any failed or warned tests. Your driver should also print messages to the debugger when it detects any anomalies. When NDISTest detects some critical situation it may hit a breakpoint, which will freeze the machine until you take appropriate actions in the debugger. Any bugs in your driver can potentially crash the system. NDISTest usually hits those bugs, so it is a good idea to have a debugger ready that you can use to examine the bugcheck .

In Very Rare Cases Ndistest May Also Hit A Breakpoint in The Server. So you may need to also connect a debugger to the server machine..

The Microsoft WinDbg debugger is available for download in the Microsoft WHDC section Microsoft Debugging Tools. If you have an NDISTest server machine you can run WinDbg on the server machine and connect it to the client machine.

During installation of NDISTest, all the debug symbols for NDISTest are copied to the directory " / symbols" under the directory where you installed NDISTest. You should add this directory to your debugger's symbol path.If you are unable to connect a debugger to your client or server machine, you can alternatively use a tool like SysInternals' freeware tool DebugView, which you can download from their utilities section. Actually you can use any tool or debugger (eg SoftICE) that will display kernel debug messages.

Another useful tool is a network sniffer that allows you to watch all the traffic on the test network. The sniffer tool should not use any of the test or support devices but should use an extra network adapter also connected to the test network. You should prefer TO Run The Sniffer on a Separate Third Machine.

How do i configure the ndis test tool?

Before you configure NDISTest, make sure to enable TCP / IP on both message devices and configure them to use the same IP subnet address. If you have DHCP enabled on the message devices, you should be ok. Check the IP addresses with the IPCONFIG command IN A Command Prompt Window if in doubt.

NDISTest will present you only those physical and virtual network adapters that are actually still available for the test, message, and support device entries. It is important to note that NDISTest will no longer show any entries that are associated with the same adapter once you select A listed adapter to Be a test, message, or support device. This Makes Sense As you for instance cannot test deficiate driver with a support device That Is The Physical Adapter to Which the iM is bound.

You NEED Administrator Privileges on The Client and Server Machines in Order To Run Ndistest.Start The Server First

If you have a server machine, Start Ndistest on The Server First. Make you have the server.

Run the "ndtest.bat" file from the directory where you installed NDISTest on the server. Select the TESTS tab. On the right, select the SERVER radio button. In the MESSAGE combo box, select the message device from the list of adapters. Notice that the IP address is listed for each adapter Note:... The MESSAGE combo box will only show adapters that have TCP / IP bound to it Select the support device in the SUPPORT DEVICES list box Figure Two Test settings for server machine Hit the Start button.

The server is now flient.

Now Start The Client

Make Sure You Have Administrator Privileges on The Client.

Run the "ndtest.bat" file from the directory where you installed NDISTest on the client. Select the TESTS tab. On the right, select the CLIENT radio button. In the TEST combo box, select your test device from the list of adapters. The Test Device Can Be The Ndis MiniPort or Intermediate Driver of Any Physical or Virtual Adapter.

Note:. If you are testing an NDIS intermediate driver, be sure to use an underlying network card that will pass NDISTest on its own Run the tests that you intend to make on your NDIS IM driver on the "bare card" before you test your Im Driver.

If you have a server machine, select the message device from the list of adapters in the MESSAGE combo box. Notice that the IP address is listed for each adapter. The support device (s) of the server machine will now appear in the SUPPORT DEVICES list box Note:... The MESSAGE combo box will only show adapters that have TCP / IP bound to it Select the support device in the SUPPORT DEVICES list box If you have a server machine, make sure to select the support device of the server .., not the client Select the MANUAL TESTS radio button you can select as many tests as you would like to run or simply hit the SELECT ALL button Which tests can be selected depends on whether a support device is available:. One card (1c ) tests are always available. Two card (2c) tests can be selected as soon as a support device is available on the local client or on the remote server machine. Two machine (2m) tests are only available when the support device is on the Server Machine. Ndistest Will Execute Tests in T he order they appear in the list Note:. You can change the order of the tests by selecting a test script, holding down the key, and moving the test script with the and keys Figure Three. Test settings for client machine Tests will begin as soon as you hit the START button you can watch the status of the individual tests in the test progress window Note:.. When you start NDISTest for the first time on the test device, a message box might appear saying that you will have to restart the machine in order to enable the Driver Verifier on the test device. NDISTest enables Driver Verifier by default on the test device and you should leave it enabled to achieve an optimal test coverage.

How long a test run takes depends on the number of tests selected, the speed of the machine (s) and the speed of the network. This can be anything from less than a minute to several hours.Where can I see a summary of the Test Results?

Here Is How You Can Get A List of The Results of All Individual Tests:

On The Main Menu, Select "Results" - "Test Logs ..." - "Test Logs ..." in The Combo Box on the top, Select The Test Run for Which You Want To See The Test Results. Ndistest Creates A New Test Result Entry for each test run and saves the results of the individual tests there. The list of the selected test run's test results appear in the list box along with a short summary for each individual test. Select the file "ndistest.htm" for a summary of the SELECTED TEST Run'S Test Results or Click on The File Name of any of the Individual Test Results to see it it it it it it it it it it

.

Bottom Line

The quality of your NDIS miniport or intermediate driver will substantially increase when you run NDISTest against it. Do not wait to test your driver until you have added more features to it but test it as soon as you can install it for the first time. NDISTest Will EnSure your Driver conforms to ndis and will reland Any bugs at a very early stage.

Although available since the early 1990s, NDISTest has not become very popular amongst NDIS driver developers. Maybe because most people think NDISTest is only available in conjunction with the HCT. However, NDISTest is actually available separately from the HCT and is a great tool that will Make Your Life Easier.

Further Reading

NDISTest comes with a help file that has many details about how the program works internally. You will find information about the packet structure that NDISTest uses for the packets it sends out to the test network, a list of command line options, and much more. SO IT's Really Worth Reading IT.

About The Author:

Stephan Wolf has worked as an independent system software developer since 1988. He lives and works mainly in Germany, but sometimes abroad. His focus is on network driver development (not only) for all Windows variants (including CE). You can contact him at Stewo68@hotmail.com (Hotmail Sometimes "Recognizes" Serious Email As Spam, SO TRY AGAIN if you get no answer).

转载请注明原文地址:https://www.9cbs.com/read-129231.html

New Post(0)