[Click] Error in getting queue size
llong_li
llong_li at 163.com
Wed Jun 12 04:06:29 EDT 2013
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.
More information about the click
mailing list