Changing default EDCA parameters.

103 views
Skip to first unread message

Ella Robinson

unread,
Apr 30, 2025, 11:06:51 AMApr 30
to ns-3-users
Hi, 

I am trying to change default EDCA parameters in 802.11n. 
Would like to confirm a few things: EDCA is separate for uplink and downlink?
E.g., setting the EDCA parameters for STA below would correspond to an uplink scenario?

        Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::StaWifiMac/VI_EdcaTxopN/MinCw", UintegerValue(3));

And setting it for AP (like below) would correspond to a downlink scenario?
 Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::ApWifiMac/VI_EdcaTxopN/MinCw", UintegerValue(3));
My second question is considering the downlink scenario, how would the AP know to apply the EDCA parameter I set for let's say voice users? Because when I set up the traffic, I use that using UDP Client Helper and I set parameters of UDP client helper to simulate video-like traffic:

    UdpClientHelper client(apInterface.GetAddress(0), port);
    client.SetAttribute("MaxPackets", UintegerValue(10000));
    client.SetAttribute("Interval", TimeValue(MilliSeconds(5)));
    client.SetAttribute("PacketSize", UintegerValue(1024));

    ApplicationContainer clientApps;
    clientApps.Add(client.Install(wifiStaNodes))
This doesn't "label" the client as "VIDEO", so how would the AP apply the EDCA parameters I set to these STAs?

Tom Henderson

unread,
May 1, 2025, 8:46:50 AMMay 1
to ns-3-...@googlegroups.com, Ella Robinson, Pasquale Imputato
Ella, unfortunately there doesn't appear to be any example or test
program that shows how to do this, and it is not discussed in the Sphinx
documentation chapter on Wi-Fi. I've cc'ed Pasquale Imputato who has
been working on this topic recently and he may be able to provide some
suggestions. Please note that the API for how to configure the EDCA
settings was changed in the ns-3.42 release cycle so the answer will
depend on whether you use a later or earlier release than ns-3.42.

- Tom
> --
> Posting to this group should follow these guidelines
> https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> <https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting>
> ---
> 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
> <mailto:ns-3-users+...@googlegroups.com>.
> To view this discussion visit
> https://groups.google.com/d/msgid/ns-3-users/3cd9ad76-7e95-48b4-aa67-260672ae3cean%40googlegroups.com <https://groups.google.com/d/msgid/ns-3-users/3cd9ad76-7e95-48b4-aa67-260672ae3cean%40googlegroups.com?utm_medium=email&utm_source=footer>.

Ella Robinson

unread,
May 1, 2025, 10:51:41 AMMay 1
to Tom Henderson, ns-3-...@googlegroups.com, Pasquale Imputato
Ok, thanks so much. I will wait for Pasquale's suggestions. The
version.txt file of my ns-3 says "3-dev", so seems like its version 3?

Tommaso Pecorella

unread,
May 1, 2025, 4:18:09 PMMay 1
to ns-3-users
@Ella: "3-dev" means that it's the development version, most likely downloaded from GitLab (but there's also a mirror on GitHub).
However, this doesn't tell if it's a "recent" development version... one could have cloned the repo 2 years ago, and it would still say "3-dev"...

The most reliable way is to look at the CHANGES.md file. Somewhere at the beginning you'll find a line like "## Changes from ns-3.xx to ns-3-dev".
This will tell you how "recent" the repo is. If it says "3.44 to ns-3-dev", you're on a very recent release.

Said so, upgrading a development version is fairly easy (if you used git to clone the repo). Just use "git pull" from the terminal and it will update. 

Ella Robinson

unread,
May 2, 2025, 8:59:02 AMMay 2
to ns-3-...@googlegroups.com
Right, thanks! I checked the CHANGED.md file and it says ## Changes
from ns-3.43 to ns-3-dev, so looks like I am just one release back. I
can do a git pull for latest. Thanks so much, this was helpful!
> 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/KtCKjYBds5M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/ns-3-users/fff41e9a-cc6e-48e5-9b96-c6a9f596df86n%40googlegroups.com.

Pasquale Imputato

unread,
May 3, 2025, 5:01:09 PMMay 3
to Ella Robinson, Tom Henderson, ns-3-...@googlegroups.com
Hi Ella,

in the current ns-3 version, you can set the EDCA parameters at the AP as you reported with

Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::ApWifiMac/VI_EdcaTxopN/MinCws", UintegerValue(3));

Please note that MinCw is now deprecated and I suggest using MinCws (which supports the multi link case too).
The parameters you set with lines as the one above will be used by the AP and advertised by the AP in the EDCA parameter set elements to be used by the associated STAs.

If you want AP to advertise different parameters (and then STAs use different parameters), you can set this through lines like

Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::ApWifiMac/CwMinsForSta", StringValue("VI 1"));

Additionally, when you set traffic flows that you want to cross the VI access category, you should set a proper Type of Service on the traffic flow through

client.SetAttribute("Tos", UintegerValue(0xb8));

You can find an example for setting proper ToS in examples/wireless/wifi-multi-tos.cc

Finally, to check the version of ns-3 you are using (you probably cloned from ns-3-dev), you could have a look at CHANGES.md.

Thanks,
Pasquale

Ella Robinson

unread,
Oct 29, 2025, 2:45:17 PM (2 days ago) Oct 29
to ns-3-users
Hi Pasquale, 
Thanks a lot for your reply. It helped tremendously! However, I am still a bit unclear on one thing. I am interested in changing EDCA parameters for traffic sent by a particular STA in the network who is sending uplink data to a particular AP.
 
For the interested STA: NodeList = 1, DeviceList =0
For the AP it's connected to it: NodeList = 0, DeviceList = 0

Now, these 2 lines you shared earlier below seem to be doing the same thing. How are they different? 

Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::ApWifiMac/VI_EdcaTxopN/MinCws", UintegerValue(3));
Config::Set("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::ApWifiMac/CwMinsForSta", StringValue("VI 1"));

First one seems to be changing CW_min parameter for the AP to 3, which the AP will then advertise to it's STA and STA will use that in the uplink.
The second line also seems to change the value to CW_min to 1, which will be used by the STA to send data to AP in the uplink.

Additionally, which values of NodeList and DeviceList should I use in these lines to achieve what I am desiring?

Thanks so much for your time and effort to help out the ns3 community. 
Ella
Reply all
Reply to author
Forward
0 new messages