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.

SIMPLELINK-WIFI-CC3120-SDK-PLUGIN: how to make cc3120boost support IPv6 socket connect?

Part Number: SIMPLELINK-WIFI-CC3120-SDK-PLUGIN
Other Parts Discussed in Thread: CC3120BOOST, MSP-EXP432E401Y, CC3120

Hi, guys.

I have a suit of MSP-EXP432E401Y+CC3120BOOST,  I found the Features "IPv4 and IPv6 TCP/IP Stack" in  swas034 document.  However, in actual development, it was found that it was not possible to connect to IPv6 addresses.  I ended up finding the following code comment in the SDK source code. I follow order is  `SlNetSock_connect --> SlNetIfWifi_connect --> sl_Connect` .

 

with the latest SDK version of simplelink_sdk_wifi_plugin_2_40_00_22, they can get IPv6 global address from the DHCPv6 service , they can query IPv6  address from DNS. but  with to connecting  to IPv6 address occur error as `SLNETERR_BSD_ECONNREFUSED                                       (-111L)  /**< Connection refused `

"On this version only AF_INET is supported  socket address"  is True?  Thanks.

```sh
~$ cat simplelink_sdk_wifi_plugin_2_40_00_22/source/ti/drivers/net/wifi/sl_socket.h
[....]
/*!
\brief Initiate a connection on a socket

Function connects the socket referred to by the socket
descriptor sd, to the address specified by addr. The addrlen
argument specifies the size of addr. The format of the
address in addr is determined by the address space of the
socket. If it is of type SOCK_DGRAM, this call specifies the
peer with which the socket is to be associated; this address
is that to which datagrams are to be sent, and the only
address from which datagrams are to be received. If the
socket is of type SOCK_STREAM, this call attempts to make a
connection to another socket. The other socket is specified
by address, which is an address in the communications space
of the socket.


\param[in] sd Socket descriptor (handle)
\param[in] addr Specifies the destination addr\n
sockaddr:\n - code for the
address format. On this version
only AF_INET is supported.\n -
socket address, the length
depends on the code format

\param[in] addrlen Contains the size of the structure pointed
to by addr

\return On success, a socket handle.\n
On a non-blocking connect a possible negative value is SL_EALREADY.
On failure, negative value.\n
SL_POOL_IS_EMPTY may be return in case there are no resources in the system
In this case try again later or increase MAX_CONCURRENT_ACTIONS

\sa sl_Socket
\note belongs to \ref client_side
\warning
*/
#if _SL_INCLUDE_FUNC(sl_Connect)
_i16 sl_Connect(_i16 sd,
const SlSockAddr_t *addr,
_i16 addrlen);
#endif
  • Hey Chunyang,

    The CC3120 in general does support the IPv6 protocol and IPv6 addressing. However, as you noted, the sl_Bind function of the host driver Socket module only supports IPv4 addresses. 

    In general, SL_ERROR_BSD_ECONNREFUSED indicates that the remote server is either not listening on that socket, or has actively refused the connection attempt by the CC3120. In both cases, you should check your server config to ensure there aren't any settings preventing the CC3120 from connecting. And double check your CC3120 code to ensure that you are connecting to the right address and port.

    Regards,

    Paul

  • Hey Paul 

    Thanks your reply. on server side I'm certain it listening and allow connecting from client. I'm very confused that as we can see in the above line ( sl_Connect ) of the sdk source code, it has write "sockaddr:\n - code for the address format. On this version only AF_INET is supported." so,  it means that "sl_Connect" API function only supported AF_INET to connect ?

    Regards,

    Chunyang

  • Hey Chunyang,

    I took a closer look at the host driver socket API documentation that you mentioned as well as some of the source code. I can confirm that this is an error with the documentation and have reported it so it can get fixed. My previous comment was incorrect. All the functions of this API do support SL_AF_INET6 (IPv6) for client/server socket communication.

    If you take a look at chapter 6.5 Socket Working Flow in our Programmer's Guide, this documentation accurately represents the supported functionality.

    I apologize for the confusion on my part.

    As for the connection refused error you're seeing, could you provide a network capture/log of the TCP handshake on you server? 

    Regards,

    Paul

  • Hey Paul,

    You are right, I fixed this problem,  It is caused by the firewall. Thanks.

    Chunyang,