[Click] TCP NAT in click

Cezary Krzyżanowski cezary.krzyzanowski at put.poznan.pl
Wed Dec 10 13:51:58 EST 2008


Hello.

I'm in a middle of implementing a custom testbed using click. I'm forced
to use only userlevel drivers. Also I turn off sniffing mode in FromDev
effectively passing all the traffic straight to click without the host
Linux stack. After my processing I'm returning the packets to the host
Linux stack (via ToHost.u) for passing into userland applications.

The problem I've encountered is that TCP packets routed to the virtual
TUN device don't find their way into applications on this system.

I'm attaching a simple example of what is the problem. I'm using nc to
test connectivity. In UDP mode the packets get correctly sent to nc -u
-l -p 3000, while TCP packets don't. Also I'm sniffing both external and
virtual interfaces (I've tried both promiscuous and non-promiscuous
modes). The packets arrive correctly to the virtual TUN device.

I'd appreciate any help.

Cezary Krzyżanowski

-------------- next part --------------
AddressInfo(
	tst_if 192.168.200.13/24 11:22:33:44:55:66);
FromHost(tst, tst_if, ETHER tst_if:eth)
	-> Discard;
IPRewriterPatterns(
	local - - tst_if:ip -);
//rw :: IPRewriter(
//	pattern local 0 1);
rw :: TCPRewriter(
	pattern local 0 1)
FromDevice(eth1, SNIFFER no)
	-> ipc :: Classifier(
		12/0800,
		-)
	-> Strip(14)
	-> CheckIPHeader
	-> GetIPAddress(16)
	-> rw
	-> CheckIPHeader
	-> EnsureEther
	-> StoreData(OFFSET 0, DATA \<11, 22, 33, 44, 55, 66>)
	-> ToHost(tst);
rw[1] -> Discard;
ipc[1] -> Discard;



More information about the click mailing list