> ## Content Index
> Fetch the complete content index at: https://ostreff.info/llms.txt
> Use this file to discover other available public pages before exploring further.

# TCP Fast Open (TFO) on FreeBSD
- URL: https://ostreff.info/tcp-fast-open-tfo-on-freebsd/
- Published: 2021-01-27T18:41:52.000Z
- Updated: 2022-11-11T11:55:03.000Z
- Author: Jordan Ostreff
- Tags: FreeBSD, DNS

**[TCP Fast Open](https://en.wikipedia.org/wiki/TCP%5FFast%5FOpen?ref=ostreff.info)**[ (](https://en.wikipedia.org/wiki/TCP%5FFast%5FOpen?ref=ostreff.info)**[TFO](https://en.wikipedia.org/wiki/TCP%5FFast%5FOpen?ref=ostreff.info)**[) ](https://en.wikipedia.org/wiki/TCP%5FFast%5FOpen?ref=ostreff.info)is an extension to speed up the opening of successive [Transmission Control Protocol](https://en.wikipedia.org/wiki/Transmission%5FControl%5FProtocol?ref=ostreff.info) (TCP) connections between two endpoints. It works by using a *TFO cookie* (a TCP option), which is a [cryptographic](https://en.wikipedia.org/wiki/Cryptographic?ref=ostreff.info) cookie stored on the client and set upon the initial connection with the server.[\[1\]](https://en.wikipedia.org/wiki/TCP%5FFast%5FOpen?ref=ostreff.info#cite%5Fnote-lwn-1) When the client later reconnects, it sends the initial SYN packet along with the TFO cookie data to authenticate itself. If successful, the server may start sending data to the client even before the reception of the final ACK packet of the [three-way handshake](https://en.wikipedia.org/wiki/Three-way%5Fhandshake?ref=ostreff.info), skipping that way a round-trip delay and lowering the [latency](https://en.wikipedia.org/wiki/Latency%5F%28engineering%29?ref=ostreff.info) in the start of data transmission.

Put the following into /etc/sysctl.conf:

> net.inet.tcp.fastopen.server\_enable=1

and voala - the dns/unbound port compiled with "TFOCL" and "TFOSE" options on - now can be started and used without any warnings.

More how the TFO implementation on freebsd can be read on [https://people.freebsd.org/\~pkelsey/](https://people.freebsd.org/~pkelsey/TFO%5FDesign%5FDetails.pdf?ref=ostreff.info).

Same information was also attached bellow:

[TFO\_Design\_Details](https://wp-blog.ostreff.info/wp-content/uploads/2019/01/TFO%5FDesign%5FDetails.pdf?ref=ostreff.info)