Skip to content
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

Adaptive padding 20181218 rebased again #622

Closed

Conversation

Labels
None yet
Projects
None yet
3 participants
@asn-d6
Copy link
Member

@asn-d6 asn-d6 commented Dec 27, 2018

No description provided.

mikeperry-tor and others added 30 commits Dec 27, 2018
We need this for padding negotiation so that we can have later machine
revisions supercede earlier ones.
This is a good code review start point, to get an overview of the interfaces
and types used in circuit padding.
This helps us to determine if a middle node can pad to us or not.
These event callbacks allow circuit padding to decide when to attempt to
launch and negotiate new padding machines, and when to tear old ones down.
These callbacks allow the padding state machines to react to various types of
sent and received relay cells.
This implements all of the event handling, state machines, and padding
decisions for circuit padding.

I recommend reviewing this after you look at the call-in points into it from
the rest of Tor.
* Tighten and justify cutoff for approximation in GPD sampler.
* Use expm1(-xi log U) to evaluate U^{-xi} - 1 without precision loss.
* Use log1p(x) to evaluate log(1 + x) precisely even for x near 0.
* Avoid 0 by rejection sampling, not by choosing to return 0 instead.
  (This avoids the problematic 0 return from crypto_rand_double()
   into the log() without introducing distribution bias).
Hope is this will make it easier to test on the live tor network.

Does not need to be merged if we don't want to, but will come in handy
for researchers.
Note to self/others: don't merge this.
This project introduces the prob_distr.c subsystem which implements all the
probability distributions that WTF-PAD needs. It also adds unittests for all of
them.

Code and tests courtesy of Riastradh.

Co-authored-by: Taylor R Campbell <campbell+tor@mumble.net>
Also add some basic tests for sampling delays from the uniform distribution.
Tighten up integer-like type usage.
Tighten up integer type usage.
Tighten up type usage.
Fix a return type issue.
Fix a return type issue.
asn-d6 and others added 28 commits Dec 27, 2018
In binary80 arithmetic, the bins for the log-logistic distribution,
which has a very fat tail, were computed with a value that overshot
the bounds, leading to a NaN intermediate.

One defensive way to avoid this would be to change the cdf_* and sf_*
functions for distributions of bounded support -- like log-logistic,
which is supported only on (0, +\infty) -- to return -/+inf for
points outside the bounds.  But for testing purposes it might be
better not to work defensively like that because it might mask
upstream problems.
Test a couple shutdown conditions and wrapping coverage.
Squeeze some more coverage out of existing tests.
Reorganize TODO file for 0.3.6/0.3.7
Fix crash and double-free bugs found during testing. And some other bugs too.
Add wronghop tests and some additional negotiation coverage.
Be a little more ambitious with compat-breaking features. We should
try to do as many as possible for 0.3.6..
Reorder and group machine compat-breaking changes so we can look at all of
them as a unit.

We shouldn't break compatibility for research machines. So we must solidify
all of the machine behaviors ASAP.
This way we can remove a redundant function declaration.
No need to do rejection sampling in circuitpadding.c anymore, which was not
covered by tests.
Add test for closest hist bin.
Rest of tokens tests.
@coveralls
Copy link

@coveralls coveralls commented Dec 27, 2018

Pull Request Test Coverage Report for Build 3397

  • 942 of 986 (95.54%) changed or added relevant lines in 15 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+2.2%) to 63.295%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/feature/nodelist/routerlist.c 1 2 50.0%
src/core/or/circuituse.c 3 5 60.0%
src/core/or/connection_edge.c 0 2 0.0%
src/lib/math/prob_distr.c 209 211 99.05%
src/core/or/relay.c 5 11 45.45%
src/core/or/circuitbuild.c 2 13 15.38%
src/core/or/circuitpadding.c 707 727 97.25%
Files with Coverage Reduction New Missed Lines %
src/core/or/circuitbuild.c 2 42.31%
Totals Coverage Status
Change from base Build 3386: 2.2%
Covered Lines: 46368
Relevant Lines: 73257

💛 - Coveralls

@asn-d6 asn-d6 closed this Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment