CN106603348B - A kind of method and system that simulation DHCP Offer floods - Google Patents

A kind of method and system that simulation DHCP Offer floods Download PDF

Info

Publication number
CN106603348B
CN106603348B CN201710079086.5A CN201710079086A CN106603348B CN 106603348 B CN106603348 B CN 106603348B CN 201710079086 A CN201710079086 A CN 201710079086A CN 106603348 B CN106603348 B CN 106603348B
Authority
CN
China
Prior art keywords
router
measured
dhcp
address
survey
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.)
Active
Application number
CN201710079086.5A
Other languages
Chinese (zh)
Other versions
CN106603348A (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.)
Huzhou Yinglie Intellectual Property Operation Co ltd
Original Assignee
Shanghai Feixun Data Communication Technology 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201710079086.5A priority Critical patent/CN106603348B/en
Publication of CN106603348A publication Critical patent/CN106603348A/en
Application granted granted Critical
Publication of CN106603348B publication Critical patent/CN106603348B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/32Flooding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]

Abstract

The invention discloses the methods that simulation DHCP Offer floods, comprising: test host sets up DHCP Offer packet;Router to be measured surveys router solicitation IP to accompanying by hub, and separated when obtaining the 1/2 of the lease phase of IP accompanies the connection surveyed between router and hub;It tests host and a large amount of DHCP Offer packets is sent to router to be measured by hub;Test host judges whether router to be measured obtains the source IP in DHCP Offer packet, if so, judging router DHCP dysfunction to be measured;Otherwise stop sending DHCP Offer packet, and the connection accompanied and surveyed between router and hub is re-established, judge that can router to be measured obtain to accompany and surveys the IP that router is sent, if, then judge that router DHCP function to be measured is normal, otherwise judges router DHCP dysfunction to be measured.The present invention solves the situation of test environmental resource anxiety at present.

Description

