Winsock problem
-
Hi, I'm trying to enable my ARM development board to communicate with a PC. I can establish a connection and send data from the PC to the micro without any issues. When I try to send data from the micro to the PC, however, my socket doesn't respond to the data. A network analyzer shows that the packet was sent and formated properly. I have tried both TCP and UDP with the same results. Has anyone come across this before? Thanks.
For those of you who are interested I finally figured out what the problem was. When I implemented the TCP/IP stack on the micro I made a mistake in the routine that calculates the IP header checksum. With an invalid checksum Winsock just disregarded the message. Once the correct checksum was sent everything worked fine. Thanks to all of you for your help. I appreciate it. Paul
-
For those of you who are interested I finally figured out what the problem was. When I implemented the TCP/IP stack on the micro I made a mistake in the routine that calculates the IP header checksum. With an invalid checksum Winsock just disregarded the message. Once the correct checksum was sent everything worked fine. Thanks to all of you for your help. I appreciate it. Paul
So it was not a Winsock problem at all. ;)
-
So it was not a Winsock problem at all. ;)
-
For those of you who are interested I finally figured out what the problem was. When I implemented the TCP/IP stack on the micro I made a mistake in the routine that calculates the IP header checksum. With an invalid checksum Winsock just disregarded the message. Once the correct checksum was sent everything worked fine. Thanks to all of you for your help. I appreciate it. Paul
-
If you don't mind me asking, which network analyser did you use that didn't display an incorrect checksum?
-
I was using Wireshark, but it DID display an incorrect checksum. I just got busy doing other things and completely overlooked it. It wasn't until I focused on the problem that I paid attention to what the analyzer was telling me.
-
Cool, the reason I asked is we have a similar project coming up, and a long time ago I ran into a goofy problem with a fairly early version of Ethereal where it didn't flag some field as having an invalid value, I lost a lot of hair over that one! :)
-
I can see how that would happen. Thankfully this one didn't take me that much time. Try WireShark http://www.wireshark.org/[^] it's a useful tool.
What wonders me now... that you actually have seen the corrupt IP packages in Wireshark. I was assuming you ran Wireshark on Windows PC and your hosts are connected via a switch, shouldn't the switch throw away the IP packages from the embedded board with wrong header checksum instead of forwarding them?
-
What wonders me now... that you actually have seen the corrupt IP packages in Wireshark. I was assuming you ran Wireshark on Windows PC and your hosts are connected via a switch, shouldn't the switch throw away the IP packages from the embedded board with wrong header checksum instead of forwarding them?
Oops I was thinking wrong. IP packages are OSI Layer 3 and network switches operate on Layer 2... so they couldn't care less about IP header checksums. Sorry for the confusion. Happy coding! :)
-
What wonders me now... that you actually have seen the corrupt IP packages in Wireshark. I was assuming you ran Wireshark on Windows PC and your hosts are connected via a switch, shouldn't the switch throw away the IP packages from the embedded board with wrong header checksum instead of forwarding them?