Open-source project
lwip-tcpip/lwip avatar
lwip-tcpip/lwip

lwIP for Resource-Constrained Embedded Networking

lwIP mirror from http://git.savannah.gnu.org/cgit/lwip.git

1,764 stars636 forksCNOASSERTION

At a glance

What is it?
lwIP is a compact C implementation of TCP/IP for embedded systems with limited RAM and code ROM. It suits projects that need IPv4 or IPv6, TCP or UDP, and selectable APIs without adopting a full desktop network stack.
Who is it for?
Adopt lwIP when an embedded target has tens of kilobytes of RAM available and the device needs a configurable TCP/IP implementation rather than a general-purpose operating system network layer. Do not choose it merely for its feature list if your application depends on behavior that the README leaves undocumented, such as deployment-specific buffering defaults or driver integration requirements.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 52 days ago.
What is it written in?
Mainly C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Why lwIP Fits Tight Embedded Targets

lwIP addresses a specific engineering problem: providing a full-scale TCP/IP implementation where an embedded device has roughly tens of kilobytes of free RAM and room for about 40 kilobytes of code ROM. That resource profile is the central design goal stated by the README. It makes lwIP relevant to firmware teams working on small controllers and other systems that cannot justify the networking assumptions of a desktop operating system.

The stack covers connectionless and connection-oriented transport. Its documented protocol support includes IPv4 and IPv6, ICMP, UDP, and TCP. TCP includes congestion control, round-trip time estimation, fast recovery, fast retransmission, and SACKs. This is a substantial protocol set, but the package should still be treated as configurable embedded infrastructure rather than a drop-in application framework. The README does not give universal buffer sizes, initialization steps, or hardware-driver settings because those concerns depend on the target and port.

The intended users are therefore C developers integrating networking into firmware. They need to choose an API, connect lwIP to the platform's network interface, establish timing and memory settings, and decide which protocol components to compile. Teams looking for a hosted TCP/IP stack with a standard operating system network service would have to account for the missing host integration instructions.

lwIP also targets more than ordinary IP over Ethernet. The feature list includes PPPoS, PPPoE, DNS, multicast management, DHCP variants, IPv6 neighbor discovery, and 6LoWPAN operation over IEEE 802.15.4, BLE, or ZEP. These options broaden its application range, but they also increase the number of configuration and compatibility decisions that must be made before integration.

lwIP API, Protocol, and Application Layers

lwIP exposes two documented programming choices: a raw/native API for enhanced performance and an optional Berkeley-like socket API. The raw API gives an embedded application closer access to stack mechanisms, while the socket API offers a familiar interface for code organized around sockets. The README does not claim that both interfaces have identical behavior, nor does it promise source compatibility with every application written for a desktop socket implementation.

The optional TLS path is implemented as a layered TCP abstraction called `altcp`. The README says that this can place TLS nearly transparently beneath a TCP-based protocol and notes that it has been ported to mbedTLS. Listed applications include HTTPS, SNMPv3, and an MQTT client with TLS support through `altcp`. TLS is optional, not an automatic property of every lwIP build.

Several higher-level applications are included in the repository documentation. The project lists an HTTP server with SSI and CGI, an SNMPv2c agent with a MIB compiler, SNTP, NetBIOS and MDNS responders, an iPerf server, and an MQTT client. These examples show the range of possible uses, but the README does not state that each application is production-ready for every platform. Their configuration, dependencies, and integration assumptions are not presented in the excerpt.

IPv6 support is substantial but has named boundaries. MLD aims to comply with RFC 2710 and does not support MLDv2. Neighbor discovery and stateless address autoconfiguration aim to comply with RFC 4861 and RFC 4862. This distinction matters when a product requires multicast listener behavior beyond the documented MLD scope.

Repository Structure and the Path from Source to Firmware

Based on the repository layout, lwIP separates the maintained TCP/IP implementation from contributed integrations and examples. Core stack code is under `src`, while contributions such as platform ports and applications are under `contrib`. This arrangement helps developers distinguish the central implementation from target-specific work, although it does not mean that `contrib` is optional for every product. A device with unusual hardware or timing may require a port found there.

The top level also includes `CMakeLists.txt`, `BUILDING`, `CHANGELOG`, `UPGRADING`, documentation, and a `test` directory. The presence of a `CMakeLists.txt` establishes that CMake is represented in the repository, but the README does not provide an exact CMake invocation, generator selection, or first-build command. It would be unsafe to invent those steps and present them as the project's documented procedure.

Development is hosted on Savannah, even though this repository is described as an lwIP mirror. The README directs development activity to the Savannah Git tree, mailing lists, and project page. It also points to GitHub Actions for continuous integration builds using GCC and clang. That workflow indicates build coverage at the repository level, but it does not specify which configurations execute or what quality threshold applies.

The documentation is distributed across several sources. Source comments are extracted into the project's web documentation, `docs` contains background material, `doc/savannah.txt` covers Git access, and the wiki is linked for supplementary information. The README explicitly warns that the wiki is not maintained as well as it should be. For current API details, the generated source documentation and mailing-list archives are better documented evidence than the wiki.

Finding a First lwIP Build Without Invented Setup Steps

