Sending packets with TCP/IP on QNX

I have a QNX box talking to a Windows XP box through an TCP/IP over ethernet link. I have wireshark inbetween to look at the packets.

I see that some packets from QNX box to XP box get lost every now and then. After a packet lost, QNX box sends couple more packets and some times does retransmission, but other times I dont see any retransmissions. QNX box just stops sending packets and only ACKs received packets from the remote end.

Anyone encountered a problem like this?

Thanks for all the replies.


Saying that a QNX box is talking via TCP/IP is a little vague. Do you mean TCP or UDP by any chance. Is this some utility like telnet or ftp or your own program?

Note that TCP/IP does NOT guarantee delivery of packets. It only guarantees that packets delivered will be correct. The detection of non-deliver and re-delivery must be done by the calling program.

That said, I’ve never seen a problem in a local area network like this. The only circumstance I can imagine in which this would happen would be 1) hardware problems, 2) a saturated bus (coaxial) Ethernet link.

It is my program. I open a socket and connect to the server. It is a TCP/IP over ethernet link.
thanks for the help. I’ll check on the hardware issue.

Regardless of whether you get your hardware working, you need to implement a resend protocol. There is a lot to say about this. The receiving end should send some kind of ACK when the data is received, and the sender needs to detect a timeout on receiving the ACK so it can resend. Finally, you need some way of detecting a loss of ACK. That is the packet data goes through, the ACK gets lost, and the data is resent. The receiver must detect that this is duplicate data, throw it out and send the ACK again.

I tried with another hardware and the issue remains.
I thought TCP handles resending and ACK as necessary. Doesn’t TCP support reliable tranmission?

Yes it does but there are limits, if the application or the hardware is broken, it will ultimately fail. The sender and receiver must handles those error properly. For example the connection can break, if you keep sending on it, that’ s not good.

If a connection is broken, then send() and recv() functions would return error and then my software would close the socket and open a new socket and reconnect to the server. I thought that should be the only error handling I needed.

Currently what I see is Send-Q is getting bigger and bigger (seen by netstat -an) and finally connection is closed and a new connection is opened but the problem remains.

Is there a way to see the timers related to TCP in QNX?

I found out the problem. We had a hub inbetween and it seems it is broken. Replacing the hub solved the problem. Thanks for all the help!