Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medium-ish size transfer fails #28

Open
remleduff opened this issue Nov 19, 2019 · 1 comment
Open

Medium-ish size transfer fails #28

remleduff opened this issue Nov 19, 2019 · 1 comment

Comments

@remleduff
Copy link

Trying to transfer a ~100 MB ubi image to an embedded device running uboot.

I first had to apply the patch from #20 to allow the server to run at all on Linux.

The file transfers, apparently nearly all of the file, but it fails at a consistent point with the following traceback:

Exception happened during processing of request from ('192.168.5.1', 3675)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib64/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib64/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib64/python2.7/SocketServer.py", line 651, in __init__
    self.finish()
  File "/usr/lib64/python2.7/SocketServer.py", line 731, in finish
    self.socket.sendto(self.wfile.getvalue(), self.client_address)
error: [Errno 90] Message too long

On the client, it aborts with: TFTP error: 'Unknown transfer ID.' (5)

I'm running python 2.7 on Centos 7

@computercolin
Copy link

computercolin commented Jun 13, 2023

I observe this as well. Looking at transfers using Wireshark, it appears this library does not support block number rollover (wraparound). Running both on Debian and MacOS, I see the transfer reach block 65535 and ptftpd raises the above exception. Tested clients were the included ptftp, and curl (which is confirmed to support rollover).

If you want to use this library, one direction is to use very large block sizes. 9000+. At 9000 byte blocks, you would be able to transfer files roughly 580 MB in size. This library claims to support the block size option, so a client can request large blocks, however I also observed the library to choose smaller blocks than the MTU on my NIC would allow, so you may have to do some hacking around in the block size discovery logic.

Block sizes up to 65464 are possible, and these allows sending very large files over tftp without block number rollover. However, very large blocks requires that 1) your network sends fragmentation-needed messages and 2) the client correctly handles packet fragmentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants