Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - sendmmsg to saturate 1 GBit link: (2 Items)
   
sendmmsg to saturate 1 GBit link  
Hi

I would like to saturate a 1 GBit/s link with data, which statically allocated in my program. So I know what to send and
 when. I can create according to the manual up to 1024 messages with sendmmsg. 

But I am out of buffers already when I send 20 messages (7003 bytes). Sending 10 messages at once works.

How can I debug this and where can I increase the  memory/buffers available for this operation? So that I can actually 
send the promised 1024 UDP messages at once?

Is my expectation correct that sendmmsg only returns once the DMA for this bunch of messages is done?

Kind Regards
 Thorsten

Re: sendmmsg to saturate 1 GBit link  
There's an interface send queue which is where the data is placed and sendmmsg() will return. Once that is full then 
sendmmsg() will return ENOBUFS. The driver will be reading from the other end of the interface send queue and setting up
 the DMA descriptors. You have no indication of when the packet is actually transmitted. This makes it very tricky to 
saturate an interface with UDP traffic - if you write too fast you get ENOBUFS and you are just wasting CPU that's 
probably needed to deal with transmitting, write too slowly and you aren't keeping the interface busy enough. TCP is a 
lot easier to saturate an interface in that there will be a TCP socket buffer that a blocking write() will not return 
from until there is space in that buffer.

Drivers can set their interface queue lengths, but most will default to 256 packets. I suspect you are also suffering 
from fragmentation increasing the number of packets, unless you have adjusted the interface MTU.