CN101931564B - 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
CN101931564B
CN101931564B CN200910087922XA CN200910087922A CN101931564B CN 101931564 B CN101931564 B CN 101931564B CN 200910087922X A CN200910087922X A CN 200910087922XA CN 200910087922 A CN200910087922 A CN 200910087922A CN 101931564 B CN101931564 B CN 101931564B
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.)
Expired - Fee Related
Application number
CN200910087922XA
Other languages
Chinese (zh)
Other versions
CN101931564A (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, and 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 products 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 through 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 through 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 through 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; Can only exceptional value (field value) be implanted in the negotiation packet that sends to equipment under test and test, test in the response message and can not exceptional value be implanted, therefore; Message to be tested 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, said detecting information comprises message name to be measured and exception field value;
Use with corresponding message of said message name to be measured and equipment under test and carry out message negotiation, include said exception field value in the said message, said 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, said detecting information comprises message name to be measured and exception field value;
Control said testing equipment and equipment under test and use with the corresponding message of said message name to be measured and carry out message negotiation, include said exception field value in the said message, said 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 said 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 said message name to be measured and equipment under test, includes said exception field value in the said message, and said 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 said detecting information comprises message name to be measured and exception field value;
Control module is used to control said testing equipment and equipment under test and uses with the corresponding message of said message name to be measured and carry out message negotiation, includes said exception field value in the said message, and said 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:
Said control appliance; Be used for sending detecting information to said testing equipment; Control said testing equipment or equipment under test and initiatively initiate the message negotiation process between said testing equipment and the said equipment under test, said detecting information comprises message name to be measured and exception field value;
Said testing equipment; Be used to utilize message corresponding and said equipment under test to carry out message negotiation with said message name to be measured; Include said exception field value in the said message; And, know the protocol anomaly test result of equipment under test through the operating state behind the inquiry equipment under test message negotiation, said testing equipment is the equipment similar with said equipment under test.
Can know by technique scheme, in the said method of testing of the embodiment of the invention, send the process that starts message negotiation to testing equipment or equipment under test through control appliance; 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 comprehensive, 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 at the testing equipment end, has also reduced testing cost.
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; Obviously, the 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 property, can also obtain other accompanying drawing according to these accompanying drawings.
The message method for detecting abnormality process sketch map 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
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, 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 are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
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 sketch map 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 Protocolover Ethernet PPPoE) is example, comprising:
Step 11: drive end sends PPPoE initialization (PPPoE Active DiscoveryInitiation, PADI) message to Partner.
Step 12: Partner sends the PPPoE service to drive end (PPPoE Active DiscoveryOffer, PADO) message is provided.
Step 13: drive end sends PPPoE request (PPPoE Active DiscoveryRequest, PADR) message to Partner.
Step 14: Partner sends pppoe session (PPPoE Active DiscoverySession-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 it is, for example, as shown in Figure 1 in the prior art because testing equipment is just initiated message negotiation as drive end; Can only exceptional value be implanted in PADI message and the PADR message; And can not exceptional value 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 said 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 said message name to be measured and equipment under test and is carried out message negotiation, includes said exception field value in the said message, and said 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 said message name to be measured to said equipment under test, and in said negotiation packet, implant said exception field value, 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 said exception field in the response message that returns to equipment under test, and said response message is corresponding with said 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 through 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 pass through command line mode 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.
Step 23: the operating state behind the testing equipment inquiry equipment under test message negotiation obtains test result.
Specifically comprise: testing equipment is sent Query Information to said equipment under test; When in preset time range, receiving the response message of the said Query Information that said equipment under test returns; Then said equipment under test is in proper working order; Think that promptly said 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 preset time range, not receiving the response message of the said Query Information that said equipment under test returns; Then be regarded as said 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 the maintenance agreement state machine with different equipment under tests through exploitation; 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 the message negotiation process of perhaps passive reception and equipment under test through 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 the protocol test of equipment under test more comprehensively, improve test mass.
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 said 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, it is understandable that this detecting information also can directly be obtained from extraneous (other equipment) by control appliance.
Step 32: control appliance is controlled said testing equipment and equipment under test and is used with the corresponding message of said message name to be measured and carry out message negotiation, includes said exception field value in the said message, and said testing equipment is the equipment similar with said equipment under test.
Particularly, can be that control appliance sends test command to said testing equipment, control said testing equipment and initiatively send and the corresponding message of said message name to be measured to equipment under test, comprise said exception field value in the said message; Perhaps; Also can be that control appliance sends test command to said equipment under test; Control said equipment under test and carry out message negotiation to testing equipment transmission message, said testing equipment is returned response message according to detecting information to said equipment under test, and this response message is corresponding with said 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.
It is understandable that; Those skilled in the art can know; For equipment that can will be similar with equipment under test as testing equipment, need make this equipment have the interface of receiving control apparatus order to carrying out certain transformation as the equipment of testing equipment; Thereby can make control appliance pass through command line mode 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.
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 transform equipment under test, 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 said equipment under test; When in preset time range, receiving the response message of the said Query Information that said equipment under test returns, then said equipment under test is in proper working order; When in preset time range, not receiving the response message of the said Query Information that said equipment under test returns; Then be regarded as said 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 said testing equipment obtain the test result order, and the return results that control appliance is inquired about according to said testing equipment after the operating state of said 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 said equipment under test, when in preset time range, receiving the response message of the said Query Information that said equipment under test returns, promptly be regarded as said equipment under test through in proper working order behind the unusual protocol test; Have the ability of keeping out unusual protocol massages, relatively more healthy and stronger; When in preset time range, not receiving the response message of the said Query Information that said equipment under test returns; Then be regarded as said 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 through 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 through exploitation with the maintenance agreement state machine, need carry out certain transformation to equipment under test, make between testing equipment and the control appliance and can communicate between equipment under test and the control appliance; Therefore, can reduce testing cost, reduce the construction cycle be used to develop special test equipment; And initiatively initiate the message negotiation process of perhaps passive reception and equipment under test through 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 the protocol test of equipment under test more comprehensively, improve test mass.
Be the described technical scheme of the clearer description embodiment of the invention, below will be different according to the message negotiation originating end, be described in detail from the angle of whole test system method of testing this unusual agreement.
The unusual protocol testing method schematic flow sheet that Fig. 4 provides for the embodiment of the invention three comprises:
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 be arranged in the control appliance in advance.
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
Data item name Content Default value Format description
MODULE_NAME The agreement name Do not have Length is less than 20 arbitrary string
OP Action type “MODIFY” MODIFY/ EXTEND
PACKET_NAME Message name Do not have Length is less than 20 arbitrary string
FLD_NAME Field name Do not have Length is less than 20 arbitrary string
OFFSET Skew 0 Integer more than or equal to 0
LENGTH Length 0 Integer more than or equal to 0
FLD_VALUE Field value Null character string Less than 80
FLD_STEP Step-length 1 Integer more than or equal to 1
REPEAT_NUM Number of repetition 1 Integer more than or equal to 1
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] representes 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, it is 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, got into 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, got into 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, got into for the 4th step afterwards, otherwise, finish to test; In the 4th step, message name, field name and the field value selected are all sent to testing equipment.
Step 407: control appliance gets into wait state, waits for certain message negotiation time.
It is 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, gets into 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 corresponding message of message name that control appliance sends; And when a certain field of this negotiation packet is the corresponding field of the field name 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, gets into 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&&
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), get into 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, through the operating state of ping order inquiry equipment under test.
Step 415: testing equipment is obtained test result;
For example; If equipment under test possibly 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 the test result of this moment 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 through testing equipment; It is understandable that control appliance also can directly obtain test result from equipment under test, promptly can use following step to substitute above-mentioned step 413-416; Comprise: the first step; Control appliance sends sense command to equipment under test, for example, and the ping order; In 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 through 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 gets into 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 corresponding message of message name that control appliance sends; And when a certain field of this response message is the corresponding field of the field name 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 said enforcement of Fig. 4.
Step 512-521: identical with the step 410-419 of second embodiment.
Present embodiment can reduce development cost through 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.
It is 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 is sent to testing equipment through socket (socket) mode.
Concrete, when adopting command line mode, because testing equipment needs order and the detecting information of receiving control apparatus etc., therefore, testing equipment need carry out the order line transformation and have the protocol anomaly code implanting 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 through 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, said control switch order is used to control said testing equipment start-stop test, and specific code can be like [undo] patt enable
Protocol anomaly test field configuration clear command, said clear command be used to control said testing equipment and remove the test detecting information that obtains, and specific code can be like patt clear
Protocol anomaly test field configuration display command, said display command be used to control said testing equipment and show the test detecting information that obtains, and specific code can be like 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 inspection protocol anomaly Test Switchboard whether to open, check 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&&
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 said 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 said message name to be measured and equipment under test, includes said exception field value in the said message, and said 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 said exception field value of said message name to be measured to equipment under test according to the test command that said receiver module 61 receives; Perhaps, be used to return the response message of the negotiation packet that said equipment under test sends, said response message is corresponding with said message name to be measured, comprises said exception field value in the said response message;
Exception field is implanted unit 622, the exception field value of the detecting information that is used for said receiver module 61 is received implant with corresponding negotiation packet of said message name to be measured or said response message in.
The equipment of present embodiment through 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 through exploitation with the maintenance agreement state machine, need carry out certain transformation to equipment under test, make between testing equipment and the control appliance and can communicate between equipment under test and the control appliance; Therefore, can reduce testing cost, reduce the construction cycle be used to develop special test equipment; And initiatively initiate the message negotiation process of perhaps passive reception and equipment under test through 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 the protocol test of equipment under test more comprehensively, improve test mass.
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 said detecting information comprises message name to be measured and exception field value;
Control module 72 is used to control said testing equipment and equipment under test and uses with the corresponding message of said message name to be measured and carry out message negotiation, includes said exception field value in the said message, and said testing equipment is the equipment similar with said 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 said testing equipment, controls said testing equipment and initiatively sends and the corresponding message of said message name to be measured to equipment under test, comprises said exception field value in the said message;
Second control unit 722; Be used for sending test command to said equipment under test; Control said equipment under test and send message to testing equipment, said testing equipment is corresponding with said message name to be measured to the response message that said equipment under test returns, and comprises said exception field value in the said 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 said equipment under test;
Test result acquiring unit 732 is used for when in preset time range, receiving the response message of the said Query Information that said equipment under test returns, confirming that said equipment under test is in proper working order; When in preset time range, not receiving the response message of the said Query Information that said equipment under test returns, confirm said equipment under test operation irregularity.
It is understandable that; Operating state query unit 731 can also be used for sending Query Information to said testing equipment, and the result that then this moment, test result acquiring unit 732 can directly return after said equipment under test is inquired about according to said testing equipment obtains test result.Specifically can repeat no more referring to previous embodiment here.
Present embodiment can reduce development cost through 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, can make the negotiation packet of test more comprehensive.
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 said testing equipment 82; Control said testing equipment 82 or equipment under test 81 and initiatively initiate the message negotiation process between said testing equipment 82 and the said equipment under test 81, said detecting information comprises message name to be measured and exception field value;
Testing equipment 82; Be used to utilize message corresponding and said equipment under test 81 to carry out message negotiation with said message name to be measured; Include said exception field value in the said message; And, know the protocol anomaly test result of equipment under test through the operating state behind the inquiry equipment under test message negotiation, said testing equipment 82 is the equipment similar with said equipment under test 81.
Concrete, testing equipment 82 can comprise the order line module, said order line module is used for the detecting information that receiving control apparatus 83 sends through command line mode; Perhaps, testing equipment 82 comprises the demons module, and said demons module is used for the detecting information that receiving control apparatus 83 sends through socket (socket) mode.On communication modes, control appliance 83 can pass through serial ports, telecommunication network (Telnet) or containment, and (Secure Shell, SSH) mode perhaps is connected with equipment under test 81 with testing equipment 82.
In some cases; For example; Only be provided with the card of throwing the net in the control appliance 83,, switch need be set in order to realize communicating by letter of control appliance and two equipment (testing equipment and equipment under test); This switch is connected with said equipment under test, testing equipment and control appliance, is used to make said equipment under test to communicate by letter with control appliance with control appliance and said testing equipment.
Present embodiment can reduce development cost through 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, can make the negotiation packet of test more comprehensive.
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, therefore with the protocol status of equipment under test; 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 accomplished through the relevant hardware of program command; Aforesaid program can be stored in the computer read/write memory medium; This program 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.
What should explain at last is: above embodiment is only in order to technical scheme of the present invention to be described but not limit it; Although the present invention has been carried out detailed explanation 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, also can not make amended technical scheme break away from the spirit and the scope of technical scheme of the present invention and these are revised or be equal to replacement.

