lwIP

start
lwIP (lightweight IP) is a widely-used, open-source TCP/IP stack designed specifically for resource-constrained embedded systems. It minimizes RAM usage while providing a full-scale TCP implementation, making it suitable for devices with only tens of kilobytes of free memory.

Features

  • 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 (264)

View All 264 Projects →
Tasmota SML Images

Tasmota SML Images

This project provides pre-compiled Tasmota firmware binaries specifically optimized for smart meter reading via SML and advanced scripting on ESP32 and ESP8266 platforms. It features a dual-track approach offering both the classic Tasmota Scripter and the high-performance TinyC VM, utilizing FreeRTOS for background processing and LittleFS for filesystem management. The firmware supports energy monitoring, Google Charts visualization, and emulation of smart battery interfaces like Shelly Pro 3EM.

freertos littlefslwiplvglplatformio-platformio-core
Z906 Remote

Z906 Remote

An ESP8266-based IoT solution for remote management of the Logitech Z906 5.1 surround sound system. It provides a web interface and MQTT integration for volume control, input switching, and status monitoring via the system's DE-15 console port.

littlefslwip
Pixel Pets

Pixel Pets

Pixel Pets is an open-source virtual pet ecosystem built for the M5Stack hardware family, featuring interactive digital companions with adaptive behaviors. It utilizes FreeRTOS for task management and the M5Unified library for hardware abstraction, supporting advanced features like ESP-NOW inter-device communication, offline LLM-based voice control, and real-time environment syncing. The project targets various ESP32 platforms including the CoreS3, Core2, and M5StickC PLUS2.

freertos littlefslwip
ESP32 Bit Pirate

ESP32 Bit Pirate

ESP32 Bit Pirate is an open-source firmware that transforms ESP32-S3 development boards into multi-protocol hardware hacking tools. It provides extensive support for digital protocols like I2C, SPI, and UART, as well as radio communications including Wi-Fi, Bluetooth, and Sub-GHz, utilizing FreeRTOS and LittleFS for robust device interaction.

freertos littlefslwipnimble
BETTA HA Panel

BETTA HA Panel

BETTA HA Panel is a runtime-configurable Home Assistant dashboard firmware for ESP32-P4 and ESP32-S3 touchscreen devices. Built on the ESP-IDF framework using LVGL and LittleFS, it allows users to design complex, multi-page layouts via a web-based drag-and-drop editor without requiring YAML configuration or firmware rebuilds.

freertos littlefslvgllwip

High-Fidelity ESP32 Bluetooth Audio Sink with Premium Codecs

An advanced Bluetooth audio receiver firmware for ESP32 that supports high-resolution codecs including LDAC, aptX HD, and AAC. Built on ESP-IDF v5.5.2, it features real-time DSP audio enhancement, integrated LED matrix visualization, and BLE-based remote control.

freertos lwip
Multi-Firmware-ESP

Multi-Firmware-ESP

A custom bootloader for the ESP32 that enables switching between multiple firmware versions using hardware switches. It integrates Over-The-Air (OTA) update capabilities and the ESP-Serial-Flasher library to facilitate remote firmware management and master-slave device flashing.

freertos lwip
ESP CAN-Analyzer

ESP CAN-Analyzer

An ESP32-based bridge that interfaces CAN bus systems with IoT environments using the Lawicel (SLCAN) protocol. It supports real-time CAN data monitoring and transmission via a web interface, Serial, or WebSockets, and is designed for automotive and industrial applications.

freertos spiffslwip