problem with scheduling

53 views
Skip to first unread message

Doaa Terri

unread,
Aug 18, 2015, 8:49:35 AM8/18/15
to ns-3-users

Hi all, 
I wanted to change the contention window of a specific node at specified time (ie: t=10s) , I tried the method mentioned here to change the value https://groups.google.com/d/msg/ns-3-users/TZ6ZftgIkvU/T_vSSIV6sIIJ
Then I try to wrap it in a method that I can schedule at t=10. However, what I have tried did not work, since I have checked that the cw attribute has not been changed from the config file. However, when I tried to do it without the scheduling, it works (the value has been changed). So it seems that the problem from the way I scheduled the method. any help please? 
void chaan( Ptr<Node> node, uint32_t minCw, uint32_t maxCw )
{

///// changing contention window
//uint32_t minCw = 1;
//uint32_t maxCw = minCw;


 //Ptr<Node> node = wifiStaNodes.Get(0);
 //Ptr<Node> node = wifiStaNodes.Get(0);

Ptr<NetDevice> dev = node->GetDevice(0);
Ptr<WifiNetDevice> wifi_dev = DynamicCast<WifiNetDevice>(dev);
Ptr<WifiMac> mac = wifi_dev->GetMac();
        PointerValue ptr;
mac->GetAttribute("DcaTxop", ptr);
        Ptr<DcaTxop> dca = ptr.Get<DcaTxop>();
dca->SetMinCw(minCw);
dca->SetMaxCw(maxCw);
//dca->SetAifsn(2);

Ptr<EdcaTxopN> edca;
mac->GetAttribute("VO_EdcaTxopN", ptr);
edca = ptr.Get<EdcaTxopN>();
edca->SetMinCw(minCw);
edca->SetMaxCw(maxCw);
//edca->SetAifsn(2);

mac->GetAttribute("VI_EdcaTxopN", ptr);
edca = ptr.Get<EdcaTxopN>();
edca->SetMinCw(minCw);
edca->SetMaxCw(maxCw);
//edca->SetAifsn(2);

mac->GetAttribute("BE_EdcaTxopN", ptr);
edca = ptr.Get<EdcaTxopN>();
edca->SetMinCw(minCw);
edca->SetMaxCw(maxCw);
//edca->SetAifsn(2);

mac->GetAttribute("BK_EdcaTxopN", ptr);
edca = ptr.Get<EdcaTxopN>();
edca->SetMinCw(minCw);
edca->SetMaxCw(maxCw);
//edca->SetAifsn(2)

Simulator::Schedule(Seconds(1.0), &chaan, node, minCw, maxCw); 



}


Simulator::Schedule(Seconds(10.0), &chaan, wifiStaNodes.Get(0), 2,2); 

Konstantinos

unread,
Aug 18, 2015, 9:32:45 AM8/18/15
to ns-3-users
Two questions:

a) Which config file you checked (and when) to see that the CW has not been changed? 
b) Why do you need to schedule the change every second?

Regards,
K.

Doaa Terri

unread,
Aug 18, 2015, 10:24:17 AM8/18/15
to ns-3-users
Hi Konstantinos!
Thank you for your reply!
a) I used config store (with save mode).  
b) I put it to have the schedualing

--
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/YJ8cGXxmv-U/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.

Konstantinos

unread,
Aug 18, 2015, 12:56:25 PM8/18/15
to ns-3-users
a) I am not 100% sure since I have not used it, but the config store will take only the initial values. It will not see the change in the CW at t=10s.
b) I do not understand. You call the same function every second without actually changing anything. That's just redundant. I mean, you only need to schedule it once at t=10s. No need to call Simulator::Schedule again within the function. 

You can easily verify that the CW has changed by enabling the logs and checking if the corresponding methods are called.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages