Giter VIP home page Giter VIP logo

Comments (12)

mpetazzoni avatar mpetazzoni commented on July 4, 2024

Hmm, I'm not sure what you mean. To my knowledge there is no windowing mechanism in UDP. But to be honest that's not something I've looked at in a very long time. Could you elaborate on what you're looking for?

from ptftpd.

isaiahtaylor avatar isaiahtaylor commented on July 4, 2024

@mpetazzoni thank you for the quick response.

There are some specifications of TFTP that allow for streaming; the server that replies with a file will simply stream the file, sending data packets without waiting for ACKs. However, so that the client doesn't get overloaded, there is a protocol to negotiate a window of time where a certain amount of packets may be received. See this: https://www.compuphase.com/tftp.htm and search on the page for the header "Unreliable data streaming"

from ptftpd.

isaiahtaylor avatar isaiahtaylor commented on July 4, 2024

The question is whether anything like that is implemented in either the server or the client.

from ptftpd.

isaiahtaylor avatar isaiahtaylor commented on July 4, 2024

See this RFC specification, https://tools.ietf.org/rfc/rfc7440.txt, and which depends on the option extension: https://tools.ietf.org/html/rfc2347

from ptftpd.

mpetazzoni avatar mpetazzoni commented on July 4, 2024

Interesting! Looks like that RFC is more recent than ptftpd, which probably explains why I didn't look at it when I initially worked on this project 😄

One of the design principles of ptftpd is support all the TFTP-related standards (and to follow the RFCs very precisely), and to do so in a clean, well-documented way in the code. Sadly I don't think I would have time to work on it these days, but if you're interested in implementing support for it, I'd welcome the contribution!

from ptftpd.

mpetazzoni avatar mpetazzoni commented on July 4, 2024

(I may also get bored on day on a flight and decide to do it, but it's hard to say when that would be -- maybe in a couple of months?)

from ptftpd.

mpetazzoni avatar mpetazzoni commented on July 4, 2024

Hey @iptaylortechnical, I've implemented support for RFC7440. It's available in master, and I'm also about to push version 1.3 to PyPI. Let me know if you get a chance to test it!

from ptftpd.

isaiahtaylor avatar isaiahtaylor commented on July 4, 2024

@mpetazzoni wow! Thank you so much! I really appreciate this work! I will take a look at the code and PR any improvements I can find.

from ptftpd.

mpetazzoni avatar mpetazzoni commented on July 4, 2024

My only gripe with it is that it probably no longer works on Windows now because the server needs to identify the maximum UDP datagram size via sysctl to confirm that the requested blocksize and windowsize will fit in the UDP send buffer, and potentially adjust the windowsize accordingly to fit.

I haven't found a good way to determine this programmatically, so if you have any ideas, I'm all ears!

from ptftpd.

isaiahtaylor avatar isaiahtaylor commented on July 4, 2024

@mpetazzoni I will give that some thought.

A quick question: is there a reason that you use datetime.today() to take timestamps rather than time.time()? The reason I'm asking is that the system I'm on may not have access to the datetime object but will have access to the time object. Is that a vital difference? The only instances I see in the code use it as a timestamp only for measuring a time 1 and time 2. Is that accurate, and would it be an issue if I had to modify it straight across to time.time()?

Related, would a PR for that be appreciated? Guessing not as it works as is. It is interesting to note, however, that datetime.today() is equivalent to date.fromtimestamp(time.time()) as shown here. So basically just wrapping time.time() as something human readable. If I'm not mistaken, the wrapping could just be removed.

Let me know whether I've understood the purpose, and whether a PR would be helpful.

from ptftpd.

mpetazzoni avatar mpetazzoni commented on July 4, 2024

Yup, I wrote this a long time ago when I was not nearly as good in Python (it was a good learning exercise!). time.time() will work just as well, feel free to send a PR.

from ptftpd.

isaiahtaylor avatar isaiahtaylor commented on July 4, 2024

@mpetazzoni as for the Windows datagram size, it seems windows has the upper bound of 65507 bytes for a datagram packet. That of course says nothing about what the network can handle. But you could just hardcode that in case of a windows system.

from ptftpd.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.