The only way to send UDP packets in C is to use send/sendo/write/... calls.
The problem with those is, that for each packet I need to perform a new call from user-space.
Does anyone know whether there is a function which allows for something like
send_packets( int socket, const char* buffer, int packetSize )
Which does automatically split the data in the buffer into packets of size packetSize (e.g. 1472) and then send them as UDP packets?
Thanks
You can batch raw packets but not higher level protocols. The low-level API is for utilities like Wireshark.
On Linux you can modify the kernel to implement a sendmmsg() API similar to recvmmsg() but when I did it I only registered a performance loss due to how cumbersome the interface is actually to use.
The userbase of such an API is pretty limited as if you really want high performance simply move to InfiniBand or use the userspace socket API provided by Solarflare (OpenOnload) or Mellanox that depends upon their 10 GigE RDMA over Ethernet capable interfaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With