Cognitive Radio

Introduction#

Electromagnetic spectrums allotted to networks such as GSM/HSPA, 3G, 4G, TV, Wi-Fi, defense communication, radio broadcasting, mobile satellites, aeronautical satellites are not always evenly utilized. While some bands in the spectrum are heavily used and overcrowded, some other bands are idle most times and underutilized. This underutilization of bands in the electromagnetic spectrum leads to Spectrum Holes, that are nothing but available channels in the wireless spectrum. These channels are a band of frequencies which are assigned to a primary user, but at times are not utilized by that user.

With the advent of Cognitive Radio (CR), spectrum can be utilized more efficiently. A user who is unable to be serviced by a band, can access a spectrum hole at the correct time and geographic location. Thus, CR is an adaptive, intelligent radio and network technology that can automatically detect spectrum holes and utilize them for data transmission.

NetSim models CR by using the specifications in the IEEE 802.22 standard. Users can also connect a Cognitive Radio with Internetwork devices, use all the protocols that Internetworks support, and view packet and event traces.

Figure ‑: A typical Cognitive Radio Network scenario in NetSim. The topology shows two CR Base Stations communication with CR CPEs and connected to an external network via a Router

Figure ‑: The Result dashboard and Plot window shown in NetSim after completion of simulation

Simulation GUI#

Open NetSim and click New Simulation Cognitive Radio Networks as shown Figure 2‑1.

Figure ‑: NetSim Home Screen

Create Scenario#

Cognitive Radio Networks come with a palette of various devices like CR_CPE, Base_Station L2 Switch, Router, Wired Node, Wireless Node, and AP (Access Point).

Click and drop into environment#

  • Add a Base Station (BTS) – click the Base_Station icon on the toolbar and place the BTS in the grid.

  • Add a Cognitive Radio CPE – click the CR_CPE icon on the toolbar and place the CR_CPE in the grid.

  • Add a Switch, Router, Wired Node, Wireless Node, and an Access point – click the appropriate icon on the toolbar and place the device in the grid.

Figure ‑: CR Networks Device Palette in GUI

NOTE:* If you change the settings of the grid, then ensure that you place the CPE in the BS’s coverage area.***

  • Connect the devices in the Cognitive Radio network by clicking the Wired/Wireless icon on the toolbar.

  • Configure an application as follows:

  • Click the Application icon on the toolbar.

  • Specify the source and destination devices in the network.

  • Specify other parameters such as method and type of the application.

Figure ‑: Top Ribbon/Toolbar

  • Set the properties of the BTS, CR_CPE, and other devices as follows:
  • Right-click a BTS, CR_CPE, device, click Properties and modify the interface and layers’ properties to your requirement.

  • For a BTS, specify incumbent count, minimum and maximum frequency, channel bandwidth, modulation technique, coding rate.

Enable Packet Trace, Event Trace & Plots (Optional)#

Click Packet Trace / Event Trace icon in the tool bar and click on OK button. For detailed help, please refer to sections 8.4 and 8.5 of the User Manual. Select Plots icon for enabling Plots and click on OK button see Figure 2‑4.

Graphical user interface, application Description automatically generated

Figure ‑: Packet Trace, Event Trace & Plots options on top ribbon

Run Simulation#

Click on Run Simulation icon on the top ribbon/toolbar.

Graphical user interface, application Description automatically generated

Figure ‑: Run Simulation on top ribbon

Set the Simulation Time and click on OK button.

Model Features#

The following are the 802.22 features implemented in NetSim:

  • Primary user: A user who has higher priority or legacy rights to use a specific part of the spectrum. Also known as Incumbent user. In NetSim, the primary user is part of the base station.

  • Secondary user: A user who has a lower priority or legacy rights to use a specific part of the spectrum, and therefore uses the spectrum in such a way that it does not cause interference to the primary users.

  • Keep-out distance: The minimum distance between the primary user and the secondary user to ensure that there is no interference.

  • Spectrum sensing: A process of monitoring and sensing the spectrum to capture information such as holes in the spectrum and the interference, and the primary users in the geographical area.

For more information about spectrum sensing in NetSim, see

