perfdhcp is a DHCP benchmarking tool. It provides a way of measuring the performance of DHCP servers by generating large amounts of traffic from simulated multiple clients. It is able to test both IPv4 and IPv6 servers, and provides statistics concerning response times and the number of requests that are dropped.

By default, tests are run using the full four-packet exchange sequence (DORA for DHCPv4, SARR for DHCPv6). An option is provided to run tests using the initial two-packet exchange (DO and SA) instead. It is also possible to configure perfdhcp to send DHCPv6 RENEW and RELEASE messages at a specified rate in parallel with the DHCPv6 four-way exchanges.

When running a performance test, perfdhcp will exchange packets with the server under test as fast as possible unless the -r is given to limit the request rate. The length of the test can be limited by setting a threshold on any or all of the number of requests made by perfdhcp, the elapsed time, or the number of requests dropped by the server.

To allow the contents of packets sent to the server to be customized, perfdhcp allows the specification of template files that determine the contents of the packets. For example, the customized packet may contain a DHCPv6 ORO to request a set of options to be returned by the server, or it may contain the Client FQDN option to request that server performs DNS updates. This may be used to discover performance bottlenecks for different server configurations (e.g. DDNS enabled or disabled).

Up to two template files can be specified on the command line, each file representing the contents of a particular type of packet, the type being determined by the test being carried out. For example, if testing DHCPv6:

· With no template files specified on the command line, perfdhcp will generate both SOLICIT and REQUEST packets.

· With one template file specified, that file will be used as the pattern for SOLICIT packets: perfdhcp will generate the REQUEST packets.

· With two template files given on the command line, the first will be used as the pattern for SOLICIT packets, the second as the pattern for REQUEST packets.

The template file holds the DHCP packet represented as a stream of ASCII hexadecimal digits and it excludes any IP/UDP stack headers. The template file must not contain any characters other than hexadecimal digits and spaces. Spaces are discarded when the template file is parsed (so in the file, '12B4' is the same as '12 B4' which is the same as '1 2 B 4')

The template files should be used in conjunction with the command line parameters which specify offsets of the data fields being modified in outbound packets. For example, the -Etime-offset switch specifies the offset of the DHCPv6 Elapsed Time option in the packet template. If the offset is specified, perfdhcp will inject the current elapsed time value into this field before sending the packet to the server.

In many scenarios, perfdhcp needs to simulate multiple clients (having unique client identifier). Since packets for each client are generated from the same template file, it is necessary to randomize the client identifier (or HW address in DHCPv4) in the packet created from it. The -Orandom-offset option allows specification of the offset in the template where randomization should be performed. It is important to note that this offset points to the end (not the beginning) of the client identifier (or HW address field). The number of bytes being randomized depends on the number of simulated clients. If the number of simulated clients is between 1 and 255, only one byte (to which randomization offset points) will be randomized. If the number of simulated clients is between 256 and 65535, two bytes will be randomized. Note, that two last bytes of the client identifier will be randomized in this case: the byte which randomization offset parameter points to, and the one which precedes it (random-offset - 1). If the number of simulated clients exceeds 65535, three bytes will be randomized; and so on.

Templates may be currently used to generate packets being sent to the server in 4-way exchanges, i.e. SOLICIT, REQUEST (DHCPv6) and DISCOVER, REQUEST (DHCPv4). They cannot be used when RENEW or RELEASE packets are being sent.

The base MAC or DUID used to simulate different clients. The basetype may be "mac" or "duid". (The keyword "ether" may alternatively used for MAC.) The -b option can be specified multiple times. The MAC address must consist of six octets separated by single (:) or double (::) colons, for example: mac=00:0c:01:02:03:04. The DUID value is a hexadecimal string: it must be at least six octets long and must not be longer than 64 bytes and the length must be less than 128 hexadecimal digits, for example: duid=0101010101010101010110111F14.

Rate at which DHCPv4 or DHCPv6 renew requests are sent to a server. This value is only valid when used in conjunction with the exchange rate (given by -rrate). Furthermore the sum of this value and the release-rate (given by -Frate) must be equal to or less than the exchange rate.

