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)
Thu, Jan 23, 6:42 PM
Unknown Object (File)
Sun, Jan 12, 7:17 PM
Unknown Object (File)
Sat, Dec 28, 3:26 PM
Unknown Object (File)
Dec 24 2024, 4:18 AM
Unknown Object (File)
Dec 11 2024, 9:12 AM
Unknown Object (File)
Oct 25 2024, 4:30 PM
Unknown Object (File)
Oct 3 2024, 1:04 AM
Unknown Object (File)
Sep 18 2024, 4:03 PM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28931
Build 26921: arc lint + arc unit

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.