Bug 953 - WiMAX channel scanning overflow
WiMAX channel scanning overflow
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wimax
ns-3.8
All All
: P2 normal
Assigned To: Flavio Kubota
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-07 11:25 EDT by Tom Henderson
Modified: 2010-12-28 19:41 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2010-07-07 11:25:26 EDT
when a ss node moves out of range, it starts to scan 
void
SSLinkManager::StartScanning (
  SubscriberStationNetDevice::EventType type, bool deleteParameters)
{

...

  if (m_ss->GetState () != SubscriberStationNetDevice::SS_STATE_IDLE)
    {
      m_dlChnlNr++;
    }

however, if no base station is found, the above counter will overflow after 20 tries and segmentation fault will occur.  The value of 20 is due to the below code:

void
WimaxNetDevice::InitializeChannels (void)
{
  // initializing arbitrary vector of channels (or frequencies)
  uint64_t frequency = 2000;

  for (uint8_t i = 0; i < 20; i++)
    {
      m_dlChannels.push_back (frequency);
      frequency += 40;
    }
}

I started to provide a patch for this that:
- moved the magic number 20 into an attribute
- cause a check in the above scanning code so that it did not overflow

but one question I have is what should be the behavior if the max value is reached?  Stop scanning, restart immediately from channel 0, go to sleep for a while?  Please advise.

Also, can you please comment on whether the above frequency = 2000 assignment is still arbitrary and needs to be moved also to an attribute?  What defaults correspond to real implementations (frequency start, frequency increment, number of channels, etc.)?  In other words, can we remove the "arbitrary" from the above?
Comment 1 Flavio Kubota 2010-08-08 15:30:13 EDT
The IEEE 802.16 standard does not specify what to do if SS does not scan a BS. I've resolved restarting immediately from channel 0.

On channel initialization method, I've changed the "arbitrary" to values specified by WirelessMAN-OFDM RF profile for 10 MHz channelization (Section 12.3.3.1 from IEEE 802.16-2004 standard).
Comment 2 Josh Pelkey 2010-08-09 17:50:15 EDT
I had to revert the changes in src/devices/wimax/bs-link-manager.cc in order to get the wimax-phy-layer and wimax-ss-mac-layer tests to pass.  One of them crashed and the other failed.  I'm not exactly sure yet what this does to wimax, but I am re-opening in case the bug is valid again.  Here is the reverted changeset: http://code.nsnam.org/ns-3-dev/rev/d4a75eecfa7d
Comment 3 Tom Henderson 2010-11-17 18:43:48 EST
I was not able to easily find a solution to this so I am reassigning to Flavio.
Comment 4 Flavio Kubota 2010-12-28 19:41:29 EST
To connect quickly, BS is using the first channel. All the others values is the values defined in the IEEE 802.16-2004 standard.

The segmentation fault is fixed.