From: Pádraig Brady <P@xxxxxxxxxxxxxx>
To: Roy Rietveld <rwm_rietveld@xxxxxxxxxxx>
Subject: Re: TCP/IP send, sendfile, RAW
Date: Fri, 05 May 2006 10:09:49 +0100
Roy Rietveld wrote:
> Can somebody help me with this.
> I'am new to Linux normaly i do programming for RTOS.
> I would like to send ethernet packets with 1400 bytes payload.
> I wrote a small program witch sends a buffer of 1400 bytes in a
> endless loop.
> The problem is that a would like 100Mbits throughtput but when i check
> this with ethereal.
> I only get 40 MBits. I tried sending with an UDP socket and RAW
> socket. I also tried sendfile.
> The RAW socket gives the best result till now 50 MBits throughtput.
> Is there something faster then send or am i doing something wrong.
> I'm running kernel 2.6 on a ARM9 core at 177Mhz 32RAM 32Flash.
Is this the platform for both sender and receiver?
What you have to consider is processing required per packet.
At 50Mb/s you are getting for following number of packets per second:
$ echo "(50*10^6)/8/(12+8+14+20+8+1400+4)" | bc
I'm guessing that the receiver or sender is running out of CPU at this rate?
Also maybe this number of interrupts/s may be an issue on this platform?
You can check the interrupt rate easilty enough with:
cat /proc/interrupts; sleep 10; cat /proc/interrupts
Note by default ethereal (libpcap) will use 3 syscalls per packet
to copy and timestamp each packet. Have a look at PACKET_MMAP
to alleviate this.
At the interrupt level you could use NAPI or interrupt coalescing etc.
What driver are you using?