]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Remove two conflux algs: maxrate and cwndrate.
authorMike Perry <mikeperry-git@torproject.org>
Mon, 8 May 2023 14:44:38 +0000 (14:44 +0000)
committerMike Perry <mikeperry-git@torproject.org>
Wed, 10 May 2023 17:49:51 +0000 (17:49 +0000)
Maxrate had slower throughput than lowrtt in Shadow, which is not too
surprising. We just wanted to test it.

src/core/or/conflux.c
src/core/or/conflux_st.h

index e9a66b83e1a34251a555c892bee16373b82f537c..e2e9460c06c3bbcd1cecd9118d0baaf05b874a0b 100644 (file)
@@ -438,133 +438,6 @@ conflux_decide_circ_cwndrtt(const conflux_t *cfx)
   return leg->circ;
 }
 
-/**
- * Favor the circuit with the highest send rate.
- *
- * Only spill over to other circuits if they are still in slow start.
- * In steady-state, we only use the max throughput circuit.
- */
-static const circuit_t *
-conflux_decide_circ_maxrate(const conflux_t *cfx)
-{
-  uint64_t max_rate = 0;
-  const conflux_leg_t *leg = NULL;
-
-  /* Find the highest bandwidth leg */
-  CONFLUX_FOR_EACH_LEG_BEGIN(cfx, l) {
-    uint64_t rate;
-    const congestion_control_t *cc = circuit_ccontrol(l->circ);
-
-    rate = CELL_MAX_NETWORK_SIZE*USEC_PER_SEC *
-           cc->cwnd / l->circ_rtts_usec;
-    if (rate > max_rate) {
-      max_rate = rate;
-      leg = l;
-    }
-  } CONFLUX_FOR_EACH_LEG_END(l);
-
-  /* If the package window is has room, use it */
-  if (leg && circuit_ready_to_send(leg->circ)) {
-    return leg->circ;
-  }
-
-  leg = NULL;
-  max_rate = 0;
-
-  /* Find the circuit with the max rate where in_slow_start == 1: */
-  CONFLUX_FOR_EACH_LEG_BEGIN(cfx, l) {
-    uint64_t rate;
-    /* Ignore circuits with no room in the package window */
-    if (!circuit_ready_to_send(l->circ)) {
-      continue;
-    }
-
-    const congestion_control_t *cc = circuit_ccontrol(l->circ);
-
-    rate = CELL_MAX_NETWORK_SIZE*USEC_PER_SEC *
-                 cc->cwnd / l->circ_rtts_usec;
-
-    if (rate > max_rate && cc->in_slow_start) {
-      max_rate = rate;
-      leg = l;
-    }
-  } CONFLUX_FOR_EACH_LEG_END(l);
-
-  /* If no sendable leg was found, don't send on any circuit. */
-  if (!leg) {
-    return NULL;
-  }
-  return leg->circ;
-}
-
-/**
- * Favor the circuit with the highest send rate that still has space
- * in the congestion window, but when it is full, pick the next
- * highest.
- */
-static const circuit_t *
-conflux_decide_circ_highrate(const conflux_t *cfx)
-{
-  uint64_t max_rate = 0;
-  uint64_t primary_leg_rtt = 0;
-  const conflux_leg_t *leg = NULL;
-
-  /* Find the highest bandwidth leg */
-  CONFLUX_FOR_EACH_LEG_BEGIN(cfx, l) {
-    uint64_t rate;
-    const congestion_control_t *cc = circuit_ccontrol(l->circ);
-
-    rate = CELL_MAX_NETWORK_SIZE*USEC_PER_SEC *
-              cc->cwnd / l->circ_rtts_usec;
-
-    if (rate > max_rate) {
-      max_rate = rate;
-      primary_leg_rtt = l->circ_rtts_usec;
-      leg = l;
-    }
-  } CONFLUX_FOR_EACH_LEG_END(l);
-
-  /* If the package window is has room, use it */
-  if (leg && circuit_ready_to_send(leg->circ)) {
-    return leg->circ;
-  }
-
-  /* Reset the max rate to find a new max */
-  max_rate = 0;
-  leg = NULL;
-
-  /* For any given leg, it has primary_leg_rtt/2 time before the 'primary'
-   * leg's acks start arriving. So, the amount of data a 'secondary'
-   * leg can send while the primary leg transmits these acks is:
-   *   (cwnd_leg/(secondary_rtt/2))*primary_rtt/2
-   *     = cwnd_leg*primary_rtt/secondary_rtt.
-   * So any leg with available room below that that is no good.
-   */
-  CONFLUX_FOR_EACH_LEG_BEGIN(cfx, l) {
-    if (!circuit_ready_to_send(l->circ)) {
-      continue;
-    }
-    const congestion_control_t *cc = circuit_ccontrol(l->circ);
-
-    uint64_t rate = CELL_MAX_NETWORK_SIZE*USEC_PER_SEC *
-                    cc->cwnd / l->circ_rtts_usec;
-
-    /* Pick the leg with the highest rate that still has room */
-    if (rate > max_rate &&
-        cwnd_sendable(l->circ, primary_leg_rtt, l->circ_rtts_usec) <=
-        cwnd_available(l->circ)) {
-      leg = l;
-      max_rate = rate;
-    }
-  } CONFLUX_FOR_EACH_LEG_END(l);
-
-  /* If no sendable leg was found, don't send on any circuit. */
-  if (!leg) {
-    return NULL;
-  }
-  return leg->circ;
-}
-
 /**
  * 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
@@ -736,10 +609,6 @@ conflux_decide_next_circ(conflux_t *cfx)
       return (circuit_t*)conflux_decide_circ_lowrtt(cfx);
     case CONFLUX_ALG_CWNDRTT: // throughput (low oooq)
       return (circuit_t*)conflux_decide_circ_cwndrtt(cfx);
-    case CONFLUX_ALG_MAXRATE: // perf test (likely high ooq)
-      return (circuit_t*)conflux_decide_circ_maxrate(cfx);
-    case CONFLUX_ALG_HIGHRATE: // perf test (likely high ooq)
-      return (circuit_t*)conflux_decide_circ_highrate(cfx);
     default:
       return NULL;
   }
index dae4845cb6893baa98ef4cea5382cca7111c47b9..af2e4db7b84a820e117a1e2778bbcfefadb01e9b 100644 (file)
@@ -20,8 +20,6 @@ typedef enum {
  CONFLUX_ALG_MINRTT = 0,
  CONFLUX_ALG_LOWRTT = 1,
  CONFLUX_ALG_CWNDRTT = 2,
- CONFLUX_ALG_MAXRATE = 3,
- CONFLUX_ALG_HIGHRATE = 4
 } conflux_alg_t;
 
 /**