Skip to content

Weird empty (only padding) datagrams sent in some cases #176

@matheus23

Description

@matheus23

This test:

#[test]
fn path_response_retransmit() {
    let _guard = subscribe();
    let mut pair = Pair::default();
    let (client_ch, server_ch) = pair.connect();
    pair.drive();

    println!("-------- client migrates --------");
    pair.client.addr = SocketAddr::new(
        Ipv4Addr::new(127, 0, 0, 1).into(),
        CLIENT_PORTS.lock().unwrap().next().unwrap(),
    );
    pair.client_conn_mut(client_ch).ping();

    let responses_sent_before = pair
        .client_conn_mut(server_ch)
        .stats()
        .frame_tx
        .path_challenge;

    pair.drive_client(); // This will send the ping
    pair.drive_server(); // This will make the server receive the ping and send a path challenge
    pair.drive_client(); // This will make the client send the first path response
    println!("-------- server loses messages --------");
    // Have the server lose the path response
    pair.server.inbound.clear();

    pair.drive();

    assert_eq!(
        pair.client_conn_mut(server_ch)
            .stats()
            .frame_tx
            .path_response,
        responses_sent_before + 2
    );
}

Causes this curious behavior:

2025-11-22T12:18:58.776041Z TRACE server:send{space=Data pn=13 path_id=0}: iroh_quinn_proto::connection: 4720: IMMEDIATE_ACK
2025-11-22T12:18:58.776057Z TRACE server:send{space=Data pn=13 path_id=0}: iroh_quinn_proto::connection: 5085: RETIRE_CONNECTION_ID sequence=1
2025-11-22T12:18:58.776072Z TRACE server:send{space=Data pn=13 path_id=0}: iroh_quinn_proto::connection::packet_builder: 264: PADDING * 1
2025-11-22T12:18:58.776090Z TRACE server:send{space=Data pn=13 path_id=0}: iroh_quinn_proto::connection::packet_builder: 295: wrote packet size=30 short_header=true
2025-11-22T12:18:58.776114Z TRACE server: iroh_quinn_proto::connection::transmit_buf: 152: clipped datagram size segment_size=30 prev_segment_size=1200
2025-11-22T12:18:58.776134Z TRACE server: iroh_quinn_proto::connection: 1104: new datagram started count=2
2025-11-22T12:18:58.776156Z TRACE server:send{space=Data pn=14 path_id=0}: iroh_quinn_proto::connection: 4720: IMMEDIATE_ACK
2025-11-22T12:18:58.776170Z TRACE server:send{space=Data pn=14 path_id=0}: iroh_quinn_proto::connection::packet_builder: 264: PADDING * 3
2025-11-22T12:18:58.776187Z TRACE server:send{space=Data pn=14 path_id=0}: iroh_quinn_proto::connection::packet_builder: 295: wrote packet size=30 short_header=true
2025-11-22T12:18:58.776214Z TRACE server: iroh_quinn_proto::connection: 1104: new datagram started count=3
2025-11-22T12:18:58.776237Z TRACE server:send{space=Data pn=15 path_id=0}: iroh_quinn_proto::connection: 4720: IMMEDIATE_ACK
2025-11-22T12:18:58.776250Z TRACE server:send{space=Data pn=15 path_id=0}: iroh_quinn_proto::connection::packet_builder: 264: PADDING * 3
2025-11-22T12:18:58.776266Z TRACE server:send{space=Data pn=15 path_id=0}: iroh_quinn_proto::connection::packet_builder: 295: wrote packet size=30 short_header=true
2025-11-22T12:18:58.776292Z TRACE server: iroh_quinn_proto::connection: 1104: new datagram started count=4
2025-11-22T12:18:58.776315Z TRACE server:send{space=Data pn=16 path_id=0}: iroh_quinn_proto::connection: 4720: IMMEDIATE_ACK
2025-11-22T12:18:58.776330Z TRACE server:send{space=Data pn=16 path_id=0}: iroh_quinn_proto::connection::packet_builder: 264: PADDING * 3
2025-11-22T12:18:58.776345Z TRACE server:send{space=Data pn=16 path_id=0}: iroh_quinn_proto::connection::packet_builder: 295: wrote packet size=30 short_header=true
2025-11-22T12:18:58.776369Z TRACE server: iroh_quinn_proto::connection: 1104: new datagram started count=5
2025-11-22T12:18:58.776394Z TRACE server:send{space=Data pn=17 path_id=0}: iroh_quinn_proto::connection::packet_builder: 264: PADDING * 4
2025-11-22T12:18:58.776411Z TRACE server:send{space=Data pn=17 path_id=0}: iroh_quinn_proto::connection::packet_builder: 295: wrote packet size=30 short_header=true
2025-11-22T12:18:58.776437Z TRACE server: iroh_quinn_proto::connection: 1104: new datagram started count=6
2025-11-22T12:18:58.776461Z TRACE server:send{space=Data pn=18 path_id=0}: iroh_quinn_proto::connection::packet_builder: 264: PADDING * 4
2025-11-22T12:18:58.776478Z TRACE server:send{space=Data pn=18 path_id=0}: iroh_quinn_proto::connection::packet_builder: 295: wrote packet size=30 short_header=true
2025-11-22T12:18:58.776503Z TRACE server: iroh_quinn_proto::connection: 1104: new datagram started count=7
2025-11-22T12:18:58.776527Z TRACE server:send{space=Data pn=19 path_id=0}: iroh_quinn_proto::connection::packet_builder: 264: PADDING * 4
2025-11-22T12:18:58.776544Z TRACE server:send{space=Data pn=19 path_id=0}: iroh_quinn_proto::connection::packet_builder: 295: wrote packet size=30 short_header=true
2025-11-22T12:18:58.776568Z TRACE server: iroh_quinn_proto::connection: 1104: new datagram started count=8
2025-11-22T12:18:58.776593Z TRACE server:send{space=Data pn=20 path_id=0}: iroh_quinn_proto::connection::packet_builder: 264: PADDING * 4
2025-11-22T12:18:58.776610Z TRACE server:send{space=Data pn=20 path_id=0}: iroh_quinn_proto::connection::packet_builder: 295: wrote packet size=30 short_header=true
2025-11-22T12:18:58.776642Z TRACE server: iroh_quinn_proto::connection: 1104: new datagram started count=9
2025-11-22T12:18:58.776670Z TRACE server:send{space=Data pn=21 path_id=0}: iroh_quinn_proto::connection::packet_builder: 264: PADDING * 4
2025-11-22T12:18:58.776690Z TRACE server:send{space=Data pn=21 path_id=0}: iroh_quinn_proto::connection::packet_builder: 295: wrote packet size=30 short_header=true
2025-11-22T12:18:58.776718Z TRACE server: iroh_quinn_proto::connection: 1104: new datagram started count=10
2025-11-22T12:18:58.776746Z TRACE server:send{space=Data pn=22 path_id=0}: iroh_quinn_proto::connection::packet_builder: 264: PADDING * 4
2025-11-22T12:18:58.776765Z TRACE server:send{space=Data pn=22 path_id=0}: iroh_quinn_proto::connection::packet_builder: 295: wrote packet size=30 short_header=true

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions