diff options
| author | eunhhu <[email protected]> | 2026-09-29 09:27:49 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-29 09:27:49 +0100 |
| commit | f26f5fbd0a487a9a2848f819361b4e6fdd7a9cb1 (patch) | |
| tree | 624028b8a84299842bd3d3456be5962dd7dd420c /link/link-protocol.h | |
| parent | a6c825b8613177e32e9bf43e2abd6ac820bc8321 (diff) | |
| download | pure-f26f5fbd0a487a9a2848f819361b4e6fdd7a9cb1.tar.gz pure-f26f5fbd0a487a9a2848f819361b4e6fdd7a9cb1.zip | |
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).
Diffstat (limited to 'link/link-protocol.h')
| -rw-r--r-- | link/link-protocol.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/link/link-protocol.h b/link/link-protocol.h index e82e599..f51260b 100644 --- a/link/link-protocol.h +++ b/link/link-protocol.h @@ -51,10 +51,12 @@ * Losses are detected as RFC 9002 says; congestion control is its NewReno * (RFC 9002 ยง7). */ -/* A packet is at most PURE_LINK_DATAGRAM bytes; a source's or an input's - * name is 1 to PURE_LINK_NAME bytes; a receiver keeps where a packet came - * from (the socket's address) in PURE_LINK_ADDRESS bytes. */ -enum { PURE_LINK_DATAGRAM = 1200, PURE_LINK_NAME = 64, PURE_LINK_ADDRESS = 28 }; +/* A packet is PURE_LINK_DATAGRAM bytes at most at first, and up to + * PURE_LINK_DATAGRAM_MOST once the path is found to carry that many (a + * probe of that size acknowledged: DPLPMTUD, RFC 8899); a source's or an + * input's name is 1 to PURE_LINK_NAME bytes; a receiver keeps where a + * packet came from (the socket's address) in PURE_LINK_ADDRESS bytes. */ +enum { PURE_LINK_DATAGRAM = 1200, PURE_LINK_DATAGRAM_MOST = 1452, PURE_LINK_NAME = 64, PURE_LINK_ADDRESS = 28 }; /* Counts for a host's report: packets and records sent, records sent again, * packets lost and acknowledged, packets received, deliveries handed over, @@ -91,10 +93,13 @@ void pure_link_sender_take(PureLinkSender *, const unsigned char *packet, size_t void pure_link_sender_tick(PureLinkSender *, uint64_t now); /* The next packet to send into out, and its number: its size, or 0 when * there is none (nothing to send, or the window is full). whole: a full - * packet is padded to PURE_LINK_DATAGRAM (so packets may go in a burst of - * whole datagrams, as UDP GSO sends them). */ -size_t pure_link_sender_packet(PureLinkSender *, unsigned char out[PURE_LINK_DATAGRAM], bool whole, uint64_t now, + * packet is padded to the sender's datagram (so packets may go in a burst + * of whole datagrams, as UDP GSO sends them). A probe of a larger size is + * larger than the datagram: it goes alone. */ +size_t pure_link_sender_packet(PureLinkSender *, unsigned char out[PURE_LINK_DATAGRAM_MOST], bool whole, uint64_t now, uint64_t *number); +/* The size of a full packet now. */ +size_t pure_link_sender_datagram(const PureLinkSender *); /* A packet made but not sent (the socket refused it): what it carried is * sent again, and it counts as never sent. */ void pure_link_sender_refused(PureLinkSender *, uint64_t number); |
