[Click] Multiple source

Eddie Kohler kohler at cs.ucla.edu
Mon Apr 5 12:45:41 EDT 2010


Close!

The rules differ for push and pull.

* A push output port must connect to exactly one push input port.
* A pull input port must connect to exactly one pull output port.

HOWEVER

* A push INPUT port must connect to AT LEAST one push output port.
* A pull OUTPUT port must connect to AT LEAST one pull input port.

So this is legal:

a :: FromDump; b :: FromDump; // agnostic, here: push outputs
q :: Queue;                   // push input, pull output
x :: Discard; y :: Discard;   // agnostic, here: pull inputs
a -> q -> x; b -> q -> y;     // q's inputs and outputs connected 2x

But this isn't:

a :: FromDump; b :: FromDump; // agnostic, here: pull outputs
uq :: Unqueue;                // pull input, push output
x :: Discard; y :: Discard;   // agnostic, here: push inputs
a -> uq -> x; b -> uq -> y;   // ERROR ERROR ERROR

The way to think about this is probably in terms of "active" and "passive" 
ports.  "Active" ports, which are subject to an element's decisions, are 
connected exactly once.  (E.g., push outputs: element must decide which output 
to push to; pull inputs: element must decide which input to pull from.) 
"Passive" ports, by which an element is acted upon, may be connected more than 
once.  (E.g., an element doesn't choose which push input port to accept 
packets from; this is a parameter to the push() call.)

Eddie


Ian Rose wrote:
> Note that multiple elements can output into a single input port of 
> another element.  In other words, this is legal, even though input 0 of 
> 'q' is being used by 2 elements.
> 
> FromDump(a.pcap) -> q::Queue -> Discard;
> FromDump(b.pcap) -> q;
> 
> I must admit this could be better advertised in the docs - it took me a 
> long time to realize that.  I even built a (useless) Mux element to do this!
> 
> Of course the opposite (1 output port going to >1 elements) is NOT legal.
> 
> - Ian
> 
> 
> Jimmy wrote:
>> Hi all,
>>
>> So Queue element can only have one input source and MixedQueue can
>> have two input ports, but the first input is FIFO, and the second
>> input is LIFO. TimeSortedSched element can merge multiple packet
>> streams by timestamp.
>>
>> Are there any elements that simply have the function of merging
>> multiple incoming source packet streams? I mean if there are five
>> RatedSource, each with different settings, how to merge these packet
>> streams into one single stream?
>>
>> Thanks.
>>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list