Comments (12)
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.
@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.
The question is whether anything like that is implemented in either the server or the client.
from ptftpd.
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.
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.
(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.
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.
@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.
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.
@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.
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.
@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)
- Client isn't swapping ports after first block 1 data packet from (any) server HOT 6
- Python 3 support HOT 1
- python3 experimental HOT 3
- DHCP Server Offering IPs to All Clients HOT 1
- Broken on Linux HOT 2
- get_ip_config_for_iface() python3 error
- Feature: DHCP scope (PR #23)
- Feature: MAC Based Leases / DHCP Accept Previous Clients
- Feature: Optional HTTP Server
- RecursionError in TFTPServer.send_response HOT 2
- Medium-ish size transfer fails HOT 1
- tftp Not working on Windows with Python 3.7 HOT 2
- Protocol gets out of sequence if the client misses packets. HOT 1
- cannot stat /proc/sys/net/inet/udp/maxdgram HOT 2
- tftpserver.py - Directory traversal attack HOT 1
- PXE boot - WARNING(tftpd): Error packet received! HOT 6
- Allow the usage of IOStrings and do not close file objects
- Cisco IOS uploads to ptftpd fail with "File already exists error" HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ptftpd.