Re: tftp protocol

On Fri, Oct 16, 2009 at 10:56:55PM +0200, Havard Eidnes wrote:
> Actually... I suspect that the BUGS statement is in actual fact
> wrong, if it implies that the protocol spec makes it impossible
> to transfer files larger than 32MiB using tftp with the default
> block size of 512 bytes. I've experienced that same problem,
> when trying to tftp updates for Cisco wireless controllers, which
> also have image files larger than 32MiB.
>
> Cisco's "fix" for this problem is to point to a particular
> implementation of tftp daemon functionality in the form of a
> Windows program (yuk!) (and, yes, the source is available as
> well, but it has Windows-specific code littering the code, if I
> recall correctly). The tftp client in the Cisco case uses the
> default block size of 512 bytes, and with this combination, it
> can actually transfer the wireless controller image file.
>
> The "block numbers" in the tftp protocol are actually not
> designed to do "random access" in the server-side file, it's
> designed to distinguish between duplicate blocks and new blocks
> at the client. If the client and server implements a 0.5 * 2^16
> "block number window", and they allow the block number to wrap
> around the 2^16 mark, it may actually work to transfer files
> larger than 32MiB without increasing the block size above the
> default 512 bytes.
>
> The RFCs specifying the block size extension mention speed as a
> motivation for the extension, not the ability to transfer files
> larger than 32MiB...
>
> I've not actually had the time to sit down to see if a patch
> could be made to the NetBSD tftp daemon (and client) to allow
> such operation.
FWIW, we had to fix a similar issue to tftp a large file from
the windows vista installation. Konstantin Kabassavov came up
with the attached patch; I didn't check it in details.
It also handle '\' vs '/'.
--
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
NetBSD: 26 ans d'experience feront toujours la difference
--