backoff counter freezes calculation is wrong at each node. Is this the correct of counting freezes at each node in my main function??

18 views
Skip to first unread message

Chandu

unread,
Mar 13, 2019, 1:09:48 AM3/13/19
to ns-3-users
In my work, i have written code to calculate the backoff counter freezes at each node. I have below function in channel-access-manager.cc in src/wifi/model folder.

uint16_t
ChannelAccessManager::GetNumberOfFreezes()
{
  return m_freezecounter;
}



I want to print out this m_freezecounter at each node from my main file but output is coming out totally wrong. In my main file i have below code to call this function at every node.


  for (int i=0; i < staNodes; i++)
  {
              freezes_count[i] = 0;
  }

  uint32_t sum =0;
  for (int i=0; i<staNodes; i++)
      {
         Ptr<Node> node = wifiStaNode.Get (i); // Get pointer to ith node in container
         Ptr<ChannelAccessManager> manager = node->GetObject<ChannelAccessManager> ();
         freezes_count[i]  = manager->GetNumberOfFreezes();
         std::cout << " Station Node: "<<i<<" freezes "<<freezes_count[i] << std::endl;
         sum += freezes_count[i];
      }


Something is wrong with the above code. I have been checking and trying to correct but but no luck till now. Please someone help me to solve this issue.

When i calculated freezes for 10 stations when maxpackets are 10 , output is like this: please check attached image(frrezes.png).
Output generated is not correct compared to the log files generated. From log files, for 10 stations --> the total number of freezes=7511
frrezes.png
Reply all
Reply to author
Forward
0 new messages