S K UCI,
I have reproduced your problem with both the online compiler and GCC. For me, it always gets hung up on the first data packet. It sends two data packets (there are also SYNC packets to open the socket) and the receiver never gets a good version of the first packet. One difference between my network capture and yours is that I do see the mbed attempt to resend that first packet but it always has a bad checksum. Maybe your packet sniffing software doesn't show packets which have a bad checksum?
00:00:00.000107 IP (tos 0x0, ttl 64, id 60539, offset 0, flags [DF], proto TCP (6), length 40)
192.168.0.3.6666 > 192.168.0.148.49153: Flags [.], cksum 0xc6fb (correct), seq 1, ack 10, win 65535, length 0
00:00:02.750120 IP (tos 0x0, ttl 255, id 6, offset 0, flags [none], proto TCP (6), length 777)
192.168.0.148.49153 > 192.168.0.3.6666: Flags [P.], cksum 0x1738 (incorrect -> 0x1936), seq 10:747, ack 1, win 2920, length 737
00:00:00.999865 IP (tos 0x0, ttl 255, id 7, offset 0, flags [none], proto TCP (6), length 512)
192.168.0.148.49153 > 192.168.0.3.6666: Flags [P.], cksum 0x48fb (correct), seq 747:1219, ack 1, win 2920, length 472
It is interesting that one byte of the checksum is 2 too high and the other byte is 2 too low. I will investigate it more later today. At least I now have a repro that occurs while a debugger is attached.
Thanks for the thorough repro steps. They are a great help!
-Adam
Hi Adam,
Excellent, thank you! I will try this out and let you know what happens. Hopefully I'll have a chance to look at it next week.
Adam Green wrote:
S K UCI,
I have pulled in the latest network stack sources from the github repository and placed them in the following library:
Import libraryEthernetInterface
Deprecated fork of old network stack source from github. Please use official library instead: https://mbed.org/users/mbed_official/code/EthernetInterface/
Last commit 26 Oct 2013 by Adam Green
If this version of the network stack still gives you problems then I will debug your issues and use the results to improve the robustness of the network stack.
Thanks for the help,
Adam