DHCP client testing tool

DHCP is vastly growing in service provider networks for broadband subscribers, I had the chance to work lately with a some of these setups. The protocol is really easy to configure for broadband and provide many benefits.  It has lower overhead compared to PPPOE and it is much more suitable for Multicast services.

For those of you who are working with subscriber management, I know sometimes you need to do quick tests to verify new configurations or may be to do some stress or scalability tests. Traffic generators are  more suitable for stress and scalability tests but sometimes I really need some simple tool to play with from my desktop and inspect packets directly.

There are more sophisticated ways to craft packets when needed but this  Linux DHCP client test tool was very handy in doing quick testing, it's very simple and intuitive to use. It does not offer a complete set of options or operations but it is very useful to test your configuration or to do a simple stress test if your PC can handle it. The limitation I found is that it was not automated, so I had to make my own script to generate MAC addresses and feed it to the tool to issue any number of sessions I like.

I bring up about 16K of DHCP subscribers in about 30min with the script and tool. The script distributes the number of clients on 5 threads to speed up things a bit, but of course this can be optimized in many ways to speed it up, but I will personally keep it simple for everyday use. Feel free to improve this anyway you like but please share the value with the community.

All you need to do is to put the tool and script in the same folder and run the script as follows with superuser privileges.

sudo ./dhcptest.py -i eth1.2668 -s 10000
-i is the interface
-s is the number of subscribers you want to randomly create

Download the tool and check documentation on how to use it from the link below and you can download the python script here. Put them in the same directory and you are good to go.

http://sargandh.wordpress.com/2012/02/23/linux-dhcp-client-simulation-tool/

Note: The script does not have much of error handling, so you need to make sure you are using the correct parameters. The tool must be used with root permissions to be able to open promiscuous sockets on your box.

Check Also

Best AI tools list