Question(s) for the programming gurus

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all.

I'm quite new to the concepts of the "traffic control" framework, and I've got a programming-related question. Hopefully someone has the answer...

Is it possible, either for the device driver itself or for a userspace program, to get information about how many packets are currently queued for a given network interface?

Let's describe it a little more in detail:

I have a network interface eth0 in my linux box. Now I apply traffic shaping to that interface, for example the outgoing traffic is shaped down to 1 MBit/s. There is an application that creates packets which are meant to be sent out via eth0, and the application creates its packets with a much higher rate than 1 MBit/s. This would result in the shaper enqueuing packets for eth0 and, sooner or later, in dropping some of the packets if the queue is full.

So I want to slow down the rate at which the application creates its packets. The easiest way would be to take a look at the "traffic control" queues for eth0 and check their current state. When the queue is filled up to a specified level, the application should stop creation of new packets until the queue has been emptied. (*)

So, is there any way for my application to check the state of the eth0-queues? Or is this possible for the driver of eth0 (as I'm in control of this driver, I could implement a way to pass the needed information down to the application if necessary)?

Next question: if I understood the concepts of the "traffic control" system correctly, one could add several queues to a single device. Is there any way to simply get the total amount of packets that are waiting in all attached queues? Or would I need to check each queue and sum up the values?

And last question: what kind of information can I get about the currently enqueued packets? Just the amount of packets that are enqueued, or only the amount of enqueued bytes, or both?

I'd appreciate any kind of help very much. Pointers to existing documentation welcome - I didn't find the answers in the docs I found, but maybe I just didn't search well enough (or in the wrong places)?

Thanks in advance.

Bye, Mike

(*) In other words: I want to have the effects of slowing down the traffic generation of my application without having to care about the actual implementation of the traffic shaping. In my special case this makes sense and would save me a lot of work.

_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux