Changing the values of CWmin and CWmax is not having an effect

144 views
Skip to first unread message

Fatma Marzouk

unread,
Sep 19, 2017, 10:59:56 AM9/19/17
to ns-3-users
Hi all,

Please, I am developing an application relay election in Vanet.

My approach consisted in electing the best relay with a receiver based method. That is, upon reception of a message by a leader vehicle each  member will compute  the distance that separates him from the sender of the message. Then compute the value   Cwmax eventually Cwmin to decide his contention window time: [Cwmin Cwmax]*Time slot.

I use tag 0 for this particular type of message to be relayed which stands for AC-BE in ns3 and the two bound of the CW interval are computed as follows:

int MaxCW1=(50*(1-((Prog_Distance)/(Range))))
int MinCW1= (7*(1-((Prog_Distance)/(Range))))
std
::cout <<  "The maximal contention window MaxCw for node " << GetNode()->GetId() << " is " << (MaxCW1)<<" at " << (Simulator::Now ().GetNanoSeconds())  <<std::endl;
std
::cout <<  "The minimal contention window MinCw for node " << GetNode()->GetId() << " is " << (MinCW1)<<" at " << (Simulator::Now ().GetNanoSeconds())  <<std::endl;


Config::Set("/NodeList/GetNode()->GetId()/DeviceList/0/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/BK_EdcaTxopN/MinCw", UintegerValue(MinCW1));
 
Config::Set("/NodeList/GetNode()->GetId()/DeviceList/0/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/BK_EdcaTxopN/MaxCw", UintegerValue(MaxCW1));


For now, I did not consider that when one nodes hears the same message that was already received discard sending, as I am first of all interested in seeing  the order of vehicle IDs sending the message and if it is in respect to the CWmax computed by this member.I also added the tracing at PHY layer so that each time the nodes sends a message it is notified.

I tried to see what simulation can give in the case of 3 nodes. I am supposed to have high probability of having the third node (the farest)relaying then the second. I know it is a mater of probability but I encountered that particular scenario where the trace logs states clearly the following:


A Message is received by the node:1from Node Sender:0at25503769245
The distance between the sender Node 0 and the receiver Node  1 is 33.8929at25503769245
The maximal contention window MaxCw for node 1 is 35 at 25503769245
The minimal contention window MinCw for node 1 is 5 at 25503769245
 A message is received by Node number 2at+25503769391.0ns
The distance between the sender Node 0 and the receiver Node  2 is 77.8727at25503769391
The maximal contention window MaxCw for node 2 is 17 at 25503769391
The minimal contention window MinCw for node 2 is 2 at 25503769391
 A message is received by Node number 3at+25503769488.0ns
The distance between the sender Node 0 and the receiver Node  3 is 106.931at25503769488
The maximal contention window MaxCw for node 3 is 5 at 25503769488
The minimal contention window MinCw for node 3 is 0 at 25503769488

 A DENM is reboradcasted by Node number 1at+51007538490.0ns
 A DENM is reboradcasted by Node number 2at+51007538782.0ns
 A DENM is reboradcasted by Node number 3at+51008974766.0ns


Seeing that logs about Cw window. Node 3 or less probably node 2 should relay but not node 1. I suspected it is because of the propagation delay and of the fact that node 3 received later. But I cheched and it received only 243ns after node 1 had received. But  the difference in the starting window is 5 *slot time = 5*9 micro seconds in ofdm if I am not mistaken.

It seems that although I change the contention window in the ns3 code it is not having any effect or that I am doing it wrongly

Any help please ?

Thank you in advance

Fatma

Fatma Marzouk

unread,
Sep 20, 2017, 7:16:32 AM9/20/17
to ns-3-users
Hello everyone,

I am still facing the issue.
I see that after changing the Cwmin and Cwmax for each node on run time and displaying by GetMaxCw()   and GetMinCw() I see that their values. However this change of values does not have any effect on the time of sending the AC BE message. I even tried to have deterministic timer for each node by setting Cwmin = Cwmax. However, it is still the same order of sending. Here is the logs in the case of 3 nodes.


A message is sent by node0at27484307591

A message is received by Node number 1at+27485331695.0ns
The distance between the sender Node 0 and the receiver Node  1 is 31.2241at27485331695
The maximal contention window MaxCw for node 1 is 46 at 27485331695
The minimal contention window MinCw for node 1 is 46 at 27485331695

A message is received by Node number 2at+27485331833.0ns
The distance between the sender Node 0 and the receiver Node  2 is 72.7294at27485331833
The maximal contention window MaxCw for node 2 is 40 at 27485331833
The minimal contention window MinCw for node 2 is 40 at 27485331833

 A DENM is reboradcasted by Node number 1at+54970663390.0ns
 A DENM is reboradcasted by Node number 2at+54970663666.0ns


Can someone please help solve know why ?

Thank you in advance

Fatma


Rediet

unread,
Sep 20, 2017, 9:11:04 AM9/20/17
to ns-3-users
Hello Fatma,

I didn't dig into the problem, but you're talking about changing the AC_BE CW parameters, but in the code snippet that you provided you're modifying the AC_BK. Is it the wrong snippet or is there a typo there?

Rediet

Fatma Marzouk

unread,
Sep 20, 2017, 9:22:09 AM9/20/17
to ns-3-...@googlegroups.com
Hello ,

Thank you for your answer.
sorry I copied the wrong code line.
In the code where I change these values and where I don't see any effect on sending times, it is AC_BE and I use qostag 0 for this AC.

--
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 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/XWkNgkOGJXk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Rediet

unread,
Sep 21, 2017, 3:11:02 AM9/21/17
to ns-3-users
Hello Fatma,

There seems to be a misunderstanding concerning how the initial BO is drawn. The standard says that it should be drawn between 0 and CW, with CW starting at CWmin and doubled upon failure up to CWmax (and not between CWmin and CWmax). Therefore, it's statistically possible that the drawn initial BO for node 1 be lower than than of node 2.
If you want to increase the chances (i.e. over a sufficient number of draws) for node 1 to have priority over node 2, lower the CWmin (while keeping the CWmax being roughly a 2^N multiple of that value). Btw, setting CWmin=CWmax will lead to repeated collisions in dense environments.

Rediet
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages