devices = wifi.Install (wifiPhy, wifiMac, networkNodes);
Ptr<UniformRandomVariable> uv = CreateObject<UniformRandomVariable> ();
m_hello_time =100+ uv->GetValue (0, 100);
Simulator::Schedule (MilliSeconds(startTime), &ns3::NeighborDiscovery::SendHello, this);
MAX_RESPONSE_TIME = 21.2345;
double r =1.0+ uv->GetValue (0, MAX_RESPONSE_TIME);
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
WifiHelper wifi;
wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("OfdmRate6Mbps"), "RtsCtsThreshold", UintegerValue (0));
wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
Config::SetDefault("ns3::WifiMacQueue::MaxPacketNumber", UintegerValue(5000));
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue(10000));
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue(10000));
Config::SetDefault("ns3::WifiRemoteStationManager::RtsCtsThreshold",UintegerValue(0));
YansWifiChannelHelper wifiChannel;
wifiChannel.AddPropagationLoss("ns3::RangePropagationLossModel","MaxRange", DoubleValue(distance)); wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");
uint32_t newMinCw = 100;
m_dca->SetMinCw(newMinCw);
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue(10000));
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue(10000));
"RtsCtsThreshold", UintegerValue (0)
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("OfdmRate6Mbps"),"RtsCtsThreshold", UintegerValue (0));
Good day Rediet:Thanks for taking the time to reply, as you correctly proposed changing the value of the "contention window" (CW) decreased considerably the number of WifiPhy RxDrop, in the previous simulation by sec 3 i had 700 drops now by 3 i have 600 or 500 depending the setting of the CWSince i'm implementing this from the mac the only thing i did wasuse my existing DcaTxop object and set the CW.
uint32_t newMinCw = 100;
m_dca->SetMinCw(newMinCw);
But that raised more questions.
- ¿Why these settings didn't improve anything at ll?
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue(10000));Config::SetDefault("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue(10000));
"RtsCtsThreshold", UintegerValue (0)
- ¿For the rate control algorithm is there a recommended one?
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("OfdmRate6Mbps"),"RtsCtsThreshold", UintegerValue (0));
- As i understand the backoff time will be from 0 to minCw if i'm not mistaken
- ¿Does changing the minCw affect the control rate algorithm i selected?
- ¿Is there any other parameter in the DcaTxOp to set? should i set the something for EdcaTxOp as well?
- Besides the aforementioned anyother parameter for reducing the colliions ir wifiphydrops (maybe change to DSSS?)?
wifi.SetRemoteStationManager ("ns3::IdealWifiManager","RtsCtsThreshold", UintegerValue (99999));
Config::SetDefault("ns3::WifiMacQueue::MaxPacketNumber", UintegerValue(5000));
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue(10000));
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue(10000));
uint32_t newMinCw = 100; m_dca->SetMinCw(newMinCw);
// setting EdcaTxopN MinCw for the 4 queues m_edca.find (AC_VO)->second->SetMinCw(newMinCw); m_edca.find (AC_VI)->second->SetMinCw(newMinCw); m_edca.find (AC_BE)->second->SetMinCw(newMinCw); m_edca.find (AC_BK)->second->SetMinCw(newMinCw);
Good day Rediet:Thanks for the quick response and follow up, i made several experiments so:
- Correct me if i'm wrong but MinCw and MaxCw should be multiples or did you mean numbers expressed as 2^N-1 numbers;
- Since default MinCw 2^4-1=15 and MaxCw = 2^10-1=1023
- Knowing that i will have a lot of nodes with randomized start broadcast hellos, therefore is best recommendable to disable RTC/CTS and rely on the rate control algorithm? which i can choose as you mentioned from: IdealWifiManager, MinstrekWifiManager or AarfWifiManager
wifi.SetRemoteStationManager ("ns3::IdealWifiManager","RtsCtsThreshold", UintegerValue (99999));- With the same settings i mentioned before
Config::SetDefault("ns3::WifiMacQueue::MaxPacketNumber", UintegerValue(5000));
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue(10000));
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue(10000));- Below you will found two snapshots with the IdealWifiManager with RtsCtsThreshold to 0 and 99999 and i didn't see any enhancement whatsoever, did i miss any additional configuration?
- In my question "¿Is there any other parameter in the DcaTxOp to set? should i set the something for EdcaTxOp as well? you answered: If you have QoS enabled yes you should (for all ACs). Otherwise only non-QoS parameters will have high CWmin.
- What other parameters these would be
- When you mentioned trying to changin the EDCA's CWmin i saw from a thread that these are hard to change since they are read only values, nevertheless i think i´m changing them, for each of the queues, is the following correct, meaning is that what you meant by changing the EDCA CWmin?
uint32_t newMinCw = 100;m_dca->SetMinCw(newMinCw);// setting EdcaTxopN MinCw for the 4 queuesm_edca.find (AC_VO)->second->SetMinCw(newMinCw);m_edca.find (AC_VI)->second->SetMinCw(newMinCw);m_edca.find (AC_BE)->second->SetMinCw(newMinCw);m_edca.find (AC_BK)->second->SetMinCw(newMinCw);
wifi.SetRemoteStationManager ("ns3::IdealWifiManager","RtsCtsThreshold", UintegerValue (99999));
Config::SetDefault("ns3::WifiMacQueue::MaxPacketNumber", UintegerValue(5000));
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue(10000));
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue(10000));sa
wifi.SetRemoteStationManager ("ns3::IdealWifiManager","RtsCtsThreshold", UintegerValue (99999), "ErpProtectionMode", StringValue("Rts-Cts"), "HtProtectionMode", StringValue("Rts-Cts"));
Have you tried this and does it work?
Because I would say that this code snipped you posted is just wrong.
The XX_EdcaTxopN and DcaTxop attributes of RegularWifiMac that you are setting with this code need a PointerValue pointing to a Queue objectThey are READ-ONLY attributes. - DcaTxop: The DcaTxop object
- Set with class: ns3::PointerValue
- Underlying type: ns3::Ptr< ns3::DcaTxop>
- Flags: read
- VO_EdcaTxopN: Queue that manages packets belonging to AC_VO access class
- Set with class: ns3::PointerValue
- Underlying type: ns3::Ptr< ns3::EdcaTxopN>
- Flags: read
- VI_EdcaTxopN: Queue that manages packets belonging to AC_VI access class
- Set with class: ns3::PointerValue
- Underlying type: ns3::Ptr< ns3::EdcaTxopN>
- Flags: read
- BE_EdcaTxopN: Queue that manages packets belonging to AC_BE access class
- Set with class: ns3::PointerValue
- Underlying type: ns3::Ptr< ns3::EdcaTxopN>
- Flags: read
- BK_EdcaTxopN: Queue that manages packets belonging to AC_BK access class
- Set with class: ns3::PointerValue
- Underlying type: ns3::Ptr< ns3::EdcaTxopN>
- Flags: read
uint32_t newMinCw = 100; m_dca->SetMinCw(newMinCw); // setting EdcaTxopN MinCw for the 4 queues m_edca.find (AC_VO)->second->SetMinCw(newMinCw); m_edca.find (AC_VI)->second->SetMinCw(newMinCw); m_edca.find (AC_BE)->second->SetMinCw(newMinCw); m_edca.find (AC_BK)->second->SetMinCw(newMinCw);
Good day Rediet:Sorry for my delayed response, below my comments, i took a little bit of time to save future questions and you saw that i´m doing my homework :) :
- I´ll try the the IdealWifiManager that selects the best MCS based on the fed back SNR over an ideal feedback channel (SnrTag).
wifi.SetRemoteStationManager ("ns3::IdealWifiManager","RtsCtsThreshold", UintegerValue (99999));
Config::SetDefault("ns3::WifiMacQueue::MaxPacketNumber", UintegerValue(5000));
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue(10000));
Config::SetDefault("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue(10000));sa
- Regarding activating the RTS/CTS protection you mention 3 aspects
- Can be activated by ErpProctectionMode or/and HtProtectionMode
- I dig in the WifiRemotestation manager and yes there are only two options as an enum
- That being said, therefore i, infer that i need to setup those aforementioned values to RTS_CTS since in the constructor the default value is:
.AddAttribute ("ErpProtectionMode",
- So i assuming you want me to do the following:
wifi.SetRemoteStationManager ("ns3::IdealWifiManager","RtsCtsThreshold", UintegerValue (99999), "ErpProtectionMode", StringValue("Rts-Cts"), "HtProtectionMode", StringValue("Rts-Cts"));
- Also you mention that the RegularWifiMac has the protection mode by default as CTs-toself deactivates so
- ¿Do i leave it deactivated so the aforementioned setup takes action or i activate it?
- Also digging i encountered these functions, should i enable them?, they seem to have relation with the items we have been discussing
Regarding the EDCA in the thread:
- https://groups.google.com/d/topic/ns-3-users/TZ6ZftgIkvU/discussion
- Konstantinos mention this are read-only values
//Modify EDCA configuration (TXOP limit) for AC_BE Ptr<NetDevice> dev = wifiApNodes.Get (1)->GetDevice (0); Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice> (dev); Ptr<WifiMac> wifi_mac = wifi_dev->GetMac (); PointerValue ptr; Ptr<EdcaTxopN> edca; wifi_mac->GetAttribute ("BE_EdcaTxopN", ptr); edca = ptr.Get<EdcaTxopN> (); edca->SetTxopLimit (MicroSeconds (3008));
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("OfdmRate6Mbps"), "ControlMode", StringValue ("OfdmRate6Mbps"), "RtsCtsThreshold", UintegerValue (0),"ProtectionMode",StringValue("Rts-Cts"));
Config::SetDefault ("ns3::WifiMacQueue::MaxPacketNumber", UintegerValue(5000));
Config::SetDefault ("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue(10000));
Config::SetDefault ("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue(10000));
AddAttribute ("ProtectionMode", "Protection mode used when non-ERP STAs are connected to an ERP AP: Rts-Cts or Cts-To-Self",EnumValue (WifiRemoteStationManager::CTS_TO_SELF),MakeEnumAccessor (&WifiRemoteStationManager::SetProtectionMode, &WifiRemoteStationManager::GetProtectionMode),MakeEnumChecker (WifiRemoteStationManager::RTS_CTS, "Rts-Cts",WifiRemoteStationManager::CTS_TO_SELF, "Cts-To-Self"))
WifiRemoteStationManager::SetUseNonErpProtection (bool enable)
WifiRemoteStationManager::SetHtSupported (bool enable)
wifiMac.SetType ("ns3::EESOA","CtsToSelfSupported", BooleanValue (true));
uint32_t newMinCw = 100;m_dca->SetMinCw(newMinCw);// setting EdcaTxopN MinCw for the 4 queues
m_edca.find (AC_VO)->second->SetMinCw(newMinCw);
m_edca.find (AC_VI)->second->SetMinCw(newMinCw);m_edca.find (AC_BE)->second->SetMinCw(newMinCw);m_edca.find (AC_BK)->second->SetMinCw(newMinCw);
Good day Rediet:I think the "recipe" is required to be break down in 2 parts
- The remote station manager
- Right now my setup is the shown below
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue ("OfdmRate6Mbps"), "ControlMode", StringValue ("OfdmRate6Mbps"), "RtsCtsThreshold", UintegerValue (0),"ProtectionMode",StringValue("Rts-Cts"));
Config::SetDefault ("ns3::WifiMacQueue::MaxPacketNumber", UintegerValue(5000));
Config::SetDefault ("ns3::WifiRemoteStationManager::MaxSsrc", UintegerValue(10000));
Config::SetDefault ("ns3::WifiRemoteStationManager::MaxSlrc", UintegerValue(10000));- Also the protections are no longer accessed at least in the new version of NS3 V 3.25 as shown below, the only protection mode is this
AddAttribute ("ProtectionMode", "Protection mode used when non-ERP STAs are connected to an ERP AP: Rts-Cts or Cts-To-Self",EnumValue (WifiRemoteStationManager::CTS_TO_SELF),MakeEnumAccessor (&WifiRemoteStationManager::SetProtectionMode, &WifiRemoteStationManager::GetProtectionMode),MakeEnumChecker (WifiRemoteStationManager::RTS_CTS, "Rts-Cts",WifiRemoteStationManager::CTS_TO_SELF, "Cts-To-Self"))- There is no longer the ErpProtectionMode or the HtProtectionMode, nevertheless they can be accessed via function call, regarless you said it only works if i´m going to use ERP or HT right which is not my case i think right?
WifiRemoteStationManager::SetUseNonErpProtection (bool enable)
WifiRemoteStationManager::SetHtSupported (bool enable)- I tried with the IdealWifiManager but i didn't see any improvement so i have 3 questions regarding the remote station manager is the following
- ¿Is the setup above optimal (for that constant manager) or i'm missing anything?
- ¿If the idealconstant manager is the best option, what is the setup i must put?
- At the end the remote station manager setup MUST be consistent with the MAC configuration right?
- Meaning if you use Rts-cts with remote station manager the same must be done in MAC
- The MAC
- A little bit of Context first
- my MAC class in inherits fro Adhoc Wifi MAC therefore is an ADHOC_STA
- The only setup i saw digging in hte Adhoc wific mac, regular mac and wifimac was this one
wifiMac.SetType ("ns3::EESOA","CtsToSelfSupported", BooleanValue (true));- And modify the Cwmin thorugh
uint32_t newMinCw = 100;m_dca->SetMinCw(newMinCw);// setting EdcaTxopN MinCw for the 4 queues
m_edca.find (AC_VO)->second->SetMinCw(newMinCw);
m_edca.find (AC_VI)->second->SetMinCw(newMinCw);m_edca.find (AC_BE)->second->SetMinCw(newMinCw);m_edca.find (AC_BK)->second->SetMinCw(newMinCw);- But it does not make sense to me that the remote station manager does not have a RTS-CTS protection and the make does meaning if hte remote station manager uses rts-cts so the mac and if it uses cts-to-self so the mac
So based on my setup (constant rate manager) what setup on the remote station manager and mac should be to have minimum of collisions?