fix: optimize ib size for 3 TCP round trips #218
+3
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During TCP's slow start phase, the congestion window (CWND) typically:
Starts with an initial congestion window (initcwnd) of 10 MSS (Maximum Segment Size)
Doubles after each round trip time (RTT)
With a standard MSS of 1460 bytes:
Total for 3 round trips: 14,600 + 29,200 + 58,400 = 102,200 bytes
However, we need to account for TCP/IP overhead:
This means each segment carries 1460 bytes of payload but requires 1500 bytes on the wire.
When accounting for this overhead and some implementation variations (like initial window sizes that might be slightly different in various TCP stacks), the practical optimal size for 3 round trips is approximately 98304 bytes (96KB).
This value represents a sweet spot that: