04b41a7af8b644f55439c7c6a987c057ec70f78b
[exim.git] / test / scripts / 1990-TCP-Fast-Open / 1990
1 # TCP Fast Open
2 #
3 # Linux:
4 # Both server and client-side TFO support must be enabled in the
5 # kernel, 'sudo sh -c "echo 3 > /proc/sys/net/ipv4/tcp_fastopen"'.
6 #
7 # A packet capture on the loopback interface will show the TFO
8 # option on the SYN, but the fast-output SMTP banner will not
9 # be seen unless you also deliberately emulate a long path:
10 # 'sudo tc qdisc add dev lo root netem delay 50ms'
11 # You'll need iproute-tc installed, for the tc command.
12 # You'll need kernel-modules-extra installed, or you get
13 # an unhelpful error from RTNETLINK.
14 # To tidy up:  'sudo tc qdisc delete dev lo root'
15 #
16 sudo perl
17 system ("tc qdisc add dev lo root netem delay 50ms");
18 ****
19 #
20 # First time runs will see a TFO request option only; subsequent
21 # ones should see the TFO cookie and fast-output SMTP banner
22 # (currently on a separate packet after the server SYN,ACK but before
23 # the client ACK).
24 #
25 # The client log => lint.ex  should have a "TFO" element.
26 # Assuming this is the first run since boot, the a@test recipient will not.
27 #
28 sudo perl
29 system ("ip tcp_metrics delete 127.0.0.1");
30 ****
31 #
32 # The server log <= line for b@test.ex  should have a "TFO" element, but
33 # this will only be obtained when the above delay is inserted into the
34 # loopback net path.
35 #
36 #
37 #
38 # FreeBSD: it looks like you have to compile a custom kernel, with
39 # 'options TCP_RFC7413' in the config.  Also set
40 # 'net.inet.tcp.fastopen.enabled=1' in /etc/sysctl.conf
41 # Untested.
42 #
43 exim -DSERVER=server -bd -oX PORT_D
44 ****
45 #
46 exim a@test.ex
47 Testing
48 ****
49 sleep 3
50 #
51 exim b@test.ex
52 Testing
53 ****
54 sleep 3
55 #
56 #
57 sudo perl
58 system ("tc qdisc delete dev lo root");
59 ****
60 #
61 killdaemon
62 no_msglog_check