CN113037591A - Test method and system for verifying IPV6 protocol consistency - Google Patents
Test method and system for verifying IPV6 protocol consistency Download PDFInfo
- Publication number
- CN113037591A CN113037591A CN202110240696.5A CN202110240696A CN113037591A CN 113037591 A CN113037591 A CN 113037591A CN 202110240696 A CN202110240696 A CN 202110240696A CN 113037591 A CN113037591 A CN 113037591A
- Authority
- CN
- China
- Prior art keywords
- server
- response
- client
- module
- message
- 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.)
- Pending
Links
- 238000010998 test method Methods 0.000 title claims abstract description 11
- 238000012360 testing method Methods 0.000 claims abstract description 90
- 238000000034 method Methods 0.000 claims abstract description 45
- 230000004044 response Effects 0.000 claims abstract description 44
- 238000010276 construction Methods 0.000 claims abstract description 21
- 230000008569 process Effects 0.000 claims abstract description 15
- 230000009365 direct transmission Effects 0.000 claims abstract description 12
- 230000005540 biological transmission Effects 0.000 claims description 12
- 238000012790 confirmation Methods 0.000 claims description 2
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- RTZKZFJDLAIYFH-UHFFFAOYSA-N Diethyl ether Chemical compound CCOCC RTZKZFJDLAIYFH-UHFFFAOYSA-N 0.000 description 8
- 230000006872 improvement Effects 0.000 description 8
- 230000003993 interaction Effects 0.000 description 7
- 230000002159 abnormal effect Effects 0.000 description 4
- 230000002452 interceptive effect Effects 0.000 description 4
- 238000012795 verification Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000004088 simulation Methods 0.000 description 2
- -1 IPv6 Chemical compound 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000004886 process control Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/18—Protocol analysers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
- H04L61/5014—Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/618—Details of network addresses
- H04L2101/659—Internet protocol version 6 [IPv6] addresses
Abstract
The invention provides a test method and a system for verifying the consistency of an IPV6 protocol, wherein the test method comprises the following steps: confirming whether the server or the client is tested, if the server is tested, executing a server test flow, and if the client is tested, executing a client test flow; the server test flow comprises the following steps: step 21: creating a message; step 22: if the response is the customized response, selecting an option construction package to be sent; if the response is a conventional response, direct transmission is not changed; the client test process comprises the following steps: step 31: creating a message; step 32: if the request is a customization request, selecting an option construction package to be sent and then sending the option construction package; if it is a regular request, the direct transmission is not altered. The invention has the beneficial effects that: the time cost is reduced, the resource utilization rate is improved, the quality and the test coverage of the IPV6 module are improved, and the reusability is strong.
Description
Technical Field
The invention relates to the technical field of testing, in particular to a testing method and a testing system for verifying the consistency of an IPV6 protocol.
Background
The current IPV6 environment is a fixed environment, cannot control and modify each link in protocol interaction, can only perform basic protocol interaction verification, and cannot perform combined verification on abnormal situations and other scenarios.
Specific defects are as follows:
(1) parameters cannot be configured, default parameters cannot be modified, and option field support and response types are incomplete.
(2) The lack of process control can not modify the established interactive flow, the event can not be inserted in the middle, and the conditions of time delay, packet loss, multiple responses and multiple request concurrence can not be established.
(3) The test scene is absent, only a WAN interface environment exists at present, a LAN environment does not exist, and the DHCPv6 server cannot be verified.
Disclosure of Invention
The invention is invented in view of the problems that the server can not be configured by self definition, the testing process can not be controlled, the message parameters can not be customized, the testing scene at the LAN side is lost and the like in the current environment. The tool can conveniently construct and send the IPV6 message, and can realize the construction of test environments such as interactive flow control, special scene construction, option field addition and deletion, abnormal field construction and the like.
The invention provides a test method for verifying the consistency of an IPV6 protocol, which comprises the following steps:
step 1: confirming whether the server or the client is tested, if the server is tested, executing a server test flow, and if the client is tested, executing a client test flow;
the server test flow comprises the following steps:
step 21: creating a message;
step 22: if the response is the customized response, selecting an option construction package to be sent; if the response is a conventional response, direct transmission is not changed;
the client test process comprises the following steps:
step 31: creating a message;
step 32: if the request is a customization request, selecting an option construction package to be sent and then sending the option construction package; if it is a regular request, the direct transmission is not altered.
As a further improvement of the present invention, when testing DHCPv6, in step 21, a DHCPv6_ advertise method is selected to create an advertise message; in the step 31, a dhcpv6_ solict method is selected to create a solict message.
As a further improvement of the present invention, when testing the DHCPv6, the server testing process further includes step 23: when the request message is received, the client side responds, and the client side test process comprises the following steps of 33: waiting for the server to give a reply response.
As a further improvement of the present invention, when ICMPv6 is tested, in step 21, an ICMPv6_ ra method is selected to create an ra packet; in step 31, an icmpv6_ rs method is selected to create an rs packet.
As a further improvement of the present invention, when testing ICMPv6, the server testing process further includes step 23: receiving the timing broadcast transmission, the client test procedure includes step 33: and waiting for the server to give an ra response, and otherwise, repeating the transmission at regular time.
The invention also provides a test system for verifying the consistency of the IPV6 protocol, which comprises the following steps:
a confirmation module: the client-side testing module is used for confirming whether the server or the client is tested, if the server is tested, the server testing module is operated, and if the client is tested, the client-side testing module is operated;
the server test module includes:
a creation module: used for creating a message;
a selection module: if the response is the customized response, selecting an option construction package to be sent; if the response is a conventional response, direct transmission is not changed;
the client test module comprises:
a creation unit: used for creating a message;
a selection unit: if the request is a customization request, selecting an option construction package to be sent and then sending the option construction package; if it is a regular request, the direct transmission is not altered.
As a further improvement of the present invention, when testing DHCPv6, in the creating module, a DHCPv6_ advertise method is selected to create an advertise message; in the creating unit, a method of dhcpv6_ Solicit is selected to create a Solicit message.
As a further improvement of the present invention, when testing the DHCPv6, the server testing module further includes a response module: the client test module is used for responding when receiving a request message, and further comprises a response unit: waiting for the server to give a reply response.
As a further improvement of the invention, when the ICMPv6 is tested, an ICMPv6_ ra method is selected in the creating module to create an ra message; in the creating unit, an icmpv6_ rs method is selected to create an rs message.
As a further improvement of the present invention, when testing ICMPv6, the server testing module further includes a broadcasting module: the client test module is used for receiving the timing broadcast transmission and further comprises a response transmission module: for waiting for the server to give ra response, otherwise repeating the transmission periodically.
The invention has the beneficial effects that: the time cost is reduced, the resource utilization rate is improved, the quality and the test coverage of the IPV6 module are improved, and the reusability is strong.
Drawings
FIG. 1 is a flow chart of DHCPv6 testing;
FIG. 2 is a flow chart of an ICMPv6 test;
FIG. 3 is a block logic diagram;
FIG. 4 is a schematic diagram of ICMPv6 message interaction;
FIG. 5 is a schematic diagram of DHCPv6 message interaction;
Detailed Description
The invention discloses a test method for verifying the consistency of an IPV6 protocol, wherein the test environment topology of the invention is as follows:
the system supports: 64-bit windows 7 and systems above;
programming language: python 3.7;
testing a framework: scapy;
scapy is a Python program that allows users to send, listen, and parse and disguise network messages. These functions can be used to make tools to sniff, scan, and attack networks. In other words, scapy is a powerful interactive program that manipulates messages. It can forge or analyze messages of various protocols, and also has the functions of sending, capturing, matching requests and responding to the messages and more functions. A scapy can easily do traditional tasks like scanning (scanning), tracerouting (tracing), probing (binding), unit testing (units tests), attacks (attacks) and network discovery (network discovery).
The tool use process of the invention comprises the following steps:
(1) determining a scenario to test: if the server segment is simulated, the IPV6 address and DNSv6 need to be manually configured, and the simulation client does not need to be additionally configured.
(2) Modifying the related message parameters (if necessary, the parameters have default values without modification), and selecting the option according to the requirements.
(3) And sending the corresponding message encapsulation example by using a sendp () method.
(4) And (4) capturing a packet in the process, and sending a customized message according to a protocol interaction flow to finish the test.
The invention discloses a test method for verifying the consistency of an IPV6 protocol, which comprises the following steps:
step 1: confirming whether the server or the client is tested, if the server is tested, executing a server test flow, and if the client is tested, executing a client test flow;
the server test flow comprises the following steps:
step 21: creating a message;
step 22: if the response is the customized response, selecting an option construction package to be sent; if the response is a conventional response, direct transmission is not changed;
the client test process comprises the following steps:
step 31: creating a message;
step 32: if the request is a customization request, selecting an option construction package to be sent and then sending the option construction package; if it is a regular request, the direct transmission is not altered.
As shown in fig. 1, when testing DHCPv6, in step 21, a DHCPv6_ advertise method is selected to create an advertise message; in the step 31, a dhcpv6_ solict method is selected to create a solict message. When testing the DHCPv6, the server testing process further includes step 23: when the request message is received, the client side responds, and the client side test process comprises the following steps of 33: waiting for the server to give a reply response.
As shown in fig. 2, when the ICMPv6 is tested, in step 21, an ICMPv6ra method is selected to create an ra message; in step 31, an icmpv6_ rs method is selected to create an rs packet. When testing ICMPv6, the server testing process further includes step 23: receiving the timing broadcast transmission, the client test procedure includes step 33: and waiting for the server to give an ra response, and otherwise, repeating the transmission at regular time.
And (3) module packaging:
dhcpv6. py: the DHCPV6 protocol module calls a method in the scapy library to package 4 interactive standard message formats of the DHCPv6 protocol.
Icmpv6. py: the ICMPv6 protocol module calls a method in the scapy library to package 4 standard messages, 2 ping detection messages and a scene in the ICMPv6 protocol.
The framework logic of the present invention is shown in FIG. 3.
The module is explained in detail:
ICMPv6 module, ICMPv6 message format:
Ether | IPv6 | ICMPv6 | Options… |
the ICMPv6 message interaction is shown in fig. 4.
By using a standard protocol framework provided by a scapy library, three packet headers of Ether, IPv6 and ICMPv6 can be constructed by directly calling, and the packet headers need to be constructed according to actual conditions when the option part is reached.
Code:
the DHCPv6 module and DHCPv6 message interaction are shown in fig. 5.
DHCPV6 message format:
Ether | IPv6 | UDP | DHCPv6 | Options… |
by using a standard protocol framework provided by a scapy library, three packet headers of Ether, IPv6, UDP and DHCPv6 can be constructed by directly calling, and the packet headers need to be constructed according to actual conditions when the option part is reached.
Code:
the invention can realize the following test items:
1) ICMPv6 and DHCPv6 conventional protocol conformance scenarios;
2) DHCPv6 verifies the unconventional scene without any options such as IAPD and DNS;
3) and constructing an illegal message request or an illegal message server response scene.
Compared with the existing test verification method, the method has the following advantages:
1. time cost is reduced and resource utilization rate is improved; the DUT protocol support condition can be quickly established and verified only by understanding the composition of the message without additional equipment, the use requirement of the optical modem can be reduced, the special environment can be quickly realized, and other methods are not needed for verification.
2. Improving the quality and testing coverage of the IPV6 module; in the existing mirror image environment, various conventional and unconventional message responses or conditions can be simulated, abnormal test environment caused by external factors or abnormal test results caused by unstable environment is avoided, and the test coverage rate of the IPV6 module can be accurately prompted.
3. The reusability is strong: all projects with IPV6 modules can be tested by using the tool to construct message simulation test environment.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.
Claims (10)
1. A test method for verifying the consistency of an IPV6 protocol is characterized by comprising the following steps: step 1: confirming whether the server or the client is tested, if the server is tested, executing a server test flow, and if the client is tested, executing a client test flow;
the server test flow comprises the following steps:
step 21: creating a message;
step 22: if the response is the customized response, selecting an option construction package to be sent; if the response is a conventional response, direct transmission is not changed;
the client test process comprises the following steps:
step 31: creating a message;
step 32: if the request is a customization request, selecting an option construction package to be sent and then sending the option construction package; if it is a regular request, the direct transmission is not altered.
2. The method as claimed in claim 1, wherein when testing DHCPv6, in step 21, selecting DHCPv6_ advertise method to create advertise message; in the step 31, a dhcpv6_ solict method is selected to create a solict message.
3. The method according to claim 2, wherein when testing the DHCPv6, the server testing process further comprises the step 23: when the request message is received, the client side responds, and the client side test process comprises the following steps of 33: waiting for the server to give a reply response.
4. The method of claim 1, wherein when testing ICMPv6, in step 21, an ICMPv6_ ra method is selected to create an ra message; in step 31, an icmpv6_ rs method is selected to create an rs packet.
5. The method of claim 4, wherein when testing ICMPv6, the server test flow further comprises step 23: receiving the timing broadcast transmission, the client test procedure includes step 33: and waiting for the server to give an ra response, and otherwise, repeating the transmission at regular time.
6. A test system for verifying protocol conformance of IPV6, comprising:
a confirmation module: the client-side testing module is used for confirming whether the server or the client is tested, if the server is tested, the server testing module is operated, and if the client is tested, the client-side testing module is operated;
the server test module includes:
a creation module: used for creating a message;
a selection module: if the response is the customized response, selecting an option construction package to be sent; if the response is a conventional response, direct transmission is not changed;
the client test module comprises:
a creation unit: used for creating a message;
a selection unit: if the request is a customization request, selecting an option construction package to be sent and then sending the option construction package; if it is a regular request, the direct transmission is not altered.
7. The test system of claim 6, wherein when testing DHCPv6, in the creating module, a DHCPv6_ advertise method is selected to create an advertise message; in the creating unit, a method of dhcpv6_ Solicit is selected to create a Solicit message.
8. The testing system of claim 7, wherein when testing the DHCPv6, the server testing module further comprises a response module: the client test module is used for responding when receiving a request message, and further comprises a response unit: waiting for the server to give a reply response.
9. The test system according to claim 6, wherein when testing ICMPv6, in the creating module, an ICMPv6_ ra method is selected to create an ra message; in the creating unit, an icmpv6_ rs method is selected to create an rs message.
10. The test system of claim 9, wherein the server test module further comprises a broadcast module when testing ICMPv 6: the client test module is used for receiving the timing broadcast transmission and further comprises a response transmission module: for waiting for the server to give ra response, otherwise repeating the transmission periodically.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110240696.5A CN113037591A (en) | 2021-03-04 | 2021-03-04 | Test method and system for verifying IPV6 protocol consistency |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110240696.5A CN113037591A (en) | 2021-03-04 | 2021-03-04 | Test method and system for verifying IPV6 protocol consistency |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113037591A true CN113037591A (en) | 2021-06-25 |
Family
ID=76468037
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110240696.5A Pending CN113037591A (en) | 2021-03-04 | 2021-03-04 | Test method and system for verifying IPV6 protocol consistency |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113037591A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1909482A (en) * | 2005-08-05 | 2007-02-07 | 华为技术有限公司 | Method for realizing detection of DHCP service performance |
CN101043461A (en) * | 2007-04-24 | 2007-09-26 | 华为技术有限公司 | Method for testing DHCPv6 service and client |
CN101237354A (en) * | 2007-11-19 | 2008-08-06 | 北京天地互连信息技术有限公司 | A comprehensive testing method for DHCPv6 consistency |
KR101303030B1 (en) * | 2013-03-29 | 2013-09-03 | (주)넷맨 | Method for operating and searching host in internet protocol version 6 network |
CN105338125A (en) * | 2014-06-25 | 2016-02-17 | 华为技术有限公司 | Message processing method and apparatus |
-
2021
- 2021-03-04 CN CN202110240696.5A patent/CN113037591A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1909482A (en) * | 2005-08-05 | 2007-02-07 | 华为技术有限公司 | Method for realizing detection of DHCP service performance |
CN101043461A (en) * | 2007-04-24 | 2007-09-26 | 华为技术有限公司 | Method for testing DHCPv6 service and client |
CN101237354A (en) * | 2007-11-19 | 2008-08-06 | 北京天地互连信息技术有限公司 | A comprehensive testing method for DHCPv6 consistency |
KR101303030B1 (en) * | 2013-03-29 | 2013-09-03 | (주)넷맨 | Method for operating and searching host in internet protocol version 6 network |
CN105338125A (en) * | 2014-06-25 | 2016-02-17 | 华为技术有限公司 | Message processing method and apparatus |
Non-Patent Citations (2)
Title |
---|
T. NARTEN等: "Neighbor Discovery for IP version 6 (IPv6) amp;amp;lt; amp;amp;lt;a href= amp;quot;./draft-ietf-ipv6-2461bis-00.txt amp;quot; amp;amp;gt;draft-ietf-ipv6-2461bis-00.txt amp;amp;lt;/a amp;amp;gt; amp;amp;gt;", 《IETF》 * |
范小雨等: "DHCPv6协议一致性测试集的设计和实现", 《计算机工程》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111130931B (en) | Detection method and device for illegal external connection equipment | |
CN109167762B (en) | IEC104 message checking method and device | |
CN109525461B (en) | Network equipment testing method, device, equipment and storage medium | |
CN106534289B (en) | Automatic testing method, device and system | |
CN100536438C (en) | Method for testing DHCPv6 service and client | |
EP3809222B1 (en) | Vehicle remote diagnosis method and system | |
CN112333019B (en) | Router configuration and test method and system and readable storage medium | |
CN101958810A (en) | Method and system used for realizing fault positioning of intermediate node autonomously | |
CN114071791A (en) | User plane function information reporting method, access network equipment and core network equipment | |
CN113347580B (en) | Intelligent device network distribution method and device, electronic device and storage medium | |
CN115150377A (en) | Method and device for calling and processing simulation interface | |
CN114815782A (en) | Remote diagnosis method, apparatus, device and medium | |
CN111147285B (en) | Cloud security product unified management method | |
CN110445658B (en) | Message processing method and system | |
CN113037591A (en) | Test method and system for verifying IPV6 protocol consistency | |
CN104734939A (en) | Session keep-alive method and device | |
US9077635B2 (en) | Method and apparatus for network subnet discovery | |
CN105553935B (en) | A kind of data package processing method, device and terminal | |
CN111447302B (en) | Method and system for simulating multi-client to test DHCP (dynamic host configuration protocol) by using raw socket | |
CN114070816A (en) | Server message processing method, system, electronic equipment and readable storage medium | |
CN112738032B (en) | Communication system for preventing IP deception | |
CN106603348B (en) | A kind of method and system that simulation DHCP Offer floods | |
CN106789256B (en) | Test system and test method for simulating wide area network environment | |
CN111510331A (en) | Network fault analysis method, device, server and storage medium | |
CN114338633B (en) | Method and system for remotely connecting Linux server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210625 |