Bug 679 - channel switching causes error
: channel switching causes error
Status: NEW
: ns-3
devices
: ns-3-dev
: All All
: P3 major
Assigned To:
:
: bug
:
:
  Show dependency treegraph
 
Reported: 2009-09-18 13:25 EDT by
Modified: 2010-01-13 13:26 EDT (History)


Attachments
Can't reproduce (475 bytes, application/octet-stream)
2010-01-11 09:09 EDT, Pavel Boyko
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-09-18 13:25:18 EDT
I am using the latest dev version of ns-3. 

I added the following lines into third.cc to see if I can figure out 
how to use ChannelNumber: 
insert at line 86 (above the phy.SetChannel (channel.Create ()); line: 
YansWifiPhy testCN; 
testCN.SetChannelNumber (1000); 


When I do this I get an error: 
"assert failed. file=../src/devices/wifi/wifi-phy-state-helper.cc, 
line=379, cond="IsStateSwitching()" 
line 379 is NS_ASSERT(IsStateSwitching()); 


I checked in yans-wifi-phy.cc for the same assert, and on line 311 it 
is NS_ASSERT(!IsStateSwitching()); 


When I added the ! to line 379 of wifi-phy-state-helper.cc so that it 
would be the same as line 311 of yans-wifi-phy.cc, the error went 
away. 


I'm not sure if I did something wrong with my attempt at using 
ChannelNumber, or if the ! got lost.
------- Comment #1 From 2010-01-11 09:09:12 EDT -------
  Sorry, can't reproduce on current ns-3-dev. Patch according to your
description attached below. Please check that bug still exist.  

(In reply to comment #0)
> I am using the latest dev version of ns-3. 
> 
> I added the following lines into third.cc to see if I can figure out 
> how to use ChannelNumber: 
> insert at line 86 (above the phy.SetChannel (channel.Create ()); line: 
> YansWifiPhy testCN; 
> testCN.SetChannelNumber (1000); 
> 
> 
> When I do this I get an error: 
> "assert failed. file=../src/devices/wifi/wifi-phy-state-helper.cc, 
> line=379, cond="IsStateSwitching()" 
> line 379 is NS_ASSERT(IsStateSwitching()); 
> 
> 
> I checked in yans-wifi-phy.cc for the same assert, and on line 311 it 
> is NS_ASSERT(!IsStateSwitching()); 
> 
> 
> When I added the ! to line 379 of wifi-phy-state-helper.cc so that it 
> would be the same as line 311 of yans-wifi-phy.cc, the error went 
> away. 
> 
> 
> I'm not sure if I did something wrong with my attempt at using 
> ChannelNumber, or if the ! got lost.
------- Comment #2 From 2010-01-11 09:09:50 EDT -------
Created an attachment (id=716) [details]
Can't reproduce
------- Comment #3 From 2010-01-13 13:26:05 EDT -------
I think this may have been a case of trying to change channels when the sender
was sending.  As far as I can tell, that will still cause an assert error in
the code.  I'm not sure if there is a way to allow channel switching to be
scheduled even when a node is sending, even if you let the node finish sending
and then switch the channel.

Michael