In ns-3, is backoff procedure suspended when channel is busy?

211 views
Skip to first unread message

Le Tian

unread,
Aug 18, 2015, 12:19:41 PM8/18/15
to ns-3-users

Hi all,


For dcf backoff, according to wifi standard,  


"If the medium is determined to be busy at any time during a backoff slot, then the backoff procedure is

suspended; that is, the backoff timer shall not decrement for that slot. The medium shall be determined to be

idle for the duration of a DIFS period or EIFS, as appropriate (see 9.3.2.3), before the backoff procedure is

allowed to resume"


but in ns-3, it seems no suspense in backoff when the channel is busy, slots are always decreased. do I misunderstand that ? 

void

DcfManager::RequestAccess (DcfState *state)

{

  NS_LOG_FUNCTION (this << state);

  //Deny access if in sleep mode

  if (m_sleeping)

    {

      return;

    }

  UpdateBackoff ();

  NS_ASSERT (!state->IsAccessRequested ());

  state->NotifyAccessRequested ();

  /**

   * If there is a collision, generate a backoff

   * by notifying the collision to the user.

   */

  if (state->GetBackoffSlots () == 0

      && IsBusy ())

    {

      MY_DEBUG ("medium is busy: collision");

      /* someone else has accessed the medium.

       * generate a backoff.

       */

      state->NotifyCollision ();

    }

  DoGrantAccess ();

  DoRestartAccessTimeoutIfNeeded ();

}


Kind regards,
Le

Tommaso Pecorella

unread,
Aug 18, 2015, 4:23:42 PM8/18/15
to ns-3-users, sebastie...@gmail.com
Hi,

it could be a bug (a rather subtle one).
As usual, the best thing is to poke Sébastien (he's already reading in cc) to check if it's a known bug.

Cheers,

T.

Sebastien Deronne

unread,
Aug 21, 2015, 3:26:31 AM8/21/15
to Le Tian, ns-3-...@googlegroups.com
Sorry, I had not time to look into this, but freezing should normally be working ok.
If you still have issue, I could investigate next month.

2015-08-21 9:12 GMT+02:00 Le Tian <Le....@uantwerpen.be>:
Hi,

I realised i may misunderstand the code, 

DcfManager::GetAccessGrantStart (void) const which is called by UpdateBackoff () seems consider the situation when channel is busy with " Time busyAccessStart = m_lastBusyStart + m_lastBusyDuration + m_sifs;"


Time

DcfManager::GetAccessGrantStart (void) const

{

  NS_LOG_FUNCTION (this);

  Time rxAccessStart;

  if (!m_rxing)

    {

      rxAccessStart = m_lastRxEnd + m_sifs;

      if (!m_lastRxReceivedOk)

        {

          rxAccessStart += m_eifsNoDifs;

        }

    }

  else

    {

      rxAccessStart = m_lastRxStart + m_lastRxDuration + m_sifs;

    }

  Time busyAccessStart = m_lastBusyStart + m_lastBusyDuration + m_sifs;

  Time txAccessStart = m_lastTxStart + m_lastTxDuration + m_sifs;

  Time navAccessStart = m_lastNavStart + m_lastNavDuration + m_sifs;

  Time ackTimeoutAccessStart = m_lastAckTimeoutEnd + m_sifs;

  Time ctsTimeoutAccessStart = m_lastCtsTimeoutEnd + m_sifs;

  Time switchingAccessStart = m_lastSwitchingStart + m_lastSwitchingDuration + m_sifs;

  Time accessGrantedStart = MostRecent (rxAccessStart,

                                        busyAccessStart,

                                        txAccessStart,

                                        navAccessStart,

                                        ackTimeoutAccessStart,

                                        ctsTimeoutAccessStart,

                                        switchingAccessStart

                                        );

  NS_LOG_INFO ("access grant start=" << accessGrantedStart <<

               ", rx access start=" << rxAccessStart <<

               ", busy access start=" << busyAccessStart <<

               ", tx access start=" << txAccessStart <<

               ", nav access start=" << navAccessStart);

  return accessGrantedStart;

}


hope i understand correctly this time.


Kind regards,



Le Tian
Modeling of Systems and Internet Communication (MOSAIC)
University of Antwerp - iMinds
Dept. Mathematics and Computer Science
Middelheimlaan 1
2020 Antwerpen - Belgium

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/Yo7HBXWT4U4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages