In the past few weeks, I’ve written about challenges of industrial wireless (with a focus on Wi-Fi): multipath and interference. This last post will be about the greatest challenge: channel access latency.
What does it mean when we ask how fast something is? If we ask which is the faster way to move people, a bus or a motorcycle, we interpret the question to mean which one makes a trip faster. The bus moves more people per unit time, but that’s not what we think of as “fast”. When we ask how fast a data link is, though, usually the answer is in data per second. To find out how long it takes for a piece of data to propagate through the network, we ask about “latency”.
Low-Latency High Packet Rate
Many industrial networks need to send many small packets, maybe 60 bytes in size, very
frequently. Such users define their networks not in Bps but in packets per second.
Often these users deploy Wi-Fi networks. Each RF packet takes less than 100us. If the channel were shared perfectly, you could fit 10000 RF packets on the channel every second.
Wi-Fi Channel Sharing
802.11 has an amazing scheme, called the distributed coordination function (DCF), to share the channel with Wi-Fi users, hoppers, and anyone else using the channel. The DCF performs clear channel assessment (CCA) for a very brief period of time (between 16us and 63us, depending on the priority of the packet to be sent) before transmitting. The transmitter waits for an ACK from the receiving station. It must wait long enough for the receiver to verify the packet is good and send an ACK, plus 5us per mile of propagation delay.
If the transmitter does not receive an ACK, it tries again at a random point during a contention window (CW). The contention window on the first retry is short (default is 279us). It doubles with each successive to a maximum of 9ms. The frame is thrown out if no ACK is received after the retry limit.
DCF in an Industrial Setting
The point of random backoff is to prevent two users from backing off the same amount of time. As the number of users and packets goes up, however, contention happens more frequently. Not only are more packets lost to collisions, but more often transmitters use larger CWs, wasting channel time.
Users may configure radios on their network to use shorter contention windows to increase their chance of getting the channel. They may also increase the CCA threshold, so their radios may transmit over weaker networks. But these measures do nothing to share the channel more effectively among users in one’s own network. Setting a shorter contention window will cause more collisions.
Data Rate Fallback
Some radios have fallback algorithms that select a lower data in response to frequent retries. You typically need -64dBm of signal to receive a 20MHz WiFi signal at full data rate. At the lowest data rate, you can have a reliable link down to -82dBm, almost 100 times less signal. A good fallback algorithm uses the fastest rate that is reliable for the signal strength seen at the node it’s transmitting to.
Simplistic fallback algorithms seen in consumer equipment fall back to a lower data rate if it’s having to do many retries. This is good if the retries are due to low signal strength. If they’re due to collisions, however, a lower data rate makes the problem worse. Lower data rate packets take longer to send, increasing the chance of collisions.
Coordinated Channel Access
The original Wi-Fi standard provides a point coordination function (PCF) to allow one node to control which radios on the network can access the media. The 802.11(n) spec provides for a hybrid coordination function (HCF) controlled channel access (HCCA). In these schemes there is never an issue of nodes in the same network transmitting at the same time. There is latency associated with waiting for a node’s turn to transmit, but this is not a waste of other nodes usually have traffic to pass during their turn.
I would love to see PCF or HCCA implemented in a product. I only know of it from the 802.11 specs.
Conclusion
Achieving low latency in a network with a high packet rate is the biggest challenge to industrial wireless users. The issues of multipath, interference, and channel contention covered in these recent posts are rare and can usually be mitigated by tweaking parameters. Wi-Fi is way more than a protocol for connect to the Internet at coffee shops.
Further Reading on Wi-Fi in General
Next Generation Wireless LANs - Spoonfeeds you the nuts and bolts of 802.11(n) and the earlier Wi-Fi standards. The best book on Wi-Fi.
802.11 Wireless Networks: The Definitive Guide - Very dated because it was published before 802.11(n), but easy to read
The 802.11 Handbook: A Designer’s Companion - Also dated, but I’m including it because it prevents so much information so densely in an easy-to-follow way.
Top Comments