tcpdump mailing list archives

Re: transmitting packets


From: Rick Jones <rick.jones2 () hp com>
Date: Fri, 31 Mar 2006 10:25:24 -0800

Jan Allman wrote:
Is it possible to send standard Ethernet packets at near Gigabit
throughput using UDP packets and libpcap?
Has anyone tried this before. I am wondering whether libpcap is a
more optimum approach to the standard Linux "sendto" function.

It could very well be, assuming you are willing to craft your own UDP headers, but it begs the question "Why?" Most CPU's these days (well, most "decent" CPUs :) can use send()/sendto() to generate traffic at gigabit speeds.

Between a pair of 2x1GHz Itanium2 systems running a 2.6.12 kernel:


loiter:/opt/netperf2_work# src/netperf -t UDP_STREAM -H 192.168.4.215 -c -C -- -m 1472 UDP UNIDIRECTIONAL SEND TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.4.215 (192.168.4.215) port 0 AF_INET
Socket  Message  Elapsed      Messages                   CPU      Service
Size    Size     Time         Okay Errors   Throughput   Util     Demand
bytes   bytes    secs            #      #   10^6bits/sec % SS     us/KB

135168    1472   10.00      812799      0      957.1     19.02    3.256
135168           10.00      812799             957.1     23.12    3.958

They weren't even breaking a sweat :)


What sort of problem are you looking to solve?

For just blasting frames onto the wire, there is the in-kernel pktgen stuff under linux.

sincerely,

rick jones
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.


Current thread: