3 ms·
FreeBSD uses a pretty similar approach to what you've described: MSS and Windows Scale are each turned into 3-bit table entries, SACK gets one bit, and one bit
by toast0 7y ago
FreeBSD uses a pretty similar approach to what you've described:
MSS and Windows Scale are each turned into 3-bit table entries, SACK gets one bit, and one bit indicates which MAC secret was used; secrets are rotated every 15 seconds, two are kept, so client ACK needs to come in 15-30 seconds depending on where in the rotation cycle you are; 24-bits are used for the MAC. 15 second round trip covers the vast majority of internet connections.
Details nicely commented here: https://github.com/freebsd/freebsd/blob/master/sys/netinet/tcp_syncache.c#L1967 https://github.com/freebsd/freebsd/blob/master/sys/netinet/t...
- Majromax 7y agoPerfect, that's exactly the kind of thing I was looking for. Although I'm a little confused by the comment's description of the birthday attack -- it doesn't immediately seem useful to me for an attacker to find separate connections that generate the same cookie.
- toast0 7y agoI'm not a cryptographer, but as I understand it, the birthday attack says if you have a valid hash for one thing, you can generate more things, and get a collision in a surpisingly small number of iterations. In this context, it's easy to get a valid hash --- when the system is in syncookie mode, send a SYN from an address where you have visibility of the SYN+ACK responses. Then, you could use that cookie (sequence number) to spoof ACK packets with other sources, and they've estimated the number of packets you need to spoof before you'll have probably generated a connection. That number of packets is significantly fewer than when the syncache has not overflowed recently, and you need to have sent a SYN, and have an exact match of the sequence number.