From: Marcin Siodelski Date: Mon, 10 Sep 2012 10:14:19 +0000 (+0200) Subject: [2230] Added perfdhcp command line examples. X-Git-Tag: trac2351_base~66^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ebd6dbbd9af7ea20543a9813a9d38cc7a227935;p=thirdparty%2Fkea.git [2230] Added perfdhcp command line examples. --- diff --git a/tests/tools/dhcp-ubench/dhcp-perf-guide.html b/tests/tools/dhcp-ubench/dhcp-perf-guide.html index 60de83809b..27da0b1c0d 100644 --- a/tests/tools/dhcp-ubench/dhcp-perf-guide.html +++ b/tests/tools/dhcp-ubench/dhcp-perf-guide.html @@ -7,7 +7,7 @@ This document describes various aspects of DHCP performance, measurements and tuning. It covers BIND 10 DHCP (codename Kea), existing ISC DHCP4 software, perfdhcp (a DHCP performance - measurement tool) and other related topics.


Table of Contents

Preface
Acknowledgements
1. Introduction
2. ISC DHCP 4.x
3. Kea
Backend performance evaluation
MySQL backend
MySQL tweaks
SQLite-ubench
SQLite tweaks
memfile-ubench
memfile tweaks
Performance measurements
Possible further optimizations
4. perfdhcp
Purpose
Key features
Command line options
Running a test

List of Tables

3.1. Synchronous results
3.2. Asynchronous results
3.3. Estimated performance

Preface

Table of Contents

Acknowledgements

Acknowledgements

ISC would like to acknowledge generous support for + measurement tool) and other related topics.


Table of Contents

Preface
Acknowledgements
1. Introduction
2. ISC DHCP 4.x
3. Kea
Backend performance evaluation
MySQL backend
MySQL tweaks
SQLite-ubench
SQLite tweaks
memfile-ubench
memfile tweaks
Performance measurements
Possible further optimizations
4. perfdhcp
Purpose
Key features
Command line options
Starting perfdhcp
perfdhcp command line examples
Example: basic usage
Example: rate control
Example: templates

List of Tables

3.1. Synchronous results
3.2. Asynchronous results
3.3. Estimated performance

Preface

Table of Contents

Acknowledgements

Acknowledgements

ISC would like to acknowledge generous support for BIND 10 development of DHCPv4 and DHCPv6 components provided by Comcast.

Chapter 1. Introduction

This document is in its early stages of development. It is @@ -196,7 +196,7 @@ SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe7 Multi-threaded or multi-process benchmark may be considered in the future. It may be somewhat difficult as only some backends support concurrent access. -

Chapter 4. perfdhcp

Purpose

+

Chapter 4. perfdhcp

Purpose

There is a growing need to evaluate performance of DHCP servers in different traffic conditions to understand their bottle necks. This helps to elimante bugs in existing DHCP software as well @@ -206,15 +206,15 @@ SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe7 mostly. However, the number of implemented features and parameters exposed to the user make this tool useful for functional testing as well. -

Key features

+

Key features

The perfdhcp exposes the number of command line parameters to control DHCP message exchanges. Currently they fall back to the following categories:

  1. Rate control - control how many DHCP exchanges are initiated within a period of time. Tool can also simulate - best effort conditions where it attempts to start as many - exchanges as possible. + best effort conditions attempting to initiate as many DHCP + packet exchanges within a unit of time as possible.

  2. Test exit specifiers - control the conditions when test completes including number of initiated exchanges, test period or @@ -367,7 +367,7 @@ The exit status is: exchanges are not successfully completed.

    -

Running a test

+

Starting perfdhcp

In order to run performance test at least two separate systems have to be installed: client and server. The first one has to have perfdhcp tool installed, the latter has to have DHCP server @@ -377,28 +377,224 @@ The exit status is: impacted by the performance of VMs.

The DHCP operates on low port numbers (67 for DHCPv4 relays and - 547 for DHCPv6) running perfdhcp with non-root priviliges will + 547 for DHCPv6). Running perfdhcp with non-root priviliges will usually result in the error message similar to this:

$./perfdhcp -4 -l eth3 -r 100 all
 Error running perfdhcp: Failed to bind socket 3 to 172.16.1.2/port=67
         

- perfdhcp exposes '-L' command line option that - imposes use of custom local port and the following command line will - work: + perfdhcp has the '-L' command line option that + imposes use of custom local port. Thus the following command + line will work:

