Author Topic: TCP Handshake problems?  (Read 6217 times)

crazycompgeek

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
TCP Handshake problems?
« on: October 27, 2005, 04:08:13 PM »
I am using computer (Windows XP) to be server. The SBC65EC (PIC18F6621 + RTL8019AS) is the client. I am also sampling analog data and transfer data through TCP between the client and server. I use Ethereal to capture TCP packages to analyse them too.
The connection is fine. It's established very well. However, the data transferring is not good. Here is what happens:
1) For every 2 packages I send, I get back 1 header with ACK. It does not bother me at all the second problem does not happen.
2) When the checksum of a package that the computer receive is incorrect or the TCP seqment is lost, the computer sends an ACK to request that lost package. However, the microcontroller continues sending new packages which the computer won't allow to receive. It has been an endless loop (computer keeps requesting the lost package, microcontroller keeps sending new packages) until the connection is reset.

So my questions are:
* Why TCP/IP stack does not handle resending lost packages through TCP?
* I want to modify the TCP/IP stack. However, because microcontroller send 2 packages at a time before receive an ACK, sometimes we get an error on the first package and by the time we receive the ACK for error, the first package is not on the buffer anymore. How can you resolve that?

If you have ever come across this, please let me know how to get around.
Thanks a lot...
CCG

crazycompgeek

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: TCP Handshake problems?
« Reply #1 on: October 28, 2005, 10:07:36 AM »
Someone helps me figure out to comment the line
#define TCP_NO_WAIT_FOR_ACK (in projdef.h)
I commented that line and now, when the board send 1 package to PC and receive back package with ACK, it stops to send.
I debugged and found out that when the PIC receive the package, it interpreted the wrong SEQ number and ACK number. The SEQ # seems to be random while the ACK # seems to be off (I expected 0x00000007 and got 0x0000000A or 0x00000003 or 0x00000008)
I checked with ethereal and verified that the computer sends correct information.
Does anyone have any idea about it?
Thanks a lot.

OmarZ

  • Hero Member
  • *****
  • Posts: 243
    • View Profile
Re: TCP Handshake problems?
« Reply #2 on: March 04, 2006, 01:03:41 AM »
I have same problems....
Did you resolve it?

OmarZ

  • Hero Member
  • *****
  • Posts: 243
    • View Profile
Re: TCP Handshake problems?
« Reply #3 on: March 06, 2006, 09:52:38 AM »
It was my mistake! All is working well

Bipsype09

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
    • single russian brides
TCP Handshake problems
« Reply #4 on: December 26, 2009, 11:43:19 AM »
Go to your Control Panel, go to Network Connections, right click your network adapter, select Properties, make sure the TCP/IP box is checked. Also, the 1394 connection is usually a Firewire connection and not a LAN connection. Is your computer using a wireless adapter or ethernet?

Aletstero

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
TCP Handshake problems
« Reply #5 on: February 04, 2010, 05:47:37 AM »
il try 2morrow, but what do u mean "Ping"?

ironman28,
   the "Internet Protocol TCP/IP" box is checked, and im using an ethernet cable which cant be the problem because my LAN network is fine

BTW, thnx for the suggestions/help guys, i really appreciate it