altugbakan / rs-tftpd

TFTP Server Daemon implemented in Rust
https://crates.io/crates/tftpd
MIT License
51 stars 14 forks source link

Option to send Duplicate Data Packets #5

Closed lupyuen closed 11 months ago

lupyuen commented 11 months ago

Hi: Thank you so much for the excellent work on rs-tftpd! Your project was very helpful for troubleshooting a strange TFTP Timeout problem on a RISC-V SBC (Star64), I wrote about it below. Thanks again! :-)

altugbakan commented 11 months ago

Hello!

Thank you so much for using rs-tftpd on an environment! My idea for building this was actually to use it with u-boot at work. Do you think adding a burst-sending option can be helpful for things like this? We can add a new flag for resending all packets every time.

Do you think this would be a helpful addition? Did you have any other issues while working? Thanks again!

lupyuen commented 11 months ago

Great to hear that we're both having U-Boot TFTP issues :-)

Yes it would be very helpful to have a Command-Line Option that will send Duplicate Data Packets! I wonder if we need a Delay between the Duplicate Packets, should that be another option? (I inserted a 1 millisecond delay between Duplicate Packets)

rs-tftpd works great for me, I have no other requests. (Though I'm still trying to figure out how to install it as a Linux Service)

This U-Boot TFTP Timeout issue feels very strange. I hope it's not something simple that I missed, like a faulty network cable :-)

acassis commented 11 months ago

@lupyuen did you compare rs-tftpd against the default tftpd package from Ubuntu/Debian? Is this issue happening with this tftpd as well?

lupyuen commented 11 months ago

@acassis Yes I saw the same TFTP Timeout when using the standard xinetd + tftpd on Raspberry Pi 4 (32-bit Debian): https://lupyuen.github.io/articles/tftp2#all-things-considered

I have a hunch that it's something inside U-Boot for JH7110 that's dropping UDP Packets, causing Resends and Timeouts.

altugbakan commented 11 months ago

Hey @lupyuen! I added a pre-release for supporting duplicate packets. You can use tftpd --duplicate-packets <NUM> to make the server send packets more than once.

If you have time, would you be so kind to try it and see if it is working as you intended? Thanks!

lupyuen commented 11 months ago

@altugbakan Thank you so much! It seems we need to insert a delay between duplicate packets: https://github.com/altugbakan/rs-tftpd/pull/7

Also I hope I got this right: The option --duplicate-packets 2 will actually send 1 original + 1 duplicate packet?

Wonder if we might confuse folks? Should we shift it to --duplicate-packets 1?

Thanks again for adding this option, we finally have a proper solution for our U-Boot issue :-)

stappersg commented 11 months ago

On Sun, Oct 08, 2023 at 01:16:59AM -0700, Lup Yuen Lee wrote:

Also I hope I got this right: The option --duplicate-packets 2 will actually send 1 original + 1 duplicate packet?

Wonder if we might confuse folks? Should we shift it to --duplicate-packets 1?

For what it is worth: I prefer '--duplicate-packets 1' for original packet and one duplicate.

So also --duplicate-packets 2 for orig plus two extras.

After all is without the duplicate packets option without duplicates.

Groeten Geert Stappers -- Silence is hard to parse

altugbakan commented 11 months ago

I think changing the duplicate packets option with the number of duplicate packets makes more sense, thanks! I also will try to add a default delay.

altugbakan commented 11 months ago

Added with #7