lwIP
startFeatures
-
Dual-stack IPv4 and IPv6 support with packet forwarding over multiple network interfaces.
-
Full TCP implementation featuring congestion control, RTT estimation, fast recovery, and fast retransmit.
-
UDP and experimental UDP-lite extensions for low-overhead transport.
-
ICMP and ICMPv6 support for network maintenance and diagnostic functions.
-
IGMP and MLDv1 support for managing multicast traffic and listener discovery.
-
Neighbor Discovery (ND) and stateless address autoconfiguration for IPv6 compliance (RFC 4861/4862).
-
Comprehensive IP addressing via DHCP, DHCPv6, AutoIP/APIPA (Zeroconf), and Address Conflict Detection (ACD).
-
DNS client including support for mDNS (Multicast DNS) responder.
-
Layered TCP (altcp) abstraction for transparent TLS integration, typically ported to mbedTLS.
-
Point-to-Point Protocol support including PPPoS (over Serial) and PPPoE (over Ethernet).
-
6LoWPAN adaptation layer for low-power wireless networks like IEEE 802.15.4 and BLE.
-
Integrated HTTP/HTTPS server with support for Server Side Includes (SSI) and CGI.
-
SNMPv2c/v3 agent with an included MIB compiler for network management.
-
MQTT client with optional TLS encryption for secure IoT messaging.
-
SNTP (Simple Network Time Protocol) implementation for clock synchronization.
-
NetBIOS name service responder and iPerf server for network performance testing.
Architecture
lwIP is designed with a modular architecture that balances the need for a layered protocol stack with the performance requirements of resource-constrained hardware. The core stack is contained within the src directory, while platform-specific ports and optional applications reside in the contrib directory. A central feature of its architecture is the pbuf (packet buffer) structure, which allows for zero-copy data handling as packets move through the various layers of the stack, significantly reducing CPU and memory overhead.
To accommodate different system designs, lwIP provides three distinct Application Programming Interfaces (APIs):
- Raw API: A callback-based, event-driven interface that provides the highest performance and lowest memory footprint by running directly in the TCP/IP thread.
- Netconn API: A sequential, thread-safe API that requires an operating system (RTOS) and provides a simplified programming model.
- Socket API: A BSD-compatible socket layer built on top of the Netconn API, facilitating the porting of existing standard networking code.
Use Cases
This library is ideal for:
- IoT End-Nodes: Small, battery-powered sensors using 6LoWPAN or BLE to communicate with gateways.
- Industrial Automation: PLCs and industrial controllers requiring reliable TCP/IP communication for Modbus/TCP or Ethernet/IP protocols.
- Embedded Web Servers: Devices providing local configuration or monitoring dashboards via HTTP or HTTPS.
- Network Gateways: Systems bridging traffic between different physical layers, such as Ethernet to Serial (PPP) or WiFi to 6LoWPAN.
- Resource-Constrained Systems: Microcontrollers with limited RAM (e.g., 20KB-50KB) that still require a full-featured, standards-compliant network stack.
Getting Started
Developers can begin by exploring the src directory for the core protocol implementations and the contrib directory for existing ports to various hardware and operating systems. The stack requires a header file named lwipopts.h to be defined by the user, which configures the stack’s features and memory limits at compile-time. For systems using an RTOS, a system abstraction layer (sys_arch) must be implemented to handle threading and synchronization. Comprehensive self-documentation extracted from the source code is available at the official lwIP documentation site, and development is centrally managed via the Savannah Git repository.
Related Projects (298)
View All 298 Projects →Holocubic NES Dynamic Module
A high-performance NES emulator implemented as a dynamic shared object for the Clocteck Holocubic ESP32-S3 platform. It utilizes the ESP-ELFLoader to integrate with cubic Lua firmware, providing a scriptable interface for gaming with support for multiple mappers and BLE controllers.
FlightPortrait Firmware
FlightPortrait is an open-source firmware for an ESP32-S3-powered 13.3" color e-ink frame that visualizes local aviation traffic. Built using the ESP-IDF framework, it leverages FreeRTOS and NimBLE to provide a secure, low-power display solution that retrieves images via HTTPS. The project emphasizes a "simple by design" approach, featuring a robust state machine for provisioning, polling, and deep sleep cycles to maximize battery life.
ESP32-P4 Home Assistant MQTT Voice Assistant
This project provides local voice assistant firmware for the ESP32-P4 platform, built natively on ESP-IDF and integrated with Home Assistant's Assist pipeline. It utilizes WakeNet9 for wake-word detection, MQTT for control and discovery, and features a local MP3 player and web-based management dashboard.
ESP32-C3 Environmental Monitoring Node
A high-efficiency, low-power environmental monitoring firmware developed using the native ESP-IDF v5.x framework for the ESP32-C3. It integrates deep sleep cycles with multi-sensor data collection and provides configurable alerts via Telegram, Discord, and custom webhooks. The system includes a built-in SoftAP web portal for runtime configuration, allowing users to manage Wi-Fi credentials and sensor thresholds without serial re-flashing.
POOM Multitool Platform
POOM is an open-source multitool platform for ESP32-C5 and ESP32-C6 microcontrollers, designed for wireless security testing, IoT automation, and portable gaming. It leverages the ESP-IDF framework with FreeRTOS, OpenThread, and lwIP to provide a modular environment for Wi-Fi/BLE analysis and hardware interaction.
SensorStation3
SensorStation3 is an ESP32-based environmental monitoring station that utilizes FreeRTOS and the LVGL graphics library to provide a real-time touchscreen dashboard. It supports a variety of I2C sensors for tracking temperature, humidity, CO2, and atmospheric pressure, featuring seamless integration with Home Assistant and MQTT-based platforms.
CYD Dashboard
A comprehensive multi-screen information dashboard for the ESP32-based 'Cheap Yellow Display' (CYD) featuring real-time amateur radio data, weather, and financial tracking. Built with a hybrid Arduino and ESP-IDF framework, it utilizes FreeRTOS for task management and LovyanGFX for high-performance rendering on 2.8-inch touchscreens.
Overhead
Overhead is a modular multi-page situational-awareness dashboard for ESP32-based touchscreen modules, such as the Cheap Yellow Display. Built on the Arduino framework and FreeRTOS, it integrates real-time data for satellite passes, aircraft ADS-B tracking, aviation weather, and celestial events. The project is specifically engineered for reliability on low-memory hardware, featuring a serialized HTTPS task and a remote web interface for control and monitoring.