* [U-Boot] Is there file size limiation of tftp @ 2012-08-12 1:21 J.Hwan Kim 2012-08-12 3:03 ` Mike Frysinger 2012-08-12 15:41 ` Jerry Van Baren 0 siblings, 2 replies; 5+ messages in thread From: J.Hwan Kim @ 2012-08-12 1:21 UTC (permalink / raw) To: u-boot Hi, everyone Is there any limit of file size for tftpboot? I have a problem downloading the file of which file size is 65MB. The procedure stops in the middle of downloading. Thanks in advnace. Best Regards, J.Hwan Kim ----------------------------------------------------------------------------------------------------------------------------- # tftp 0xc0000000 192.168.100.10:system.img smc911x: detected LAN9221 controller smc911x: phy initialized smc911x: MAC c3ea1460M (00405c260a5b) TFTP from server 192.168.100.10; our IP address is 192.168.100.50 Filename 'system.img'. Load address: 0xc0000000 Loading: T ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ########## ^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] Is there file size limiation of tftp 2012-08-12 1:21 [U-Boot] Is there file size limiation of tftp J.Hwan Kim @ 2012-08-12 3:03 ` Mike Frysinger 2012-08-12 15:41 ` Jerry Van Baren 1 sibling, 0 replies; 5+ messages in thread From: Mike Frysinger @ 2012-08-12 3:03 UTC (permalink / raw) To: u-boot On Saturday 11 August 2012 21:21:03 J.Hwan Kim wrote: > Is there any limit of file size for tftpboot? not really. how much unused RAM do you have ? > I have a problem downloading the file of which file size is 65MB. did you overwrite u-boot or something ? -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120811/0dc8be98/attachment.pgp> ^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] Is there file size limiation of tftp 2012-08-12 1:21 [U-Boot] Is there file size limiation of tftp J.Hwan Kim 2012-08-12 3:03 ` Mike Frysinger @ 2012-08-12 15:41 ` Jerry Van Baren 2012-08-12 21:09 ` Wolfgang Denk 2012-10-02 6:34 ` Simon Glass 1 sibling, 2 replies; 5+ messages in thread From: Jerry Van Baren @ 2012-08-12 15:41 UTC (permalink / raw) To: u-boot On 08/11/2012 09:21 PM, J.Hwan Kim wrote: > Hi, everyone > > Is there any limit of file size for tftpboot? > I have a problem downloading the file of which file size is 65MB. > The procedure stops in the middle of downloading. > > Thanks in advnace. > > Best Regards, > J.Hwan Kim > > ----------------------------------------------------------------------------------------------------------------------------- > > # tftp 0xc0000000 192.168.100.10:system.img > smc911x: detected LAN9221 controller > smc911x: phy initialized > smc911x: MAC c3ea1460M (00405c260a5b) > TFTP from server 192.168.100.10; our IP address is 192.168.100.50 > Filename 'system.img'. > Load address: 0xc0000000 Probably what Mike said. Note that 64MB is 0x40000000 and your load address is 0xC0000000... add the two together and you get 0x1_0000_0000 which is a very suspicious number. Having said that, there are two places where TFTP implementations have problems. The block number is a 16 bit unsigned integer. The easier (and less often problematic) one is where the block number goes from 0x7FFF to 0x8000. If an implementation erroneously treats the block number as a *signed* integer, it will screw that up. The second size limit stumbling block is when the block number hits 0xFFFF, what is the next block number? Some implementations just give up and limit the maximum file size to 64K-1 blocks[1]. If your block size is the default 512, that makes the maximum file size 32MB. If your block size is 4K, it will make the maximum file size 256MB. RFC1350[2] is silent on the issue, probably because the authors never considered using TFTP with files bigger than 32MB. TFTP does use block number 0 in a special way to ACK the write request and says "block numbers are consecutive and begin with one." The simpler and more intuitive interpretation of 0xFFFF + 1 is to wrap to 0x0000. The less intuitive one that honors 0 being special is to wrap to 0x0001. U-Boot wraps to 0, see net/tftp.c function update_block_number(). Your TFTP server needs to do the same. Best regards, gvb Ref: [1] <http://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol#Extensions> [2] <http://tools.ietf.org/html/rfc1350> ^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] Is there file size limiation of tftp 2012-08-12 15:41 ` Jerry Van Baren @ 2012-08-12 21:09 ` Wolfgang Denk 2012-10-02 6:34 ` Simon Glass 1 sibling, 0 replies; 5+ messages in thread From: Wolfgang Denk @ 2012-08-12 21:09 UTC (permalink / raw) To: u-boot Dear Jerry Van Baren, In message <5027CEB1.1070202@gmail.com> you wrote: > > Probably what Mike said. Note that 64MB is 0x40000000 and your load No. 64 MiB is 0x04000000; 0x40000000 is 1024 MiB. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "He only drinks when he gets depressed." "Why does he get depressed?" "Sometimes it's because he hasn't had a drink." - Terry Pratchett, _Men at Arms_ ^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] Is there file size limiation of tftp 2012-08-12 15:41 ` Jerry Van Baren 2012-08-12 21:09 ` Wolfgang Denk @ 2012-10-02 6:34 ` Simon Glass 1 sibling, 0 replies; 5+ messages in thread From: Simon Glass @ 2012-10-02 6:34 UTC (permalink / raw) To: u-boot Hi, On Sun, Aug 12, 2012 at 8:41 AM, Jerry Van Baren <gvb.uboot@gmail.com> wrote: > On 08/11/2012 09:21 PM, J.Hwan Kim wrote: >> Hi, everyone >> >> Is there any limit of file size for tftpboot? >> I have a problem downloading the file of which file size is 65MB. >> The procedure stops in the middle of downloading. >> >> Thanks in advnace. >> >> Best Regards, >> J.Hwan Kim >> >> ----------------------------------------------------------------------------------------------------------------------------- >> >> # tftp 0xc0000000 192.168.100.10:system.img >> smc911x: detected LAN9221 controller >> smc911x: phy initialized >> smc911x: MAC c3ea1460M (00405c260a5b) >> TFTP from server 192.168.100.10; our IP address is 192.168.100.50 >> Filename 'system.img'. >> Load address: 0xc0000000 > > Probably what Mike said. Note that 64MB is 0x40000000 and your load > address is 0xC0000000... add the two together and you get 0x1_0000_0000 > which is a very suspicious number. > > Having said that, there are two places where TFTP implementations have > problems. The block number is a 16 bit unsigned integer. > > The easier (and less often problematic) one is where the block number > goes from 0x7FFF to 0x8000. If an implementation erroneously treats the > block number as a *signed* integer, it will screw that up. > > The second size limit stumbling block is when the block number hits > 0xFFFF, what is the next block number? Some implementations just give > up and limit the maximum file size to 64K-1 blocks[1]. If your block > size is the default 512, that makes the maximum file size 32MB. If your > block size is 4K, it will make the maximum file size 256MB. Yes. If it helps, I found a limit of about 95MB, which is something like (the maximum tftp packet payload on Ethernet of about 1450) * 65535 or similar, caused by a buggy tftp server. When I switched to tftpd-hpa my problems went away. > > RFC1350[2] is silent on the issue, probably because the authors never > considered using TFTP with files bigger than 32MB. TFTP does use block > number 0 in a special way to ACK the write request and says "block > numbers are consecutive and begin with one." The simpler and more > intuitive interpretation of 0xFFFF + 1 is to wrap to 0x0000. The less > intuitive one that honors 0 being special is to wrap to 0x0001. > > U-Boot wraps to 0, see net/tftp.c function update_block_number(). Your > TFTP server needs to do the same. > > Best regards, > gvb Regards, Simon > > Ref: > [1] <http://en.wikipedia.org/wiki/Trivial_File_Transfer_Protocol#Extensions> > [2] <http://tools.ietf.org/html/rfc1350> > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-10-02 6:34 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-08-12 1:21 [U-Boot] Is there file size limiation of tftp J.Hwan Kim 2012-08-12 3:03 ` Mike Frysinger 2012-08-12 15:41 ` Jerry Van Baren 2012-08-12 21:09 ` Wolfgang Denk 2012-10-02 6:34 ` Simon Glass
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox