[Click] Create a packet to send some counts from a click router, what is the click way to do this?

Alastair McKinley amckinley03 at googlemail.com
Sun Dec 21 10:45:02 EST 2008


Hi everyone,

I'm writing a little network monitoring application and I would like to use
user level click to do so.

Basically the application needs to count certain types of packets over a
given time period and when that period expires send a packet out containing
the values of the counts, and then reset the counts.

I think I need to write my own element to count the packets, which will also
then write the values to a packet when it receives a packet on its second
interface, generated by a TimedSource.

The configuration I imagine would look something like this:

FromDevice -> Classifier[0] -> [0]CustomCounterElement;                   //
Count a few different types of packets inside the custom element
Classifier[1] -> Discard;

CustomCounterElement[0] -> Discard;    // Discard the original packets

TimedSource(5.00,000000000000000000000000000000) ->
[1]CustomCounterElement;   // Every 5 seconds send a 30 byte packet to the
custom element which writes it's packet counts which are then reset

CustomCountereElement[1] -> UDPIPEEncap() -> ToDevice;   // Encapsulate the
packet in a static UDP header and transmit


Does this seem like a reasonably sensible way to do this?
I wonder is the a better solution that reuses existing click elements that I
cannot think of?

Best regards and thanks,

Alastair


More information about the click mailing list