Skip to content
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
109 changes: 95 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions iroh-relay/src/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ impl QuicClient {
server_addr: SocketAddr,
host: &str,
) -> Result<(SocketAddr, std::time::Duration), Error> {
use quinn_proto::PathId;

let connecting = self
.ep
.connect_with(self.client_config.clone(), server_addr, host);
Expand Down Expand Up @@ -334,7 +336,7 @@ impl QuicClient {
// if we've sent to an ipv4 address, but received an observed address
// that is ivp6 then the address is an [IPv4-Mapped IPv6 Addresses](https://doc.rust-lang.org/beta/std/net/struct.Ipv6Addr.html#ipv4-mapped-ipv6-addresses)
observed_addr = SocketAddr::new(observed_addr.ip().to_canonical(), observed_addr.port());
let latency = conn.rtt();
let latency = conn.rtt(PathId::ZERO).unwrap_or_default();
// gracefully close the connections
conn.close(QUIC_ADDR_DISC_CLOSE_CODE, QUIC_ADDR_DISC_CLOSE_REASON);
Ok((observed_addr, latency))
Expand Down Expand Up @@ -458,8 +460,9 @@ mod tests {
/// In this case we don't simulate it via synthetically high RTT, but by dropping
/// all packets on the server-side for 2 seconds.
#[tokio::test]
#[traced_test]
// #[traced_test]
async fn test_qad_connect_delayed() -> Result {
tracing_subscriber::fmt::try_init().ok();
// Create a socket for our QAD server. We need the socket separately because we
// need to pop off messages before we attach it to the Quinn Endpoint.
let socket = tokio::net::UdpSocket::bind(SocketAddr::new(Ipv4Addr::LOCALHOST.into(), 0))
Expand Down
1 change: 1 addition & 0 deletions iroh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ metrics = ["iroh-metrics/metrics", "iroh-relay/metrics", "portmapper/metrics"]
test-utils = ["iroh-relay/test-utils", "iroh-relay/server", "dep:axum"]
discovery-local-network = ["dep:swarm-discovery"]
discovery-pkarr-dht = ["pkarr/dht"]
qlog = ["quinn/qlog"]
# Use private Apple APIs to send multiple packets in a single syscall.
fast-apple-datapath = ["quinn/fast-apple-datapath"]

Expand Down
1 change: 1 addition & 0 deletions iroh/bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ metrics = ["iroh/metrics", "iroh-metrics"]
local-relay = ["iroh/test-utils"]
# Use private Apple APIs to send multiple packets in a single syscall.
fast-apple-datapath = ["iroh/fast-apple-datapath", "quinn/fast-apple-datapath"]
qlog = ["iroh/qlog", "quinn/qlog"]
9 changes: 9 additions & 0 deletions iroh/bench/src/iroh.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#[cfg(feature = "qlog")]
use std::sync::Arc;
use std::{
net::SocketAddr,
time::{Duration, Instant},
};

use bytes::Bytes;
#[cfg(feature = "qlog")]
use iroh::endpoint::QlogFileFactory;
use iroh::{
Endpoint, EndpointAddr, RelayMode, RelayUrl,
endpoint::{Connection, ConnectionError, QuicTransportConfig, RecvStream, SendStream},
Expand Down Expand Up @@ -133,6 +137,11 @@ pub fn transport_config(max_streams: usize, initial_mtu: u16) -> QuicTransportCo
acks.ack_eliciting_threshold(10u32.into());
config.ack_frequency_config(Some(acks));

#[cfg(feature = "qlog")]
config.qlog_factory(Arc::new(
QlogFileFactory::from_env().with_prefix("bench-iroh"),
));

config
}

Expand Down
7 changes: 7 additions & 0 deletions iroh/bench/src/quinn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use std::{
};

use bytes::Bytes;
#[cfg(feature = "qlog")]
use iroh::endpoint::QlogFileFactory;
use n0_error::{Result, StdResultExt};
use quinn::{
Connection, Endpoint, RecvStream, SendStream, TransportConfig, crypto::rustls::QuicClientConfig,
Expand Down Expand Up @@ -116,6 +118,11 @@ pub fn transport_config(max_streams: usize, initial_mtu: u16) -> TransportConfig
acks.ack_eliciting_threshold(10u32.into());
config.ack_frequency_config(Some(acks));

#[cfg(feature = "qlog")]
config.qlog_factory(Arc::new(
QlogFileFactory::from_env().with_prefix("bench-quinn"),
));

config
}

Expand Down
Loading
Loading