8000 Threading fixes, async test suites and TCP SACK receiver-side implementation by saminiir · Pull Request #14 · saminiir/level-ip · GitHub
[go: up one dir, main page]

Skip to content

Threading fixes, async test suites and TCP SACK receiver-side implementation - #14

Merged
saminiir merged 36 commits into
masterfrom
devel
Nov 14, 2017
Merged

saminiir merged 36 commits into
masterfrom
devel

Conversation

@saminiir
Copy link
Copy Markdown
Owner

This change set includes important robustness fixes:

  • Correct reference counting for tcp_linger (Fixes Race condition in tcp_linger #13)
  • Asynchronous test suites (speed increase and TSan reports)
  • TCP SACK receiver behaviour (significantly reduces waiting on TCP retransmissions)

Plus other minor fixes (see commit log).

We don't support fragmentation yet, so disable it.
This helps determining dropped packets with e.g. Wireshark output.

If misbehaving, lvl-ip log shows if it dropped the packet right after
it received it.
This probably lead to the race condition, where the linger timeout
fired AFTER the socket had already been freed.
This speeds up the test cycle a little bit, but more importantly
we now use just a single lvl-ip instance.

The aim here is to increase stress testing - if running multiple
suites simultaneously fail at some point, there's a creeping bug
in lvl-ip.
This helps pinpointing any errors, since debug mode
is more verbose.
Otherwise, the socket might not be deleted from the list by certain
routines?
It complained about using %hhu (unsigned char) for unsigned int.
We simply use socket->lock for the time being, as it makes
locking easier (with the perf penalty though.)
This causes a race condition and I can't be bothered to fix it now.
This is a bit confusing, since tsan reports a lock-order-inversion here.
The code still works OK.  Might be related to this issue?
google/sanitizers#814

It overall reduces racing errors by tsan,
since we now wait-lock before releasing the socket lock.

I could use the socket lock as the lock for pthread_cond_wait, but
it only accepts mutexes, and I think there could be some perf
improvements in using rwlocks.
There's a lock-order-inversion warning that might not be an actual
problem: google/sanitizers#814
I saw this with Wireshark - at times, there was a
"previously unseen segment" originating from me.

This is immediately a smell, since only lost/reordered packets
from the network should cause this.
This seems to make peers significantly more receptive
to our traffic, since it should now match the MSS they request.
Only with one sack. Next is to bring 0-4 sack blocks.
@saminiir
saminiir merged commit c1950ea into master Nov 14, 2017
@saminiir
saminiir deleted the devel branch November 14, 2017 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Race condition in tcp_linger

1 participant

0