[Click] network load-balancer troubleshooting

Roman Chertov rchertov at cs.ucsb.edu
Tue Dec 7 20:56:34 EST 2010


On Tue, 07 Dec 2010 17:52:17 -0800 Sunjeet Singh <sstattla at gmail.com> wrote

> When I do a simple Click program-
> 
> FromDevice(eth4, PROMISC true) -> Print -> Discard;
> 
> it prints my regular traffic on eth4 but not the traffic that I am
> sending on eth4 using tcpreplay. Does FromDevice only capture packets
> that are destined to that interface and not packets that originate from
> that interface?

Yes.  FromDevice is used to capture only the incoming packets.  If you send
packets via tcpreplay on the same box that runs click, click will not see those
packets unless you use the FromHost element.

Roman

> 
> 
> Thanks,
> Sunjeet
> 
> 
> On 10-12-07 5:36 PM, Roman Chertov wrote:
> > On Tue, 07 Dec 2010 17:30:07 -0800 Sunjeet Singh<sstattla at gmail.com>  wrote
> >
> >>> You can do something like this.
> >>>
> >>> my_switch[0] ->   Print(1) ->   ...
> >>> my_switch[1] ->   Print(2) ->   ...
> >>> my_switch[2] ->   Print(3) ->   ...
> >>>
> >> This doesn't print the packets that I am sending to eth4. Are the
> >> packets getting discarded before they are reaching Click? Or are they
> >> returning a value that is not in the my_switch[0] to my_switch[2] range?
> > You can put a Print element like this to see what is going on.
> >
> > FromDevice(eth4, PROMISC true) ->  Print ->  my_switch;
> >
> >>> Also, you need to strip the original Ethernet header first.  Otherwise,
> >>> you
> >>> are
> >>> just encapsulating an Ethernet frame inside another Ethernet frame.  So
> >>> you
> >>> would want to place a Strip(14) after my_switch[x].
> >> I need to modify the MAC address fields (only) of the existing packets
> >> and send them. How should I go about doing that?
> > http://read.cs.ucla.edu/click/elements/storeetheraddress
> >
> > Roman
> >
> >>> My favorite debugging method is using a Tee.
> >>>
> >>> path ->   t :: Tee ->   ...
> >>>
> >>> t[1] ->   ToHostSniffers(ethX);
> >>>
> >>> and then you can just run tcpdump/wireshark to see what packets are on
> >>> the
> >>> path
> >>> (assuming you have Ethernet packets).
> >> I will look into this, thank you.
> >>
> >>
> >> Thanks for your help!
> >> Sunjeet
> >>
> >>
> >>> Roman
> >>>
> >>>
> >>> On Tue, 07 Dec 2010 14:38:28 -0800 Sunjeet Singh<sstattla at gmail.com>  
> >>> wrote
> >>>
> >>>> Can someone please help me troubleshoot?
> >>>>
> >>>> On Linux, I'm trying to configure a load-balancer that sits in front of
> >>>> a cluster, receives all packets destined to that cluster, calculates a
> >>>> hash of some fields of the packet using HashSwitch() to decide which
> >>>> worker machine in the cluster to send that packet to, and finally then
> >>>> forwards that packet to that worker machine by rewriting the MAC Address
> >>>> field of that packet.
> >>>>
> >>>> Here's what my click script looks like (currently testing with one
> >>>> frontend machine and one worker machine)-
> >>>>
> >>>> AddressInfo(mymac<IP add. of frontend/8>   <mac add of eth0>);
> >>>> AddressInfo(worker1<IP add. of worker1/8>   <mac add of worker eth0>);
> >>>> AddressInfo(worker2<IP add. of worker1/8>   <mac add of eth1>);
> >>>> AddressInfo(worker3<IP add. of worker1/8>   <mac add of eth2>);
> >>>>
> >>>> my_switch :: HashSwitch(26, 8);
> >>>>
> >>>> FromDevice(eth4, PROMISC true) ->   my_switch;
> >>>> todevice1 :: ToDevice(eth0);
> >>>> todevice2 :: ToDevice(eth1);
> >>>> todevice3 :: ToDevice(eth2);
> >>>>
> >>>> my_switch[0] ->   EtherEncap(0x0800, mymac, worker1) ->   Queue ->
> >>>> todevice1;
> >>>> my_switch[1] ->   EtherEncap(0x0800, mymac, worker2) ->   Queue ->
> >>>> todevice2;
> >>>> my_switch[2] ->   EtherEncap(0x0800, mymac, worker3) ->   Queue ->
> >>>> todevice3;
> >>>>
> >>>>
> >>>> When I run the script with the command "sudo click try.click", it starts
> >>>> executing and gives no messages. To test it,
> >>>> I used tcpdump to first see if any of the interfaces on worker1 is
> >>>> receiving any traffic ->   No.
> >>>> Then I checked if any traffic is going out of eth0, eth1 or eth2 on
> >>>> frontend ->   No.
> >>>> Checked if eth4 is receiving the packets I sent through tcpreplay ->  
> >>>> Yes.
> >>>>
> >>>> How can I go about debugging this? I will greatly appreciate any help in
> >>>> this regard.
> >>>>
> >>>> Thank you,
> >>>> Sunjeet Singh
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> 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
> >> _______________________________________________
> >> click mailing list
> >> click at amsterdam.lcs.mit.edu
> >> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> >




More information about the click mailing list