A Guide to WiSeConnect™ Network Stacks#
The WiSeConnect™ SDK provides multiple network stack implementations through the Network Manager service, offering developers the flexibility to choose the most appropriate networking architecture for their specific application requirements and deployment scenarios. Each network stack offers unique capabilities and is optimized for different use cases.
This guide helps you understand the available network stack options and how to configure them for your application.
Network Stack Architecture Overview#
The Network Manager service supports three primary network stack architectures, each optimized for different deployment scenarios and system requirements.
Offload Network Stack (NWP Mode)#
The Offload Network Stack runs the network stack on the Network Wireless Processor (NWP), providing integrated networking capabilities with the wireless chipset.
Configuration:
Default mode for wireless networking applications
Network stack integrated with the wireless firmware
Supports both System-on-chip (SoC) and network co-processor (NCP) modes
Component:
Offload Network Stack(Internal Network Mode)
Hosted Network Stack (Network stack on MCU)#
The Hosted Network Stack runs the network stack on the M4 processor or external host MCU, which can be either Lightweight IP (LwIP) or any custom external network stack. This architecture provides flexibility for custom networking requirements and allows the use of existing network stack implementations.
Configuration:
Enable by setting
SL_SI91X_TCP_IP_FEAT_BYPASSopermode bit oftcp_ip_feature_bit_mapconfigurationSupports LwIP or custom external network stacks
Configurable via LwIP options (
lwipopts.h) when using LwIP stackSupports both SoC and NCP modes
Component:
LwIP Network Stack (Hosted)(LwIP Network Stack)
Dual Network Stack Mode#
The Dual Network Stack Mode enables simultaneous operation of network stacks on both the NWP and MCU processor. This provides maximum flexibility by allowing different network stacks to run on different processors simultaneously.
Key Characteristics:
Network stack on NWP (dedicated wireless networking)
Network stack on M4 (custom/external networking)
Simultaneous operation of different stack types
Enhanced system scalability and flexibility
Architecture:
NWP runs dedicated network stack for wireless operations
M4 runs LwIP or custom external network stack
Independent socket management on both processors
Coordinated network interface management
Configuration:
Enable Dual Stack Mode by setting the
SL_SI91X_EXT_TCP_IP_DUAL_MODE_ENABLEopermode bit in theext_tcp_ip_feature_bit_mapconfiguration.Dual Stack Mode (
SL_SI91X_EXT_TCP_IP_DUAL_MODE_ENABLEinext_tcp_ip_feature_bit_map) cannot be enabled at the same time as Hosted Stack Mode (SL_SI91X_TCP_IP_FEAT_BYPASSintcp_ip_feature_bit_map); only one can be active.Requires careful coordination between NWP and M4 stacks.
Supports advanced features like TCP window scaling and dynamic coexistence memory.
Component: Refer to section Network Stack Components Summary
Network Stack Components Summary#
The following table provides a quick reference for the components used in each network stack mode:
Note: BIT(0) refers BIT 0 of
tcp_ip_feature_bit_map, BIT(10) refers BIT 10 ofext_tcp_ip_feature_bit_map.
Network Stack Mode | Component | Opermode Bits | Description |
|---|---|---|---|
Offload Only Mode |
| BIT(0) = 0, BIT(10) = 0 | Network stack running on NWP only |
Offload + External Host |
| BIT(0) = 0, BIT(10) = 1 | Network stack on NWP + external host stack |
Hosted Only Network Mode |
| BIT(0) = 1, BIT(10) = 0 | LwIP stack running on M4 processor |
Hosted Network Mode + External Host |
| BIT(0) = 1, BIT(10) = 0 | LwIP stack running on M4 processor + external host stack |
Dual Stack Mode (NWP + M4) Mode |
| BIT(0) = 0, BIT(10) = 1 | Both NWP and M4 stacks running simultaneously |
Component Selection Guidelines:
Use
Offload Network Stackfor offload only mode scenarios with network processing on NWP.Use
Offload Network Stack+ external host stack when combining NWP offload with external host processing.Use
LwIP Network Stack (Hosted)for host-based networking with LwIP on M4.Use
LwIP Network Stack (Hosted)+ external host stack when combining host-based networking with LwIP on M4 and network stack on external host.Use
Dual Network Stack(Network Dual Stack) for running network stacks on both NWP and M4 on SiWx917 device.
Dual Stack Component Limitations#
IPv6 is not supported when using
Dual Network Stacknetwork component.For socket operations when using
Dual Network Stacknetwork component:Use BSD socket APIs for LwIP socket functionality on M4.
Use SiWx91x internal socket APIs for NWP socket functionality.
Dual Stack Mode (
SL_SI91X_EXT_TCP_IP_DUAL_MODE_ENABLEinext_tcp_ip_feature_bit_map) cannot be enabled simultaneously with Hosted Stack Mode (SL_SI91X_TCP_IP_FEAT_BYPASSintcp_ip_feature_bit_map); only one can be active at a time.Bitmap macros:
SL_SI91X_TCP_IP_FEAT_BYPASS(for Hosted Stack Mode)SL_SI91X_EXT_TCP_IP_DUAL_MODE_ENABLE(for Dual Stack Mode)
Advanced features may require additional configuration and validation.
Next Steps#
Explore the available network stack implementations and application examples:
API Reference Guides#
The WiSeConnect SDK offers a variety of socket implementations for different networking requirements:
Network Management provides access to the Network Management API Reference Guide.
BSD Sockets implements the Berkeley Software Distribution (BSD) standard API for socket programming.
SiWx91x Sockets implements a socket programming API for the SiWx91x chipsets.
IoT Sockets implements the ARM standard Internet-of-things (IoT) socket programming API.
Application Examples#
The WiSeConnect SDK provides application examples demonstrating the use of different nework stack use cases:
The Wi-Fi - Station Ping example demonstrates how to send an ICMP ping request.
The Wi-Fi - SNTP Client example demonstrates how to build an SNTP client and fetch network time.
The Wi-Fi - LwIP TCP Client example demonstrates how to transfer the TCP data using LWIP stack by configuring the SiWx91x in client mode.
The Wi-Fi - Dual Network Stack Mode example demonstrates the configuration of dual network stack mode (Network stack on NWP + external host stack) and showcases the station ping functionality for dual network stacks.
The Wi-Fi - Dual Network Stack NWP + M4 example demonstrates the configuration of dual network stack mode (Network stack on NWP + Network stack on M4) and showcases the station ping functionality for dual network stacks.
Refer to this link for more examples: