// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0 > or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT >, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::{
net::{IpAddr, Ipv4Addr},
time::Duration,
};
use crate ::{
MIN_INITIAL_PACKET_SIZE, Pmtud,
cc::{
CWND_INITIAL_PKTS, ClassicSlowStart, classic_cc::ClassicCongestionController, cubic
::Cubic,
hystart::HyStart, new_reno::NewReno,
},
};
mod cubic;
mod hystart;
mod new_reno;
mod search;
pub const IP_ADDR: IpAddr = IpAddr::V4(Ipv4Addr::UNSPECIFIED);
pub const MTU: Option<usize> = Some(1 _500 );
pub const RTT: Duration = Duration::from_millis(100 );
pub const INITIAL_CWND: usize = CWND_INITIAL_PKTS * MIN_INITIAL_PACKET_SIZE;
/// Helper to create `ClassicCongestionController` with New Reno for tests.
pub fn make_cc_newreno() -> ClassicCongestionController<ClassicSlowStart, NewReno> {
ClassicCongestionController::new(
ClassicSlowStart::default(),
NewReno::default(),
Pmtud::new(IP_ADDR, MTU),
true ,
)
}
/// Helper to create `ClassicCongestionController` with Cubic for tests.
pub fn make_cc_cubic() -> ClassicCongestionController<ClassicSlowStart, Cubic> {
ClassicCongestionController::new(
ClassicSlowStart::default(),
Cubic::default(),
Pmtud::new(IP_ADDR, MTU),
true ,
)
}
/// Helper to create `ClassicCongestionController` with HyStart++ for tests.
pub fn make_cc_hystart(paced: bool) -> ClassicCongestionController<HyStart, Cubic> {
ClassicCongestionController::new(
HyStart::new(paced, crate ::cc::HyStartCssBaseline::default()),
Cubic::default(),
Pmtud::new(IP_ADDR, MTU),
true ,
)
}
Messung V0.5 in Prozent C=90 H=98 G=94
¤ Dauer der Verarbeitung: 0.3 Sekunden
¤
*© Formatika GbR, Deutschland