Skip to content

Commit

Permalink
Merge pull request #126 from Tencent/release/v0.5.0
Browse files Browse the repository at this point in the history
Release/v0.5.0
  • Loading branch information
iyangsj committed Jan 3, 2024
2 parents f8801ba + 6cdd0cc commit edcab8d
Show file tree
Hide file tree
Showing 25 changed files with 1,189 additions and 346 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/rust.yml
Expand Up @@ -19,10 +19,20 @@ jobs:
submodules: 'recursive'
- name: Update rust
run: rustup update
- name: Build TQUIC library
run: cargo build -F ffi --verbose
- name: Build TQUIC tools
run: cargo build --all --verbose
- name: Build TQUIC library and tools
run: cargo build --all -F ffi --verbose

build_macos:
name: Build for MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Update rust
run: rustup update
- name: Build TQUIC library and tools
run: cargo build --all -F ffi --verbose

build_ios:
name: Build for iOS
Expand All @@ -41,7 +51,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: build
args: --target=${{ env.TARGET }} --verbose
args: --target=${{ env.TARGET }} --verbose --features ffi

build_android:
name: Build for Android
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/tquic-goodput.yml
Expand Up @@ -7,14 +7,15 @@ on:

env:
CARGO_TERM_COLOR: always
QUIC_IMAGES: lsquic=tquicgroup/qirls,picoquic=tquicgroup/qirpq,quiche=tquicgroup/qircq

jobs:
measure:
runs-on: ubuntu-latest

strategy:
matrix:
impl: [tquic,lsquic,quiche]
impl: [tquic,lsquic,picoquic,quiche]
case: [goodput100k,goodput1m,goodput10m]
cc: [cubic, bbr]

Expand All @@ -34,10 +35,10 @@ jobs:
- name: Run the interop tests
run: |
cd quic-interop-runner
python3 run.py -s ${{ matrix.impl }} -c ${{ matrix.impl }} -t ${{ matrix.case }} -a ${{ matrix.cc }} -d -n "drop-rate --delay=15ms --bandwidth=10Mbps --queue=25 --rate_to_server=0 --rate_to_client=0" -j ${{ matrix.case }}-0-${{ matrix.cc }}-${{ matrix.impl }}.json
python3 run.py -s ${{ matrix.impl }} -c ${{ matrix.impl }} -t ${{ matrix.case }} -a ${{ matrix.cc }} -d -n "drop-rate --delay=15ms --bandwidth=10Mbps --queue=25 --rate_to_server=1 --rate_to_client=1" -j ${{ matrix.case }}-1-${{ matrix.cc }}-${{ matrix.impl }}.json
python3 run.py -s ${{ matrix.impl }} -c ${{ matrix.impl }} -t ${{ matrix.case }} -a ${{ matrix.cc }} -d -n "drop-rate --delay=15ms --bandwidth=10Mbps --queue=25 --rate_to_server=3 --rate_to_client=3" -j ${{ matrix.case }}-3-${{ matrix.cc }}-${{ matrix.impl }}.json
python3 run.py -s ${{ matrix.impl }} -c ${{ matrix.impl }} -t ${{ matrix.case }} -a ${{ matrix.cc }} -d -n "drop-rate --delay=15ms --bandwidth=10Mbps --queue=25 --rate_to_server=5 --rate_to_client=5" -j ${{ matrix.case }}-5-${{ matrix.cc }}-${{ matrix.impl }}.json
python3 run.py -r $QUIC_IMAGES -s ${{ matrix.impl }} -c ${{ matrix.impl }} -t ${{ matrix.case }} -a ${{ matrix.cc }} -d -n "drop-rate --delay=15ms --bandwidth=10Mbps --queue=25 --rate_to_server=0 --rate_to_client=0" -j ${{ matrix.case }}-0-${{ matrix.cc }}-${{ matrix.impl }}.json
python3 run.py -r $QUIC_IMAGES -s ${{ matrix.impl }} -c ${{ matrix.impl }} -t ${{ matrix.case }} -a ${{ matrix.cc }} -d -n "drop-rate --delay=15ms --bandwidth=10Mbps --queue=25 --rate_to_server=1 --rate_to_client=1" -j ${{ matrix.case }}-1-${{ matrix.cc }}-${{ matrix.impl }}.json
python3 run.py -r $QUIC_IMAGES -s ${{ matrix.impl }} -c ${{ matrix.impl }} -t ${{ matrix.case }} -a ${{ matrix.cc }} -d -n "drop-rate --delay=15ms --bandwidth=10Mbps --queue=25 --rate_to_server=3 --rate_to_client=3" -j ${{ matrix.case }}-3-${{ matrix.cc }}-${{ matrix.impl }}.json
python3 run.py -r $QUIC_IMAGES -s ${{ matrix.impl }} -c ${{ matrix.impl }} -t ${{ matrix.case }} -a ${{ matrix.cc }} -d -n "drop-rate --delay=15ms --bandwidth=10Mbps --queue=25 --rate_to_server=5 --rate_to_client=5" -j ${{ matrix.case }}-5-${{ matrix.cc }}-${{ matrix.impl }}.json
- name: Store measurement results
uses: actions/upload-artifact@v3
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [v0.5.0] - 2024-01-03

