In NetSim CR networks, Spectral efficiency is defined as the fraction of time the channel is busy. It is ChannelBusyTime/TotalSimulationTime.  


This metric is available in the CR Channel Metrics in the NetSim results dashboard. The Spectral Efficiency obtained in the results dashboard can also be calculated through the Packet Trace.


Calculation of Spectral Efficiency through Packet Trace


Consider the following scenario in Cognitive Radio network with 2 CR-CPEs and a Base Station (Experiment file attached)


A Unicast CBR application is configured from CR-CPE_2 to CR-CPE_3

Enable Packet Trace and simulate the scenario for 100s


Follow the steps given below to calculate spectral efficiency

1. After the simulation, open Packet Trace


2. In the Packet Trace, filter the DESTINATION_ID to Broadcast-0 and RECEIVER_ID to application destination Id, in this case, Node_3


3. Now, scroll to the right- side of the Packet Trace and add a new column Column1 by right-clicking on the column and selecting Insert option


4. Calculate the Transmission time using the formula Phy_Layer_End_Time - Phy_Layer_Start_Time and note down the sum of Transmission time for the packets filtered.


5. Sum of Transmission time (for broadcast) = 925069.43 microseconds


6. Now, undo the filters applied to DESTINATION_ID and RECEIVER_ID.


7. Filter the DESTINATION_ID to Base_Station_1 and Node_2 (the source node in this case).


8. Now calculate the transmission time for the packets filtered using the formula Phy_Layer_End_Time - Phy_Layer_Start_Time and note down the sum of Transmission time for the packets filtered. 


9. Sum of transmission times= 28409687.32 microseconds


10. Add the sum of transmission times obtained above and convert the time to seconds

925069.43 + 28409687.32 = 2,93,34,756.75 microseconds = 29.335 seconds


11. Calculate the Spectral Efficiency using the formula 


Sum of Transmission Time / Simulation time

Here, the simulation time is 100s.


Therefore, Spectral Efficiency = 29.3345/ 100= 0.29335


Now compare the Spectral Efficiency obtained in the Results dashboard by going to CR Metrics-> Channel Metrics


Reference Articles;

How do I calculate Queuing Delay, Transmission Time and Propagation Delay from Packet Trace?

How does one start understanding the packet trace ?