-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
various improvements to the packet number generator #2905
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2905 +/- ##
==========================================
+ Coverage 86.22% 86.23% +0.01%
==========================================
Files 132 132
Lines 9141 9150 +9
==========================================
+ Hits 7881 7890 +9
Misses 910 910
Partials 350 350
Continue to review full report at Codecov.
|
6412545
to
431dff2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but two questions:
- Why isn't the optimistic ack attack an issue for long-lived connections? Sure, it requires more upfront investment from an attacker, but then they can still max out the server's connection "for free"?
- Using a mathematical PRNG seeded with cryptographic random means an attacker could (in principle) reconstruct the seed, and avoid the defense. Not an issue if we don't worry about long-lived connections.
It is, but we don't need a check every
Unfortunately, I don't have precise numbers here how many numbers you can receive from |
Fixes #398.
We skip packet numbers to defend against the Optimistic ACK attack.
crypto/rand.Read
. Instead, use amath/rand.Rand
, initialized with cryptographic random.A good way to think about this is by looking at the packet numbers skipped per max congestion windows (10000 packets). The current algorithm skips (on average) one PN in 500, which leads to 20 skipped packet numbers per cwnd (and therefore, per RTT). As a consequence, the ACK frames will have roughly 20 ACK ranges (assuming no packet loss). Clearly, this is a waste.