A kind of method and system that simulation DHCP Offer floods
Technical field
The invention belongs to testing field more particularly to a kind of method and system that simulation DHCP Offer floods.
Background technique
DHCP (Dynamic Host Configuration Protocol, DHCP) is DynamicHost setting agreement, it is The network protocol of one local area network.It is generally applied in large-scale LAN environment, main function is the management concentrated, divides With IP address, the host in network environment is made dynamically to obtain the information such as IP address, the address Gateway, dns server address, And it is able to ascend the utilization rate of address.Originally, do not occurred using flooding come test router DHCP function in laboratory environment, The case where being taken by mistake by environmental disturbances or taking address more and can not surf the Internet, which is to check just to find through client feedback scene 's.Although having test environment later, existing laboratory environment test resource is limited, can not fully achieve true ring The test in border, this needs to prepare multiple Dynamic Host Configuration Protocol server and different IP is arranged, while responding the DHCP of router sending Discover, which carrys out immersion simulations, to be tested, and test environmental resource is at full stretch, and test environment is costly, and does not test DHCP function Test resource is wasted when energy, test environment is complicated, needs someone to instruct operation, takes time and effort.
Summary of the invention
The present invention provides a kind of method and system that simulation DHCP Offer (DHCP supply message) floods, existing to solve There is the condition problem of the test environmental resource anxiety of the DHCP function of test router present in technology.
A kind of method that simulation DHCP Offer floods of the present invention, comprising steps of
Test host described in S100 sets up DHCP Offer packet;
S200 router to be measured, to survey router solicitation IP address is accompanied, is successfully obtained by hub to the router to be measured After getting the IP address for accompanying survey router distribution, at the 1/2 of lease phase, separated accompany is surveyed between router and hub Connection;
Test host described in S300 sends the DHCP Offer packet largely set up to router to be measured by hub, described DHCP Offer packet includes the source IP address for being supplied to the router to be measured;
Test host described in S400 judges whether the router to be measured obtains the source IP address in DHCP Offer packet, If so, entering step S500, S600 is otherwise entered step;
S500 judges the router DHCP dysfunction to be measured;
Test host described in S600 stops sending the DHCP Offer packet, and re-establishes to accompany and survey router and hub Between connection, judge the router to be measured can obtain accompany survey router send IP address, if so, entering step Otherwise S700 enters step S500;
S700 judges that router DHCP function to be measured is normal.
The invention discloses a kind of methods that simulation DHCP Offer floods, and are suitable for all-router.Mainly pass through DHCP Offer packet is set up, after router normally obtains IP address, when 1/2 time lease phase sent out DHCP Request, is disconnected With the connection for accompanying survey router (being equivalent to server) for distributing its IP address, then interference present in simulated environment is (a large amount of Issue DHCP Offer packet), the method that simulation DHCP Offer of the invention floods can be used to carry out test router can or can not Mistake takes address, judges the DHCP function of router.This method simple possible, is easy to operate and control, and test environment is simple, saves Test resource, reduces cost, improves testing efficiency, solve the DHCP function of test router existing in the prior art Test environmental resource anxiety condition problem.
Further, further includes: it is DHCP that net playing mode of router to be measured, which is arranged, in S010, and the rent accompanied and survey router is arranged Contract period;S020 will test host and hub wired connection, and router to be measured has with the hub respectively with survey router is accompanied Test environment is established in line connection.
Further, the step S200 includes:
Router to be measured described in S210 issues DHCP Discover message in a broadcast manner, and IP address is rented in request;
After accompanying survey router to receive the DHCP Discover message described in S220, sent to the router to be measured One DHCP Offer message surveys router and can be supplied to the IP address that router to be measured uses in the message comprising described accompany And the IP address for accompanying survey router itself;
After the router reception to be measured DHCP Offer message described in S230, the DHCP Request of a broadcast is issued Message, and accompany described in being added in the Option Field of the DHCP Request message and survey router address and the router to be measured The IP address of application;
It is sent after accompanying survey router to receive the DHCP Request message described in S240 and responds DHCP ACK message, and Increase the IP address of the router solicitation to be measured in the DHCP ACK message Option Field uses lease phase information;
After router to be measured described in S250 receives the DHCP ACK message, the IP for surveying router distribution is accompanied described in inspection Whether location is able to use, if then the router to be measured successfully obtains the IP address chosen, and according to the IP address Start continuity process automatically using the lease phase;
For S260 at 1/2 moment of lease phase for the IP address that the router to be measured obtains, disconnection, which is accompanied, surveys router and collection Communication connection between line device, the router to be measured can accompany survey router transmission DHCP Request message to re-rent to described IP address.
1/2 moment of selection lease phase disconnects the connection accompanied and survey router and hub, so that router to be measured and accompanying survey It can not be linked up by message between router and re-rent IP address matters, at this point, a large amount of external interferences are added, that is, sent a large amount of DHCP Offer message, sees whether router to be measured can be interfered by it, and mistake takes the IP address in interference message.
Further, the step S100 includes: and tests host described in S110 to set up a large amount of DHCP Offer by xcap Packet.This programme is using xcap software group packet, to realize that a kind of simulation DHCP Offer floods.Xcap is a windows hair Job contract tool, can read the network interface that place has from system.Xcap give out a contract for a project tool can on windows from specified interface The message of construction is sent, supports two kinds of simple sending strategys, first is that (being chosen with mouse) chosen is sent, second is that cycling through It is multiple.Xcap supports to construct common ether network packet, including arp, rarp, ipv4, ipv6, icmpv4, icmpv6, igmp, Udp, tcp, pim, ospf, rip, snmp, ppp, pppoe, ipsec (ah/esp) etc. and some messages being of little use, such as Fruit 802.3, STP etc..The various DHCP Offer packets of xcap software analog, to test exhaustive comprehensively.Xcap software Originally it is intrinsic environment in test protocol consistency function test envelope, there are a SOP reference documents, shirtsleeve operation allows tester's energy Enough quickly upper hands, have the advantages that easy to control, resource multiplex, high-efficient.In addition, be guarantee test quality and efficiency it is same When, lab resources, reasonable distribution, fixed test environment can also be saved, advantageously ensures that the accuracy of test result.
Further, the step S300 includes: that test host described in S310 passes through hub to the router to be measured The DHCP Offer packet largely set up is cycled through, the DHCP Offer packet includes the source IP for being supplied to the router to be measured Address.
The present invention also provides a kind of systems that simulation DHCP Offer floods, comprising: router to be measured accompanies survey to route Device, test host and hub, the router to be measured, accompany survey router and test host respectively with the wired company of the hub It connects, the test host includes: a group packet module, packet sending and receiving module and checks judgment module, and the packet sending and receiving module is distinguished It is connected with described group of packet module, inspection judgment module, in which:
The group packet module of the test host sets up DHCP Offer packet;
Router to be measured, to survey router solicitation IP address is accompanied, is successfully got by hub to the router to be measured It is separated at the 1/2 of lease phase to accompany the company surveyed between router and hub after the IP address for accompanying survey router distribution It connects;
The packet sending and receiving module of the test host sends described group of packet module to router to be measured by hub and sets up A large amount of DHCP Offer packet;
The inspection judgment module of the test host judges whether the router to be measured obtains the DHCP Offer Source IP address in packet;
If the inspection judgment module of the test host judges that the router to be measured obtains the DHCP Offer packet In source IP address, then judge the router DHCP dysfunction to be measured;
If the inspection judgment module of the test host judges that the DHCP Offer packet has not been obtained in the router to be measured In source IP address, then the packet sending and receiving module of the test host stops sending the DHCP Offer packet, re-establishes and accompanies The connection between router and hub is surveyed, the inspection judgment module of the test host further judges the router to be measured It can obtain to accompany and survey the IP address that router is sent, if so, the inspection judgment module of the test host judges routing to be measured Device DHCP function is normal, and otherwise the inspection judgment module of the test host judges the router DHCP dysfunction to be measured.
System of the invention is simple and easy to control, and test environment is fixed, and tester is upper quick-moving, high-efficient.This system may be used also Test resource is saved in multiplexing, and other than testing the router feature, which can also carry out the protocol tests such as ARP, port loophole Sweep test etc..
Further, the test host further includes the setup module being connected with the packet sending and receiving module, in which: described It is DHCP that net playing mode of router to be measured, which is arranged, in the setup module for testing host, and the lease phase accompanied and survey router is arranged.
Further, router to be measured passes through hub to survey router solicitation IP address is accompanied, to the router to be measured After successfully getting the IP address for accompanying survey router distribution, at the 1/2 of lease phase, separated accompany surveys router and line concentration Connection between device;Include:
The router to be measured issues DHCP Discover message in a broadcast manner, and IP address is rented in request;
Described accompany is surveyed after router receives the DHCP Discover message, sends one to the router to be measured DHCP Offer message surveys router and can be supplied to the IP address and institute that router to be measured uses in the message comprising described accompany State the IP address accompanied and survey router itself;
After the router to be measured receives the DHCP Offer message, the DHCP Request report of a broadcast is issued Text, and accompany described in being added in the Option Field of the DHCP Request message and survey router address and the router Shen to be measured IP address please;
It is described accompany to survey router and receive response DHCP ACK message is sent after the DHCP Request message, and described Increase the IP address of the router solicitation to be measured in DHCP ACK message Option Field uses lease phase information;
After the router to be measured receives the DHCP ACK message, the IP address for surveying router distribution is accompanied to be described in inspection It is no to be able to use, if then the router to be measured successfully obtains the IP address chosen, and used according to the IP address The lease phase starts continuity process automatically;
At 1/2 moment of lease phase for the IP address that the router to be measured obtains, disconnection, which is accompanied, surveys router and hub Between communication connection, the router to be measured can to it is described accompany survey router send DHCP Request message come with re-renting IP Location.
Further, the group packet module of the test host sets up DHCP Offer packet by xcap software.
Further, the packet sending and receiving module of the test host is cycled through by hub to the router to be measured The DHCP Offer packet largely set up, the DHCP Offer packet include the source IP address for being supplied to the router to be measured.
The present invention has the beneficial effect that:
(1) various DHCP Offer packets are set up in simulation, test exhaustive comprehensively.
(2) environment reusable is tested, without using multiple servers, saves test resource and space utilization.And the environment The protocol tests such as ARP, the test of port vulnerability scanning etc. can also be carried out.
(3) test environment is fixed, and guarantees test quality.
(4) easy to operate, test environment is easy to control, and operator is easy to get started.
(5) at low cost, while reducing cost, also improve testing efficiency.
In conclusion the present invention has many advantages, such as to guarantee test quality, saves test resource, improves testing efficiency.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly introduced, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this For the those of ordinary skill in field, without any creative labor, it can also be obtained according to these attached drawings His attached drawing.
Fig. 1 is a kind of one flow chart of embodiment of the method that simulation DHCP Offer floods of the present invention;
Fig. 2 is router DHCP lease to be measured in a kind of another embodiment of method that simulation DHCP Offer floods of the present invention Process flow diagram flow chart;
Fig. 3 is a kind of system embodiment block diagram that simulation DHCP Offer floods of the present invention;
Fig. 4 is a kind of system embodiment topological diagram that simulation DHCP Offer floods of the present invention;
Fig. 5 is a kind of another embodiment flow chart of method that simulation DHCP Offer floods of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention make into It is described in detail to one step, it is clear that the described embodiments are only some of the embodiments of the present invention, rather than whole implementation Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts All other embodiment, shall fall within the protection scope of the present invention.
The invention discloses a kind of method that simulation DHCP Offer floods, embodiment one as shown in Figure 1, comprising steps of
Test host described in S100 sets up DHCP Offer packet;
S200 router to be measured, to survey router solicitation IP address is accompanied, is successfully obtained by hub to the router to be measured After getting the IP address for accompanying survey router distribution, at the 1/2 of lease phase, separated accompany is surveyed between router and hub Connection;
Test host described in S300 sends the DHCP Offer packet largely set up to router to be measured by hub, described DHCP Offer packet includes the source IP address for being supplied to the router to be measured;
Test host described in S400 judges whether the router to be measured obtains the source IP address in DHCP Offer packet, If so, entering step S500, S600 is otherwise entered step;
S500 judges the router DHCP dysfunction to be measured;
Test host described in S600 stops sending the DHCP Offer packet, and re-establishes to accompany and survey router and hub Between connection, judge the router to be measured can obtain accompany survey router send IP address, if so, entering step Otherwise S700 enters step S500;
S700 judges that router DHCP function to be measured is normal.
The present embodiment simulates the test environment that DHCP Offer floods, and serves as a server with survey router is accompanied, A large amount of DHCP Offer packets, which are set up, with test host realizes that simulation DHCP floods.Firstly, test host first sets up a large amount of DHCP Offer packet, first group, which is built up, does not send, builds the phenomenon that floods to subsequent send together.Survey routing is accompanied to act as a server Role, therefore, tested routing first surveys router (being equivalent to server) application IP address to accompanying, and can see with normally obtaining IP Location.If tested routing can successfully obtain the IP address accompanied and survey route assignment, at the 1/2 of the lease phase of this IP address Between this moment, disconnect the connection accompanied and survey router and hub, then allow test host by hub to router to be measured A large amount of DHCP Offer packets that group is built up before are sent, this DHCP Offer packet the inside is used containing router to be measured is supplied to IP, referred to herein as source IP.Note that source IP here is not with the IP address for accompanying survey router to be supplied to router to be measured before It this message and accompanies before because being here the message testing the counterfeit server of host and initiating and surveys router and divide in the same address Give the DHCP Offer message of router to be measured other than the IP address of offer is different with IP address, remaining difference is little.Very Extremely, in fraud of router to be measured, the IP for the sender that the DHCP Offer message that test host is sent includes are also not The really IP address of oneself, but disguise oneself as and accompany survey router, the IP for the sender for including in the message, which is accompanied, surveys router IP.Therefore, if router to be measured does not carry out further verifying confirmation to message, the DHCP of test host transmission is just obtained If source IP address in Offer message, then illustrate that exception occurs in the router DHCP function to be measured.That is, then Judge the source IP address that router to be measured is tested either with or without acquisition in the DHCP Offer packet that host is sent, if obtain Words, then illustrate the DHCP dysfunction of the router to be measured.If not obtaining, reconnects to accompany and survey router and collection Cable between line device establishes connection, and re-inspection judges that router to be measured accompanies the IP for surveying router and providing either with or without acquisition, if It can get to accompany after in connection and survey the IP that router provides, then illustrate that the router DHCP function to be measured is normal, cannot obtain Words, then judge the router DHCP dysfunction to be measured.
The method of the present embodiment is simple and easy, goes back reusable, saves test resource, without providing multiple DHCP services Device solves the situation of test environmental resource anxiety by simulating the method that DHCP floods.Reduce cost, improves test effect Rate, and the quality tested is guaranteed.
Preferably, before the test of above-described embodiment starts, it is also necessary to be arranged accordingly, build test environment. Specifically, it is DHCP that net playing mode of router to be measured, which is arranged, and be set, such as 1 minute the lease phase accompanied and survey router, will test Host and hub wired connection, certainly, router to be measured and accompanying survey router respectively with the hub wired connection, such as This, has put up test environment.
Preferably, in the above-described embodiments, in the step S100, test host sets up a large amount of DHCP Offer packets, I Can be set up using xcap software, xcap software is originally intrinsic environment in test protocol consistency function test envelope, is had SOP reference documents, shirtsleeve operation allow tester that can quickly go up hand, do not know about the tester of test environment, it is only necessary to It can be tested referring to SOP document;Furthermore there is the advantages that easy to control, resource multiplex, high-efficient.
Preferably, in above-described embodiment, as shown in Fig. 2, the step S200 comprising steps of
Router to be measured described in S210 issues DHCP Discover message in a broadcast manner, and IP address is rented in request;
After accompanying survey router to receive the DHCP Discover message described in S220, sent to the router to be measured One DHCP Offer message surveys router and can be supplied to the IP address that router to be measured uses in the message comprising described accompany And the IP address for accompanying survey router itself;
After the router reception to be measured DHCP Offer message described in S230, the DHCP Request of a broadcast is issued Message, and accompany described in being added in the Option Field of the DHCP Request message and survey router address and the router to be measured The IP address of application;
It is sent after accompanying survey router to receive the DHCP Request message described in S240 and responds DHCP ACK message, and Increase the IP address of the router solicitation to be measured in the DHCP ACK message Option Field uses lease phase information;
After router to be measured described in S250 receives the DHCP ACK message, the IP for surveying router distribution is accompanied described in inspection Whether location is able to use, if then the router to be measured successfully obtains the IP address chosen, and according to the IP address Start continuity process automatically using the lease phase;
For S260 at 1/2 moment of lease phase for the IP address that the router to be measured obtains, disconnection, which is accompanied, surveys router and collection Communication connection between line device, the router to be measured can accompany survey router transmission DHCP Request message to re-rent to described IP address.
After the half the time (i.e. 1/2 moment of lease phase) for reaching validity period as defined in lease, router to be measured just into Enter " re-renting state ", router to be measured (can accompany and survey router) unicast to send to the Dynamic Host Configuration Protocol server for distributing IP address for it DHCP REQUEST message, to carry out the update of IP lease.If as Dynamic Host Configuration Protocol server accompany survey that router thinks can be after It is continuous to use, a confirmation message will be returned to router to be measured, router to be measured so successfully re-rents IP address.If accompanying survey Router thinks the IP address to be distributed to the router to be measured again, then it is new to be notified that router to be measured cannot obtain Lease.If router to be measured can be when reaching 7/8 in the lease time limit in the renewed treaty operation failure that the half the time of lease carries out (87.5%) when, if there is no the confirmation message of server, which is just recycled by server.Client computer must weigh The new application process for starting lease.Therefore, it is disconnected at 1/2 moment of lease phase and accompanies the communication connection for surveying router and hub, Fail to receive lease message or the answer message re-rented can not be returned to be given to router to be measured so that accompanying and surveying router, at this point, A large amount of DHCP Offer packets are sent by test host again, disguises oneself as and accompanies survey router, simulation DHCP Offer floods, and detects road By the DHCP function of device.
Preferably, test host can be by the way of cycling through, by establishment in the step S300 of embodiment one kind A large amount of DHCP Offer packet loop is sent to router to be measured.
Based on the same technical idea, the embodiment of the present invention also provides a kind of system that simulation DHCP Offer floods, should Above method embodiment can be performed in system.The system that simulation DHCP Offer provided in an embodiment of the present invention floods, such as Fig. 3 institute Show, comprising: router 10 to be measured accompanies and surveys router 20, test host 30 and hub 40, and the router 10 to be measured accompanies survey Router 20 and test host 30 respectively with 40 wired connection of hub, the test host 30 include: a group packet module 31, Packet sending and receiving module 32 and inspection judgment module 33, the packet sending and receiving module 32 are sentenced with described group of packet module 31, inspection respectively Disconnected module 33 is connected, in which:
The group packet module 31 of the test host 30 sets up DHCP Offer packet;
The router to be measured 10 passes through hub 40 to survey 20 IP address requesting of router is accompanied, to the router to be measured After 10 successfully get the IP address for accompanying survey router 20 to distribute, at the 1/2 of lease phase, separated accompany surveys router 20 With the connection between hub 40;
The packet sending and receiving module 32 of the test host 30 sends described group of packet to router 10 to be measured by hub 40 The a large amount of DHCP Offer packet that module 31 is set up;
The inspection judgment module 33 of the test host 30 judges whether the router to be measured 10 obtains the DHCP Source IP address in Offer packet;
If the inspection judgment module 33 of the test host 30 judges that the router to be measured 10 obtains the DHCP Source IP address in Offer packet then judges the router 10DHCP dysfunction to be measured;
If the inspection judgment module 33 of the test host 30 judges that the DHCP has not been obtained in the router to be measured 10 Source IP address in Offer packet, then the packet sending and receiving module 32 of the test host 30 stops sending the DHCP Offer packet, The connection accompanied and surveyed between router 20 and hub 40 is re-established, the inspection judgment module 33 of the test host 30 is further Judge that can the router to be measured 10 obtain to accompany and surveys the IP address that router 20 is sent, if so, the test host 30 Check that judgment module 33 judges that router 10DHCP function to be measured is normal, otherwise the inspection judgment module 33 of the test host 30 Judge the DHCP dysfunction of the router to be measured 10.
This system saves test resource, and other than testing the function, which can also carry out the protocol tests such as ARP, port Vulnerability scanning test etc..High-efficient, test environment is fixed, and is easily understood, tester is upper quick-moving.Be guarantee test quality with While efficiency, lab resources, reasonable distribution, fixed test environment can also be saved, advantageously ensures that the standard of test result True property.
Preferably, the test host 30 in above-described embodiment further includes the setting mould being connected with the packet sending and receiving module 32 Block 34, in which: it is DHCP that 10 network access of router to be measured, which is arranged, in the setup module 34 of the test host 30, and is arranged and accompanies survey The lease phase of router 20.Since this system floods for simulating DHCP Offer, the lease phase is set for testing, therefore generally It is set to 1 minute, the setting lease phase too long will affect testing efficiency.
Preferably, the group packet module 31 of the test host 30 of above-described embodiment one kind sets up DHCP by xcap software Offer packet.Xcap software is originally intrinsic environment in test protocol consistency function test envelope, has SOP reference documents, simply Operation allows tester that can quickly go up hand, has the advantages that easy to control, resource multiplex, high-efficient.
Preferably, in the system that the simulation DHCP Offer of above-described embodiment one kind floods, the router 10 to be measured By hub 40 to survey 20 IP address requesting of router is accompanied, described accompany successfully is got to the router 10 to be measured and surveys routing It is separated at the 1/2 of lease phase to accompany the connection surveyed between router 20 and hub 40 after the IP address that device 20 distributes;This Process includes:
The router to be measured 10 issues DHCP Discover message in a broadcast manner, and IP address is rented in request;
Described accompany is surveyed after router 20 receives the DHCP Discover message, is sent to the router 10 to be measured One DHCP Offer message surveys router 20 and can be supplied to the IP that router 10 to be measured uses in the message comprising described accompany Address and the IP address for accompanying survey router 20 itself;
After the router to be measured 10 receives the DHCP Offer message, the DHCP Request report of a broadcast is issued Text, and accompany described in being added in the Option Field of the DHCP Request message and survey 20 address of router and the router to be measured The IP address of 10 applications;
It is described accompany to survey router 20 and receive response DHCP ACK message is sent after the DHCP Request message, and in institute That states the IP address for increasing that the router to be measured 10 is applied in DHCP ACK message Option Field uses lease phase information;
After the router to be measured 10 receives the DHCP ACK message, the IP for surveying that router 20 distributes is accompanied described in inspection Whether location is able to use, if then the router to be measured 10 successfully obtains the IP address chosen, and according to the IP Location starts continuity process using the lease phase automatically;
At 1/2 moment of lease phase for the IP address that the router 10 to be measured obtains, disconnection, which is accompanied, surveys router 20 and collection Communication connection between line device 40, the router 10 to be measured can survey the transmission DHCP Request message of router 20 to described accompany To re-rent IP address.
Preferably, based on any of the above embodiments, the packet sending and receiving module 32 of the test host 30 passes through collection Line device 40 cycles through the DHCP Offer packet largely set up to the router 10 to be measured, and the DHCP Offer packet includes to mention Supply the source IP address of the router to be measured 10.A large amount of DHCP Offer packets that group is built up are cycled through so that immersion simulations Effect is more preferable.
Another embodiment of the present invention, system of the invention are tested using method of the invention, simulation DHCP The method that Offer floods is suitable for all-router.Mainly set up manually using xcap software
DHCP Offer packet, after router obtains address, when 1/2 time lease phase sent out DHCP Request, analog loop Interference present in border (a large amount of to issue DHCP Offer packet) wrong can or can not take the test problems such as address to solve router.
Basic, specific test flow chart is detailed in Fig. 5:
S501 builds test environment: it is DHCP that net playing mode of router, which is arranged, in PC, and the survey router lease phase is accompanied to be set as 1 point PC is connect by clock, arrangement above with HUB after the completion, and specific environment topological diagram is as shown in Figure 4;
S502 sets up DHCP Offer packet: by the message organized in testing protocol consistency environment, purpose MAC (ff: Except ff:ff:ff:ff:ff/01:00:5e:01:01:01) it is revised as LAN mouthfuls of MAC of router;
S503 router normally obtains address;
S504, which is disconnected, accompanies the cable surveyed between router and HUB: after router normally obtains address, the lease phase 1/2 when Between (30s) disconnect the cable accompanied and surveyed between router and HUB;
S505 sends DHCP Offer packet: protocol test PC cycles through a large amount of source IPs to router and is 192.168.1.170 DHCP Offer packet;
S506 checks that router obtains IP situation: checking router either with or without address in acquisition offer packet 192.168.1.170;S510 is entered step if any, otherwise enters S507;
S507 stops paying out DHCP Offer packet: if router does not obtain address 192.168.1.170 in offer packet;Association View test PC stops sending DHCP Offer packet;
The cable surveyed between router and HUB is accompanied in S508 reconnection;
S509 checks that router obtains IP situation: check whether router can correctly obtain address, if then entering S511, Otherwise enter S510;
S510 judges router DHCP dysfunction;
S511 judges that router DHCP function is normal.
Compared with existing best technique, the present invention has the advantages that
It is easy to control: not know about the tester of test environment, need to can only be tested referring to SOP document;
Reusable: test resource is saved, other than testing the function, which can also carry out the protocol tests such as ARP, port Vulnerability scanning test etc.;
High-efficient: test environment is fixed, and is easily understood, tester is upper quick-moving.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of method that simulation DHCP Offer floods, which is characterized in that comprising steps of
S100, which tests host, sets up DHCP Offer packet, and the DHCP Offer packet is that counterfeit accompany of test host surveys router initiation Message;
S200 router to be measured surveys router solicitation IP address to described accompany by hub, successfully obtains to the router to be measured After getting the IP address for accompanying survey router distribution, at the 1/2 of the lease phase of the IP address accompanied and survey router distribution The separated connection accompanied between survey router and the hub;
Test host described in S300 sends the DHCP Offer packet largely set up to the router to be measured by the hub, The DHCP Offer packet includes the source IP address that the test host is supplied to the router to be measured;
Test host described in S400 judges whether the router to be measured obtains the source IP address in DHCP Offer packet, if It is then to enter step S500, otherwise enters step S600;
S500 judges the router DHCP dysfunction to be measured;
Test host described in S600 stops sending the DHCP Offer packet, and re-establishes described accompany and survey router and the collection Connection between line device judges that can the router to be measured obtain to accompany and surveys the IP address that router is sent, if so, entering step Rapid S700, otherwise enters step S500;
S700 judges that router DHCP function to be measured is normal.
2. a kind of method that simulation DHCP Offer floods according to claim 1, which is characterized in that further include:
It is DHCP that the net playing mode of router to be measured, which is arranged, in S010, and the lease phase for surveying router is accompanied described in setting;
S020 is by the test host and the hub wired connection, and the survey router and described accompany survey router difference With the hub wired connection, test environment is established.
3. a kind of method that simulation DHCP Offer floods according to claim 1, which is characterized in that the step S200 Comprising steps of
Router to be measured described in S210 issues DHCP Discover message in a broadcast manner, and IP address is rented in request;
After accompanying survey router to receive the DHCP Discover message described in S220, one is sent to the router to be measured DHCP Offer message surveys router and can distribute to IP address and the institute of the router to be measured in the message comprising described accompany State the IP address accompanied and survey router itself;
After the router reception to be measured DHCP Offer message described in S230, the DHCP Request report of a broadcast is issued Text, and accompany described in being added in the Option Field of the DHCP Request message and survey router address and described accompany surveys router point The IP address of router to be measured described in dispensing;
It accompanies to survey after router receives the DHCP Request message described in S240 and sends response DHCP ACK message, and described The use for surveying the IP address that router distributes to the router to be measured is accompanied to rent described in increasing in DHCP ACK message Option Field Contract period information;
After router to be measured described in S250 receives the DHCP ACK message, the IP address for surveying router distribution is accompanied to be described in inspection It is no to be able to use, if then the router to be measured successfully obtains the IP address accompanied and survey router distribution, and according to described IP address starts continuity process using the lease phase automatically;
S260 is surveyed at 1/2 moment of lease phase for the IP address that router distributes to the router to be measured in described accompany, and disconnects institute The communication connection accompanied and surveyed between router and the hub is stated, the router to be measured can survey router transmission to described accompany DHCP Request message re-rents IP address.
4. a kind of method that simulation DHCP Offer floods according to claim 1, which is characterized in that the step S100 Comprising steps of
Test host described in S110 sets up a large amount of DHCP Offer packets by xcap.
5. a kind of method that simulation DHCP Offer floods according to claim 1-4, which is characterized in that described Step S300 comprising steps of
Test host described in S310 cycles through the DHCP largely set up to the router to be measured by the hub Offer packet, the DHCP Offer packet include the source IP address for being supplied to the router to be measured.
6. a kind of system that simulation DHCP Offer floods characterized by comprising router to be measured accompanies and surveys router, test Host and hub, the router to be measured accompany and survey router and test host respectively with the hub wired connection, described Test host include: a group packet module, packet sending and receiving module and check judgment module, the packet sending and receiving module respectively with it is described Group packet module checks that judgment module is connected, in which:
The group packet module of the test host sets up DHCP Offer packet, and the DHCP Offer packet is to test that host is counterfeit accompanies survey The message that router is initiated;
The router to be measured, to survey router solicitation IP address is accompanied, is successfully obtained by the hub to the router to be measured After getting the IP address for accompanying survey router distribution, at the 1/2 of the lease phase of the IP address accompanied and survey router distribution The separated connection accompanied between survey router and the hub;
The packet sending and receiving module of the test host sends described group of packet module to the router to be measured by the hub The a large amount of DHCP Offer packet set up, the DHCP Offer packet include that the test host is supplied to the router to be measured Source IP address;
The inspection judgment module of the test host judges whether the router to be measured obtains in the DHCP Offer packet Source IP address;
If the inspection judgment module of the test host judges that the router to be measured obtains in the DHCP Offer packet Source IP address then judges the router DHCP dysfunction to be measured;
If the inspection judgment module of the test host judges that the router to be measured has not been obtained in the DHCP Offer packet Source IP address, then the packet sending and receiving module of the test host stops sending the DHCP Offer packet, re-establishes described accompany The connection between router and the hub is surveyed, the inspection judgment module of the test host further judges the road to be measured Can the IP address that survey router be accompanied to send be obtained by device, if so, the inspection judgment module judgement of the test host The router DHCP function to be measured is normal, and otherwise the inspection judgment module of the test host judges the router to be measured DHCP dysfunction.
7. a kind of system that simulation DHCP Offer floods according to claim 6, which is characterized in that the test host It further include the setup module being connected with the packet sending and receiving module, in which:
It is DHCP that the net playing mode of router to be measured, which is arranged, in the setup module of the test host, and accompanies survey to route described in setting The lease phase of device.
8. a kind of system that simulation DHCP Offer floods according to claim 6, which is characterized in that router to be measured is logical Hub is crossed to survey router solicitation IP address is accompanied, described accompany successfully is got to the router to be measured and surveys router distribution After IP address, at the 1/2 of the lease phase for accompanying the IP address for surveying router distribution, separated accompany surveys router and hub Between connection;Include:
The router to be measured issues DHCP Discover message in a broadcast manner, and IP address is rented in request;
Described accompany is surveyed after router receives the DHCP Discover message, sends a DHCP to the router to be measured Offer message surveys router and can distribute to the IP address of the router to be measured and described accompany in the message comprising described accompany Survey the IP address of router itself;
After the router to be measured receives the DHCP Offer message, the DHCP Request message of a broadcast is issued, and Survey router address and described accompany is accompanied to survey router point described in being added in the Option Field of the DHCP Request message The IP address of dispensing router to be measured;
It is described accompany to survey router and receive response DHCP ACK message is sent after the DHCP Request message, and in the DHCP Survey router is accompanied to distribute to believing using the lease phase for the IP address of the router to be measured described in increasing in ACK message Option Field Breath;
After the router to be measured receives the DHCP ACK message, the IP address for surveying router distribution is accompanied whether described in inspection It is enough to use, if then the router to be measured successfully obtains the IP address accompanied and survey router distribution, and according to the IP Location starts continuity process using the lease phase automatically;
It surveys at 1/2 moment of lease phase for the IP address that router distributes to the router to be measured in described accompany, is accompanied described in disconnection The communication connection between router and the hub is surveyed, the router to be measured can survey router transmission DHCP to described accompany Request message re-rents IP address.
9. a kind of system that simulation DHCP Offer floods according to claim 6, which is characterized in that the test host Group packet module pass through xcap set up DHCP Offer packet.
10. according to a kind of described in any item systems that simulation DHCP Offer floods of claim 6-9, it is characterised in that:
The packet sending and receiving module of the test host cycles through a large amount of establishments to the router to be measured by the hub DHCP Offer packet, the DHCP Offer packet includes to be supplied to the source IP address of the router to be measured.
CN201710079086.5A 2017-02-14 2017-02-14 A kind of method and system that simulation DHCP Offer floods Active CN106603348B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710079086.5A CN106603348B (en) 2017-02-14 2017-02-14 A kind of method and system that simulation DHCP Offer floods

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710079086.5A CN106603348B (en) 2017-02-14 2017-02-14 A kind of method and system that simulation DHCP Offer floods

