I am working on a masters [paper][1] where I am trying to change the random waiting time for MAC wireless networks to a Period-controlled MAC for higher performance. There are a couple of existing c++ files that need alterations to change them from random to periodic. I have narrowed it down to the following function:
void BackoffTimer::start(int cw, int idle, double difs) { Scheduler &s = Scheduler::instance(); assert(busy_ == 0); busy_ = 1; paused_ = 0; stime = s.clock(); rtime = (Random::random() % cw) * mac->phymib_.getSlotTime(); #ifdef USE_SLOT_TIME ROUND_TIME(); #endif difs_wait = difs; if(idle == 0) paused_ = 1; else { assert(rtime + difs_wait >= 0.0); s.schedule(this, &intr, rtime + difs_wait); } } I would appreciate it if anyone could help me alter this method to change the random calculation to periodic. Thanks. I will explain the proposed protocol in terms of a simple scenario: consider 2 transmitting nodes experiencing a collision in a network; after they each have waited a random amount of time; say x and y, (implying they both have different backoff periods) if we imply periodic backoff from there on, their backoffs will be x+a, y+a which goes on and will never be equal; preventing them from ever colliding with each other again. Also, the period of the backoff is same for all the nodes in the network ('a' in the above example), and any change that has to be done with this 'a' period will also affect with all the nodes in the network. rtime in the program denotes the remaining time of backoff, cw denotes the contention window value and difs denotes the 802.11 dcf inter frame space Any advice or suggestion will be much appreciated.