WolfIP: Lightweight TCP/IP stack with no dynamic memory allocations

2026-03-1215:3915047github.com

Lightweight TCP/IP stack with no dynamic memory allocations - wolfSSL/wolfip

NameName

wolfIP is a TCP/IP stack with no dynamic memory allocations, designed to be used in resource-constrained embedded systems.

Endpoint only mode is supported, which means that wolfip can be used to establish network connections but it does not route traffic between different network interfaces.

A single network interface can be associated with the device.

  • BSD-like, non blocking socket API, with custom callbacks
  • No dynamic memory allocation
    • Fixed number of concurrent sockets
    • Pre-allocated buffers for packet processing in static memory
Layer Protocol Features RFC(s)
Data Link Ethernet II Frame encapsulation IEEE 802.3
Data Link ARP Address resolution, request/reply RFC 826
Network IPv4 Datagram delivery, TTL handling RFC 791
Network IPv4 Forwarding Multi-interface routing (optional) RFC 1812
Network ICMP Echo request/reply, TTL exceeded RFC 792
Network IPsec ESP Transport mode RFC 4303
Transport UDP Unicast datagrams, checksum RFC 768
Transport TCP Connection management, reliable delivery RFC 793, RFC 9293
Transport TCP Maximum Segment Size negotiation RFC 793
Transport TCP TCP Timestamps, RTT measurement, PAWS, Window Scaling RFC 7323
Transport TCP Retransmission timeout (RTO) computation RFC 6298, RFC 5681
Transport TCP TCP SACK RFC 2018, RFC 2883, RFC 6675
Transport TCP Congestion Control: Slow start, congestion avoidance RFC 5681
Transport TCP Fast Retransmit, triple duplicate ACK detection RFC 5681
Application DHCP Client only (DORA) RFC 2131
Application DNS A and PTR record queries (client) RFC 1035
Application HTTP/HTTPS Server with wolfSSL TLS support RFC 9110

The POSIX shim builds libwolfip.so, which can be injected in front of host tools so that calls to socket(2) and friends are redirected to the wolfIP stack and the TAP device (wtcp0). After running make:

sudo LD_PRELOAD=$PWD/libwolfip.so nc 10.10.10.2 80

The example above mirrors the existing nc-driven demos: any TCP sockets opened by the intercepted process are serviced by wolfIP instead of the host kernel.

ICMP datagram sockets can be validated the same way. With the TAP interface created automatically by the shim and the host endpoint configured in config.h (HOST_STACK_IP defaults to 10.10.10.1), run:

sudo LD_PRELOAD=$PWD/libwolfip.so ping -I wtcp0 -c5 10.10.10.1

The -I wtcp0 flag pins the test to the injected interface and -c5 generates five echo requests. Successful replies confirm the ICMP datagram socket support end-to-end through the tap device.

wolfIP now includes a dedicated FreeRTOS wrapper port at:

  • src/port/freeRTOS/bsd_socket.c
  • src/port/freeRTOS/bsd_socket.h

This port follows the same model as the POSIX wrapper:

  • One background task loops on wolfIP_poll()
  • Socket wrappers serialize stack access with a mutex
  • Blocking operations wait on callback-driven wakeups (instead of busy polling)

wolfIP is licensed under the GPLv3 license. See the LICENSE file for details. Copyright (c) 2025 wolfSSL Inc.

You can’t perform that action at this time.


Read the original article

Comments

  • By rwmj 2026-03-1221:031 reply

    passt (the network stack that you might be using if you're running qemu, or podman containers) also has no dynamic memory allocations. I always thought it's quite an interesting achievement. https://blog.vmsplice.net/2021/10/a-new-approach-to-usermode... https://passt.top/passt/about/#security

  • By rpcope1 2026-03-1218:241 reply

    It would be interesting to know why you would choose this over something like the Contiki uIP or lwIP that everything seems to use.

    • By RealityVoid 2026-03-1218:391 reply

      Not sure if they do for _this_ package, but the Wolf* people's model is usually selling certification packages so you can put their things in stuff that need certifications and you offload liability. You also get people that wrote it and that you can pay for support. I kind of like them, had a short project where I had to call on them for getting their WolfSSL to work with a ATECC508 device and it was pretty good support from them.

      • By jpfr 2026-03-1219:214 reply

        As the project is GPL’ed I guess they sell a commercial version. GPL is toxic for embedded commercial software. But it can be good marketing to sell the commercial version.

        Edit: I meant commercial license

        • By anthonj 2026-03-138:38

          In my company we used their stuff often. They have an optional commercial license for basically all their products. The price was very reasonable as well.

        • By LoganDark 2026-03-1219:29

          You don't need a commercial version, many projects get away with selling just a commercial license to the same version. As long as they have the rights to relicense this works fine.

        • By RealityVoid 2026-03-1219:30

          I think they might sell a commercial version as well. It makes sense with the GPL. But I can't really recall that well.

        • By cpach 2026-03-139:422 reply

          “GPL is toxic for embedded commercial software”

          Why is that?

          • By bobmcnamara 2026-03-1313:481 reply

            Many bare metal or RTOS systems consist of a handful of statically linked programs (one or two bootloaders and the main application), many companies would rather find a non-GPL library rather than open up the rest of the system's code. Sometimes a system contains proprietary code that may not be open sourced as well.

            • By 1718627440 2026-03-1413:031 reply

              In the embedded world you don't really sell software you sell devices with firmware. Unless the library OS is AGPL, it doesn't matter too much.

              • By tjoff 2026-03-1419:08

                Yes it matters a lot?

          • By dietr1ch 2026-03-1312:49

            He probably meant viral or tried to make a deadly twist on virality

HackerNews