This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3000 server socket still open, stops accepting client requests

Hi all,

We are trying to use the CC3000 in a scenario where we use it expose an HTTP
server on the wireless network.
The HTTP server is both used to serve a set of web APIs, along with a few
webpages enabling it to report its status to the user. This runs on our MCU and
the CC3000 is used for its IP stack + radio.

We have identified an unfortunate behavior which we believe might be caused by
a bug in the CC3000 ip stack.

Basically our service seems to work well with most client applications (we've
tried it using android devices, linux stations running both chrome and
firefox), however when attempting to browse the HTTP server with a Windows
client, we see the following issue :
* initially everything seems to work fine, content is loads
* however after an short amount of time spent browing (usually this
kicks in pretty fast, browsing a page or two triggers the problem), the CC3000
stops accepting new connections. At the network level what we see is the client
sending SYN packets, but these packets are never SYN/ACKed by the CC3000

We've digged further and it appears that :
* As soon as the issue kicks-in all TCP connexions to the server fail may it be from
the same station or another one (client sends SYN, server never ACKS)
* If we wait 60 seconds (so that potential timeouts are all cleared)
--> State unchanged (this rules out dangling connections which could prevent new ones to occur)

* In the meantime :
--> Wifi module still responds to PING requests
--> Comm (SPI) seems to be working properly
-----> Non-Socket commands are processed successfully (eg: nvmem read, ipconfig_get)
-----> Scan ioctl returns no error but shows no network
-----> accept keeps returning -2 (PENDING), which seem to suggest the server socket is still very well alive/active and ready
--> if we attempt a close on the server sock it will return 0
--> if we initially open a second, dummy, server socket, once the HTTP
socket stop responding, the second socket can still accept new incoming
connections

So basically from client stations it appears as if the socket was not open, whereas from the our MCU, everything seems normal. The socket behave as if it was still active, only accept() never returns new client sockets.

attached: in log.zip file : debug trace fetched from the module
3348.logs.zip

contents :
* out_net_win_1: debug trace (NS_TX_DBG) with problematic client
* out_net_deb_1: debug trace (NS_TX_DBG) with friendly client
* out_fw_win_2: debug trace (WL_TX_DBG) with problematic client
* out_fw_deb_2: debug trace (WL_TX_DBG) with friendly client

I'm running the 1.28 SP the issue occured with 1.24 as well

Thank you,

Regards,

Florian

  • Hi Florian,

    I had a look at the logs, but it did not give more information about the error.

    Also, In the logs I did not see any calls made to accept while waiting for a connection. How are you waiting for new connections?

    If possible can you please capture the failure logs from the beginning? Just like the success logs that were captured from the beginning.
    And when you capture the logs, please call the below API netapp_set_debug_level(0x1ff);

    Apart from the SYN not being ACKed, do you see anything else in the air trace, like a RST before the new connection setup?

    Are you using the same browser for testing the success and failure case? If not, then please try to use the same browsers for both the working case and the failure case, so that we have lesser parameters to consider.

    Thanks & Regards,
    Raghavendra

  • Raghavendra Shenoy Mathav said:
    Also, In the logs I did not see any calls made to accept while waiting for a connection. How are you waiting for new connections?

    We're waiting for new connections by repeatedly calling accept in an event loop (first it calls accept, then it dispatches any incoming data to other tasks if necessary).

    We're pretty sure this works properly because if we open two server connections both handled by this single event loop, the second works fine once the first one starts failing.

    I've also been manually triggering the following code snipped (through a serial debug command) to visualize the result of calling various network API commands once the socket is "dead" :

    void wifi_test_sock(void)
    {
        sockaddr_in clientAddr;
        socklen_t addrLen;
        fd_set writesds, readsds, errorsds;
        timeval timeout;
        int status, newsock;
    
        DEBUG("in test\n");
    
        newsock = -1;
        newsock = accept(serv_sck_80, (sockaddr*)&clientAddr, &addrLen);
    
        DEBUG("accept returned %d\n", newsock);
    
        FD_ZERO(&readsds);
        FD_ZERO(&writesds);
        FD_ZERO(&errorsds);
    
        timeout.tv_sec = 0; 
        timeout.tv_usec = 10000;
    
        status = select(5, &readsds, &writesds, &errorsds, &timeout);
    
        DEBUG("select returned %d\n", status);
    
        DEBUG("try close\n");
        status = closesocket(sck);
        DEBUG("close returned %d\n", status);
    
        return;
    }
    

    The result is that accept always returns -2 once we fail. Select returns no error, and close completes successfully.

    Raghavendra Shenoy Mathav said:
    If possible can you please capture the failure logs from the beginning? Just like the success logs that were captured from the beginning.

    And when you capture the logs, please call the below API netapp_set_debug_level(0x1ff);

    Ok, I'll do this and provide news logs. Do you need both driver and network logs or would network logs be enough ?

    Raghavendra Shenoy Mathav said:
    Apart from the SYN not being ACKed, do you see anything else in the air trace, like a RST before the new connection setup?

    I'll double check but I have not seen anything that seems out of the ordinary

    Raghavendra Shenoy Mathav said:
    Are you using the same browser for testing the success and failure case? If not, then please try to use the same browsers for both the working case and the failure case, so that we have lesser parameters to consider.


    We'be been using the latest (36.0.1985.125) chrome release in both case. The success case is under linux, failure is under windows. I could replicate failure both with Chrome under windows XP and windows 7.

  • Hi  Raghavendra,

    Please find attached some new log with the more verbose debugging option activated.

    7026.logs_060814.zip

    _1: driver log
    _2, _3: network stack logs

    Florian Vallee said:

    Apart from the SYN not being ACKed, do you see anything else in the air trace, like a RST before the new connection setup?

    I'll double check but I have not seen anything that seems out of the ordinary

    [/quote]

    Actually scratch that, I'm seeing an interesting pattern before the server socket goes mute.

    See :

     

    In particular packets 1590 & 1591 : we receive a TCP keep alive packet followed by a RST. Shortly after that, the server socket stops responding to SYN requests. I've done several captures, and it looks like this pattern always occurs right before the socket stops responding.

    I did a few more tests on both our failing workstations, and it appears that the issue is triggered way sooner when using windows XP. Under Windows 7 I can browse the HTTP website, sometimes during up to a few minutes, whereas under windows XP the issue is triggered almost immediately while loading the first page.

  • Hi Raghavendra,

    Do you have any update on this issue ?

    Thank you,

    Regards,

    Florian

  • I am also having this exact issue with the cc3000 stopping accepting incoming connections but is still able to be pinged. 

    Is there going to be a firmware update to resolve this issue or is there a way around it a a library level?


    Regards

    Jasper

  • Still having this problem with 1.14.   There's gotta be a fix somehow.  Right?