hi everyone,
i'm looking for a way to transmit raw ethernet frames quickly over
ethernet on a machine running linux.
help in any form - pointers to code, papers, better groups/boards to
post on - would be greatly appreciated,
i'm interested in this, because i want to benchmark a user-space
firewall i wrote, and haven't been able to stress it so far.
on the receive path, i've been very impressed with the performance
boost from using mmap and polling that is implemented in phil wood's
pcap (
http://public.lanl.gov/cpw/), and it seems to me that something
similar should work on the transmit side.
i am willing to use a NIC dedicated to transmitting. i'd prefer a
pre-packaged solution, but am happy to try to implement ideas that
people might have. i'm fairly comfortable with C programming, less so
with kernel/driver hacking, but happy to try.
the best ideas i came across were in ncap (
http://luca.ntop.org/),
which has some nice ideas, but their kernel fails to boot (and there's
no source code).
i've experimented with libnet (
http://www.packetfactory.net/libnet/),
which essentially encapsulates sendto, but is limited to about 330,000
64-byte packets per second (~160 Mbps) on a 3 Ghz Pentium running Linux
2.6.16.14 with an e1000 GigE card on a 64 bit PCI-X 133 MHz bus.
i suspect something like a sendto call which takes a vector of packets
would speed things up quite a bit, but i can't figure out where sendto
is acually implemented, can anyone point me to source?
i've tried the tuning suggestions in
http://datatag.web.cern.ch/datatag/howto/tcp.html (basically, using
sysctl to allocate more buffer) but they didn't help very much.
cheers,
adnan
http://www.ece.utexas.edu/~adnan