-
Notifications
You must be signed in to change notification settings - Fork 38
More reliable Tor experiments #78
Description
Hello,
I've been thinking about improving Shadow's reliability for small sized experimentation, so here are some insights. Let me just describe the issue first.
When sampling the consensus, the generate.py script takes the median relay of each bin for which the sorted list of relays has been put into them. This script applies this logic by relay class (i.e., guards, exits, guardexits and middles) and decides the number of the sampled relays by taking the same proportion for each relay class. This choice implies that the total bandwidth proportion of each relay class is not preserved, while this proportion has a huge impact over how vanilla Tor selects path because it is part of how the bandwidth-weights are computed (one of the last line of the consensus). If the proportion of total bandwidth between classes stays the same, then the bandwidth-weight would be identical for the scaled down consensus. This is what I suggest to fix.
You can see in the following image the divergence of the total bandwidth of each relay class from its expected value, for different scaled down network from a same consensus.
An interesting result of this experiment is that it does not necessarily get better as we increase the size of the sampling.
I think there are several possibilities to improve on the current sampling:
- Minimize the divergence between classes when sampling relays
- Apply a post-sampling correction on each relay's bandwidth such that the proportion gets right (that is, we tweak a bit the bandwidths).
- Both of the above
Also, I am inclined to believe that the sampling strategy should be linked to the type of experiment we intend to run. E.g., for location-aware path selection, we might want to ensure to keep relays from many locations. And this does not look trivial to me :)