Roman Chertov | 4 Aug 19:39 2009
Picon

Re: FromHost Click v1.6

Lorenzo Bianconi wrote:
> Hi all,
> 
> I am using Click in kernel mode on a system with a three ethernet devices
> and I am trying to understand how is best way to connect the interfaces to
> the router core.
> In order to produce a portable code to other systems (with different number
> of ports),  I am using the Linux bridge utility to define just one interface
> in the Click configuration.
> More precisely I have defined a couple of FromHost/ToHost elements connected
> to the Linux bridge in order to receive/transmit packets from/to the the
> physical devices. Everything works fine but unfortunately
> I have obtained a lower throughput than the one I have achieved with three
> couples of FromDevice/ToDevice elements. I am using Click v1.6 and analysing
> the FromHost code in Click v1.7 I have noticed that in this version was
> added a queue to store incoming packets received from the Linux kernel.
> Is it possible that the FromHost packet managment in Click v1.6 is not very
> efficient (since it handles only one packet at a time) and defining a queue
> for the incoming packet I will obtain a higher throughput?

I doubt that this is the case.  The kernel has its own queue which feeds 
into FromDevice.  You can see the size of this queue by doing 'ifconfig 
<DEV> | grep txqueue'.  FromDevice was changed to avoid locking issues 
which started to appear in 2.6.24.7 kernel (you can search a discussion 
on the issue).  I highly suggest to grab the latest sources out of git 
as 1.7rc1 does not have all the bug fixes which were introduced later.

Roman

> 
(Continue reading)

Cliff Frey | 4 Aug 20:34 2009

Re: FromHost Click v1.6

If you are using the linux "brctl" bridge to bridge multiple ethernet
devices, you can actually do this in click with an EtherSwitch element.

You can do something like

switch :: EtherSwitch;
FromDevice(eth0) -> [0] switch [0] -> ToDevice(eth0);
FromDevice(eth1) -> [1] switch [1] -> ToDevice(eth1);
FromDevice(eth2) -> [2] switch [2] -> ToDevice(eth2);
FromHost(lbr) -> [3] switch [3] -> ToHost(lbr);

If you then want to hook up click elements to the switch as well, you can do
that too... something like

define(CLICK_IP 1.2.3.4);
define(CLICK_MAC 00:01:02:03:04:05);
ar :: ARPResponder($CLICK_IP $CLICK_MAC);
arpq :: ARPQuerier($CLICK_IP, $CLICK_MAC);
ping_r :: ICMPPingResponder;

switch [4]
-> arp_cl :: Classifier(12/0800, 12/0806 20/0001, 12/0806 20/0002);

arp_cl [0]
-> CheckIPHeader(14)
-> IPClassifier(proto icmp type echo dst $CLICK_IP)
-> ping_r
-> arpq
-> [4] switch;

(Continue reading)

david johnson | 5 Aug 01:41 2009
Picon

Problems with example access_point, station click code using Atheros

Hi again

Forgot to attach the sender and receiver code for this problem

I am trying to get the wifi access point and station code examples
in /conf/wifi working with madwifi 0.9.4 in monitor mode.

The only thing I changed in the code was
//-> prism2_decap :: Prism2Decap()
-> RadiotapDecap()
-> extra_decap :: ExtraDecap()

I can authenticate and associate - but I find that there is about 75%
packet loss when pinging between the client and the AP due to repeated
association requests arriving at the AP.

Any idea how to fix this problem?

Thanks
David

Attachment (access-point.click): text/x-csrc, 2351 bytes
Attachment (station.click): text/x-csrc, 3794 bytes
_______________________________________________
click mailing list
click <at> amsterdam.lcs.mit.edu
https://amsterdam.lcs.mit.edu/mailman/listinfo/click
(Continue reading)

david johnson | 7 Aug 14:15 2009
Picon

Accessing element handlers from within a click script

Hi

I've got the following example code in which I'm continuously scanning
for beacons and storing the results in bs.scan. I then want to send the
results of the scan to other nodes in the network when I get a certain
request message.

To do this I need to access the BeaconScanner handler "scan". I'm new to
click and maybe I'm breaking some fundamental rule in a click config
script but is it possible to pass an element handler as a parameter to
another element. 

