Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide a kind of soft routing performance method of testing, for solving in prior art the problem of the soft routing performance can not testing the network switch that have employed Layer3 Switching technology.
For achieving the above object and other relevant objects, the invention provides a kind of soft routing performance method of testing, be applied to and have employed in the network equipment of Layer3 Switching technology, soft routing performance method of testing comprises: be connected with the first network interface card of the first computer by the first port of the described network equipment, second port of the described network equipment is connected with the second network interface card of second computer, establishment is given out a contract for a project VLAN, and the VLAN that gives out a contract for a project described in the first port is configured to, the IP address of the network segment that the first port connects is set; Create packet receiving VLAN, by the described network equipment all the other ports at least one be configured to described packet receiving VLAN, the IP address of the network segment that the port that is configured to described packet receiving VLAN connects is set; Second computer and the described network equipment carry out communication test; The network segment that at least one IP address of the network segment connected by described vlan port of giving out a contract for a project of first computer construction is source address, described packet receiving VLAN connects IP address for the purpose of the packet of address, different described packet has different source addresses or different destination addresses, and packet sending speed is set, the packet constructed is sent with described packet sending speed; Adjust described packet sending speed according to second computer and described network device communications test mode, and then determine the maximum packet sending speed under described communication test is in not packet loss state.
Alternatively, the destination address of described packet is inaccessible IP address.
Alternatively, described communication test is comprised and being tested by ping order.
Alternatively, described soft routing performance method of testing also comprises: in setting-up time section, gives out a contract for a project with described maximum packet sending speed, detects described communication test state simultaneously.
Alternatively, described first computer and described second computer are same computer, and described first network interface card and described second network interface card are the different network interface cards of same computer.
Alternatively, described soft routing performance method of testing also comprises: the described network equipment is connected with the 3rd computer by serial ports, and the 3rd computer is checked the running status of the described network equipment.
Alternatively, the running status of the described network equipment comprises the CPU usage of described equipment.
Alternatively, the running status of the described network equipment also comprises the memory usage of the described network equipment.
Alternatively, the running status of the described network equipment also comprises the quantity of route processing message.
Alternatively, the running status of the described network equipment checked by described 3rd computer by Command Line Interface.
Alternatively, described first computer, described second computer and the 3rd computer are same computer, and described first network interface card and described second network interface card are the different network interface cards of same computer.
As mentioned above, the soft routing performance method of testing of one of the present invention, there is following beneficial effect: simulate different packet sending speeds by one and send the packet needing route, the network equipment with soft routing capabilities sends protocol data bag while packet receiving, comes the soft routing capabilities of Sampling network equipment and the performance of CPU.
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this specification can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this specification also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.
It should be noted that, the diagram provided in the present embodiment only illustrates basic conception of the present invention in a schematic way, then only the assembly relevant with the present invention is shown in graphic but not component count, shape and size when implementing according to reality is drawn, it is actual when implementing, and the kenel of each assembly, quantity and ratio can be a kind of change arbitrarily, and its assembly layout kenel also may be more complicated.
The invention provides a kind of soft routing performance method of testing, be applied to and have employed in the network equipment of Layer3 Switching technology.This soft routing performance method of testing has used message between different sub-network, send the principle needed through route processing.Illustrating that two websites realize cross-network segment communicating by three-tier switch below is a how process.Assuming that website A, B are communicated by three-tier switch.Website A and the B place network segment all belong to the directly connected subnet on switch, if website A and website B is not in same subnet, first dispatching station A will send ARP request message to its " default gateway ", and the IP address of " default gateway " is exactly the IP address of VLAN belonging to website A on three-tier switch in fact.When the IP address broadcast of dispatching station A to " default gateway " goes out an ARP request, switch just returns an ARP to dispatching station A and replys message, tell the MAC Address of this VLAN of website A switch, by software, the information such as the IP address of website A, MAC Address, the port numbers that is directly connected with switch can be set in three layers of hardware table item of exchange chip simultaneously.Website A carries out target MAC (Media Access Control) address replacement, first the bag issuing B is issued switch after receiving this ARP reply message.After switch receives this bag, equally first carry out source MAC study, target MAC (Media Access Control) address is searched, and because now target MAC (Media Access Control) address is the MAC Address of switch, this message will be delivered to three layers of engine process of exchange chip in this case.In general, three layers of engine have two tables, and one is Host routes table, and this table is with IP address for index, and the information such as object IP address, next-hop mac address, port numbers are deposited in the inside.If find one to mate list item, after message being carried out to certain operations (such as object MAC and source MAC replace, TTL subtract 1 etc.), the port repeat that message is specified from show will be gone out.If do not find coupling entry in Host routes table, then can continue to search another table--network segment routing table.The information such as network segment address, next-hop mac address, port numbers deposited by this table.In general entry of this table wants much less, but the scope covered is very large, as long as arrange proper, substantially can ensure that message that major part enters switch is all walked hardware and forwarded, not only greatly improve forwarding speed like this, also mitigate the load of CPU simultaneously.If search network segment routing table also do not find coupling list item, then exchange chip can give CPU process bag, carries out soft route, also can be called CPU.Due to one of website B directly connected subnet belonging to switch, after CPU receives this IP message, can directly with the IP of B for index checks arp cache, if there is no the MAC Address of website B, then ask to B station broadcast ARP according to routing iinformation, B station obtains this ARP asks backward switch to reply its MAC Address, CPU is while receiving this ARP reply message, equally can by software the IP address of website B, MAC Address, entering the information such as the port numbers of switch is set in three layers of hardware table item of exchange chip, then the IP message repeating sent by website A to website B, this completes the first time one-way communication of website A to website B.Owing to having preserved the routing iinformation of website A, B in three layers of engine of chip internal, carry out between website A, B communicating or the website of other network segment is wanted to communicate with A, B later, exchange chip then can directly be gone out wrapping the port repeat of specifying from three layers of hardware table item, and need not give CPU process bag again.This mode by " route repeatedly exchanges ", substantially increases forwarding speed.It should be noted that, the route table items in three layers of engine is mostly by software design patterns.
In one embodiment, as shown in Figure 1, described soft routing performance method of testing comprises:
Step S1, first port of the described network equipment is connected with the first network interface card of the first computer, second port of the described network equipment is connected with the second network interface card of second computer, establishment is given out a contract for a project VLAN, and the VLAN that gives out a contract for a project described in the first port is configured to, the IP address of the network segment that the first port connects is set; Create packet receiving VLAN, by the described network equipment all the other ports at least one be configured to described packet receiving VLAN, the IP address of the network segment that the port that is configured to described packet receiving VLAN connects is set.Particularly, the described VLAN of giving out a contract for a project and described packet receiving VLAN is different VLAN, when the described network equipment receive source address for described in give out a contract for a project the IP address of the network segment of port, destination address is the packet of the IP address of the network segment of described packet receiving port, and the source address that receives for described network equipment first time of this packet for described in give out a contract for a project the IP address of the network segment of port, when destination address is the packet of the IP address of the network segment of described packet receiving port, because this packet is that travelling across VLAN sends, therefore, the described network equipment directly can not carry out hardware forwarding to this packet, need to carry out soft route processing.
Step S2, second computer and the described network equipment carry out communication test.Particularly, second computer and the described network equipment carry out continual communication test, determine whether described network equipment working is in abnormality by the result of communication test, when the situation of packet loss appears in described communication test, then illustrate that described network equipment working is in packet loss state, i.e. abnormality.When the situation of packet loss does not appear in described communication test, then illustrate that described network equipment working is in not packet loss state, i.e. normal condition.In one embodiment, described communication test is comprised and being tested by ping order.
Step S3, the network segment that at least one IP address of the network segment connected by described vlan port of giving out a contract for a project of first computer construction is source address, described packet receiving VLAN connects IP address for the purpose of the packet of address, different described packet has different source addresses or different destination addresses, and packet sending speed is set, the packet constructed is sent with described packet sending speed.Particularly, described packet comprises IP message.In one embodiment, the packet of described first computer construction can be multiple packets with different source addresses or different destination addresses, to ensure that these packets all need to carry out routing forwarding in the tested described network equipment.In one embodiment, the destination address of described packet is inaccessible IP address.Due to when the destination address of described packet is inaccessible IP address, the MAC Address that destination address is corresponding cannot be determined, namely cannot set up hardware forwarding table.Therefore, when this destination address of each transmission is the packet of inaccessible IP address, all soft route processing will be carried out.Like this, described first computer can detect the soft routing capabilities of the described network equipment by sending same packet continuously.
Step S4, adjusts described packet sending speed according to second computer and described network device communications test mode, and then determines the maximum packet sending speed under described communication test is in not packet loss state.Particularly, when described second computer and described network device communications test mode be not packet loss state (i.e. normal communication state) time, improve the packet sending speed of the first computer; When described second computer and described network device communications test mode are packet loss state (i.e. abnormal communication states), reduce the packet sending speed of the first computer.By continuous trial, and then determine the maximum packet sending speed under described communication test is in not packet loss state.
In one embodiment, described soft routing performance method of testing also comprises: in setting-up time section, gives out a contract for a project with described maximum packet sending speed, detects described communication test state simultaneously.Particularly, the first computer all sends packet with described maximum packet sending speed in setting-up time section, detects described communication test simultaneously in real time and whether is in not packet loss state always.If detect described communication test to be in real time in not packet loss state always, then described maximum packet sending speed correspond to the maximum soft routing capabilities of the tested network equipment.If detect described communication test be in real time sometimes in packet loss state, then described maximum packet sending speed needs to adjust, and namely reduces described packet sending speed and further tests.
In one embodiment, described first computer and described second computer are same computer, and described first network interface card and described second network interface card are the different network interface cards of same computer.Particularly, this computer at least comprises two pieces of network interface cards, wherein the first port of one piece of interconnection network equipment, the second port of another block interconnection network equipment.
In one embodiment, described soft routing performance method of testing also comprises: the described network equipment is connected with the 3rd computer by serial ports, and the 3rd computer is checked the running status of the described network equipment.In one embodiment, the running status of the described network equipment comprises the CPU usage of described equipment.The running status of the described network equipment can also comprise the memory usage of the described network equipment.The running status of the described network equipment can also comprise the quantity of route processing message.In one embodiment, the running status of the described network equipment checked by described 3rd computer by Command Line Interface.By checking that the running status of the described network equipment can determine performance and the stability of the described network equipment further.In one embodiment, described first computer, described second computer and the 3rd computer are same computer, and described first network interface card and described second network interface card are the different network interface cards of same computer.Particularly, this computer at least comprises two pieces of network interface cards, wherein the first port of one piece of interconnection network equipment, second port of another block interconnection network equipment, simultaneously, this computer is also connected with the described network equipment by Serial Port Line, and checks the running status of the described network equipment by serial port command.
In sum, a kind of soft routing performance method of testing of the present invention is simulated different packet sending speeds by one and is sent the packet needing route, the network equipment with soft routing capabilities sends protocol data bag while packet receiving, comes the soft routing capabilities of Sampling network equipment and the performance of CPU.The soft routing capabilities of the network equipment is the significant capability of the network equipment, and the present invention greatly strengthen the power of test of the performance to the network equipment.So the present invention effectively overcomes various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.