lost and found ( for me ? )

perfdhcp : DHCP stress tool


perfdhcp on CentOS 6 : fail

perfdhcp on Mint14 : fail
perfdhcp Fedora 18 : success ( as of now )

In my environment , perfdhcp does not seem to run if perfdhcp boxes have multiple bridge interfaces ( virbrX )
In case of CentOS and Mint14 , I’m using KVM on both boxes , which means these boxes have multiple bridge interfaces.
In case of Fedora , that box does not have bridge interfaces.
** please note that this is as-is based info **

about perfdhcp

perfdhcp has been shipped with BIND10 source code.
When compiling BIND10 , perfdhcp will be compiled as well.
Assume that you have already compiled BIND10 from the source code.

[ fail perfdhcp on CentOS6 ]

I compiled BIND10 on CentOS 6.4 64bit box.
# cat /etc/centos-release
CentOS release 6.4 (Final)

# uname -ri
2.6.32-358.2.1.el6.x86_64 x86_64

# bind10 --version
bind10 20110223 (BIND 10 1.0.0)

# /usr/local/bin/perfdhcp –help
Error parsing command line options: unknown command line option
perfdhcp [-hv] [-4|-6] [-r<rate>] [-t<report>] [-R<range>] [-b<base>]
   [-n<num-request>] [-p<test-period>] [-d<drop-time>] [-D<max-drop>]
   [-l<local-addr|interface>] [-P<preload>] [-a<aggressivity>]
   [-L<local-port>] [-s<seed>] [-i] [-B] [-c] [-1]
   [-T<template-file>] [-X<xid-offset>] [-O<random-offset]
   [-E<time-offset>] [-S<srvid-offset>] [-I<ip-offset>]
   [-x<diagnostic-selector>] [-w<wrapped>] [server]

The [server] argument is the name/address of the DHCP server to
contact.  For DHCPv4 operation, exchanges are initiated by
transmitting a DHCP DISCOVER to this address.
<snip>

run perfdhcp
nn , perfdhcp stopped...
# /usr/local/bin/perfdhcp -l eth1
Running: perfdhcp -l eth1
Error running perfdhcp: unknown label character: 101

on ISC-DHCP box
# dhcpd --version
isc-dhcpd-4.2.4

# egrep -v ^# dhcpd.conf | grep -v ^$
INTERFACES="eth3";
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 192.168.150.0 netmask 255.255.255.0 {
       interface eth3;
       range 192.168.150.10 192.168.150.200;
       option subnet-mask 255.255.255.0;
       option broadcast-address 192.168.150.255;
       option routers 192.168.150.254;
       ping-check false;
}

# egrep -i udp /var/log/syslog
Apr 18 19:49:03 ubuntu-1 dhcpd: 4 bad udp checksums in 5 packets

the workaround on this error is configuring the following iptables on ISC-DHCP box.
# iptables -A POSTROUTING -t mangle -p udp --dport 67 -j CHECKSUM --checksum-fill

# iptables -n -L -t mangle
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
CHECKSUM   udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:68 CHECKSUM fill
CHECKSUM   udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:67 CHECKSUM fill

try again. ,,, perfdhcp stopped
/usr/local/bin/perfdhcp -l eth1
Running: perfdhcp -l eth1
Error running perfdhcp: unknown label character: 101

check ISC-DHCP box.
perfdhcp is using same MAC address.
Apr 18 20:12:36 ubuntu-1 dhcpd: DHCPDISCOVER from 00:0c:01:02:03:04 via 192.168.150.1
Apr 18 20:12:36 ubuntu-1 dhcpd: DHCPDISCOVER from 00:0c:01:02:03:04 via 192.168.150.1
Apr 18 20:12:36 ubuntu-1 dhcpd: DHCPOFFER on 192.168.150.10 to 00:0c:01:02:03:04 via 192.168.150.1
Apr 18 20:12:36 ubuntu-1 dhcpd: DHCPDISCOVER from 00:0c:01:02:03:04 via 192.168.150.1
Apr 18 20:12:36 ubuntu-1 dhcpd: DHCPOFFER on 192.168.150.10 to 00:0c:01:02:03:04 via 192.168.150.1
Apr 18 20:12:36 ubuntu-1 dhcpd: DHCPDISCOVER from 00:0c:01:02:03:04 via 192.168.150.1
Apr 18 20:12:36 ubuntu-1 dhcpd: DHCPOFFER on 192.168.150.10 to 00:0c:01:02:03:04 via 192.168.150.1
Apr 18 20:12:36 ubuntu-1 dhcpd: DHCPDISCOVER from 00:0c:01:02:03:04 via 192.168.150.1
Apr 18 20:12:36 ubuntu-1 dhcpd: DHCPOFFER on 192.168.150.10 to 00:0c:01:02:03:04 via 192.168.150.1

