[Click] About the arrival of packets

Beyers Cronje bcronje at gmail.com
Fri Feb 4 04:00:22 EST 2011


*Please always include list.*

Your app will have to read the value of the rate counter. Here's a simple
example:

Config:

FromDevice(eth0) -> cc::Counter -> Discard;

Then you can read the handler, i.e.:

cat /click/cc/rate



On Fri, Feb 4, 2011 at 3:52 AM, shule ney <neyshule at gmail.com> wrote:

> Hi,beyers:
> Thanks very very ... much beyers :D, I checked the document about the /proc
> and counter element, so how can I use this counter's "rate" to notify my
> user level program,  I mean is there any method that the "rate" can tell the
> user level program its value right now? Thanks very much to reply me.
>
> Best Regards
> eugene
>
> 2011/2/4 Beyers Cronje <bcronje at gmail.com>
>
> Hi,
>>
>> You typically use Click handlers for this. Click elements expose data to
>> users via handlers that can be accessed via /click filesystem if running
>> kernel Click, or ControlSocket
>> http://read.cs.ucla.edu/click/elements/controlsocket if running userlevel
>> Click.
>>
>> The click fs is similar to Linux's /proc system.
>>
>> For instance PollDevice exposes a count handler that returns the number of
>> packets PollDevice has received from the input card. You would probably
>> find
>> the Counter element http://read.cs.ucla.edu/click/elements/counter and
>> AverageCounter element
>> http://read.cs.ucla.edu/click/elements/averagecounter most
>> helpful. They expose handlers like rate, bit_rate etc.
>>
>> Obviously this means your userland apps need to monitor these handlers,
>> there is no notification push from Click.
>>
>> Beyers
>>
>> On Thu, Feb 3, 2011 at 10:39 PM, shule ney <neyshule at gmail.com> wrote:
>>
>> > Hi,all:
>> > Is there any mechanism that the kernel mode click can notify the
>> user-land
>> > if there are packets coming? Here what I want to implement is telling
>> the
>> > userland whether there are packets coming and the coming rate. Thanks
>> for
>> > your guys' help :D.
>> > _______________________________________________
>> > click mailing list
>> > click at amsterdam.lcs.mit.edu
>> > https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>> >
>> _______________________________________________
>> click mailing list
>> click at amsterdam.lcs.mit.edu
>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>
>
>


More information about the click mailing list