netdetect: detect all servers before network bench

This commit add a new program to automize the detection of available
server to perform a network bench.

It features two parts :
- client side
It generates keepalive message on a multicast adress containing all it's
IP adresses taken from hw.py

- server side
Collects all the keepalive message and save server's name (mac address)
and it's associated IP adresses

If with miss 2 consecutive keepalive, the entry is deleted (that's the
scrubbing process)
If no changes occurs within a defined time, the discovery process is
over.

The first server that complete the detection send its server list to the
other to insure all servers have the same list.

A typical output is :
[root@localhost src]# ./netdetect.py hw.py
Sending keepalive for 00:21:cc:d9:bf:26
Adding 00:21:cc:d9:bf:26
Sending keepalive for 00:21:cc:d9:bf:26
Received Keepalive from 00:21:cc:d9:bf:26
Adding d8:9d:67:1b:07:e4
Sending keepalive for 00:21:cc:d9:bf:26
Received Keepalive from 00:21:cc:d9:bf:26
Received Keepalive from d8:9d:67:1b:07:e4
Adding d8:9d:67:1a:d0:fc
Sending keepalive for 00:21:cc:d9:bf:26
Received Keepalive from 00:21:cc:d9:bf:26
Received Keepalive from d8:9d:67:1b:07:e4
Received Keepalive from d8:9d:67:1a:d0:fc
Sending keepalive for 00:21:cc:d9:bf:26
Received Keepalive from 00:21:cc:d9:bf:26
Received Keepalive from d8:9d:67:1b:07:e4
Received Keepalive from d8:9d:67:1a:d0:fc
Sending keepalive for 00:21:cc:d9:bf:26
Received Keepalive from 00:21:cc:d9:bf:26
Received Keepalive from d8:9d:67:1b:07:e4
Received Keepalive from d8:9d:67:1a:d0:fc
Sending keepalive for 00:21:cc:d9:bf:26
Received Keepalive from 00:21:cc:d9:bf:26
Received Keepalive from d8:9d:67:1b:07:e4
Received Keepalive from d8:9d:67:1a:d0:fc
Sending keepalive for 00:21:cc:d9:bf:26
Received Keepalive from 00:21:cc:d9:bf:26
Received Keepalive from d8:9d:67:1b:07:e4
Received Keepalive from d8:9d:67:1a:d0:fc
About to send the synthesis
Exiting Client, end of discovery
Received Synthesis
End of Discovery with 3 systems!
Exiting server
Synthesis result
Server d8:9d:67:1b:07:e4 -> 10.66.6.136
Server d8:9d:67:1a:d0:fc -> 10.66.6.249
Server 00:21:cc:d9:bf:26 -> 192.168.1.185 10.152.18.104
detect: Adding ipv4 netmask and cidr value

If an IPV4 address got found, its usefull to report its netmask and cidr
representation to add more context.

This will be used by AHC mode to determine what network is the common
point between all servers.

A typical output is like :
 ('network', 'eth0', 'ipv4', '10.142.32.227'),
 ('network', 'eth0', 'ipv4-netmask', '255.255.255.0'),
 ('network', 'eth0', 'ipv4-cidr', '24'),
detect: Adding ipv4 network

It could be useful to get the network too.

A typical output is :
 ('network', 'eth0', 'ipv4-network', '10.142.32.0'),
netdetect: Adding CIDR in IP field

When reporting an IP to the other systems, let's add the CIDR mask to
ease the detection of systems in the same network.
health: Adding netmask,cidr,network for sample files

Useful to debug AHC
netdetect: Adding IP filtering

Before sending the synthesis to all nodes, we need to do some filtering.
Some servers are maybe in a different subnet and cannot participate in
the benchmark.

Let's count what subnetwork is getting the more servers from the initial
server list and then filter the server list to get one IP per server
than match this network.

Once the filtering is done, let's send it to the servers.

The next step is to self-eliminate servers that are no more part of this
list since they shall not participate in the benchmark.
netdetect: Implementing network benchmarking

This pretty long commit is adding the following steps:
- compute the port list that every server shall create
- every server starts its benchmark servers
- every server inform the leader it's ready to run
- leader waits all servers to tell they are ready
- leader sends a message to start the benchmark
- servers runs the benchmark simultaneously

TODO:
- doing a precise configurtion of the benchmark
- parsing netperf's output
- save information
health-check: Network mode requires netperf

Netperf is mandatory to make performance checks.
netdetect: Initial parsing of network results

This patch implements the first parsing to get socket & message size and
the according bandwidth.
pxe & health-check: Adding python-netaddr dependency

Since commit 527318d1ee9b258fc01cb6f7c3e47f3b60118f0a, python-netaddr is
mandatory to make detect.py working properly.
health-check: Renaming target image

While building health-check, let's name it health.img to avoid mixing
with initrd.pxe
health-check: Installing netdetect

We need netdetect to be part of the health-check image.
netdetect: Let's save the resulting file

Let's print it to the console and save it in a file.

Typical output is:

Saving results in ProLiantDL360pGen8655651B21-HP-CZ3323FDV8d8-9d-67-1a-41-7c.perf.hw
[...]
('network', 'tcp_bench', 'conf', '87380/16384/16384'),
('network', 'tcp_bench', 'bw', '110.51')]

Note the .perf.hw extension.
netdetect: If a single server is present, let's exit

There is no interest testing a single server....
netdetect: Daemon option doesn't always exist

On some older release of netperf, the -D option doesn't exist.
As we are part of a thread, this is not a fatal issue.

netserver is so running in background.
netdetect: s/killall/pkill/

I don't have killall on the wheezy
netdetect: Adding port information to netperf

Former commit did remove the port by mistake, let's put it back again.
netdetect: Don't search for perfect timing

When parsing netperf output, don't try to search x.00 value as sometimes
it's ending a little bit later. So search x. is enough.
pxe & health: Adding ethtool as dependency

It's a very useful tool that will allow reporting much more about the
ethernet device configuration (rx/tx/...)
netdetect: Avoid naming conflict