CN105323120A - Test method, test device and test terminal for DHCP service side - Google Patents

Test method, test device and test terminal for DHCP service side Download PDF

Info

Publication number
CN105323120A
CN105323120A CN201510844013.1A CN201510844013A CN105323120A CN 105323120 A CN105323120 A CN 105323120A CN 201510844013 A CN201510844013 A CN 201510844013A CN 105323120 A CN105323120 A CN 105323120A
Authority
CN
China
Prior art keywords
dhcp
address
server side
test
packet
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
Application number
CN201510844013.1A
Other languages
Chinese (zh)
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.)
Shanghai Feixun Data Communication Technology 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 CN201510844013.1A priority Critical patent/CN105323120A/en
Publication of CN105323120A publication Critical patent/CN105323120A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a test method, test device and test terminal for a DHCP service side. The test terminal configures predetermined address interval distribution rules of the DHCP service side; the test terminal generates a DHCP test data packet used for simulating a network environment required by a test and sends the DHCP test data packet to the DHCP service side; the test terminal captures a DHCP service provision data packet returned by the DHCP service side, wherein the DHCP service provision data packet contains a distributed IP address of the DHCP service side corresponding to the DHCP test data packet; and the test terminal extracts the IP address from the DHCP service provision data packet, and checks whether the address interval in which the IP address is satisfies the predetermined address interval distribution rules. The problem of incomplete device type coverage is solved, a test process is simplified, and device starting and switching time is omitted.

Description

