lwIP (lightweight IP) is a widely used
open-source TCP/IP stack
The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the set of communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suit ...
designed for
embedded system
An embedded system is a computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is ''embedded'' ...
s. lwIP was originally developed by
Adam Dunkels at the
Swedish Institute of Computer Science and is now developed and maintained by a worldwide network of developers.
lwIP is used by many manufacturers of embedded systems, including
Intel/Altera,
Analog Devices,
Xilinx
Xilinx, Inc. ( ) was an American technology and semiconductor company that primarily supplied programmable logic devices. The company was known for inventing the first commercially viable field-programmable gate array (FPGA) and creating the ...
,
TI,
ST and
Freescale
Freescale Semiconductor, Inc. was an American semiconductor manufacturer. It was created by the divestiture of the Semiconductor Products Sector of Motorola in 2004. Freescale focused their integrated circuit products on the automotive, embedd ...
.
lwIP network stack
The focus of the lwIP network stack implementation is to reduce resource usage while still having a full-scale TCP stack.
This makes lwIP suitable for use in embedded systems with tens of kilobytes of free RAM and room for around 40 kilobytes of code ROM.
lwIP protocol implementations
Aside from the
TCP/IP stack
The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the set of communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suit ...
, lwIP has several other important parts, such as a
network interface, an operating system emulation layer, buffers and a memory management section. The operating system emulation layer and the network interface allow the network stack to be transplanted into an operating system, as it provides a common interface between lwIP code and the
operating system kernel
The kernel is a computer program at the core of a computer's operating system and generally has complete control over everything in the system. It is the portion of the operating system code that is always resident in memory and facilitates in ...
.
The network stack of lwIP includes an
IP (Internet Protocol) implementation at the
Internet layer
The internet layer is a group of internetworking methods, protocols, and specifications in the Internet protocol suite that are used to transport network packets from the originating host across network boundaries; if necessary, to the destinat ...
that can handle packet forwarding over multiple network interfaces.
Both
IPv4 and
IPv6
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communications protocol that provides an identification and location system for computers on networks and routes traffic across the Internet. IPv ...
are supported dual stack since lwIP v2.0.0 . For network maintenance and debugging, lwIP implements
ICMP (Internet Control Message Protocol).
IGMP
The Internet Group Management Protocol (IGMP) is a communications protocol used by hosts and adjacent routers on IPv4 networks to establish multicast group memberships. IGMP is an integral part of IP multicast and allows the network to direct m ...
(Internet Group Management Protocol) is supported for multicast traffic management. While
ICMPv6
Internet Control Message Protocol version 6 (ICMPv6) is the implementation of the Internet Control Message Protocol (ICMP) for Internet Protocol version 6 (IPv6). ICMPv6 is an integral part of IPv6 and performs error reporting and diagnostic fu ...
(including
MLD) is implemented to support the use of IPv6.
lwIP includes an implementation of IPv4
ARP (Address Resolution Protocol) and IPv6
Neighbor Discovery Protocol
The Neighbor Discovery Protocol (NDP), or simply Neighbor Discovery (ND), is a protocol of the Internet protocol suite used with Internet Protocol Version 6 (IPv6). It operates at the link layer of the Internet model, and is responsible for gat ...
to support
Ethernet
Ethernet () is a family of wired computer networking technologies commonly used in local area networks (LAN), metropolitan area networks (MAN) and wide area networks (WAN). It was commercially introduced in 1980 and first standardized in 1 ...
at the
data link layer
The data link layer, or layer 2, is the second layer of the seven-layer OSI model of computer networking. This layer is the protocol layer that transfers data between nodes on a network segment across the physical layer. The data link layer ...
. lwIP may also be operated on top of a
PPP (Point-to-Point Protocol) implementation at the data link layer.
At the
transport layer
In computer networking, the transport layer is a conceptual division of methods in the layered architecture of protocols in the network stack in the Internet protocol suite and the OSI model. The protocols of this layer provide end-to-end ...
lwIP implements
TCP (Transmission Control Protocol) with congestion control, RTT estimation and fast recovery/fast retransmit.
UDP (User Datagram Protocol) is implemented with experimental
UDP-Lite
UDP-Lite (Lightweight User Datagram Protocol) is a connectionless protocol that allows a potentially damaged data payload to be delivered to an application rather than being discarded by the receiving station. This is useful as it allows decisi ...
extensions.
APIs and sockets
lwIP provides a specialized no-copy
application programming interface (API) for enhanced network stack performance. The
Berkeley socket API is optional.
Raw sockets, or raw pcbs (protocol control blocks), are provided depending on the API used.
Application layer support
At the application layer the lwIP network stack may be supported through the implementation of the following protocols. The
DNS (Domain Name System), an
SNMP
Simple Network Management Protocol (SNMP) is an Internet Standard protocol for collecting and organizing information about managed devices on IP networks and for modifying that information to change device behaviour. Devices that typically ...
(Simple Network Management Protocol) agent, in v1, v2 or v3, with private MIB (
management information base
A management information base (MIB) is a database used for managing the entities in a communication network. Most often associated with the Simple Network Management Protocol (SNMP), the term is also used more generically in contexts such as in ...
) support and MIB compiler.
Operating systems that implement the lwIP TCP/IP stack may provide a range of supporting clients and servers at the application layer. Such as an IPv4
DHCP
The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other communication parameters to devices connected to the network using a cli ...
(Dynamic Host Configuration Protocol) client or IPv4
link-local address
In computer networking, a link-local address is a unicast network address that is valid only for communications within the subnetwork that the host is connected to. Link-local addresses are most often assigned automatically with a process known as ...
es (AutoIP). Specialized raw API applications include: an
HTTP
The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide We ...
server, a
SNTP
The Network Time Protocol (NTP) is a networking protocol for clock synchronization between computer systems over packet-switched, variable- latency data networks. In operation since before 1985, NTP is one of the oldest Internet protocols in c ...
client, a
SMTP
The Simple Mail Transfer Protocol (SMTP) is an Internet standard communication protocol for electronic mail transmission. Mail servers and other message transfer agents use SMTP to send and receive mail messages. User-level email clients ty ...
client, a
NetBIOS
NetBIOS () is an acronym for Network Basic Input/Output System. It provides services related to the session layer of the OSI model allowing applications on separate computers to communicate over a local area network. As strictly an API, Ne ...
nameserver, a
mDNS
In computer networking, the multicast DNS (mDNS) protocol resolves hostnames to IP addresses within small networks that do not include a local name server. It is a zero-configuration service, using essentially the same programming interfaces, pac ...
responder, a
MQTT
MQTT (originally an initialism of MQ Telemetry Transport) is a lightweight, publish-subscribe, machine to machine network protocol for Message queue/Message queuing service. It is designed for connections with remote locations that have devices ...
client and a
TFTP
Trivial File Transfer Protocol (TFTP) is a simple lockstep File Transfer Protocol which allows a client to get a file from or put a file onto a remote host. One of its primary uses is in the early stages of nodes booting from a local area netwo ...
server.
OS implementations
lwIP is used as network stack in
ReactOS and
Genode
Genode is a free and open-source software operating system (OS) framework consisting of a microkernel abstraction layer and a set of user space components. The framework is notable as one of the few open-source operating systems not derived from ...
and can be used in
Minix and
GNU Hurd
GNU Hurd is a collection of microkernel servers written as part of GNU, for the GNU Mach microkernel. It has been under development since 1990 by the GNU Project of the Free Software Foundation, designed as a replacement for the Unix kernel, and ...
to implement network servers.
See also
* micro IP (
uIP)
References
{{Reflist
External links
Adam Dunkels' initial Lwip paperlwIP developmentlwIP documentation wikilwIP functions documentationlwIP former homepage (obsolete)LwIP Usage Guide by Microchip (pdf)
Embedded systems