We do have two supported ways to send TCP frames from the FDK, both use our ExaSOCK TCP/IP library.
1) The first way is to use the FDK, libexanic and exasock "extensions" mode:
In this mode:
- You use exasock software to establish the initial TCP session. (using the usual "bind()" and "connect()" sockets operations)
- When you are ready to hand over to hardware, your software asks exasock for the next TCP/IP header using exasock_tcp_build_header() (see: https://exablaze.com/docs/exanic/user-guide/sockets/sockets/#tcp-acceleration)
- You then format your packet in software, set the length and calculate the header checksum (exasock_tcp_set_length() and exasock_tcp_calc_checksum())
- You can do the above step for many different payloads with the same sequence number.
- libexanic lets you preload these new frames into hardware (see https://exablaze.com/docs/exanic/user-guide/libexanic/libexanic/#transmit-preloading)
- when you are ready to transmit, you can trigger the frame from either software (libexanic) or from hardware (FDK)
- once the frame is sent, you need to update the TCP state. You do this by telling the TCP engine which frame was sent using exasock_tcp_send_advance().
- you can then go back to the start and prepare some new frames.
This may sound complicated, but it's easy to do and we have example code for you already that shows you how to do this:
- the example firmware is the exanic_trigger.fw example (see https://exablaze.com/docs/exanic/user-guide/fdk_v2/fdk_v2/#example-designs)
The above solution works fine if you can send 1 TCP frame, then wait ~700ns before sending the next one, but this is not always ideal. To resolve this, we have another method called ExaSOCK Accelerated Transmission Engine (ATE).
2) The second way is to use ExaSOCK ATE. This again uses exasock to connect and manage retransmissions, but it offloads part of the TCP state into the hardware so that frames can be generated in hardware back to back.
- When using exasock ATE, the hardware generates the TCP headers for you.
-Your logic simply needs to supply the payload and the checksum for your payload.
- We have example code and software for doing this, but this is not public (yet).
Exasock ATE is the fastest TCP tick to trade system available. Using ATE we achieve less than half the latency of the current fastest published devices (e.g. https://technologyevangelist.co/wp-content/uploads/2017/10/The-Ultimate-Trading-Machine-Infographic-v5.pdf) We are working with STAC to have this number published soon...
If you are interested in ATE, you need to run it on an ExaNIC V5P card. This is a largest and fastest card, and is the best device to use if you want to do high speed trading out of hardware.