From 41cbb5631fd12dc223738de65246af1a69761bea Mon Sep 17 00:00:00 2001 From: eunhhu Date: Tue, 29 Sep 2026 05:11:01 +0100 Subject: Send a record whole when it fits a packet, however many pieces it has A record over a piece (1,000 bytes) went in pieces even when it fit the packet whole: a record of 1,013 bytes went as two RECORD frames, and the receiver gathered it the slow way (an allocation, pieces, then onto the line). A record none of whose pieces went yet now goes whole in a RECORDS frame whenever it fits what is left of the packet; its pieces are marked sent together. A record too large for a packet, or one resent after some of its pieces were lost, still goes in pieces, and a receiver takes a record whole or in pieces alike. The transport alone takes 2.85 us a record of 1,013 bytes, not 3.18 (quinn: 3.90). transport.c now checks every record delivered: in order, once each, its bytes as sent. None was wrong in a network namespace with 1 ms of delay, 3 % loss and 10 % reordering, with records of 61, 1,013 and 16,013 bytes. --- serve/link.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'serve/link.h') diff --git a/serve/link.h b/serve/link.h index 5d4a746..83cc645 100644 --- a/serve/link.h +++ b/serve/link.h @@ -29,8 +29,8 @@ * shape of the messages (the sender's output and the * receiver's input must have the same): the stream the * records after it are of - * 0x02 RECORD u64 number, u32 size, u32 offset, u16 length, bytes: a saved - * send as stored, or a piece of one + * 0x02 RECORD u64 number, u32 size, u32 offset, u16 length, bytes: a piece + * of a saved send (pieces are 1000 bytes, the last shorter) * 0x03 ACK u64 largest number, u32 delay (µs), u8 ranges, each as u64 * first and u64 last, newest first * 0x04 STORED source, input (as STREAM), u64 the last number heard @@ -40,8 +40,8 @@ * 0x05 PING to be acknowledged * 0x06 RECORDS u64 the first one's number, u8 count, then whole records one * after another (numbers following on), each its size (a - * varint: LEB128) and its bytes: small sends, 1 or 2 bytes - * of framing each, not the 19 of RECORD + * varint: LEB128) and its bytes: a send that fits the packet + * whole, with 1 to 3 bytes of framing, not the 19 of RECORD * 0x00 PADDING to the end of the packet: a full packet sent in a burst is * a whole datagram * Losses are detected as RFC 9002 says; congestion control is its NewReno -- cgit v1.2.3