diff options
| author | eunhhu <[email protected]> | 2026-09-29 08:30:30 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-29 08:30:30 +0100 |
| commit | fb573903562695af47b63f91a9e96f55d0661d94 (patch) | |
| tree | b08bc45b9ae55e6397c133db1a4e6aa553fb0c18 /research/experiments/019-idle-links/transport.c | |
| parent | 5545fb068a0aaf05947889185f9c390db43289fa (diff) | |
| download | pure-fb573903562695af47b63f91a9e96f55d0661d94.tar.gz pure-fb573903562695af47b63f91a9e96f55d0661d94.zip | |
Queue only the way to the receivers behind M6's bottleneck
tbf with netem under it lost tbf's queue (netem became it), and the
answers queued behind the data. Now each way has its netem, the way to
the receivers' ports then a tbf whose queue holds a round trip; the way
back does not queue. transport.c takes its listener's port
(TRANSPORT_PORT).
Diffstat (limited to 'research/experiments/019-idle-links/transport.c')
| -rw-r--r-- | research/experiments/019-idle-links/transport.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/research/experiments/019-idle-links/transport.c b/research/experiments/019-idle-links/transport.c index 0ce693a..3a531ef 100644 --- a/research/experiments/019-idle-links/transport.c +++ b/research/experiments/019-idle-links/transport.c @@ -13,7 +13,8 @@ * queued before the link starts (a backlog drained). RATE: records * queued a second (0: as fast as the window allows), and the time * from each queued to handed over. SECONDS: stop after that long - * (0: once all are handed over). TRANSPORT_GSO=0: no UDP GSO bursts. + * (0: once all are handed over). TRANSPORT_GSO=0: no UDP GSO bursts; + * TRANSPORT_PORT: the listener's port. * Built beside pure-crypto.so (build/). */ #include "link.h" #include "module.h" @@ -160,13 +161,13 @@ int main(int argc, char **argv) { snprintf(path, sizeof(path), "%s/b.key", dir); PureSealKey *b = pure_seal_key(path, hex, error, sizeof(error)); if (!b || !pure_seal_peer(hex, public_b)) return fprintf(stderr, "transport: %s\n", error), 1; - /* A port nobody uses. */ + /* The port TRANSPORT_PORT names, or one nobody uses. */ int probe = socket(AF_INET, SOCK_DGRAM, 0); struct sockaddr_in any = {.sin_family = AF_INET, .sin_addr.s_addr = htonl(INADDR_LOOPBACK)}; socklen_t length = sizeof(any); if (probe < 0 || bind(probe, (struct sockaddr *)&any, sizeof(any)) || getsockname(probe, (struct sockaddr *)&any, &length)) return 1; - unsigned port = ntohs(any.sin_port); + unsigned port = getenv("TRANSPORT_PORT") ? (unsigned)atoi(getenv("TRANSPORT_PORT")) : ntohs(any.sin_port); close(probe); PureLinkReceiver *r = pure_link_receiver(b, public_b, &(PureLinkHost){input_of, deliver, NULL}, error, sizeof(error)); if (!r || !pure_link_allow(r, "bench.ordered", public_a, error, sizeof(error)) || |
