1. Technical Field
Embodiments of the present disclosure relate to electronic device test, and particularly to a network connection device and method for testing network ports of the network connection device.
2. Description of Related Art
A network connection device (e.g., a router or a network switch) includes external network ports that are used for data transfer over an extranet network, and internal network ports that are used for data transfer over an intranet network. A test device (e.g., a computer) may be utilized to test the network ports of the network connection device. The test device may control the network connection device to transfer data packets to and fro between the external network ports and the internal network ports, and test data transfer performance of the network ports. However, it is inconvenient to implement the network port test using such test device, and may cause test costs to increase.
In general, the word “module,” as used hereinafter, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, for example, Java, C, or Assembly. One or more software instructions in the modules may be embedded in firmware. It will be appreciated that modules may comprised connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of computer-readable medium or other computer storage device.
In one embodiment, the network connection device 10 may further include a test unit 14, a storage system 15, and at least one processor 16. The test unit 14 includes a number of function modules. The function modules may comprise computerized codes in the form of one or more programs that are stored in the storage system 15. The computerized codes includes instructions that are executed by the at least one processor 16 to provide functions for the modules. In one embodiment, the storage system 15 may be an internal storage device, such as a random access memory (RAM) for temporary storage of information, and/or a read only memory (ROM) for permanent storage of information. In some embodiments, the storage system 15 may also be an external storage device, such as an external hard disk, a storage card, or a data storage medium.
The setup module 200 sets multiple port pairs of the network connection device 10. Each of the port pairs includes an external network port 11 and an internal network port 12. In one example with respect
The creation module 210 creates a data packet. A data packet is a formatted unit of data transmitted over network and consists of control information and user data.
The transmission module 220 selects the port pairs one by one. For each of the selected port pairs, the transmission module 220 transmits the data packet from the external network port 11 of the selected port pair to the internal network port 12 of the selected port pair. For example, the transmission module 220 selects the port pair of Port5-Port0, and transmits the data packet from Port5 to Port0. In one embodiment, the transmission module 220 selects the port pairs according to the sequence.
The comparison module 230 determines whether data transfer of the selected port pair is normal by comparing the data packet transmitted to the internal network port 12 of the selected port pair with a corresponding data packet returned from the internal network port 12 of the selected port pair. As mentioned above, when a data packet is transmitted from an external network port 11 to an internal network port 12, the loopback device 13 connected to the internal network port 12 may drive the internal network port 12 to the return data packet to the external network port 11. If the data packet transmitted to the internal network port 12 of the selected port pair is identical to the corresponding data packet returned from the internal network port 12 of the selected port pair, the comparison module 230 determines that the data transfer of the selected port pair is normal. Otherwise, if the data packet transmitted to the internal network port 12 of the selected port pair is not identical to the corresponding data packet returned from the internal network port 12 of the selected port pair, the comparison module 230 determines that the data transfer of the selected port pair is abnormal.
The display module 240 controls the display device 17 to display a test result of the selected port pair. In one embodiment, the display device 17 includes multiple LED indicators. Each of the LED indicators corresponds to one of the port pairs. If data transfer of the selected port pair is normal, the display module 240 lights up a corresponding LED indicator with green. Otherwise, if the data transfer of the selected port pair is abnormal, the display module 240 lights up the corresponding LED indicator with red. The display module 240 may light up all the LED indicators with green if the data transfer of all the port pairs is normal.
In block S301, each of the internal network ports 12 of the network connection device 10 is connected to a loopback device 13.
In block S302, the setup module 200 sets port pairs of the network connection device 10. Each of the port pairs includes an external network port 11 and an internal network port 12. In one example, the network connection device 10 includes an external network port Port5 and five internal network ports Port0-Port4. The setup module 200 sets five port pairs of Port5-Port0, Port5-Port1, Port5-Port2, Port5-Port3, and Port5-Port4.
In block S303, the creation module 210 creates a data packet. The data packet is in a predetermined format and consists of control information and user data.
In block S304, the transmission module 220 selects one of the port pairs. For example, the transmission module 220 selects the port pair of Port5-Port0. In one embodiment, the transmission module 220 selects the port pairs according to a predetermined sequence.
In block S305, the transmission module 220 transmits the data packet from the external network port 11 of the selected port pair to the internal network port 12 of the selected port pair. For example, the transmission module 220 transmits the data packet from Port5 to Port0.
In block S306, the comparison module 230 compares the data packet transmitted to the internal network port 12 of the selected port pair with a corresponding data packet returned from the internal network port 12 of the selected port pair via a corresponding loopback device 13, to determine whether data transfer of the selected port pair is normal. If the data packet transmitted to the internal network port 12 of the selected port pair is identical to the corresponding data packet returned from the internal network port 12 of the selected port pair, the comparison module 230 determines that the data transfer of the selected port pair is normal.
In block S307, the display module 240 controls the display device 17 to display a test result of the selected port pair. In one embodiment, the display module 240 may further display a total test result of all the selected port pairs if the data transfer of all the port pairs is normal.
In block S308, the transmission module 220 determines if there are any other port pairs that have not been selected. If there are any other port pairs that have not been selected, the flow may return to block S304. If there are no other port pairs to be selected, the procedure ends.
Although certain inventive embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
99126700 | Aug 2010 | TW | national |