RSSI Measurements and RF Switch (50PA-338) Calibration Notes

From VirtualMeshTest
Jump to: navigation, search

I used the RSSI measurements from the first field experiement on Oct 20th, 2009 and the RSSI measurements on mesh testbed with the insertion loss=40dB to for my first attempt to calibrate the RF switch.

The simplest form of path loss is

L = 10*n*log10(d)+C

We can set n and C as we want.

Contents

Summary of Findings

Initially I started this note as an RF switch calibration note, but I ended up investigating the cause of RSSI fluctuations particularly in the emulated experiments under the mesh testbed.

In the field, the interference or noise can cause RSSI fluctuations, but in the mesh testbed they are not likely to be the causes of RSSI fluctuations of more than 20dB.

The first cause is the tx antenna diversity, and its outcome is bi-modal distribution of RSSIs. The second cause is more chaotic. It seems to be the agitation by the RF switch attenuation setting to the channel condition.

The Cause of RSSIs Bi-modal Distribution : Tx Antenna Diversity

Researchers from Universit`a degli Studi di Roma and Universit`a di Palermo have investigated the cause of RSSI's bi-modal distributions, and they published a number of papers to explain this RSSI behavior.

Initially, in Are 802.11 link quality broadcast measurements always reliable?, they suspected that the power save mechanism is the primary cause of the bi-modal distribution, but they concluded in G. Bianchi, A. D. Stefano, C. Giaconia, L. Scalia, G. Terrazzino, and I. Tinnirello, “Experimental assessment of the backoff behavior of commercial ieee 802.11b network cards,” in INFOCOM. IEEE, 2007, pp. 1181–1189. that the tx antenna diversity is the primary cause of the bi-modal distribution. According to this paper, the madwifi transmit diversity algorithm appears to cyclically (periodically) switch between the two antennas in the case of broadcast and multicast because the transmitter cannot obtain feedbacks from the receivers. In case of unicast, the transmitter utilizes the feedbacks from the receivers (ACKs) to determine which antenna to use.

In Domenico Giustiniano's PhD thesis, he showed that Intel's 802.11 also has similar tx antenna diversity scheme, so it is very likely to see this bi-modal distribution for other vendor's 802.11 devices utilizing tx antenna diversity.

Also according to UserDocs/AntennaDiversity - madwifi-project.org - Trac, "the switch that selects which antenna transmits tends to have about a 10dB-15dB attenuation on the non-transmitting antenna. So there is some power that goes to that non-transmitting antenna. Also, if you see fluctuations in output power levels of about that amount on one antenna, then it may be diversity kicking in."

Tanja Lang, Geoff Fellows and John Louis also observed in The Impact of Packet Type on Signal Strength in WLANs that the control packets have bi-modal distribution while data and management packets have uni-modal distribution, but they couldn't clearly state the cause of bi-modal distribution. It can be explained by the tx antenna diversity since most of the contol packets are beacons and probes which are broadcast packets while most of the data packets are unicast packets.

The Cause of Additional RSSI Fluctuation : Executions of RF Switch Attenuation Settings

These types of RSSI fluctuations were observed only under the mesh testbed. Whenever an SA (Set Attenuation) command is executed on the RF switch, the channel condition in the emulator is affected and the RSSIs end up in the different range of values. It looks more chaotic than the bi-modal distribution stuff. This RSSI fluctuations are gone once we installed terminators on the ports on the backend side of the RF switches.

What we need to do?

We have to disable tx antenna diversity in the emulator. It is not an option because with the tx antenna diversity, the error rate for broadcast frames such as beacons will increase a lot and it will cause more frequent disconnection and disassociation of the clients because the client usually think it is disconnected when it loses three consecutive beacons.

Also be sure to use terminators on the RF switches.

Field Test vs. Emulated Test with default setting

The set-ups were

  • Antenna diversity was disabled at the field test and enabled at the Emulated Test.
  • Management Frames (beacons, probes) were used.

