Skip to main content

Module padding

Module padding 

Source
Expand description

Channel padding

Tor spec padding-spec.txt section 2.

§Overview of channel padding control arrangements

  1. tor_chanmgr::mgr::map collates information about dormancy, netdir, and overall client configuration, to maintain a ChannelPaddingInstructions which is to be used for all relevant1 channels. This is distributed to channel frontends (Channels) by calling Channel::reparameterize.

  2. Circuit and channel get_or_launch methods all take a ChannelUsage. This is plumbed through the layers to AbstractChanMgr::get_or_launch, which passes it to the channel frontend via Channel::note_usage.

  3. The Channel collates this information, and maintains an idea of whether padding is relevant for this channel (PaddingControlState). For channels where it is relevant, it sends CtrlMsg::ConfigUpdate to the reactor.

  4. The reactor handles CtrlMsg::ConfigUpdate by reconfiguring is padding timer; and by sending PADDING_NEGOTIATE cell(s).


  1. A “relevant” channel is one which is not excluded by the rules about padding in padding-spec 2.2. Arti does not currently support acting as a relay, so all our channels are client-to-guard or client-to-directory. ↩

Re-exports§

use std::pin::Pin; 🔒
use web_time_compat::Duration; 🔒
use web_time_compat::Instant; 🔒
use educe::Educe; 🔒
use futures::FutureExt; 🔒
use futures::future; 🔒
use futures::future::FusedFuture; 🔒
use pin_project::pin_project; 🔒
use rand::distr::Distribution; 🔒
use tracing::error; 🔒
use tor_cell::chancell::msg::Padding; 🔒
use tor_cell::chancell::msg::PaddingNegotiate; 🔒
use tor_config::impl_standard_builder; 🔒
use tor_error::into_internal; 🔒
use tor_rtcompat::SleepProvider; 🔒
use tor_units::IntegerMilliseconds; 🔒

Structs§

PaddingTimerProj 🔒
Parameters
Timing parameters, as described in padding-spec.txt
ParametersBuilder
Builder for Parameters.
PreparedParameters 🔒
Timing parameters, “compiled” into a form which can be sampled more efficiently
Timer 🔒
Timer that organises wakeups when channel padding should be sent

Enums§

ParametersError
An error that occurred whil e constructing padding parameters.
SleepInstructions 🔒
Return value from prepare_to_sleep: instructions for what caller ought to do