The windowsize option permits multiple blocks to be transmitted
before the receiver sends an ACK improving throughput for larger
files.
Sponsored by: DARPA
Differential D23836
Add support for the TFTP windowsize option described in RFC 7440. jhb on Feb 25 2020, 5:51 PM. Authored by Tags None Referenced Files
Subscribers
Details
The windowsize option permits multiple blocks to be transmitted Sponsored by: DARPA
Diff Detail
Event TimelineComment Actions I didn't closely review tftp-transfer.c, but everything else looks good, especially the tests! Thanks for implementing tests for option processing; I never got around to that.
Comment Actions I can’t speak to the relevant standards and don’t have time to read up on them now, but the improvement seems pretty marginal? Would a larger window or block size be acceptable? Switched networks often have extremely low loss rates, even if this doesn’t do nice TCP scaling. Comment Actions This is a 50 MHz soft core, and that window size is enough to match the TCP speeds it can currently achieve; the memory-I/O interaction is not currently great on it despite having a DMA engine. Larger window sizes would of course be beneficial for better hardware, and larger block sizes can also work, although require your network stack to support UDP fragmentation, something that bootloaders may not do, but if they ask TFTPD for either then they will get them, the limitations all just stem from the netboot client we're using. Comment Actions So for reference, I ran 'tftp' over localhost to fetch a ~5MB file. With the defaults (512b blocks, 1 window), it took 1.7 seconds. With 1024 byte blocks it took 1.2 seconds. With 512 byte blocks and a windowsize of 16 it took 0.2 seconds, and with 1025 byte blocks and a windowsize of 16 it took 0.1 seconds (as reported by the client). For that simple test it seems that windowsize makes a much bigger difference than blocksize for improving throughput. Comment Actions 1.7s->1.2s is 1.4x faster for 2x the block size, and 1.7s->0.2s is 8.5x faster for 16x the window size. The only meaningful comparison would be 1024 byte 1 blocks with a window size of 1 vs 512 byte blocks with a window size of 2, and I would expect the former to be marginally faster (though perhaps not noticeably) than the latter given there are fewer packets to construct and process. Where you really win with window size though is the ability to ramp it up such that you're transmitting more than 1 MTU's worth of data at a time; increasing the block size further just gives you either fragmentation (at which point you basically have windowing, just at a lower layer) or your network stack doesn't bother to implement it and you can't go that high. |