[Click] Some packets emitted but not received across the wire

Kyriakos Zarifis kyr.zarifis at gmail.com
Wed Jan 9 23:33:49 EST 2013


Hi all,

I just recently started using Click (and I love it!)

For experimentation/practice, I am playing with a toy element that bounces
random packets to a port other than the one they are destined to, with a
10% chance.

I have this topology:

    s1
     |
    s0
  /     \
A       B

I send single pings from A to B. The expected behavior is to see most echo
replies/requests go only through s0, but 10% of the packets should be
bounced to s1, back to s0, and then to their destination.

The problem I am seeing is that this works _sometimes_, but most of the
times when a packet is bounced to s1, it disappears on its way back to s0.
This happens both in user and kernel space.
I can verify that the bounced packet seems to be leaving s1 both by tcpdump
(in userspace) and by IPPrints(in kernelspace), but then it never appears
on s0's interface (neither in tcpdumps nor in click Print logs).

When the bounce works, the tcpdumps/logs show it was bounced just fine, but
I get very few successful bounces (maybe 10%), while most in most cases the
bounced packet disappears on its way back.


I went through the list archives and saw a few people had some similar
problem where they couldn't emit packets to ToDevice if the same interface
had been initialized with FromDevice, and in some cases that was resolved
by using "METHOD LINUX". I tried that in user level but got the same
behavior. Also, in my case the packets disappear *most* of the time, but
not *always*, so I'm not sure if this is the same issue.


This has been troubling me all day, and most of all I'm confused by the
fact that it works sometimes, but I haven't been able to see a pattern,
other than maybe that the successful bounce rate seems to be a bit higher
right after the switch has been restarted (but I don't know how this can be
related so it's probably just my impression)

Any ideas would be very welcome, thanks.



A simplified version of s0.click looks something like this:

q0 :: Queue(10);
q1 :: Queue(10);
q2 :: Queue(10);
s :: LinearIPLookup(10.1.1.1/32 0,
10.1.1.2/32 1);
b0 :: Bouncer();   //outputs to b[0] with 90%, to b[1] with 10%
b1 :: Bouncer();
classifier1::Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -);
FromDevice(eth0, PROMISC true) -> [0]classifier1;
FromDevice(eth1, PROMISC true) -> [0]classifier1;
FromDevice(eth2, PROMISC true) -> [0]classifier1;
classifier[0]->Discard;
classifier[1]->Discard;
classifier[2]->Strip(14)->CheckIPHeader(INTERFACES 10.0.0.0/8)-
>IPPrint("in")->[0]s;
classifier1[3]->Discard;
s[0] -> Unstrip(14)->b0;
s[1] -> Unstrip(14)->b1;

b0[0]->q0;   //forward to h0 normally
b0[1]->q2;   //bounce to s1
b1[0]->q1;   //forward to h1
b0[1]->q2;   //bounce to s1

q0->ToDevice(eth0);
q1->ToDevice(eth1);
q2->IPPrint("bounced")->ToDevice(eth2);


and s1.click looks like this:

q0 :: Queue(100);
s :: LinearIPLookup(10.1.1.1/32 0,
10.1.1.2/32 0);
classifier1::Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -);
FromDevice(eth0, PROMISC true) -> [0]classifier;
classifier[0]->Discard;
classifier[1]->Discard;
classifier[2]->Strip(14)->CheckIPHeader(INTERFACES 10.0.0.0/8)-
>IPPrint("in")->[0]s;
classifier[3]->Discard;
s[0] -> Unstrip(14)->q1;

q1->IPPrint("out q1")->ToDevice(eth0);


Thanks!


More information about the click mailing list