The repository provides `BUILDING`, `CMakeLists.txt`, and `src/include/lwip/opt.h`, but the README excerpt does not give a complete installation procedure for a particular board. The README excerpt does not document a one-line installer. The correct first step is to obtain the source from the project page or repository and read `BUILDING` for the supported build sequence. Do not assume that cloning or creating a `build` directory is the complete setup, because neither instruction is stated here.

A first real use also requires decisions that the README cannot answer for you. Identify the network medium, then determine whether the platform uses Ethernet, PPP, PPPoE, PPPoS, or one of the documented 6LoWPAN arrangements. Next, select either the raw/native API or the Berkeley-like socket API. Configuration must account for the memory available on the target and the timing integration used by the firmware.

The README also points to an HTTP server example, but it does not provide the source path, menu options, port, configuration keys, or build command needed to launch it. Consequently, there is no verified command block to include for a first server run. Copying commands from an unrelated lwIP tutorial would introduce platform details that are not traceable to this repository description.

For developers starting from the source, the most concrete first actions are therefore procedural rather than speculative: inspect `BUILDING`, review `src/include/lwip/opt.h`, locate the applicable platform port under `contrib`, and confirm the toolchain required by that port. Only after those platform facts are known does a build command become meaningful.

Resource Tuning, Upgrade Work, and the BSD Licensing Statement

lwIP's memory reduction goal does not remove configuration responsibility. `src/include/lwip/opt.h` is the central opt-in configuration location identified by its path, but the README excerpt does not enumerate the available keys or recommend values. Buffer sizes, protocol enablement, interface behavior, and timing will affect both RAM consumption and protocol behavior. An engineer adopting the stack must treat configuration review as part of implementation rather than relying on the headline code and memory figures.

The repository includes `UPGRADING` and `CHANGELOG`. Those files are the documented starting points for determining compatibility changes between revisions, although the README does not summarize a current upgrade procedure or a supported release cadence. The default branch is `master`, and the mirror has no GitHub releases. That means the README does not identify a GitHub release artifact that an adopter can select as a stable package.

The last push to this repository was on 2026-09-01, and the repository is not archived. The README says development and maintenance are hosted on Savannah, so users should distinguish changes in this mirror from the authoritative development location. Repository activity alone does not establish that a particular board port or application has been validated for a product.

The README describes lwIP as freely available under a BSD license. GitHub classifies the repository's license as a custom license and directs readers to the license file, while the repository also contains `COPYING` and `COPYING` is listed at the top level. Because those descriptions are not identical, integrators should inspect the applicable license files for their distribution. This is a compliance check, not legal advice, and embedded products often need separate review of notices and third-party component terms.

When lwIP Is the Wrong Networking Choice

The clearest wrong-tool case is a project that needs a ready-made host operating system network stack with documented distribution packages and platform integration. lwIP is an independent embedded TCP/IP implementation written primarily in C. Its API selection, memory configuration, timing, and port integration require product-specific work.

A second limitation is the boundary between feature support and target qualification. The README lists MLD without MLDv2 support, and it describes optional TLS through `altcp` rather than built-in TLS for every API path. If a design depends on MLDv2, assumes ordinary TLS integration through any socket operation, or expects every listed application to work unchanged on a given MCU, those assumptions exceed the documentation.

The source-of-truth issue can also affect maintenance planning. This repository is a mirror, while development is hosted on Savannah. It is not archived and received a push on 2026-09-01, but adopters integrating the Savannah tree should check where changes are made and how they enter this mirror before assuming every branch state is identical.

A direct alternative approach is to use the network stack supplied by the target operating system. That option delegates interface, socket, buffering, and lifecycle management to the OS vendor, but can consume more memory than lwIP's embedded design target. Another approach is a larger standalone TCP/IP stack with a more uniform host-facing configuration process. The relevant difference is not the number of listed protocols. It is the amount of platform integration and resource control the application team wants to own.

Editorial conclusion

Adopt lwIP when an embedded target has tens of kilobytes of RAM available and the device needs a configurable TCP/IP implementation rather than a general-purpose operating system network layer. Do not choose it merely for its feature list if your application depends on behavior that the README leaves undocumented, such as deployment-specific buffering defaults or driver integration requirements. Check `src/include/lwip/opt.h`, the selected platform adaptation layer, and `BUILDING` first, then verify the specific application needs against the documentation and generated source documentation.

Frequently asked questions

What is lwIP used for?

lwIP is a compact C implementation of the TCP/IP protocol suite for embedded systems with limited RAM and code ROM. It supports IPv4, IPv6, TCP, UDP and other network features.

Does lwIP support IPv6 and TCP?

Yes. The documented feature list includes IPv6, TCP with congestion control, RTT estimation, fast recovery, fast retransmit and SACKs. IPv6 neighbor discovery and address autoconfiguration are also listed.

How do I install and build lwIP for an embedded device?

The README excerpt does not provide a complete board-specific installation command. It directs developers to the source repository and includes `BUILDING`, `CMakeLists.txt` and `src/include/lwip/opt.h` as relevant starting points.

Official sources

  1. Issues
  2. lwip-tcpip/lwip on GitHub
  3. Project website
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/lwip-tcpip-lwip.svg)](https://hysenlabs.com/projects/lwip-tcpip-lwip)

Was this useful?