tcp on uC, 3way handshake problem

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
hello,

i tried to implement tcp on my uC, starting with the handshake to
establish the connection (passive open only). And here is my problem:
Computer sends the SYN packet, uC replies with SYN,ACK packet, but the
computer doesn't answer with an ACK packet. This sounds to me, as if
my reply packet is wrong. Possibly my missing checksums (in ip, and
tcp layer) are the reason, but i read, checksum 0x0000 would be ok (at
least for beta testing).
I will post at the end some lines of the ethereal dump.

Does anybody have an idea what could be wrong in my packet (the rfc
seems not require special options for connecting...), and what (free)
tools (windows) can help me (maybe analysing and finding mistakes and
not just showing the packet) to find my fails.

thanks
heiko

ethereal dump:
192.168.101.10 -> 192.168.101.14
 port 1111 -> 988 [SYN] seq56%33985 Ack=0 win81%92 Len=0, some options
are set
192.168.101.14 -> 192.168.101.10
 port 988 -> 1111 [SYN,ACK] seq40%74241 Ack56%33986 win81%92 Len=0,
options are all 0x00

Re: tcp on uC, 3way handshake problem
Quoted text here. Click to load it

Heiko,

The checksum is probably the culprit.

For TCP packets, the checksum must be calculated.
It isn't optional.

A UDP packet can turn off checksums by setting the
checksum field to 0.  In fact, if the computed checksum
of an outgoing packet is 0, then the UDP layer must set
the value to 0xFFFF if it wants the receiver to compute
the checksum.


Joe



Re: tcp on uC, 3way handshake problem
Quoted text here. Click to load it

Heiko,

Also don't forget about the IP checksum field.

This is a separate field from the UDP or TCP checksum
fields, and is computed on just the IP header.


Joe



Re: tcp on uC, 3way handshake problem

Quoted text here. Click to load it

Heiko, you need checksums on both the IP header and the TCP with
pseudo-header. If either checksum is not correct, the peer is supposed to
drop the packet without any notice to the sender ('silently discarded').

Ethereal is your friend here - adjust you code till Ethereal is happy with
both checksums.

IMHO, the checksum handling in the IP protocol stack is a sorry mess - there
are things checked many times and intertwined on different protocol layers.

Been there - done that.

Tauno Voipio
tauno voipio @ iki fi




Re: tcp on uC, 3way handshake problem
hello,

thanks to all for giving advices,
now i "decided" to implement the checksum.

heiko

Site Timeline