Tor 0.4.9.1-alpha-dev
|
Conflux multipath core algorithms. More...
#include "core/or/or.h"
#include "core/or/circuit_st.h"
#include "core/or/sendme.h"
#include "core/or/relay.h"
#include "core/or/congestion_control_common.h"
#include "core/or/congestion_control_st.h"
#include "core/or/origin_circuit_st.h"
#include "core/or/circuitlist.h"
#include "core/or/circuituse.h"
#include "core/or/conflux.h"
#include "core/or/conflux_params.h"
#include "core/or/conflux_util.h"
#include "core/or/conflux_pool.h"
#include "core/or/conflux_st.h"
#include "core/or/conflux_cell.h"
#include "lib/time/compat_time.h"
#include "app/config/config.h"
Go to the source code of this file.
Macros | |
#define | TOR_CONFLUX_PRIVATE |
#define | USEC_PER_SEC 1000000 |
#define | CONFLUX_MIN_LINK_INCREMENT 31 |
Variables | |
static uint64_t | total_ooo_q_bytes = 0 |
Conflux multipath core algorithms.
Definition in file conflux.c.
#define USEC_PER_SEC 1000000 |
const congestion_control_t * circuit_ccontrol | ( | const circuit_t * | circ | ) |
Get the congestion control object for a conflux circuit.
Because conflux can only be negotiated with the last hop, we can use the last hop of the cpath to obtain the congestion control object for origin circuits. For non-origin circuits, we can use the circuit itself.
Definition at line 707 of file conflux.c.
Referenced by cfx_del_leg(), circuit_ready_to_send(), conflux_can_switch(), cwnd_available(), and cwnd_sendable().
|
inlinestatic |
Returns true if a circuit has package window space to send, and is not blocked locally.
Definition at line 206 of file conflux.c.
Referenced by conflux_decide_circ_lowrtt(), and conflux_decide_next_circ().
|
inlinestatic |
Returns true if we can switch to a new circuit, false otherwise.
This function assumes we're primarily switching between two circuits, the current and the prev. If we're using more than two circuits, we need to set cfx_drain_pct to 100.
Definition at line 356 of file conflux.c.
Referenced by conflux_decide_next_circ().
Favor the circuit with the lowest RTT that still has space in the congestion window up to the ratio of RTTs.
This algorithm should only use auxillary legs up to the point where their data arrives roughly the same time as the lowest RTT leg. It will not utilize the full cwnd of auxillary legs, except in slow start. Therefore, out-of-order queue bloat should be minimized to just the slow-start phase.
circuit_t * conflux_decide_circ_for_send | ( | conflux_t * | cfx, |
circuit_t * | orig_circ, | ||
uint8_t | relay_command | ||
) |
This function is called when we want to send a relay cell on a conflux, as well as when we want to compute available space in to package from streams.
It determines the circuit that relay command should be sent on, and sends a SWITCH cell if necessary.
It returns the circuit we should send on. If no circuits are ready to send, it returns NULL.
Definition at line 454 of file conflux.c.
Referenced by relay_send_command_from_edge_().
Return the circuit with the minimum RTT. Do not use any other circuit.
This algorithm will minimize RTT always, and will not provide any throughput benefit. We expect it to be useful for VoIP/UDP use cases. Because it only uses one circuit on a leg at a time, it can have more than one circuit per guard (ie: to find lower-latency middles for the path).
Returns the circuit that conflux would send on next, if conflux_decide_circ_for_send were called. This is used to compute available space in the package window.
Definition at line 606 of file conflux.c.
Referenced by conflux_can_send(), and conflux_decide_circ_for_send().
conflux_cell_t * conflux_dequeue_cell | ( | conflux_t * | cfx | ) |
Dequeue the top cell from our queue.
Returns the cell as a conflux_cell_t, or NULL if the queue is empty or has a hole.
uint64_t conflux_get_circ_bytes_allocation | ( | const circuit_t * | circ | ) |
conflux_leg_t * conflux_get_leg | ( | conflux_t * | cfx, |
const circuit_t * | circ | ||
) |
Return the leg for a circuit in a conflux set. Return NULL if not found.
Definition at line 115 of file conflux.c.
Referenced by cfx_del_leg(), conflux_note_cell_sent(), conflux_process_cell(), conflux_update_rtt(), and record_rtt_exit().
uint64_t conflux_get_max_seq_recv | ( | const conflux_t * | cfx | ) |
uint64_t conflux_get_max_seq_sent | ( | const conflux_t * | cfx | ) |
uint64_t conflux_get_total_bytes_allocation | ( | void | ) |
size_t conflux_handle_oom | ( | size_t | bytes_to_remove | ) |
|
inlinestatic |
Find the leg with lowest non-zero curr_rtt_usec, and pick it for our current leg.
Definition at line 549 of file conflux.c.
Referenced by conflux_decide_next_circ().
bool conflux_process_cell | ( | conflux_t * | cfx, |
circuit_t * | in_circ, | ||
crypt_path_t * | layer_hint, | ||
cell_t * | cell | ||
) |
Process an incoming relay cell for conflux. Called from connection_edge_process_relay_cell().
Returns true if the conflux system now has well-ordered cells to deliver to streams, false otherwise.
int conflux_process_switch_command | ( | circuit_t * | in_circ, |
crypt_path_t * | layer_hint, | ||
cell_t * | cell, | ||
relay_header_t * | rh | ||
) |
|
static |
bool conflux_should_multiplex | ( | int | relay_command | ) |
Determine if we should multiplex a specific relay command or not.
TODO: Version of this that is the set of forbidden commands on linked circuits
Definition at line 47 of file conflux.c.
Referenced by conflux_decide_circ_for_send(), conflux_note_cell_sent(), and relay_send_command_from_edge_().
|
inlinestatic |
Returns the amount of room in a cwnd on a circuit.
Definition at line 302 of file conflux.c.
Referenced by cwnd_sendable().
|
inlinestatic |