### Added
- Add support for building on MacOS
- Add support for stateless reset
- Relaese tls_conf_selector as soon as the hanshake is completed.
- Add linear mode and upper limit for probe timeout
- Add FFI enable_multipath()/set_multipath_algorithm()
- Add RoundRobin multipath scheduler
- Add more units test for mulitpath transport
- tquic_client: stop trying and exit if it fails to reconnect the server multiple times.
- tquic_client: output the stats first and then exit when it receives an SIGINT signal.

### Changed
- Simplify FFI quic_set_logger() to avoid from return unnessary errors
- Rename set_multipath() in Config to enable_multipath()
- Rename set_multipath_algor() in Config to set_multipath_algorithm()
- Change default congestion control algorithm to BBR

### Fixed
- Fix stream scheduling for multipe incredmental streams
- Fix reinjection for multipath transport


## [v0.4.0] - 2023-12-18

### Added
Expand Down Expand Up @@ -77,6 +101,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Provide example clients and servers.


[v0.5.0]: https://github.com/tencent/tquic/compare/v0.4.0...v0.5.0
[v0.4.0]: https://github.com/tencent/tquic/compare/v0.3.0...v0.4.0
[v0.3.0]: https://github.com/tencent/tquic/compare/v0.2.0...v0.3.0
[v0.2.0]: https://github.com/tencent/tquic/compare/v0.1.0...v0.2.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "tquic"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
rust-version = "1.70.0"
license = "Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions cbindgen.toml
Expand Up @@ -40,6 +40,7 @@ exclude = ["MAX_CID_LEN", "MIN_CLIENT_INITIAL_LEN"]
"TlsConfigSelectMethods" = "quic_tls_config_select_methods_t"
"TlsConfigSelectorContext" = "quic_tls_config_select_context_t"
"CongestionControlAlgorithm" = "quic_congestion_control_algorithm"
"LevelFilter" = "quic_log_level"
"Http3Connection" = "http3_conn_t"
"Http3Config" = "http3_config_t"
"Http3Context" = "http3_context_t"
Expand Down
101 changes: 97 additions & 4 deletions include/tquic.h
Expand Up @@ -53,6 +53,36 @@ typedef enum quic_congestion_control_algorithm {
QUIC_CONGESTION_CONTROL_ALGORITHM_COPA,
} quic_congestion_control_algorithm;

/**
* Available multipath scheduling algorithms.
*/
typedef enum quic_multipath_algorithm {
/**
* The scheduler sends packets over the path with the lowest smoothed RTT
* among all available paths. It aims to optimize throughput and achieve
* load balancing, making it particularly advantageous for bulk transfer
* applications in heterogeneous networks.
*/
MULTIPATH_ALGORITHM_MIN_RTT,
/**
* The scheduler sends all packets redundantly on all available paths. It
* utilizes additional bandwidth to minimize latency, thereby reducing the
* overall flow completion time for applications with bounded bandwidth
* requirements that can be met by a single path.
* In scenarios where two paths with varying available bandwidths are
* present, it ensures a goodput at least equivalent to the best single
* path.
*/
MULTIPATH_ALGORITHM_REDUNDANT,
/**
* The scheduler sends packets over available paths in a round robin
* manner. It aims to fully utilize the capacity of each path as the
* distribution across all path is equal. It is only used for testing
* purposes.
*/
MULTIPATH_ALGORITHM_ROUND_ROBIN,
} quic_multipath_algorithm;

