lwIP (lightweight IP) is a widely used
open-source TCP/IP stack 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
Analog Devices, Inc. (ADI), also known simply as Analog, is an American multinational semiconductor company specializing in data conversion, signal processing and power management technology, headquartered in Wilmington, Massachusetts.
The c ...
,
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 fi ...
,
TI,
ST and
Freescale.
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, lwIP has several other important parts, such as a
network interface Network interface may refer to:
* Network interface controller, a computer hardware component that connects a computer to a computer network
* Network interface device, a device that serves as the demarcation point between a telephone carrier's loc ...
, 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 that can handle packet forwarding over multiple network interfaces.
Both
IPv4
Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 was the first version d ...
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. I ...
are supported dual stack since lwIP v2.0.0 . For network maintenance and debugging, lwIP implements
ICMP (Internet Control Message Protocol).
IGMP (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 g ...
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 ...
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 lwIP implements
TCP
TCP may refer to:
Science and technology
* Transformer coupled plasma
* Tool Center Point, see Robot end effector
Computing
* Transmission Control Protocol, a fundamental Internet standard
* Telephony control protocol, a Bluetooth communication s ...
(Transmission Control Protocol) with congestion control, RTT estimation and fast recovery/fast retransmit.
UDP (User Datagram Protocol) is implemented with experimental
UDP-Lite 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
The Domain Name System (DNS) is a hierarchical and distributed naming system for computers, services, and other resources in the Internet or other Internet Protocol (IP) networks. It associates various information with domain names assigned to ...
(Domain Name System), an
SNMP (Simple Network Management Protocol) agent, in v1, v2 or v3, with private MIB (
management information base) 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 (Dynamic Host Configuration Protocol) client or IPv4
link-local addresses (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 Web, ...
server, a
SNTP client, a
SMTP client, a
NetBIOS nameserver, a
mDNS responder, a
MQTT client and a
TFTP server.
OS implementations
lwIP is used as network stack in
ReactOS
ReactOS is a free and open-source operating system for amd64/ i686 personal computers intended to be binary-compatible with computer programs and device drivers made for Windows Server 2003 and later versions of Windows. ReactOS has been noted ...
and
Genode 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, ...
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