4 ms·
It has a fixed maximum number of concurrent sockets, and each socket has queues backed by per-socket fixed-size transmit and receive buffers (see `rxmem` and `t
by Ao7bei3s 7mo ago
It has a fixed maximum number of concurrent sockets, and each socket has queues backed by per-socket fixed-size transmit and receive buffers (see `rxmem` and `txmem` in `struct tsocket`[1]). This is fine, because in TCP, each side advertises remaining buffer space via the window size header field [2] (possibly with its meaning modified by the window scale option during the initial handshake - see [3] & `struct PACKED tcp_opt_ws`), and possibly also how much it can maximally receive in one packet (via the MSS option on the initial handshake [4]; possibly modified by intermediary systems via MSS clamping). wolfip has unusually small buffer sizes, and hardcodes them via #define, and everything else (e.g. congestion control) is pretty rudimentary too, but otherwise it's pretty much the same as in a "normal" implementation.
[1] https://github.com/wolfSSL/wolfip/blob/60444d869e8f451aa2dca2d3d791fa793d5f4e03/src/wolfip.c#L1073 https://github.com/wolfSSL/wolfip/blob/60444d869e8f451aa2dca...
[2] https://github.com/wolfSSL/wolfip/blob/60444d869e8f451aa2dca2d3d791fa793d5f4e03/src/wolfip.c#L650 https://github.com/wolfSSL/wolfip/blob/60444d869e8f451aa2dca...
[3] https://github.com/wolfSSL/wolfip/blob/60444d869e8f451aa2dca2d3d791fa793d5f4e03/src/wolfip.c#L3249 https://github.com/wolfSSL/wolfip/blob/60444d869e8f451aa2dca...
[4] https://github.com/wolfSSL/wolfip/blob/60444d869e8f451aa2dca2d3d791fa793d5f4e03/src/wolfip.c#L2228 https://github.com/wolfSSL/wolfip/blob/60444d869e8f451aa2dca...
- fulafel 7mo agoOk. So I guess it doesn't try to go very fast.
- ajb 7mo agoBuffer size is the product of bandwidth and delay, so if communicating with something close, it can still go fast. Had an illustration of this once when my then-employers IT dept set up the desktop IP phones to update from a TFTP server on the other continental land mass. Since TFTP only allows one outstanding packet, everyone outside head office had to wait a long time for their phone to update, while head office didn't see any issue.
- sbrivio 7mo agopasst has been doing something similar for years (see https://passt.top/kvm_forum_2022.pdf https://passt.top/kvm_forum_2022.pdf pages 17, 18) and it's actually pretty fast (https://passt.top/#performance_1 https://passt.top/#performance_1), even though it's not as resource-constrained as WolfIP. We're finally adding multithreading (https://bugs.passt.top/show_bug.cgi?id=13 https://bugs.passt.top/show_bug.cgi?id=13) these days.
- pseudohadamard 7mo agoIf it's a memory-constrained embedded device you're sending a handful of bytes of telemetry every now and then, not aiming for gigabit speeds. In fact it couldn't get to megabit speeds even if it wanted to. For something like that this is perfect.