From f26f5fbd0a487a9a2848f819361b4e6fdd7a9cb1 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Tue, 29 Sep 2026 09:27:49 +0100 Subject: Find how large a packet the path carries: 1,452 bytes once a probe is acknowledged A link starts at 1,200 bytes; once an RTT is known it sends a PING padded to 1,452 (DPLPMTUD, RFC 8899), alone and with the don't-fragment bit, and uses that size once it is acknowledged. A probe lost is no congestion; it is tried again a second on, three times, then ten minutes on. GSO is asked for each burst (a control message), not the socket, so a packet sent alone is never cut. CUBIC counts in the datagram. On loopback packets fall by 19-27%; the CPU a record falls 13% at 1 KiB and 7% at 16 KiB; in the simulator of a 50 Mbit/s path with 1% loss the goodput rises from 6.1 to 7.0 Mbit/s (5%: 2.3 to 3.0). --- research/experiments/019-idle-links/links.c | 4 ++-- research/experiments/020-lossy-paths/sim.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'research/experiments') diff --git a/research/experiments/019-idle-links/links.c b/research/experiments/019-idle-links/links.c index 8c52550..4c77482 100644 --- a/research/experiments/019-idle-links/links.c +++ b/research/experiments/019-idle-links/links.c @@ -179,7 +179,7 @@ static PureLinkSender *sender_of(size_t device) { /* What a sender has to send, to its socket. */ static void send_packets(PureLinkSender *s, int fd, uint64_t now) { - unsigned char packet[PURE_LINK_DATAGRAM]; + unsigned char packet[PURE_LINK_DATAGRAM_MOST]; uint64_t number; for (size_t size; (size = pure_link_sender_packet(s, packet, false, now, &number));) { if (send(fd, packet, size, 0) < 0 && (errno == EAGAIN || errno == ENOBUFS)) { @@ -192,7 +192,7 @@ static void send_packets(PureLinkSender *s, int fd, uint64_t now) { /* Answers waiting on fd, to the sender. */ static void take_answers(PureLinkSender *s, int fd, uint64_t now) { - unsigned char packet[PURE_LINK_DATAGRAM + 64]; + unsigned char packet[PURE_LINK_DATAGRAM_MOST + 64]; for (ssize_t got; (got = recv(fd, packet, sizeof(packet), 0)) > 0;) pure_link_sender_take(s, packet, (size_t)got, now); } diff --git a/research/experiments/020-lossy-paths/sim.c b/research/experiments/020-lossy-paths/sim.c index 00f93d6..699c9d4 100644 --- a/research/experiments/020-lossy-paths/sim.c +++ b/research/experiments/020-lossy-paths/sim.c @@ -19,7 +19,7 @@ typedef struct { uint64_t at; bool to_receiver; size_t size; - unsigned char bytes[PURE_LINK_DATAGRAM]; + unsigned char bytes[PURE_LINK_DATAGRAM_MOST]; } Packet; static uint64_t sim_seed; @@ -111,7 +111,7 @@ int main(int argc, char **argv) { unsigned char *bytes = calloc(1, size + 1); for (uint64_t seq = 1; seq <= records; ++seq) if (!pure_link_sender_queue(s, seq, bytes, size)) return 1; - unsigned char out[PURE_LINK_DATAGRAM]; + unsigned char out[PURE_LINK_DATAGRAM_MOST]; uint64_t sample_at = 0, window_sum = 0, rtt_sum = 0, samples = 0, window_least = UINT64_MAX; PureLinkDone told[64]; while (heard < records || s->stored < records) { -- cgit v1.2.3