When all measurements were taken into account, the exponent values don't seem to be those of free space. Median values were used. I also have drawn graphs using average values. It helps to have an exponent value close to two for the field test taking all measurements into account, but it makes the graph deviate for the exponent of two when the first measurement is dropped. It also makes the emulated test results deviate more from the exponent of two.

The median RSSI measurements from the field test on Oct 20th, 2009
The average RSSI measurements from the field test on Oct 20th, 2009
The median RSSI measurements from the mesh testbed (exponent = 2, insertion loss = 40dB)
The average RSSI measurements from the mesh testbed (exponent = 2, insertion loss = 40dB)
RSSI Measurements
Exponent (n) System Loss (C) R^2
The field experiement on Oct 20th, 2009/Median RSSI 2.42 -29.61 0.93
The field experiement on Oct 20th, 2009/Average RSSI 1.99 -40.22 0.93
Test on the mesh testbed/Median RSSI 1.61 -38.58 0.86
Test on the mesh testbed/Average RSSI 1.18 -49.70 0.73

The first measurement which is done at the shortest distance look suspicious both in the field test and the emulated test, so I decided to drop the first measurement.

The median RSSI measurements from the field test on Oct 20th, 2009
The average RSSI measurements from the field test on Oct 20th, 2009
The median RSSI measurements from the mesh testbed (exponent = 2, insertion loss = 40dB
The average RSSI measurements from the mesh testbed (exponent = 2, insertion loss = 40dB

Now the exponent values is very close to two which is the typical exponent for the free space while they are losing linearity (R^2 decreased to ~0.74.)

RSSI Measurements
Exponent (n) System Loss (C) R^2
The field experiement on Oct 20th, 2009/Median RSSI 1.99 -40.47 0.74
The field experiement on Oct 20th, 2009/Average RSSI 1.80 -44.94 0.75
Test on the mesh testbed (exponent = 2, insertion loss = 40dB) / Median RSSI 2.00 -29.08 0.74
Test on the mesh testbed (exponent = 2, insertion loss = 40dB) / Average RSSI 1.67 -37.41 0.66

In all cases so far, average RSSIs result in smaller exponent values than median RSSIs.

Now I decided to increase the insertion loss of the RF switch from 40dB to 40 + (40.47-29.08) = 51.39 (dB).

For some locations, I realized the RSSI values are multi-modal. For instance, the RSSI values at the first, fourth, sixth and eighth locations are definitely multi-modal.

RSSIs at 0.5 meters
RSSIs at 94.3 meters
RSSIs at 157.4 meters
RSSIs at 254.1 meters

while the RSSI values at second, third, fifth and seventh locations are uni-modal.

RSSIs at 35.2 meters
RSSIs at 51.8 meters
RSSIs at 135.3 meters
RSSIs at 216.6 meters

Why do we have bi-modal distributions for RSSIs? Primary Cause is Tx Antenna Diversity.

In the previous pictures, it seems that all RSSIs at all locations have bi-modal distributions. The reason that we observed uni-modal at the second/third/fifth and seventh locations is that the lower RSSIs seem to be below the receiver sensitivity.

If tx antenna diversity is the the primary reason for the multi-modal distribution of RSSIs, then the energy from the second antenna radiated to the cable between the first antenna and the RF switch is at least larger than -61 dBm (the min RSSI observed at distance = 0.5 meters). The difference between the higher RSSIs and lower RSSIs are about 30dB, and it corresponds to the loss from the disconnected second antenna to the cable end.

Therefore I disabled the antenna diversity particularly on the transmitter side. You can do this by

sysctl -w dev.wifi0.diversity=0
sysctl -w dev.wifi0.txantenna=1
sysctl -w dev.wifi0.rxantenna=1

It worked and the RSSI values at every location is now uni-modal. Compare the two pictures. The measurements with antenna diversity is in the first picture, and the those without antenna diversity is in the second picture. You can see the gap between max and min RSSI values is much smaller in the second picture, and it is actually uni-modal.

RSSIs with tx antenna diversity
RSSIs without tx antenna diversity

However, it is not just a vertically shifted version of RSSIs from the field test.

The RSSI measurements from the mesh testbed (exponent = 2, insertion loss = 51.4dB, tx antenna diversity disabled)

Also the exponent is > 2.1 and it is not a good fit to a linear function (R^2 = 0.46).

RSSI Measurements
Exponent (n) System Loss (C) R^2
Test on the mesh testbed (exponent = 2, insertion loss = 51.4dB, tx antenna diversity disabled) 2.12 -17.48 0.46

Roundtrip Experiment

It also somehow emulated the first field experiment. The same locations (distances from the peer node) in the field experiments were selected. At each location, the node stayed for ten seconds.

The distance between p001 and p002

First Experiment (Oct 27th, 2009)

Another issue that is observed is that the RSSI values tend to converge to different values when the attenuation setting is changed (i.e. channel condition is changed). It happened even though I manually fixed the rate to 1Mbps and the txpower to 17dBm. See the following picture. It is the graph of RSSIs measured when a node is having a round trip between two points (between d=0.5 meters and d=356.6 meters). This graph is not symmetrical. You can also notice that at the beginning point (d=0.5 meters) the RSSI is about -25dBm but when the node comes back to the same location at the end of the trip, the RSSI is about -36dBm.

RSSIs measured when a node is having a round trip between two points (between d=0.5 meters and d=356.6 meters)

Possibly the transmitter can adaptively control the txpower anyway, or the receiver change the gain dynamically. Also I note that any level of accuracy is not guaranteed for the RSSI (That's why the RCPI is in need, but I don't see a good implementation of RCPI yet.).

Second Experiment (Oct 28th, 2009)

I did the same experiments to compare the RSSIs when the tx antenna diversity is enabled and when it is disabled.

The set-ups were

  • Default parameters were used (SAMPLE rate selection, default txpower)
  • Management Frames were used to measure RSSIs.
RSSIs measured when a node is having a round trip between two points (between d=0.5 meters and d=356.6 meters). Transmit antenna diversity is enabled.
RSSIs measured when a node is having a round trip between two points (between d=0.5 meters and d=356.6 meters). Transmit antenna diversity is disabled.
RSSIs measured when a node is having a round trip between two points (between d=0.5 meters and d=356.6 meters). Transmit antenna diversity is enabled.

They clearly show that the RSSIs from the node with tx antenna diversity has bi-modal distribution while the RSSIs from the node without tx antenna diversity has uni-modal distribution. It confirmed what I observed at the first experiment.

It is interesting to note that both graphs are not symmetrical, but the higher values of RSSIs in the first picture (with tx antenna diversity) have the similar pattern to the RSSIs in the second picture (without tx antenna diversity).

Also note that both experiments were performed with the same duration.

The number of packets (beacons) observed in the first picture is less than the number of packets in the second picture by about 200. It means that with the tx antenna diversity, the performance is degraded because the disconnected secondary antenna is selected for 50% of beacons.

Another Cause of RSSI Fluctuation in Mesh Testbed

Even though we realized that the bi-modal distribution is primarily due to the tx antenna diversity, there seem to some fluctuation in the RSSIs. I conjecture that the channel condition is irritated whenever the RF switches get the attenuation setting commands. Thus when the nodes are static, 1) Setting the RF switch with the same attenuation settings periodically (e.g. every one second, send the same SA command to the RF switch) and 2) Not setting the RF (i.e. do not send any command to the RF switch) switch have different impact on the channel condition in the mesh testbed.

