acce4b333de469c687908f3a04381f2897d242e9Tinderbox UserCopyright (C) 2016, 2017 Internet Systems Consortium, Inc. ("ISC")
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark AndrewsThis Source Code Form is subject to the terms of the Mozilla Public
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark AndrewsLicense, v. 2.0. If a copy of the MPL was not distributed with this
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrewsfile, You can obtain one at http://mozilla.org/MPL/2.0/.
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark AndrewsSome systems (Linux, FreeBSD, OS X/macOS and Windows 10) support
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrewsthe TCP Fast Open (RFC 7413) mechanism in their recent versions.
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark AndrewsBIND 9 supports this on the server side.
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark AndrewsWhen the TCP_FASTOPEN socket option is defined after the listen()
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrewssystem call the socket code in the libisc set the option with
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrewsthe half of the listen backlog (so the fast open maximum queue length
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrewsis the half of the pending connection queue length).
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark AndrewsAny failure is logged and ignored.
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark AndrewsSystem specific notes:
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews - FreeBSD doesn't interpret the argument as a queue length but
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews only as an on/off switch.
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews
b351a5864727a390e06d787e522b141ca760590fMichał Kępień - Using TCP Fast Open on FreeBSD, as of versions 10.3 and 11.0, requires
b351a5864727a390e06d787e522b141ca760590fMichał Kępień compiling a custom kernel and setting the "net.inet.tcp.fastopen.enabled"
b351a5864727a390e06d787e522b141ca760590fMichał Kępień sysctl to 1.
b351a5864727a390e06d787e522b141ca760590fMichał Kępień
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews - Apple OS X/macOS allows only 0 or 1 so the code puts 1 for this system.
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews
7e89f3c9f83c3cac813a7295363217e869f8e249Francis Dupont - Windows 10 uses a 0/1 char flag? Note that TCP_FASTOPEN is defined
7e89f3c9f83c3cac813a7295363217e869f8e249Francis Dupont only in SDK 10.0.14393.0 or higher (Visual Studio 2015 requires
7e89f3c9f83c3cac813a7295363217e869f8e249Francis Dupont extra setting of the "Target Platform Version" in all project
7e89f3c9f83c3cac813a7295363217e869f8e249Francis Dupont properties).
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews - the only other system known to support this is Linux.
c5342425ea5568af04f4b87d5d9690453b21c9f1Mark Andrews