[Click] wait() in click

Beyers Cronje bcronje at gmail.com
Thu Nov 23 11:33:49 EST 2006


On 11/23/06, Beyers Cronje <bcronje at gmail.com> wrote:
>
> Hi Omer,
>
> Click runs in a single thread, so you dont need to worry about threads.
> (unless you configure SMP click, but SMP click has its issues at the moment,
> in my opinion) Have a look at the ARP elements in click. Your point 5 is not
> required, use a classifier element to identify your response packet when it
> arrives and output it to your element.
>
> As a simple example the following click config:
>
> PollDevice(eth0) -> cc :: Classifier(<type i>, <response>, -);
>
> cc[0] -> YE :: YourElement;    // Receive type i packet
> cc[1] -> YE;  // Response to p_a
> cc[2] -> Discard;  // Push path for all other packets
>
> YE -> Queue -> ToDevice(eth0); // Push p_a to eth0
>
>
> Regards
>
> Beyers
>
> On 11/23/06, ﻯﻮﻠﻫﺩ ﺮﻤﻋ <omerbeg at gmail.com> wrote:
> >
> > Hi
> >
> > I am trying to create an element that has to wait for a response from a
> > remote host, something like an arp. Instead of giving a long description
> > of
> > the problem I can summarize the flow as being the following:
> >
> > ------------------------------------
> > 1. p_i = packet of type 'i' enters the element
> > 2. process_packet(p_i);
> > 3. p_a = new packet of type 'a' created
> > 4. output(n).push(p_a); //pushed to another element -> eventually to the
> > NIC
> > 5. wait(ms); // wait until a response to p_a arrives from destination
> > 6. process_packet(p_i);
> > 7. output(m).push(p_i);
> > -------------------------------------
> >
> > My question is: can I do it in a single thread ? or will I need a
> > separate
> > thread to implement 3 and 4 ? and how can I create these threads ?
> >
> > Sincerely
> >
> > -Omer
> > _______________________________________________
> > click mailing list
> > click at amsterdam.lcs.mit.edu
> > https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> >
>
>


More information about the click mailing list