Drive-by Experiment

I used Java GUI to do the drive-by Experiment, but the RSSIs measured at node 2 fluctuate by 20-30 dB which I didn't expect to see because the antenna diversity is disabled.

Here is the screen shot of the Java GUI. The red line shows the mobility path of node 1.

Screen shot of Java GUI running a drive-by experiment.

The summary of the set-ups is

  • Tx antenna diversity is disabled on both ends.
  • RSSIs were measured at node 2.
  • The RSSIs of beacons were measured.
  • Node 1 is a mobile node. Node 2 is fixed.
RSSI measurements from a drive-by experiment. Speed=60km
RSSI measurements from a drive-by experiment. Speed=30km
RSSI measurements from a drive-by experiment. Speed=5km

For the roundtrip experiments, every 10 seconds, the location information is updated by feeding an xml file defining the locations of node one and two to the netcat (nc). We didn't see any RSSI fluctuation once the tx antenna diversity was disabled. Weirdly enough, I observed the RSSI fluctuation on these drive-by experiments using Java GUI. I tried to varying the speed of the mobile node, but RSSI fluctuations were still observed at the lower speed settings.

Experiments with Two Fixed Nodes

I realized that these RSSI fluctuations happen only when I use the Java GUI.

I decided to fix the location of two nodes on the Java GUI, and ran an experiment. The summary of the set-ups is

  • Tx antenna diversity is disabled on both ends.
  • RSSIs were measured at node 2.
  • The RSSIs of beacons were measured.
  • Node 1 and Node 2 are fixed.
  • The distance between two nodes is 250 meters.
  • 200 beacons were measured for each experiment.