http://www.ieee802.org/22/Meeting_documents/2006_Mar/22-06-0028-05-0000-Spectrum-Sensing-Simulation-Model.doc.

You can find the definition of the Spectrum sensing function the SpectrumManager.c file. If you want to modify this function at run-time, you must write a new sensing algorithm that checks if the incumbent user’s signal is present. This changes the keep-out distance.

The following is the Spectrum sensing function:

struct stru_802_22_SSFOutput* fn_NetSim_CR_CPE_SSF(struct

stru_802_22_SSFInput* input,NETSIM_ID nDevId,NETSIM_ID nInterfaceId)

  • UCS notification: UCS or Urgent Coexistence Situation notification is a notification that the secondary user sends when it senses that the primary user is back to use the channel. In NetSim, this happens when the distance between the primary user and the secondary user is less than the keep-out distance. UCS notifications are generated at the end of the quiet period (network-wide quiet periods when all network traffic is suspended and the base stations and CPEs perform in-band sensing.

  • Channel switching: A process where the secondary user switches the channel when the primary user of the channel comes back to use it.

In NetSim, the secondary user does not switch the channel to an adjacent one. The secondary user switches the channel to a channel that is next to an adjacent channel.

For example, if the primary user has returned to channel 1, the secondary user switches to channel 3 and not channel 2.

  • Operating frequency: The frequency band at which the incumbent operates. This band can range from 54 MHz to 862 MHz. The bandwidth of every channel is 6 MHz.

For example, if the operating frequency is set from 54 MHz to 72 MHz, then

  • Channel 1 will be 54 to 60 MHz.

  • Channel 2 will be 60 to 66 MHz.

  • Channel 3 will be 66 to 72 MHz.

  • ON duration: The duration of time for which the primary or incumbent user operates.

In NetSim, you can specify a duration between 1 second and 100,000 seconds.

  • OFF duration: The time interval between two successive ON durations of an incumbent.

For example, if you specify an ON duration on 5 seconds, the incumbent operates once every 5 seconds. If you specify an ON duration of 0, the incumbent remains always active.

PHY rate: The PHY rate in the IEEE 802.22 standard depends on the following parameters:

  • Number of bits per symbol

  • Coding rate

  • Cyclic prefix

  • Symbol duration

PHY rate in Cognitive Radio is calculated as follows:

$$PHY\ rate = \frac{Bit\ count\ in\ One\ symbol}{Symbol\ duration}$$

Bit count in One symbol = Subcarrier count × Number of bits  × Coding Rate

$$Bit\ count\ in\ One\ symbol = 1440 \times 2 \times 2\left( \frac{1}{2} \right),\ where\ Subcarrier\ count = 1440$$

For Subcarrier count, refer the table on page 201 in the document available here –

https://ieeexplore.ieee.org/document/7098301.

The following table lists the different modulation techniques and the number of bits per symbol see Table 3‑1, the modulation technique uses.

Modulation technique # of bits per symbol
BPSK 1
QPSK 2
16-QAM 4
64-QAM 6

Table ‑: Different Modulation techniques vs. number of bits per symbol

The following displays the coding rate.

Coding rate Data bits Redundant bits (n-k)
1/2 (default) 1 1
2/3 2 1
3/4 3 1
4/5 4 1

Table ‑: Different Coding rates vs. Data bits vs. Redundant bits

The following table displays the cyclic prefix. 

Cyclic prefix
1/4
1/8
1/16
1/64

Table ‑: Cyclic prefix

$$\mathbf{Symbol}\ \mathbf{duration} = \frac{\mathbf{Subcarrier}\ \mathbf{spacing}}{\mathbf{Cyclic}\ \mathbf{prefix}} = \mathbf{317}.\mathbf{38}$$

$$\mathbf{Data}\ \mathbf{rate} = \frac{\mathbf{Bit}\ \mathbf{count}\ \mathbf{in}\ \mathbf{One}\ \mathbf{symbol}}{\mathbf{Symbol}\ \mathbf{duration}} = \frac{\mathbf{1440}}{\mathbf{317}.\mathbf{38}} = \mathbf{4}.\mathbf{53}\mathbf{Mbps}$$

In NetSim, the base station allocates a maximum of One symbol per CPE. If the generation rate is more than the data filled in one symbol, the allocation fails and this results in Zero throughput. The first symbol is reserved for CR control frames or any broadcast PDU.

  • Coding rate: A fractional number used for error correction. Coding rate specifies what part of the redundant message is meaningful. If the code rate is {\displaystyle k/n}k/n, for every ‘{\displaystyle k}k’ bits of useful information, the coder generates a total of ‘{\displaystyle n}n’ bits of data, of which {\displaystyle n-k}n-k are redundant.

How to avoid low Application Layer Throughput#

When you simulate a Cognitive Radio network in NetSim, the throughput in the Application layer is lesser than the throughput in the Datalink layer throughput because of the following factors:

  • TCP connection establishment.

  • ARP set up.

  • Service flow created for the CPE to the BS and the BS to the CPE.

  • Bandwidth request.

To avoid the above effects:

  • Set the application traffic model to Custom.

  • Set the Downlink/Uplink ratio to 1:1 so, the BS transmits whatever it receives.

  • Run UDP in the Transport layer.

  • Use static ARP.

  • Run the simulation for more than 100 seconds.

Segmentation#

CR segments packets of 100B. In the application settings if the packet size is greater than 100B, then those packets will be segmented. The segment IDs can be viewed in the packet trace.

How to Modify Device Parameters at Run-time#

For information about how to change the device parameters at run-time, see

https://tetcos.freshdesk.com/support/solutions/articles/14000084233-how-do-i-modify-the-cognitive-radio-device-parameters-during-run-time-.

Featured Examples#

NetSim contains some example configuration files to let you simulate and understand the concepts associated with Cognitive Radio. To simulate these examples, click Examples > Cognitive-Radio in the NetSim Home Screen.

Users can change the default values of the parameters in these examples and see how they impact the Cognitive Radio network.

CR Keep-out Distance #

The Cognitive Radio network you model from the example configuration file meets the following specifications:

  • A network with 1 base station and 2 CR CPEs, and a unicast application running on one of the CR CPEs.

NetSim uses the following defaults for this example:

  • The unicast application transmits data at a constant bit-rate from CR_CPE_2 to CR_CPE_3.

  • Simulation runs for 100 seconds.

To simulate the example for CR Keep-out Distance for Cognitive Radio, in NetSim:

Open NetSim and Select Examples > Cognitive Radio Networks > CR Keepout Distance then click on the tile in the middle panel to load the example as shown in below screenshot

Graphical user interface Description automatically generated

Figure ‑: List of scenarios for the example of CR Keepout Distance

The following network diagram illustrates what the NetSim UI displays when you open the example configuration file see Figure 4‑2.

Figure ‑: Network set up for studying the CR Keepout Distance

  1. See that by default, NetSim has set a grid length of 500m X 500m.

  2. See that by default, NetSim has set the Incumbent Count to 3, the range of the operating frequency from 54 MHz to 60 MHz, and incumbent is always ON. To do so:

  1. Right-click Base_Station_1 and click Properties.

    The Cr_Bs pop-up window appears.

  2. Click INTERFACE_1 (COGNITIVE_RADIO) in the left area.

  3. Click DATALINK_LAYER in the right area.

  4. The following parameters settings have been made for this example.

  5. 1 for the Incumbent count field.

  6. 500, 0 for the X, Y co-ordinates

  7. 54 for the Oper_Freq_Start(MHz) field.

  8. 60 for the Oper_Freq_End(MHz) field.

  9. 10 for the ON_Duration(s) field.

  10. 0 for the OFF_Duration(s) field.

  11. Click OK. The following figure illustrates the CR_Bs pop-up window and the default settings see Figure 4‑3.

Figure ‑: Datalink Layer properties window

  1. In NetSim GUI Plots are Enabled.

  2. Simulate the CR Keep-out Distance for Cognitive Radio example. To do so:

  1. Click the Run icon located on the toolbar. The Run > Simulation pop-up window appears.
  1. Retain the default settings in the Simulation Configuration tab > (Simulation Time = 100).

  2. Click OK. After NetSim simulates the CR Keep-out Distance for > Cognitive Radio example, NetSim displays the Simulation Results > window.

  1. Interpret the results. To do so:
  1. Click CR Metrics > Incumbent metrics in the left area and check the Detailed View check box in the Incumbent metrics_Table pop-up window see Figure 4‑4.
  1. Scroll right and see the value in the Operational time (Microsec) and Idle time (Microsec) column. Because the incumbent is operational throughout the simulation, you will see that the value of the Operational time is 100 seconds and that of the Idle time is zero (0) seconds. The following Figure 4‑4 illustrates step (b).
Table Description automatically generated

Figure ‑: Incumbent metrics Table

  1. Click Application_Metrics in the left area and check the Detailed View check box in the Application_Metrics_Table pop-up window see Figure 4‑5.

  2. See the value in the Throughput (Mbps) column. Because we set the Keep-out distance to 100 and set the incumbent coordinates to outside the Keep-out distance, there is no Interference, and you see a non-zero value for the throughout. The following figure illustrates step (d).

Graphical user interface, application Description automatically generated

Figure ‑: Application Metrics Table

PU SU Spectrum Usage #

The Cognitive Radio network you model from the example configuration file meets the following specifications:

  • A network with 1 base station and 2 CR CPEs, and a unicast application running on one of the CR CPEs.

NetSim uses the following defaults for this example:

  • The unicast application transmits data at a constant bit-rate from CR_CPE_2 to CR_CPE_3.

  • Simulation runs for 100 seconds.

  • Packet trace is enabled.

To simulate the example for PU and SU’s Spectrum Usage for Cognitive Radio, in NetSim:

Open NetSim and Select Examples > Cognitive Radio Networks > PU SU Spectrum Usage then click on the tile in the middle panel to load the example as shown in below screenshot

Graphical user interface, application Description automatically generated

Figure ‑: List of scenarios for the example of PU SU Spectrum Usage

The following network diagram illustrates what the NetSim UI displays when you open the example configuration file see Figure 4‑7.

Figure ‑: Network set up for studying the PU SU Spectrum Usage

  1. See that by default, NetSim has set a grid length of 500m X 500m.
  1. See that by default, NetSim has set the Incumbent Count to 3, the range of the operating frequency from 54 MHz to 60 MHz, and incumbent has an OFF period. To do so:
  1. Right-click Base_Station_1 and click Properties. The Cr_Bs pop-up > window appears.
  1. Click INTERFACE_1 (COGNITIVE_RADIO) in the left area.

  2. Click DATALINK_LAYER in the right area.

  3. Incumbent count drop-down list is set to 1.

  4. NetSim has specified a value of 54 in the Oper_Freq_Start(MHz) field.

  5. NetSim has specified a value of 60 in the Oper_Freq_End(MHz) field.

  6. NetSim has specified a value of 10 in the ON_Duration(s) field.

  7. NetSim has specified a value of 10 in the OFF_Duration(s) field.

  8. Click OK. The following figure illustrates the CR_Bs pop-up window and the default settings see Figure 4‑8.

Figure ‑: Datalink Layer properties window

  1. Ensure that the distance between incumbent and CR CPEs is less than > 100m (keep-out distance).

  2. In NetSim GUI Plots are Enabled.

  3. Simulate the PU SU Spectrum Usage for Cognitive Radio example. To do > so:

  1. Click the Run icon located on the toolbar.

    The Run Simulation pop-up window appears.

  1. Retain the default settings in the Simulation Configuration tab (Simulation Time = 100).

  2. Click OK. After NetSim simulates the PU SU Spectrum Usage for Cognitive Radio example, NetSim displays the Simulation Results window.

  1. Interpret the results. To do so:
  1. Click Open Packet Trace in the left area and filter the Packet_Type column by CBR and BW Request the Transmitter_ID column by Node-2 (CR_CPE_2).
  1. See the filtered values in the PHY_Layer_START time column, in the spreadsheet. Observe that no data is transmitted between 10 to 20 seconds because, the incumbent user is using the channel. For the first 10 seconds, Node-2 uses the channel and for the next 10 seconds, the incumbent (Base_Station_1) uses the channel. And, this happens every 10 seconds. The following Figure 4‑9 illustrates step (b).

Figure ‑: Packet Trace

The Cognitive Radio network you model from the example configuration file meets the following specifications:

  • A network with 1 base station, 1 router, 1 Wired node and 2 CR CPEs, and a unicast application running on one of the CR CPEs.

NetSim uses the following defaults for this example:

  • The unicast application transmits data at a constant bit-rate from CR_CPE_2 to Wired_Node_5.

  • Simulation runs for 30 seconds.

To simulate the example Effect of Downlink-Uplink Ratio for Cognitive Radio, in NetSim:

Open NetSim and Select Examples > Cognitive Radio Networks > Effect of DL UL Ratio then click on the tile in the middle panel to load the example as shown in below Figure 4‑10

Figure ‑: List of scenarios for the example of Effect of DL UL Ratio

The following network diagram illustrates what the NetSim UI displays when you open the example configuration file Figure 4‑11.

Figure 4‑11: Network set up for studying the Effect of DL UL Ratio

  1. See that by default, NetSim has set a grid length of 500m X 500m.
  1. See that by default, NetSim has set the Uplink to Downlink ratio to > 1:1. To do so:
  1. Right-click Base_Station_1 and click Properties. The Cr_Bs pop-up > window appears.
  1. Click INTERFACE_1 (COGNITIVE_RADIO) in the left area.

  2. Click PHYSICAL_LAYER in the right area see Figure 4‑12.

  3. DL_UL_Ratio drop-down list is set to 1:1.

  4. Click OK. The following Figure 4‑12 illustrates the CR_Bs pop-up > window and the default settings.

Figure ‑: Physical layer window

  1. See that by default, NetSim has not enabled Path Loss for the wireless links between the Base Station and the CR_CPEs. To do so:
  1. Right-click the wireless link between Base_Station_1 and CR_CPE_2 and click Properties. The Link Properties pop-up window appears.
  1. Channel_Characteristics drop-down list is set to NO_PATHLOSS.

  2. Click OK.

  1. Right click on the Application icon present in the top ribbon/toolbar and select Properties.
  1. A CBR Application is generated from CR-CPE-2 i.e., Source to Wireless Node 5 i.e. Destination with Packet Size remaining 1460Bytes and Inter Arrival Time remaining 10000µs. Transport Protocol is set to UDP instead of TCP.
  1. In NetSim GUI Plots are Enabled.

  2. Simulate the Effect of Downlink-Uplink Ratio for Cognitive Radio example. To do so:

  1. Click the Run icon located on the toolbar. The Run Simulation pop-up window appears.
  1. Retain the default settings in the Simulation Configuration tab (Simulation Time = 30).

  2. Click OK. After NetSim simulates the Effect of Downlink-Uplink Ratio for Cognitive Radio example, NetSim displays the Simulation Results window.

  1. Interpret the results. To do so, see the value in the Throughput (Mbps) column, in the Application_Metrics_Table window see Figure 4‑13. You will see a value of 0.8218 Mbps. The following Figure 4‑13 illustrates step (6).
Graphical user interface, application Description automatically generated

Figure ‑: Application Metrics Table

  1. Simulate the Effect of Downlink-Uplink Ratio for Cognitive Radio example with the following Uplink to Downlink ratios: 1:2, 1:3, and 1:4. You should see the following values of throughput for the different Uplink to Downlink ratios see Table 4‑1.
Sl No DL: UL Ratio Throughput (Mbps)
1 1:1 0.8218
2 1:2 0.9571
3 1:3 0.9575
4 1:4 1.001

Table ‑: Different DL: UL Ratio vs. Throughput

You will see that the throughput for #2 is lesser than that for #3 because, 3 subframes are allocated for upstream and only 1 subframe for downstream. This means more data can be transmitted through the uplink.

Effect of Coding Rate #

The Cognitive Radio network modeled in the example configuration file has the following settings:

  1. A network with 1 base station, 1 router, 1 Wired node and 2 CR CPEs, and a unicast application running on one of the CR CPEs.

NetSim uses the following defaults for this example:

  1. The unicast application transmits data at a constant bit-rate from CR_CPE_2 to Wired_Node_5.

  2. Simulation runs for 30 seconds.

To simulate the example Effect of Coding Rate for Cognitive Radio, in NetSim:

Open NetSim and Select Examples > Cognitive Radio Networks > Effect of Coding Rate then click on the tile in the middle panel to load the example as shown in below screenshot

Graphical user interface, application Description automatically generated

Figure ‑: List of scenarios for the example of Effect of Coding Rate

The following network diagram illustrates what the NetSim UI displays when you open the example configuration file see Figure 4‑15.

Figure ‑: Network set up for studying the Effect of Coding Rate

  1. See that by default, NetSim has set a grid length of 500m X 500m.
  1. See that by default, NetSim has set the Coding Rate to 1/2. To do > so:
  1. Right-click Base_Station_1 and click Properties. The Cr_Bs pop-up > window appears.
  1. Click INTERFACE_1 (COGNITIVE_RADIO) in the left area.

  2. Click PHYSICAL_LAYER in the right area see Figure 4‑16.

  3. Coding_Rate drop-down list is set to 1/2.

  4. Click OK. The following figure illustrates the CR_Bs pop-up window > and the default settings.

Figure ‑: Physical layer window

  1. See that by default, NetSim has not enabled Path Loss for the wireless links between the Base Station and the CR_CPEs. To do so:
  1. Right-click the wireless link between Base_Station_1 and CR_CPE_2 and click Properties. The Link Properties pop-up window appears.
  1. Channel_Characteristics drop-down list is set to NO_PATHLOSS.

  2. Click OK.

  1. Right click on the Application icon present in the top ribbon/toolbar.and select Properties.
  1. A CBR Application is generated from CR-CPE-2 i.e., Source to Wireless Node 5 i.e. Destination with Packet Size remaining 1460Bytes and Inter Arrival Time remaining 10000µs. Transport Protocol is set to UDP instead of TCP.
  1. In NetSim GUI Plots are Enabled.

  2. Simulate the Effect of Coding Rate for Cognitive Radio example. To do so:

  1. Click the Run icon located on the toolbar.
  1. The Run Simulation pop-up window appears.

  2. Retain the default settings in the Simulation Configuration tab (Simulation Time = 30).

  3. Click OK.

After NetSim simulates the Effect of Coding Rate for Cognitive Radio example, NetSim displays the Simulation Results window.

  1. Interpret the results. To do so, see the value in the Throughput (Mbps) column, in the Application_Metrics_Table window see Figure 4‑17. You will see a value of 0.8218 Mbps. The following Figure 4‑17 illustrates step (6).

Figure ‑: Application Metrics Table

  1. Simulate the Effect of Coding Rate for Cognitive Radio example with the following values: 2/3, 3/4, and 5/6. You should see the following values of throughput for the different Coding Rates.
Sl No Coding Rate Throughput (Mbps)
1 1/2 0.8218
2 2/3 0.9574
3 3/4 0.9576
4 5/6 1.1198

Table ‑: Different Coding Rates vs. Throughput

You will see that the throughput for #3 is more than that for #2 because, the number of data bits for #3 is more than that for #2, but the number of redundant bits is same. For #2, 2 data bits and 1 redundant bit, and for #3, 3 data bits and 1 redundant bit.

Cognitive Radio Networks Experiments in NetSim#

Apart from examples, in-built experiments are also available in NetSim. Examples help the user understand the working of features in NetSim. Experiments are designed to help the user (usually students) learn networking concepts through simulation. The experiments contain objective, theory, set-up, results, and inference. The following experiments are available in the Experiments manual (pdf file).

  1. To analyze how the allocation of frequency spectrum to the Incumbent > (Primary) and CR CPE (Secondary User) affects throughput.

Reference Documents#

IEEE 802.22 - 2011 Standard for Wireless Regional Area Network (WRAN).

Latest FAQs#

You can refer to the up-to-date FAQs about NetSim’s Cognitive Radio library at

https://tetcos.freshdesk.com/support/solutions/folders/14000105116