I need to do it at this point in the code:
25   -> send_scan_results(### pass bs.scan handler to element ###)

Thanks
David

=========================================

  1 control :: ControlSocket("TCP", 7777);
  2 
  3 rates :: AvailableRates(DEFAULT 2 4 11 22);
  4 
  5 FromDevice(ath0, PROMISC true)
  6   -> RadiotapDecap()
  7   -> c1 :: Counter
  8   -> wifi_cl :: Classifier(0/00%0c, /mgt
  9       0/08%0c, /data);
 10 
(Continue reading)

Bart Braem | 7 Aug 14:34 2009
Picon

Re: Accessing element handlers from within a click script

Hi,

On 07 Aug 2009, at 14:15, david johnson wrote:

> 've got the following example code in which I'm continuously scanning
> for beacons and storing the results in bs.scan. I then want to send  
> the
> results of the scan to other nodes in the network when I get a certain
> request message.
>
> To do this I need to access the BeaconScanner handler "scan". I'm  
> new to
> click and maybe I'm breaking some fundamental rule in a click config
> script but is it possible to pass an element handler as a parameter to
> another element.

It will be easy to pass the whole BeaconScanner to your element and  
then call the public scan_string method.
Information on passing elements to element configurations and parsing  
them can be found in the tutorials on our website.

Regards,
Bart Braem
--

-- 
Bart Braem
PATS research group - IBBT
Dept. of Mathematics and Computer Sciences
University of Antwerp
Campus Middelheim, G3.27
Middelheimlaan 1
(Continue reading)

Beyers Cronje | 7 Aug 14:41 2009
Picon

Re: Accessing element handlers from within a click script

Hi David,

I presume you are developing the send_scan_results element, in which case
you can pass bs as a configuration argument to send_scan_results element. In
your element's configure function you can then use cp_va_parse's cpElement
argument to gain a pointer to the bs object, at which point you can call any
public methods exposed by BeacondScanner. Grep for cpElement in Click's
element directory for examples on how to use it.

I believe there are alternative methods as well, such as traversing
upstream/downstream element configurations during runtime. See
click/elements/standard/unqueue2.cc for an example.

Regards

Beyers Cronje

On Fri, Aug 7, 2009 at 2:15 PM, david johnson <david.lloyd.johnson <at> gmail.com
> wrote:

> Hi
>
> I've got the following example code in which I'm continuously scanning
> for beacons and storing the results in bs.scan. I then want to send the
> results of the scan to other nodes in the network when I get a certain
> request message.
>
> To do this I need to access the BeaconScanner handler "scan". I'm new to
> click and maybe I'm breaking some fundamental rule in a click config
> script but is it possible to pass an element handler as a parameter to
(Continue reading)

Eddie Kohler | 11 Aug 00:47 2009

Re: Accessing element handlers from within a click script

Hi David,

Bart, Beyers, and Peter had good feedback for you, but I wanted to point 
specifically at some elements that already pass handlers around.  Most of our 
current elements use HandlerCall objects for write handlers, not read 
handlers.  But you can find a couple that use read handlers.

* elements/analysis/aggregateipflows.* : The _filepos_h HandlerCall object is 
called to fetch the current packet's file position...

HandlerCall *_filepos_h; ...
String s = _filepos_h->call_read();

Also check out elements/standard/script.* and elements/userlevel/progressbar.* 
for examples of using Handler objects directly.  But probably the best thing 
is to look at the HandlerCall documentation Peter mentioned.

Eddie

david johnson wrote:
> Hi
> 
> I've got the following example code in which I'm continuously scanning
> for beacons and storing the results in bs.scan. I then want to send the
> results of the scan to other nodes in the network when I get a certain
> request message.
> 
> To do this I need to access the BeaconScanner handler "scan". I'm new to
> click and maybe I'm breaking some fundamental rule in a click config
> script but is it possible to pass an element handler as a parameter to
(Continue reading)

Eddie Kohler | 11 Aug 01:01 2009

Re: How to write to /proc in a click element

Hey Harald,

I'm not sure what you mean by "proper callback handlers".  The 
END_CALL/COUNT_CALL pattern is one type of callback, and Click supports *that* 
pretty well.  Are you looking for something where elements could register or 
unregister callbacks dynamically?

Eddie

Harald Schiƶberg wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Ashish Sharma wrote:
>> Hi,
>>
>> Can someone please advise me how to write something in /proc/sys in a click
>> event? I need to change the channel in MadWifi upon reception of a control
>> packet. I am planning on writing a sysctl handler in madwifi to change the
>> channel upon request, and I need to trigger it using Click. If someone has a
>> better suggestion to do this - I'll be glad to know!
>>
>> Thanks for your help and time.
> 
> Since there are no proper callback handlers in click
> ( hidden feature request ;-) ,
> that is my way of doing these things for userlevel click:
> 
> * Your element:
> click_chatter("CHANGE_PROC: yourstuff")
(Continue reading)

Nicholas Weaver | 21 Aug 18:03 2009
Picon

Stupid question/problem on SendTo

I've got a stupid configuration thats adding VLAN tags to a packet  
from a dummy interface and then sends it out:

(userlevel, linux)

A stripped down representation of the path in question:

FromHost(dummy, 10.3.128.2/16) -> TagVLAN(164) -> Queue ->  
ToDevice(eth1);

Of course, now I have a problem with MTU packets on FromHost:

1496 byte (total size) ICMP packets work no problem...

1500 byte (MTU) ICMP packets don't get sent, with a:
ToDevice(eth1) send: Message too long

error.

How do I convince ToDevice to send a full frame ethernet packet with a  
VLAN tag?

Thanks.
Cliff Frey | 25 Aug 22:08 2009

Re: Building a packet reflector in click

I suspect the problem is that IPMirror does not set the dst_ip_anno
annotation, which is what ARPQuerier uses.

If you add a GetIPAddress(IP dst) after the IPMirror, you might have better
luck.... but I'm not positive if that'll be enough.  It is hard to know as I
don't know what your exact device configuration (ip, subnet, gateway, etc)
is.

I'd add ARPPrint elements after c[1] and arpq[1] to see what ARP traffic you
are generating/receiving.

Cliff;

On Tue, Aug 25, 2009 at 12:57 PM, david johnson <
david.lloyd.johnson <at> gmail.com> wrote:

> Hi
>
> I presented a course on click today - used a lot of material from
> University of Antwerp - thanks Bart and Michael. I thought up some
> tutorials for them to practice their concepts and I thought building a
> packet reflector would be easy - until I tried to solve it
>
> I tried something like this:
>
> define($DEV ath0)
>
> FromDevice($DEV)
>  -> c :: Classifier(12/0800, 12/0806 20/0002)
>  -> CheckIPHeader(14)
(Continue reading)


Gmane