/**
* The stream's side to shutdown.
*/
Expand Down Expand Up @@ -360,11 +390,41 @@ void quic_config_set_min_congestion_window(struct quic_config_t *config, uint64_
*/
void quic_config_set_initial_rtt(struct quic_config_t *config, uint64_t v);

/**
* Set the linear factor for calculating the probe timeout.
* The endpoint do not backoff the first `v` consecutive probe timeouts.
* The default value is `0`.
* The configuration should be changed with caution. Setting a value greater than the default
* will cause retransmission to be more aggressive.
*/
void quic_config_set_pto_linear_factor(struct quic_config_t *config, uint64_t v);

/**
* Set the upper limit of probe timeout in milliseconds.
* A Probe Timeout (PTO) triggers the sending of one or two probe datagrams and enables a
* connection to recover from loss of tail packets or acknowledgments.
* See RFC 9002 Section 6.2.
*/
void quic_config_set_max_pto(struct quic_config_t *config, uint64_t v);

/**
* Set the `active_connection_id_limit` transport parameter.
*/
void quic_config_set_active_connection_id_limit(struct quic_config_t *config, uint64_t v);

/**
* Set the `enable_multipath` transport parameter.
* The default value is false. (Experimental)
*/
void quic_config_enable_multipath(struct quic_config_t *config, bool enabled);

/**
* Set the multipath scheduling algorithm
* The default value is MultipathAlgorithm::MinRtt
*/
void quic_config_set_multipath_algorithm(struct quic_config_t *config,
enum quic_multipath_algorithm v);

/**
* Set the maximum size of the connection flow control window.
*/
Expand Down Expand Up @@ -630,6 +690,11 @@ bool quic_conn_is_closed(struct quic_conn_t *conn);
*/
bool quic_conn_is_idle_timeout(struct quic_conn_t *conn);

/**
* Check whether the connection was closed due to stateless reset.
*/
bool quic_conn_is_reset(struct quic_conn_t *conn);

/**
* Returns the error from the peer, if any.
*/
Expand Down Expand Up @@ -911,16 +976,44 @@ int http3_take_priority_update(struct http3_conn_t *conn,
void *argp),
void *argp);

/**
* An enum representing the available verbosity level filters of the logger.
*/
typedef enum quic_log_level {
/**
* A level lower than all log levels.
*/
QUIC_LOG_LEVEL_OFF,
/**
* Corresponds to the `Error` log level.
*/
QUIC_LOG_LEVEL_ERROR,
/**
* Corresponds to the `Warn` log level.
*/
QUIC_LOG_LEVEL_WARN,
/**
* Corresponds to the `Info` log level.
*/
QUIC_LOG_LEVEL_INFO,
/**
* Corresponds to the `Debug` log level.
*/
QUIC_LOG_LEVEL_DEBUG,
/**
* Corresponds to the `Trace` log level.
*/
QUIC_LOG_LEVEL_TRACE,
} quic_log_level;

/**
* Set logger.
* `cb` is a callback function that will be called for each log message.
* `line` is a null-terminated log message and `argp` is user-defined data that will be passed to
* the callback.
* `level` is the log level filter, valid values are "OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE".
* `level` represents the log level.
*/
int quic_set_logger(void (*cb)(const uint8_t *line, void *argp),
void *argp,
const char *level);
void quic_set_logger(void (*cb)(const uint8_t *line, void *argp), void *argp, quic_log_level level);

typedef enum http3_error {
HTTP3_NO_ERROR = 0,
Expand Down
6 changes: 3 additions & 3 deletions src/congestion_control/congestion_control.rs
Expand Up @@ -34,21 +34,21 @@ pub use cubic::Cubic;
pub use cubic::CubicConfig;
pub use hystart_plus_plus::HystartPlusPlus;

/// Available congestion control algorithm
/// Available congestion control algorithms.
#[repr(C)]
#[derive(Eq, PartialEq, Debug, Clone, Copy, Default)]
pub enum CongestionControlAlgorithm {
/// CUBIC uses a cubic function instead of a linear window increase function
/// of the current TCP standards to improve scalability and stability under
/// fast and long-distance networks..
#[default]
Cubic,

/// BBR uses recent measurements of a transport connection's delivery rate,
/// round-trip time, and packet loss rate to build an explicit model of the
/// network path. The model is then used to control data transmission speed
/// and the maximum volume of data allowed in flight in the network at any
/// time.
#[default]
Bbr,

/// BBRv3 is the latest version of BBR, including various fixes and
Expand Down Expand Up @@ -248,7 +248,7 @@ mod tests {
let mut config = Config::new()?;

let cc = build_congestion_controller(&config.recovery);
assert_eq!(cc.name(), "CUBIC");
assert_eq!(cc.name(), "BBR");
assert_eq!(cc.in_slow_start(), true);
assert_eq!(cc.in_recovery(Instant::now()), false);
assert_eq!(
Expand Down
6 changes: 3 additions & 3 deletions src/connection/cid.rs
Expand Up @@ -28,13 +28,13 @@ pub struct ConnectionIdItem {
/// The Connection ID.
pub cid: ConnectionId,

/// Its associated sequence number.
/// The associated sequence number.
pub seq: u64,

/// Its associated reset token. Initial CIDs may not have any reset token.
/// The associated reset token.
pub reset_token: Option<u128>,

/// The path identifier using this CID, if any.
/// The path using the Connection ID.
pub path_id: Option<usize>,
}

Expand Down

0 comments on commit edcab8d

Please sign in to comment.