The method of testing of DHCP server side, testing apparatus and test terminal
Technical field
The present invention relates to networking technology area, particularly relate to the method for testing of DHCP server side, testing apparatus and test terminal.
Background technology
Current DHCP server side, such as server, gateway etc., test, if but to test under different network environments, such as relate to the test of the equipment of dissimilar or different vendor, in actual test site, be difficult to get all the corresponding Devices to test of all kinds ready, cost also can be caused to waste even if get all the ready.
Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide the method for testing of DHCP server side, testing apparatus and test terminal, for solving the problem that test terminal type in prior art is difficult to cover comprehensively.
For achieving the above object and other relevant objects, the invention provides a kind of method of testing of DHCP server side, be applied to the test terminal connecting described DHCP server side; Described method comprises: described test terminal configures the interval allocation rule of presumptive address of described DHCP server side; Described test terminal generates the DHCP test packet being used for simulation test demand network environment, and sends to DHCP server side; Described test terminal is caught the DHCP service that DHCP server side returns and is provided packet, wherein, and the IP address that described DHCP service provides packet to comprise the corresponding described DHCP test data of DHCP server side to be responsible for assigning; Described test terminal provides packet to extract described IP address from DHCP service, and checks its address interval whether to meet the interval allocation rule of described presumptive address.
In one embodiment of the invention, described generation is used for the DHCP test packet of simulation test demand network environment, comprising: the DHCP request packet being obtained DHCP server side reception by described trapping module; Editor institute obtains DHCP request packet and preserves to generate described DHCP test packet, described editor comprise following at least one: the target MAC (Media Access Control) address 1) in amendment DHCP request packet is that broadcast address or specific DHCP server side MAC Address are to simulate the sight to multiple or specific DHCP server side request DHCP service; 2) revise source MAC in DHCP request packet and client mac address and be all broadcast address or particular clients MAC Address to simulate sight that is multiple or particular clients request DHCP service; 3) each Option field contents in amendment DHCP request packet is to simulate different Option function.
In one embodiment of the invention, the Option field of described amendment comprises Option60 field, for revising the client simulating distinct device type.
In one embodiment of the invention, the address section that described presumptive address interval allocation rule definition often kind of device type is corresponding different.
For achieving the above object and other relevant objects, the invention provides a kind of DHCP server side testing apparatus, be applied to the test terminal connecting described DHCP server side; Described method comprises: configuration module, the interval allocation rule of the presumptive address for configuring described DHCP; Test packet generation module, for generating the DHCP test packet of simulation test demand network environment, and sends to DHCP server side; Trapping module, the DHCP service returned for catching DHCP server side provides packet, wherein, the IP address that described DHCP service provides packet to comprise the corresponding described DHCP test data of DHCP server side to be responsible for assigning; Detection module, for providing packet to extract described IP address from DHCP service, and checks its address interval whether to meet the interval allocation rule of described presumptive address.
In one embodiment of the invention, the generation of described test packet generation module is used for the DHCP test packet of simulation test demand network environment, comprising: the DHCP request packet being obtained DHCP server side reception by described trapping module; Editor institute obtains DHCP request packet and preserves to generate described DHCP test packet, described editor comprise following at least one: the target MAC (Media Access Control) address 1) in amendment DHCP request packet is that broadcast address or specific DHCP server side MAC Address are to simulate the sight to multiple or specific DHCP server side request DHCP service; 2) revise source MAC in DHCP request packet and client mac address and be all broadcast address or particular clients MAC Address to simulate sight that is multiple or particular clients request DHCP service; 3) each Option field contents in amendment DHCP request packet is to simulate different Option function.
In one embodiment of the invention, the Option field of described amendment comprises Option60 field, for revising the client simulating distinct device type.
In one embodiment of the invention, the interval allocation rule of described presumptive address defines address section corresponding to described presumptive address interval allocation rule definition often kind of device type.
For achieving the above object and other relevant objects, the invention provides a kind of test terminal, the testing apparatus described in application.
As mentioned above, the method for testing of DHCP server side of the present invention, testing apparatus and test terminal, described test terminal configures the interval allocation rule of presumptive address of described DHCP server side; Described test terminal generates the DHCP test packet being used for simulation test demand network environment, and sends to DHCP server side; Described test terminal is caught the DHCP service that DHCP server side returns and is provided packet, wherein, and the IP address that described DHCP service provides packet to comprise the corresponding described DHCP test data of DHCP server side to be responsible for assigning; Described test terminal provides packet to extract described IP address from DHCP service, and checks its address interval whether to meet the interval allocation rule of described presumptive address; Solve device type and cover not problem comprehensively, simplify test process, eliminate the time of device start, switching.
Accompanying drawing explanation
Fig. 1 is shown as the schematic flow sheet of the method for testing of the DHCP server side of the present invention in an embodiment.
Fig. 2 is shown as the structural representation of the DHCPDiscovery packet of the present invention in an embodiment.
Fig. 3 is shown as the structural representation of the DHCPOffer packet of the present invention in an embodiment.
Fig. 4 is shown as the testing apparatus of the DHCP server side of the present invention in an embodiment and the structural representation of application thereof.
Element numbers explanation
The testing apparatus of 1DHCP service end
101 configuration modules
102 test packet generation modules
103 trapping modules
104 detection modules
2DHCP service end
3 test terminals
S101 ~ S105 step
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this specification can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this specification also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.It should be noted that, when not conflicting, the feature in following examples and embodiment can combine mutually.
It should be noted that, the diagram provided in following examples only illustrates basic conception of the present invention in a schematic way, then only the assembly relevant with the present invention is shown in graphic but not component count, shape and size when implementing according to reality is drawn, it is actual when implementing, and the kenel of each assembly, quantity and ratio can be a kind of change arbitrarily, and its assembly layout kenel also may be more complicated.
Technical scheme of the present invention is applied to the test of DHCP server side, and described DHCP server side is such as server or gateway device etc.
Refer to Fig. 1, the invention provides a kind of method of testing of DHCP server side, be applied to the test terminal connecting described DHCP server side, described test terminal is such as can the PC computer etc. with network interface card of testing results software.
Described method comprises:
Step S101: described test terminal is connected described DHCP server side, and obtain the IP address of DHCP server side distribution and then carry out communication.
In one embodiment of the invention, described connection is such as wired connection or wireless connections, and described wired connection is such as connected by netting twine, and described wireless connections are such as connected by wireless network card etc.
Step S102: described test terminal configures the interval allocation rule of presumptive address of described DHCP server side.
In one embodiment of the invention, the interval allocation rule of described presumptive address such as defines address section corresponding to often kind of device type, address assignment section as gateway routing device is 192.168.x.x, and the address assignment section of client is 10.x.x.x etc.
Step S103: described test terminal generates the DHCP test packet being used for simulation test demand network environment, and sends to DHCP server side.
In one embodiment of the invention, described generation is used for the DHCP test packet of simulation test demand network environment, comprising:
The DHCP request packet (DHCPDiscovery packet) of DHCP server side reception is obtained by described trapping module.
Editor institute obtains DHCP request packet also preservation to generate described DHCP test packet, described editor comprise following at least one:
1) target MAC (Media Access Control) address revised in DHCP request packet is that broadcast address or specific DHCP server side MAC Address are with the sight of simulation to multiple or specific DHCP server side request DHCP service.
2) revise source MAC in DHCP request packet and client mac address and be all broadcast address or particular clients MAC Address to simulate sight that is multiple or particular clients request DHCP service;
3) each Option field contents in amendment DHCP request packet is to simulate different Option function; Option field is such as Option60 field, Option60 (Vendorclassidentifier) is an Option Field in DHCP message, can marking equipment type, therefore, Option60 field contents is repaiied, the DHCPDiscovery packet that the client that can realize simulating distinct device type sends; If without this function field, then can add voluntarily; Certainly being not defined in this, can also be other fields such as Option82 etc., for testing the DHCP function under other network environments.
Concrete, as shown in Figure 2, show an example of the form of described DHCP request packet, wherein, target MAC (Media Access Control) address (Destination) is the ff:ff:ff:ff:ff of Broadcast (broadcast) type, namely complete 1 expression sends all DHCP server side, and source MAC (" Source " MAC that figure center goes out) and client mac address (ClientMACaddress) are set to consistent ec:a8:6b:61:14:03, certainly, in other embodiments, if desired multiple client is simulated, the address that described client mac address is broadcast type then can be set.
In addition, figure center goes out the content of described Option60 field, can for modifying according to required device type.
Step S104: described test terminal is caught the DHCP service that DHCP server side returns and provided packet (DHCPOffer packet), wherein, the described DHCP service IP address that provides packet to comprise the corresponding described DHCP test data of DHCP server side to be responsible for assigning.
In one embodiment of the invention, described DHCPOffer packet is caught by packet capturing softwares such as such as WireShark, further, aforementioned DHCP request packet (i.e. DHCPDiscovery packet) is also caught by described WireShark.
Step S105: described test terminal provides packet to extract described IP address from DHCP service, and check its address interval whether to meet the interval allocation rule of described presumptive address.
In one embodiment of the invention, as shown in Figure 3, be shown as an example of DHCPOffer data packet format, wherein, " YourIPaddress:66.66.66.11 " that frame goes out is distributed IP address, only need to check whether this IP address address section meets corresponding device type, and whether the DHCP function can testing DHCP server side is normal.
Identical with said method embodiment principle is, as shown in Figure 4, the present invention also can provide a kind of DHCP server side 2 testing apparatus 1, is applied to the test terminal 3 connecting described DHCP server side 2, technical characteristic in previous embodiment can be applicable in the present embodiment, and therefore it is no longer repeated; Described device comprises: configuration module 101, the interval allocation rule of the presumptive address for configuring described DHCP; Test packet generation module 102, for generating the DHCP test packet of simulation test demand network environment, and sends to DHCP server side 2; Trapping module 103, the DHCP service returned for catching DHCP server side 2 provides packet, wherein, the IP address that described DHCP service provides packet to comprise the corresponding described DHCP test data of DHCP server side 2 to be responsible for assigning; Detection module 104, for providing packet to extract described IP address from DHCP service, and checks its address interval whether to meet the interval allocation rule of described presumptive address.
In one embodiment of the invention, the generation of described test packet generation module 102 is used for the DHCP test packet of simulation test demand network environment, comprising: the DHCP request packet being obtained DHCP server side 2 reception by described trapping module 103; Editor institute obtains DHCP request packet and preserves to generate described DHCP test packet, described editor comprise following at least one: the target MAC (Media Access Control) address 1) in amendment DHCP request packet is that broadcast address or specific DHCP server side 2MAC address are to simulate the sight of asking DHCP service to multiple or specific DHCP server side 2; 2) revise source MAC in DHCP request packet and client mac address and be all broadcast address or particular clients MAC Address to simulate sight that is multiple or particular clients request DHCP service; 3) each Option field contents in amendment DHCP request packet is to simulate different Option function.
In one embodiment of the invention, the Option field of described amendment comprises Option60 field, for revising the client simulating distinct device type.
In one embodiment of the invention, the interval allocation rule of described presumptive address defines address section corresponding to described presumptive address interval allocation rule definition often kind of device type.
In sum, the method for testing of DHCP server side of the present invention, testing apparatus and test terminal, described test terminal configures the interval allocation rule of presumptive address of described DHCP server side; Described test terminal generates the DHCP test packet being used for simulation test demand network environment, and sends to DHCP server side; Described test terminal is caught the DHCP service that DHCP server side returns and is provided packet, wherein, and the IP address that described DHCP service provides packet to comprise the corresponding described DHCP test data of DHCP server side to be responsible for assigning; Described test terminal provides packet to extract described IP address from DHCP service, and checks its address interval whether to meet the interval allocation rule of described presumptive address; Solve device type and cover not problem comprehensively, simplify test process, eliminate the time of device start, switching.
The present invention effectively overcomes various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.

