[Click] help with the Discard element

Beyers Cronje bcronje at gmail.com
Mon Feb 21 08:33:47 EST 2005


David,

There is a FromHost userlevel element, look in
<click>/elements/userlevel. As far as I know FromHost allocates the
tun device required by ToHost.

Regards

Beyers


On Sun, 20 Feb 2005 10:17:53 +0100, David Fusté
<f2308030 at est.fib.upc.edu> wrote:
> Ok Beyers,
> 
> If I choose option #1 (Disable routing on Linux and have Click do the
> routing/switching), I noticed to pass packets from device to linux I
> have to use the ToHost element with a tun/tap device:
> 
> TOHOST MAN PAGE:
>  > ToHost.u: Click element; sends packets to Linux via Universal TUN/TAP
> device.
>  > SYNOPSIS: ToHost([DEVNAME])
>  > DESCRIPTION:
>  > Hands packets to the ordinary Linux protocol stack. Expects packets
> with Ethernet headers.
>  > You should probably give Linux IP packets addressed to the local
> machine (including broadcasts), and a copy of each ARP reply.
>  > ToHost requires an initialized FromHost(n) with the same DEVNAME.
> 
> My another question is: why (like the last line says) does ToHost
> require an initialized FromHost(n) with the same DEVNAME?
> Yes, I know FromHost element installs a fake interface called DEVNAME,
> and changes the routing table so that every packet destined for
> ADDR/MASK is sent through that interface, but it isn't possible use a
> FromHost element because I'm in user level mode and FromHost element is
> only available in kernel mode! (don't read my first email, there is a
> mistake related to this)
> 
> Two thanks!
> David
> 
> 
> Beyers Cronje wrote:
> 
> >Hi David,
> >
> >Userlevel Click runs ontop of linux as a packet sniffer, in other
> >words the kernel still processes each packet. Each packet received
> >gets processed twice, once for linux, once for click.
> >
> >You have a couple of options
> >
> >1) Disable routing on Linux and have Click do the routing/switching
> >2) Use Click kernel module
> >
> >Beyers
> >
> >
> >On Sat, 19 Feb 2005 15:21:02 +0100, David Fusté
> ><f2308030 at est.fib.upc.edu> wrote:
> >
> >
> >>Hi,
> >>I'm novice in Click and I have simple questions. I'm working with click
> >>in user level mode.
> >>
> >>This is my config file:
> >>
> >>% cat prova.click
> >>FromDevice(wlan0)->Print(ok)->Discard;
> >>%
> >>
> >>When I run it, obviously, click starts to capture packets. Then, when I
> >>open the browser, click starts to print the packets.
> >>My first question is: why does the browser correctly load the web pages?
> >>i.e. why doesn't click discard the packets?
> >>And in relation to this, since click doesn't discard packets and it pass
> >>them to linux, what's the meaning of the ToHost(DEVNAME) element?
> >>
> >>And it isn't all, if I run this other config file:
> >>
> >>% cat prova2.click
> >>FromDevice(wlan0)->Print(ok)->ToHost(wlan0);
> >>% click prova2.click
> >>prova2.click:1: While initializing 'ToHost at 3 :: ToHost':
> >> ToHost(wlan0) requires an initialized FromHost with the same dev_name
> >>Router could not be initialized!
> >>%
> >>
> >>why does ToHost element need a FromHost element? I only want to capture
> >>packets from device to linux, not from linux to device.
> >>Moreover, there isn't a FromHost element in user level mode! Why does
> >>ToHost user level element want a FromHost kernel element? It isn't possible.
> >>
> >>I don't know where I am wrong. Help me please.
> >>Thank you!
> >>
> >>David
> >>_______________________________________________
> >>click mailing list
> >>click at amsterdam.lcs.mit.edu
> >>https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> >>
> >>
> >>
> 
>



More information about the click mailing list