Publications (2)

Publication Number Publication Date
CN106603348A CN106603348A (en) 2017-04-26
CN106603348B true CN106603348B (en) 2019-10-11

Family

ID=58587488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710079086.5A Active CN106603348B (en) 2017-02-14 2017-02-14 A kind of method and system that simulation DHCP Offer floods

Country Status (1)

Country Link
CN (1) CN106603348B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108667953A (en) * 2018-04-27 2018-10-16 四川斐讯信息技术有限公司 A kind of the lease function test method and system, test device of DHCP service

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101453495A (en) * 2008-12-30 2009-06-10 杭州华三通信技术有限公司 Method, system and equipment for preventing authentication address resolution protocol information loss
CN102438028A (en) * 2012-01-19 2012-05-02 神州数码网络(北京)有限公司 Method, device and system for preventing fraud of dynamic host configuration protocol (DHCP) server
CN103701825A (en) * 2013-12-31 2014-04-02 工业和信息化部电子第五研究所 Security testing system oriented to mobile intelligent terminal IPv6 protocol and application of protocol
EP2757743A1 (en) * 2011-11-16 2014-07-23 Huawei Technologies Co., Ltd Method, device, apparatus and system for generation of dhcp snooping binding table
CN104009967A (en) * 2013-02-27 2014-08-27 上海斐讯数据通信技术有限公司 Method for preventing attack of untrusted servers
CN105323120A (en) * 2015-11-26 2016-02-10 上海斐讯数据通信技术有限公司 Test method, test device and test terminal for DHCP service side

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101453495A (en) * 2008-12-30 2009-06-10 杭州华三通信技术有限公司 Method, system and equipment for preventing authentication address resolution protocol information loss
EP2757743A1 (en) * 2011-11-16 2014-07-23 Huawei Technologies Co., Ltd Method, device, apparatus and system for generation of dhcp snooping binding table
CN102438028A (en) * 2012-01-19 2012-05-02 神州数码网络(北京)有限公司 Method, device and system for preventing fraud of dynamic host configuration protocol (DHCP) server
CN104009967A (en) * 2013-02-27 2014-08-27 上海斐讯数据通信技术有限公司 Method for preventing attack of untrusted servers
CN103701825A (en) * 2013-12-31 2014-04-02 工业和信息化部电子第五研究所 Security testing system oriented to mobile intelligent terminal IPv6 protocol and application of protocol
CN105323120A (en) * 2015-11-26 2016-02-10 上海斐讯数据通信技术有限公司 Test method, test device and test terminal for DHCP service side