senn from “perfdhcp --help” , default MAC address is 00:0c:01:02:03:04..

-b<base>: The base mac, duid, IP, etc, used to simulate different
   clients.  This can be specified multiple times, each instance is
   in the <type>=<value> form, for instance:
   (and default) mac=00:0c:01:02:03:04.

nnn , still error
# perfdhcp -4 -l eth1 -R 50 -n 1000 -r 10 -x aeistT
Running: perfdhcp -4 -l eth1 -R 50 -n 1000 -r 10 -x aeistT
IPv4
rate[1/s]=10
clients=50
num-request[0]=1000
drop-time[0]=1
drop-time[1]=1
aggressivity=1
broadcast
elp-offset=-1
sid-offset=-1
rip-offset=-1
diagnostic-selectors=aeistT
interface=eth1
server=255.255.255.255
Set MAC to 00::0c::01::02::03::04
Set DUID to 0001000119024e25000c01020304
Error running perfdhcp: unknown label character: 101

[ fail perfdhcp on Mint14]

Okay , I’ll build BIND10 on Mint 14 box and try perfdhcp on that box.
# uname -ri
3.5.0-27-generic x86_64

build BIND10
# git clone git://git.bind10.isc.org/bind10
# cd bind10
# autoreconf --install

# ./configure
configure: WARNING: /usr/bin/python3.2-config does not exist or is not executable, so we could not detect python development environment.  Your system may require an additional package (e.g. "python3-dev").  Alternatively, if you are sure you have python headers and libraries, define PYTHON_INCLUDES and PYTHON_LDFLAGS and run this script.
checking Python.h usability... no
checking Python.h presence... no
checking for Python.h... no
configure: error: Missing Python.h

# python --version
Python 2.7.3

install python 3.3 via apt-get
# apt-get install python3.3 python3.3-dev -y

# ./configure
hecking botan/botan.h presence... no
checking for botan/botan.h... no
configure: error: Missing required header files.

# apt-get install -y libbotan1.10-dev

# ./configure
checking log4cplus/logger.h usability... no
checking log4cplus/logger.h presence... no
checking for log4cplus/logger.h... no
configure: error: Missing required header files.

# apt-get install -y liblog4cplus-dev

# ./configure
checking boost/shared_ptr.hpp presence... no
checking for boost/shared_ptr.hpp... no
configure: error: Missing required header files.

# apt-get install libboost-all-dev -y

# ./configure
    BIND 10 source configure results:
   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Package:
 Name:          bind10
 Version:       20130221

C++ Compiler:    g++

Flags:
 DEFS:          -DHAVE_CONFIG_H
 CPPFLAGS:       -DOS_LINUX  -I$(top_srcdir)/ext/asio -I$(top_srcdir)/ext/coroutine -DASIO_DISABLE_THREADS=1
 CXXFLAGS:      -g -O2
 LDFLAGS:
 B10_CXXFLAGS:   -Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Werror -fPIC
 OS Family:     Linux
 Python:        -I/usr/include/python3.3m -I/usr/include/x86_64-linux-gnu/python3.3m

                 -L/usr/lib/python3.3/config-3.3m-x86_64-linux-gnu  -Wl,-R/usr/lib/python3.3/config-3.3m-x86_64-linux-gnu
                -lpython3.3
 Boost:
 Botan:         -I/usr/include/botan-1.10

                -lbotan-1.10   -lbotan-1.10
 Log4cplus:
                 -llog4cplus -pthread
 SQLite:
                -lsqlite3

Features:
  SQLite3

Developer:
 Enable Debugging: no
 Google Tests: no
 Valgrind: not found
 C++ Code Coverage: no
 Python Code Coverage: no
 Logger checks: no
 Generate Documentation: no


 Now you can type "make" to build BIND 10

# make
# make install

nn , error ..okay
# /usr/local/sbin/bind10 --version
Traceback (most recent call last):
 File "/usr/local/libexec/bind10/b10-init", line 72, in <module>
   import isc.cc
 File "/usr/local/lib/python3/dist-packages/isc/cc/__init__.py", line 2, in <module>
   from isc.cc.session import *
 File "/usr/local/lib/python3/dist-packages/isc/cc/session.py", line 25, in <module>
   import isc.log
