All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Renzmann <mrenzmann@otaku42.de>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Question(s) for the programming gurus
Date: Thu, 29 Jan 2004 10:23:39 +0000	[thread overview]
Message-ID: <4018DF2B.5060202@otaku42.de> (raw)
In-Reply-To: <40184E85.6000807@otaku42.de>

Hi Lars.

First of all, thanks for your fast reply.

Lars Landmark wrote:
>>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?
> Yes, if a small extension to the scheduler in question is carried out.
> You may add a variable counting packets in the enqueue () and dequeue(),
> and either write this to the /proc file system or poll the result with the
> help from tc.  Look at sch_fifo.c, it counts packets in the queue. But it
> does not report it any further.

Hmm... just to get it right: if I modify the source of any scheduler, 
there is no need to recompile the kernel, as the schedulers are 
"encapsulated" completely as loadable kernel modules? Because that is a 
important criterion for my decision, I want to (better: have to) avoid 
to recompile the kernel at any costs.

>>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?
>  Using class based queuing you may isolate each queue from each other and
> count packets each queue holds.  On the other hand, if you want the total
> amount of queued packets, then a global variable would help you.

As far as I understood the concepts of the tc framework, each interface 
has a queuing discipline attached. Optionally, this discipline may have 
several filters and classes. Filters decide which packet belongs to 
which class, and each class may optionally have other qdiscs attached to 
it. Is this understanding correct?

If so, then in the following situation...

                                    +----[client1]
                                    |
(Internet)---eth0--[router]--eth1--+----[client2]
                                    |
                                    +----[client3]

... I'd choose a discipline that implements classes. At least one class 
per client with one qdisc attached to each class would be necessary to 
allow bandwidth shaping for traffic that passes the router on its way 
from the clients to the Internet. Right?

In this case I need to modify the "root discipline" in order to 
implement a "per class" counter, so that I can see if the queue for a 
client fills up.


While thinking about the above, another idea came to my mind. Maybe 
there is a way to avoid to modify every scheduler that might become 
interesting for the described task. Wouldn't it be more reasonable to 
write my own dummy qdisc handler that just implements the very basic 
functions needed to attach another qdisc to it? In this case, the dummy 
only needed to have the functions enqueue() and dequeue() which keep the 
counter up-to-date. Of course one counter per class would be necessary 
in the above described scenario, but that shouldn't be much harder than 
having a global counter. That could be thought to be a "statistic qdisc" 
which also could be used for simple accounting purposes... hmm, do you 
think that this could work? If so, I'd like to try that one.

Bye, Mike

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

  parent reply	other threads:[~2004-01-29 10:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-29  0:06 [LARTC] Question(s) for the programming gurus Michael Renzmann
2004-01-29  8:43 ` Lars Landmark
2004-01-29 10:23 ` Michael Renzmann [this message]
2004-01-29 13:12 ` Lars Landmark
2004-01-29 18:07 ` Michael Renzmann
2004-01-30 10:44 ` Lars Landmark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4018DF2B.5060202@otaku42.de \
    --to=mrenzmann@otaku42.de \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.