Overview

Supported Features

The networking stack is modular and configured at build time. Enable only the features your application needs to minimize memory use; almost all of them can be disabled. Buffer management keeps copies to a minimum: the stack avoids copying application data on the transmit path.

Ethernet and TSN

Network Layer

IPv6 (RFC 8200)

  • Static addresses or SLAAC (Stateless Address Autoconfiguration, RFC 4862), with a configurable number of addresses and prefixes.

  • Neighbor Discovery (RFC 4861) with an optional neighbor cache, and Multicast Listener Discovery v2 (RFC 3810).

  • 6LoWPAN (RFC 4944) for IEEE 802.15.4 networks, with IPHC header compression (RFC 6282) and fragmentation.

  • DHCPv6 (RFC 8415) client and server, including prefix delegation. See DHCPv6.

  • DNS server addresses from Router Advertisements (RDNSS, RFC 8106).

  • Privacy extensions (RFC 8981).

  • Fragmentation and Path MTU Discovery (RFC 8201).

  • Route table, forwarding between interfaces with CONFIG_NET_IPV6_FORWARDING, and multicast routing and forwarding.

IPv4 (RFC 791). Not available on IEEE 802.15.4, which is IPv6 only.

  • Static addresses, link-local address autoconfiguration (RFC 3927) and address conflict detection (RFC 5227). Sample: IPv4 autoconf client.

  • DHCPv4 (RFC 2131) client and server. See DHCPv4.

  • IGMPv2 (RFC 2236) and IGMPv3 (RFC 3376).

  • Fragmentation and Path MTU Discovery (RFC 1191).

  • Route table, and forwarding between interfaces with CONFIG_NET_IPV4_FORWARDING.

  • NAT (Network Address Translation): source NAT (masquerading) of forwarded packets that match iptables-like rules, with connection tracking that translates the replies back.

IPv6 and IPv4 can be used at the same time (dual-stack).

Filtering and tunneling

Transport and Sockets

Application Protocols

The protocol name links to its documentation, when there is one.

Protocol

Standard

Role

Samples

CoAP [1]

RFC 7252

client, server

CoAP client, CoAP service

DNS

RFC 1035

resolver

DNS resolve

mDNS, DNS-SD

RFC 6762, RFC 6763

resolver, responder

mDNS responder

LLMNR (deprecated)

RFC 4795

resolver, responder

FTP

RFC 959

client

FTP client shell sample

HTTP

HTTP/1.1 (RFC 2616), HTTP/2 (RFC 9113), HTTP/3 (RFC 9114)

client (HTTP/1.1), server (HTTP/1.1, HTTP/2, HTTP/3)

HTTP Client, HTTP Server

LwM2M [2]

LwM2M specification 1.0.2, LwM2M specification 1.1.1

client

LwM2M client

MCP (Model Context Protocol)

2025-11-25

server

MCP Server Hello World

MIDI 2.0

Network UDP transport

endpoint host

MIDI2 network transport

MQTT

3.1.1, 5.0

client

MQTT publisher

MQTT-SN

1.2

client

MQTT-SN publisher

OCPP (Open Charge Point Protocol)

1.6

charge point

OCPP charge point

Prometheus

metrics server

Prometheus Sample

RTP (Real-time Transport Protocol), SRTP

RFC 3550, RFC 3711

source, sink

RTP

SNTP

RFC 5905

client, server

SNTP client, SNTP server

SOCKS5

RFC 1928

client

SSH

SSH-2 (RFC 4251 to RFC 4254)

client, server (shell, exec and subsystem channels), shell backend

SSH server and client

STUN

RFC 8489

message codec

TFTP

RFC 1350

client

TFTP client

WebSocket

RFC 6455

client, HTTP server upgrade

WebSocket Client

Management

  • Network management API to receive events from the network stack, for example when an IP address is added or an interface comes up.

  • Connection Manager to monitor IP connectivity and control network association through one API, whatever the network technology.

  • Network configuration library to set up network interfaces at boot from Kconfig options.

  • Wi-Fi management API to scan for and connect to networks, and Wi-Fi network managers that register with the Wi-Fi stack to implement it.

Diagnostics

Source Tree Layout

The networking stack source code tree is organized as follows:

subsys/net/

Various optional network stack components like connection manager, packet filter code and hostname handling are located here.

subsys/net/ip/

This is where the core network stack code is located.

subsys/net/l2

This is where the IP stack layer 2 code is located. This includes generic support for Ethernet, IEEE 802.15.4 and Wi-Fi.

subsys/net/lib/

Application-level protocols (DNS, MQTT, etc.) and additional stack components (BSD Sockets, etc.).

include/zephyr/net/

Public API header files. These are the header files applications need to include to use IP networking functionality.

samples/net/

Sample networking code. This is a good reference to get started with network application development.

tests/net/

Test applications. These applications are used to verify the functionality of the IP stack, but are not the best source for sample code (see samples/net/ instead).