Popular wireless personal area network technologies are usually based on short radio waves. Notable
examples are Bluetooth, ZigBee, and Wi-Fi. In this paper, we describe a MAC protocol for wireless networks, mainly for Android smartphone devices, based entirely on high-frequency sound waves. Beyond the human hearing range, ultrasonic waves are a good and cheap complementary solution for
environments where other forms of communications are disabled or interrupted. Our main contribution is a packet-based MAC protocol for wireless ultrasonic networks that supports generic and low-bandwidth applications such as smart homes, remote control, and entertainment devices.
Case study: Implementing a Personal Area Network MAC Protocol for Inaudible Sound Waves (IEEE COMCAS 2019)
1. Case study: Implementing a Personal Area
Network MAC Protocol for Inaudible Sound Waves
Itai Dabran, Guy Menhel, Yuval Ron
Faculty of Computer Science,
Technion – Israel Institute of Technology, Haifa, Israel
Alon Eilam, Guy Shofen
Sonarax, Haifa, Israel
Speaker name: Yuval Ron
2. Agenda
▸Introduction
- Basic terms
- Communication based Inaudible Sound Waves
- Advantages and disadvantages
▸Protocol Design
- Goals and challenges
▸Implementation
- PoC game
- Other usages and experiments
▸Future work and conclusions
2
3. Wireless Personal Area Network (WPAN)
▸Intended to replace cabling
▸Transmit over a short distance (a few centimeters to a few meters)
▸Use a low-powered wireless network technology
▸Usually uses short radio-waves (Bluetooth, zigbee) or infrared
Brief overview of existing solutions
3
4. WPAN based on Inaudible Sound Waves
▸Encode binary data into sound waves beyond the human hearing range (> 20 kHz)
▸Each device has a microphone and a speaker
▸Obvious nominees to join the network are mobile phones, tablets and smart IoT devices
Novel idea of an ad hoc WPAN
4
5. Advantages
▸Cheap requirements
▸Works even when other forms of communication are interrupted or not allowed
- For example: Airplanes (flight mode), underground environments, crowded places
▸Accurate for indoor positioning
▸No need of a direct line of sight between two connected devices (like in Infrared)
▸Health: no radio-waves radiation
▸Security: solves existing attack vectors
5
6. Disadvantages
▸Possible hardware damage to microphones
▸May interfere animals with good hearing (dogs, etc)
▸Low bandwidth and high bit errors
- Therefore suitable mainly for small-scale projects
▸Health: unknown side-affects (more headaches?)
▸Security: creates new challenges
6
7. Related Work
▸Characterized by
- long propagation delay,
- low bit rates
- error-prone acoustic communication
▸Popular protocols:
- Ordered Carrier Sense Multiple Access (Ordered CSMA)
Underwater acoustic area (UWA) networks
7
8. Related Work
▸An increasing academic and industrial interest in ultrasonic applications
▸Indoor positioning system (Another joint work of Sonarax and Technion)
▸Healthcare: monitoring of patients’ breath
▸Device control: recognition of in-air dynamic gestures
Other uses of ultrasonic waves in Smartphones
8
9. Designing an Ultrasonic WPAN
Achieve a pseudo-OSI model in real action,
built entirely on ultrasonic waves
9
Sound Waves
Sonarax SDK
Application
MAC Protocol
(this paper)
10. Sonarax SDK
▸Encodes data into sound waves that are sent through the speaker
▸These sound waves are received using the mic, and the data gets
decoded by the SDK.
▸Text messages (String) and numbers (Integers)
▸Different ranges (~0.5m to ~10m) and rates (bits per sec)
▸Multiple channels
▸Complete API with many capabilities
10
Sound Waves
Sonarax SDK
11. Network Design
▸Desired Features
- Packet-based communication
- Easy to join leave the network
- Send direct message to another station
- Send broadcast message
- Get all station IDs
▸Technology Limitations
- Transmitting and listening
simultaneously is not possible
- Unable to detect a collision during
transmission or at the end of it
- Low bandwidth
- High probability for bit error
- Limited number of channels
11
12. Assumptions
▸The number of channels is not enough to perform
pseudo-random hopping sequence like in Bluetooth
▸Therefore, we assume we have only one shared channel
▸All nodes can hear each other (Physical carrier sense)
▸No hidden terminal effect
▸Short range: ~2.5 meters
▸The maximal number of connected devices: 4
12
d=2.5m
R=1.25m
13. CSMACA
▸Variant of the CSMA protocol, which tries to split the channel equally between all
transmitting nodes
▸DIFS = the amount of time a station waits before it sends a new packet
▸SIFS = the amount of time until the destination starts to send back the ACK packet
▸SIFS < DIFS
- ensures priority for the acknowledgment packet in order not to collide with new packets
Carrier-Sense Multiple Access with Collision-Avoidance
13
14. CSMACA (2)
▸When a station receives a packet from the application level, it first checks if the
channel is idle.
▸If true, it waits for DIFS and then sends the packet in case the channel is still idle.
▸If, however, another station is using the channel, it will draw a random waiting time
and wait until the current transmission ends.
▸As before, it will wait for DIFS, but this time also count down while the channel is idle.
▸When the counter resets, it will send the packet.
14
15. Simple Initialization
▸Very simple and includes only one broadcast message
▸Each node randomly selects a 16-bit ID number from the range 1–65535 to join the
network (0 is reserved for broadcasting) and then broadcasts
▸Probability of collision between any two IDs within a network of four devices: 0.01%
- using the generalized birthday formula
▸Other solutions:
- Use the MAC address (48-bits) or the IMEI number of the device (15 decimal digits) – larger headers…
- Master-slave architecture (like in Bluetooth) - causes many collusions, we have only one channe
Setting a unique and short identifier for every station
15
16. Headers
▸Cost-effective in the design of the packet
header’s format and the retransmission scheme
▸Header fields: (40 bits)
- SenderID
- ReciverID
- TYPE - 5-bit type code
- FLOW - flow control bit
- ARQN - acknowledge indication bit
- SEQN - sequence number bit
▸Payload (up to 56 bits)
16
Header
Packet = Header + Payload
17. Implementation
▸Based on Sonarax SDK for Android devices
▸Written in JAVA
▸Generic API for the Application layer, that includes:
- Initialization (joining a network)
- direct packet sending
- broadcast
- retransmission
- sending in loop
- call-backs for receiving new packages
- getting all station IDs
- aborting
- and more…
17
Sound Waves
Sonarax SDK
MAC Protocol
(this paper)
18. Demo
Watch it in action!
18
Sound Waves
Sonarax SDK
MAC Protocol
(this paper)
Application
19. TicTacToe
▸Play with each other by using only the phone’s speaker and microphone
▸Phone joins the network when opened
▸Pressing the “Find Partner” button sends a broadcast
▸A connection is established with another player
▸Each move on the board is sent to the opponent until the game ends
Application that runs solely on ultrasonic sound waves
19
20. Future Work and Conclusions
▸Improvements for next protocol versions (currently at the application level):
- Fragmentation
- Encryption and other security measurements
- Support the “hidden terminal effect” (i.e., virtual carrier sense)
▸BatChat – Android application with chat based on ultrasonic waves
- By Guy Menhel, Ron Grinberg, Saar Globin, and Tal Yaakov
- https://play.google.com/store/apps/details?id=com.technion.BatChat
20
Track: New Communication Techniques and Applications
WIFI – home internet connection uses, not much to say (you know it)
BlueTooth - 10-100m range, Automatic device discovery; communicates through physical barriers.
IrDA - Requires line of site for communication (1-2m range)
NFC – nowadays used primarily for payment, transfer of data between mobile devices (contacts, files, settings, etc.). Range of a few centimeters.
Zigbee -
The main point of this slide is to see that every technology took a niche, and that the all co-exist and used for different aspect in our everyday life. Thus maybe our new technology might find itself another niche.
Another point is that most of the solutions are radio based (except the IR one). Maybe it’s time to experiment with other options.
First protocol combines the concepts of round-robin scheduling and CSMA
Second protocol is a CSMA/CA-based electro-communication system solves small submarine robot communication collision problems. It detects the communication channel state (busy or idle) and uses a compact Carrier Sense Multiple Access with a Collision Avoidance (CSMA/CA) solution.
In 2017, researchers presented a system that monitors the user’s breathing rates using ultrasonic waves [5]. The system is operated by only one Android smartphone with no additional equipment. The system employs sonar phase data to monitor the periodic signal caused by the rise and fall of the chest when inhaling and exhaling.
In the same year, researchers at Shandong University in China created an ultrasound-based system that recognizes in-air dynamic gestures [6]. Their method of extracting motion gestures consisted of three main stages. First, they emit ultrasonic waves and receive raw data. Then, by classifying the input to gestures (or to noise), they are able to perform the actual operation on the smartphone. Three years earlier, another group of researchers dealt with the same issue [7]. Their in-air gesture recognition solution classified the input either manually or by using machine recognition, depending on the gesture itself
In wireless networks, mainly those based on ultrasound devices, when a station sends a package, it can hear only itself. Therefore, transmitting and listening simultaneously is not possible. Nodes are unable to detect a collision during transmission or at the end of it. As a result, it is impossible to stop a broadcast that collides with another, and unfortunately, both packets will be damaged. It also means that after a station completed broadcasting, it does not know whether the broadcast succeeded or not, which makes the issue of whether to retransmit even harder.
To simplify our design, we assume there is a physical carrier sense in our network, i.e., all nodes can hear each other and there is no hidden terminal effect.
In addition, we assume that the maximal number of connected devices at each moment is four. The logic behind this assumption comes from the limited network range. Since the sending range is about 2.5 meters between every two devices, it defines a circle with a radius of 1.25 meters (Figure 1). In this small area, it is unrealistic to connect more than four devices to the same network.
Our MAC layer implementation consists of a simple Stop and Wait protocol. The destination must send an Acknowledgment (ACK) packet after it receives a packet from another station. Broadcast packets are not acknowledged. If the ACK packet does not come (time out), the source will retransmit his original packet according to our CSMA/CA-like algorithm, which is described below. Since messages and ACK packets may be lost, each packet must be numbered serially (modulo 2).
In this version, we do not support fragmentation since it will increase the network’s delay, which is already relatively high. No encryption was performed here but could be performed at the application level.
The size of the packet header is 5 bytes, 2 bytes for the sender ID, 2 bytes for the receiver IDs, a sequence number bit (SEQN), an acknowledge indication bit (ARQN), a flow control bit (FLOW), and a 5-bit type code (TYPE). Currently, we define only two particular packet types, indicating joining and aborting the network. In later versions, it will be possible to use the TYPE code for other purposes such fragmentation.
Note that the Sonarax SDK accepts only strings; therefore, the packet’s byte array representation is converted into a string using Base64. Since the number of bytes of each packet is divided by 3, the conversion does not add unnecessary bits.
The sending algorithm is as follows. When a station receives a packet from the application level, it first checks if the channel is idle. If true, it waits for DIFS and then sends the packet in case the channel is still idle. If, however, another station is using the channel, it will draw a random waiting time and wait until the current transmission ends. As before, it will wait for DIFS, but this time also count down while the channel is idle. When the counter resets, it will send the packet.
We implemented our MAC protocol in JAVA, based on the Sonarax SDK for Android devices. The protocol is a generic interface that gives essential network functionalities for simple applications with low bandwidth requirements.
The protocol’s API includes initialization, sending a packet to a specific station (array of bytes), broadcasting to all connected devices, retransmission and sending in a loop, call-backs for receiving new packages, getting all station IDs, aborting, and more. The protocol’s packet header is implemented as described earlier.
Local file version
To test our protocol, we created a sample application for Android devices that plays the popular “Tic Tac Toe” game, based on our protocol’s API. The application allows users to play with each other by using only the phone’s speaker and microphone.
The goal of this demonstration was to achieve a pseudo-OSI model in real action, built entirely on ultrasonic waves.
When opening the application, the phone joins the network. Pressing the “Find Partner” button sends a broadcast packet indicating the station is ready to play, according to an inner protocol at the application layer.
A connection is established after another device receives a similar message. Each move on the board is sent to the opponent and the game continues. We tested the application successfully with two pairs of devices playing against each other simultaneously.