Closed lupyuen closed 1 year ago
... is the intended effect putting the delay only between the packets, or before each packet?
That question trigger this question:
What if a duplicated packet is actual a delayed packet?
Longer version:
What if a duplicated packet transmitted by TFTP server is for the TFTP client a packet is could catch on time?
Anyway: I suggest that in addition to "--delay-time-between-duplicates" for an option like "--delayed-response-time". That option is indepented from --duplicate_packets. What it does is give a TFTP client time to get ready to recieve packet after it did request for a packet. ( I imagine an immature network driver available in the U-BOOT environment. )
Groeten Geert Stappers -- Silence is hard to parse
Edits (sorry the previous hasty version)
On Sun, Oct 08, 2023 at 07:11:25AM -0700, Geert Stappers wrote:
That question trigger this question:
That question did trigger this question:
What if a duplicated packet is actual a delayed packet?
Longer version:
What if a duplicated packet transmitted by TFTP server is for the TFTP client a packet is could catch on time?
What if a duplicated packet transmitted by the TFTP server is for the TFTP client a packet it could catch on time?
Anyway: I suggest that in addition to "--delay-time-between-duplicates" for an option like "--delayed-response-time". That option is indepented from --duplicate_packets. What it does is give a TFTP client time to get ready to recieve packet after it did request for a packet. ( I imagine an immature network driver available in the U-BOOT environment. )
Groeten Geert Stappers -- Silence is hard to parse
Hi @stappersg: I hope I understood your question correctly, suppose our tftpd sends this sequence of packets to the client:
#1
#1
#2
#2
Our question: If the client correctly receives Original Packet #1
, will it handle Duplicate Packet #1
correctly?
Yes the TFTP Client should drop Duplicate Packet #1
, because the Block Number is encoded inside the packet. We see this behaviour in curl
:
$ curl -v --output initrd tftp://192.168.31.10/initrd
* Received last DATA packet block 1 again.
* Received last DATA packet block 2 again.
Apparently U-Boot will drop Duplicate Packets too, because otherwise our Kernel Image would have been corrupted over TFTP and our device will fail to boot. (So far I haven't seen any boot failures due to corrupted Kernel Image)
Which leads to another question: Why don't we throttle the Original Packets and omit the Duplicate Packets?
#1
#2
We tried throttling tftpd to do the above, but it doesn't fix the TFTP Timeouts. (Details here)
So I agree with you, there seems to be a problem with the Network Drivers in some ports of U-Boot. (Maybe it's not responding to I/O Interrupts quick enough? Or it has run out of Network Buffers?)
On Sun, Oct 08, 2023 at 11:12:02PM -0700, Lup Yuen Lee wrote:
Stappers
What if a duplicated packet transmitted by the TFTP server is for the TFTP client a packet it could catch on time? ....
- Original Packet
#1
- Delay 2 milliseconds
- Original Packet
#2
- Delay 2 milliseconds
We tried throttling tftpd to do the above, but it doesn't fix the TFTP Timeouts. (Details here)
So I agree with you, there seems to be a problem with the Network Drivers in some ports of U-Boot. (Maybe it's not responding to I/O Interrupts quick enough? Or it has run out of Network Buffers?)
What I think what could work
client sends request for packet #1
server gets request for packet #1
server waits (meanwhile client switches to recieve mode)
server sends packet #1
client processes packet #1
client sends request for packet #2
server gets request for packet #2
server waits (meanwhile client switches to recieve mode)
server sends packet #2
client processes packet #2
Who it is made working with "duplicates":
client sends request for packet #1
server gets request for packet #1
server sends packet #1 (meanwhile client switches to recieve mode)
server sends duplicate of packet #1
client processes packet #1
client sends request for packet #2
server gets request for packet #2
server sends packet #2 (meanwhile client switches to recieve mode)
server sends duplicate of packet #2
client processes packet #2
Answer of problem might be finding out time for steps 03 and 08.
Groeten Geert Stappers -- Silence is hard to parse
Hi: Thanks for adding the option for Duplicate Packets. Based on my testing, we need to insert 1 millisecond delay between the Duplicate Packets. (Should this be another option?)
Without Delay: U-Boot JH7110 boots slower (5.7 Mbps), with 2 TFTP Timeouts
With Delay (1 millisecond): U-Boot JH7110 boots faster (8.8 Mbps), with No TFTP Timeouts
This was tested on macOS over Wired Ethernet. Thanks :-)