$./perfdhcp -4 -l eth3 -r 100 -L 10067 all

but in the standard configuration no responses will be received from the ISC DHCP server because server responds to default relay port 67. + Alternative way to overcome this issue is to run perfdhcp as root.

- Alternative way to overcome the issue with lack of privileges - to use default DHCP port number is to run perfdhcp as root. -

- In this section the perfdhcp command line options examples + Currently, perfdhcp is seen from the server perspective as relay agent. + This simplifies its implementation (specifically there is no need to + receive traffic sent to braodcast addresses). This imposes that IPv4 + address has to be set manually on the interface that will be used to + communicate with the server. For example, if DHCPv4 server is listening + on the interface connected to 172.16.1.0 subnet, interface on client + machine has to have network address assigned from the same subnet + on one of its interfaces connected to this subnet: +

#ifconfig eth3 172.16.1.2. netmask 255.255.255.0 up

+

perfdhcp command line examples

+ In this section the perfdhcp command line examples are presented as a quick start guide for new users. For the detailed list of command line options refer to the section called “Command line options”. -

-

-          
-        

-

\ No newline at end of file +

Example: basic usage

+ If server is listening on interface with IPv4 address 172.16.1.1 + the simpliest perfdhcp command line will look like this: +

#./perfdhcp 172.16.1.1
+***Rate statistics***
+Rate: 206.345
+
+***Statistics for: DISCOVER-OFFER***
+sent packets: 21641
+received packets: 350
+drops: 21291
+orphans: 0
+
+min delay: 9.022 ms
+avg delay: 143.100 ms
+max delay: 259.303 ms
+std deviation: 56.074 ms
+collected packets: 30
+
+***Statistics for: REQUEST-ACK***
+sent packets: 350
+received packets: 268
+drops: 82
+orphans: 0
+
+min delay: 3.010 ms
+avg delay: 152.470 ms
+max delay: 258.634 ms
+std deviation: 56.936 ms
+collected packets: 0
+          

+ In this case perfdhcp will use remote address 172.16.1.1 as a + destination address and will use suitable local interface for + communication. Since, no rate control parameters have been specified + it will be initiating DHCP exchanges with the maximum possible + rate (it will try to initiate maximum number of exchanges per + second and count number of completed exchanged). Due to server's + performance constraints, many DHCP packets sent to server are likely + to be dropped. The performance test will be running until it is + not interrupted by the user (with ^C). +

+ The default performance statistics reported by perfdhcp have the + following meaning: +

  • Rate - number of packet exchanges (packet sent + to the server and matching response received from the server) + completed within a second.

  • sent packets - total number of DHCP packets of + a specific type sent to the server.

  • received packets - total number of DHCP packets + of specific type received from the server.

  • drops - number of dropped packets for the + particular exchange. Number of dropped packets is calculated as + a difference between number of sent packets and number of + response packets received from the server. It is likely that + server sent the reponse but perfdhcp execution had ended before + reponse arrived. In such case this packet will be assumed + dropped.

  • orphans - number of packets that have been + received from the server and did not match any packet sent by + perfdhcp. This may occur if received packet has been sent + to some other host or if exchange time out has occured and + has been been garbage collected.

  • min delay - minimum delay that occured between + sending the packet to the server and receiving reponse from + it.

  • avg delay - average delay between sending the + packet of the specific type the server and receiving response + from it.

  • max delay - maximum delat that occured between + sedning the packet to the server and receiveing response from + it.

  • std deviation - standard deviation of delay + between sending the packet of a specific type to the server and + receiving response from it.

  • collected packets - number of garbage collected + sent packets. Packets may get garbage collected when waiting time + for server response exceeds value set with + -d<drop-time>.

+

+ perfdhcp allows to run the test using specified interface: +

#./perfdhcp -l eth3

+ or local address assigned to it: +

#./perfdhcp -l 172.16.1.2

+

Example: rate control

+ In the examples above perfdhcp initiates new exchanges with best + effort rate. In this case many packets is expected to be dropped by the + server due to performance limitations. Many times it is desired to set + the expected (reasonable) rate and verify if generated traffic is + handled without packet dropes by DHCP server. The following command will + make perfdhcp to initiate 300 4-way exchanges per second and test will + last for 60 seconds: +

