Patent Publication Number: US-2007104110-A1

Title: System and method for testing a network interface card

Description:
FIELD OF THE INVENTION  
      The present invention is generally related to systems and methods of computer tests, and more particularly, to a system and method for computer hardware devices tests.  
     DESCRIPTION OF RELATED ART  
      Nowadays, not only may a computer assist humans on data processing, but may also be used as an entertainment system playing music or other forms of multi-media or as a tool for going on the Internet. During assembly, a computer may be installed with a plurality of various peripheral devices while it is in the assembly plant. Before the computer is shipped to a customer or a computer retailer, the computer should pass a series of tests to make sure that the computer works normally.  
      One of these tests is the test for network interface cards (NICs). The purpose of such test is to test functions of NICs installed in a computer. Typically, the test requires at least one test server and a plurality of test computers installed with NICs. Before the test, a physical network is required to be established by engineers. During the test, test data files are transmitted over the network through the test server and each test computer whereby to test whether the NICs are in good working condition.  
      However, such tests are very expensive due to the requirement that the physical network needs at least one test server and test computers. Furthermore, the test results depend much on the establishment of the physical network.  
      What is needed, therefore, is a method that test a network interface card more efficiently, conveniently and inexpensively.  
     SUMMARY OF THE INVENTION  
      One embodiment provides a system for testing a network interface card (NIC). The system includes a device management module, a data packet creating module, a data packet sending module, a data packet receiving module and a determining module. The device management module is configured for enabling the network interface card. The network interface card is connected to a motherboard and a test fixture to form a transmission loop. The data packet creating module is configured for creating a first data packet that includes test data. The data packet sending module is configured for sending the first data packet via the transmission loop. The data packet receiving module is configured for receiving data from the transmission loop and storing the data as a second data packet. The determining module is configured for determining whether the second data packet has the same data as the test data in the first data packet, to determine whether the network interface card functions normally.  
      One embodiment provides a method for testing an NIC. The NIC is attached to a motherboard, connected to a test fixture, which makes the NIC, the motherboard and the test fixture collectively form a transmission loop. The method includes the steps of: providing a motherboard and a test fixture, both being connected to a network interface card to be tested to form a transmission loop; enabling the network interface card; creating a first data packet that comprises test data; sending the first data packet via the transmission loop; receiving data from the transmission loop and storing the data as a second data packet; and determining whether the second data packet has the same data as the test data in the first data packet, to determine whether the network interface card functions normally.  
      Other systems, methods, features, and advantages of the present invention will be or become apparent to one skilled in the art upon examination of the following drawings and detailed description. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       FIG. 1  is a schematic diagram of an application environment of a system for testing a network interface card (NIC) in accordance with one preferred embodiment;  
       FIG. 2  is a schematic diagram of function modules of the NIC test system of  FIG. 1 ; and  
       FIG. 3  is a flowchart of a method for testing an NIC in accordance with one preferred embodiment. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION  
       FIG. 1  is a schematic diagram of an application environment of a system for testing a network interface card (NIC) in accordance with one preferred embodiment. The application environment may typically include a computer  100  and a test fixture  108 . The computer  100  may be an IBM clone personal computer (PC). Typically, the computer  100  may include a motherboard  102 , a storage device  106 , a central processing unit (CPU), a memory and other units or hardware, such as an audio card, a graphic accelerating card, a keyboard, a mouse, and so on. However, in order to describe the preferred embodiment concisely, these units are not shown in the drawings.  
      The motherboard  102  may be a typical main board that can be configured onto a computer. The motherboard  102  typically provides a plurality of interfaces (or ports) for attachment of various peripheral devices or hardware; for example, providing a CPU socket for the attachment of a CPU, providing a memory slot for the attachment of a memory. In the preferred embodiment, the motherboard  102  further provides a storage interface for an attachment of the storage device  106  and a network interface for an attachment of a network interface card (NIC)  104 . The NIC  104  is also known as network adapter.  
      The storage device  106  may be an internal storage of the computer  100 , such as a hard disk or a floppy disk, or an outer usage storage, such as a compact disk, a flash memory or the like.  
      Furthermore, the test fixture  108  typically consists of an RJ-45 connector and at least a CAT5 cable. The RJ-45 connector is commonly used for network cabling and for telephony applications. The RJ-45 connector can also be used for serial connections in special cases. Although used for a variety of purposes, the RJ-45 connector is probably most commonly used for 10Base-T and 100Base-TX Ethernet connections, such as usage in the preferred embodiment. As known, CAT5 is an Ethernet cable standard defined by the Electronic Industries Association and Telecommunications Industry Association (commonly known as EIA/TIA). CAT5 is the 5th generation of twisted pair Ethernet cabling and the most popular of all twisted pair cables in use today, also known as Category 5.  
      In the embodiment, the test fixture  108  is attached to the NIC  104 , this makes the motherboard  102 , the NIC  104  and the test fixture  108  to collectively form a transmission loop. Test files or data packets can be transmitted in the transmission loop. The transmission loop is partially formed by connecting the first pin and the third pin of the RJ-45 connector, and connecting the second pin and the sixth pin of the RJ-45 connector. The first and the second pins function as transmitting pins, and the third and the sixth pins function as receiving pins.  
      Moreover, an NIC test system  200  is installed on the computer  100  to assist the computer  100  to test whether the NIC  104  functions normally. The NIC test system  200  is typically an application software or a combination thereof executable by a typical computer.  
       FIG. 2  is a schematic diagram of function modules of the NIC test system  200 . The NIC test system  200  mainly includes a device management module  202 , a data packet creating module  204 , a data packet sending module  206 , a data packet receiving module  208 , a determining module  210  and a reporting module  212 .  
      The device management module  202  is mainly configured for enabling a network interface card (for example, the NIC  104 ) that is connected to a motherboard (for example, the motherboard  104 ) and a test fixture (for example, the test fixture  108 ), and for disabling the NIC  104  after the test. The device management module  202  is further configured for obtaining a device identification of the NIC  104 , obtaining the media access control (MAC) address of the NIC  104 , and obtaining a corresponding network driver interface specification (NDIS) handle. The NDIS handle is required for enabling the NIC  104 , like that a ticket is required for boarding on a bus.  
      A MAC address of an NIC is a hardware address/physical address that uniquely identifies the NIC. One MAC address matches a unique corresponding NIC in the world. A MAC address typically consists of 48 bits of binary numbers, or 12 bits of hex numbers, for example, 00-D0-09-A1-D7-B7. NDIS developed by Microsoft and 3COM is a windows device driver interface that enables a single NIC to support multiple protocols. The device management module  202  uses the device identification, MAC address of the NIC  104  and the corresponding NDIS handle to enable the NIC  104 .  
      The data packet creating module  204  is mainly configured for creating a first data packet. The first data packet is stored in the storage device  106 . The first data packet includes a source MAC address, a destination MAC address, test data and a definition of a data frame type of the test data. In the embodiment, the source MAC address is the same as the MAC address of the NIC  104 , and the destination MAC address may be any acceptable address, typically, the broadcast address: FFFF FFFF FFFF. The test data can be any type of data, such as a typical text data, or even a string of bits.  
      The data packet sending module  206  is mainly configured for sending a whole first data packet via the transmission loop. The test data in the first data packet are sent from the source MAC address to the destination MAC address defined in the first data packet. In particular, the test data are divided into a plurality of data frames, the types of data frames are defined in the first data packet before being sent, and each data frame is defined to be sent from the source MAC address to the destination MAC address. In the preferred embodiment, the data frames are sent from the NIC  104 , transmitted through the test fixture  108 , and finally back to the NIC  104 .  
      The data packet receiving module  208  is mainly configured for receiving data from the transmission loop, and storing the data into the storage device  106  as a second data packet. In particular, the data packet receiving module  208  receives data frames from the transmission loop through the NIC  104 , and stores and combines the data frames that have the same source MAC address and destination MAC address into the storage device  106  as a second data packet.  
      The determining module  210  is mainly configured for determining whether the second data packet has the same data as the test data in the first data packet, so as to determine the test result of whether the NIC  104  functions normally. Specifically, the test result denotes that the NIC  104  functions normally if the second data packet has the same data as the test data in the first data packet; or the test result denotes that the NIC  104  does not function normally if the second data packet does not have the same data as the test data in the first data packet.  
      The reporting module  212  is mainly configured for reporting the test result. The test result may be shown on a monitor or printed by a printer, or in other suitable manners.  
       FIG. 3  is a flowchart of a method for testing an NIC in accordance with one preferred embodiment. Step S 300  includes test preparations that include: preparing a test fixture  108  by utilizing the RJ-45 connector and at least one CAT5 cable; connecting the test fixture  108  to the NIC  104 , and connecting the NIC  104  to the motherboard  102  so as to form the transmission loop, and executing the NIC test system  200  in the computer  100 . Test files or data packets can be transmitted in the transmission loop. The transmission loop is partially formed by connecting the first pin and the third pin of the RJ-45 connector, and connecting the second pin and the sixth pin of the RJ-45 connector. The first and second pins function as transmitting pins, and the third and sixth pins function as receiving pins.  
      In step S 302 , the device management module  202  invokes a GetAdaptersInfo function to obtain the device identification and the MAC address of the NIC  104 . The GetAdaptersInfo function is a typical function of the standard software development kit (SDK) issued and provided by Microsoft Corporation. It should be noted that, in an alternative embodiment, the GetAdaptersInfo function as well as other functions below used in the preferred embodiment can be replaced with other functions or application programs that achieves the same or similar objective. That is, the execution of the test method does not rely on SDK.  
      In step S 304 , the device management module  202  invokes a CreateFile function of SDK to obtain a corresponding NDIS handle. In step S 306 , the device management module  202  invokes a DeviceIoControl function of SDK to enable the NIC  104  according to the device identification and the MAC address of the NIC  104  and the corresponding NDIS handle.  
      In step S 308 , the data packet creating module  204  creates a first data packet (herein named and referred to as TxData). TxData is stored in the storage device  106 . TxData includes the source MAC address, the destination MAC address, test data, and a definition of the data frame type of the test data. In the preferred embodiment, the source MAC address is the same as the MAC address of the NIC  104 , and the destination MAC address may be any acceptable address, typically, the broadcast address: FFFF FFFF FFFF. The test data can be any type of data, such as a typical text data, or even a string of characters or numbers.  
      In step S 310 , the data packet sending module  206  sends TxData via the transmission loop. In particular, the data packet sending module  206  divides the test data of TxData into a plurality of data frames with the type defined in TxData, and sends each data frame from the source MAC address to the destination MAC address. In the preferred embodiment, the data frames are sent from the NIC  104 , transmitted through the test fixture  108 , and finally back to the NIC  104 .  
      In step S 312 , the data packet receiving module  208  receives data from the transmission loop, and stores the data into the storage device  106  as the second data packet (herein named and referred to as RxData). In particular, the data packet receiving module  208  receives data frames from the transmission loop through the NIC  104 , and stores and combines the data frames that have the same source MAC address and destination MAC address into the storage device  106  as the second data packet RxData.  
      In step S 314 , the determining module  210  determines whether RxData has the same data as the test data in TxData, so as to determine whether the network interface card functions normally.  
      If RxData has the same data as the test data in TxData, in step S 316 , the reporting module  212  reports a passed test result denoting that the NIC  104  functions normally. Otherwise, if RxData does not have the same data as the test data in TxData, in step S 320 , the reporting module  212  reports a failed test result denoting that the NIC  104  does not function normally.  
      In step S 318 , the device management module  202  disables the NIC  104 , and the reporting module  212  outputs the test result on a monitor, a printer, or in other suitable manners.  
      It should be emphasized that the above-described embodiments of the present invention, particularly, any “preferred” embodiments, are merely possible examples of implementations, merely set forth for a clear understanding of the principles of the invention. Many variations and modifications may be made to the above-described embodiment(s) of the invention without departing substantially from the spirit and principles of the invention. All such modifications and variations are intended to be included herein within the scope of this disclosure and the present invention and protected by the following claims.