Change GI, MCS value, Channel width and propagation model dynamically

244 views
Skip to first unread message

Durgesh Kshirsagar

unread,
Dec 16, 2021, 4:08:51 AM12/16/21
to ns-3-users
Hello everyone!
I am puzzled to know that if we can change GI, MCS value,   Channel width and propagation model dynamically in NS3.
Thank you!

Samir Si-Mohammed

unread,
Dec 16, 2021, 7:40:56 AM12/16/21
to ns-3-...@googlegroups.com
Hello,

I guess you’re talking about Wi-Fi. I do not know if it can help, but you can change those parameters using:

// Set channel width
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/+\
Phy/ChannelWidth",
UintegerValue (channelWidth));

// Set guard interval
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/+\
HtConfiguration/ShortGuardIntervalSupported",
BooleanValue (sgi));

std::ostringstream oss;
oss << "VhtMcs" << MCS;
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
"DataMode", StringValue (oss.str ()),
"ControlMode", StringValue (oss.str ()));

For MCS, the second line depends on the Wi-Fi amendment you are in. For instance, the given code is for 802.11ac (« VhtMcs »), for 802.11ac it would be HE (« HeMcs »), etc.

For the propagation models you must specify it when you create your physical channel, for instance with the YansWifiChannelHelper: 
 
YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();

channel.AddPropagationLoss("ns3::LogDistancePropagationLossModel");

Regards,

Samir 

--
Samir SI-MOHAMMED
Researcher/PhD Candidate
ENS Lyon - Labex MILyon - STACKEO
LIP UMR CNRS - 
INRIA DANTE Team

--
Posting to this group should follow these guidelines 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/56c61e25-39f3-4244-ab71-09e038691d38n%40googlegroups.com.

Durgesh Kshirsagar

unread,
Dec 16, 2021, 12:46:58 PM12/16/21
to ns-3-users
Thank you for you answer. But can we change these values dynamically? Is it theoretically and practically correct/feasible?

Samir Si-Mohammed

unread,
Dec 16, 2021, 3:52:10 PM12/16/21
to ns-3-...@googlegroups.com
Hello,

You can do so by creating a simple function like the one below:

void changeParameters (double channelWidth, double sgi) {
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelWidth", UintegerValue (channelWidth));
Config::Set ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/HtConfiguration/ShortGuardIntervalSupported", BooleanValue (sgi));

}

And calling it with a scheduling before running the simulation:

Simulator::Schedule(Seconds(5), &changeParameters, 40, 1);

Simulator::Stop (Seconds (simulationTime));
Simulator::Run ();

I think that the MCS dynamic update must be a bit more complicated since you have to pass the WifiHelper object to the function. Regarding the practical correctness I think that parameters like MCS are more chosen by the transmitter device after a negotiation phase (See this video for more details).

Hope this will help.

Regards,

Samir 

--
Samir SI-MOHAMMED
Researcher/PhD Candidate
ENS Lyon - Labex MILyon - STACKEO
LIP UMR CNRS - 
INRIA DANTE Team

Durgesh Kshirsagar

unread,
Dec 17, 2021, 3:04:07 AM12/17/21
to ns-3-users
Thank you so much for your help! I will definitely go through video.

Shivam Garg

unread,
Sep 19, 2023, 9:04:27 PM9/19/23
to ns-3-users
Hi Durgesh,

Were you able to figure out how to change the values dynamically?

Regards,
Shivam

Reply all
Reply to author
Forward
0 new messages