#./perfdhcp -l eth3 -p 60 -r 300
+***Rate statistics***
+Rate: 256.683 exchanges/second, expected rate: 300 exchanges/second
+
+***Statistics for: DISCOVER-OFFER***
+sent packets: 17783
+received packets: 15401
+drops: 2382
+orphans: 0
+
+min delay: 0.109 ms
+avg delay: 75.756 ms
+max delay: 575.614 ms
+std deviation: 60.513 ms
+collected packets: 11
+
+***Statistics for: REQUEST-ACK***
+sent packets: 15401
+received packets: 15317
+drops: 84
+orphans: 0
+
+min delay: 0.536 ms
+avg delay: 72.072 ms
+max delay: 576.749 ms
+std deviation: 58.189 ms
+collected packets: 0
+          

+ Note that in this example the packet drops have been significantly + reduced thanks to setting reasonable rate. The non-zero number of + packet drops and achived rate (256/s) below expected rate (300/s) + indicate that server's measured performance is lower than 300 leases + per second. Further rate decrease should eliminate most of the packet + drops and bring achived rate close to expected rate: +

#./perfdhcp -l eth3 -p 60 -r 100 -R 30
+***Rate statistics***
+Rate: 99.8164 exchanges/second, expected rate: 100 exchanges/second
+
+***Statistics for: DISCOVER-OFFER***
+sent packets: 5989
+received packets: 5989
+drops: 0
+orphans: 0
+
+min delay: 0.023 ms
+avg delay: 2.198 ms
+max delay: 181.760 ms
+std deviation: 9.429 ms
+collected packets: 0
+
+***Statistics for: REQUEST-ACK***
+sent packets: 5989
+received packets: 5989
+drops: 0
+orphans: 0
+
+min delay: 0.473 ms
+avg delay: 2.355 ms
+max delay: 189.658 ms
+std deviation: 5.876 ms
+collected packets: 0
+          

+ Note that the last parameter (-R 30) configures perfdhcp to simulate + traffic from distinct 30 clients. +

Example: templates

+ By default the DHCP messages are formed in-flight with default options. + If desired, there is a way to define custom packet format with template + files. Content in template files is encoded in hexadecimal format. The + perfdhcp forms the packet by replacing parts of the binary stream read + from the file with variable data such as elapsed time, HW address, DUID + etc. The offsets where such variable data is placed is specific to the + template file and have to be specified from the command line. Refer to + the section called “Command line options” to find out how to + specify offsets for particular options and fields. With the following + command line the DHCPv6 SOLICIT and REQUEST packets will be formed from + solicit-example.hex and request6-example.hex packets: +

#./perfdhcp -6 -l eth3 -r 100 -R 20 -T templates/solicit-example.hex -T templates/request6-example.hex -O 21 -E 84 -S 22 -I 40 servers
+***Rate statistics***
+Rate: 99.5398 exchanges/second, expected rate: 100 exchanges/second
+
+***Statistics for: SOLICIT-ADVERTISE***
+sent packets: 570
+received packets: 569
+drops: 1
+orphans: 0
+
+min delay: 0.259 ms
+avg delay: 0.912 ms
+max delay: 6.979 ms
+std deviation: 0.709 ms
+collected packets: 0
+
+***Statistics for: REQUEST-REPLY***
+sent packets: 569
+received packets: 569
+drops: 0
+orphans: 0
+
+min delay: 0.084 ms
+avg delay: 0.607 ms
+max delay: 6.490 ms
+std deviation: 0.518 ms
+collected packets: 0
+          

+ where: +

  • two occurences of -O 21 - DUID's last octet + positions in SOLICIT and REQUEST respectively.

  • -E 84 - elapsed time option position in + REQUEST template

  • -S 22 - server id position in REQUEST + template

  • -I 40 - IA_NA option position in REQUEST + template

+