ImportError: libb10-log.so.1: cannot open shared object file: No such file or directory
Error in sys.excepthook:
Traceback (most recent call last):
 File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
   from apport.fileutils import likely_packaged, get_recent_crashes
 File "/usr/lib/python3/dist-packages/apport/__init__.py", line 4, in <module>
   from apport.report import Report
 File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
   import apport.fileutils
 File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
   from apport.packaging_impl import impl as packaging
 File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
   import apt
 File "/usr/lib/python3/dist-packages/apt/__init__.py", line 21, in <module>
   import apt_pkg
ImportError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
 File "/usr/local/libexec/bind10/b10-init", line 72, in <module>
   import isc.cc
 File "/usr/local/lib/python3/dist-packages/isc/cc/__init__.py", line 2, in <module>
   from isc.cc.session import *
 File "/usr/local/lib/python3/dist-packages/isc/cc/session.py", line 25, in <module>
   import isc.log
ImportError: libb10-log.so.1: cannot open shared object file: No such file or directory

nnn , I can not find the root cause of this…

compile form soruce code instead of git.

uninstall bind10
# make uninstall

build bind10 from the source code
 636  tar xzvf bind10-1.0.0.tar.gz
 637  cd bind10-1.0.0/
 638  ./configure
 639  make;make install

another error..
# /usr/local/sbin/bind10 –version
Traceback (most recent call last):
 File "/usr/local/libexec/bind10/b10-init", line 71, in <module>
   import isc.cc
 File "/usr/local/lib/python3/dist-packages/isc/__init__.py", line 5, in <module>
   import isc.cc
 File "/usr/local/lib/python3/dist-packages/isc/cc/__init__.py", line 2, in <module>
   from isc.cc.session import *
 File "/usr/local/lib/python3/dist-packages/isc/cc/session.py", line 25, in <module>
   import isc.log
ImportError: libb10-cfgclient.so.0: cannot open shared object file: No such file or directory
Error in sys.excepthook:
Traceback (most recent call last):
 File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
   from apport.fileutils import likely_packaged, get_recent_crashes
 File "/usr/lib/python3/dist-packages/apport/__init__.py", line 4, in <module>
   from apport.report import Report
 File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
   import apport.fileutils
 File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
   from apport.packaging_impl import impl as packaging
 File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
   import apt
 File "/usr/lib/python3/dist-packages/apt/__init__.py", line 21, in <module>
   import apt_pkg
ImportError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
 File "/usr/local/libexec/bind10/b10-init", line 71, in <module>
   import isc.cc
 File "/usr/local/lib/python3/dist-packages/isc/__init__.py", line 5, in <module>
   import isc.cc
 File "/usr/local/lib/python3/dist-packages/isc/cc/__init__.py", line 2, in <module>
   from isc.cc.session import *
 File "/usr/local/lib/python3/dist-packages/isc/cc/session.py", line 25, in <module>
   import isc.log
ImportError: libb10-cfgclient.so.0: cannot open shared object file: No such file or directory

packages which are required to run bind10 are missing ??
# apt-get install build-essential autoconf libtool pkg-config zlib1g-dev libssl-dev libexpat1-dev libreadline6-dev libboost-all-dev libbotan1.10-dev liblog4cplus-dev libsqlite3-dev python3.3-dev sqlite3 python3-setuptools

still error
# bind10 --version
Traceback (most recent call last):
 File "/usr/local/libexec/bind10/b10-init", line 71, in <module>
   import isc.cc
 File "/usr/local/lib/python3/dist-packages/isc/__init__.py", line 5, in <module>
   import isc.cc
 File "/usr/local/lib/python3/dist-packages/isc/cc/__init__.py", line 2, in <module>
   from isc.cc.session import *
 File "/usr/local/lib/python3/dist-packages/isc/cc/session.py", line 25, in <module>
   import isc.log
ImportError: libb10-cfgclient.so.0: cannot open shared object file: No such file or directory
Error in sys.excepthook:
Traceback (most recent call last):
 File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
   from apport.fileutils import likely_packaged, get_recent_crashes
 File "/usr/lib/python3/dist-packages/apport/__init__.py", line 4, in <module>
   from apport.report import Report
 File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
   import apport.fileutils
 File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
   from apport.packaging_impl import impl as packaging
 File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 20, in <module>
   import apt
 File "/usr/lib/python3/dist-packages/apt/__init__.py", line 21, in <module>
   import apt_pkg
