[Click] question about test-tun.click
Eddie Kohler
kohler at cs.ucla.edu
Fri Jul 9 10:04:35 EDT 2004
Hi Xavier,
Xavier Brouckaert wrote:
> Hi Eddie,
>
> There are magical things in click :-)
>
> I tried this :
>
> ICMPSendPings(1.0.0.3,1.0.0.1) -> IPPrint(in) -> Queue ->
> KernelTun(1.0.0.1/8) -> IPPrint(out) -> Discard
>
> Note that in my short click config, there is no ICMPPingResponder.
>
> When I launch it :
> gav at osiris:~/Coding/click-1.4.1/conf$ sudo click tun.click
> in: 1089363312.434501: 1.0.0.3 > 1.0.0.1: icmp: echo request (0, 1)
> out: 1089363312.434888: 1.0.0.1 > 1.0.0.3: icmp: echo reply (0, 1)
> in: 1089363313.434485: 1.0.0.3 > 1.0.0.1: icmp: echo request (0, 2)
> out: 1089363313.434796: 1.0.0.1 > 1.0.0.3: icmp: echo reply (0, 2)
> in: 1089363314.434493: 1.0.0.3 > 1.0.0.1: icmp: echo request (0, 3)
> out: 1089363314.434813: 1.0.0.1 > 1.0.0.3: icmp: echo reply (0, 3)
>
> There are Echo Replies ! So, they must be made by the kernel because I
> don't create them in click. I ping myself through tun0 and the kernel IP
> stack answers. Seems logical but is this expected behaviour ?
Yes. KernelTun lets you send packets to the kernel, and receive packets from
the kernel.
> So, I think that the exemple test-tun.click is misleading because
> IPFilter(..), ICMPPingResponder and IPPrint(tun-ping) are useless ! If
> they were useful, I would see tun-ping messsages.
> The author of test-tun.click thinks that Echo Requests go out of
> KernelTun and this is not true.
Um, not quite. The documentation says "should produce a stream of 'tun-ok'
printouts", not "'tun-ok' and 'tun-ping' printouts". The "tun-ping" lines are
there in case *you* run 'ping 1.0.0.2' from another window. That feature wasn't
documented though; here's what I've added.
// This configuration should work on FreeBSD, OpenBSD, and Linux. It should
// produce a stream of 'tun-ok' printouts if all goes well. On OpenBSD, you
// may need to run
// route add 1.0.0.0 -interface 1.0.0.1
// after starting the Click configuration. Also try running 'ping 1.0.0.2'
// (or any other host in 1.0.0.1/8) while the configuration is running.
// Click should respond to those pings. It'll also print out 'tun-ping'
// messages for each ping received.
Eddie
> If you agree with me, it would be great to change the online
> documentation accordingly.
>
> Xavier
More information about the click
mailing list