It is observed that the Java GUI keep printing the following xml.

<QUERY TYPE="nodeinfo"></QUERY>

  <PHYSICAL UNITS="meters" DIMENSION="2" MODEL="freespace" SCALEFACTOR="1.0610015965572788">
    <NODE INPUT="1" X="251.64900869740194" Y="249.7639973962978"></NODE>
    <NODE INPUT="2" X="500.47050044314767" Y="248.82149174574576"></NODE>
  </PHYSICAL>

Even though the nodes are fixed, the RSSI fluctuations were observed. However, when the Java GUI stopped, the RSSI fluctuations disappeared. The RSSI values stayed at the same range of values when the Java GUI stopped. For instance, if the Java GUI stopped when the RSSI was around -63 dBm, the RSSI values stayed very close to this RSSI value.

I also used netcat (nc) to feed a xml file with the same location information.

nc 10.51.1.7 1234 < ./loc.xml

loc.xml is as follows (basically the same as the query generated by the Java GUI) :

<MESHTEST>
  <PHYSICAL UNITS="meters" DIMENSION="2" MODEL="freespace" SCALEFACTOR="1.0610015965572788">
    <NODE INPUT="1" X="251.64900869740194" Y="249.7639973962978"></NODE>
    <NODE INPUT="2" X="500.47050044314767" Y="248.82149174574576"></NODE>
  </PHYSICAL>
</MESHTEST>

The RSSIs is now in a different range.

The results from those experiments were summarized in the following graph. Only when the Java GUI is up and running, the RSSIs fluctuate.

The RSSI measurements between two fixed nodes. Distance = 250 meters.

Roundtrip Experiments Again

I created a script for this roundtrip experiment. The summary of the set-ups is

  • Tx antenna diversity is disabled on both ends.
  • RSSIs were measured at node 2.
  • The RSSIs of beacons were measured.
  • Node 1 is fixed, and Node 2 is mobile.
  • Initially Node 1 and Node 2 are at the same location. Node 2 gets away from Node 1 until distance = range. Then Node 1 goes back to its initial location where Node 1 is located.
  • Speed is adjustable.
  • Mobile node (node 2) stay at a location at least one second. If hold time is set, a node stay at a location for "hold time" in addition to one second.

The results from these experiments clearly show that the RSSIs don't fluctuate so much during the hold time, and whenever the attenuation setting command is executed, the RSSI fluctuate and end up in a different range of values.

RSSI measurements from a roundtrip experiment. Speed=60km. Hold time=0sec
RSSI measurements from a roundtrip experiment. Speed=500km. Hold time=19sec
RSSI measurements from a roundtrip experiment. Speed=1000km. Hold time=60sec

Roundtrip Experiments with Eight Nodes

The causes for the RSSI fluctuations were conjectured to be the followings

  1. Inappropriate Terminators => Try other types of terminators
  2. Inaccurate attenuation calculations => Try more accurate matrix calculations for smaller size
  3. Crosstalk (?) => Try to locate eight nodes

