[Click] external libs with kernel driver

Walter Cerroni walter.cerroni at unibo.it
Wed Jun 27 06:26:44 EDT 2012


Hi Joerg,

we had to deal with similar issues for one of our research projects: we had some custom elements that required ssl and math libraries (not available in kernel mode), whereas other elements needed kernel-level performance.

So we decided to run two click instances, one in kernel mode, the other in user space. At first, we tried to use handlers to make the two instances communicate, but this was sufficient only for very simple information exchange.

When things got more complicated, we decided to use a KernelTap element (http://read.cs.ucla.edu/click/elements/kerneltap): the user-level instance defines a virtual interface (e.g., tap0), whereas the kernel-level one sees it as an Ethernet interface and can use FromDevice/ToDevice elements to exchange packets with the user-level instance. Of course, this means that the user-level instance must be already running when installing the kernel-level one, otherwise the latter will complain for the missing tap0 interface.

The advantages of our approach are: (1) it works fine; (2) the interface is Ethernet standard, so when we decided to separate the two instances and run them on two different (virtual) machines, the operation was straightforward.

I guess this solution may cause a bottleneck in case all packets processed by the kernel need to be transferred to the user-level, so in this case it is probably better to have a single user-level instance. Our case was different, since all the performance-demanding tasks were assigned to kernel-level elements only and packet exchanges with the user-level instance happened at relatively low rate. Maybe someone else from the list who knows the Click internal architecture better than me can give you a better advice about performance bottleneck.

Hope this helps you.

Regards,


Walter


on 06/27/2012 10:20 AM Jörg Kaiser wrote:
> Hi everyone,
>
> I don't have much experience in linux programming but I wondered if it
> would make sense to split click up into a user level part and a kernel
> level part and let the both communicate through a netlink-socket. Or
> would that be a bottleneck? As I understand it the kernel level mode
> brings performance at cost of flexibility (not possible to use external
> libraries).
> Background: I tried to use the Botan crypto library but it will only
> work in unserlevel.
>
> I would be very pleased for a comment,
>
> cheers
>
> Joerg Kaiser
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


LA RICERCA C’È E SI VEDE:
5 per mille all'Università di Bologna - C.F.: 80007010376
http://www.unibo.it/5permille

Questa informativa è inserita in automatico dal sistema al fine esclusivo della realizzazione dei fini istituzionali dell’ente.



More information about the click mailing list