[PATCH] fix the Sorcerer's Apprentice Syndrome in tftp (-g)

Baruch Siach baruch at tkos.co.il
Fri May 8 03:43:26 UTC 2009


Hi busybox mailing list,

The attached patch fixes a variant of the famous Sorcerer's Apprentice 
Syndrome (http://en.wikipedia.org/wiki/Sorcerer's_Apprentice_Syndrome) in the 
tftp client.

I'm seeing this bug on tftp downloads (-g). When a DATA packet is received 
from the tftp server after more than 50ms, the tftp client resends TFTP_ACK, 
thus getting the DATA packet twice, and acknowledging it twice.  From this 
point on each DATA packet is sent and acknowledged twice. If another timeout 
occurs, we get three DATA packets for each block, and no on. At some point we 
saw hundreds of packets being sent for one block. In one instance the transfer 
of a 2.5MB file took a few hours to complete. Using http/ftp for the same 
transfer takes less than 15 seconds.

This patch actually reverts r10885 (and r10477 which is a duplicate) as 
resending a TFTP_ACK is not needed anymore. I verified that the current code 
recovers from lost ACKs correctly. Dropping a few TFTP_ACK during the transfer 
didn't break the transfer.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tftp-retransmit-bug.patch
Type: text/x-diff
Size: 407 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090508/f7812cbe/attachment.bin>


More information about the busybox mailing list