If you are using the linux "brctl" bridge to bridge multiple ethernet devices, you can actually do this in click with an EtherSwitch element.
You can do something like switch :: EtherSwitch; FromDevice(eth0) -> [0] switch [0] -> ToDevice(eth0); FromDevice(eth1) -> [1] switch [1] -> ToDevice(eth1); FromDevice(eth2) -> [2] switch [2] -> ToDevice(eth2); FromHost(lbr) -> [3] switch [3] -> ToHost(lbr); If you then want to hook up click elements to the switch as well, you can do that too... something like define(CLICK_IP 1.2.3.4); define(CLICK_MAC 00:01:02:03:04:05); ar :: ARPResponder($CLICK_IP $CLICK_MAC); arpq :: ARPQuerier($CLICK_IP, $CLICK_MAC); ping_r :: ICMPPingResponder; switch [4] -> arp_cl :: Classifier(12/0800, 12/0806 20/0001, 12/0806 20/0002); arp_cl [0] -> CheckIPHeader(14) -> IPClassifier(proto icmp type echo dst $CLICK_IP) -> ping_r -> arpq -> [4] switch; arp_cl [1] -> ar; arp_cl [2] -> [1] arpq; I'm sure that there are typos in the above config... but the general idea should work. This is also a great way to play with click even if you have only one ethernet card. You can just drop the lines about eth1/eth2, and use ToHost(eth0)/FromHost(eth0). This will essentially not change your linux setup, but will add a click router between your linux machine and the network... You might need to recompile click with appropriate configure options to get the EtherSwitch element, I'm not sure. Cliff On Tue, Aug 4, 2009 at 11:19 AM, Lorenzo Bianconi < [email protected]> wrote: > Hi Roman, > > > I am actually using a configuration with FromHost/ToHost elements. However > I > have noticed that using FromDevice/ToDevice elements I can achieve higher > throughput and the cpu usage is much lower. Unfortunately I can not adopt > this solution due to the fact that the brctl bridge is unable to learn the > MAC address from Click and I am stuck with the FromHost/ToHost one. That is > why I was wondering if the 1.7.0 version of FromHost, which includes a > packet queue within the element, can improve the performance with respect > to > the 1.6.0 version of FromHost which has a single packet queue. > > Thanks > > Kinds regards > > Lorenzo > _______________________________________________ > click mailing list > [email protected] > https://amsterdam.lcs.mit.edu/mailman/listinfo/click > _______________________________________________ click mailing list [email protected] https://amsterdam.lcs.mit.edu/mailman/listinfo/click