ImportError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
 File "/usr/local/libexec/bind10/b10-init", line 71, in <module>
   import isc.cc
 File "/usr/local/lib/python3/dist-packages/isc/__init__.py", line 5, in <module>
   import isc.cc
 File "/usr/local/lib/python3/dist-packages/isc/cc/__init__.py", line 2, in <module>
   from isc.cc.session import *
 File "/usr/local/lib/python3/dist-packages/isc/cc/session.py", line 25, in <module>
   import isc.log
ImportError: libb10-cfgclient.so.0: cannot open shared object file: No such file or directory

seen from Google results , the workaround is just issuing “ldconfig” …
# ldconfig
# bind10 --version
bind10 20110223 (BIND 10 1.0.0)

finally I could build bind10 :D

The purpose of compiling bind10 on Mint 14 box is … to use perfdhcp !!
let’s use perfdhcp on Mint 14 box.

run perfdhcp
another process is grabing port 67 ..
# /usr/local/bin/perfdhcp -4 -l eth3 -R 50 -n 1000 -r 10 -x aeistT
Running: perfdhcp -4 -l eth3 -R 50 -n 1000 -r 10 -x aeistT
IPv4
rate[1/s]=10
clients=50
num-request[0]=1000
drop-time[0]=1
drop-time[1]=1
aggressivity=1
broadcast
elp-offset=-1
sid-offset=-1
rip-offset=-1
diagnostic-selectors=aeistT
interface=eth3
server=255.255.255.255
Set MAC to 00::0c::01::02::03::04
Set DUID to 00010001190261b7000c01020304
Error running perfdhcp: Failed to bind socket 3 to 192.168.150.5/port=67

# lsof -ni:67
COMMAND  PID            USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
dnsmasq 3222 libvirt-dnsmasq    4u  IPv4  18965      0t0  UDP *:bootps

kill this process and run perfdhcp
nnn , same error..
# lsof -ni:67
COMMAND  PID            USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
dnsmasq 3222 libvirt-dnsmasq    4u  IPv4  18965      0t0  UDP *:bootps
# kill 3222

# lsof -ni:67
# /usr/local/bin/perfdhcp -4 -l eth3 -R 50 -n 1000 -r 10 -x aeistT
Running: perfdhcp -4 -l eth3 -R 50 -n 1000 -r 10 -x aeistT
IPv4
rate[1/s]=10
clients=50
num-request[0]=1000
drop-time[0]=1
drop-time[1]=1
aggressivity=1
broadcast
elp-offset=-1
sid-offset=-1
rip-offset=-1
diagnostic-selectors=aeistT
interface=eth3
server=255.255.255.255
Set MAC to 00::0c::01::02::03::04
Set DUID to 0001000119026534000c01020304
Error running perfdhcp: unknown label character: 101

both CentOS perfdhcp and Mint perfdhcp box has many interfaces , because I’m using KVM on both boxes.. is this the root cause ??
# ifconfig | awk '{print $1}' | egrep "(vir|lo|eth)"
eth0
eth1
eth2
eth3
lo
virbr0
virbr1
virbr2
virbr3
virbr4
virbr5

[ success perfdhcp on Fedora 18 ]

I build Fedora18 VM with KVM.
This VM has no bridge interfaces.
# ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

run perfdhcp
Okay , I can run perfdhcp w/o any problems as of now.
It seems that perfdhcp can not run if that box has bridge interfaces.
# /usr/local/bin/perfdhcp -4 -l eth1 -x aeistT
Running: perfdhcp -4 -l eth1 -x aeistT
IPv4
drop-time[0]=1
drop-time[1]=1
aggressivity=1
broadcast
elp-offset=-1
sid-offset=-1
rip-offset=-1
diagnostic-selectors=aeistT
interface=eth1
server=255.255.255.255
Set MAC to 00::0c::01::02::03::04
Set DUID to 000100011902839e000c01020304

DHCPD logs
Apr 18 22:23:35 ubuntu-1 dhcpd: DHCPDISCOVER from 00:0c:01:02:03:04 via 192.168.150.17
Apr 18 22:23:35 ubuntu-1 dhcpd: DHCPOFFER on 192.168.150.10 to 00:0c:01:02:03:04 via 192.168.150.17

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.