Search code examples
c++creal-time

Realtime TCP/IP stack


I want to program (as efficiently as possible) a TCP/IP communication stack in C or C++. It really must run as fast as possible.

Does anyone have a good example or suggestion of where to start?


Solution

  • As Steve points out in the comments you do need quite a bit of experience to do this well. So rather than jumping directly to your end goal I recommend these possible steps:

    1. Write a reliable transport using UDP as a normal user-land protocol.
    2. Write a custom protocol using raw sockets in user-land.
    3. Write a kernel level protocol module/driver
    4. Write your stack on a FPGA network card

    Linux is a good option as the details you need are easily accessible and documented.

    And oh yeah, stop as soon as you realize you won't likely outperform the Linux kernel.