Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements a dual sender Zerocopy strategy for QUIC V1 and VReverso #5

Open
wants to merge 17 commits into
base: protocol_reverso
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ the same.
Building
--------

quiceh requires Rust 1.66 or later to build. The latest stable Rust release can
quiceh requires Rust 1.79 or later to build. The latest stable Rust release can
be installed using [rustup](https://rustup.rs/).

Once the Rust build environment is setup, the quiceh source code can be fetched
Expand Down
14 changes: 9 additions & 5 deletions apps/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl Args for CommonArgs {

let early_data = args.get_bool("--early-data");

let dump_packet_path = if args.get_str("--dump-packets") != "" {
let dump_packet_path = if !args.get_str("--dump-packets").is_empty() {
Some(args.get_str("--dump-packets").to_string())
} else {
None
Expand All @@ -155,7 +155,7 @@ impl Args for CommonArgs {
let enable_active_migration = args.get_bool("--enable-active-migration");

let max_field_section_size =
if args.get_str("--max-field-section-size") != "" {
if !args.get_str("--max-field-section-size").is_empty() {
Some(
args.get_str("--max-field-section-size")
.parse::<u64>()
Expand All @@ -166,7 +166,7 @@ impl Args for CommonArgs {
};

let qpack_max_table_capacity =
if args.get_str("--qpack-max-table-capacity") != "" {
if !args.get_str("--qpack-max-table-capacity").is_empty() {
Some(
args.get_str("--qpack-max-table-capacity")
.parse::<u64>()
Expand All @@ -177,7 +177,7 @@ impl Args for CommonArgs {
};

let qpack_blocked_streams =
if args.get_str("--qpack-blocked-streams") != "" {
if !args.get_str("--qpack-blocked-streams").is_empty() {
Some(
args.get_str("--qpack-blocked-streams")
.parse::<u64>()
Expand Down Expand Up @@ -319,7 +319,7 @@ impl Args for ClientArgs {
let version = args.get_str("--wire-version");
let version = u32::from_str_radix(version, 16).unwrap();

let dump_response_path = if args.get_str("--dump-responses") != "" {
let dump_response_path = if !args.get_str("--dump-responses").is_empty() {
Some(args.get_str("--dump-responses").to_string())
} else {
None
Expand Down Expand Up @@ -464,6 +464,7 @@ Options:
--qpack-blocked-streams STREAMS Limit of streams that can be blocked while decoding. Any value other that 0 is currently unsupported.
--disable-pacing Disable pacing (linux only).
--initial-cwnd-packets PACKETS The initial congestion window size in terms of packet count [default: 10].
--enable-hidden-copy Assemble a stream frame and control through encryption.
-h --help Show this screen.
";

Expand All @@ -477,6 +478,7 @@ pub struct ServerArgs {
pub key: String,
pub disable_pacing: bool,
pub enable_pmtud: bool,
pub enable_hidden_copy: bool,
}

impl Args for ServerArgs {
Expand All @@ -491,6 +493,7 @@ impl Args for ServerArgs {
let key = args.get_str("--key").to_string();
let disable_pacing = args.get_bool("--disable-pacing");
let enable_pmtud = args.get_bool("--enable-pmtud");
let enable_hidden_copy = args.get_bool("--enable-hidden-copy");

ServerArgs {
listen,
Expand All @@ -501,6 +504,7 @@ impl Args for ServerArgs {
key,
disable_pacing,
enable_pmtud,
enable_hidden_copy,
}
}
}
2 changes: 1 addition & 1 deletion apps/src/bin/quiceh-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn main() {
let conn_args = CommonArgs::with_docopt(&docopt);
let args = ClientArgs::with_docopt(&docopt);

match connect(args, conn_args, stdout_sink) {
match connect::<BufResponseFactory>(args, conn_args, stdout_sink) {
Err(ClientError::HandshakeFail) => std::process::exit(-1),

Err(ClientError::HttpFail) => std::process::exit(-2),
Expand Down
3 changes: 2 additions & 1 deletion apps/src/bin/quiceh-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ fn main() {
config.set_max_stream_window(conn_args.max_stream_window);

config.enable_pacing(pacing);
config.enable_hidden_copy_for_zc_sender(args.enable_hidden_copy);

let mut keylog = None;

Expand Down Expand Up @@ -355,7 +356,7 @@ fn main() {
debug!("New connection: dcid={:?} scid={:?}", hdr.dcid, scid);

#[allow(unused_mut)]
let mut conn = quiceh::accept(
let mut conn = quiceh::accept_with_buf_factory(
&scid,
odcid.as_ref(),
local_addr,
Expand Down
13 changes: 9 additions & 4 deletions apps/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
use crate::args::*;
use crate::common::*;
use quiceh::AppRecvBufMap;
use quiceh::BufFactory;
use quiceh::BufSplit;

use std::cell::RefCell;
use std::io::prelude::*;
Expand All @@ -52,10 +54,13 @@ pub enum ClientError {
Other(String),
}

pub fn connect(
pub fn connect<F: BufFactory<Buf = BufResponse>>(
args: ClientArgs, conn_args: CommonArgs,
output_sink: impl FnMut(String) + 'static,
) -> Result<(), ClientError> {
) -> Result<(), ClientError>
where
<F as BufFactory>::Buf: BufSplit,
{
let mut buf = [0; 65536 * BATCH_SIZE];
let mut out = [0; MAX_DATAGRAM_SIZE];

Expand Down Expand Up @@ -176,7 +181,7 @@ pub fn connect(
config.enable_dgram(true, 1000, 1000);
}

let mut http_conn: Option<Box<dyn HttpConn>> = None;
let mut http_conn: Option<Box<dyn HttpConn<F>>> = None;

let mut app_proto_selected = false;

Expand Down Expand Up @@ -208,7 +213,7 @@ pub fn connect(
.unwrap();

// Create a QUIC connection and initiate handshake.
let mut conn = quiceh::connect(
let mut conn = quiceh::connect_with_buffer_factory(
connect_url.domain(),
&scid,
local_addr,
Expand Down
Loading