Claims (13)

1. a protocol anomaly method of testing is characterized in that, comprising:
Obtain detecting information, said detecting information comprises message name to be measured and exception field value;
Use with corresponding message of said message name to be measured and equipment under test and carry out message negotiation, include said exception field value in the said message, said equipment under test and testing equipment are same category of device, saidly similarly are meant that both protocol state machines are identical;
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, said using carried out message negotiation with corresponding message of said 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 said message name to be measured to said equipment under test;
Perhaps
Return the response message of the negotiation packet of said equipment under test transmission, said response message is corresponding with said message name to be measured.
3. protocol anomaly method of testing according to claim 1 is characterized in that, the operating state behind the said inquiry equipment under test message negotiation obtains test result and comprises:
Send Query Information to said equipment under test;
When in preset time range, receiving the response message of the said Query Information that said equipment under test returns, then said equipment under test is in proper working order;
When in preset time range, not receiving the response message of the said Query Information that said equipment under test returns, then said equipment under test operation irregularity.
4. a protocol anomaly method of testing is characterized in that, comprising:
Send detecting information to testing equipment, said detecting information comprises message name to be measured and exception field value;
Controlling said testing equipment and equipment under test uses with the corresponding message of said message name to be measured and carries out message negotiation; Include said exception field value in the said message; Said equipment under test and testing equipment are same category of device, saidly similarly are meant that both protocol state machines are identical;
Operating state behind the inquiry equipment under test message negotiation is obtained test result.
5. according to the said method of claim 4, it is characterized in that said testing equipment of said control and equipment under test are used and carried out message negotiation with the corresponding message of said message name to be measured and comprise:
Send test command to said testing equipment, control said testing equipment and send and the corresponding message of said message name to be measured to equipment under test; Perhaps
Send test command to said equipment under test, control said equipment under test and send message to testing equipment, said testing equipment is corresponding to response message and said message name to be measured that said equipment under test returns.
6. according to claim 4 or 5 described methods, it is characterized in that the operating state behind the said inquiry equipment under test message negotiation is obtained test result and comprised:
Send Query Information to said equipment under test;
When in preset time range, receiving the response message of the said Query Information that said equipment under test returns, then said equipment under test is in proper working order;
When in preset time range, not receiving the response message of the said Query Information that said equipment under test returns, then said equipment under test operation irregularity.
7. a testing equipment is characterized in that, comprising:
Receiver module is used to obtain detecting information, and said detecting information comprises message name to be measured and exception field value;
The message negotiation module; Be used to carry out message negotiation with corresponding message of said message name to be measured and equipment under test; Include said exception field value in the said message, said equipment under test and testing equipment are same category of device, saidly similarly are meant that both protocol state machines are identical;
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 said receiver module also is used for the test command of receiving control apparatus;
Said message negotiation module comprises:
Transmitting element is used for initiatively sending and the corresponding negotiation packet that comprises said exception field value of said message name to be measured to equipment under test according to the test command that said receiver module receives; Perhaps, be used to return the response message of the negotiation packet that said equipment under test sends, said response message and said message name to be measured are corresponding, comprise said exception field value in the said response message;
Exception field is implanted the unit, the exception field value of the detecting information that is used for said receiver module is received implant with corresponding negotiation packet of said message name to be measured or said response message in.
9. a control appliance is characterized in that, comprising:
Sending module is used for sending detecting information to testing equipment, and said detecting information comprises message name to be measured and exception field value;
Control module; Being used to control said testing equipment and equipment under test uses with the corresponding message of said message name to be measured and carries out message negotiation; Include said exception field value in the said message; Said equipment under test and testing equipment are same category of device, saidly similarly are meant that both protocol state machines are identical;
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, said control module comprises:
First control unit is used for sending test command to said testing equipment, controls said testing equipment and initiatively sends and the corresponding message of said message name to be measured to equipment under test, comprises said exception field value in the said message;
Second control unit; Be used for sending test command to said equipment under test; Control said equipment under test and send message to testing equipment, said testing equipment is corresponding with said message name to be measured to the response message that said equipment under test returns, and comprises said exception field value in the said response message.
11. control appliance according to claim 9 is characterized in that, said acquisition module as a result comprises:
The operating state query unit is used for sending Query Information to said equipment under test;
The test result acquiring unit is used for when in preset time range, receiving the response message of the said Query Information that said equipment under test returns, confirming that said equipment under test is in proper working order; When in preset time range, not receiving the response message of the said Query Information that said equipment under test returns, confirm said 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:
Said control appliance; Be used for sending detecting information to said testing equipment; Control said testing equipment or equipment under test and initiatively initiate the message negotiation process between said testing equipment and the said equipment under test, said detecting information comprises message name to be measured and exception field value;
Said testing equipment; Be used to utilize message corresponding and said equipment under test to carry out message negotiation with said message name to be measured; Include said exception field value in the said message, and, know the protocol anomaly test result of equipment under test through the operating state behind the inquiry equipment under test message negotiation; Said equipment under test and testing equipment are same category of device, saidly similarly are meant that both protocol state machines are identical.
13. system according to claim 12 is characterized in that, said control appliance is connected with said testing equipment and said equipment under test through 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 CN101931564A (en) 2010-12-29
CN101931564B true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103116168B (en) * 2013-02-01 2015-02-04 珠海德百祺科技有限公司 Anomaly detecting and processing method and device for navigational positioning devices
CN106302353B (en) * 2015-06-04 2020-01-10 华为技术有限公司 Identity authentication method, identity authentication system and related equipment
CN112416739B (en) * 2019-08-23 2023-10-24 腾讯科技(深圳)有限公司 Test method and device and electronic equipment
CN118035199A (en) * 2024-01-12 2024-05-14 湖南国科亿存信息科技有限公司 Nfs server control method and device for preventing read-write abnormality during high availability switching

