Page MenuHomeFreeBSD

Handle ECN handshake in simultaneous open
ClosedPublic

Authored by rscheff on Jan 26 2020, 8:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 20, 4:54 PM
Unknown Object (File)
Jan 26 2024, 2:06 PM
Unknown Object (File)
Jan 26 2024, 2:06 PM
Unknown Object (File)
Jan 26 2024, 2:06 PM
Unknown Object (File)
Jan 26 2024, 2:06 PM
Unknown Object (File)
Jan 26 2024, 1:54 PM
Unknown Object (File)
Dec 27 2023, 3:45 AM
Unknown Object (File)
Dec 25 2023, 5:37 AM
Subscribers

Details

Summary

While addessing the simultaneous open TCP options, and then
testing this with ECN found that negotiation to fail.

As normally SYN,ACK processing is done in the syncache, adding
a special case for simultaneous open ECN handling.

Test Plan

extended the syn-rcvd-via-syn-sent-ipv4.pkt script to include ECN
handshake, as well as a data segment to validate that ECT0 marks
are sent.

--ip_version=ipv4
--tolerance_usecs=50000

// Ensure that all relevant sysctl variables have their default variables.
 0.00 `sysctl -w net.inet.tcp.rfc1323=1`
+0.00 `sysctl -w net.inet.tcp.sack.enable=1`
+0.00 `sysctl -w net.inet.tcp.ecn.enable=1`
+0.00 `sysctl -w net.inet.tcp.rexmit_slop=200`
+0.00 `sysctl -w net.inet.tcp.rexmit_drop_options=0`
+0.00 `sysctl -w kern.ipc.maxsockbuf=2097152`
// Flush host cache.
+0.00 `sysctl -w net.inet.tcp.hostcache.purgenow=1`
// Create a TCP endpoint in the SYN-RCVD state.
+0.00 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0.00 fcntl(3, F_GETFL) = 0x02 (flags O_RDWR)
+0.00 fcntl(3, F_SETFL, O_RDWR | O_NONBLOCK) = 0
+0.00 getsockopt(3, SOL_SOCKET, SO_RCVBUF, [65536], [4]) = 0
+0.00 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
+0.00 > SEW  0:0(0) win 65535 <mss 1460,nop,wscale 6,sackOK,TS val 100 ecr 0>
+0.10 < SEW  0:0(0) win 32767 <mss 1460>
+0.00 > SE. 0:0(0) ack 1 win 65535 <mss 1460>
// Verify that there are no errors pending at the socket layer.
+0.10 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
// Now it is in the SYN-RCVD state.
+0.00 %{ assert tcpi_state == TCPI_SYN_RECEIVED }%

+0.01 <[noecn] . 1:1(0) ack 1 win 65535
// Set Socket back to blocking state
+0.00 fcntl(3, F_SETFL, O_RDWR) = 0
//Verify that data segment is sent with ECT0
+0.00 write (3, ..., 10) = 10
+0.00 >[ect0] P. 1:11(10) ack 1
// Tear it down.
+0.00 close(3) = 0

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Note: BBR does not have ECN support currently.

  • update to include only ECN diff against master
This revision is now accepted and ready to land.May 21 2020, 1:55 PM

Approving as mentor, only a visual code read was done.

This revision was automatically updated to reflect the committed changes.