Claims (9)

1. a method of testing for DHCP server side, is characterized in that, is applied to the test terminal connecting described DHCP server side; Described method comprises:
Described test terminal configures the interval allocation rule of presumptive address of described DHCP server side;
Described test terminal generates the DHCP test packet being used for simulation test demand network environment, and sends to DHCP server side;
Described test terminal is caught the DHCP service that DHCP server side returns and is provided packet, wherein, and the IP address that described DHCP service provides packet to comprise the corresponding described DHCP test data of DHCP server side to be responsible for assigning;
Described test terminal provides packet to extract described IP address from DHCP service, and checks its address interval whether to meet the interval allocation rule of described presumptive address.
2. the method for testing of DHCP server side according to claim 1, is characterized in that, described generation is used for the DHCP test packet of simulation test demand network environment, comprising:
The DHCP request packet of DHCP server side reception is obtained by described trapping module;
Editor institute obtains DHCP request packet also preservation to generate described DHCP test packet, described editor comprise following at least one:
1) target MAC (Media Access Control) address revised in DHCP request packet is that broadcast address or specific DHCP server side MAC Address are with the sight of simulation to multiple or specific DHCP server side request DHCP service;
2) revise source MAC in DHCP request packet and client mac address and be all broadcast address or particular clients MAC Address to simulate sight that is multiple or particular clients request DHCP service;
3) each Option field contents in amendment DHCP request packet is to simulate different Option function.
3. the method for testing of DHCP server side according to claim 2, is characterized in that, the Option field of described amendment comprises Option60 field, for revising the client simulating distinct device type.
4. the method for testing of DHCP server side according to claim 3, is characterized in that, the address section that described presumptive address interval allocation rule definition often kind of device type is corresponding different.
5. a DHCP server side testing apparatus, is characterized in that, is applied to the test terminal connecting described DHCP server side; Described device comprises:
Configuration module, the interval allocation rule of the presumptive address for configuring described DHCP;
Test packet generation module, for generating the DHCP test packet of simulation test demand network environment, and sends to DHCP server side;
Trapping module, the DHCP service returned for catching DHCP server side provides packet, wherein, the IP address that described DHCP service provides packet to comprise the corresponding described DHCP test data of DHCP server side to be responsible for assigning;
Detection module, for providing packet to extract described IP address from DHCP service, and checks its address interval whether to meet the interval allocation rule of described presumptive address.
6. the testing apparatus of DHCP server side according to claim 5, is characterized in that, the generation of described test packet generation module is used for the DHCP test packet of simulation test demand network environment, comprising:
The DHCP request packet of DHCP server side reception is obtained by described trapping module;
Editor institute obtains DHCP request packet also preservation to generate described DHCP test packet, described editor comprise following at least one:
1) target MAC (Media Access Control) address revised in DHCP request packet is that broadcast address or specific DHCP server side MAC Address are with the sight of simulation to multiple or specific DHCP server side request DHCP service;
2) revise source MAC in DHCP request packet and client mac address and be all broadcast address or particular clients MAC Address to simulate sight that is multiple or particular clients request DHCP service;
3) each Option field contents in amendment DHCP request packet is to simulate different Option function.
7. the testing apparatus of DHCP server side according to claim 6, is characterized in that, the Option field of described amendment comprises Option60 field, for revising the client simulating distinct device type.
8. the testing apparatus of DHCP server side according to claim 7, is characterized in that, the interval allocation rule of described presumptive address defines address section corresponding to described presumptive address interval allocation rule definition often kind of device type.
9. a test terminal, is characterized in that, applies the testing apparatus as described in any one of claim 6 ~ 8.
CN201510844013.1A 2015-11-26 2015-11-26 Test method, test device and test terminal for DHCP service side Pending CN105323120A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510844013.1A CN105323120A (en) 2015-11-26 2015-11-26 Test method, test device and test terminal for DHCP service side

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510844013.1A CN105323120A (en) 2015-11-26 2015-11-26 Test method, test device and test terminal for DHCP service side

