Summary of the invention
Can't test the all-network card of user side in order to solve traditional method for testing pressure, and cause network card coverage rate deficiency when testing, can't reach the problem of pressure test purpose fully, the invention provides a kind of method for testing pressure of network card.
The invention discloses a kind of method for testing pressure of network card, send test file by the user side with a plurality of network cards to server, the test file of user side and reception server passback is to carry out pressure test to these network cards.The pressure test mode of this network card is set up strategy table and provide strategy to pass on means is provided, to solve the above problems.
Strategy passes on shows to have network card index, server path and the route of a routing index, each network card.Add a policy information in this test file that sends, this policy information comprises this routing index of a user path and its correspondence;
Provide a strategy to pass on means, carry out the following step: receive test file and policy information that user side sent, wherein policy information comprises user path and its corresponding routing index, consult strategy according to routing index and pass on table, obtaining route, and route comprises the network card index of server path and appointment; According to user path and server path, server is given in the test file transmission via appointed network card; Via the test file that appointed network card reception server is passed back, wherein server is according to the user path; And server path is passed test file back; And the test file that receives transmitted give user side.
Wherein above-mentioned test file and policy information can be specified by a tester.In more detail, the tester can specify server to be measured and test file to be transmitted according to the demand of pressure test, obtains the policy information corresponding to server to be measured more in view of the above.
According to an enforcement example of the present invention, user side links to each other by a network with server.Implement example according to of the present invention another, user side links to each other by a hub with server.
In addition, strategy passes on means and can comprise in addition: the test file of original test file and server being passed back at user side compares, and exports comparing result according to this.
In sum, the method for testing pressure of network card passes on the Collaboration of means by policy information and strategy, passing on means by strategy searches built-in strategy according to policy information and passes on table, the network card that acquisition is desired to test, user path and server path, and then the network card by appointment transmits test file between user side and server.Thus, the transmission that user side can be just can carry out test file to all network cards with receive carrying out pressure test, and solve the problem of the network card coverage rate deficiency of traditional method of testing.
Embodiment
Below in execution mode, be described in detail detailed features of the present invention and advantage, its content is enough to make any those skilled in the art to understand technology contents of the present invention and implements according to this, and according to the disclosed content of this specification, claim and accompanying drawing, any those skilled in the art can understand purpose and the advantage that the present invention is correlated with easily.
The method for testing pressure that the invention provides a kind of network card is applicable between a user side and the server, wherein user side have a plurality of network cards (Network Interface Card, NIC).Please refer to Fig. 1, it is the connection diagram of the one enforcement example according to the present invention.Can be seen by Fig. 1 and to know that user side 20 links to each other with server 22, and user side 20 has network card 21a and network card 21b, user side 20 also can be carried out a strategy and pass on means 24.
User side 20 can be calculator systems such as main frame or desktop PC, and has a plurality of network cards 21 simultaneously.As shown in Figure 1, user side 20 has network card 21a and network card 21b, and user side 20 can be by arbitrary network card 21 transceive data.That is to say, user side 20 by arbitrary network card 21 that it had all can connect internet (Internet), local area network (LAN) (Local Area Network, LAN) or other calculator system.Wherein network card 21a is set at default network card 21 by user side 20, so do not have under the specially appointed situation in the network package (packet) of transceive data, user side 20 is all by network card 21a transceive data.
Server 22 also can be calculator systems such as the main frame or the webserver.Server 22 has a shared catalogue can be opened for user side 20, and user side 20 has the read-write right of share directory.In other words, user side 20 can write new file in share directory, also can read the file in the share directory.
And user side 20 can link to each other by networks such as internet or local area network (LAN)s with server 22.More preferably, user side 20 also can link to each other by a hub (hub) with server 22, or directly links to each other in the mode of wire jumper (cross over).According to an enforcement example of the present invention, user side 20 is configured in laboratory or the factory building of testing usefulness with server 22, and user side 20 only links to each other to carry out method for testing pressure by hub with server 22.
Next please be simultaneously with reference to Fig. 2, implement the flow chart of example for one of the method for testing pressure of network card of the present invention.
Can see by Fig. 2 and to know that the method for testing pressure of network card can comprise step S30: specify one of these network cards 21; Step S32 a: test file and a policy information are sent to strategy pass on means 24; Step S33: search a strategy according to policy information and pass on table, to obtain a user path and a server path; Step S34:, test file is sent to server by appointed network card according to user path and server path; Step S36: make server that the test file that is transmitted is write server; Step S38: make server send test file to user side according to user path and server path; Step S40: by appointed network card acceptance test file; Step S42: contrast the original test file and the test file of reception; And step S44: output one contrast result.
User side 20 has network card tabulation, and note has a network card title and a network card index of each network card 21 in the table.More preferably, a medium access control address (Media Access Control address, MAC address also is called MAC Address) that comprises each network card 21 in the network card tabulation in addition.
The content of network card tabulation is exemplified below:
The network card title |
The network card index |
The MAC Address of network card |
Eth1 |
|
1 |
00:23:18:66:05:F1 |
Eth2 |
2 |
00:23:18:66:05:F2 |
So in step S30, the middle selection one of a plurality of network cards 21 that can be had by user side 20 is in order to carry out method for testing pressure.Network card 21b is designated in this enforcement example, and the method for testing pressure of network card use network card 21 carries out the transmission between user side 20 and the server 22.Then in step S32, the method for testing pressure of network card sends to strategy with test file and policy information and passes on means 24, sends test file to server 22 to make strategy pass on means 24 according to policy information.Wherein policy information can be incorporated in the test file, and policy information can comprise a routing index of a user path and its correspondence.The user path can comprise an Internet Protocol address (Internet Protocoladdress, IP address also are called the IP address) or the IP network section of user side; More preferably, the user path comprises the MAC Address of this user side.For example, the content of policy information can be [192.168.1.101/00:23:18:66:05:F1,1].
Therefore in the policy information that sends, can specify the network card 21 that this time carries out method for testing pressure by user path and routing index.In more detail, the method for testing pressure of network card passes on means 24 with network card 21b transmission test file by policy information indication strategy.
In addition, above-mentioned test file and policy information can be specified by a tester.In more detail, the tester can specify server 22 to be measured and test file to be transmitted according to the demand of pressure test, obtains the policy information corresponding to server to be measured 22 more in view of the above.In step S33, strategy passes on means to be searched a strategy according to policy information and passes on table, to obtain server path and network card index; And in step S34, strategy passes on means according to the server path that user path in the policy information and inquiry obtain, and via appointed network card test file is sent to server.
After receiving policy information, strategy passes on means 24 and passes on table according to the network card index search strategy of appointment in the policy information.Strategy passes on table to be set up in advance and finishes, and passes on means 24 for strategy and searches.Strategy passes on to be shown to comprise a routing index and a route, and route can comprise server path and network card index.Wherein server path can comprise the IP address or the IP network section of server; More preferably, server path comprises a connectivity port (port) of server.
Strategy pass on means 24 then and according to 22 of user side 20 and servers from the IP addresses send documents.
Strategy pass on the table content be exemplified below:
Routing index |
Route |
1 |
[192.168.1.100:80,1] |
2 |
[192.168.1.100:80,2] |
By the routing index of appointment in the policy information, can in passing on table, strategy find out corresponding route.Thus, can obtain the network card index, and the MAC Address that need carry out the network card 21 of method for testing pressure.According to network card index and the MAC Address of network card 21b, strategy passes on means 24 and just can specified network card 21b send the work of test file, but not is sent by default network card 21a.
Strategy passes on table and comprises the IP address or the network segment of server 22, thus strategy pass on means 24 according to this IP address/network segment send documents and give server 22.Thus, pass on the IP address/network segment of corresponding server 22 in the table by change strategy, user side 20 can carry out method for testing pressure with different servers 22, or makes different network card 21 carry out method for testing pressure with different server 22.
Pass on the information that provided of table according to policy information and strategy, strategy passes on means 24 and just can obtain IP address/network segment of appointed network card 21b and MAC Address as the user side path.Relative, server path comprises the connectivity port of the IP address/network segment and the server 22 of server 22.
If user side 20 directly links to each other for (by hub or wire jumper) with server 22, or be configured in the same district net, user side 20 can obtain the MAC Address of server 22 by the network mechanism of broadcasting packages.But the MAC Address of server network card can be built in strategy in the lump with the IP address of server 22 passes in the table, to save the time of the MAC Address of seeking server.
After obtaining user path and server path, strategy passes on means 24 and by appointed network card 21b test file is transmitted and give server 22.With Internet Protocol, when user side 20 transmission test files gave server 22, user side 20 was a source end (source), and server is a destination (destination).Strategy passes on means 24 according to user path and server path, the network package that includes test file can be sent to server 22 to meet the Internet Protocol mode.
After server 22 was received test file, S36 write share directory with test file in step.Then in step S38, server 22 is according to user path and server path, reads the test file that writes in step S36 and sends to user side 20.Server 22 can be resolved network package that user side 20 transmits obtaining user path and server path, and with the MAC Address of the appointed network card 21b of user side 20 test file is sent to appointed network card 21b.And when server 22 transmission test files gave user side 20, this moment, user side 20 was a destination, and server 22 sides are the source end.
Then in step S40, the method for testing pressure of network card (user side 20) is from appointed network card 21b acceptance test file.Thus, can avoid user side 20, and make the situation that other network card 21 is not utilized all with default network card 21a transceive data.
The method for testing pressure of network card compares test file originally in step S42 with the test file that receives in step S40, to confirm online whether normal between above-mentioned user side 20 and the server 22.If comparing result is identical, then the method for testing pressure of network card can be in step S44 output " correctly " result as a comparison; Then exportable otherwise " mistake " be the result as a comparison.
And according to an enforcement example of the present invention, the method for testing pressure of network card can repeat above-mentioned steps, whether can bear the lot of data accessing operation with test particular network card, or whether performance significantly decreases in the test process.In addition, implement example according to of the present invention another, the method for testing pressure of network card repeats pressure test to different network cards, to reach required network card coverage rate and pressure test.
In sum, can specify arbitrary network card to carry out pressure test by policy information according to the method for testing pressure of the network card of enforcement example of the present invention.The method for testing pressure of network card is specified the network card of desiring to test, and sends policy information and give strategy and pass on means to inform appointed network card.Strategy passes on means to be searched built-in strategy according to policy information and passes on table, obtain user path and server path after, and network card transmission data that can be by appointment are between user side and server.Thus, user side can use arbitrary network card to carry out transceive data carrying out pressure test, and solves the problem of the network card coverage rate deficiency of traditional method of testing.