Citations (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
EP1434386A2 (en) * 2002-12-19 2004-06-30 NTT DoCoMo, Inc. Protocol testing system and protocol testing method
CN1852178A (en) * 2005-11-16 2006-10-25 华为技术有限公司 Protocol testing apparatus and method thereof
CN1909482A (en) * 2005-08-05 2007-02-07 华为技术有限公司 Method for realizing detection of DHCP service performance

Patent Citations (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
EP1434386A2 (en) * 2002-12-19 2004-06-30 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
CN1852178A (en) * 2005-11-16 2006-10-25 华为技术有限公司 Protocol testing apparatus and method thereof

Also Published As

Publication number Publication date
CN101931564A (en) 2010-12-29

Similar Documents

Publication Publication Date Title
CN104202334B (en) A kind of method and device for establishing network connection
CN101931564B (en) Method and system for testing protocol anomaly, test device and control device
CN103401726A (en) Network path detecting method, device and system
CN101141421A (en) Ethernet interface converter
CN102144235B (en) IC chip, signal conditioning package, software module control method, information handling system, information processing method and program
CN104580187B (en) A method of realizing that the external device of different MODULEBUS agreements is interacted with server
CN108270733A (en) A kind of method and system for managing smart machine
CN101262683B (en) A simulation testing system and method for electric modulation antenna protocol software
CN106255177A (en) The transmission method of a kind of equipment state and 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
CN110958153A (en) Network transmission rate detection system, method and storage medium
CN101964923A (en) Configuration system and method for interactive commands
CN102185727B (en) System and method for writing serial numbers to product firmware in batches
CN101212346B (en) Software version management method and device for network element management system
CN102164365A (en) Mobile through ticket simulation test system
CN101072135A (en) Wireless LAN testing method and system
CN103491557B (en) The processing method and processing device of upgrading base station data
CN1996907A (en) Method and device for testing the performance of the route information protocol of the network devices
CN102932208A (en) Site monitoring method and device
CN104717109A (en) Simulation testing method and system for wide area network links
CN102917370A (en) Method, device and system for determining corresponding near-end unit of far-end unit and far-end unit
US20040143781A1 (en) System and method for non-intrusive loopback testing
CN106685600A (en) Method for messaging among work stations within local area network
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