\ No newline at end of file diff --git a/tests/tools/dhcp-ubench/dhcp-perf-guide.xml b/tests/tools/dhcp-ubench/dhcp-perf-guide.xml index bfde03de31..f9b9744bf7 100644 --- a/tests/tools/dhcp-ubench/dhcp-perf-guide.xml +++ b/tests/tools/dhcp-ubench/dhcp-perf-guide.xml @@ -603,8 +603,7 @@ SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe7 well. - -
+
Key features The perfdhcp exposes the number of command line parameters to @@ -615,8 +614,8 @@ SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe7 Rate control - control how many DHCP exchanges are initiated within a period of time. Tool can also simulate - best effort conditions where it attempts to start as many - exchanges as possible. + best effort conditions attempting to initiate as many DHCP + packet exchanges within a unit of time as possible. @@ -661,7 +660,6 @@ SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe7
-
Command line options @@ -793,8 +791,8 @@ The exit status is:
-
- Running a test +
+ Starting perfdhcp In order to run performance test at least two separate systems have to be installed: client and server. The first one has to have @@ -806,35 +804,262 @@ The exit status is: The DHCP operates on low port numbers (67 for DHCPv4 relays and - 547 for DHCPv6) running perfdhcp with non-root priviliges will + 547 for DHCPv6). Running perfdhcp with non-root priviliges will usually result in the error message similar to this: $./perfdhcp -4 -l eth3 -r 100 all Error running perfdhcp: Failed to bind socket 3 to 172.16.1.2/port=67 - perfdhcp exposes '-L' command line option that - imposes use of custom local port and the following command line will - work: + perfdhcp has the '-L' command line option that + imposes use of custom local port. Thus the following command + line will work: $./perfdhcp -4 -l eth3 -r 100 -L 10067 all but in the standard configuration no responses will be received from the ISC DHCP server because server responds to default relay port 67. + Alternative way to overcome this issue is to run perfdhcp as root. - Alternative way to overcome the issue with lack of privileges - to use default DHCP port number is to run perfdhcp as root. + Currently, perfdhcp is seen from the server perspective as relay agent. + This simplifies its implementation (specifically there is no need to + receive traffic sent to braodcast addresses). This imposes that IPv4 + address has to be set manually on the interface that will be used to + communicate with the server. For example, if DHCPv4 server is listening + on the interface connected to 172.16.1.0 subnet, interface on client + machine has to have network address assigned from the same subnet + on one of its interfaces connected to this subnet: + #ifconfig eth3 172.16.1.2. netmask 255.255.255.0 up - +
+
+ perfdhcp command line examples - In this section the perfdhcp command line options examples + In this section the perfdhcp command line examples are presented as a quick start guide for new users. For the detailed list of command line options refer to . - - - - - +
+ Example: basic usage + + If server is listening on interface with IPv4 address 172.16.1.1 + the simpliest perfdhcp command line will look like this: + #./perfdhcp 172.16.1.1 +***Rate statistics*** +Rate: 206.345 + +***Statistics for: DISCOVER-OFFER*** +sent packets: 21641 +received packets: 350 +drops: 21291 +orphans: 0 + +min delay: 9.022 ms +avg delay: 143.100 ms +max delay: 259.303 ms +std deviation: 56.074 ms +collected packets: 30 + +***Statistics for: REQUEST-ACK*** +sent packets: 350 +received packets: 268 +drops: 82 +orphans: 0 + +min delay: 3.010 ms +avg delay: 152.470 ms +max delay: 258.634 ms +std deviation: 56.936 ms +collected packets: 0 + + In this case perfdhcp will use remote address 172.16.1.1 as a + destination address and will use suitable local interface for + communication. Since, no rate control parameters have been specified + it will be initiating DHCP exchanges with the maximum possible + rate (it will try to initiate maximum number of exchanges per + second and count number of completed exchanged). Due to server's + performance constraints, many DHCP packets sent to server are likely + to be dropped. The performance test will be running until it is + not interrupted by the user (with ^C). + + + The default performance statistics reported by perfdhcp have the + following meaning: + + Rate - number of packet exchanges (packet sent + to the server and matching response received from the server) + completed within a second. + sent packets - total number of DHCP packets of + a specific type sent to the server. + received packets - total number of DHCP packets + of specific type received from the server. + drops - number of dropped packets for the + particular exchange. Number of dropped packets is calculated as + a difference between number of sent packets and number of + response packets received from the server. It is likely that + server sent the reponse but perfdhcp execution had ended before + reponse arrived. In such case this packet will be assumed + dropped. + orphans - number of packets that have been + received from the server and did not match any packet sent by + perfdhcp. This may occur if received packet has been sent + to some other host or if exchange time out has occured and + has been been garbage collected. + min delay - minimum delay that occured between + sending the packet to the server and receiving reponse from + it. + avg delay - average delay between sending the + packet of the specific type the server and receiving response + from it. + max delay - maximum delat that occured between + sedning the packet to the server and receiveing response from + it. + std deviation - standard deviation of delay + between sending the packet of a specific type to the server and + receiving response from it. + collected packets - number of garbage collected + sent packets. Packets may get garbage collected when waiting time + for server response exceeds value set with + ]]>. + + + + perfdhcp allows to run the test using specified interface: + #./perfdhcp -l eth3 + or local address assigned to it: + #./perfdhcp -l 172.16.1.2 + +
+
+ Example: rate control + + In the examples above perfdhcp initiates new exchanges with best + effort rate. In this case many packets is expected to be dropped by the + server due to performance limitations. Many times it is desired to set + the expected (reasonable) rate and verify if generated traffic is + handled without packet dropes by DHCP server. The following command will + make perfdhcp to initiate 300 4-way exchanges per second and test will + last for 60 seconds: + #./perfdhcp -l eth3 -p 60 -r 300 +***Rate statistics*** +Rate: 256.683 exchanges/second, expected rate: 300 exchanges/second + +***Statistics for: DISCOVER-OFFER*** +sent packets: 17783 +received packets: 15401 +drops: 2382 +orphans: 0 + +min delay: 0.109 ms +avg delay: 75.756 ms +max delay: 575.614 ms +std deviation: 60.513 ms +collected packets: 11 + +***Statistics for: REQUEST-ACK*** +sent packets: 15401 +received packets: 15317 +drops: 84 +orphans: 0 + +min delay: 0.536 ms +avg delay: 72.072 ms +max delay: 576.749 ms +std deviation: 58.189 ms +collected packets: 0 + + Note that in this example the packet drops have been significantly + reduced thanks to setting reasonable rate. The non-zero number of + packet drops and achived rate (256/s) below expected rate (300/s) + indicate that server's measured performance is lower than 300 leases + per second. Further rate decrease should eliminate most of the packet + drops and bring achived rate close to expected rate: + #./perfdhcp -l eth3 -p 60 -r 100 -R 30 +***Rate statistics*** +Rate: 99.8164 exchanges/second, expected rate: 100 exchanges/second + +***Statistics for: DISCOVER-OFFER*** +sent packets: 5989 +received packets: 5989 +drops: 0 +orphans: 0 + +min delay: 0.023 ms +avg delay: 2.198 ms +max delay: 181.760 ms +std deviation: 9.429 ms +collected packets: 0 + +***Statistics for: REQUEST-ACK*** +sent packets: 5989 +received packets: 5989 +drops: 0 +orphans: 0 + +min delay: 0.473 ms +avg delay: 2.355 ms +max delay: 189.658 ms +std deviation: 5.876 ms +collected packets: 0 + + Note that the last parameter (-R 30) configures perfdhcp to simulate + traffic from distinct 30 clients. + +
+
+ Example: templates + + By default the DHCP messages are formed in-flight with default options. + If desired, there is a way to define custom packet format with template + files. Content in template files is encoded in hexadecimal format. The + perfdhcp forms the packet by replacing parts of the binary stream read + from the file with variable data such as elapsed time, HW address, DUID + etc. The offsets where such variable data is placed is specific to the + template file and have to be specified from the command line. Refer to + to find out how to + specify offsets for particular options and fields. With the following + command line the DHCPv6 SOLICIT and REQUEST packets will be formed from + solicit-example.hex and request6-example.hex packets: + #./perfdhcp -6 -l eth3 -r 100 -R 20 -T templates/solicit-example.hex -T templates/request6-example.hex -O 21 -E 84 -S 22 -I 40 servers +***Rate statistics*** +Rate: 99.5398 exchanges/second, expected rate: 100 exchanges/second + +***Statistics for: SOLICIT-ADVERTISE*** +sent packets: 570 +received packets: 569 +drops: 1 +orphans: 0 + +min delay: 0.259 ms +avg delay: 0.912 ms +max delay: 6.979 ms +std deviation: 0.709 ms +collected packets: 0 + +***Statistics for: REQUEST-REPLY*** +sent packets: 569 +received packets: 569 +drops: 0 +orphans: 0 + +min delay: 0.084 ms +avg delay: 0.607 ms +max delay: 6.490 ms +std deviation: 0.518 ms +collected packets: 0 + + where: + + two occurences of -O 21 - DUID's last octet + positions in SOLICIT and REQUEST respectively. + -E 84 - elapsed time option position in + REQUEST template + -S 22 - server id position in REQUEST + template + -I 40 - IA_NA option position in REQUEST + template + + +