nasa / bplib

Apache License 2.0
27 stars 13 forks source link

bpcat needs to throttle datagrams sent via UDP socket #151

Closed jphickey closed 2 years ago

jphickey commented 2 years ago

The bpcat test tool transfers bundles via a UDP socket. Even when running locally on the same PC (i.e. using a localhost socket) bplib can generate traffic fast enough to overfill the outgoing UDP buffer in the network stack, resulting in lost bundles. These are then (eventually) retried, but this slows the transfer down considerably, and drastically increases the number of out-of-order frames received at the other side.

An simple workaround is to simply throttle down calls to send() by adding an artificial delay between each bundle. This will slow down the transfer initially, but over the longer term it will greatly increase the throughput because there will not be as many retries.