Adequate Power

Getting the wave-2 chipset working over the air has been surprisingly challenging.  Cabled transmission (SMA cables) to an AP was working mildly well,  and over the air (OTA) transmission was just not working at all.

We decided to investigate the power requirements of the chip. We were told that power draw would be up to 14 watts. We’ve seen PCIe cards draw 12W from the PCIe bus before. This radio has power connector points on the board for an extra 5v lead.

To our surprise, hooking up a 5V lead from a floppy drive power header on the motherboard was inadequate. So we attached multi-meters and saw that it was pulling the 5v line down to 4.22V and drawing 2.5amps. Holy cow!

We decided we needed power off of the 12V line. Soldering up a 15W linear regulator, we got a much steadier 5V supply to the card. It worked!

image
Multi-meters connected to measure current draw and voltage levels
image
Heat sink on the DC regulator

This time,  we were able to connect a station to the AP and start a 850Mbps download without any trouble. Whew!

Measuring Jitter

In verifying our latest software release for LANforge, I wanted an independent way to verify and measure the jitter imposed on a wanlink. There are many ways to accomplish this, but here is a summary of my procedure.

  • Synchronize clocks
  • Setup a wanlink with delay and jitter
  • Start captures on sender and receiver
  • Start UDP traffic in one direction
  • Run the captures through a script to estimate the jitter
  • Compare to LANforge jitter measurement

The information from the following links was very helpful in creating a bash script to calculate jitter from wireshark captures:

The network topology I used was two computers each with a network interface connected to the other through a switch. Each computer is running the LANforge software, so I was able to create a wanlink on one interface so that the latency and jitter impairments would affect packets leaving that interface.

netsmith-wanlink

To synchronize the clocks, I used ntpd on one system and ntpdate on the other.

The wanlink was set to 1.544Mbps with 10ms of delay and 100ms of jitter at a frequency of 1%. As I was capturing traffic, I varied the jitter frequency from 1% to 10% to 50% then 0%. See the LANforge User Guide for a detailed explanation of how jitter is set:

https://www.candelatech.com/lfgui_ug.php#wl_mod

wanlink

I initiated the wireshark captures from the LANforge Port Manager, but could have also used tshark to do this.

The UDP traffic was a one-way 56Kbps connection from eth1 on one system to the virtual interface behind the wanlink on the other system. The connection ran for about 180 seconds while I varied the jitter frequency on the wanlink.

I stopped the captures and filtered out all other traffic such as arps or icmps so that only lanforge protocol traffic remained and then ran the captures through the getjitter.bash script which also generated this image:

1-10-50-0-jitter

This matched up to what the LANforge Dynamic Report tool displayed for the jitter measurement on the connection:

1-10-50-0-jitter-dyn-rpt

The bash script below is used as follows:

./getjitter.bash sender.pcap receiver.pcap

It uses tshark, bc, gnuplot and qiv. It could probably be cleaned up, but the jitter estimate appears to be accurate.

#!/bin/bash

tshark -r $1 -T fields -e frame.time_epoch > frametimeS
tshark -r $2 -T fields -e frame.time_epoch > frametimeR
tshark -r $1 |awk '{print $2}' > ticks
tshark -r $1 -T fields -e udp.length > rates

declare -a S=(`cat frametimeS`)
declare -a R=(`cat frametimeR`)
declare -a T=(`cat ticks`)
declare -a Rate=(`cat rates`)
jitter=0
i=0

j=`echo ${#S[@]}`
let j=$j-2

for ((k=0; k<=$j; k++)); do
 #echo "${R[$i]} ${R[i+1]}"
 D=`echo "(${R[i+1]} - ${R[$i]}) - (${S[i+1]} - ${S[$i]})" |bc |tr -d -`
 rate=`echo "((${Rate[$i]}*8) / (${S[i+1]} - ${S[$i]}))" |bc |tr -d -`
 jitter=`echo "$jitter + ($D - $jitter)/16" |bc -l`
 #printf "%12s - %12s = %12s , %12s\n" ${R[i+1]} ${R[$i]} $D $jitter
 echo "${T[$i]} $jitter $rate" >> myjitter
 i=$i+1
done

echo 'set style data points' > jitter.gp
echo 'set nogrid' >> jitter.gp