Also Published As

Publication number Publication date
CN106603348A (en) 2017-04-26

Similar Documents

Publication Publication Date Title
US9847965B2 (en) Asset detection system
EP2837159B1 (en) System asset repository management
US8954573B2 (en) Network address repository management
CN105743684B (en) The configuration method and router of router under a kind of ap mode
US9225671B2 (en) Auto management of a virtual device context enabled network infrastructure
CN102025792B (en) Router and IP address setting method thereof
JP2013511207A5 (en)
CN104579887A (en) Cloud gateway as well as cloud gateway creation and configuration system and method
CN105847343B (en) Public network information detection method, apparatus and system for point-to-point transmission
CN103516567A (en) Method and system for equipment discovery and server
CN106131235A (en) A kind of IP address configuration method
CN101179515A (en) Method and device for inhibiting black hole routing
US20140280467A1 (en) Method of managing port dhcp server protocol addresses
CN103401954B (en) The implementation method of virtual DHCP
CN106603348B (en) A kind of method and system that simulation DHCP Offer floods
CN102075588B (en) Method and system for realizing network address translation (NAT) transversing and equipment
CN102594839A (en) Method for distinguishing pseudo dynamic host configuration protocol (DHCP) servers and switchboards
CN104506405B (en) The method and device of cross-domain access
CN105338131B (en) The test method and system of a kind of Dynamic Host Configuration Protocol server address tankage
CN107025084A (en) virtual desktop sharing method and device
CN206149319U (en) Internet video shared device
CN104780230A (en) Method of automatically acquiring cloud server IP address, system and cloud system
CN106506236A (en) The methods, devices and systems that a kind of WAP is declared automatically
CN103516820A (en) Port forwarding method and apparatus based on MAC address
CN111447302B (en) Method and system for simulating multi-client to test DHCP (dynamic host configuration protocol) by using raw socket

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201105

Address after: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

Address before: 201616 Shanghai city Songjiang District Sixian Road No. 3666

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240410

Address after: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Country or region after: China

Address before: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou Jiji Intellectual Property Operation Co.,Ltd.

Country or region before: China