gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > DSwifi TCP errors

#151295 - kusma - Fri Feb 22, 2008 9:14 pm

I'm having some issues with some data sent from a DS-client over a socket and to a PC-server does not reach the server for a very long time (more than 10 seconds usually). This only seems to happen to a special kind of 5 bytes big sync-packet. My first suspicion was that this was due to nagling, and my first attempt was to set TCP_NODELAY on the socket (as Wikipedia suggests). However, it seems that IPPROTO_TCP and TCP_NODELAY is not defined in dswifi.

This lead me to believing that nagling wasn't supported in dswifi, so I looked for other issues. So, I fired up Wireshark (a TCP packet debugger), and I saw that the packets seemed to be attempted to be sent when I expected them to. BUT! Wireshark reported lots of problems when those specific packets were sent! The issues seems to start with a TCP Out of order, and continue with TCP Dup ACKs and TCP Retransmissions. Then, a bit later, when the server sends a two-byte packet, the client sends back one big packet containing all the data that failed (due to the errors described above).

Now, has anyone experienced anything similar? This looks more and more like a bug in DSwifi to me, and if it is, does anyone know a work-around? Also, does anyone know if DSwifi does nageling, and if so, is it possible to turn it off?

edit: removed a ' in the link so the bbcode parser would understand the link.


Last edited by kusma on Sun Dec 21, 2008 6:54 pm; edited 1 time in total

#151320 - TwentySeven - Sat Feb 23, 2008 11:10 am

I ran into exactly this issue.


I gave up and went with udp.

#151323 - masscat - Sat Feb 23, 2008 11:52 am

You can hack the effect of TCP_NODELAY easily (well you could against CVS source dated 2006-10-10). See my GDB stub page. This does mean that TCP_NODELAY is set for all TCP sockets.

In an old version of dswifi (I do not know if it is still present) I did find a problem with TCP data retransmission (see here) for which I put together an experimental fix.
Again the patch is against an old version of dswifi and, as stated in the linked thread, it is not a complete fix (and not tested much either).