echo 'set style line 1 lt 1 lw 2' >> jitter.gp
echo 'set style line 2 lt 2 lw 2' >> jitter.gp
echo 'set style line 3 lt 3 lw 5' >> jitter.gp
echo 'set style line 4 lt 3 lw 1' >> jitter.gp
echo 'set style line 5 lt 3 lw 2' >> jitter.gp
echo 'set style line 6 lt 3 lw 1' >> jitter.gp
echo 'set style line 7 lt 17 lw 2' >> jitter.gp
echo 'set style line 8 lt 17 lw 4' >> jitter.gp

echo 'set xlabel "Time (sec)"' >> jitter.gp
echo 'set ylabel "Jitter (sec)"' >> jitter.gp

echo 'plot "myjitter" using 1:($2/1) title "jitter" with impulses ls 6' >> jitter.gp

echo 'set term png' >> jitter.gp
echo 'set output "jitter.png"' >> jitter.gp
echo 'replot' >> jitter.gp

gnuplot jitter.gp 2>&1 1>/dev/null
qiv jitter.png &

The next steps for improving this jitter measurement would be to incorporate a sequence number check to look for drops and a latency measurement to get a more detailed evaluation of the impairments setup on the wanlink.

For the latency measurement, I came up with this script used as follows:

./getlatency.bash sender.pcap receiver.pcap

It makes use of the lanforge protocol as decoded by wireshark to acquire and verify sequence numbers.

#!/bin/bash

tshark -r $1 -T fields -e lanforge.seqno > seqno1
tshark -r $2 -T fields -e lanforge.seqno > seqno2
tshark -r $1 -T fields -e frame.time_epoch > frame1
tshark -r $2 -T fields -e frame.time_epoch > frame2
tshark -r $1 |awk '{print $2}' > ticks

declare -a array1=(`cat seqno1`)
declare -a array2=(`cat seqno2`)
declare -a frame1=(`cat frame1`)
declare -a frame2=(`cat frame2`)
declare -a T=(`cat ticks`)
latency=0
i=0

for key in "${!array1[@]}";
do
 if [ $key == ${array2[$key]} ]; then
 array1[$key]=${frame1[$key]}
 array2[$key]=${frame2[$key]}
 else
 unset array1[$key]
 unset array2[$key]
 fi
 
 latency=`echo "(${array2[$key]} - ${array1[$key]})*1000" |bc -l`
 if [[ $latency == 1[1-9][1-9]* ]]; then
 echo "${T[$key]} $latency" 
 fi
 echo "${T[$key]} $latency" >> mylatency
done

echo 'set style data points' > latency.gp
echo 'set nogrid' >> latency.gp

echo 'set style line 1 lt 1 lw 2' >> latency.gp
echo 'set style line 2 lt 2 lw 2' >> latency.gp
echo 'set style line 3 lt 3 lw 5' >> latency.gp
echo 'set style line 4 lt 3 lw 1' >> latency.gp
echo 'set style line 5 lt 3 lw 2' >> latency.gp
echo 'set style line 6 lt 3 lw 1' >> latency.gp
echo 'set style line 7 lt 17 lw 2' >> latency.gp
echo 'set style line 8 lt 17 lw 4' >> latency.gp

echo 'set xlabel "Time (sec)"' >> latency.gp
echo 'set ylabel "Latency (ms)"' >> latency.gp

echo 'plot "mylatency" using 1:($2/1) title "latency" with impulses ls 6' >> latency.gp

echo 'set term png' >> latency.gp
echo 'set output "latency.png"' >> latency.gp
echo 'replot' >> latency.gp

gnuplot latency.gp 2>&1 1>/dev/null
qiv latency.png &

Which produced this image:

1-10-50-0-latency.png

This shows that the capture files verify that there is about a 17ms baseline delay due to the 7ms serialization delay and 10ms additional delay setup on the wanlink. As I increased the jitter frequency, more packets experienced the 100ms jitter.

 

 

Turning off IPMI DHCP

Many SuperMicro motherboards have IPMI features that have a dual-port feature. The first two Ethernet ports on the motherboard are capable of serving the IPMI function.

IPMI served by these ports
IPMI served by these ports

If the dedicated IPMI port is not cabled, IPMI will be served off the LAN1 port (which is predictably the MGT port on LANforge machines).

Turning off IPMI is often not possible, but turning off the IPMI port DHCP is possible. There are two ways of doing this, and you might not even need to reboot your server if your IPMI driver is included in the Linux distribution you are using.

Using the Linux IPMI tools

You might have either the ipmiutils or the ipmitool package available, maybe both. Both are probably going to rely on the same drivers, however.

ipmiutil

# install
 $ sudo yum install ipmiutil
