[Click] How do I do this?

Beyers Cronje bcronje at gmail.com
Wed Aug 1 18:03:14 EDT 2007


HI Adam,

Why not use IPClassifier element?

I.e. the following click config file will forward all UDP port 1234 packets
to your simulation code element, and your element will output it to
KernelTun element that delivers it to the tunnel interface:

FromDevice(eth0) -> Strip(14) -> MarkIPHeader -> IPClassifier(dst udp port
1234) -> YourSimulationElement -> KernelTun(1.0.0.1/8);

You might need to enable promiscuous mode in FromDevice if the destination
ethernet address is not eth0's address.

Alternatively, if you are looking at a true UDP server, you should use the
Socket element i.e.:

Socket(UDP, 10.1.1.1, 1234) -> YourSimulationElement -> KernelTun(1.0.0.1/8
);

Beyers



On 8/1/07, Adam M <click at irotas.net> wrote:
>
> Hi folks,
>
> I'd like to have Click running as a UDP server (in userspace) listening
> for packets from the physical network interface (eth0). Therefore, when
> eth0 receives a UDP packet destined for the correct port number, the
> packet gets delivered to Click.
>
> Once Click gets the packet, my network simulation code takes over. The
> simulation code implements protocols relating to wireless networking.
> Once the simulation is finished processing the packet, it delivers the
> packet to a virtual interface using TUN.
>
> The userspace applications are listening for packets from the virtual
> interface, and have no idea that Click is running between the physical
> interface and the virtual interface.
>
> Of course, this is clearly not efficient. However, it is simple and good
> enough for what I need to accomplish.
>
> I'm trying to figure out how to do this with Click. Do I need to write
> my own Element to act as a UDP server that delivers packets to a virtual
> interface? Are there some Elements I can use out of the box to make life
> easier?
>
> Thanks again,
> Adam
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list