How to manually setup DIFS

359 views
Skip to first unread message

Matteo Danieletto

unread,
May 1, 2015, 9:43:57 PM5/1/15
to ns-3-...@googlegroups.com
Hi all,
I am interesting to change the DIFS value for 802.11b configuration.
I know that DIFS = 2*timeslot + SIFS but I am looking for only change DIFS value.
I looked inside the WiFi module but I didn't find any suggestion where DIFS is initialized.

Is there any possibility to change manually?

Thank you a lot

Matteo

Sebastien Deronne

unread,
May 2, 2015, 5:00:12 AM5/2/15
to ns-3-...@googlegroups.com
You need to tune SIFS and/or the slot time value, but you cannot change only DIFS (unless you want to break the standard rules and bring changes to the code for your own work).

Matteo Danieletto

unread,
May 2, 2015, 12:07:34 PM5/2/15
to ns-3-...@googlegroups.com
Thank you Sebastian.
Yes the idea is to break the standard rules, but I didn't find where DIFS is computed.

Thank you 
Matteo 

Matteo Danieletto

unread,
May 5, 2015, 3:40:46 AM5/5/15
to ns-3-...@googlegroups.com
Hi all,
I checked inside dcf-manager.cc and wifi-mac.cc but I didn't find any suggestion where DIFS is computed.

I also found this post:


where Pecorella suggested to change the attribute DIFS: "For the Difs there's an attribute in WifiMac."
but that post is 2 years old and maybe something changed in these 2 years.


Thank you a lot
Matteo

Tommaso Pecorella

unread,
May 5, 2015, 4:08:45 AM5/5/15
to ns-3-...@googlegroups.com
Sebastien already told you: there is no DIFS in ns-3. The DIFS (the time to wait) is calculated by using SIFS, EIFS, and/or the slot time value.

T.

Matteo Danieletto

unread,
May 5, 2015, 4:10:17 AM5/5/15
to ns-3-...@googlegroups.com
Ok, maybe I found the place.


DcfManager::GetBackoffStartFor (DcfState *state)
{
  NS_LOG_FUNCTION (this << state);
  Time mostRecentEvent = MostRecent (state->GetBackoffStart (),
                                     GetAccessGrantStart () + MicroSeconds (state->GetAifsn () * m_slotTimeUs));

  return mostRecentEvent;
}

I should substitute the MicroSeconds (state->GetAifsn () * m_slotTimeUs) with the time I need.
e.g. I wish to configure DIFS=5ms then I will put MostRecent (state->GetBackoffStart (),
                                     GetAccessGrantStart () + MicroSeconds (5000));

Is it right?
Thank you
Matteo

Sebastien Deronne

unread,
May 5, 2015, 4:12:22 AM5/5/15
to ns-3-...@googlegroups.com
Which version are you using?

Sorry but it's always the same here, people do not even read the documentation!
I spent time to clearly indicate in the wifi doc how to change the timing parameters (from ns-3.22).
I also added few indications in Doxygen, so please use them!

And sorry to repeat myself, but there is NO attribute to change the DIFS value, but there are one attribute for SIFS and one attribute for the slot time, and guess what => DIFS = SIFS + 2 * slot.
If you really want to break standard rules and set DIFS independently, then you will have to bring changes to your code.


--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, 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.

Matteo Danieletto

unread,
May 5, 2015, 4:24:01 AM5/5/15
to ns-3-...@googlegroups.com
Sorry but Sebastian wrote: "SIFS and/or the slot time value, but you
cannot change only DIFS (unless you want to break the standard rules
and bring changes to the code for your own work)"

what I understood is: DIFS is computed with SIFS and slot time and if
I will find the place where DIFS is computed then I can set up my
DIFS.

Matteo
> --
> 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/uvvJGQw1_PE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

Matteo Danieletto

unread,
May 5, 2015, 4:42:17 AM5/5/15
to ns-3-...@googlegroups.com
I am using 3.22 .

I had understood that I couldn't setup DIFS as attribute.
However, I though that was easy to find the place where you compute
SIFS + 2 * slot .

Matteo
> 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/uvvJGQw1_PE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

Sebastien Deronne

unread,
May 5, 2015, 4:47:01 AM5/5/15
to ns-3-...@googlegroups.com
Of course, you can overwrite it in the code.
But it seems the easiest but also the laziest way. So start like that but I advise you to add your own attribute instead which would force overwriting DIFS.
Why? 2 reasons:
- you change it in the code. But some months later you re-use your code for something else and you get results, but you forgot you add change a key parameter in the code, and thus you are not standard-compliant.
- what if you want to test with several DIFS values? Especially if you want to automate your tests. Changing each time manually its value in the code sounds not ok here.

Sebastien Deronne

unread,
May 5, 2015, 4:58:09 AM5/5/15
to ns-3-...@googlegroups.com
FYI, you need to check in dcf-manager.cc, where the DIFS is computed as:
SIFS + AIFSN * SLOT, where AIFSN is set to 2 for DCF (non QoS).

Matteo Danieletto

unread,
May 6, 2015, 11:18:26 AM5/6/15
to ns-3-...@googlegroups.com
Thank you a lot for the suggestions
Cheers
Matteo
Reply all
Reply to author
Forward
0 new messages