If you have done IOS upgrade of this latest Cisco 3850 switch you may noticed a TFTP file transfer is taking longer time.
I have come across this issue multiple times & it almost took more than 20 min to copy ~250MB image to switch flash when using TFTP. As shown in the below it took 1548s (~26min) to copy the image via TFTP & my transfer speed was ~1.3Mbps (166150 Bytes/Sec)
3850-2#copy tftp://10.128.13.2/cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin flash: Destination filename [cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin]? Accessing tftp://10.128.13.2/cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin... Loading cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin from 10.128.13.2 (via Vlan1600): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 257243236 bytes] 257243236 bytes copied in 1548.260 secs (166150 bytes/sec)
Tried with different TFTP servers, different Operating Systems (Windows, MAC OX,etc) & every time it took more than 25 mins.
Then I did the same file transfer via FTP . This time it took only around 261s (4.3 min) & copied 7.5 Mbps (984249 Bytes/Sec) which is much better than the TFTP transfer speed which was ~ 1.3 Mbps.
3850-2#copy ftp://10.128.8.214/firmware/cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin flash: Destination filename [cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin]? Accessing ftp://10.128.8.214/firmware/cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin...!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 257243236/4096 bytes] 257243236 bytes copied in 261.360 secs (984249 bytes/sec)
Here is the file transfer rate If I do it via USB stick directly attached to the switch. As you can see file transferred within 60s & I got around 32.8Mbps (4295262 Bytes/Sec) transfer rate. If it is new installation, you can use this method, but in a existing network IOS upgrade , it is practically difficult to use this method as you have to physically attach USB on to the switches.
3850-2#copy usbflash0:cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin flash: Destination filename [cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin]? Copy in progress...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 257243236 bytes copied in 59.890 secs (4295262 bytes/sec)
Based on the above, I did not have clear understanding why TFTP is that slow in this latest & greatest 3850 switch. But I stopped using TFTP for IOS image upgrade, instead get used to FTP method. I posted this thread on 30th September 2013 in CSC forum to find an answer. There was not direct answer to this for past 6 months. It all changed yesterday as I noticed Luke Primm from Cisco gave me the clear reason for this slow TFTP speeds & how to overcome that . Here is Luke’s word in response to my query.
” Hello Rasika,
By default, the Catalyst 3850 uses a tftp block size value of 512, which is the lowest possible value. The reasoning behind this default value is to ensure interoperability with legacy tftp servers.
For IOS-XE version 3.3.2 and below, you will have to manually change the block size in the global configuration to speed up the transfer process. The example below is a transfer comparison when using the default block size of 512K versus a transfer using the maximum block size value of 8192K.
Hope that helpls
Luke”
So here is how I can fix my slow TFTP transfer rate of this 3850 switch. You have to increase the TFTP blocksize from 512 bytes (min) to 8192 bytes (max)
3850-2(config)#ip tftp ?
blocksize Specify TFTP client blocksize
boot-interface Force interface to use for TFTP booting
min-timeout Set minimum timeout period for retransmission
source-interface Specify interface for source address in TFTP connections
3850-2(config)#ip tftp blocksize ?
<512-8192> blocksize value
3850-2(config)#ip tftp blocksize 8192
Before go ahead & do the file transfer test & compare the result, let’s look at how this increased TFTP blocksize works. RFC2348-TFTP Blocksize Option describe what options you can have. When you configure increased blocksize, TFTP client will initiate (if you copy a file to TFTP client) the request with blocksize option to set that increased value. Here in my example you can see 3850-2 switch send TFTP Read Request with blocksize 8192 as an option.
If the server is willing to accept the blocksize option, it sends an Option Acknowledgment (OACK) to the client. The specified value must be less than or equal to the value specified by the client. The client must then either use the size specified in the OACK, or send an ERROR packet, with error code 8, to terminate the transfer. In my case TFTP server accept this block size and send OACK.
So client is confirming usage of the increased block size & informing server that it is ready to accept data block 1.
Then data transfer starts with 8192 octet block sizes & here is the block 1.
So here is the final result with blocksize of 8192. As you can see below same file copied less than 2 mins
3850-2#copy tftp://10.128.13.2/cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin flash: Destination filename [cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin]? Accessing tftp://10.128.13.2/cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin... Loading cat3k_caa-universalk9.SPA.03.03.02.SE.150-1.EZ2.bin from 10.128.13.2 (via Vlan1600): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 257243236 bytes] 257243236 bytes copied in 118.770 secs (2165894 bytes/sec)
As you can see, ~250MB file transfers less than 120s (or 2 min) & speed I was getting it ~16.5Mbps (2165894 bytes/Sec). This is a really great & TFTP file transfer rates won’t be slow it down.
So bottom line is configure “ip tftp blocksize 8192” command on your 3850 switch configuration as template command as long as that is supported by your TFTP server.
This is important as IOS-XE images are 250-300MB in size. In legacy switches, even with 512 block size slow file transfer rates may not affect as image sizes are less than 32MB in size most of the cases. But I doubted you would waste 20min to copy a image across for a switch upgrade.
Thanks Luke 🙂
Aug 2019 – Update
Leo (CSC VIP) pointed me out a bug CSCvq01204, that could be triggered if you set TFTP block size to 8192. It seems like only affected 16.6.x & better to lowering blocksize to 1468 or lower, if you hit with it.
Symptom:
An IOS-XE based C3K switches are not able to receive a file copy from a TFTP server when TFTP blocksize is set to 8192.
Conditions:
Catalyst 3K running on 16.6.6 code. Whether DHCP snooping is enabled globally or not does not affect the test result. This issue is not CSCvk53444.
Workaround:
If TFTP blocksize value is 1468 or lower, transmission works.
Excellent post. Thanks! I noticed something similar with a 5508 WLAN controller recently. TFTP was extremely slow, and FTP was much faster. I think I shall go investigate.
Not sure on 5508, you can change TFTP blocksize. May be stiking to FTP is a good idea if it is faster…
HTH
Rasika
Awesome Work!
Thanks Stewart…..
The same command can be run on a 5700 series WLC – same symptoms.
Hi Luke,
Glad you saw this post as credit should go to you pointing out this.
Yes, this can apply for 5760. I think this applicable for other catalyst as well 3750/2960/etc. Since image size is small for those, it does not make huge difference in time taken to file copy.
Is there any show command to verify TFTP blocksize of a switch (other than show run | in tftp) ?
Rasika
I just saw that this option can also be set on an AP itself, which in turn would increase the speed of pre-downloading a new image. However as it has to be set on each AP separately it not really scalable in a high AP count environment. Unless of course, Cisco once decides to implement such a feature to roll out on the APs.
Patrick
Yes, it is useful feature if Cisco can implement it to configure via WLC for those.
Rasika
Dude! You flipp’n rock! I ran into this yesterday… of course, I should have checked your blog!
Side note: How deep have you gone with Bonjour, Apple TV fun on the 5760?
-Paul 😉
Thanks!
Hi Paul,
IOS-XE 3.6 will come with lots of improvement, I will wait for that code & play with Bounjour/Apple TV. Will post here as I play.
Thanks for feedback 🙂
HTH
Rasika