Handling low latency packets using shared memory on Linux?

If I received UDP packets on Linux (and I didnโ€™t mind changing some source code), what would be the fastest way for my application to read packets?

I want to change the network stack so that after receiving the UDP packet, it is written to the shared memory and has access to this application memory?

Will there be any way for the stack to notify the application of the need to respond, rather than require the application to continuously poll the shared memory?

Any tips / additional resources are welcome - I just saw:

http://www.kegel.com/c10k.html

+4
source share
1 answer

If latency is a problem and the default UDP network stack does not work as you wish, try using different existing (installable) network stacks.

For example, try UDP Lite , compare with the standard UDP stack, this particular stack does not perform any checksum in the UDP datagram, thus reducing latency by providing a damaged datagram for the application layer.

Side note: you do not need to have a โ€œpollingโ€ mechanism. Read the select manual (and its possible derivative, for example pselect or ppoll ), with such an API, the kernel will โ€œwake upโ€ your application as soon as it has something to read or write in the pipeline.

0
source

Source: https://habr.com/ru/post/1469368/


All Articles