Hopping Channel Calculation in NetSim DTDMA

What are hopping channels and how are they computed in NetSim DTDMA?

Applies to: NetSim Pro v14/v15

Frequency hopping changes a radio's operating frequency among a set of channels within a configured band. In NetSim DTDMA, the available hopping-channel count is derived from the frequency span and the channel bandwidth. During a hopping event, the simulation selects one channel index and sets the operating frequency for that node.



The Hopping Channels Count shown in the GUI is informational only. The displayed count is not used by the simulation engine. During simulation, DTDMA calculates the hopping range from the lower frequency, upper frequency, and bandwidth.

What is a hopping channel?

A hopping channel is one bandwidth-sized frequency position within the configured lower-to-upper frequency span. 

How the channel count is calculated

Hopping channel count =
(Upper frequency - Lower frequency)
-----------------------------------
Channel bandwidth

The simulation converts the result to an integer:

int range = (int)(
(phy->dUpperFrequency - phy->dLowerFrequency) /
phy->dBandwidth);

If the span is not an exact multiple of the bandwidth, the integer conversion truncates the fractional part. Configure a frequency span that is divisible by the channel bandwidth when a whole set of equal-width channels is required.

Example

Lower frequency2400 MHz
Upper frequency2480 MHz
Channel bandwidth5 MHz
Computed count(2480 - 2400) / 5 = 16 channels

The channel indices are 0 through 15. With the calculation, the corresponding selected frequencies are obtained from:

Selected frequency =
Lower frequency + Channel index × Channel bandwidth

How DTDMA selects a hopping frequency

The function generates a random channel index in the calculated range and sets the node's current operating frequency:

r = random channel index from 0 to range - 1;

phy->dFrequency =
phy->dLowerFrequency + r * phy->dBandwidth;

The selected frequency is subsequently used by DTDMA propagation and interference processing.

Where the calculations are performed

LocationPurpose
<NetSim_Install_Directory>\src\Simulation\DTDMA\FrequencyHopping.c
fn_NetSim_DTDMA_FrequencyHopping()
Calculates the integer channel range, selects a random channel index, and assigns the current frequency during simulation.
<NetSim_Install_Directory>\src\Simulation\DTDMA\DTDMA_Phy.cUses the selected frequency for propagation, reception, and interference-related processing.

Key distinction

The displayed hopping-channel count is informational. The simulation engine calculates its channel range from the configured lower frequency, upper frequency, and bandwidth in FrequencyHopping.c.