CN101931564A - Method and system for testing protocol anomaly, test device and control device - Google Patents

Method and system for testing protocol anomaly, test device and control device Download PDF

Info

Publication number
CN101931564A
CN101931564A CN200910087922XA CN200910087922A CN101931564A CN 101931564 A CN101931564 A CN 101931564A CN 200910087922X A CN200910087922X A CN 200910087922XA CN 200910087922 A CN200910087922 A CN 200910087922A CN 101931564 A CN101931564 A CN 101931564A
Authority
CN
China
Prior art keywords
message
under test
equipment under
equipment
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN200910087922XA
Other languages
Chinese (zh)
Other versions
CN101931564B (en
Inventor
邱国平
杨敬腾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Digital Technologies Chengdu Co Ltd
Original Assignee
Huawei Symantec Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Symantec Technologies Co Ltd filed Critical Huawei Symantec Technologies Co Ltd
Priority to CN200910087922XA priority Critical patent/CN101931564B/en
Publication of CN101931564A publication Critical patent/CN101931564A/en
Application granted granted Critical
Publication of CN101931564B publication Critical patent/CN101931564B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a system for testing protocol anomaly, a test device and a control device. The method comprises the following steps: acquiring test information which comprises a name of a message to be tested and an abnormal field value; using a message corresponding to the name of the message to be tested to conduct message negotiation with a tested device, wherein the message comprises the abnormal field value, and the tested device and a testing device are similar devices; and inquiring the work state of the tested device after the message negotiation to obtain a test result. By the embodiment of the invention, the development cost can be reduced and the development time can be lowered, thereby enabling the tested negotiated message to be more comprehensive.

Description

Protocol anomaly method of testing and system, testing equipment and control appliance
Technical field
The present invention relates to the network communications technology, particularly a kind of protocol anomaly method of testing and system, testing equipment and control appliance.
Background technology
When utilizing internet communication; communication failure appears sometimes; these faults have greatly because safety product healthy and strong inadequately causing aspect protocol processes; for example; after the equipment that is provided with a certain safety product receives external exception message; judge and defencive function if this safety product lacks legitimacy, then cause restarting or the key function inefficacy of this equipment probably.And restart or the lost efficacy problem cause of key function fatal often, very big to user's harmfulness, company's product is caused extremely bad negative effect.Therefore, the protocol anomaly test has vital status in the safety product test.Present protocol anomaly testing scheme comprises the Software Testing Tool that adopts special-purpose hardware testing equipment or special use.
Existing special-purpose hardware testing equipment or special-purpose Software Testing Tool are to carry out message negotiation by this special-purpose hardware testing equipment or the PC and the equipment under test that are mounted with special-purpose Software Testing Tool, testing equipment or PC are implanted exceptional value and are sent in the negotiation packet of equipment under test, and the state by equipment under test in the message negotiation process (operate as normal or restart etc.) is known test result.
Because the drive end of message negotiation and the protocol status of Partner must be consistent, otherwise can't be by carrying out message negotiation, need exploitation and maintenance agreement state machine in the therefore existing special test equipment (as drive end), can different equipment under tests being tested, and the development agreement state machine needs higher development cost and construction cycle.Simultaneously, can only initiate message negotiation as drive end owing to testing equipment in the prior art, exceptional value (field value) can only be implanted in the negotiation packet that sends to equipment under test and be tested, test in the response message and exceptional value can not be implanted, therefore, tested message is not comprehensive yet, influences test mass.
Summary of the invention
The embodiment of the invention provides a kind of protocol anomaly method of testing and system, testing equipment and control appliance, has reduced testing cost, has improved test mass.
The embodiment of the invention provides a kind of protocol anomaly method of testing, comprising:
Obtain detecting information, described detecting information comprises message name to be measured and exception field value;
With carrying out message negotiation with corresponding message of described message name to be measured and equipment under test, include described exception field value in the described message, described equipment under test and testing equipment are same category of device;
Operating state behind the inquiry equipment under test message negotiation obtains test result.
The embodiment of the invention also provides a kind of protocol anomaly method of testing, comprising:
Send detecting information to testing equipment, described detecting information comprises message name to be measured and exception field value;
Control described testing equipment and equipment under test and use with the corresponding message of described message name to be measured and carry out message negotiation, include described exception field value in the described message, described equipment under test and testing equipment are same category of device;
Operating state behind the inquiry equipment under test message negotiation is obtained test result.
The embodiment of the invention provides a kind of testing equipment, comprising:
Receiver module is used to obtain detecting information, and described detecting information comprises message name to be measured and exception field value;
The message negotiation module is used to carry out message negotiation with corresponding message of described message name to be measured and equipment under test, includes described exception field value in the described message, and described equipment under test and testing equipment are same category of device;
The test result acquisition module, the operating state behind the inquiry equipment under test message negotiation obtains test result.
The embodiment of the invention provides a kind of control appliance, comprising:
Sending module is used for sending detecting information to testing equipment, and described detecting information comprises message name to be measured and exception field value;
Control module is used to control described testing equipment and equipment under test and uses with the corresponding message of described message name to be measured and carry out message negotiation, includes described exception field value in the described message, and described equipment under test and testing equipment are same category of device;
Acquisition module as a result is used to inquire about the operating state behind the equipment under test message negotiation, obtains test result.
The embodiment of the invention provides a kind of protocol anomaly test macro, comprises equipment under test, testing equipment and control appliance, wherein:
Described control appliance, be used for sending detecting information to described testing equipment, control described testing equipment or equipment under test and initiatively initiate message negotiation process between described testing equipment and the described equipment under test, described detecting information comprises message name to be measured and exception field value;
Described testing equipment, be used to utilize message corresponding and described equipment under test to carry out message negotiation with described message name to be measured, include described exception field value in the described message, and by the operating state behind the inquiry equipment under test message negotiation, know the protocol anomaly test result of equipment under test, described testing equipment is the equipment similar with described equipment under test.
As shown from the above technical solution, in the described method of testing of the embodiment of the invention, send the process that starts message negotiation by control appliance to testing equipment or equipment under test, can make testing equipment or equipment under test initiatively initiate message negotiation, testing equipment can and be sent in the response message of equipment under test at the negotiation packet of issuing equipment under test carry unusual field value, make tested message more comprehensively, improve test mass, the colleague, because testing equipment has identical protocol status with equipment under test, need not to develop again and the maintenance agreement state machine, also reduced testing cost at the testing equipment end.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
The message method for detecting abnormality process schematic diagram that Fig. 1 adopts for prior art based on message negotiation;
The schematic flow sheet of the protocol anomaly method of testing that Fig. 2 provides for the embodiment of the invention one;
The schematic flow sheet of the protocol anomaly method of testing that Fig. 3 provides for the embodiment of the invention two;
The schematic flow sheet of the protocol anomaly method of testing that Fig. 4 provides for the embodiment of the invention three;
The schematic flow sheet of the protocol anomaly method of testing that Fig. 5 provides for the embodiment of the invention four;
The structural representation of the testing equipment that Fig. 6 provides for the embodiment of the invention five;
The structural representation of the control appliance that Fig. 7 provides for the embodiment of the invention six;
The structural representation of the protocol anomaly test macro that Fig. 8 provides for the embodiment of the invention seven.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
Be the clearer description embodiment of the invention, sketch protocol anomaly method of testing of the prior art earlier, as shown in Figure 1, the message method for detecting abnormality process schematic diagram that Fig. 1 adopts for prior art based on message negotiation, as shown in the figure, with based on Point-to-Point Protocol over Ethernet (Point to Point Protocol over Ethernet PPPoE) is example, comprising:
Step 11: drive end sends PPPoE initialization (PPPoE Active Discovery Initiation, PADI) message to Partner.
Step 12: Partner sends the PPPoE service to drive end (PPPoE Active Discovery Offer, PADO) message is provided.
Step 13: drive end sends PPPoE request (PPPoE Active Discovery Request, PADR) message to Partner.
Step 14: Partner sends pppoe session (PPPoE Active Discovery Session-Confirmation, PADS) message to drive end.
In message negotiation process shown in Figure 1, the transmission of subsequent packet and reception must be based upon on the basis of front message reception and transmission, and for example, the transmission of PADR message must receive the PADO message at local terminal (Partner), and just can carry out after successfully handling.Therefore, need set up protocol state machine, be used to judge whether the message of front is successfully handled at drive end and Partner.And in the prior art because testing equipment is just initiated message negotiation as drive end, for example, as shown in Figure 1, exceptional value can only be implanted in PADI message and the PADR message, and exceptional value can not be implanted in PADO message and the PADS message, therefore the message of test is not comprehensive, influences test mass.
To the technical scheme that the embodiment of the invention adopts be described in detail below.
Understand the embodiment of the invention for clearer, briefly set forth earlier the major technique thinking of the embodiment of the invention:
1, employing and equipment under test have the same protocol state equipment as testing equipment, testing equipment need not be developed and the maintenance state protocol machine specially.Concrete, can be with the equipment similar as testing equipment with equipment under test, for example, if equipment under test is a router, then testing equipment is the router similar with this router, the implication of " similar " is that both protocol state machine is identical here.Therefore,, need not development agreement state machine again, can reduce development cost, reduce the construction cycle owing to had the protocol state machine identical in the testing equipment with equipment under test.
2, adopt control appliance control testing equipment or equipment under test initiatively to initiate message negotiation, make testing equipment in issuing the negotiation packet of equipment under test, to implant exceptional value, also can in the response message of the negotiation packet that the response equipment under test sends, implant exceptional value, make test comprehensively.For example, when testing equipment during as drive end, can test PADI message and PADR message, when equipment under test during as drive end, can test PADO message and PADS message, realization can be tested 100% message.
To specifically describe the embodiment of the invention below:
The schematic flow sheet of the protocol anomaly method of testing that Fig. 2 provides for the embodiment of the invention one comprises:
Step 21: testing equipment is obtained detecting information, and described detecting information comprises message name to be measured and exception field value;
Concrete, testing equipment need be obtained detecting information to control appliance.
Step 22: testing equipment is used with corresponding message of described message name to be measured and equipment under test and is carried out message negotiation, includes described exception field value in the described message, and described equipment under test and testing equipment are same category of device;
Particularly, testing equipment can be according to the control command of control appliance, initiatively send and the corresponding negotiation packet of described message name to be measured to described equipment under test, and implant described exception field value in described negotiation packet, promptly the field to be measured in message to be tested is implanted the exception field value.Same, equipment under test also can initiatively be initiated message negotiation according to the control command of control appliance, and then testing equipment can be implanted described exception field in the response message that returns to equipment under test, and described response message is corresponding with described message name to be measured.
In the embodiment of the invention, because testing equipment and equipment under test are same category of device, therefore, testing equipment can provide the protocol status identical with equipment under test easily, and need not to develop again and the maintenance state protocol machine.Concrete, can pass through by equipment that will be similar to transform as testing equipment with equipment under test, make this equipment have the interface of receiving control apparatus order, thereby can make control appliance information to be tested (comprising message to be measured and exception field value) is handed down to testing equipment, and can control the test of testing equipment initiation protocol by command line mode.
Step 23: the operating state behind the testing equipment inquiry equipment under test message negotiation obtains test result.
Specifically comprise: testing equipment sends Query Information to described equipment under test; When in default time range, receiving the response message of the described Query Information that described equipment under test returns, then described equipment under test is working properly, think that promptly described equipment under test through not crashing behind the unusual protocol test, has the ability of keeping out unusual protocol massages, promptly relatively more healthy and stronger; When in default time range, not receiving the response message of the described Query Information that described equipment under test returns, then be considered as described equipment under test through unusual protocol massages test back operation irregularity, the ability of promptly resisting unusual protocol massages is lower, and this equipment is healthy and strong inadequately.
The described method of testing of present embodiment, the protocol status similar with equipment under test can be provided easily, thereby carry out protocol test, and need not to obtain the protocol status similar with different equipment under tests by exploitation with the maintenance agreement state machine, only need carry out certain transformation to equipment under test, make between testing equipment and the control appliance and between equipment under test and the control appliance and can communicate, therefore, can reduce testing cost, reduce the construction cycle that is used to develop special test equipment.And initiatively initiate or the message negotiation process of passive reception and equipment under test by testing equipment, can and send in the response message of equipment under test at the negotiation packet that initiatively sends to equipment under test and carry unusual field value, make more comprehensively, improve test mass the protocol test of equipment under test.
The protocol anomaly method of testing schematic flow sheet that Fig. 3 provides for the embodiment of the invention two, as shown in Figure 3, this process is to describe this test process from the control appliance end, comprising:
Step 31: control appliance sends detecting information to testing equipment, and described detecting information comprises message name to be measured and exception field value.
Concrete, control appliance can be analyzed all fields of all negotiation packets in the agreement to be measured as required, obtains detecting information.Detecting information comprises message name, field name and field value, can also comprise information such as sequence number, action type, fields offset and modification length.Certainly, be understandable that this detecting information also can directly be obtained from extraneous (other equipment) by control appliance.
Step 32: control appliance is controlled described testing equipment and equipment under test and is used with the corresponding message of described message name to be measured and carry out message negotiation, includes described exception field value in the described message, and described testing equipment is the equipment similar with described equipment under test.
Particularly, can be that control appliance sends test command to described testing equipment, control described testing equipment and initiatively send and the corresponding message of described message name to be measured to equipment under test, comprise described exception field value in the described message; Perhaps, also can be that control appliance sends test command to described equipment under test, control described equipment under test and carry out message negotiation to testing equipment transmission message, described testing equipment is returned response message according to detecting information to described equipment under test, this response message is corresponding with described message name to be measured, and in this response message, implant the exception field value, be used to test the defensive ability/resistance ability of equipment under test to this exception message.
Be understandable that, those skilled in the art can know, for equipment that can will be similar with equipment under test as testing equipment, need be to carrying out certain transformation as the equipment of testing equipment, make this equipment have the interface of receiving control apparatus order, thereby can make control appliance information to be tested (comprising message to be measured and exception field value) is handed down to testing equipment, and can control the test of testing equipment initiation protocol by command line mode.
Same, those skilled in the art can know, initiatively initiate message negotiation for the control command that makes equipment under test can accept control appliance, also need equipment under test is transformed, and make it have the communication interface of receiving control apparatus control command.
Step 33: the operating state behind the control appliance inquiry equipment under test message negotiation, obtain test result.
Concrete, control appliance can send Query Information to described equipment under test; When receiving the response message of the described Query Information that described equipment under test returns in default time range, then described equipment under test is working properly; When in default time range, not receiving the response message of the described Query Information that described equipment under test returns, then be considered as described equipment under test through unusual protocol massages test back operation irregularity, the ability of promptly resisting unusual protocol massages is lower, and this equipment is healthy and strong inadequately.
Perhaps, control appliance can also send to described testing equipment obtain the test result order, and the return results that control appliance is inquired about according to described testing equipment after the operating state of described equipment under test is known test result.Particularly, testing equipment receives that control appliance sends obtain the test result order after, send query messages to described equipment under test, when in default time range, receiving the response message of the described Query Information that described equipment under test returns, it is working properly behind the unusual protocol test of process promptly to be considered as described equipment under test, have the ability of keeping out unusual protocol massages, relatively more healthy and stronger; When in default time range, not receiving the response message of the described Query Information that described equipment under test returns, then be considered as described equipment under test operation irregularity behind the unusual protocol test of process, the ability of promptly resisting unusual protocol massages is lower, and this equipment is healthy and strong inadequately.Afterwards, testing equipment sends to control appliance with the test result that inquires.
The equipment of present embodiment by will be similar with equipment under test is as testing equipment, the agreement similar with equipment under test can be provided easily, thereby carry out protocol test, and need not to obtain the protocol status similar with different equipment under tests by exploitation with the maintenance agreement state machine, only need carry out certain transformation to equipment under test, make between testing equipment and the control appliance and between equipment under test and the control appliance and can communicate, therefore, can reduce testing cost, reduce the construction cycle be used to develop special test equipment; And initiatively initiate or the message negotiation process of passive reception and equipment under test by testing equipment, can and send in the response message of equipment under test at the negotiation packet that initiatively sends to equipment under test and carry unusual field value, make more comprehensively, improve test mass the protocol test of equipment under test.
Be the described technical scheme of the clearer description embodiment of the invention, below will be according to message negotiation originating end difference, be described in detail from the angle of whole test system method of testing this unusual agreement.
Fig. 4 is the unusual protocol testing method schematic flow sheet that the embodiment of the invention three provides, and comprising:
Step 401: control appliance starts test.
Step 402: control appliance obtains configuration file, comprises detecting information in this configuration file, and configuration file can read from the external world, also can set in advance in control appliance.
Step 403: control appliance is set up effective test chart according to configuration file, and test chart comprises one or more detecting informations.Detecting information comprises message name, field name and field value, can also comprise following information: sequence number, action type, fields offset and modification length etc.
Protocol massages to be tested and field etc. can be according to the forms shown in the table 1:
Table 1
Figure B200910087922XD0000091
Step 404: control appliance judges whether to have next bar record to be measured according to test chart, and every record comprises message name and field name, if, select this record, execution in step 405 afterwards, otherwise, execution in step 419.
Step 405: control appliance judges whether to exist the next field value of noting to be measured of this selection, promptly can test a plurality of field values of a record, if, select this field value, execution in step 406 afterwards, otherwise, execution in step 419.
In when test, when field value is 1 byte, generally field value is traveled through test (from 0 to 255 all tests), when field value during, can get the centrifugal pumps such as maximum, minimum value and off-limits critical value in the agreement range of normal value greater than 1 byte.When the configuration words segment value, can adopt continuation mode, also can adopt discrete way, for example [00-FF] represents that field is carried out 0 to 255 value travels through test, [00, FF] expression is only tested 0 and 255 values.
Step 406: record that control appliance will be selected and field value (exceptional value) send to testing equipment, and send the triggering test command to testing equipment, trigger testing equipment and initiatively initiate message negotiation.
Above-mentioned message name and field name are made the as a whole loop test that carries out, be understandable that, message name and field name are separately carried out loop test.Promptly can use following steps to substitute above-mentioned step 404-406, comprise: the first step, judge whether to have next message name to be measured, when existing, select this message name, entered for second step afterwards, otherwise, finish test; Second step judged whether to exist the next field name to be measured under the message name of this selection, when existing, selected this field name, entered for the 3rd step afterwards, otherwise, finish test; The 3rd step judged whether to exist the field name next field value to be measured down of this selection, when existing, selected this field value, entered for the 4th step afterwards, otherwise, finish to test; In the 4th step, message name, field name and the field value of selecting all sent to testing equipment.
Step 407: control appliance enters wait state, waits for certain message negotiation time.
Be understandable that this message negotiation time can be provided with according to concrete needs, this message negotiation time is the message negotiation time that testing equipment and equipment under test carry out according to detecting information.
Step 408: testing equipment triggers test according to the triggering test command of control appliance, enters step 409.
Step 409: testing equipment is judged the detecting information the coupling whether negotiation packet of giving equipment under test to be sent and field send with control appliance, if, execution in step 410, otherwise, execution in step 411.
When matching judgment, when negotiation packet is the message of the message name correspondence of control appliance transmission, and when a certain field of this negotiation packet is the field of the field name correspondence that sends of control appliance, show that this negotiation packet and field and detecting information mate, otherwise for not matching.
Step 410: testing equipment is filled in the field value (exceptional value) that control appliance sends in the field of this selection, enters step 411.
Step 411: testing equipment encapsulation negotiation packet.
Concrete, the process of step 409-411 can adopt following judgement code skeleton to carry out:
If(g_iPattMode==ENABLE&&
Strcmp (g_sPattPkg, [concrete message])==0﹠amp; ﹠amp;
Strcmp (g_sPattField, [concrete protocol fields]==0))
{
// protocol encapsulation
// field value the g_sPattFldValue that sends over control appliance replaces
}
Wherein, g_iPattMode: protocol anomaly Test Switchboard (global variable)
G_sPattPkg: when the protocol massages sign (global variable) of Pretesting
G_sPattField: when the protocol fields sign (global variable) of Pretesting
G_sPattFldValue: when the protocol field value (global variable) of Pretesting
Step 412: the negotiation packet after testing equipment will encapsulate sends to equipment under test, and both carry out message negotiation.
Step 413: control appliance obtains the test result order to the testing equipment transmission after wait certain negotiation time (stand-by period of step 407 arrives), enter step 414.
Step 414: testing equipment is obtained the test result order according to this and is sent querying command to equipment under test;
Concrete, this querying command can be the ping order, by the operating state of ping order inquiry equipment under test.
Step 415: testing equipment is obtained test result;
For example, if equipment under test may intactly return the data of ping order when testing equipment adopts the ping order, show that test result is that equipment under test is in normal condition, if the ping utility in the testing equipment is when the return data that waits less than equipment under test, during prompt timeout (timeout) information, then Ci Shi test result is that equipment under test is in and restarts or abnormal state such as reset.
Step 416: testing equipment returns to control appliance with the test result that obtains.
Above-mentioned is that control appliance obtains test result by testing equipment, be understandable that, control appliance also can directly obtain test result from equipment under test, promptly can substitute above-mentioned step 413-416 with following step, comprise: the first step, control appliance sends sense command to equipment under test, for example, and the ping order; Second step, control appliance obtains test result, for example, when adopting the ping order, if receive the data of the complete ping order that equipment under test returns, then obtaining test result is that equipment under test is in normal condition, when the ping utility in the control appliance during at the return data that waits less than equipment under test, during prompt timeout (timeout) information, at this moment obtain test result and be equipment under test and be in and restart or abnormal state such as reset.
Step 417: control appliance is preserved test result, forms daily record or form.This step is optional.
Step 418: control appliance sends clear command to testing equipment, and the indication testing equipment is removed detecting information.Perhaps, control appliance sends display command to testing equipment, and the indication testing equipment shows detecting information etc.This step is optional.
Step 419: finish.
Present embodiment can reduce development cost by adopting the equipment similar with equipment under test as testing equipment, reduces the development time; Adopt control appliance control testing equipment to initiate message negotiation, the negotiation packet on can testing from testing equipment to the equipment under test direction.
The protocol anomaly method of testing schematic flow sheet that Fig. 5 provides for the embodiment of the invention four, this process from control appliance control equipment under test end initiatively the process of initiation protocol test comprise setting forth:
Step 501-505: identical with the step 401-405 in the previous embodiment.
Step 506: record that control appliance will be selected and field value (exceptional value) send to testing equipment.
Step 507: control appliance sends to equipment under test and triggers test command, triggers equipment under test and initiatively initiates message negotiation.
Step 508: control appliance enters wait state, waits for certain negotiation time (configurable).
Step 509: equipment under test sends negotiation packet to testing equipment after receiving and triggering test command, initiates message negotiation.
Step 510: after testing equipment receives the negotiation packet of equipment under test transmission, start testing equipment and carry out the message processing.
Step 511: testing equipment is judged the detecting information the coupling whether response message of giving equipment under test to be sent and field send with control appliance, if, execution in step 512, otherwise, execution in step 513.
When matching judgment, when response message is the message of the message name correspondence of control appliance transmission, and when a certain field of this response message is the field of the field name correspondence that sends of control appliance, show that this response message and field and detecting information mate, otherwise for not matching.Specifically can adopt the judgment mode of the step 409-411 in the described enforcement of Fig. 4.
Step 512-521: identical with the step 410-419 of second embodiment.
Present embodiment can reduce development cost by adopting the equipment similar with equipment under test as testing equipment, reduces the development time; Adopt control appliance control equipment under test to initiate message negotiation, the response message of the negotiation packet on can testing from equipment under test to the testing equipment direction.
Be understandable that those skilled in the art can know that in the above-described embodiments, control appliance can pass through command line mode, perhaps,, the detecting information of selecting sent to testing equipment by socket (socket) mode.
Concrete, when adopting command line mode, because testing equipment needs the order of receiving control apparatus and detecting information etc., therefore, testing equipment needs to carry out the order line transformation and has the protocol anomaly code to implant function on the basis similar with equipment under test:
1, order line transformation
Transform for the testing equipment order line, require control appliance to issue by the protocol fields that order line will be tested in the testing equipment, requiring provides to issue orders:
The order of protocol anomaly test control switch, described control switch order be used to control described testing equipment start-stop test, and specific code can be as [undo] patt enable
Protocol anomaly test field configuration clear command, described clear command be used to control described testing equipment and remove the test detecting information that obtains, and specific code can be as patt clear
Protocol anomaly test field configuration display command, described display command be used to control described testing equipment and show the test detecting information that obtains, and specific code can be as patt display
The order of concrete protocol anomaly test field configuration distributing is used to issue detecting information, specific code can as:
Patt pppoe<sequence number〉<action type〉<message name〉<field name〉<fields offset〉<modification length〉<field value 〉.
2, the protocol anomaly code is implanted
According to concrete agreement, in the encapsulation process of protocol negotiation message, implant abnormality code, need to check whether the protocol anomaly Test Switchboard is opened, and checks then whether negotiation packet and protocol fields mate, the eligible exceptional value of carrying out encapsulates.Its basic framework can for:
If(g_iPattMode==ENABLE&&
Strcmp (g_sPattPkg, [concrete message])==0﹠amp; ﹠amp;
Strcmp (g_sPattField, [concrete protocol fields]==0))
{
// protocol encapsulation
// field value the g_sPattFldValue that sends over control appliance replaces
}
Wherein, g_iPattMode: protocol anomaly Test Switchboard (global variable)
G_sPattPkg: when the protocol massages sign (global variable) of Pretesting
G_sPattField: when the protocol fields sign (global variable) of Pretesting
G_sPattFldValue: when the protocol field value (global variable) of Pretesting
The structural representation of the testing equipment that Fig. 6 provides for the embodiment of the invention five comprises receiver module 61, message negotiation module 62 and test result acquisition module 63.Wherein:
Receiver module 61 is used to obtain detecting information, and described detecting information comprises message name to be measured and exception field value;
Message negotiation module 62 is used to carry out message negotiation with corresponding message of described message name to be measured and equipment under test, includes described exception field value in the described message, and described equipment under test and testing equipment are same category of device;
Test result acquisition module 63, the operating state behind the inquiry equipment under test message negotiation obtains test result.
Further, receiver module 61 also is used for the test command of receiving control apparatus.Message negotiation module 62 comprises transmitting element and exception field implantation unit, wherein:
Transmitting element 621 is used for initiatively sending and the corresponding negotiation packet that comprises described exception field value of described message name to be measured to equipment under test according to the test command that described receiver module 61 receives; Perhaps, be used to return the response message of the negotiation packet that described equipment under test sends, described response message is corresponding with described message name to be measured, comprises described exception field value in the described response message;
Exception field is implanted unit 622, the exception field value that is used for detecting information that described receiver module 61 is received implant with corresponding negotiation packet of described message name to be measured or described response message in.
The equipment of present embodiment by will be similar with equipment under test is as testing equipment, the agreement similar with equipment under test can be provided easily, thereby carry out protocol test, and need not to obtain the protocol status similar with different equipment under tests by exploitation with the maintenance agreement state machine, only need carry out certain transformation to equipment under test, make between testing equipment and the control appliance and between equipment under test and the control appliance and can communicate, therefore, can reduce testing cost, reduce the construction cycle be used to develop special test equipment; And initiatively initiate or the message negotiation process of passive reception and equipment under test by testing equipment, can and send in the response message of equipment under test at the negotiation packet that initiatively sends to equipment under test and carry unusual field value, make more comprehensively, improve test mass the protocol test of equipment under test.
The structural representation of the control appliance that Fig. 7 provides for the embodiment of the invention six comprises sending module 71, control module 72 and acquisition module 73 as a result.Wherein:
Sending module 71 is used for sending detecting information to testing equipment, and described detecting information comprises message name to be measured and exception field value;
Control module 72 is used to control described testing equipment and equipment under test and uses with the corresponding message of described message name to be measured and carry out message negotiation, includes described exception field value in the described message, and described testing equipment is the equipment similar with described equipment under test;
Acquisition module 73 as a result, are used to inquire about the operating state behind the equipment under test message negotiation, obtain test result.
Particularly, control module 72 comprises first control unit and second control unit, wherein:
First control unit 721 is used for sending test command to described testing equipment, controls described testing equipment and initiatively sends and the corresponding message of described message name to be measured to equipment under test, comprises described exception field value in the described message;
Second control unit 722, be used for sending test command to described equipment under test, control described equipment under test and send message to testing equipment, described testing equipment is corresponding with described message name to be measured to the response message that described equipment under test returns, and comprises described exception field value in the described response message.
Concrete, acquisition module 73 comprises operating state query unit and test result acquiring unit as a result, wherein:
Operating state query unit 731 is used for sending Query Information to described equipment under test;
Test result acquiring unit 732 is used for determining that described equipment under test is working properly when receiving the response message of the described Query Information that described equipment under test returns in default time range; When in default time range, not receiving the response message of the described Query Information that described equipment under test returns, determine described equipment under test operation irregularity.
Be understandable that, operating state query unit 731 can also be used for sending Query Information to described testing equipment, and then the result that this moment, test result acquiring unit 732 can directly return after described equipment under test is inquired about according to described testing equipment obtains test result.Specifically can repeat no more referring to previous embodiment herein.
Present embodiment can reduce development cost by adopting the equipment similar with equipment under test as testing equipment, reduces the development time; Adopt control appliance control testing equipment or equipment under test to initiate message negotiation, the negotiation packet that can make test more comprehensively.
The structural representation of the protocol anomaly test macro that Fig. 8 provides for the embodiment of the invention seven comprises equipment under test 81, testing equipment 82 and control appliance 83.Wherein:
Control appliance 83, be used for sending detecting information to described testing equipment 82, control described testing equipment 82 or equipment under test 81 and initiatively initiate message negotiation process between described testing equipment 82 and the described equipment under test 81, described detecting information comprises message name to be measured and exception field value;
Testing equipment 82, be used to utilize message corresponding and described equipment under test 81 to carry out message negotiation with described message name to be measured, include described exception field value in the described message, and by the operating state behind the inquiry equipment under test message negotiation, know the protocol anomaly test result of equipment under test, described testing equipment 82 is the equipment similar with described equipment under test 81.
Concrete, testing equipment 82 can comprise the order line module, described order line module is used for the detecting information that receiving control apparatus 83 sends by command line mode; Perhaps, testing equipment 82 comprises the demons module, and described demons module is used for the detecting information that receiving control apparatus 83 sends by socket (socket) mode.On communication modes, control appliance 83 can pass through serial ports, telecommunication network (Telnet) or containment, and (Secure Shell, SSH) mode is connected with testing equipment 82 or with equipment under test 81.
In some cases, for example, only be provided with the card of throwing the net in the control appliance 83, in order to realize communicating by letter of control appliance and two equipment (testing equipment and equipment under test), switch need be set, this switch is connected with described equipment under test, testing equipment and control appliance, is used to make described equipment under test to communicate by letter with control appliance with control appliance and described testing equipment.
Present embodiment can reduce development cost by adopting the equipment similar with equipment under test as testing equipment, reduces the development time; Adopt control appliance control testing equipment or equipment under test to initiate message negotiation, the negotiation packet that can make test more comprehensively.
When utilizing special test equipment to test in the prior art, need realize complete protocol state machine according to actual needs, make testing equipment consistent with the protocol status of equipment under test, therefore, the agreement of knowing equipment under test that need be perfectly clear realizes details, and exploitation corresponding protocol state machine, can increase difficulty of test and size of code undoubtedly, will certainly increase construction cycle and development cost and personnel and drop into.And in the above-described embodiments, because testing equipment is to be formed by similar equipment under test transformation, more convenient realization consistent with the equipment under test protocol status, therefore do not need other development agreement state machine, protocol state machine safeguards that by equipment itself development difficulty reduces greatly, only need carry out the implantation of order line transformation and protocol anomaly code gets final product, thereby the quickening development progress shortens the construction cycle, reduces development cost.And the foregoing description can realize that testing equipment initiatively initiates message test process and the passive message test process that carries out of testing equipment, realizes negotiation packet comprehensive of test.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of program command, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, FLASH, magnetic disc or CD.
It should be noted that at last: above embodiment is only in order to technical scheme of the present invention to be described but not limit it, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that: it still can make amendment or be equal to replacement technical scheme of the present invention, and these modifications or be equal to replacement and also can not make amended technical scheme break away from the spirit and scope of technical solution of the present invention.

Claims (13)

1. a protocol anomaly method of testing is characterized in that, comprising:
Obtain detecting information, described detecting information comprises message name to be measured and exception field value;
With carrying out message negotiation with corresponding message of described message name to be measured and equipment under test, include described exception field value in the described message, described equipment under test and testing equipment are same category of device;
Operating state behind the inquiry equipment under test message negotiation obtains test result.
2. protocol anomaly method of testing according to claim 1 is characterized in that, described using carried out message negotiation with corresponding message of described message name to be measured and equipment under test and comprised:
According to the control command of control appliance, send and the corresponding negotiation packet of described message name to be measured to described equipment under test;
Perhaps
Return the response message of the negotiation packet of described equipment under test transmission, described response message is corresponding with described message name to be measured.
3. protocol anomaly method of testing according to claim 1 is characterized in that, the operating state behind the described inquiry equipment under test message negotiation obtains test result and comprises:
Send Query Information to described equipment under test;
When receiving the response message of the described Query Information that described equipment under test returns in default time range, then described equipment under test is working properly;
When in default time range, not receiving the response message of the described Query Information that described equipment under test returns, then described equipment under test operation irregularity.
4. a protocol anomaly method of testing is characterized in that, comprising:
Send detecting information to testing equipment, described detecting information comprises message name to be measured and exception field value;
Control described testing equipment and equipment under test and use with the corresponding message of described message name to be measured and carry out message negotiation, include described exception field value in the described message, described equipment under test and testing equipment are same category of device;
Operating state behind the inquiry equipment under test message negotiation is obtained test result.
5. according to the described method of claim 4, it is characterized in that described testing equipment of described control and equipment under test are used and carried out message negotiation with the corresponding message of described message name to be measured and comprise:
Send test command to described testing equipment, control described testing equipment and send and the corresponding message of described message name to be measured to equipment under test; Perhaps
Send test command to described equipment under test, control described equipment under test and send message to testing equipment, described testing equipment is corresponding to response message and described message name to be measured that described equipment under test returns.
6. according to claim 4 or 5 described methods, it is characterized in that the operating state behind the described inquiry equipment under test message negotiation is obtained test result and comprised:
Send Query Information to described equipment under test;
When receiving the response message of the described Query Information that described equipment under test returns in default time range, then described equipment under test is working properly;
When in default time range, not receiving the response message of the described Query Information that described equipment under test returns, then described equipment under test operation irregularity.
7. a testing equipment is characterized in that, comprising:
Receiver module is used to obtain detecting information, and described detecting information comprises message name to be measured and exception field value;
The message negotiation module is used to carry out message negotiation with corresponding message of described message name to be measured and equipment under test, includes described exception field value in the described message, and described equipment under test and testing equipment are same category of device;
The test result acquisition module, the operating state behind the inquiry equipment under test message negotiation obtains test result.
8. testing equipment according to claim 7 is characterized in that described receiver module also is used for the test command of receiving control apparatus;
Described message negotiation module comprises:
Transmitting element is used for initiatively sending and the corresponding negotiation packet that comprises described exception field value of described message name to be measured to equipment under test according to the test command that described receiver module receives; Perhaps, be used to return the response message of the negotiation packet that described equipment under test sends, described response message and described message name to be measured are corresponding, comprise described exception field value in the described response message;
Exception field is implanted the unit, the exception field value that is used for detecting information that described receiver module is received implant with corresponding negotiation packet of described message name to be measured or described response message in.
9. a control appliance is characterized in that, comprising:
Sending module is used for sending detecting information to testing equipment, and described detecting information comprises message name to be measured and exception field value;
Control module is used to control described testing equipment and equipment under test and uses with the corresponding message of described message name to be measured and carry out message negotiation, includes described exception field value in the described message, and described equipment under test and testing equipment are same category of device;
Acquisition module as a result is used to inquire about the operating state behind the equipment under test message negotiation, obtains test result.
10. control appliance according to claim 9 is characterized in that, described control module comprises:
First control unit is used for sending test command to described testing equipment, controls described testing equipment and initiatively sends and the corresponding message of described message name to be measured to equipment under test, comprises described exception field value in the described message;
Second control unit, be used for sending test command to described equipment under test, control described equipment under test and send message to testing equipment, described testing equipment is corresponding with described message name to be measured to the response message that described equipment under test returns, and comprises described exception field value in the described response message.
11. control appliance according to claim 9 is characterized in that, described acquisition module as a result comprises:
The operating state query unit is used for sending Query Information to described equipment under test;
The test result acquiring unit is used for determining that described equipment under test is working properly when receiving the response message of the described Query Information that described equipment under test returns in default time range; When in default time range, not receiving the response message of the described Query Information that described equipment under test returns, determine described equipment under test operation irregularity.
12. a protocol anomaly test macro is characterized in that, comprises equipment under test, testing equipment and control appliance, wherein:
Described control appliance, be used for sending detecting information to described testing equipment, control described testing equipment or equipment under test and initiatively initiate message negotiation process between described testing equipment and the described equipment under test, described detecting information comprises message name to be measured and exception field value;
Described testing equipment, be used to utilize message corresponding and described equipment under test to carry out message negotiation with described message name to be measured, include described exception field value in the described message, and by the operating state behind the inquiry equipment under test message negotiation, know the protocol anomaly test result of equipment under test, described equipment under test and testing equipment are same category of device.
13. system according to claim 12 is characterized in that, described control appliance is connected with described testing equipment and described equipment under test by serial ports, telecommunication network Telnet or containment SSH mode.
CN200910087922XA 2009-06-25 2009-06-25 Method and system for testing protocol anomaly, test device and control device Expired - Fee Related CN101931564B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910087922XA CN101931564B (en) 2009-06-25 2009-06-25 Method and system for testing protocol anomaly, test device and control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910087922XA CN101931564B (en) 2009-06-25 2009-06-25 Method and system for testing protocol anomaly, test device and control device

Publications (2)

Publication Number Publication Date
CN101931564A true CN101931564A (en) 2010-12-29
CN101931564B CN101931564B (en) 2012-07-25

Family

ID=43370498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910087922XA Expired - Fee Related CN101931564B (en) 2009-06-25 2009-06-25 Method and system for testing protocol anomaly, test device and control device

Country Status (1)

Country Link
CN (1) CN101931564B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103116168A (en) * 2013-02-01 2013-05-22 珠海德百祺科技有限公司 Anomaly detecting and processing method and device for navigational positioning devices
CN110958272A (en) * 2015-06-04 2020-04-03 华为技术有限公司 Identity authentication method, identity authentication system and related equipment
CN112416739A (en) * 2019-08-23 2021-02-26 腾讯科技(深圳)有限公司 Test method and device and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6694470B1 (en) * 1999-05-21 2004-02-17 Panasonic Communications Co., Ltd. Retransmission procedure and apparatus for handshaking protocol
JP2004201121A (en) * 2002-12-19 2004-07-15 Ntt Docomo Inc Protocol testing system and protocol testing method
CN1909482A (en) * 2005-08-05 2007-02-07 华为技术有限公司 Method for realizing detection of DHCP service performance
CN100387004C (en) * 2005-11-16 2008-05-07 华为技术有限公司 Protocol testing apparatus and method thereof

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103116168A (en) * 2013-02-01 2013-05-22 珠海德百祺科技有限公司 Anomaly detecting and processing method and device for navigational positioning devices
CN110958272A (en) * 2015-06-04 2020-04-03 华为技术有限公司 Identity authentication method, identity authentication system and related equipment
CN110958272B (en) * 2015-06-04 2021-10-15 华为技术有限公司 Identity authentication method, identity authentication system and related equipment
CN112416739A (en) * 2019-08-23 2021-02-26 腾讯科技(深圳)有限公司 Test method and device and electronic equipment
CN112416739B (en) * 2019-08-23 2023-10-24 腾讯科技(深圳)有限公司 Test method and device and electronic equipment

Also Published As

Publication number Publication date
CN101931564B (en) 2012-07-25

Similar Documents

Publication Publication Date Title
US7801027B2 (en) Auto-negotiation by nodes on an infiniband fabric
CN101447898B (en) Test system used for network safety product and test method thereof
CN1514586B (en) Testing method of data communication equipment of imitating multiuser, multi connection
CN102972070B (en) System and method for using multiple network addresses to establish synchronization of a device under test and test equipment controlling the test
CN103401726A (en) Network path detecting method, device and system
CN104202334B (en) A kind of method and device for establishing network connection
CN101636968A (en) Method for preventing denial of service attacks using transmission control protocol state transition
CN109587005A (en) Connecting detection method, apparatus, computer equipment and readable storage medium storing program for executing
CN105323121B (en) A kind of Network status detection method and device
CN1996898B (en) A system and method for real time detection of the data channel states
CN101141421A (en) Ethernet interface converter
CN102144235B (en) IC chip, signal conditioning package, software module control method, information handling system, information processing method and program
CN106255177A (en) The transmission method of a kind of equipment state and device
CN101931564B (en) Method and system for testing protocol anomaly, test device and control device
CN101217422A (en) A method to test the performance of net mouth
CN108804329A (en) A kind of test system and method for data transfer integrity
CN101212346B (en) Software version management method and device for network element management system
CN110958153A (en) Network transmission rate detection system, method and storage medium
CN101136756B (en) Electric self-checking method, system and BMC chip on network long-range control host machine
US20040143781A1 (en) System and method for non-intrusive loopback testing
CN107592607A (en) A kind of bluetooth equipment complex and its communication means
CN100518097C (en) Simple detection method for GGSN facilities
CN104717109A (en) Simulation testing method and system for wide area network links
CN108307522B (en) Method and device for processing radio bearer, terminal and base station
CN109286575A (en) Message priority configuration method, device and the network equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee

Owner name: HUAWEI DIGITAL TECHNOLOGY (CHENGDU) CO., LTD.

Free format text: FORMER NAME: CHENGDU HUAWEI SYMANTEC TECHNOLOGIES CO., LTD.

CP03 Change of name, title or address

Address after: 611731 Chengdu high tech Zone, Sichuan, West Park, Qingshui River

Patentee after: Huawei Symantec Technologies Co., Ltd.

Address before: High tech Park No. 88 University of Electronic Science and technology of Sichuan province 611731 Chengdu Tianchen Road

Patentee before: Chengdu Huawei Symantec Technologies Co., Ltd.

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120725

Termination date: 20190625

CF01 Termination of patent right due to non-payment of annual fee