[erlang-questions] IP packet manipulation within Erlang

Geoff Cant nem@REDACTED
Fri Jan 8 00:32:31 CET 2010

Martti Kuparinen <martti.kuparinen@REDACTED> writes:

> Hi,
> How suitable is Erlang for a small project where I'd like to
> - grab all incoming IP packets
> - perform some IP header manipulation
> - send out the modified packets
> I'm aware I need some kind of bpf/pcap driver to get the packets into
> Erlang (or does Erlang now have something in this front).
> Do you guys have any idea how fast this whole thing would be compared
> to doing same in normal userland C program? Or even compared to doing
> the manipulation within Linux kernel.
> Martti

Hi there, I've been working on a project which sounds like it could be
suitable for the packet manipulation you want to do. Enet
(http://github.com/archaelus/enet) is a very early stage network stack
written in Erlang. The project also includes a port program that
connects to a TAP device to send and receive raw ethernet frames to and
from the host operating system.

The tap program I have has only been tested on OS X, but I suspect it
could work on Linux with small modifications.

Enet can currently handle arp/icmp/ip and some aspects of udp for en/decoding.

Geoff Cant

More information about the erlang-questions mailing list