0

I have a simple c program to copy an image from the server using TCP

The problem is it always fails to work with certain images, it only receives 'x' bytes and then times out.

The program is not the problem here since i have tried with different programs(C and python using bigger recv buffers) using TCP and they still fail at 'x'th bytes.

server: vxworks 
client: linux

if i try connecting from SUN client using the same code, it has no problem receiving the image. I did a bit of packet sniffing and found that my client is requesting packet 'A' which has the 'x'th byte in it. The server sends it or re-transmits it, but the client never acknowledges it and timesout eventually.

Question is why is this image specific ? and only happens on linux client?

the file written to the client is always 'x' bytes long

maheshg
  • 339
  • 2
  • 7
  • 17

2 Answers2

1

It looks like network issue for me. What is the size of packet? Sounds strange but could not it be MTU blackhole between server and linux?

user996142
  • 2,753
  • 3
  • 29
  • 48
  • size if 1514 with data of 1460... but why fail for only this particular image and not others? – maheshg Apr 20 '12 at 21:23
  • there must be no connection between the failure and That image in particular. Simply, you can't reliably "transfer" data of arbitrary size without a protocol layer that specifies how many bytes are expected. – ShinTakezou Apr 20 '12 at 21:52
1

My friend once experienced this exact same problem and it turned out to that the payload of the binary image he was transferring was triggering a bug in a filtering router along way. The route would just drop the connection when a particular byte sequence passed through. Bizarre but true.

xphoon
  • 36
  • 1
  • this might make sense since SUN slices it differently than the Linux machine... this particular byte sequence is seen only at the end of a TCP data-payload when using linux and that is the packet client keeps on requesting and times out... – maheshg Apr 20 '12 at 22:00
  • do you know the system specifics or the byte sequence that caused sucha a problem? – maheshg Apr 20 '12 at 22:10
  • Saw something similar on HP PCs back in about 2000. The bitmap of death - would induce BSOD on Windows if saved to disk. –  Apr 20 '12 at 22:56