Applicable Versions
NetSim Standard
NetSim Pro

Applicable Releases

The NetSim Cognitive Radio library enables spectrum usage detection based on the spatial relationship between the primary and secondary users, namely, whether the primary user (also known as the incumbent) is located within or beyond the so-called "keep-out distance" from the secondary user. In essence, the secondary user can detect the primary user if the latter is situated within the defined keep-out distance.

In this setup, the secondary user, or the Cognitive Radio Customer Premises Equipment (CR CPE), actively checks for any presence of the incumbent. Upon detection of the primary user, the secondary user will issue UCS Notifications to the base station. These notifications are generally generated at the conclusion of the quiet period.

It's important to note that the keep-out distance implemented in NetSim is an abstract model for simulation purposes, offering users the flexibility to adjust this parameter based on their specific sensing techniques or algorithms. Given that the keep-out distance is user-defined, it's presumed that the user will determine this value based on their preferred sensing technique.

This functionality is available in the academic version of NetSim.

However, the standard version of NetSim provides additional flexibility, granting users access to the source code which allows them to modify the Spectrum Sensing Function. Users have the capability to develop and incorporate new sensing algorithm functions, and alter the keep-out distance applied in the following function:

struct stru_802_22_SSFOutput* fn_NetSim_CR_CPE_SSF(struct stru_802_22_SSFInput* input,NETSIM_ID nDevId,NETSIM_ID nInterfaceId)

This particular function is housed in the spectrummanager.c file and is designed to verify the presence or absence of the incumbent signal.



1. Spectrum sensing reference:

Additional info for Advanced users

The quiet period is scheduled whenever FCH is received from the BS during which Secondary Users perform Spectrum Sensing.

Quiet Period is scheduled as shown below:

pstruEventDetails->dEventTime =

pstruBSMAC->dFrameStartTime +

(pstruFCH->n_Length_of_the_frame - pstruCPEPhy->nIntraFrameQuietPeriodDuration)*




pstruFCH->n_Length_of_the_frame is 6 bits which Indicates the length of the frame in number of OFDM symbols from the start of the frame including all preambles

pstruCPEPhy->nIntraFrameQuietPeriodDuration Default is one symbol and has range 1-16

pstruSymbol->dSymbolDuration SCH packet is one symbol long

pstruBSPHY->dTTG is Transmit Transition Gap. 105-333 micro sec. default 210 micro sec

At the beginning of every superframe, the BS shall transmit the superframe preamble and the SCH on the operating channel.In order to associate with a base station, a CPE must receive the SCH to establish communication with the BS. SCH carries BS MAC address along with the schedule of quiet periods for sensing.  

SCH header contains the following information related to Quiet Period:
, etc.,

At the beginning of every frame base station transmits Frame Control Header (FCH). FCH is decoded by the CRCPE's using the BS ID that is part of the SCH. 

Based on the SCH bitmap sz_Current_Intra_frame_Quiet_period_Cycle_Frame_Bitmap. It is then decided whether Quiet Period needs to be scheduled or not.

The Quiet period is scheduled by the Spectrum Manager. The Quiet period is scheduled in FCH.c file in the function fn_NetSim_CR_CPE_ProcessFCH().  The Quiet period is handled in SpectrumManager.c file in the function fn_NetSim_CR_QuietPeriod().

The quiet period duration indicates the number of symbols starting from the end of the frame duration, during which no transmissions shall take place. The SCH header structure can be found in the 802.22.h file in the Cognitive Radio project of NetSim source codes. 

During Quiet Period Spectrum Sensing is done by the Secondary users and the possibility of interference is checked in the function fn_NetSim_CR_CPE_SSF(). Interference in the operating or adjacent channels is checked and UCS Notifications are initiated from the SU's to the BS.

The UCS Notifications are processed by the BS in SpectrumManager.c file in the function fn_NetSim_CR_BS_UCS() and channel switch message is broadcasted if interference is identified.

The 802.22 MAC Header has a variable n_UCS which is 1-bit Urgent Coexistence Situation used by the CPE to alert the BS about a UCS with incumbents in the channel currently being used by the BS or either of its adjacent channels:
 0: no incumbent (default)
 1: incumbent detected

During the Quiet Period upon sensing the spectrum, if interference is detected, n_UCSvariable is set to 1 in the UCS notification. 

Following are the channel states in 802.22:


Upon receiving the UCS notification BS sets the current operating channel state to ChannelState_PROTECTED if n_UCS variable is set to 1. This happens in the function fn_NetSim_CR_BS_UCS()  which is part of the SpectrumManager.c file.  BS checks for any channels in ChannelState_BACKUP state. If found, it is set as the operating channel.
BS then broadcasts CHS_REQ Channel switch request in order to switch the entire cell operation to a new channel.

CRCPE's upon receiving the CHS_REQ switches their operating channel to the new channel. Channel Switching happens in the function fn_NetSim_CR_CPE_SwitchChannel()which is part of the SpectrumManager.c file.  In the results window, UCS Notification and CHS_REQ count can be found under CRCPE metrics. Packet Trace and Event Trace logs the details of these packets and can be used for the purpose of analysis.