This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error on closing Tcp connection

Hello all,

I'm using the RealView Realtime Libary V3.10 and the RTX-Kernel. I want to implement an embedded server application based on a MCB2300 Board. So I tried the tcp sockets from the Realtime Libary. I just played around to get some experience how it works.

So the server is listening and waiting for a connection. If the client is connected, the server sends a "Hallo" (hello) and is waiting for data. If the first data packet is recieved by the server, it is sending a "Tschau"(Bye) and is closing the connection with the function tcp_close().

To test the example I used a simple telnet client and connect to the embedded server. Everything is working fine, but the closing of the connection has a myserios error. To get some informaztion whats happening I used Wireshark.

I could see the following packets.
(I used the FTP Port to improve the display of the send Data.)

No.     Time        Source                Destination           Protocol Info                                                            SrcPort
      6 6.068468    192.168.104.120       192.168.104.220       TCP      1237 > ftp [SYN] Seq=0 Len=0 MSS=1260                           1237
      7 6.111373    192.168.104.220       192.168.104.120       TCP      ftp > 1237 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1260       ftp
      8 6.111423    192.168.104.120       192.168.104.220       TCP      1237 > ftp [ACK] Seq=1 Ack=1 Win=65535 Len=0                    1237
      9 6.148777    192.168.104.220       192.168.104.120       FTP      Response: Hallo                                                 ftp
     10 6.311293    192.168.104.120       192.168.104.220       TCP      1237 > ftp [ACK] Seq=1 Ack=8 Win=65528 Len=0                    1237
     11 7.972288    192.168.104.120       192.168.104.220       FTP      Request: k                                                      1237
     12 8.001030    192.168.104.220       192.168.104.120       TCP      ftp > 1237 [ACK] Seq=8 Ack=2 Win=5840 Len=0                     ftp
     13 8.012089    192.168.104.220       192.168.104.120       FTP      Response: Tschau                                                ftp
     14 8.170622    192.168.104.120       192.168.104.220       TCP      1237 > ftp [ACK] Seq=2 Ack=16 Win=65520 Len=0                   1237
     15 8.207028    192.168.104.220       192.168.104.120       TCP      ftp > 1237 [FIN, ACK] Seq=16 Ack=2 Win=5840 Len=0               ftp
     16 8.207066    192.168.104.120       192.168.104.220       TCP      1237 > ftp [ACK] Seq=2 Ack=17 Win=65520 Len=0                   1237
     17 8.207312    192.168.104.120       192.168.104.220       TCP      1237 > ftp [FIN, ACK] Seq=2 Ack=17 Win=65520 Len=0              1237
     18 8.264813    192.168.104.220       192.168.104.120       TCP      ftp > 1237 [FIN, ACK] Seq=17 Ack=3 Win=5840 Len=0               ftp
     19 12.224794   192.168.104.220       192.168.104.120       TCP      ftp > 1237 [FIN, ACK] Seq=17 Ack=3 Win=5840 Len=0               ftp
     20 12.224830   192.168.104.120       192.168.104.220       TCP      1237 > ftp [RST] Seq=3 Len=0

So it seems the Tcp-Stack ignores the ACK and the FIN, ACK send by the client as a reaction to to FIN, ACK send by the server to close the connection. Then the server sends again FIN, ACK because he thinks client didn't recieve them. Finally the client sends a RST to closed the connection that has the error.

The HTTP-Server as part a Tcp-Stack is running without this error. So I can eliminate the possibility of a missconfiguration.

Has anybody similar experiences with the closing of a tcp connection?
Any ideas what could be wrong?

I would be happy to get some experience from people using the Tcp-Interface of the Realtime Libary.

Thanks
Rainer

Parents Reply Children
No data