For DHCPv4 operation, specify the local hostname/address to use when communicating with the server. By default, the interface address through which traffic would normally be routed to the server is used. For DHCPv6 operation, specify the name of the network interface through which exchanges are initiated.

A text file containing a list of MAC addresses, one per line. If provided, a MAC address will be choosen randomly from this list for every new exchange. In the DHCPv6 case, MAC addresses are used to generate DUID-LLs. This parameter must not be used in conjunction with the -b parameter.

Initiate rate DORA/SARR (or if -i is given, DO/SA) exchanges per second. A periodic report is generated showing the number of exchanges which were not completed, as well as the average response latency. The program continues until interrupted, at which point a final report is generated.

The name of a file containing the template to use as a stream of hexadecimal digits. This may be specified up to two times and controls the contents of the packets sent (see the "Templates" section above).

Rate at which IPv6 RELEASE requests are sent to a server. This value is only valid when used in conjunction with the exchange rate (given by -rrate). Furthermore the sum of this value and the renew-rate (given by -frate) must be equal to or less than the exchange rate.

-Aencapsulation-level

Specifies that relayed traffic must be generated. The argument specifies the level of encapsulation, i.e. how many relay agents are simulated. Currently the only supported encapsulation-level value is 1, which means that the generated traffic is an equivalent of the traffic passing through a single relay agent.

The following options may only be used in conjunction with -T and control how perfdhcp modifies the template. The options may be specified multiple times on the command line; each occurrence affects the corresponding template file (see "Templates" above).

-Etime-offset

Offset of the (DHCPv4) secs field or (DHCPv6) elapsed-time option in the (second i.e. REQUEST) template and must be 0 or a positive integer: a value of 0 disables this.

-Iip-offset

Offset of the (DHCPv4) IP address in the requested-IP option / (DHCPv6) IA_NA option in the (second/request) template.

-Orandom-offset

Offset of the last octet to randomize in the template. random-offset must be an integer greater than 3. The -T switch must be given to use this option.

-Ssrvid-offset

Offset of the server-ID option in the (second/request) template. srvid-offset must be a positive integer, and the switch can only be used when the template option (-T) is also given.

-Xxid-offset

Offset of the transaction ID (xid) in the template. xid-offset must be a positive integer, and the switch can only be used when the template option (-T) is also given.

The following options may only be used in conjunction with -r and control both the length of the test and the frequency of reports.

-Dmax-drop

Abort the test if more than max-drop requests have been dropped. Use -D 0 to abort if even a single request has been dropped. If max-drop includes the suffix '%', it specifies a maximum percentage of requests that may be dropped before abort. In this case, testing of the threshold begins after 10 requests have been expected to be received.

-nnum-requests

Initiate num-request transactions. No report is generated until all transactions have been initiated/waited-for, after which a report is generated and the program terminates.

-ptest-period

Send requests for test-period, which is specified in the same manner as -d. This can be used as an alternative to -n, or both options can be given, in which case the testing is completed when either limit is reached.

Server to test, specified as an IP address. In the DHCPv6 case, the special name 'all' can be used to refer to All_DHCP_Relay_Agents_and_Servers (the multicast address FF02::1:2), or the special name 'servers' to refer to All_DHCP_Servers (the multicast address FF05::1:3). The server is mandatory except where the -l option is given to specify an interface, in which case it defaults to 'all'.

There are two mailing lists available for Kea project. kea-users (kea-users at lists.isc.org) is intended for Kea users, while kea-dev (kea-dev at lists.isc.org) is intended for Kea developers, prospective contributors and other advanced users. Both lists are available at http://lists.isc.org. The community provides best effort type of support on both of those lists.

The Kea software has been written by a number of engineers working for ISC: Tomek Mrugalski, Stephen Morris, Marcin Siodelski, Thomas Markwalder, Francis Dupont, Jeremy C. Reed, Wlodek Wencel and Shawn Routhier. That list is roughly in the chronological order in which the authors made their first contribution. For a complete list of authors and contributors, see AUTHORS file.