Bug 595 - PHY may start receive packet inside SIFS
PHY may start receive packet inside SIFS
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3.4
All All
: P1 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-16 12:44 UTC by Kirill V. Andreev
Modified: 2009-06-26 09:26 UTC (History)
1 user (show)

See Also:


Attachments
Proposed fix (487 bytes, patch)
2009-06-16 12:44 UTC, Kirill V. Andreev
Details | Diff
Testcace added (2.83 KB, patch)
2009-06-22 10:11 UTC, Kirill V. Andreev
Details | Diff
NS_ASSERT fixed (605 bytes, patch)
2009-06-26 08:55 UTC, Kirill V. Andreev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kirill V. Andreev 2009-06-16 12:44:04 UTC
Created attachment 467 [details]
Proposed fix

PHY passes information to DcfManager about PHY events, and DCF manager must catch situation, when PHY starts to transmit and m_rxing is true. This may occur only after the following steps:
1. PHY has started to receive a packet inside SIFS.
2. MacLow has started to transmit an ACK frame (or any other frame) when SIFS has expired.
3. PHY has started to transmit this ACK frame and has cancelled previously started receiving:
  if (m_state->IsStateSync ())
    {
      m_endSyncEvent.Cancel ();
    }
and has not tell anything to DcfManager.
4. IsBusy method of DcfManager decides that the medium is busy (because m_rxing was not unset)
5. Next transmission causes collision at DcfManager layer due to IsBusy () (see DcfManager::RequestAccess)


The idea to solve this problem is to check m_rxing flag when running DcfManager::NotifyTxStartNow (see patch)
Comment 1 Mathieu Lacage 2009-06-19 03:19:02 UTC
this looks right, but, as usual for changes to the Dcf code, I would like to see an associated testcase. Could you do this for me ? 
Comment 2 Kirill V. Andreev 2009-06-19 05:16:53 UTC
OK
Comment 3 Kirill V. Andreev 2009-06-22 10:11:41 UTC
Created attachment 475 [details]
Testcace added

Added a test which cheks that RX inside SIFS was managed properly.
Comment 4 Mathieu Lacage 2009-06-25 09:25:36 UTC
changeset 9b07308116ed
Comment 5 Kirill V. Andreev 2009-06-26 08:55:03 UTC
Created attachment 490 [details]
NS_ASSERT fixed

Fixed NS_ASSERT: '<' replaced with '<='
Comment 6 Kirill V. Andreev 2009-06-26 09:02:33 UTC
This assert has failed, but after replacing '<' with '<=' everything has become OK. this assert was added, because cancel RX may occur only when we cancel RX inside SIFS
Comment 7 Mathieu Lacage 2009-06-26 09:26:37 UTC
changeset e66fc1287031