# show configuration
 $ sudo ipmiutil lan -c
# disable the LAN feature (if desired)
 $ sudo ipmiutil lan -d
# or set a fixed IP:
 $ ipmiutil lan -e -I 0.0.0.0

Setting the address of 0.0.0.0 sometimes is a shortcut for disabling the IPMI LAN features. Or you can set a normal non-routable address like 192.168.0.251. (Refer to this post.)

ipmitool

Similar commands are listed for IPMITool on this post. The “lan set 1” phrase refers to “IPMI Device 1.”

 $ sudo ipmitool lan set 1 ipsrc static
 $ sudo ipmitool lan set 1 ipaddr 192.168.0.251
 $ sudo ipmitool lan set 1 netmask 255.255.255.0
 $ sudo ipmitool lan set 1 defgw ipaddr 192.168.0.1

Configuring the BIOS

We might have a motherboard that isn’t in the driver set for these tools. This is how you’d know:
ipmi-100

In this scenario, we need to reboot and press DEL to get into the BIOS. You will likely never see two motherboards with exactly the same BIOS screen layout…but just look for IPMI and you’ll likely get to screens that look like this:

Advanced screen bios-100

Advanced – IPMI Configuration

bios-101

IPMI LAN Configuration

bios-102We can verify that this is the MAC address we’re seeing traffic from using tcpdump. Let’s also gather the MAC addresses because we’ll want those as a reference when looking at our tcpdump data.

bios-ip-103

Now we can craft a tcpdump that will show useful things:

tcpdump -eni eth1 \
    ether host 00:25:90:01:66:0a \
 or ether host 00:25:90:01:66:0b \
 or ether host 00:25:90:01:8a:ef

And we’ll see results like this:

17:35:07.814819 00:25:90:01:8a:ef > Broadcast, ethertype IPv4 (0x0800), length 590: 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:25:90:01:8a:ef, length 548
17:35:10.874561 00:25:90:01:8a:ef > Broadcast, ethertype IPv4 (0x0800), length 590: 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:25:90:01:8a:ef, length 548
17:35:13.945135 00:25:90:01:8a:ef > Broadcast, ethertype IPv4 (0x0800), length 590: 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:25:90:01:8a:ef, length 548

Clearly, we’re getting getting DHCP broadcasts from that port. After setting the IPMI IP in the BIOS to 0.0.0.0, those broadcasts stop.

Using UTF-8 in Your SSIDs

The LANforge server process is not multi-byte character aware, and pasting hanzi or other logograms into the GUI will get mangled. What is displayed is an byte escape sequence, like what this script shows:

 > ./utf8hex.pl 小猫
\xe5\xb0\x8f\xe7\x8c\xab

This is the C-language byte encoding for those UTF-8 characters. This is what wpa_supplicant and hostapd rely on in their configuration files. (That script is pasted below.)

If you paste hanzi into the hostapd.conf file “ssid=” property, (you have to specify a custom file) you can get a virtual AP to come up. It will NOT associate with a station. The wrong way:
2015-10-23-vap-utf8-101

If you paste the byte sequence into the ssid property, a station WILL associate. Make sure to specify utf8_ssid=1. The right way:
2015-10-23-vap-utf8-201

The display scan window will display the SSID as a byte sequence.
2015-10-23-vap-utf8-100

The SSID picker in the Port Modify will show the byte sequence after you click the DISPLAY SCAN button.
2015-10-23-vap-utf8-102

Watch your Wireless Events log window for of station association messages. A station that continues to scan even if the SSID is shown in the scan windows is one that is not connecting.

2015-10-23-vap-utf8-200

This is the right way to write the wpa_supplicant file, with the SSID escape sequence. Use the utf8hex script to get this byte sequence.
2015-10-23-vap-utf8-103

Here is the utf8hex.pl script:

#!/usr/bin/perl -w
use utf8;

for my $u (@ARGV) {

   foreach my $ch (split('', $u)) {
      my $b = ord($ch);
      if ($b >= 20 && $b <= 126) {
         print $ch;
      }
      else {
         printf("\\x%x", $b);
      }
   }
   print "\n";
}

Captive Portal Automated Testing

wifi_captive_portalIf you’ve ever been to a coffee shop for free WiFi, and needed to sign-in for Internet access, you’ve used a Captive Portal. Are you developing one? How many stations can your portal controller authenticate simultaneously? Let’s do some automated testing of that with LANforge. This cookbook will guide you through how to use the portal-bot script.
#wifi #network #testing