802.11 OFDM Beacon Frame Generation and Transmission Using Quick-Control RF Signal Generator
This example shows how to generate packets containing MAC beacon frames suitable for baseband simulation or over-the-air transmission using WLAN Toolbox™, Instrument Control Toolbox™ and Keysight Technologies® RF signal generator.
In this example WLAN Toolbox is used to create an IEEE® 802.11™ beacon frame. Using Instrument Control Toolbox, the generated beacon frame is downloaded to Keysight Technologies N517B signal generator for over-the-air transmission. Beacon frame is a type of management frame that identifies a basic service set (BSS) formed by a number of 802.11 devices. The access point of a BSS periodically transmits the beacon frame to establish and maintain the network. A WiFi device can be used to view this beacon frame transmitted by the RF Signal Generator.
For more information on beacon frame generation using WLAN Toolbox, please refer 802.11 OFDM Beacon Frame Generation.
To run this example you need:
- Keysight Technologies N5172B signal generator
- Keysight VISA version 17.3
- IVI-C driver for Keysight Technologies N5172B signal generator
- National Instruments™ IVI® compliance package version 220.127.116.11 or higher
- WLAN Toolbox
- Instrument Control Toolbox
Create IEEE 802.11 Beacon Frame
The beacon packets are periodically transmitted with a beacon interval of 100 TU, where 1 TU represents 1024 microseconds time interval between successive beacons.The MAC frame bits for the beacon frames are generated using the helper function helperGenerateBeaconFrame.
SSID = 'TEST_BEACON'; % Network SSID beaconInterval = 100; % In Time units (TU) band = 5; % Band, 5 or 2.4 GHz chNum = 52; % Channel number, corresponds to 5260MHz % Generate Beacon frame [mpduBits,fc] = helperGenerateBeaconFrame(chNum, band, beaconInterval, SSID);
Create IEEE 802.11 Beacon Packet
A beacon packet is synthesized using wlanWaveformGenerator with a non-HT format configuration object. In this example an object is configured to generate a beacon packet of 20 MHz bandwidth, 1 transmit antenna and BPSK rate 1/2 (MCS 1).
cfgNonHT = wlanNonHTConfig; % Create a wlanNonHTConfig object cfgNonHT.PSDULength = numel(mpduBits)/8; % Set the PSDU length in bits % The idle time is the length in seconds of an idle period after each % generated packet. The idle time is set to the beacon interval. txWaveform = wlanWaveformGenerator(mpduBits, cfgNonHT, 'IdleTime', beaconInterval*1024e-6); Rs = wlanSampleRate(cfgNonHT); % Get the input sampling rate
Create a RF Signal Generator Object
Quick-Control RF Signal Generator is used to download and transmit the baseband waveform, txWaveform, generated by WLAN Toolbox.
rf = rfsiggen();
Discover all the available instrument resources you can connect to, using the resources method.
ans = ' ASRL1::INSTR ASRL3::INSTR ASRL::COM1 ASRL::COM3 PXI0::MEMACC TCPIP0::172.28.21.217::inst0::INSTR '
Discover all the available instrument drivers, using drivers method.
ans = 'Driver: AgRfSigGen_SCPI Supported Models: E4428C, E4438C Driver: RsRfSigGen_SCPI Supported Models: SMW200A, SMBV100A, SMU200A, SMJ100A, AMU200A, SMATE200A Driver: AgRfSigGen Supported Models: E4428C,E4438C,N5181A,N5182A,N5183A,N5171B,N5181B,N5172B N5182B,N5173B,N5183B,E8241A,E8244A,E8251A,E8254A,E8247C'
Connect to Signal Generator
Set Resource and Driver properties before connecting to the object. The IP address of Keysight Technologies N5172B signal generator is 172.28.21.217 , hence the resource specified will be 'TCPIP0::172.28.21.217::inst0::INSTR'
rf.Resource = 'TCPIP0::172.28.21.217::inst0::INSTR'; rf.Driver = 'AgRfSigGen'; % Connect to the instrument connect(rf);
Download the waveform, txWaveform, to the instrument with sampling rate Rs.
download(rf, transpose(txWaveform), Rs);
Transmit the Waveform
Call start to start transmitting waveform using specified centerFrequency, outputPower and loopCount.
centerFrequency = fc; outputPower = 0; loopCount = Inf; start(rf, centerFrequency, outputPower, loopCount);
Once the signal generator is transmitting the beacon, you can test by scanning for wireless network using a Wi-Fi device. You should now see a TEST_BEACON SSID in the list of available networks.
When you have finished transmitting, stop the waveform output, disconnect the rfsiggen object from the signal generator, and remove it from the workspace.
stop(rf); disconnect(rf); clear rf
This example uses the following helper functions: