Skip to content
Snippets Groups Projects
Commit bc8b01b6 authored by Tomasz Grabiec's avatar Tomasz Grabiec Committed by Avi Kivity
Browse files

net: keep SYN cache entry if expansion failed


Fixes #283.

When backlog is full upon receiving ACK, keep the entry in SYN
cache. The client will eventually retransmit unacknowledged data and
the connection state promotion will be retried at later time. Dropping
of SYN cache entries was causing connection resets on the client side.

The entry will be dropped when either of these occurs:
 * The connection is successfully ACK'ed
 * Invalid packet is received for that connection
 * SYN+ACK retransmission limit is exceeded
 * SYN cache hashmap bucket fills up - oldest entry is removed.

We could also implement yet another protection mechanism, as a next
step. We could drop SYN requests when we know the backlog is full, but
this patch makes the biggest difference. SYN-dropping might be needed
to avoid resets when the number of sudden connections is so large that
SYN cache buckets fill up. Assuming connection hashing is good, that's
quite a lot of connections - the hash map has 512 entries with buckets
of up to 30 elements.

Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
parent 83cc3feb
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment