[Click] In-kernel FromHost

Mathias De Maré mathias.demare at ugent.be
Sat Feb 27 18:40:47 EST 2010


Hi,

I'm experiencing some issues with the 'FromHost' element in kernel mode. I'm
using Click git from the 10th of february, and kernel 2.6.19-2.
First of all, I wasn't able to use 'FromHost' in kernel mode at first, until
I noticed the following in elements/linuxmodule/fromhost.
cc:
ELEMENT_REQUIRES(AnyDevice linuxmodule false)
I removed the 'false' to be able to use the element(as I really need to
capture packets from Linux), but I'm guessing there might be a very good
reason why there's a 'false' in there.

I've created the following test setup to show my problems.
FromDevice(eth6)
    -> Print("fromdevice")
    -> Queue
    -> Unqueue
    -> ToHost

FromHost(fake0, 10.1.1.2/24)
    -> Print("fromhost")
    -> Queue
    -> ToDevice(eth6)

I'm trying to receive packets from 10.1.1.0/24 and send packets to
10.1.1.0/24 as well.

Running click-install and not changing anything in the routing tables gives
me the following if I wait a few seconds and then (from another computer)
visit a website hosted on the server running click:
chatter: fromhost:   90 | 33330000 00160001 02030405 86dd6000 00000024
00010000
chatter: fromhost:   78 | 3333ff03 04050001 02030405 86dd6000 00000018
3aff0000
chatter: fromhost:   70 | 33330000 00020001 02030405 86dd6000 00000010
3afffe80
chatter: fromhost:   70 | 33330000 00020001 02030405 86dd6000 00000010
3afffe80
chatter: fromhost:   90 | 33330000 00160001 02030405 86dd6000 00000024
0001fe80
chatter: fromhost:   70 | 33330000 00020001 02030405 86dd6000 00000010
3afffe80
chatter: fromdevice:   74 | 0015171b b3ae0015 171bb40a 08004500 003c26e1
40004006
chatter: fromdevice:   60 | 0015171b b3ae0015 171bb40a 08060001 08000604
00020015
chatter: fromdevice:   66 | 0015171b b3ae0015 171bb40a 08004500 003426e2
40004006
chatter: fromdevice:  376 | 0015171b b3ae0015 171bb40a 08004500 016a26e3
40004006
chatter: fromdevice:   66 | 0015171b b3ae0015 171bb40a 08004500 003426e4
40004006
chatter: fromdevice:   66 | 0015171b b3ae0015 171bb40a 08004500 003426e5
40004006
chatter: fromdevice:   74 | 0015171b b3ae0015 171bb40a 08004500 003c873f
40004006
chatter: fromdevice:   66 | 0015171b b3ae0015 171bb40a 08004500 00348740
40004006
chatter: fromdevice:  392 | 0015171b b3ae0015 171bb40a 08004500 017a8741
40004006
chatter: fromdevice:   66 | 0015171b b3ae0015 171bb40a 08004500 00348742
40004006
chatter: fromdevice:   66 | 0015171b b3ae0015 171bb40a 08004500 00348743
40004006

As you can see, first a few packets do get picked up by the 'fromhost'
element. This is before visiting the web page and is (according to tcpdump)
IPv6 traffic.
When I visit the website, you can see the packets sent from the other
computer, but the responses are not visible. The web page does load, and
tcpdump shows traffic in both directions.

So I figured the reason was because eth6 was still in the routing table
(eth2 is an interface for me to access the servers through ssh):
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
10.1.1.0        *               255.255.255.0   U     0      0        0 eth6
10.1.1.0        *               255.255.255.0   U     0      0        0
fake0
10.0.0.0        *               255.255.0.0     U     0      0        0 eth2
default         typhon.wall.tes 0.0.0.0         UG    0      0        0 eth2

I removed eth6 from the routing table and installed the clickfile again, and
I then got only the  HTTP request. There was no response from the server at
all (nothing on tcpdump). So at this point, both the entries for eth6 and
fake0 are absent.

I then added the fake0 entry again (but not the eth6 entry). Then, I saw the
request arriving at the server, and the server sending out ARP requests to
my client visiting the web page. That client returned an ARP response, but
I'm not seeing it on 'FromDevice(eth6)' (I think because the routing entry's
not there).

So I'm kinda stuck here, I'm afraid. Is there a way to fix this entirely?

Thanks,
Mathias De Maré


More information about the click mailing list