In response to the last suspected cause, I located eight nodes (eight ports on RF switch) on the plane, but connect only two physical nodes. The set-ups are the same as in RSSI_Measurements_and_RF_Switch_Calibration_Notes#Roundtrip_Experiments_Again.

RSSI measurements from a roundtrip experiment. Speed=60km. Hold time=0sec. Total Number of Nodes = 8
RSSI measurements from a roundtrip experiment. Speed=60km. Hold time=0sec.

It is not so much different from the results in RSSI_Measurements_and_RF_Switch_Calibration_Notes#Roundtrip_Experiments_Again.

Field Tests with Two Nodes Connected by a Cable

These tests were performed to see if the RSSI fluctuations observed in the mesh testbed is anomaly in the testbed or can be also observed in the field test. Two hybrid machines (p005 and p006) were connected by a cable. I changed the transmit power of the p006, and RSSIs were observed on p005. The summary of the set-ups is

  • Tx antenna diversity is disabled on both ends.
  • RSSIs were measured at p005.
  • The RSSIs of control frames (beacons or probes) were measured.
  • Transmit power of p006 varied from 0dBm to 17dBm.
  • 100 beacons were measured for each experiment.

I expect to have a Received Power (dBm) = Transmit Power (dBm) - C (dB), but the similar relation is observed for the tx power between 12dBm to 17dBm only. I conjecture that the cable has non-linear loss characteristics.

The test results are as follows:

Statistics of RSSI measurements between two nodes connected by a cable per transmit power setting.
Time Series RSSI measurements between two nodes connected by a cable per transmit power setting.

The RSSIs do not fluctuate so much although there were some outliners. The frequency of outliners is relatively small (less than 5% for every tx power setting).

Therefore it is tentatively concluded that the RSSI fluctuations are artifacts made under the mesh testbed with 8 ports RF switch.

Linear Regression for the Emulated Tests with 51dB Insertion Loss

I analyzed the drive-by experiments in RSSI_Measurements_and_RF_Switch_Calibration_Notes#Drive-by_Experiment to calibrate the RF switch. Since RSSIs fluctuate, I tried to find the linear regression by using four different interpolations.

  • Upper envelope using linear interpolation
  • Lower envelope using linear interpolation
  • Linear interpolation
  • Smoothing using an ideal low pass filter.
  • Smoothing using a median filter.

The upper & lower envelopes of RSSIs, the RSSIs passed by an ideal Low Pass Filter (LPF) with 19 taps and the RSSIs passed by a median filter is as follows:

Upper and Lower Envelopes of RSSI Measurements.
RSSIs passed by an LPF and a Median Filter.

Some examples of linear regressions are seen in the following pictures. The complete results are given in the following table.

RSSIs passed by an ideal LPF with 19 taps.
RSSIs passed by a Median Filter.
RSSIs smoothed by the linear interpolation.
Different Methods of RSSI Smoothing (exponent = 2, insertion loss = 51.4dB, tx antenna diversity disabled)
Exponent (n) System Loss (C) R^2
Upper Envelope (using Linear Interpolation) 1.94 -21.79 0.56
Lower Envelope (using Linear Interpolation) 2.01 -25.14 0.54
Linear Interpolation 1.65 -30.16 0.80
Low Pass Filter 1.84 -26.32 0.78
Median Filter 1.83 -26.45 0.81

Terminators Removed the RSSI Fluctuations on the Mesh Testbed

Once we installed terminators on the backend side of the RF switches, the RSSI fluctuations are gone.

Time Series of RSSI Measurements from the Mesh Testbed with Terminators Installed

After several trials, I decided to change insertion loss from 40dB to 34dB to match the RSSIs trend in the testbed with those from the field test.

Average RSSI measurements from the Mesh Testbed (Insertion Loss = 34dB) vs. Field Test

The linear regressions for each test are as follow:

Linear Regression of Average RSSI measurements from the Mesh Testbed (Insertion Loss = 34dB) vs. Field Test
Exponent (n) System Loss (C) R^2
Test on the mesh testbed 1.99 -38.81 0.98
Field Test 1.99 -40.22 0.93
Personal tools