Summary of the invention
The object 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, NUD first is tested automatically to any status change in the tenth status change, or described ten status changes are tested successively automatically, and wherein, the first status change is: from EMPTY to INCOMPLETE; The second status change is: from EMPTY to STALE; Third state transition are: from EMPTY to INCOMPLETE to REACHABLE; The 4th status change is: 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 described the first status change, comprise the following steps:
1a, check that the current neighbor table state of equipment under test 1 is EMPTY;
1b, equipment under test 1 send NS address resolution message to link-local, and wherein, described NS address resolution message comprises: IPv6 destination address and object link layer address;
1c, when sending described message, check the address entries information that equipment under test 1 neighbor table is corresponding, comprising: the IPv6 destination address of this equipment under test and object 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, send NS overtime;
1f, check the current neighbor table state of equipment under test 1, the corresponding address item before set up is deleted.
Wherein, for described the second status change, comprise the following steps:
2a, check the current neighbor table state of equipment under test 2, 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 the address entries information that equipment under test 2 neighbor table are corresponding, comprising: the IPv6 destination address of this equipment under test and object link layer address;
2e, check the current neighbor table state of equipment under test 2, corresponding address entries state is STALE.
Wherein, for described third state transition, comprise the following steps:
3a, carry out described testing procedure 1a-1d;
3b, equipment under test 2 send 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 address entries state corresponding to equipment under test 1 neighbor table is REACHABLE.
Wherein, for described the 4th status change, comprise the following steps:
4a, carry out described testing procedure 3a-3d;
The REACHABLE_TIME of 4b, equipment under test 1 neighbor table can reach timer and set timing time, can reach timer and start countdown;
4c, reaching in the time that timer sets, do not receive the accessibility confirmatory message about equipment under test 2;
4d, check that address entries state corresponding to equipment under test 1 neighbor table is STALE.
Wherein, for described the 5th status change, comprise the following steps:
5a, carry out described testing procedure 3a-3d;
5b, equipment under test 2 send NA message to equipment under test 1, and the constructing variable of this NA message is:
ICMPv6 request marks unequal to 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 address entries state corresponding to equipment under test 1 neighbor table is STALE.
Wherein, for described the 6th status change, comprise the following steps:
6a, carry out described 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 address entries state corresponding to equipment under test 1 neighbor table is DELAY.
Wherein, for described the 7th status change, comprise the following steps:
7a, carry out described testing procedure 6a-6d;
7b, the DELAY_FIRST_PROBE_TIMER time delay of equipment under test 1 neighbor table is acted on behalf of to timer carry out time setting, time delay is acted on behalf of timer and is started 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 address entries state corresponding to equipment under test 1 neighbor table is PROBE.
Wherein, for described the 8th status change, comprise the following steps:
8a, carry out described testing procedure 6a-6d;
8b, the time delay of equipment under test 1 neighbor table is acted on behalf of to timer carry out time setting, time delay is acted on behalf of timer and is started 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 address entries state corresponding to equipment under test 1 neighbor table is REACHABLE.
Wherein, for described the 9th status change, comprise the following steps:
9a, carry out described testing procedure 7a-7d;
9b, equipment under test 1 periodically send NS address resolution message to link-local;
9c, the maximum time interval RETRANS_TIMER that transmission is set are 1s, and maximum transmission times MAX_UNICAST_SOLICIT is 3 times; Wherein, MAX_UNICAST_SOLICIT is maximum unitcast request number of times;
The maximum timer of 9d, equipment under test 1 neighbor table is
MAX_TIMER=RETRANS_TIMER*MAX_UNICAST_SOLICIT,
MAX_TIMER timer starts countdown; Wherein, MAX_TIMER is maximum time;
9e, within the maximum time of setting, receive that the NA of equipment 2 replys;
9f, check that address entries state corresponding to equipment under test 1 neighbor table is REACHABLE.
Wherein, for described the tenth status change, comprise the following steps:
10a, carry out described testing procedure 7a-7d;
10b, equipment under test 1 periodically send NS address resolution message to link-local;
10c, the maximum time interval RETRANS_TIMER that transmission is set are 1s, and maximum transmission 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 timer of 10d, equipment under test 1 neighbor table is
MAX_TIMER=RETRANS_TIMER*MAX_UNICAST_SOLICIT,
MAX_TIMER timer starts countdown; Wherein, MAX_TIMER is maximum time;
10e, within the maximum time of setting, do not receive that the NA message of equipment 3 is replied;
10f, check the current neighbor table state of equipment under test 1, the corresponding address item before set up is deleted.
Wherein, when carrying out the test of NUD status change, optionally carry out the test of NUD communication message, described 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 NA message to equipment under test 1;
11c, equipment under test 2 recording parameterses, in local neighbor table, comprising: the IPv6 source address of equipment 1 and the source link layer address of equipment 1;
11d, equipment under test 1 recording parameters, in local neighbor table, comprising: the IPv6 source address of equipment 2 and source link layer address;
11e, equipment under test 1, according to the neighbor table information in equipment under test 1, send NS message to equipment under test 2, start NUD and detect;
11f, obtain this NS message, resolve;
11g, utilize NS message model checking parameters, and record result;
11h, equipment under test 2 are replied NA message to equipment under test 1;
11i, obtain this NA message, resolve;
11j, utilize NA message model checking parameters, and record result.
The comprehensive test device of NUD of the present invention, comprises NUD state verification module, for according to selecting, NUD first being tested automatically to the tenth any status change of status change, or described ten status changes is tested successively automatically.
Wherein, described NUD state verification module, comprises, acquisition module, creation module and sending module, and wherein, described acquisition module, for obtaining state information and the address information of neighbor table specific address item; Described creation module, for creating the needed NS message of communication process or NA message; Described sending module, for sending the message being created by creation module.
Further, the present invention can comprise communication message test module, described communication message test module, comprise: acquisition module, parsing module and judge module, wherein, described acquisition module, mutual message for obtaining communication process, comprises NS message and NA message; Described parsing module, the mutual message obtaining for resolving acquisition module, comprises NS message and NA message; Described judge module, whether consistent with defined message model for judging the message field (MFLD) of parsing module parsing.
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 by automation, and move different test scripts according to different test modules, thereby overcome the demand that the angle of manual test in prior art cannot cover full test, can realize the comprehensive automatic test of NUD module.
Embodiment
Below, with reference to accompanying drawing 1~6, describe integrated test facility and the device of NUD of the present invention in detail.
The integrated test facility of NUD of the present invention, as shown in Figure 1, total mentality of designing of the present invention is: first divide test module, design the test case of tested module, comprise concrete testing procedure; According to designed test case, generate TCL test script; Then, in the test environment of disparate modules, move different TCL scripts, test, produce message and status change result; Finally, analyze message and status change result, automatically generate test result.
According to RFC2461 (Neighbor Discovery for IP Version 6, IPv6 Neighbor Discovery Protocol) definition, NUD status change comprises following 5 kinds of states altogether:
1) INCOMPLETE: " not completing " state, expression address resolution is carried out, and the link layer address of neighbor node is not yet definite;
2) REACHABLE: " can reach " state, represent address resolution success, neighbor node can arrive, but this can arrive state unsteady state;
3) STALE: " inefficacy " state, represents not determine whether neighbor node can reach, and this state is stable state;
4) DELAY: " time delay " state, represents do not determine whether neighbor node can reach, this state unsteady state;
5) PROBE: " detection " state, represent do not determine whether neighbor node can reach, need by continuing to send the accessibility of NS authentication of message neighbor node.
In this article, "---> " represent 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 (sending NS message to neighbor node), if do not checked at the appointed time, just checks less than this state.)
2) (STALE state is intermediateness to EMPTY---> STALE (receiving for the first time the NS message that neighbor node sends), only have equipment to receive for the first time when NA message is replied, just there will be this state, time is very short, conversion is fast, can be converted to REACHABLE or DELAY.)
3) (incomplete state wherein belongs to intermediateness to EMPTY---> INCOMPLETE---> REACHABLE, if do not checked at the appointed time, just checks less than this state.)
4) REACHABLE---> STALE (REACHABLE_TIME timer expiry) (cannot test in manual test, thereby need to construct the generation that message is realized this state by automatized script by this STALE state.)
5) REACHABLE---> STALE (receiving the NA message of the non-S set that neighbors sends) (cannot test in manual test, thereby need to construct the generation that message is realized this state by automatized script by this STALE state.)
6) STALE---> DELAY (also needs to construct message by automatized script by this STALE state to DELAY state and realizes, cannot see the change of these two states in manual test.)
7) DELAY---> PROBE (also not receiving NA message at DELAY_FIRST_PROBE_TIMER in the time) (conversion between these two states need to be set inner DELAY_FIRST_PROBE_TIMER time delay by automatized script and act on behalf of timer and realize)
8) DELAY---> REACHABLE (receiving NA message in the time at DELAY_FIRST_PROBE_TIMER) (conversion between these two states need to be set inner DELAY_FIRST_PROBE_TIMER time delay by automatized script and act on behalf of timer and realize)
9)PROBE——>REACHABLE
(receiving NA message in the time at RETRANS_TIMER*MAX_UNICAST_SOLICIT) (conversion between these two states need to be set inner maximum time MAX_TIMER timer by automatized script and realize)
10)PROBE——>EMPTY
(not receiving NA message in the time at RETRANS_TIMER*MAX_UNICAST_SOLICIT) (conversion between these two states need to be set inner maximum time MAX_TIMER timer by automatized script and realize)
According to above-mentioned state description, concrete testing procedure is divided as follows:
1) EMPTY---> INCOMPLETE (sending NS message to neighbor node)
1a, check that the current neighbor table state of equipment under test 1 is EMPTY;
1b, equipment under test 1 send NS address resolution message to link-local, and wherein, concrete message constructing variable is following, and (it should be noted that, NS message constructing variable herein, all with identical herein, while hereinafter occurring, no longer makes an explanation to it.):
Latter 24 of the requested node global unicast address of IPv6_Target_Address (IPv6 destination address)=FF02::1:FF+;
Latter 32 of the requested node multicast address of Target Link-Layer Address (object link layer address)=33:33+;
In the time of 1c, transmission message, check the address entries information that equipment under test 1 neighbor table is corresponding: the IPv6 destination address and the object 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, send NS overtime;
1f, check the current neighbor table state of equipment under test 1, the corresponding address item before set up is deleted.
2) EMPTY---> STALE (receiving for the first time the NS message that neighbor node sends)
2a, check the current neighbor table state of equipment under test 2, 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 the address entries information that equipment under test 2 neighbor table are corresponding, comprising: the IPv6 destination address of this equipment under test and object link layer address;
2e, check the current neighbor table state of equipment under test 2, corresponding address entries state is STALE.
3)EMPTY——>INCOMPLETE——>REACHABLE
3a, with above 1) in testing procedure 1a-1d;
3b, equipment under test 2 send 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 address entries state corresponding to equipment under test 1 neighbor table 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 as 30s, can reach timer and start countdown;
4c, reaching in the time that timer sets, do not receive " accessibility confirmatory message " about equipment under test 2;
4d, check that address entries state corresponding to equipment under test 1 neighbor table 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 NA message to equipment under test 1, and the constructing variable of this NA message is:
ICMPv6_Solicited Flag (ICMPv6 request marks) unequal to 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 address entries state corresponding to equipment under test 1 neighbor table 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 address entries state corresponding to equipment under test 1 neighbor table is DELAY.
7) DELAY---> PROBE (also not receiving NA message at DELAY_FIRST_PROBE_TIMER in the time)
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 as 5s, and time delay is acted on behalf of timer and started 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 address entries state corresponding to equipment under test 1 neighbor table is PROBE.
8) DELAY---> REACHABLE (receiving NA message in the time is acted on behalf of in time delay)
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 as 5s, and time delay is acted on behalf of timer and started 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 address entries state corresponding to equipment under test 1 neighbor table is REACHABLE.
9) PROBE---> REACHABLE receives 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, equipment under test 1 periodically send NS address resolution message to link-local;
9c, the maximum time interval RETRANS_TIMER that transmission is set are 1s, and maximum transmission times MAX_UNICAST_SOLICIT (maximum unitcast request) is 3 times;
The maximum timer of 9d, equipment under test 1 neighbor table is
MAX_TIMER (maximum time)=RETRANS_TIMER (number of retransmissions) * MAX_UNICAST_SOLICIT (maximum unitcast request), MAX_TIMER (maximum time) timer starts countdown;
9e, within the maximum time of setting, receive that the NA of equipment 2 replys;
9f, check that address entries state corresponding to equipment under test 1 neighbor table is REACHABLE.
10)PROBE——>EMPTY
(at RETRANS_TIMER*MAX_UNICAST_SOLICIT, in the time, not receiving NA message)
10a, with above-mentioned 7) in testing procedure 7a-7d;
10b, equipment under test 1 periodically send NS address resolution message to link-local;
10c, the maximum time interval RETRANS_TIMER (number of retransmissions) that transmission is set are 1s, and maximum transmission times MAX_UNICAST_SOLICIT (maximum unitcast request) is 3 times;
The maximum timer of 10d, equipment under test 1 neighbor table is
MAX_TIMER (maximum time)=RETRANS_TIMER (number of retransmissions) * MAX_UNICAST_SOLICIT (maximum unitcast request), MAX_TIMER (maximum time) timer starts countdown;
10e, within the maximum time of setting, do not receive that the NA message of equipment 3 is replied;
10f, check the current neighbor table state of equipment under test 1, the corresponding address item before 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 NA message to equipment under test 1;
C, equipment under test 2 recording parameterses, in local neighbor table, comprising: the IPv6 source address of equipment 1 and the source link layer address of equipment 1;
D, equipment under test 1 recording parameters, in local neighbor table, comprising: the IPv6 source address of equipment 2 and source link layer address;
E, equipment under test 1, according to the neighbor table information in equipment under test 1, send NS message to equipment under test 2, start NUD and detect;
F, obtain this NS message, resolve;
G, utilize NS message model checking parameters, and record result; Wherein, parameters is as follows:
ICMPv6_TYPE (icmp packet type): return to the types value in NS message
ICMPv6_Target Address (ICMPv6 destination address): return to global unicast address or link local address variable in NS message;
ICMPv6_Options TYPE (ICMPv6 option type): the types value that returns to Option Field in NS message;
ICMPv6_Options (ICMPv6 option): return to the Option Field variable in NS message;
Source Link-Layer Address (source link layer address);
H, equipment under test 2 are replied NA message to equipment under test 1;
I, obtain this NA message, resolve;
J, utilize NA message model checking parameters, and record result; Wherein, parameters is as follows:
ICMPv6_TYPE (icmp packet type): return to the types value in NS message;
ICMPv6_Target Address (ICMPv6 destination address): return to global unicast address or link local address variable in NA message;
ICMPv6_Options_TYPE (ICMPv6 option type): the types value that returns to Option Field in NA message;
ICMPv6_Options (ICMPv6 option): return to the Option Field variable in NA message;
Target Link-Layer Address (object link layer address);
ICMPv6_Solicited Flag (ICMPv6 request mark): the Option Field S flag bit variable that returns to NA message.
As shown in Figure 3, when specific implementation, can comprise the steps:
Step 301: the TCL test script writing is operated in test environment;
Step 302: input parameter test_module value, select test module;
Step 303: if test_module=1 represents that tested module is NUD status change module;
Step 304: input parameter status_module value, selection mode transition test submodule;
Step 305: if status_module=n (n=1,2......10) represents that tested status change is which kind situation recited above, moves the test case under this test environment then automatically;
Step 306: if status_module=all represents that 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 represents that tested module is NUD communication message module, moves the test case under this test environment then automatically;
Step 308: analyze message and status change result, automatically generate test result.
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, creation module 402, sending module 403.
Wherein, acquisition module 401, for obtaining the current state of neighbor table; Creation module 402, for creating the needed message of communication process; Sending module 403, for sending the message being created by creation module.In addition, can also be in sending module 403 built-in timer, to control the number of times that sends the time interval of message and repeat to send.
Wherein, acquisition module 401 may further include: the first acquiring unit 401a, for obtaining the state information of neighbor table specific address item; Second acquisition unit 401b, for obtaining the address information of neighbor table specific address item, wherein, this address information is mainly used in the address entries information of NUD list item and fills.
Wherein, creation module 402 may further include: the first creating unit 402a, for creating NS message, specifically comprises address resolution NS message and NUD state-detection NS message; The second creating unit 402b, for creating 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 communication message test module, and as shown in Figure 6, this communication message test module, comprising: acquisition module 601, parsing module 602, judge module 603.
Wherein, acquisition module 601, for the mutual message of obtaining communication process;
Parsing module 602, the mutual message obtaining for resolving acquisition module;
Judge module 603, whether consistent with defined message model for judging the message field (MFLD) of parsing module parsing.
Wherein, acquisition module 601 may further include: the first acquiring unit 601a, for the NS message of obtaining communication process; Second acquisition unit 601b, for the NA message of obtaining communication process.
In sum, integrated test facility and device according to NUD of the present invention, can move according to different test modules different test scripts, particularly in NUD status change test module, realized the test of ten kinds of status changes, overcome the demand that the angle of manual test in prior art cannot cover full test, can realize the comprehensive automatic test of NUD module.
More than in order to make those of ordinary skills understand the present invention; and the detailed description that the present invention is carried out; but can expect; within not departing from the scope that claim of the present invention contains, can also make other changes and modifications, these variations and revising all in protection scope of the present invention.