Summary of the invention
The object of the present invention is to provide a kind of in Ethernet switching chip the implementation method of embedded throughput performance test processes engine.
In network environment, do not need another object of the present invention is to the network tester equipment of specialty, embedded throughput performance test processes engine can carry out in the time of at any time need testing network performance in Ethernet switching chip.
Correspondingly, a kind of network equipment of realizing of the present invention disposes the method for installation automatically, comprises the steps:
S10 obtains the data structure of current test session use and when the current sessions time scale expires, externally sends a message, and the message that sends is carried out byte number and bag number statistics;
S20 resolves message, parses message information;
S30 inquires about according to message information, obtains the data structure of test session;
S40 adds up the byte number and the message number of the data message that receives according to the data structure of test session.
As further improvement of the present invention, said S10 specifically may further comprise the steps:
S101 carries out the initialization assignment to throughput performance test processes engine;
S102 waits for overtime expiring of time scale, if there be not overtime expire then to get back to that S102 continues etc. pending, if overtime expire then jump to S103 handle;
S103 judges whether current test session enables, if do not enable, then jumps to S104 and handles, if enable then jump to S105 and handle;
S104 upgrades the index of test session, obtains the index of next test session and gets back to S102 and handle;
S105, acquire the data structure of current test session use and obtain a current time scale variable of this session: the time scale timeout value subtracts 1 to the time scale timeout value;
S106 judges the time scale timeout value, if the current sessions time scale is not yet due, then arrives S107 and handles; If time scale expires, then externally send a message, forward S108 to and handle;
S107, the time scale timeout value in the new session more, and forward S104 to and handle;
S108, the message that needs are sent packages according to configuration, and the message that sends is carried out byte number and bag number statistics, sends to bag forwarding processing engine to message then and handles from the designated port transmission, gets back to S104 after message has sent and handles.
As further improvement of the present invention; In S105, must arrive current another time scale variable of session: the fractional part of time scale; Each Session Time scale expires, and can the fractional part of time scale be added up, when fractional part adds up greater than 65535 the time; Then integer part can be advanced one, and the time scale timeout value that next round is upgraded need add carry digit.
As further improvement of the present invention, said data structure comprises the configuration of test packet, the statistics and the heading of transmitting-receiving message.
As further improvement of the present invention, the longest 64 bytes of said heading.
As further improvement of the present invention, said S40 specifically may further comprise the steps:
Whether S401 can need loopback to judge to message after remote test equipment receives message, if message need be looped back to message source, then changes S402 over to and handles, and handles otherwise forward S403 to;
S402, the source address and the destination address of exchange message, the outbound port of message is the port of the entering of message, delivers to bag to message then and transmits processing engine;
S403 further obtains sequence of message number, receives the data structure of counting messages according to the data structure of test session, carries out the inspection of sequence of message number, and the byte number and the message number that receive data message are added up.
Correspondingly, a kind of throughput performance test processes engine that is embedded in the Ethernet switching chip of the present invention comprises:
The message sending module in order to obtain the data structure that current test session uses and when the current sessions time scale expires, externally to send a message, carries out byte number to the message that sends and adds up with the bag number;
The packet parsing module in order to message is resolved, parses message information;
The queries module in order to inquire about according to message information, obtains the data structure of test session;
Message processing module (MPM) is in order to add up the byte number and the message number of the data message that receives according to the data structure of test session.
As further improvement of the present invention, said message sending module specifically is used for:
Throughput performance test processes engine is carried out the initialization assignment;
Wait for overtime expiring of time scale, if there be not overtime expire then to get back to that this continues in step etc. pending;
If overtime expiring judges then whether current test session enables;
If do not enable, then the index to test session upgrades, and obtains the index of next test session and waits for overtime expiring of time scale;
If enable, acquire the data structure of current test session use and obtain a current time scale variable of this session: the time scale timeout value subtracts 1 to the time scale timeout value;
The time scale timeout value is judged, confirmed whether the current sessions time scale expires;
If the current sessions time scale is not yet due, the time scale timeout value in the new session more then, and the index of test session upgraded;
If time scale expires, then externally send a message, the message that needs are sent packages according to configuration, and the message that sends is carried out byte number and bag number statistics, sends to bag forwarding processing engine to message then and handles from the designated port transmission.
As further improvement of the present invention, said data structure comprises the configuration of test packet, the statistics and the heading of transmitting-receiving message.
As further improvement of the present invention, said message processing module (MPM) specifically is used for:
, remote test equipment can whether need loopback to judge after receiving message to message;
If message need be looped back to message source, then exchange the source address and the destination address of message, the outbound port of message is the port of the entering of message, delivers to bag to message then and transmits processing engine;
If message does not need loopback, then further obtain sequence of message number, receive the data structure of counting messages according to the data structure of test session, carry out the inspection of sequence of message number, the byte number and the message number that receive data message are added up.
The invention has the beneficial effects as follows: the present invention when design based on Ethernet switching chip; Embedded throughput performance test processes engine in Ethernet switching chip; Directly use the embedded instrument of switch when realizing in the Ethernet switch that adopts this exchange chip to form that network throughput carried out performance test and substitute the tester testing equipment of specialty;, can effectively not reduce network administration cost and operation cost to the change of existing network topology.
Embodiment
Below will combine each execution mode shown in the drawings to describe the present invention.But these execution modes do not limit the present invention, and the conversion on the structure that those of ordinary skill in the art makes according to these execution modes, method or the function all is included in protection scope of the present invention.
Throughput performance test environment in an embodiment of the present invention is as shown in Figure 2, does not need the network tester equipment of specialty, tests between Ethernet switch through embedded throughput performance test processes engine.Particularly, the position of embedded throughput performance test processes engine in Ethernet switching chip is as shown in Figure 3, in order to measure the throughput between the InterWorking Equipment.
Throughput is to describe the basic index parameter of network interconnection device.Definition according to throughput can know that throughput has comprised 2 layers of implication: will guarantee that at first any one Frame to be transmitted can both correctly be forwarded to suitable address, its less important transfer capability of giving full play to equipment.An outstanding feature of network development is the quick growth of network link bandwidth, and being reflected on the network interconnection apparatus, network interconnection is exactly the growth of device throughput, with reference to RFC2544 and ITU-T Y.1564, in the test of throughput, note following some:
(1) testing time:,, just can not correctly reflect the handling capacity of equipment if the time is too short because the measurement of Frame throughput is the transfer capability of equipment under the constant load situation.
(2) test granularity: the test granularity is set at and is no more than 1% of theoretical speed.In the design of actual test system, can adopt the granularity of variation, adopt bigger variation granularity to find the probable ranges of throughput fast when just beginning, select for use more small grain size with accurate location then, general many with two fens algorithms.
(3) test frame length: require a series of frame length (64,128,256,512,768,1024,1280,1518 byte) in the regular hour, is tested by certain number.Frame length is more little, and is big more to the test result influence of throughput, otherwise frame length is big more, more little to the test result influence of throughput.Because for the network equipment; Under same bandwidth; The frame length quantity of small data frame more is just big more; The time of these Frame costs of network device processing will be many more so, otherwise the quantity of the big more Frame of frame length is just more little, and the time of these Frame costs of network device processing will fewlyer also just handle more easily so.
It is as shown in Figure 4 that an embodiment of the present invention is embedded in the flow chart of the throughput performance test processes engine implementation method in the Ethernet switching chip, may further comprise the steps:
S10 obtains the data structure of current test session use and when the current sessions time scale expires, externally sends a message, and the message that sends is carried out byte number and bag number statistics;
S20 resolves message, parses message information;
S30 inquires about according to message information, obtains the data structure of test session;
S40 adds up the byte number and the message number of the data message that receives according to the data structure of test session.
The present invention supports a plurality of sessions to carry out the throughput performance test simultaneously; Minimum between each session is given out a contract for a project and is defined as a time scale at interval; If the package processing capability of packet processing engine is the message that each clock cycle can handle 8 bytes; Then sending under the situation of different message lengths, when there was different message length simultaneously in message, 1 needed clock cycle of time scale should be more than or equal to the needed clock cycle of the longest message of length.
Disposing high bandwidth with a business (EVC) below is 10M, is that the message of 64 bytes is treated to example explanation to length under test 100% bandwidth availability ratio.As shown in table 1 below; Core frequency like fruit chip is 200MHZ; Then bandwidth is that 10M and the message that sends 100% bandwidth need 13340 cycles to send a message when chip; The number of supposing the test session of test processes engine support this moment is 16, and the number of the clock cycle of each time scale configuration is 256; Then length is that the time scale number that each session of the test packet of 64 bytes needs is: 13440/16/256=3.28125, and the integer part of sending the time scale number that a message needs this moment is 3; Fractional part is 18432, and (decimal adopts integer representation among this paper, formula: fractional part * 2^16, promptly 18432=0.28125*2^16).
Table 1:
Packet Forwarding Rate under the 1M linear speed situation
Explain:
1) the Packet Forwarding Rate computing formula is under the .1M linear speed situation: 1000*1000/8/ (frame length+12+8), comprise the frame gap of 12 bytes and the lead code of 8 bytes when wherein calculating frame length;
2). the computing formula that reaches the nominated bandwidth throughput in the chip logic is: bag is transmitted number under the core frequency/specific bandwidth of chip; As the core frequency of showing chips is 200MHZ, and then bandwidth is that 10M and the message that sends 100% bandwidth need 13340 cycles to send a message when chip.
The processing logic of the transmission of message is as shown in Figure 5, and concrete handling process is following:
S101 carries out the initialization assignment to throughput performance test processes engine;
S102 waits for overtime expiring of time scale, if there be not overtime expire then to get back to that S102 continues etc. pending, if overtime expire then jump to S103 handle;
S103 judges whether current test session enables, if do not enable, then jumps to S104 and handles, if enable then jump to S105 and handle;
S104 upgrades the index of test session, obtains the index of next test session and gets back to S102 and handle;
S105, acquire the data structure of current test session use and obtain a current time scale variable of this session: the time scale timeout value subtracts 1 to the time scale timeout value;
S106 judges the time scale timeout value, if the current sessions time scale is not yet due, then arrives S107 and handles; If time scale expires, then externally send a message, forward S108 to and handle;
S107, the time scale timeout value in the new session more, and forward S104 to and handle;
S108, the message that needs are sent packages according to configuration, and the message that sends is carried out byte number and bag number statistics, sends to bag forwarding processing engine to message then and handles from the designated port transmission, gets back to S104 after message has sent and handles.
In S105, must arrive another current time scale variable of session: the time scale fractional part.It should be noted that each Session Time scale expires, can the fractional part of time scale be added up that when fractional part adds up greater than 65535 the time, then integer part can be advanced one; Then the time scale timeout value of next round renewal need add carry digit.
In addition, the data structure that obtains among the S105 comprises the configuration of test packet, the statistics and the heading of transmitting-receiving message.Heading can be specified by the user, the longest 64 bytes.
In the throughput performance test environment; If what network was carried out is the test of one-way flow; Then after the test port of remote test equipment was received this message, bag was transmitted processing engine and is delivered to throughput performance test processes engine to test packet according to the characteristic of message; If network is carried out the test of bidirectional traffics; Then the test port of remote test equipment need carry out loopback to message after receiving this message; Deliver to the test port of local test equipment once more when message; Bag is transmitted and is delivered to throughput performance test processes engine to test packet according to the characteristic of message after processing engine is received message, and it is as shown in Figure 6 that throughput performance test processes engine receives the message process chart:
Bag is transmitted processing engine and is delivered to throughput performance test processes engine to test packet according to the characteristic of message;
Carry out packet parsing, parse the information of message, like information such as MacDa, MacSa, Vlan ID, i.e. S20 step;
Carry out the inquiry of test session according to the information of message and the information of message entry port (like the keyword of port id+Vlan ID), obtain the data structure of test session, i.e. the S30 step as inquiry;
Next be the concrete steps of S40:
Whether S401 can need loopback to judge to message after remote test equipment receives message, if message need be looped back to message source, then changes S402 over to and handles, and handles otherwise forward S403 to;
S402, the source address and the destination address of exchange message, the outbound port of message is the port of the entering of message, delivers to bag to message then and transmits processing engine;
S403 further obtains sequence of message number, receives the data structure of counting messages according to the data structure of test session, carries out the inspection of sequence of message number, and the byte number and the message number that receive data message are added up.
At last, bag forwarding processing engine sends message according to message outbound port information from network interface.
The composition module map of embedded throughput performance test processes engine is as shown in Figure 7 in an embodiment of the present invention, comprising:
The message sending module in order to obtain the data structure that current test session uses and when the current sessions time scale expires, externally to send a message, carries out byte number to the message that sends and adds up with the bag number;
The packet parsing module in order to message is resolved, parses message information;
The queries module in order to inquire about according to message characteristic, obtains the data structure of test session;
Message processing module (MPM) is in order to add up the byte number and the message number of the data message that receives according to the data structure of test session.
Above-mentioned message sending module specifically is used for:
Throughput performance test processes engine is carried out the initialization assignment;
Wait for overtime expiring of time scale, if there be not overtime expire then to get back to that this continues in step etc. pending;
If overtime expiring judges then whether current test session enables;
If do not enable, then the index to test session upgrades, and obtains the index of next test session and waits for overtime expiring of time scale;
If enable, acquire the data structure of current test session use and obtain a current time scale variable of this session: the time scale timeout value subtracts 1 to the time scale timeout value;
The time scale timeout value is judged, confirmed whether the current sessions time scale expires;
If the current sessions time scale is not yet due, the time scale timeout value in the new session more then, and the index of test session upgraded;
If time scale expires, then externally send a message, the message that needs are sent packages according to configuration, and the message that sends is carried out byte number and bag number statistics, sends to bag forwarding processing engine to message then and handles from the designated port transmission.
In addition, above-mentioned message processing module (MPM) specifically is used for:
, remote test equipment can whether need loopback to judge after receiving message to message;
If message need be looped back to message source, then exchange the source address and the destination address of message, the outbound port of message is the port of the entering of message, delivers to bag to message then and transmits processing engine;
If message does not need loopback, then further obtain sequence of message number, receive the data structure of counting messages according to the data structure of test session, carry out the inspection of sequence of message number, the byte number and the message number that receive data message are added up.
The present invention when design based on Ethernet switching chip; Embedded throughput performance test processes engine in Ethernet switching chip; Directly use the embedded instrument of switch when realizing in the Ethernet switch that adopts this exchange chip to form that network throughput carried out performance test and substitute the tester testing equipment of specialty;, can effectively not reduce network administration cost and operation cost to the change of existing network topology.
In addition; The present invention is combining RFC2544 and ITU-T Y.1564 after the standard; Can do flexible configuration and reach test request testing time, test granularity, test frame length; The number that the bandwidth that the user of chip can calculate current frame length that needs test and test on the testing time disposes required transmission message reaches accurate testing time configuration, and the testing time also can be controlled by CPU simultaneously; Aspect the test granularity; The present invention program can reach test request to message of what time cycles transmission according to current test frame length and current test bandwidth accurate Calculation; As ITU-T Y.1564 a business (EVC) to dispose high bandwidth be 10M; Need be that the message of 64 bytes is done the maximum throughput test under this business to length, then 13340 clock cycle of configurable one-tenth be sent a message under test 100% bandwidth availability ratio; Rectangular of test frame, the frame length that the user can the nominative testing message, the present invention simultaneously also supports following function:
1). can test the test packet that defines multiple load type;
2). can in test packet, add sequence number;
3). support a plurality of sessions to carry out performance test simultaneously;
4). message supports to be configured to loopback mode when receiving terminal, message with switching purpose address and source address then the loopback transmitting terminal;
5). definable data of different types message is tested, as the user can self-defined ITU-T Y.1731 ETH-LB and ETH-TST network is carried out the testing throughput of one-way flow or bidirectional traffics according to standard Y.1731.
For the convenience of describing, be divided into various unit with function when describing above system and describe respectively.Certainly, when implementing the application, can in same or a plurality of softwares and/or hardware, realize the function of each unit.
Description through above execution mode can know, those skilled in the art can be well understood to the application and can realize by the mode that software adds essential general hardware platform.Based on such understanding; The part that the application's technical scheme contributes to prior art in essence in other words can be come out with the embodied of software product; This computer software product can be stored in the storage medium, like ROM/RAM, magnetic disc, CD etc., comprises that some instructions are with so that a computer equipment (can be a personal computer; Server, the perhaps network equipment etc.) carry out the described method of some part of each execution mode of the application or execution mode.
System implementation mode described above only is schematic; Wherein said unit as the separating component explanation can or can not be physically to separate also; The parts that show as the unit can be or can not be physical locations also; Promptly can be positioned at a place, perhaps also can be distributed on a plurality of NEs.Can realize the purpose of this execution mode scheme according to the needs selection some or all of module wherein of reality.Those of ordinary skills promptly can understand and implement under the situation of not paying creative work.
The application can be used for numerous general or special purpose computingasystem environment or configuration, or in the communication equipment.For example: personal computer, server computer, handheld device or portable set, plate equipment, multicomputer system, the system based on microprocessor, set top box, programmable consumer-elcetronics devices, network PC, minicom, mainframe computer, comprise DCE of above any system or equipment or the like.
The application can describe in the general context of the computer executable instructions of being carried out by computer, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract, program, object, assembly, data structure or the like.Also can in DCE, put into practice the application, in these DCEs, by through communication network connected teleprocessing equipment execute the task.In DCE, program module can be arranged in this locality and the remote computer storage medium that comprises memory device.
Be to be understood that; Though this specification is described according to execution mode; But be not that each execution mode only comprises an independently technical scheme, this narrating mode of specification only is for clarity sake, and those skilled in the art should make specification as a whole; Technical scheme in each execution mode also can form other execution modes that it will be appreciated by those skilled in the art that through appropriate combination.
The listed a series of detailed description of preceding text only is specifying to feasibility execution mode of the present invention; They are not in order to restriction protection scope of the present invention, allly do not break away from equivalent execution mode or the change that skill of the present invention spirit done and all should be included within protection scope of the present invention.