Bug 1282 - Sleep state and CCA
Sleep state and CCA
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: uan
ns-3.12
All All
: P5 normal
Assigned To: Andrea Sacco
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-18 11:12 UTC by Salva Climent
Modified: 2012-02-23 11:17 UTC (History)
2 users (show)

See Also:


Attachments
Mods to the UanPhyGen::SetSleepMode method (631 bytes, patch)
2011-10-18 11:12 UTC, Salva Climent
Details | Diff
Test Code (2.34 KB, text/x-c++src)
2012-02-03 07:56 UTC, Salva Climent
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Salva Climent 2011-10-18 11:12:19 UTC
Created attachment 1257 [details]
Mods to the UanPhyGen::SetSleepMode method

Hello,

There is a problem with the UanPhyGen::SetSleepMode (bool) method, when called in the middle of a Tx. Suppose the following:

- The Phy layer is in the middle of a Tx.
- For some reason, the upper layer calls SetSleepMode with the bool parameter set to false. This will change the m_state variable from TX to IDLE.
- When the transmission finishes, an error will be thrown at TxEndEvent line 558 since m_state has changed.

I propose checking the m_state variable before changing the state.

Another problem comes with the wakeup procedure. When the phy layer wakes up it starts at the IDLE state. Instead, I think the channel should be listened first and switch to the CCABUSY state if appropriate.

I'm attaching a patch with the modifications.
Comment 1 Andrea Sacco 2011-11-12 06:40:22 UTC
Hi Salva,
can you please give a test code to reproduce the bug?

Thanks,
Andrea
Comment 2 Salva Climent 2012-02-03 07:56:47 UTC
Created attachment 1325 [details]
Test Code
Comment 3 Salva Climent 2012-02-03 07:57:49 UTC
You can find attached the test code.
Comment 4 Andrea Sacco 2012-02-23 11:17:52 UTC
Fixed changeset 7738 fe52cb6371f2

Thanks Salva