Publications (1)

Publication Number Publication Date
CN105323120A true CN105323120A (en) 2016-02-10

Family

ID=55249759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510844013.1A Pending CN105323120A (en) 2015-11-26 2015-11-26 Test method, test device and test terminal for DHCP service side

Country Status (1)

Country Link
CN (1) CN105323120A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603348A (en) * 2017-02-14 2017-04-26 上海斐讯数据通信技术有限公司 DHCP Offer flooding simulation method and system
CN108667953A (en) * 2018-04-27 2018-10-16 四川斐讯信息技术有限公司 A kind of the lease function test method and system, test device of DHCP service
CN109525462A (en) * 2018-12-14 2019-03-26 北京奇安信科技有限公司 Gateway test method and device
CN113746653A (en) * 2020-05-29 2021-12-03 中兴通讯股份有限公司 Gateway configuration method, client, server and storage medium
WO2024103783A1 (en) * 2022-11-17 2024-05-23 中兴通讯股份有限公司 Dynamic host configuration protocol testing method, electronic device and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070245134A1 (en) * 2006-04-12 2007-10-18 Hon Hai Precision Industry Co., Ltd. Testing device and testing method for computer
CN101159758A (en) * 2007-10-30 2008-04-09 中兴通讯股份有限公司 Classification associated dynamic host machine configuring protocol option distribution method and device
CN101425938A (en) * 2008-12-17 2009-05-06 福建星网锐捷网络有限公司 Method and apparatus for network apparatus test
CN103701656A (en) * 2012-09-27 2014-04-02 中兴通讯股份有限公司 Testing method and system of broadband access unit
CN104125119A (en) * 2014-08-12 2014-10-29 上海斐讯数据通信技术有限公司 Method and system for testing server

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070245134A1 (en) * 2006-04-12 2007-10-18 Hon Hai Precision Industry Co., Ltd. Testing device and testing method for computer
CN101159758A (en) * 2007-10-30 2008-04-09 中兴通讯股份有限公司 Classification associated dynamic host machine configuring protocol option distribution method and device
CN101425938A (en) * 2008-12-17 2009-05-06 福建星网锐捷网络有限公司 Method and apparatus for network apparatus test
CN103701656A (en) * 2012-09-27 2014-04-02 中兴通讯股份有限公司 Testing method and system of broadband access unit
CN104125119A (en) * 2014-08-12 2014-10-29 上海斐讯数据通信技术有限公司 Method and system for testing server

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603348A (en) * 2017-02-14 2017-04-26 上海斐讯数据通信技术有限公司 DHCP Offer flooding simulation method and system
CN106603348B (en) * 2017-02-14 2019-10-11 上海斐讯数据通信技术有限公司 A kind of method and system that simulation DHCP Offer floods
CN108667953A (en) * 2018-04-27 2018-10-16 四川斐讯信息技术有限公司 A kind of the lease function test method and system, test device of DHCP service
CN109525462A (en) * 2018-12-14 2019-03-26 北京奇安信科技有限公司 Gateway test method and device
CN113746653A (en) * 2020-05-29 2021-12-03 中兴通讯股份有限公司 Gateway configuration method, client, server and storage medium
WO2024103783A1 (en) * 2022-11-17 2024-05-23 中兴通讯股份有限公司 Dynamic host configuration protocol testing method, electronic device and computer storage medium

