Networking method and system for testing various traffic models of router
Technical Field
The embodiment of the invention relates to the field of communication, in particular to a networking method and a networking system for testing various traffic models of a router.
Background
A Router (Router) is a device for connecting each internal network, i.e., a Local Area Network (LAN), and each external network, i.e., a Wide Area Network (WAN), in the internet, and automatically selects and sets a route according to the channel condition, and transmits signals in a front-back order through an optimal path. At present, routers are widely applied to various industries, and various products with different grades become the main force for realizing the internal connection of various backbone networks, interconnection among backbone networks and interconnection and intercommunication services of the backbone networks and the Internet.
Routers (routers), also called Gateway devices (gateways), are used to connect multiple logically separate networks, so-called logical networks representing a single network or a sub-network. This may be accomplished by the routing function of the router when data is transferred from one subnet to another. Therefore, the router has the functions of judging network addresses and selecting IP paths, can establish flexible connection in a multi-network interconnection environment, can be used for connecting various subnets by completely different data grouping and medium access methods, only receives information of a source station or other routers, and belongs to interconnection equipment of a network layer.
A router is a multi-port device that can connect to local area networks and wide area networks, which may operate in a variety of environments, and may use different protocols.
Routers can be classified into wired routers and wireless routers.
The wired router is a router connected with the electronic device by using a network cable or an optical fiber, and is only suitable for the electronic device with a network cable interface.
The wireless router is a combination of a simplex Access Point (AP) and a broadband router, is a router with a wireless coverage function, and is mainly applied to user internet Access and wireless coverage. The wireless router popular in the market generally supports four access modes of private line xdsl/cable, dynamic xdsl and pptp, and also has other network management functions, such as dhcp service, nat firewall, mac address filtering and the like.
The wireless router can work in single frequency and dual-frequency, for example, the single frequency router can adopt 2.4Ghz or 5Ghz to transmit data, and the dual-frequency router adopts 2.4Ghz frequency band and 5Ghz frequency band to transmit data.
As shown in fig. 1, which is a schematic structural diagram of an intelligent home system in the prior art, a wireless router connects intelligent electronic devices in a home through WIFI, for example, the wireless router connects intelligent electronic devices such as a mobile phone, a computer, a television, a refrigerator, a washing machine, an air conditioner, and a lamp through WIFI, so as to implement network transmission.
At present, the form of a router is various, different traffic models are often required to be covered when the router is tested, different traffic models often require different test topologies, and the industry often builds a plurality of sets of topologies suitable for various traffic for testing at present.
Therefore, multiple sets of test topologies are built to cope with different flow models, too much Personal Computer (PC) resources and system resources are consumed, and complete automated testing is difficult to realize due to the need of testing in different topologies.
Disclosure of Invention
The invention provides a system for testing various flow models of a router in various aspects, which realizes the test of various flow models by using a set of test environment, saves the resource overhead and realizes the automatic test.
One aspect of the present invention provides a networking method for testing multiple traffic models of a router, including:
installing a first wired network card and a first dual-frequency wireless network card in a first computer;
installing a second wired network card and a second dual-frequency wireless network card on a second computer;
installing a third wired network card on a third computer;
connecting the first, second and third wired network cards to a first Port (Port1), a second Port (Port2) and a third Port (Port3) of a switch with a divided VLAN;
respectively connecting a first local area network (LAN1) interface, a second local area network (LAN1) interface and a Wide Area Network (WAN) interface of a router to be tested with a fourth Port (Port4), a fifth Port (Port5) and a sixth Port (Port6) of the switch;
the first dual-frequency wireless network card and the second dual-frequency wireless network card are respectively connected with a first programmable attenuator and a second programmable attenuator through a first power divider and a second power divider in sequence;
and respectively connecting the first programmable attenuator and the second programmable attenuator with two wireless interfaces of the router to be tested.
Optionally, when the performance of the switching module of the router under test needs to be tested, configuring the Port1 and the Port4 of the switch to be in the same VLAN, and the Port2 and the Port5 to be in another VLAN; forbidding the first and second dual-frequency wireless network cards; and carrying out flow test between the first wired network card and the second wired network card on the first computer or the second computer.
Optionally, when the performance of a Network Address Translation (NAT) module of the router under test needs to be tested, configuring the Port1 and the Port4 of the switch to be in the same VLAN, and the Port2 and the Port6 to be in another VLAN; forbidding the first and second dual-frequency wireless network cards; and carrying out flow test between the first wired network card and the second wired network card on the first computer or the second computer.
Optionally, when the performance of the wireless and Network Address Translation (NAT) module of the router under test needs to be tested, configuring the Port1 and the Port4 of the switch to be in the same VLAN, the Port2 and the Port5 to be in another VLAN, and the Port3 and the Port6 to be in yet another VLAN; connecting the first dual-frequency wireless network card with WiFi of the router to be tested; setting the network card hop count (METRIC) of the first wired network card and the first dual-frequency wireless network card to be the same value; and disabling the second dual-frequency wireless network card, and performing flow test between the first dual-frequency wireless network card and the second wired network card and flow test between the first wired network card and the third wired network card on the first computer.
Optionally, when the dual-frequency wireless performance of the router to be tested needs to be tested, configuring the Port1 and the Port4 of the switch to be in the same VLAN, and configuring the Port2 and the Port5 to be in another VLAN; connecting the first dual-frequency wireless network card with 2.4G WiFi of the router to be tested, and connecting the second dual-frequency wireless network card with 5G WiFi of the router to be tested; setting the network card hop numbers of the first wired network card and the first dual-frequency wireless network card to be the same value on the first computer, and setting the network card hop numbers of the second wired network card and the second dual-frequency wireless network card to be the same value on the second computer; and carrying out flow test between the first wired network card and the second dual-frequency wireless network card and flow test between the second wired network card and the first dual-frequency wireless network card on the first computer or the second computer.
Another aspect of the present invention provides a system for testing multiple traffic models of a router, including: a first computer, a second computer, a third computer, a first wired network card, a second wired network card, a first dual-frequency wireless network card, a second dual-frequency wireless network card, a switch with a VLAN, a power divider, a first programmable attenuator and a second programmable attenuator, wherein,
the first wired network card and the first dual-frequency wireless network card are installed on the first computer;
the second wired network card and the second dual-frequency wireless network card are installed on the second computer;
the third wired network card is installed on the third computer;
the first, second and third wired network cards are respectively connected with a first Port (Port1), a second Port (Port2) and a third Port (Port3) of the switch;
a fourth Port (Port4), a fifth Port (Port5) and a sixth Port (Port6) of the switch are respectively connected with a first local area network (LAN1) interface, a second local area network (LAN2) interface and a Wide Area Network (WAN) interface of the router to be tested;
the first dual-frequency wireless network card and the second dual-frequency wireless network card are respectively connected with the first programmable attenuator and the second programmable attenuator through a first power divider and a second power divider in sequence;
the first programmable attenuator and the second programmable attenuator are respectively connected with two wireless interfaces of the router to be tested.
Optionally, when the performance of the switching module of the router to be tested needs to be tested, the Port1 and the Port4 of the switch are configured in the same VLAN, the Port2 and the Port5 of the switch are configured in another VLAN, and the first dual-frequency wireless network card and the second dual-frequency wireless network card are disabled, so that the traffic test between the first wired network card and the second wired network card is performed on the first computer or the second computer.
Optionally, when the performance of a Network Address Translation (NAT) module of the router under test needs to be tested, the Port1 and the Port4 of the switch are configured in the same VLAN, the Port2 and the Port6 of the switch are configured in another VLAN, and the first and second dual-frequency wireless network cards are disabled, so as to implement a traffic test between the first wired network card and the second wired network card on the first computer or the second computer.
Optionally, when the performance of a wireless and Network Address Translation (NAT) module of the router under test needs to be tested, the Port1 and the Port4 of the switch are configured in the same VLAN, the Port2 and the Port5 of the switch are configured in another VLAN, the Port3 and the Port6 of the switch are configured in yet another VLAN, and the first dual-frequency wireless network card connects the WiFi of the router under test; the network card hop count (METRIC) of the first wired network card and the first dual-frequency wireless network card are set to be the same value, and the second dual-frequency wireless network card is forbidden, so that the flow test between the first dual-frequency wireless network card and the second wired network card and the flow test between the first wired network card and the third wired network card are carried out on the first computer.
Optionally, when the dual-frequency wireless performance of the router to be tested needs to be tested, the Port1 and the Port4 of the switch are configured in the same VLAN, and the Port2 and the Port5 of the switch are configured in another VLAN; the first dual-frequency wireless network card is connected with 2.4G WiFi of the router to be tested, the second dual-frequency wireless network card is connected with 5G WiFi of the router to be tested, the network card hop counts of the first wired network card and the first dual-frequency wireless network card are set to be the same value on the first computer, and the network card hop counts of the second wired network card and the second dual-frequency wireless network card are set to be the same value on the second computer, so that flow test between the first wired network card and the second dual-frequency wireless network card and flow test between the second wired network card and the first dual-frequency wireless network card are carried out on the first computer or the second computer.
By the networking method and the networking system for testing various traffic models of the router, the various traffic models are tested by using one set of test environment, so that the resource overhead is saved, and the automatic test is realized.
Drawings
Fig. 1 is a schematic structural diagram of an intelligent home system in the prior art;
fig. 2 is a schematic structural diagram of a system for testing multiple traffic models of a router according to another embodiment of the present invention;
fig. 3 is a schematic flow chart of a networking method for testing multiple traffic models of a router according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The techniques described herein may be used in various Communication systems, such as 2G, 3G, 4G Communication systems and next generation Communication systems (e.g., 5G), such as Global System for mobile Communication (GSM) systems, Code Division Multiple Access (CDMA) systems, Time Division Multiple Access (TDMA) systems, Wideband Code Division Multiple Access (WCDMA) systems, Frequency Division Multiple Access (FDMA) systems, Orthogonal Frequency-Division Multiple Access (OFDMA) systems, FDMA (SC-FDMA) systems, General Packet Radio Service (General Packet Radio Service, GPRS) systems, Long Term Evolution (Long Term Evolution, LTE) systems, and other Evolution systems. CDMA systems may implement radio technologies such as Universal Terrestrial Radio Access (UTRA), CDMA2000, and the like. UTRA includes wideband-CDMA (wcdma) and other CDMA variants. In addition, CDAM2000 covers IS-2000, IS-95 and IS-856 standards. TDMA systems may implement radio technologies such as global system for mobile communications (GSM). The OFDMA system may implement Radio technologies such as Evolved-UMTS Terrestrial Radio Access (E-UTRA), Ultra Mobile Broadband (UMB), IEEE802.11(Wi-Fi), IEEE802.16(WiMAX), IEEE802.20, Flash-OFDMA, and the like. UTRA and E-UTRA are part of the Universal Mobile Telecommunication System (UMTS). 3GPP Long term evolution (e.g., LTE) is a version of UMTS that uses E-UTRA, which may employ OFDMA on the downlink and SC-FDMA on the uplink. UTRA, E-UTRA, UMTS, LTE and GSM are described in the literature of the "third Generation partnership project (3 GPP)" organization. In addition, CDAM2000 and UMB are described in the literature of the third generation partnership project 2(3GPP2) organization.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship. Additionally, the terms "system" and "network" are often used interchangeably herein.
As shown in fig. 2, which is a schematic structural diagram of a system for testing multiple traffic models of a router according to an embodiment of the present invention, the system for testing multiple traffic models of a router includes: the system comprises a first computer (PC1), a second computer (PC2), a third computer (PC3), a first wired Network card (Network Information Center1, NIC1), a second wired Network card (NIC2), a third wired Network card (NIC2), a first dual-frequency Wireless Network card (Wireless Network Information Center1, WNIC1), a second dual-frequency Wireless Network card (WNIC2), a Switch (Switch) with a virtual local area Network VLAN dividing function, a first power divider, a second power divider, a first programmable attenuator and a second programmable attenuator.
The first wired network card (NIC1) and the first dual-frequency wireless network card (WNIC1) are installed on the first computer (PC 1).
The second wired network card (NIC2) and the second dual-frequency wireless network card (WNIC2) are installed on the second computer (PC 2).
The third wired network card (NIC3) is installed on the third computer (PC 3).
The NIC1, the NIC2, and the NIC3 are respectively connected to a first Port (Port1), a second Port (Port2), and a third Port (Port3) of the switch.
And the first local area network (LAN1) interface, the second local area network (LAN2) interface and the Wide Area Network (WAN) interface of the router to be tested are respectively connected with the fourth Port (Port4), the fifth Port (Port5) and the sixth Port (Port6) of the switch.
The WNIC1 and the WNIC2 are sequentially connected with the first programmable attenuator and the second programmable attenuator through the first power divider and the second power divider respectively, namely the first power divider and the second power divider are connected in series, the WNIC1 and the WNIC2 are both connected with the first power divider, then the first power divider is connected with the second power divider, and the second power divider is connected with the first programmable attenuator and the second programmable attenuator.
The first programmable attenuator and the second programmable attenuator are respectively connected with two wireless interfaces of the router to be tested.
Fig. 3 is a schematic flow chart of a networking method for testing multiple traffic models of a router according to an embodiment of the present invention, and with reference to fig. 2, the networking method for testing multiple traffic models of a router is mainly as follows.
Step 301, installing a first wired network card (NIC1) and a first dual-frequency wireless network card (WNIC1) on a first computer (PC 1).
Step 302, install the second wired network card (NIC2) and the second dual-frequency wireless network card (WNIC2) on the second computer (PC 2).
Step 303, install the third wired network card (NIC3) on the third computer (PC 3).
In step 304, the NIC1, the NIC2, and the NIC3 are respectively connected to the first Port (Port1), the second Port (Port2), and the third Port (Port3) of the switch.
And 305, respectively connecting a first local area network (LAN1) interface, a second local area network (LAN2) interface and a Wide Area Network (WAN) interface of the router to be tested with a fourth Port (Port4), a fifth Port (Port5) and a sixth Port (Port6) of the switch.
And step 306, respectively connecting the WNIC1 and the WNIC2 to a first programmable attenuator and a second programmable attenuator through a first power divider and a second power divider in sequence.
And 307, respectively connecting the first programmable attenuator and the second programmable attenuator to two wireless interfaces of the router to be tested.
In another embodiment of the present invention, when the performance of the switching module of the router to be tested needs to be tested, that is, a traffic test between local area networks (LAN < - > LAN) is performed, the Port1 and the Port4 of the switch are configured to be in the same VLAN, and the Port2 and the Port5 are in another VLAN; disabling the WNIC1, WNIC 2; traffic testing between the NIC1 and NIC2 (NIC1< - > NIC2) was performed on either the PC1 or PC 2.
In another embodiment of the present invention, when the performance of a Network Address Translation (NAT) module of the router to be tested needs to be tested, a traffic test between a local area network and a wide area network (LAN < - > WAN) is performed, the Port1 and the Port4 of the switch are located in the same VLAN, and the Port2 and the Port6 are located in another VLAN; disabling the WNIC1, WNIC 2; traffic testing between the NIC1 and NIC2 (NIC1< - > NIC2) was performed on either the PC1 or PC 2.
In another embodiment of the present invention, when the performance of the wireless and network address translation NAT modules of the router to be tested needs to be tested, that is, traffic tests between a local area network and a wireless local area network (LAN < - > WLAN) and LAN < - > WAN are performed, the Port1 and the Port4 of the switch are configured to be in the same VLAN, the Port2 and the Port5 are in another VLAN, and the Port3 and the Port6 are in yet another VLAN; connecting the WNIC1 with WiFi of the router to be tested; setting the network card hop counts (METRIC) of the NIC1 and the WNIC1 to be the same value, because the network cards of two same network segments on the same PC are preferentially used for communication if the hop counts are different, and when the hop counts are the same, the network cards of the two same network segments are simultaneously used; disable the WNIC2, conduct traffic testing between the WNIC1 and the NIC2 (WNIC1< - > NIC2) and between the NIC1 and the NIC3 (NIC1< - > NIC3) on the PC 1.
In another embodiment of the present invention, when dual-band wireless performance of the router under test needs to be tested, that is, testing between a local area network and a wireless local area network 2.4G Port (LAN < - > WLAN2G4) and between a local area network and a wireless local area network 5G Port (LAN < - > WLAN5G) is performed, the Port1 and the Port4 of the switch are configured to be on the same VLAN, and the Port2 and the Port5 are on another VLAN; connecting the WNIC1 with 2.4G WiFi of the router to be tested, and connecting the WNIC2 with 5G WiFi of the router to be tested; setting the network card hop numbers of the NIC1 and the WNIC1 to be the same value on the PC1, and setting the network card hop numbers of the NIC2 and the WNIC2 to be the same value on the PC2, wherein the two same values may be different and the same in another embodiment of the invention; traffic testing between the NIC1 and the WNIC2 (NIC1< - > WNIC2) and traffic testing between the NIC2 and the WNIC1 (NIC2< - > WNIC1) was conducted on either the PC1 or the PC 2.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.