[Click] Error in getting queue size

llong_li llong_li at 163.com
Wed Jun 12 21:54:02 EDT 2013


Hi Eddie, 

Thanks for you response.
I print out the message in /proc/click/... such as queue length and packet bit rate. 
As a result, the queue length is about 25.
And the sum bit rate of the two input port  is somewhat equal to the bit rate of the 
output one; But I am wonder, why it is that.  In my point of view, the two input port 
will saturate the one output port? 
Is there something wrong with my opinion?




llong_li

From: Eddie Kohler
Date: 2013-06-12 21:18
To: llong_li
CC: click at pdos.csail.mit.edu
Subject: Re: [Click] Error in getting queue size
Hi,


The queue will only grow if the input rates are greater than the output CAPACITY. And this might not be the case; maybe iperf3 isn't generating traffic as fast as you think. Counter can tell you the actually observed input rates, as can Linux settings.


Eddie





On Wed, Jun 12, 2013 at 4:06 AM, llong_li <llong_li at 163.com> wrote:

Dear all:

I create a click element named AF to get the size of a queue element
In the implementation file, I override the simple_action method as follows:

Packet *
simple_action(Packet *p) {
       uint32_t _qlen = queue_size() ;
      //and something else just as in the EtherSwitch element.
}
where the method queue_size is defined as follows:
uint32_t
queue_size() const{
    if(_queue1){
         if(_queue1->size() != 0)
               click_chatter("_queue1->size: %d\n", _queue1->size());
          return _queue1->size();
    }
    else{
         int s = 0;
         for(int i = 0; i < _queues.size(); i++)
               s += _queues[i]->size();
         return s;
}

I have a similar initialization like the RED element to initialize the _queues/_queue1 .
And the configuration files is as follows:
switch :: EtherSwitch;
queue1 :: Queue
queue2 :: Queue
queue3 :: Queue
queue4 :: Queue
FromDevice(eth6, PROMISC true) -> [0]switch;
FromDevice(eth7, PROMISC true) -> [1]switch;
FromDevice(eth8, PROMISC true) -> [2]switch;
FromDevice(eth9, PROMISC true) -> [3]switch;

switch[0] -> AF -> queue1 -> ToDevice(eth6);
switch[1] -> AF -> queue2 -> ToDevice(eth7);
switch[2] -> AF -> queue3 -> ToDevice(eth8);
switch[3] -> AF -> queue4 -> ToDevice(eth9);


In my configuration, eth6~eth8 are connected to host 1, 2, 3, and 4
I start iperf test (UDP)  on my servers, host 1 and 3 as the client and host2 as the server, none on host4.
h1:   iperf3 -u -c h2 -b 1000m
h3:   iperf3 -u -c h2 -b 1000m  -p 5202.

The screen output that the queue size is 0, and sometimes 1.

In my opinion, the queue's input rate is 2x larger than the output rate, so the queue size should increase continuous, util the queue overflow. But the screen output is different.
Are there any wrong with configuration or implementation.

Thanks.
_______________________________________________
click mailing list
click at amsterdam.lcs.mit.edu
https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list