Similar Documents

Publication Publication Date Title
CN105323120A (en) Test method, test device and test terminal for DHCP service side
CN110347596B (en) Test method, device, system, electronic equipment and medium
CN100471139C (en) System and method for network test
US20160337200A1 (en) Method and Apparatus for Visualized Network Operation and Maintenance
CN109921947B (en) Network flow simulation method, device, equipment and network equipment test system
CN108256118B (en) Data processing method, device, system, computing equipment and storage medium
CN104954894A (en) Video traffic guiding method and device as well as electronic equipment
CN104410691A (en) Method and system for website acceleration on basis of content delivery network
CN105227406A (en) A kind of method of testing of router combination property
CN104793932A (en) Method and device used for software release
CN104935639A (en) Intelligent terminal, and applied distributed exploitation system and method
CN105306536A (en) Method for intelligent terminal to remotely execute service command based on WiFi (Wireless Fidelity)
CN104125119A (en) Method and system for testing server
CN104008055B (en) The method of software test, equipment and system
CN109561167A (en) A kind of domain name analytic method and device
CN109167762A (en) A kind of IEC104 message checking method and device
CN112231209A (en) Parameter acquisition method and device, computer equipment and storage medium
CN105142143A (en) Verification method and system thereof
CN106936658A (en) The method of testing and test platform of test case, simulation test equipment
CN105117344A (en) Interface integration test method and system based on PB
CN105099774A (en) Router software upgrading method and system
CN104753695A (en) Discovery and real-time display system and method for SDN (Software Defined Network) network topology
CN105338131A (en) Testing method and system for address pool capacity of DHCP server
CN109246024A (en) Load sharing method, device, terminal device and storage medium in a kind of networking
CN104486459A (en) Dual-IP and dual-line server and serving method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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: 20160210