We help IT Professionals succeed at work.

What is causing jpeg image file corruption during upload to website

I've run into a problem that I've been unable to figure out.
I have a Dell Optiplex 755 running Windows XP Pro.
The Optiplex has a wired full duplex gigabit Ethernet connection to a Dell PowerConnect 2816.
The 2816 is connected to a Cisco RV 120W Wireless VPN Router.
That is connected to a Comcast IP Gateway.

If I try to upload a JPEG image file from the Optiplex to a business website, the JPEG file is corrupted.  The file size doesn't change, but the image is changed.  Never the same way.

Image file sizes range from 78K to 2.7M.

Transfers using filezilla in binary mode fail.
Files using Network Solutions upload screen also fail.

If I copy the same images to my netbook running Windows XP Home Edition.  Connect the netbook to a port on the PowerConnect, I can upload the files consistently and without corruption.

That would seem to indicate a problem with the Optiplex.

File transfers from the Optiplex to shared folders on other systems do not have problems.
Network statistics do not show an excessive number of anything.

I replaced the cable connecting the Optiplex to the PowerConnect.
I connected the Optiplex directly to the Cisco router.
Both did not change the results.  Uploads still failed.

I'm wondering if it's a flaky network interface on the Optiplex.
I've also wondered if it could be a flow control issue.  The gigabit transfer is going to bog down at the PowerConnect where it drops from 1 Gig to 100 Meg.
Comment
Watch Question

I would start by checking the ports in the path for any errors or dropped packets.

Author

Commented:
I switched the Optiplex to a different port on the PowerConnect and still had the problem.
I also plugged it directly into the Cisco VPN router and that didn't solve the problem.

Tomorrow (Thursday) I will attempt to connect the Optiplex directly to a port on the Comcast IP Gateway.  The firewall on the gateway is disabled but there is firewall software on the Optiplex so it should be relatively safe for the duration of the experiment.

I will check the statistics on the PowerConnect as well.

I really want to get this resolved so any comments or suggestions are greatly appreciated.
Hi,

What are the duplex settings on the Optiplex and the switch?

In what way are the images corrupt? Do they open?

Author

Commented:
I don't know the settings from the switch side.
The NIC in the Optiplex is set to 1 Gig Auto Negotiate.
There is no option to force it to the 1 Gig level.

I also tried downgrading the link speed to 100 Meg.  That didn't solve the problem.

All of the images open.  Typically, parts of the image will display correctly.  Other times:
 - image is clean except for two horizontal lines of color.
 - part of image is clean the rest had a different color added to it so the background and the subject are washed in that color.
 - horizonal bands of color are overlayed on the image.  I've included a screen clipping with this post.




Corrupt-Image-TF2M1.jpg
Where are you viewing them from?

Author

Commented:
The images were uploaded to a webserver then viewed using Firefox.

Once uploaded they were downloaded to the netbook and displayed using Windows Picture and FAX viewer.

Since the image is 7.9 Meg, I transferred a copy to my business PC.  I used Windows Picture and FAX viewer to display it.  Then used GIMP to create a screen capture of it.

When I used GIMP to load the bad image file, I got an error message saying that it was corrupt.
Are they corrupt when you view them on the webserver?

Author

Commented:
Yes, the images are corrupt when viewed on the webserver.

After a long evening staring at Wireshark packet dumps and hex dumps of the good and bad image files, I know what happened.

The Optiplex NIC transmitted the file correctly.  However, the corrupt file contained two copies of one data frame.

The normal file had the FTP-DATA frames reassembled in sequence: 1 2 3 4 5 6 7...
The corrupt file contained the sequence: 1 3 2 3 4 5 6 7...

The file was reassembled incorrectly.

Using the ping -f option, I was able to determine that the default 1514 MTU was causing each packet to be fragmented.  The fragmentation could be avoided by reducing the MTU to 1470.

However, the corruption still occurred until I dropped the MTU to 1300.  In reality it could go a bit higher than that.  Maybe 1312 but I figured I'd leave it alone for now.

I also installed a new Gigabit Ethernet NIC.  This became necessary because I changed the Power Connect settings for the port used by the Optiplex to lock it at 100Meg Full Duplex.  In doing so, the NIC on the Optiplex behaved as if the cable had been disconnected.

When I disabled the NIC, it stuck in that mode and I could only disable it again.  The enable option never came active.

I suspect that when I took the Power Connect port out of Auto Negotiate mode, it disabled the MDI/MDIX detection as well.  The new NIC apparently could adapt to the cable wiring and came right up.

So for now, things are good.  I still want to go back and tweak things a bit.

There's a bit more information I want to add and will talk about points at that time.

Author

Commented:
The problem is still there and yes, the files are corrupt once they're uploaded on the webserver.

The curious thing is that the files never change in size.   By using a file comparison program, I've discovered that the file is being corrupted because one of the data packets is being used twice in the destination file.

For example, during upload, FileA.jpg is split into individual packets that are transmitted to the destination server.  Under normal circumstances, the file would be reassembled by placing the packets in their original order 1, 2, 3, 4, 5 and 6.

What appears to be happening in the corrupt file is that the file is being transmitted or reassembled such that the order becomes 1 2 5 3 4 5.  One of the packets is somehow being included in the file twice.

Since this problem does not occur when files are transferred between computers on the business network, the problem would logically be caused by a problem with the WAN link/firmware supporting the Power Connect managed switch, the wireless router or the Comcast Business IP Gateway.

I will be working to isolate the problem tomorrow.
Commented:
The problem appears to be due to a bug in the firmware for the Cisco RV 120W router.  When the problem first occurred, the testing with the netbook seemed to rule out the Cisco and Dell PowerConnect since I could upload images using the netbook.

To try and move things forward, I connected a Cisco E4200 wireless router to the Comcast IP Gateware and connected the Dell Optiplex to it.  All uploads succeeded.  Connecting the Optiplex back to the RV 120W caused the problem to reoccur.

I took the RV 120W off-site and was able to reproduce the problem using the Netbook.  Upgrading the firmware to 1.0.2.6 appears to have fixed the problem.

The symptoms of this problem were:
the inability to upload images or files larger than 2.5 Gig.
the failure of cloud based backups.
 

The nature of the bug must have caused it to happen only when the right conditions existed.  Otherwise, I would have seen the problem with the netbook from the get-go.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.