Skip to content

Commit 193503f

Browse files
committed
Use wifidog -a for mock ARP table
Also bump number of clients up to 40. Update README.
1 parent 8ccab94 commit 193503f

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

contrib/load-tester/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,16 @@
1111
Once you think the script has run long enough, kill run.sh and look at
1212
valgrind.log. You have to clean up after the script yourself, e.g. kill
1313
mock\_auth.py separately and run **./generate_interfaces.sh stop**
14+
15+
### Note on ARP tables ###
16+
17+
Although generate\_interfaces.sh will add random MAC addresses
18+
to the virtual interfaces, these will not show up in the local
19+
ARP table. The ARP table only lists remote systems. Even with the
20+
**publish** flag set, the ARP table entry will list an all-zero MAC
21+
address. For this reason, the script generates a fake ARP table
22+
and passes it to wifidog with the **-a** switch.
23+
24+
The macvlan type virtual interface used by generate\_interfaces.sh
25+
is still useful if you load-test a remote wifidog instance. In this case,
26+
the remote ARP table will (hopefully) be populated correctly.

contrib/load-tester/generate_interfaces.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ PREFIX="mac"
77
# don't touch resolv.conf
88
DHCP="dhcpcd --waitip -C resolv.conf"
99
#DHCP="dhclient -v"
10-
1110
NET="10.0.10."
11+
ARPTABLE="/tmp/arp"
1212

13+
COUNT=$2
1314

1415
function start() {
15-
echo "IP address HW type Flags HW address Mask Device" > /tmp/arp
16+
echo "IP address HW type Flags HW address Mask Device" > $ARPTABLE
1617
# Add internal address for GW
1718
sudo ip link add internal0 link $IF type macvlan mode bridge || exit 1
1819
sudo ip addr add ${NET}254 dev internal0
1920
sudo ip link set internal0 up || exit 2
20-
for i in `seq 0 9`; do
21+
for i in `seq 0 $COUNT`; do
2122
echo "Add link $i"
2223
# sudo ip link add virtual0 link eth0 type macvlan mode bridge
2324
sudo ip link add ${PREFIX}${i} link $IF type macvlan mode bridge || exit 1
@@ -32,13 +33,13 @@ function start() {
3233
# when using DHCP, the interface would immediately
3334
# go down?
3435
#sudo $DHCP ${PREFIX}${i} || exit 3
35-
echo " ${NET}$(($i + 1)) 0x1 0x2 $MAC * ${PREFIX}${i}" >> /tmp/arp
36+
echo " ${NET}$(($i + 1)) 0x1 0x2 $MAC * ${PREFIX}${i}" >> $ARPTABLE
3637
done
3738
}
3839

3940
function stop() {
4041
sudo ip link del internal0 2>/dev/null || true
41-
for i in `seq 0 9`; do
42+
for i in `seq 0 $COUNT`; do
4243
echo "Deleting link $i"
4344
sudo ip link del ${PREFIX}${i} 2>/dev/null || true
4445
done

contrib/load-tester/run.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
#!/bin/bash
22

3+
COUNT=40
34

45
echo "Make sure to configure GatewayInterface in wifidog_mock.conf"
56

6-
./generate_interfaces.sh start || exit 1
7+
./generate_interfaces.sh start $COUNT || exit 1
78

89
./mock_auth.py &
910

1011
# trace-children is necessary because of the libtool wrapper -.-
1112
#sudo valgrind --leak-check=full --trace-children=yes --trace-children-skip=/bin/sh \
1213
# --log-file=valgrind.log ../../src/wifidog -d 7 -f -c wifidog-mock.conf 2> wifidog.log &
1314

14-
../../src/wifidog -d 7 -f -c wifidog-mock.conf 2> wifidog.log &
15+
../../src/wifidog -d 7 -f -c wifidog-mock.conf -a /tmp/arp 2> wifidog.log &
1516

1617
IF=`grep GatewayInterface wifidog-mock.conf | cut -f 2 -d ' '`
1718

1819
echo "Waiting for wifidog to come up"
1920

2021
sleep 10
21-
./fire_requests.py $IF mac 9
22+
./fire_requests.py $IF mac $COUNT
2223

2324
#./generate_interfaces.sh stop
2425

0 commit comments

Comments
 (0)