Summary of the invention
The objective of the invention is to, the integrated test facility of a kind of NUD is provided, can realize the automatic test of NUD.
Another object of the present invention is to, the comprehensive test device of a kind of NUD is provided, can realize the automatic test of NUD.
The integrated test facility of NUD of the present invention; According to selecting any status change in NUD first to the tenth status change is tested automatically; Perhaps said ten status changes are tested successively automatically, wherein, first status change is: from EMPTY to INCOMPLETE; Second status change is: from EMPTY to STALE; Third state transition are: from EMPTY to INCOMPLETE to REACHABLE; The four condition transition are: from REACHABLE to STALE; The 5th status change is: from REACHABLE to STALE; The 6th status change is: from STALE to DELAY; The 7th status change is: from DELAY to PROBE; The 8th status change is: from DELAY to REACHABLE; The 9th status change is: from PROBE to REACHABLE; The tenth status change is: from PROBE to EMPTY.
Wherein, for said first status change, comprise the following steps:
1a, check that equipment under test 1 current neighbor table state is EMPTY;
1b, equipment under test 1 send NS address resolution message to link-local, and wherein, said NS address resolution message comprises: IPv6 destination address and purpose link layer address;
1c, when sending said message, check equipment under test 1 neighbor table corresponding address item information, comprising: the IPv6 destination address of this equipment under test and purpose link layer address;
1d, check that corresponding address item state is INCOMPLETE;
1e, repeat to send identical NS address resolution message pre-determined number, do not receive that any NA message responds, it is overtime promptly to send NS;
1f, check equipment under test 1 current neighbor table state, the corresponding address item of before being set up is deleted.
Wherein, for said second status change, comprise the following steps:
2a, check equipment under test 2 current neighbor table states, state is EMPTY;
2b, equipment under test 1 send NS address resolution message to link-local;
2c, equipment under test 2 are received this NS address resolution message for the first time;
2d, when receiving message, check equipment under test 2 neighbor table corresponding address item information, comprising: the IPv6 destination address of this equipment under test and purpose link layer address;
2e, check equipment under test 2 current neighbor table states, corresponding address item state is STALE.
Wherein, for said third state transition, comprise the following steps:
3a, the said testing procedure 1a-1d of execution;
3b, equipment under test 2 send the NA message to equipment under test 1, and the constructing variable of this NA message is: ICMPv6 request marks=1;
3c, equipment under test 1 receive that the NA that equipment under test 2 sends replys message;
3d, when receiving message, check that equipment under test 1 neighbor table corresponding address item state is REACHABLE.
Wherein, for said four condition transition, comprise the following steps:
4a, the said testing procedure 3a-3d of execution;
The REACHABLE_TIME of 4b, equipment under test 1 neighbor table can reach timer and set timing time, can reach timer and begin countdown;
4c, reaching in the time that timer sets, do not receive accessibility confirmatory message about equipment under test 2;
4d, check that equipment under test 1 neighbor table corresponding address item state is STALE.
Wherein, for said the 5th status change, comprise the following steps:
5a, the said testing procedure 3a-3d of execution;
5b, equipment under test 2 send the NA message to equipment under test 1, and the constructing variable of this NA message is:
An ICMPv6 request marks!=1
5c, equipment under test 1 are received the NA message of the non-S set that equipment under test 2 sends;
5d, when receiving message, check that equipment under test 1 neighbor table corresponding address item state is STALE.
Wherein, for said the 6th status change, comprise the following steps:
6a, the said testing procedure 5a-5d of execution;
6b, equipment under test 2 send NS address resolution message to link-local;
6c, equipment under test 1 are received the NS address resolution message that equipment under test 2 sends;
6d, when receiving message, check that equipment under test 1 neighbor table corresponding address item state is DELAY.
Wherein, for said the 7th status change, comprise the following steps:
7a, the said testing procedure 6a-6d of execution;
7b, time-delay is acted on behalf of timer and is carried out time set to the DELAY_FIRST_PROBE_TIMER of equipment under test 1 neighbor table, and time-delay is acted on behalf of timer and begun countdown;
7c, in the time that timer sets is acted on behalf of in time-delay, do not receive that the NA message of equipment under test 2 is replied;
7d, check that equipment under test 1 neighbor table corresponding address item state is PROBE.
Wherein, for said the 8th status change, comprise the following steps:
8a, the said testing procedure 6a-6d of execution;
8b, timer is acted on behalf of in the time-delay of equipment under test 1 neighbor table carried out time set, time-delay is acted on behalf of timer and is begun countdown;
8c, in the time that timer sets is acted on behalf of in time-delay, receive that the NA message of equipment under test 3 is replied;
8d, check that equipment under test 1 neighbor table corresponding address item state is REACHABLE.
Wherein, for said the 9th status change, comprise the following steps:
9a, the said testing procedure 7a-7d of execution;
9b, the equipment under test 1 periodic NS address resolution message that sends are to link-local;
9c, transmission is set maximum time at interval RETRANS_TIMER be 1s, maximum transmission number of times MAX_UNICAST_SOLICIT is 3 times; Wherein, MAX_UNICAST_SOLICIT is maximum unitcast request number of times;
The maximum timing device of 9d, equipment under test 1 neighbor table does
MAX_TIMER=RETRANS_TIMER*MAX_UNICAST_SOLICIT,
The MAX_TIMER timer begins countdown; Wherein, MAX_TIMER is maximum time;
9e, in the maximum time of setting, receive that the NA of equipment 2 replys;
9f, check that equipment under test 1 neighbor table corresponding address item state is REACHABLE.
Wherein, for said the tenth status change, comprise the following steps:
10a, the said testing procedure 7a-7d of execution;
10b, the equipment under test 1 periodic NS address resolution message that sends are to link-local;
10c, transmission is set maximum time at interval RETRANS_TIMER be 1s, maximum transmission number of times MAX_UNICAST_SOLICIT is 3 times; Wherein, RETRANS_TIMER is the number of retransmissions time interval; MAX_UNICAST_SOLICIT is maximum unitcast request number of times;
The maximum timing device of 10d, equipment under test 1 neighbor table does
MAX_TIMER=RETRANS_TIMER*MAX_UNICAST_SOLICIT,
The MAX_TIMER timer begins countdown; Wherein, MAX_TIMER is maximum time;
10e, in the maximum time of setting, do not receive that the NA message of equipment 3 is replied;
10f, check equipment under test 1 current neighbor table state, the corresponding address item of before being set up is deleted.
Wherein, when carrying out the test of NUD status change, optionally carry out the test of NUD communication message, said NUD communication message test comprises the following steps:
11a, equipment under test 1 send NS address resolution message to link-local;
11b, equipment under test 2 send the NA message to equipment under test 1;
11c, equipment under test 2 recording parameterses comprise in local neighbor table: the IPv6 source address of equipment 1 and the source link layer address of equipment 1;
11d, equipment under test 1 recording parameters comprise in local neighbor table: the IPv6 source address of equipment 2 and source link layer address;
11e, equipment under test 1 send the NS message to equipment under test 2 according to the neighbor table information in the equipment under test 1, and beginning NUD detects;
11f, obtain this NS message, resolve;
11g, utilize each parameter of NS message model checking, and the record result;
11h, equipment under test 2 are replied the NA message and are given equipment under test 1;
11i, obtain this NA message, resolve;
11j, utilize each parameter of NA message model checking, and the record result.
The comprehensive test device of NUD of the present invention comprises NUD state verification module, is used for according to selecting NUD first to the tenth any status change of status change being tested automatically, perhaps said ten status changes is tested successively automatically.
Wherein, said NUD state verification module comprises, acquisition module, creates module and sending module, and wherein, said acquisition module is used for obtaining the state information and the address information of neighbor table specific address item; Said establishment module is used for creating needed NS message of communication process or NA message; Said sending module is used to send by creating the good message of module creation.
Further, the present invention can comprise the communication message test module, said communication message test module; Comprise: acquisition module, parsing module and judge module, wherein, said acquisition module; The mutual message that is used for the obtaining communication process comprises NS message and NA message; Said parsing module is used to resolve the mutual message that acquisition module obtains, and comprises NS message and NA message; Said judge module is used to judge whether the message field (MFLD) of resolving module parses is consistent with defined message model.
The invention has the beneficial effects as follows: according to integrated test facility and the device of NUD of the present invention; Testing apparatus is realized through automation; And according to the different different test scripts of test module operation; Thereby overcome the demand that the angle of manual test in the prior art can't cover full test, can realize the comprehensive automatic test of NUD module.
Embodiment
Below, with reference to integrated test facility and the device of accompanying drawing 1~6 detailed description NUD of the present invention.
The integrated test facility of NUD of the present invention, as shown in Figure 1, total mentality of designing of the present invention is: divide test module earlier, design the test case of module to be tested, comprise concrete testing procedure; According to the test case that is designed, generate the TCL test script; Then, the different TCL script of operation is tested in the test environment of disparate modules, produces message and status change result; At last, analyze message and status change result, generate test result automatically.
According to RFC2461 (Neighbor Discovery for IP Version 6, IPv6 Neighbor Discovery Protocol) definition, the NUD status change comprises following 5 kinds of states altogether:
1) INCOMPLETE: " not accomplishing " state, presentation address is resolved and is carried out, and the link layer address of neighbor node is not confirmed as yet;
2) REACHABLE: " can reach " state, presentation address is resolved successfully, and neighbor node can arrive, but this can arrive state and unsteady state;
3) STALE: " inefficacy " state, expression do not confirm whether neighbor node can reach, and this state is a stable state;
4) DELAY: " time-delay " state, expression do not confirm whether neighbor node can reach this state and unsteady state;
5) PROBE: " detection " state, expression do not confirm whether neighbor node can reach, and need through continuing to send the accessibility of NS authentication of message neighbor node.
In this article, "--->" expression status change direction, as shown in Figure 2, the test of NUD status change comprises following 10 kinds of situations:
1) (incomplete state wherein belongs to intermediateness to EMPTY--->INCOMPLETE (send the NS message and give neighbor node), if do not check at the appointed time, just checks less than this state.)
2) (the STALE state is an intermediateness to EMPTY--->STALE (receiving the NS message that neighbor node sends for the first time), has only equipment to receive for the first time when the NA message is replied, and just this state can occur, the time is very short, and conversion is fast, can convert REACHABLE or DELAY into.)
3) (incomplete state wherein belongs to intermediateness to EMPTY--->INCOMPLETE--->REACHABLE, if do not check at the appointed time, just checks less than this state.)
4) REACHABLE--->STALE (REACHABLE_TIME timer expiry) (can't test in manual test, thereby need construct the generation that message is realized this state through automatized script by this STALE state.)
5) REACHABLE--->STALE (receiving the NA message of the non-S set that neighbors sends) (can't test in manual test, thereby need construct the generation that message is realized this state through automatized script by this STALE state.)
6) STALE--->DELAY (also need be realized through automatized script structure message to the DELAY state by this STALE state, in manual test, can't see the change of these two states.)
7) DELAY--->PROBE (also not receiving the NA message in the time) (conversion between these two states need be set inner DELAY_FIRST_PROBE_TIMER time-delay through automatized script and act on behalf of timer and realize) at DELAY_FIRST_PROBE_TIMER
8) DELAY--->REACHABLE (receiving the NA message in the time) (conversion between these two states need be set inner DELAY_FIRST_PROBE_TIMER time-delay through automatized script and act on behalf of timer and realize) at DELAY_FIRST_PROBE_TIMER
9)PROBE——>REACHABLE
(receiving the NA message in the time) (conversion between these two states need be set inner maximum time MAX_TIMER timer through automatized script and realize) at RETRANS_TIMER*MAX_UNICAST_SOLICIT
10)PROBE——>EMPTY
(not receiving the NA message in the time) (conversion between these two states need be set inner maximum time MAX_TIMER timer through automatized script and realize) at RETRANS_TIMER*MAX_UNICAST_SOLICIT
According to above-mentioned state description, concrete testing procedure is divided as follows:
1) EMPTY--->INCOMPLETE (send the NS message and give neighbor node)
1a, check that equipment under test 1 current neighbor table state is EMPTY;
1b, equipment under test 1 send NS address resolution message to link-local, and wherein, concrete message constructing variable (need to prove that the NS message constructing variable among this paper is all identical with here, when hereinafter occurring, no longer it is made an explanation as follows.):
IPv6_Target_Address (IPv6 destination address)=FF02::1:FF+ is by back 24 of the requesting node global unicast address;
Target Link-Layer Address (purpose link layer address)=33:33+ is by back 32 of the requesting node multicast address;
In the time of 1c, transmission message, check equipment under test 1 neighbor table corresponding address item information: the IPv6 destination address and the purpose link layer address that comprise this equipment under test;
1d, check that corresponding address item state is INCOMPLETE;
1e, repeat to send identical NS address resolution message pre-determined number (for example three times), do not receive that any NA message responds, it is overtime promptly to send NS;
1f, check equipment under test 1 current neighbor table state, the corresponding address item of before being set up is deleted.
2) EMPTY--->STALE (receiving the NS message that neighbor node sends for the first time)
2a, check equipment under test 2 current neighbor table states, state is EMPTY;
2b, equipment under test 1 send NS address resolution message to link-local;
2c, equipment under test 2 are received this NS address resolution message for the first time;
2d, when receiving message, check equipment under test 2 neighbor table corresponding address item information, comprising: the IPv6 destination address of this equipment under test and purpose link layer address;
2e, check equipment under test 2 current neighbor table states, corresponding address item state is STALE.
3)EMPTY——>INCOMPLETE——>REACHABLE
3a, above 1) middle testing procedure 1a-1d;
3b, equipment under test 2 send the NA message to equipment under test 1, and the constructing variable of this NA message is: ICMPv6_Solicited Flag (ICMPv6 request marks)=1;
3c, equipment under test 1 receive that the NA that equipment under test 2 sends replys message;
3d, when receiving message, check that equipment under test 1 neighbor table corresponding address item state is REACHABLE.
4) REACHABLE--->STALE (REACHABLE_TIME timer expiry)
4a, with above-mentioned 3) in testing procedure 3a-3d;
The REACHABLE_TIME of 4b, equipment under test 1 neighbor table can reach timer and be set at 30s, can reach timer and begin countdown;
4c, reaching in the time that timer sets, do not receive " accessibility confirmatory message " about equipment under test 2;
4d, check that equipment under test 1 neighbor table corresponding address item state is STALE.
5) REACHABLE--->STALE (receiving the NA message of the non-S set that neighbors sends)
5a, with above-mentioned 3) in testing procedure 3a-3d;
5b, equipment under test 2 send the NA message to equipment under test 1, and the constructing variable of this NA message is:
An ICMPv6_Solicited Flag (ICMPv6 request marks)!=1
5c, equipment under test 1 are received the NA message of the non-S set that equipment under test 2 sends;
5d, when receiving message, check that equipment under test 1 neighbor table corresponding address item state is STALE.
6)STALE——>DELAY
6a, with above-mentioned 5) in testing procedure 5a-5d;
6b, equipment under test 2 send NS address resolution message to link-local;
6c, equipment under test 1 are received the NS address resolution message that equipment under test 2 sends;
6d, when receiving message, check that equipment under test 1 neighbor table corresponding address item state is DELAY.
7) DELAY--->PROBE (also not receiving the NA message in the time) at DELAY_FIRST_PROBE_TIMER
7a, with above-mentioned 6) in testing procedure 6a-6d;
The DELAY_FIRST_PROBE_TIMER time-delay of 7b, equipment under test 1 neighbor table is acted on behalf of timer and is set at 5s, and time-delay is acted on behalf of timer and begun countdown;
7c, in the time that timer sets is acted on behalf of in time-delay, do not receive that the NA message of equipment under test 2 is replied;
7d, check that equipment under test 1 neighbor table corresponding address item state is PROBE.
8) DELAY--->REACHABLE (in the time is acted on behalf of in time-delay, receiving the NA message)
8a, with above-mentioned 6) in testing procedure 6a-6d;
The time-delay of 8b, equipment under test 1 neighbor table is acted on behalf of timer and is set at 5s, and time-delay is acted on behalf of timer and begun countdown;
8c, in the time that timer sets is acted on behalf of in time-delay, receive that the NA message of equipment under test 3 is replied;
8d, check that equipment under test 1 neighbor table corresponding address item state is REACHABLE.
9) PROBE--->REACHABLE receives the NA message at RETRANS_TIMER number of retransmissions * MAX_UNICAST_SOLICIT (maximum unitcast request) in the time
9a, with above-mentioned 7) in testing procedure 7a-7d;
9b, the equipment under test 1 periodic NS address resolution message that sends are to link-local;
9c, transmission is set maximum time at interval RETRANS_TIMER be 1s, maximum transmission number of times MAX_UNICAST_SOLICIT (maximum unitcast request) is 3 times;
The maximum timing device of 9d, equipment under test 1 neighbor table does
MAX_TIMER (maximum time)=RETRANS_TIMER (number of retransmissions) * MAX_UNICAST_SOLICIT (maximum unitcast request), MAX_TIMER (maximum time) timer begins countdown;
9e, in the maximum time of setting, receive that the NA of equipment 2 replys;
9f, check that equipment under test 1 neighbor table corresponding address item state is REACHABLE.
10)PROBE——>EMPTY
(not receiving the NA message in the time) at RETRANS_TIMER*MAX_UNICAST_SOLICIT
10a, with above-mentioned 7) in testing procedure 7a-7d;
10b, the equipment under test 1 periodic NS address resolution message that sends are to link-local;
10c, transmission is set maximum time at interval RETRANS_TIMER (number of retransmissions) be 1s, maximum transmission number of times MAX_UNICAST_SOLICIT (maximum unitcast request) is 3 times;
The maximum timing device of 10d, equipment under test 1 neighbor table does
MAX_TIMER (maximum time)=RETRANS_TIMER (number of retransmissions) * MAX_UNICAST_SOLICIT (maximum unitcast request), MAX_TIMER (maximum time) timer begins countdown;
10e, in the maximum time of setting, do not receive that the NA message of equipment 3 is replied;
10f, check equipment under test 1 current neighbor table state, the corresponding address item of before being set up is deleted.
In addition, the present invention can also when carrying out the test of NUD status change, optionally carry out the test of NUD communication message according to actual needs, and this NUD communication message test comprises the following steps:
A, equipment under test 1 send NS address resolution message to link-local;
B, equipment under test 2 send the NA message to equipment under test 1;
C, equipment under test 2 recording parameterses comprise in local neighbor table: the IPv6 source address of equipment 1 and the source link layer address of equipment 1;
D, equipment under test 1 recording parameters comprise in local neighbor table: the IPv6 source address of equipment 2 and source link layer address;
E, equipment under test 1 send the NS message to equipment under test 2 according to the neighbor table information in the equipment under test 1, and beginning NUD detects;
F, obtain this NS message, resolve;
G, utilize each parameter of NS message model checking, and the record result; Wherein, each parameter is following:
ICMPv6_TYPE (icmp packet type): return the types value in the NS message
ICMPv6_Target Address (ICMPv6 destination address): return global unicast address or link local address variable in the NS message;
ICMPv6_Options TYPE (ICMPv6 option type): the types value that returns Option Field in the NS message;
ICMPv6_Options (ICMPv6 option): return the Option Field variable in the NS message;
Source Link-Layer Address (source link layer address);
H, equipment under test 2 are replied the NA message and are given equipment under test 1;
I, obtain this NA message, resolve;
J, utilize each parameter of NA message model checking, and the record result; Wherein, each parameter is following:
ICMPv6_TYPE (icmp packet type): return the types value in the NS message;
ICMPv6_Target Address (ICMPv6 destination address): return global unicast address or link local address variable in the NA message;
ICMPv6_Options_TYPE (ICMPv6 option type): the types value that returns Option Field in the NA message;
ICMPv6_Options (ICMPv6 option): return the Option Field variable in the NA message;
Target Link-Layer Address (purpose link layer address);
ICMPv6_Solicited Flag (ICMPv6 request mark): the Option Field S flag bit variable that returns the NA message.
As shown in Figure 3, when concrete the realization, can comprise the steps:
Step 301: the TCL test script that writes is operated in the test environment;
Step 302: input parameter test_module value, select test module;
Step 303: if test_module=1 representes that then tested module is a NUD status change module;
Step 304: input parameter status_module value, selection mode transition test submodule;
Step 305: if (n=1 2......10), representes that then tested status change is which kind situation recited above, moves the test case under this test environment then automatically to status_module=n;
Step 306: if status_module=all representes that then tested status change is whole ten kinds of situations recited above, moves the test case under this test environment then automatically;
Step 307: if test_module=2 representes that then tested module is a NUD communication message module, moves the test case under this test environment then automatically;
Step 308: analyze message and status change result, generate test result automatically.
Fig. 4 is the structural representation of NUD status change test module in the comprehensive test device of NUD of the present invention.This NUD status change test module comprises acquisition module 401, creates module 402, sending module 403.
Wherein, acquisition module 401 is used to obtain the current state of neighbor table; Create module 402, be used for creating the needed message of communication process; Sending module 403 is used to send by creating the good message of module creation.In addition, can also be in sending module 403 built-in timer, send the time interval of message and the number of times that repeats to send with control.
Wherein, acquisition module 401 may further include: the first acquiring unit 401a is used for obtaining the state information of neighbor table specific address item; Second acquisition unit 401b is used for obtaining the address information of neighbor table specific address item, and wherein, this address information is mainly used in the address entries information of NUD list item and fills.
Wherein, create module 402 and may further include: the first establishment unit 402a, be used to create the NS message, specifically comprise address resolution NS message and NUD state-detection NS message; The second establishment unit 402b is used to create the NA message, specifically comprises address resolution NA message and NUD state-detection NA message.
As shown in Figure 5, the comprehensive test device of NUD of the present invention may further include the communication message test module, and is as shown in Figure 6, and this communication message test module comprises: acquisition module 601, parsing module 602, judge module 603.
Wherein, acquisition module 601 is used for the mutual message of obtaining communication process;
Parsing module 602 is used to resolve the mutual message that acquisition module obtains;
Judge module 603 is used to judge whether the message field (MFLD) of resolving module parses is consistent with defined message model.
Wherein, acquisition module 601 may further include: the first acquiring unit 601a is used for the NS message of obtaining communication process; Second acquisition unit 601b is used for the NA message of obtaining communication process.
In sum; Integrated test facility and device according to NUD of the present invention; Can particularly in NUD status change test module, realize the test of ten kinds of status changes according to the different different test scripts of test module operation; Overcome the demand that the angle of manual test in the prior art can't cover full test, can realize the comprehensive automatic test of NUD module.
More than be in order to make those of ordinary skills understand the present invention; And to detailed description that the present invention carried out; But can expect; In the scope that does not break away from claim of the present invention and contained, can also make other variation and modification, these variations and revising all in protection scope of the present invention.