Collaborative Coexistence of Bluetooth LE, BR/EDR, and WLAN Using PHY Packet Traffic Arbitration
This example shows how to simulate collaborative coexistence of Bluetooth® low energy (LE), Bluetooth basic rate/enhanced data rate (BR/EDR), and WLAN networks with physical layer (PHY) packet traffic arbitration (PTA).
Using this example, you can:
Create and configure a coexistence node consisting of Bluetooth BR/EDR, Bluetooth LE, and WLAN devices.
Add and configure PTA in the coexistence node.
Add On-Off application traffic between the devices.
Simulate the collaborative coexistence scenario and analyze the performance of each node.
Visualize the packet communication in the time and frequency domains for all the nodes.
Additionally, you can use this example script to perform these tasks.
Packet Traffic Arbitration
In collaborative coexistence mechanisms, two wireless networks collaborate and exchange network-related information. According to the recommended practices stated in [3], the three collaborative coexistence mechanisms are alternating wireless medium access (AWMA), PTA, and deterministic interference suppression. For more information about coexistence between Bluetooth and WLAN, see Bluetooth-WLAN Coexistence. This example simulates collaborative coexistence between Bluetooth and WLAN by using the PTA mechanism.
The PTA mechanism provides per-packet authorization for all transmissions and receptions. Bluetooth and WLAN technologies collocated in a device can collaboratively coexist by using the PTA mechanism. This example controls the transmission of packets by implementing PTA at the PHY.
If a node wants to transmit multiple packets simultaneously, PTA selects the packets to be transmitted.
If a node has two incoming packets at the same time, PTA decides whether the packets are processed by the Bluetooth or WLAN device.
If an ongoing transmission or reception exists in a device or PTA-linked devices, the PTA mechanism considers all other packets destined for this device as interference and does not process them.
If an ongoing transmission or reception exists in a device or PTA-linked devices, PTA disables transmission from that device.
If PTA is not connected to a device, the device has its own transmit-receive chain.
If you connect PTA to two or more devices, all the devices share the same transmit-receive chain.
In this example, the PTA transmits packets in this priority.
Bluetooth LE packets when CIS is configured
BR/EDR packets when SCO is configured
WLAN packets
Bluetooth LE packets
Bluetooth BR/EDR packets
Collaborative Coexistence Scenario
This figure shows a coexistence node consisting of a Bluetooth device and a WLAN device.
In the coexistence node, the PTA controls the communication to and from the Bluetooth and WLAN devices by using a single transmit-receive chain. In the absence of PTA, the Bluetooth and WLAN devices operate using their respective transmit-receive chains. The example creates and configures the coexistence node by performing these steps.
Create a coexistence node by using the
helperCoexNode
helper object.Add Bluetooth and WLAN devices to the coexistence node by using the
addDevice
object function of thehelperCoexNode
helper object.Add a PTA module between the devices by using the
addPTA
object function of thehelperCoexNode
object.Configure the connection for Bluetooth and WLAN devices.
Add application traffic between the devices.
The example simulates this coexistence scenario.
The scenario consists of these nodes.
Smartphone — This node is a multidevice coexistence node consisting of a Bluetooth BR/EDR device in a Central role, a Bluetooth LE device in a Central role, and a WLAN device in a station (STA) role. The smartphone includes a PTA module that coordinates the transmissions to avoid interference.
Headphone — This node is a coexistence node consisting of a Bluetooth BR/EDR Peripheral device that is connected to the Bluetooth BR/EDR Central device in the smartphone.
Fitness watch — This node is a coexistence node consisting of a Bluetooth LE Peripheral device that is connected to the Bluetooth LE Central device in the smartphone.
WiFi Router — This node is a coexistence node consisting of a WLAN access point (AP) device that is connected to the WLAN STA device in the smartphone.
Check for Support Package Installation
Check if the Communications Toolbox Wireless Network Simulation Library support package is installed. If the support package is not installed, MATLAB® returns an error with a link to download and install the support package.
wirelessnetworkSupportPackageCheck
Create and Configure the Scenario
Set the seed for the random number generator to 1
to ensure repeatability of results. The seed value controls the pattern of random number generation. Initializing the random number generator using the same seed ensures the same result. To improve the accuracy of your simulation results after running the simulation, you can change the seed value, run the simulation again, and average the results over multiple simulations.
rng(1,"twister")
Create a wireless network simulator object.
networkSimulator = wirelessNetworkSimulator.init;
Specify the simulation time in seconds.
simulationTime = 0.5;
Create a multidevice coexistence node. Specify the name and the position of the node in meters.
coexistenceNode = helperCoexNode(Name="CoexNode",Position=[0 0 5]);
Create a WLAN STA device by using the wlanDeviceConfig
(WLAN Toolbox) object. Use the configuration to add the WLAN STA device to the coexistence node.
staDeviceCfg = wlanDeviceConfig(Mode="STA",BandAndChannel=[2.4 1],InterferenceModeling="overlapping-adjacent-channel"); wlanSTADeviceName = addDevice(coexistenceNode,staDeviceCfg);
Create a Bluetooth BR/EDR device configuration. Use the configuration to add the Bluetooth BR/EDR Central device to the coexistence node.
centralBREDRDeviceCfg = helperBluetoothDeviceConfig(Role="central");
centralBRDeviceName = addDevice(coexistenceNode,centralBREDRDeviceCfg);
Create a Bluetooth LE device configuration. Use the configuration to add the Bluetooth LE Central device to the coexistence node.
centralLEDeviceCfg = helperBluetoothLEDeviceConfig(Role="central");
centralLEDeviceName = addDevice(coexistenceNode,centralLEDeviceCfg);
Create and configure a coexistence node with a WLAN AP device.
apDeviceCfg = wlanDeviceConfig(Mode="AP",BandAndChannel=[2.4 1],InterferenceModeling="overlapping-adjacent-channel"); wlanAPNode = helperCoexNode(Name="AP",Position=[20 0 0]); wlanAPDeviceName = addDevice(wlanAPNode,apDeviceCfg);
Create and configure a coexistence node with a Bluetooth BR/EDR Peripheral device.
peripheralBREDRNode = helperCoexNode(Name="Peripheral BREDR",Position=[10 0 0]);
peripheralBRDeviceName = addDevice(peripheralBREDRNode,helperBluetoothDeviceConfig);
Create and configure a coexistence node with a Bluetooth LE Peripheral device.
peripheralLENode = helperCoexNode(Name="Peripheral LE",Position=[0 0 0]);
peripheralLEDeviceName = addDevice(peripheralLENode,helperBluetoothLEDeviceConfig);
Configure the Connections Between the Devices
Associate the WLAN AP and WLAN STA devices of the coexistence node.
associateStations(wlanAPNode,coexistenceNode);
Configure the connection between the Bluetooth BR/EDR Central and Peripheral devices of the coexistence node.
connectionCfgBREDR = helperBluetoothConnectionConfig; configureConnection(connectionCfgBREDR,coexistenceNode,peripheralBREDRNode);
Configure the connection between the Bluetooth LE Central and Peripheral devices of the coexistence node.
connectionCfgLE = helperBluetoothLEConnectionConfig; configureConnection(connectionCfgLE,coexistenceNode,peripheralLENode);
Add Application Traffic
This example consists of only one multidevice coexistence node. If you add traffic between a multidevice coexistence node and a single device coexistence node, the addTrafficSource
object function automatically directs the traffic based on the type of the single device. To add traffic between two multidevice nodes, specify the SourceDeviceName
name-value argument to the addTrafficSource
object function. The value of the SourceDeviceName
argument must be the name of the device that the addDevice
object function returns.
Configure and add On-Off application traffic at the WLAN AP and STA nodes.
ap2staTraffic = networkTrafficOnOff(DataRate=1000,PacketSize=1200,OnTime=0.1,OffTime=0.1); addTrafficSource(wlanAPNode,ap2staTraffic,DestinationNode=coexistenceNode) sta2apTraffic = networkTrafficOnOff(DataRate=1000,PacketSize=1200,OnTime=0.1,OffTime=0.1); addTrafficSource(coexistenceNode,sta2apTraffic,DestinationNode=wlanAPNode)
Configure and add On-Off application traffic between the Bluetooth BR/EDR Central and Peripheral nodes.
central2PeripheralTrafficBR = networkTrafficOnOff(DataRate=200,PacketSize=27,OnTime=0.1,OffTime=0.1); addTrafficSource(coexistenceNode,central2PeripheralTrafficBR,DestinationNode=peripheralBREDRNode) peripheral2CentralTrafficBR = networkTrafficOnOff(DataRate=200,PacketSize=27,OnTime=0.1,OffTime=0.1); addTrafficSource(peripheralBREDRNode,peripheral2CentralTrafficBR,DestinationNode=coexistenceNode)
Configure and add On-Off application traffic between the Bluetooth LE Central and the Peripheral nodes.
central2PeripheralTrafficLE = networkTrafficOnOff(DataRate=200,PacketSize=27,OnTime=Inf,OffTime=0); addTrafficSource(coexistenceNode,central2PeripheralTrafficLE,DestinationNode=peripheralLENode) peripheral2CentralTrafficLE = networkTrafficOnOff(DataRate=200,PacketSize=27,OnTime=Inf,OffTime=0); addTrafficSource(peripheralLENode,peripheral2CentralTrafficLE,DestinationNode=coexistenceNode)
Attach PTA
To add a PTA to the multidevice coexistence node, set the enablePTA
flag to true
.
enablePTA = true;
Add a PTA to the coexistence node by using the addPTA
object function.
if enablePTA ptaHandle = @(coexObj,currentTime) helperPHYPTAModule(coexObj,currentTime); addPTA(coexistenceNode,ptaHandle) end
Simulation and Results
Add all the nodes to the wireless network simulator.
addNodes(networkSimulator,[coexistenceNode peripheralBREDRNode wlanAPNode peripheralLENode]) nodes = networkSimulator.Nodes;
Configure Packet Communication and Node Performance Visualization
To visualize packet communication in all the nodes, set the enablePacketVisualization
flag to true
. The visualization shows these plots.
Packet communication over the time and frequency domains.
State transitions of Bluetooth and WLAN packets for each node over time.
At the end of the simulation, you can visualize packets at any time instance.
enablePacketVisualization = true;
To display the visualization at the end of simulation, specify the VisualizeAtEnd
name-value argument and set to true
.
if enablePacketVisualization packetVisObj = helperPlotPacketTransitions(nodes,simulationTime,VisualizeAtEnd=false); end
To view the node performance visualization, set enableNodePerformancePlot
to true
. The visualization displays the packet loss ratio, throughput, and latency of the Bluetooth BR/EDR, Bluetooth LE, and WLAN nodes at the end of simulation.
enableNodePerformancePlot = true;
Initialize the visualization of the node performance plot.
if enableNodePerformancePlot performancePlotObj = helperVisualizePerformance(nodes,simulationTime); end
Run the Simulation
Run the simulation for the time specified and generate these results.
A runtime plot for all the nodes, showing the state transitions and packet transmissions over the time and frequency domains.
A bar plot for all the nodes showing the packet loss ratio, throughput, and average application layer (APP) packet latency. You can find these results in the
performancePlotObj
variable.The APP, link layer (LL), and PHY statistics for all the nodes simulated.
run(networkSimulator,simulationTime)
Statistics
Retrieve the statistics of all the nodes. In the coexistence node, the Bluetooth BR/EDR, Bluetooth LE, and WLAN node statistics are present in their corresponding device structures. For more information about Bluetooth BR/EDR and LE node statistics, see Bluetooth BR/EDR Node Statistics and Bluetooth LE Node Statistics, respectively. For more information about WLAN node statistics, see WLAN System-Level Simulation Statistics (WLAN Toolbox).
coexNodeStats = statistics(coexistenceNode); peripheralBREDRStats = statistics(peripheralBREDRNode); peripheralLEStats = statistics(peripheralLENode); apStats = statistics(wlanAPNode);
Further Exploration
You can use this example to further explore these capabilities.
Capture IQ Samples
Capture the IQ samples of the nodes by using the helperCaptureIQSamples
helper object. To capture the IQ samples of the nodes, uncomment and add this code before you run the wireless network simulator.
% iqSampleObj = helperCaptureIQSamples(coexistenceNode);
At the end of the simulation, the simulation stores the IQ samples of the corresponding nodes in a MAT file with the filename format NodeName_NodeID_yyyyMMdd_HHmmss
.mat
, where:
NodeName — Name of the node.
NodeID — Numeric ID of the node.
yyyyMMdd — Date of file creation, in the format year, month, day.
HHmmss — Time of file creation, in the format hour, minute, second, using the 24-hour clock format.
The IQSamples
property of the iqSampleObj
object contains the captured IQ samples. A MAT file corresponding to each node stores the captured IQ samples. If the network contains several nodes or when the simulation time is long, the process of capturing the IQ samples consume significant memory. The MAT file generated at the end of the simulation can consume significant disk space. For example, a system-level simulation that captures 100 million IQ samples creates a MAT file of approximate size 1.5 GB.
To visualize the captured IQ samples, use the Signal Analyzer (Signal Processing Toolbox) app. Uncomment and add the code after running the simulation.
% iqSamples = iqSampleObj.IQSamples; % for deviceIdx = 1:numel(iqSamples) % signalAnalyzer(iqSamples(deviceIdx)); % end
Add Mobility to Nodes
You can add mobility to any node by using the addMobility
object function. To add mobility to the coexistence node, uncomment and add this code before you run the wireless network simulator.
% addMobility(coexistenceNode,BoundaryShape="rectangle")
Add Antenna Isolation
Antenna isolation is the isolation between the antennas in the transmit-receive chains present in the same coexistence node. Isolation between two antennas minimizes the interference on each antenna caused by the adjacent antenna. To add antenna isolation between the transmit-receive chains in a coexistence node, use the configureAntennaIsolation
object function of the helperCoexNode
helper object. Uncomment and add this code before you run the wireless network simulator.
% isolationPower = 20; % In dB % configureAntennaIsolation(coexistenceNode,isolationPower)
Appendix
The example uses these helpers:
helperCoexNode
— Create a collaborative coexistence nodehelperBluetoothLEDeviceConfig
— Create Bluetooth LE device configuration object for coexistence nodehelperBluetoothDeviceConfig
— Create Bluetooth BR/EDR device configuration object for coexistence nodehelperBluetoothLEConnectionConfig
— Create Bluetooth LE connection configuration object for coexistence nodehelperBluetoothConnectionConfig
— Create Bluetooth BR/EDR connection configuration object for coexistence nodehelperPHYPTAModule
— PHY PTA module to determine the packet that needs to be transmittedhelperPlotPacketTransitions
— Visualize the state transition for all the nodes and coexistence of packetshelperVisualizePerformance
— Visualize the average application packet latency, throughput, and packet loss ratio of all the nodeshelperCaptureIQSamples
— Capture the IQ samples of a nodehelperVisualizeClassification
— Visualize the channel classification for all Bluetooth devices across time
References
Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed May 20, 2023. https://www.bluetooth.com/.
Bluetooth Special Interest Group (SIG). "Bluetooth Core Specification". Version 5.3. https://www.bluetooth.com/
Institute of Electrical and Electronics Engineers (IEEE). “IEEE Recommended Practice for Information Technology-- Local and Metropolitan Area Networks-- Specific Requirements-- Part 15.2: Coexistence of Wireless Personal Area Networks with Other Wireless Devices Operating in Unlicensed Frequency Bands.” IEEE Standard 802.15.2. IEEE, August 28, 2003. https://doi.org/10.1109/IEEESTD.2003.94386.
Institute of Electrical and Electronics Engineers (IEEE). "IEEE Standard for Information Technology--Telecommunications and Information Exchange between Systems Local and Metropolitan Area Networks--Specific Requirements Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications Amendment 1: Enhancements for High-Efficiency WLAN." IEEE 802.11ax-2021. IEEE, May 19, 2021. https://doi.org/10.1109/IEEESTD.2021.9442429.
Institute of Electrical and Electronics Engineers (IEEE). TGax Simulation Scenarios. IEEE 802.11-14/0980r16. IEEE, 2015.
Institute of Electrical and Electronics Engineers (IEEE). 11ax Evaluation Methodology. IEEE 802.11-14/0571r12. IEEE, January 2016.
"IEEE Draft Recommended Practice for Information Technology Telecommunications and Information Exchange Between Systems Local and Metropolitan Area Networks Specific Requirements-Part 15.2: Coexistence of Wireless Personal Area Networks With Other Wireless Devices Operating in Unlicensed Frequency Bands (Replaced by IEEE 802.15.2-2003)." IEEE Std P802.15.2/D09, 2003. https://ieeexplore.ieee.org/document/4040972.
See Also
Objects
wirelessNetworkSimulator
|bluetoothLENode
|bluetoothNode
|bluetoothLEConnectionConfig
|networkTrafficOnOff