Standalone TCP/IP stack for STM32, bare metal or RTOS logo

Standalone TCP/IP stack for STM32, bare metal or RTOS

Free

Embedded web server and network library – drop two files, get a full stack.

FreeFree tier
Inputs: code, fileOutputs: code, file
Type
Open Source
Company
Cesanta

About Standalone TCP/IP stack for STM32, bare metal or RTOS

Mongoose is an embedded web server and network library designed for microcontrollers and desktop operating systems. It provides a full TCP/IP network stack that can run on bare metal or on top of existing stacks like lwIP or Zephyr. The library supports a wide range of protocols including HTTP, WebSocket, MQTT, Modbus-TCP, SNTP, and plain TCP/UDP, along with built-in TLS 1.3 ECC and asynchronous DNS resolution. Mongoose is distributed as two source files (mongoose.c and mongoose.h) that can be dropped into any C/C++ project, making it easy to integrate into embedded firmware or desktop applications. It has been in development since 2004 and is used in numerous open-source and commercial products, including on the International Space Station. The library is cross-platform, supporting Linux, macOS, Windows, and a variety of microcontroller families such as STM32, NXP, ESP32, Nordic, TI, Microchip, Infineon, and Renesas. It also includes built-in firmware update capabilities for specific MCU models like STM32 H5/H7, NXP IMXRT, and RP2040/2350. Mongoose is available under an open-source license, with commercial support options that include proactive security updates and CRA compliance.

Key Features

Cross-platform support for Linux, macOS, Windows, and many MCU families
Built-in TCP/IP stack for bare metal or RTOS, or can run on top of lwIP, Zephyr, etc.
Supports HTTP, WebSocket, MQTT, Modbus-TCP, SNTP, and plain TCP/UDP protocols
Built-in TLS 1.3 ECC stack, with option to use external TLS libraries (mbedTLS, OpenSSL)
Asynchronous DNS resolver
Tiny static and runtime footprint
Source code is both ISO C and ISO C++ compliant
Built-in firmware OTA updates for STM32 H5/H7, NXP IMXRT, RP2040/2350, ESP32 and more

Pros & Cons

Pros
  • Very easy to integrate — just two files to add to any C/C++ project
  • Cross-platform: write code once and it works on many MCUs and desktop OSes
  • Includes its own TCP/IP stack, reducing dependency on external network libraries
  • Long history (since 2004) and proven reliability, used in space station
  • Built-in TLS 1.3 ECC stack for secure communications
  • Commercial support available with proactive security updates
Cons
  • Free open-source version may have limitations; commercial support requires a paid plan
  • Documentation and community support may be less extensive than larger frameworks
  • Requires C/C++ development environment; not suitable for high-level scripting languages
  • Built-in TLS stack may not support all cipher suites; external TLS libraries may be needed for some use cases

Best For

Embedded web server for IoT devicesMQTT telemetry and device managementSecure firmware over-the-air (OTA) updatesUnifying network infrastructure code across different microcontroller platformsBuilding device dashboards and remote monitoring interfaces

FAQ

What is Mongoose?
Mongoose is an embedded web server and network library that provides a full TCP/IP stack and supports protocols like HTTP, WebSocket, MQTT, and Modbus-TCP. It is designed for microcontrollers and desktop operating systems.
How do I integrate Mongoose into my project?
You can integrate Mongoose by copying the mongoose.c and mongoose.h files into your C/C++ project. No other dependencies are required for basic networking.
Does Mongoose support TLS?
Yes, Mongoose includes a built-in TLS 1.3 ECC stack. It also supports external TLS libraries such as mbedTLS and OpenSSL.
Which microcontrollers are supported?
Mongoose supports many MCU families including STM32, NXP, ESP32, Nordic, TI, Microchip, Infineon, and Renesas. It also runs on Linux, macOS, and Windows.
Is Mongoose free to use?
Mongoose is available under an open-source license. Commercial support with proactive security updates is available for a fee. Exact licensing terms should be verified on the official website.
Can Mongoose be used for OTA firmware updates?
Yes, Mongoose includes built-in firmware update capabilities for specific MCUs such as STM32 H5/H7, NXP IMXRT, RP2040/2350, and ESP32.