سؤال

I read this question: https://stackoverflow.com/questions/20164788/how-to-assign-buffer-to-nodes-in-ns3-and-change-the-queue-length-of-each-node-or

My question is a bit more straightforward.

I have an application running with N nodes sending traffic with N * M BulkSendSApplication instances to a main node through a switch. This is working well.

I would like to simulate a buffer on the switch so if there is a burst, the packets that cannot be sent at the moment will be stored and sent later. Is there any example or any piece of code when I should start learning first?

I tried the tutorial which is excellent but did not see the relevant information so far. I also read some of the manual and documentation but did not see a simple buffer that could be installed like you would install other applications and net-devices (I see the buffer as an application).

Am I wrong in thinking the buffer should be an application?

Currently I am using a modified version of this example for the bridge which relies on BridgeHelper and a CsmaHelper to create the desired setup.

هل كانت مفيدة؟

المحلول

The CSMA devices used by the bridge to model the ports of the switch contain an outgoing queue. The defaut type of packet queue created by the CsmaHelper that is used to create the ports of your switch is a DropTailQueue.

i.e.:

CsmaHelper::CsmaHelper ()
{
  m_queueFactory.SetTypeId ("ns3::DropTailQueue");
  m_deviceFactory.SetTypeId ("ns3::CsmaNetDevice");
  m_channelFactory.SetTypeId ("ns3::CsmaChannel");
}

If you need to change this, you can call

CsmaHelper::SetQueue("ns3::RedQueue", 
                     "Mode", StringValue("QUEUE_MODE_BYTES"), 
                     "QueueLimit", StringValue("10MB"))
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top