The latest development version of this page may be more current than this released 0.4.2 version.

TCP/IP

The WM IoT SDK uses the following open-source protocol stacks:

By default, the WM IoT SDK uses the LWIP protocol stack.

TCP/IP Model

The TCP/IP model of the WM IoT SDK is shown in the figure below:

graph TB A(APP)<-->|"DATA"|B[TCP/IP] B-->|"Event"|C[EV] C-->|"Event"|A E-->|"CMD"|B D[WiFi API]-->|"CMD"|E[WM_NETIF]

The following events are included:

  • WM_EVENT_WIFI_STA_GOT_IP :

    Station obtains an IPv4 address.

  • WM_EVENT_WIFI_STA_GOT_IP6 :

    Station obtains an IPv6 address.

  • WM_EVENT_WIFI_STA_LOST_IP :

    Station loses the IPv4 address.

  • WM_EVENT_WIFI_STA_LOST_IP6 :

    Station loses the IPv6 address.

  • WM_EVENT_WIFI_AP_STAIPASSIGNED :

    SoftAP successfully assigns an IP address to a connected Station.

LWIP Protocol Stack

The specific APIs of the LWIP TCP/IP protocol stack in the WM IoT SDK are as follows:

BSD Socket API:

The BSD Socket API is a common cross-platform TCP/IP socket API that originated from the Berkeley Software Distribution of the UNIX operating system and is now standardized as part of the POSIX specification.

In the WM IoT SDK, LWIP supports all common usages of the BSD Socket API.

Netconn API:

In the WM IoT SDK, LWIP supports two lower-level APIs, namely the Netconn API and the Raw API:

  • The LWIP Raw API is suitable for single-threaded devices.

  • The Netconn API is used internally within LWIP to utilize the BSD Socket API. Compared to the BSD Socket API, this API occupies fewer resources.

Attention

Generally, it is recommended to use the BSD Socket API.

For more information on the Netconn API, please refer to the `Unofficial lwIP Application Developer's Manual<https://lwip.fandom.com/wiki/Netconn_API>`_.

IPv6:

WM IoT SDK supports the IPv6 protocol.

WM IoT SDK provides menuconfig to configure LWIP

Using the compilation command line, enter menuconfig, select Components configuration to enter the component configuration, then select LWIP to view the related properties of LWIP configuration, such as:

  • TCPIP task receive mail box size :

    The mailbox size for receiving TCPIP tasks.

  • Maximum number of retransmissions of data segments :

    The maximum number of retransmissions of data segments.

  • Default TCP receive mail box size :

    The default TCP receive mailbox size.

  • Enable ipv6 :

    Enable IPv6.

FreeRTos TCP Protocol Stack

Currently not supported.

BSD TCP/IP Protocol Stack

Currently not supported.