General technical discussions.
CLA Innovation
New Member
Posts:
3
Joined:
Fri Jun 15, 2012 7:24 am

TCP connection issues

Fri Jun 15, 2012 7:29 am

Good afternoon,

I am currently working on a project which purpose is to establish a TCP connection between a PC and a microcontroler.
I configured (in C language) the µC as the server, and the PC as the client (in C#, using the TCPClient class).
While running the codes, I capture the frames on the network with Wireshark.

The client's ISN is chosen randomly by the TCPClient.Connect method.
Since there will be only one TCP connection at a time, the server's ISN is always 0.
The server's port is 0xC0C0 (49344) and the client's port is also chosen randomly by the TCPClient.Connect method.

find the screenshot of the Wireshark's capture attached !

In compliance with RFC793, the three-way-handshake should conclude with an ACK segment from the client.
In my exemple, the client tries to connect three times, and then drops : the client sends no ACK segment.

The µC's SYN-ACK reply may be bad configured ...

What kind of information did I miss ? Are there special data the client is expecting ? Why don't I get back an ACK segment from the client?


Thank you for your help.
exemple_tcp.JPG
exemple_tcp.JPG (141.54 KiB) Viewed 305 times

CLA Innovation
New Member
Posts:
3
Joined:
Fri Jun 15, 2012 7:24 am

Re: TCP connection issues

Mon Jun 18, 2012 4:06 am

Problem solved : there was an error in the checksum calculation of the SYN-ACK segment.
I didn't take into account the endianness of the µC's memory.

User avatar
eaadams
Post Whore
Posts:
2611
Joined:
Fri Mar 11, 2005 10:26 pm

Re: TCP connection issues

Mon Jun 18, 2012 7:47 am

CLA Innovation wrote:Problem solved : there was an error in the checksum calculation of the SYN-ACK segment.
I didn't take into account the endianness of the µC's memory.
We used to have that issue when moving between Motorola and Intel micro labs, students would always forget the difference when, say, implementing a stack using assembly language to store data words.

Back then we never thought about TCP comms projects though, that is interesting. Which micro are you using?

Aubrey
Last edited by eaadams on Mon Jun 18, 2012 9:29 am, edited 1 time in total.
The illiterate of the 21st century will not be those who cannot read and write, but those who cannot learn, unlearn, and relearn. Alvin Toffler, "Future Shock" 1970

CLA Innovation
New Member
Posts:
3
Joined:
Fri Jun 15, 2012 7:24 am

Re: TCP connection issues

Mon Jun 18, 2012 8:53 am

I am using a Cortex M3 microcontroler, on the LPC1788 board by NXP.
My project is a driver (in C language) that allows the µC and a PC (Windows XP) to exchange data through a TCP connection.

'

Return to General Tech

Who is online

Users browsing this forum: Bing [Bot] and 18 guests