[U-Boot] [PATCH 1/3] net: defragment IP packets

Alessandro Rubini rubini-list at gnudd.com
Fri Jul 31 17:44:55 CEST 2009


> What I'm talking about is:
>  - start a tftp file transfer.
>  - CNTR-C it, causing a partial reassembly to done.
>  - start a new transfer.

Yes, exactly the case I observed. But you are not guaranteed a partial
reassembly happens, as you should be ctrl-c-ing at the exact right
time.

> All I did was add this to the start of NetLoop() to ensure that
> things are OK.
> 
> #ifdef CONFIG_IP_DEFRAG
> memset(pkt_buff, 0, IP_HDR_SIZE_NO_UDP);
> #endif

And the behaviour changed? It's strange, as the new fragments will most
likely (but 1/64k) have a different ID.
 
>> The old instance of the TFTP server resends the last packet of the 
>> aborted xfer, 

It sounded strange to me as well, but with atftpd it is what happens.
Earlier I had plain-old tftpd, which didn't even support blksize
option.

Here it is, from PC to PC:

17:28:49.166859 IP morgana.45177 > rudo.32854: UDP, length 516
17:28:49.167030 IP rudo.32854 > morgana.45177: UDP, length 4
17:28:49.167338 IP morgana.45177 > rudo.32854: UDP, length 516
17:28:54.173411 IP morgana.45177 > rudo.32854: UDP, length 516
17:28:59.178620 IP morgana.45177 > rudo.32854: UDP, length 516
17:29:04.183788 IP morgana.45177 > rudo.32854: UDP, length 516
17:29:09.188972 IP morgana.45177 > rudo.32854: UDP, length 516
17:29:14.194160 IP morgana.45177 > rudo.32854: UDP, length 516

atftpd repeats after 5, 10, 15, 20, 25 seconds, and nothing more.

I installed the hpa version just for trying (but I'm getting back to
atftpd, as i don't like the grub-like restriction "only absolute
pathnames").

It behaves similarly:

17:40:42.404539 IP morgana.54278 > rudo.32854: UDP, length 516
17:40:42.404717 IP rudo.32854 > morgana.54278: UDP, length 4
17:40:42.404972 IP morgana.54278 > rudo.32854: UDP, length 516
17:40:43.407340 IP morgana.54278 > rudo.32854: UDP, length 516
17:40:45.409766 IP morgana.54278 > rudo.32854: UDP, length 516
17:40:49.414101 IP morgana.54278 > rudo.32854: UDP, length 516
17:40:57.422814 IP morgana.54278 > rudo.32854: UDP, length 516
17:41:13.439200 IP morgana.54278 > rudo.32854: UDP, length 516

Here it's 1, 3, 7, 16, 31 seconds.

> As a minimal test - since we are only talking about tftp and nfs (so
> far) - if we did not attempt to assemble packets which are not
> coming from the serverip, that might be an OK thing to do...
>
> if (NetReadIP(&ip->ip_src) != NetServerIP)

Yes, I agree. 

> All I'm asking for is something robust... :)

Great, thanks
/alessandro


More information about the U-Boot mailing list