Sample description

This sample is always built as a PT (Portable Termination) device (CONFIG_DECT_DEFAULT_DEV_TYPE_PT in the prj.conf file).

The sample enables CONFIG_DECT_TETHER_IPV6_LIB for a tethered host on Ethernet:

  • ICMPv6 Router Advertisements on eth0: default router (router_lifetime), RDNSS (DNS), Managed (M) flag set (CONFIG_DECT_TETHER_IPV6_RA_MANAGED=y, required), and Prefix Information Options for ULA/GUA with L=0 and A=0 (prefix hint only—no SLAAC, not on-link).

  • Minimal DHCPv6 server on UDP port 547: responds to Solicit, Request, Renew, and Information-request, offering ULA and GUA /128 values read from dect0 (same addresses the stack configured on the DECT interface).

The tether model is split: RA advertises this device as the IPv6 default gateway, M=1 tells the host to obtain those DECT /128 addresses using DHCPv6 IA_NA. Do not clear the Managed flag (CONFIG_DECT_TETHER_IPV6_RA_MANAGED=n): with PIO A=0 there is no SLAAC fallback, so hosts such as Windows typically end up with no addresses and no ::/0.

On the nRF9151 DK, the console and shell use UART0 at 115200 baud (board default), like other Zephyr samples on that kit.

Requirements

The sample supports the following development kit:

Hardware platforms

PCA

Board name

Board target

nRF9151 DK

PCA10171

nrf9151dk

nrf9151dk/nrf9151/ns

For Ethernet builds, use an SPI Ethernet shield so eth0 exists. Merge the overlays described in Building.

For more security, it is recommended to use the */ns variant of the board target. When built for this variant, the sample is configured to compile and run as a non-secure application using security by separation. Therefore, it automatically includes Trusted Firmware-M that prepares the required peripherals and secure services to be available for the application.

Overview

This sample shows how to turn a DECT NR+ uplink into an IPv6 gateway (GW) for a host that is tethered over Ethernet, without relying on host-side SLAAC. It initializes the DECT NR+: IPv6 tethering library, which then sends Router Advertisements and runs a minimal DHCPv6 server on behalf of the tethered host.

The sample calls dect_tether_ipv6_init() after nrf_modem_lib_init() (see src/main.c).

The following abbreviations from the DECT NR+ MAC specification (ETSI TS 103 636-4) are used where relevant:

  • FT: Fixed Termination point

  • PT: Portable Termination point

For the architecture diagram and system-level big picture, see DECT NR+: IPv6 tethering.

Tethered hosts (Windows and Ubuntu)

The same tether-gateway firmware behaves differently on Windows 11 and Ubuntu when using baseline overlays (eth_common.conf only).

Ubuntu typically keeps an RA-learned ::/0 (ip -6 route show default) and refreshes the route expires timer when multicast RAs arrive (~every 60 s). DHCPv6 on the PC often completes in one round trip (Solicit → Reply when the client uses Rapid Commit).

Windows 11 may remove the RA-learned default route after NUD (~30 s with default REACHABLE_TIME) even though the tether gateway still sends multicast RAs and DHCPv6 addresses may still work. For long sessions on Windows, add a persistent static ::/0 on the PC or append the file:eth_max_connectivity.conf file.

Default route or neighbor cache are independent on the host:

  • ::/0 / GW valid - From the RA router_lifetime (and Windows route policy).

  • Neighbor fe80::… - Link-layer mapping; might show Reachable, Stale, or Permanent (if you pinned it with netsh). A Reachable neighbor does not guarantee that Windows keeps ::/0.

RA timing is controlled by Kconfig (CONFIG_DECT_TETHER_IPV6_RA_ROUTER_LIFETIME and related options in subsys/net/lib/dect/tether_ipv6/Kconfig). See Windows 11 usage and Ubuntu usage for OS-specific monitoring commands and troubleshooting.

Building

This sample can be found under samples/dect/dect_tether_ipv6 in the nRF Connect SDK folder structure.

For more security, it is recommended to use the */ns variant of the board target (see the Requirements section above.) When built for this variant, the sample is configured to compile and run as a non-secure application using security by separation. Therefore, it automatically includes Trusted Firmware-M that prepares the required peripherals and secure services to be available for the application.

To build the sample, follow the instructions in Building an application for your preferred building environment. See also Programming an application for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.

Note

When building repository applications in the SDK repositories, building with sysbuild is enabled by default. If you work with out-of-tree freestanding applications, you need to manually pass the --sysbuild parameter to every build command or configure west to always use it.

See Providing CMake options for instructions on how to provide CMake options, for example to use a configuration overlay.

Configuration overlays (Ethernet)

Baseline Kconfig (no extra overlay) provides standard tethering: Managed RA, DHCPv6 /128 leases, 60 s multicast RAs, RS-triggered RAs, and Zephyr solicited NA to host NUD. Ubuntu tether tests usually need only baseline.

The following are optional files in this sample directory (append in this order after eth_common.conf and shield-specific eth_*.conf):

  • mdns-common.conf - Zephyr mDNS/DNS-SD stack (optional)

  • mdns.conf - Sample DNS-SD advertisement on dect0.

  • eth_mdns.conf- mDNS-on-Ethernet tuning (scoped DNS, CONFIG_ZVFS_POLL_MAX). After mdns-common.conf and mdns.conf.

  • mdns_forward.conf -eth0 ↔ dect0 mDNS tap. After eth_mdns.conf.

  • eth_max_connectivity.conf - RFC-max REACHABLE_TIME (1 h), long router_lifetime, long DHCPv6 lifetimes. For long iperf / stability tests on Windows.

  • eth_ra_test_short_lifetime.conf - Lab helper: router_lifetime=120 and 30 s periodic RAs.

  • eth_unsol_na.conf - Periodic unsolicited Neighbor Advertisements on eth0 (optional ND-table aid).

  • dect_rx_pool.conf - Enables a DECT-private RX net_pkt / net_buf pool (see DECT-private RX pool (dect_rx_pool.conf)) so eth0 RX bursts cannot starve dect0 RX.

  • dhcpv6-debug.conf - Logs each DHCPv6 datagram received on UDP 547 plus extra DHCPv6 debug output. Disable for production—Renew traffic can spam UART.

Both the Arceli and Seeed Studio W5500 shields are supported and equally recommended. For either one, the recommended default also appends dect_rx_pool.conf and dlc_resilient.conf, which keep the tether stable under sustained bidirectional load—use this combo unless you have a specific reason not to.

Recommended default—Arceli W5500 (from the sample directory):

cd nrf/samples/dect/dect_tether_ipv6
west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=arceli_eth_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;dect_rx_pool.conf;dlc_resilient.conf" -DEXTRA_DTC_OVERLAY_FILE=w5500-static-mac.overlay

Recommended default—Seeed Studio W5500 (from the sample directory):

cd nrf/samples/dect/dect_tether_ipv6
west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=seeed_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;eth_w5500_seeed.conf;dect_rx_pool.conf;dlc_resilient.conf" -DEXTRA_DTC_OVERLAY_FILE=w5500-seeed-static-mac.overlay

With mDNS responder on eth0 and dect0 added (Arceli W5500; append mdns-common.conf, mdns.conf, eth_mdns.conf after the shield conf—see mDNS / DNS-SD below for the full mDNS overlay chain):

cd nrf/samples/dect/dect_tether_ipv6
west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=arceli_eth_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;mdns-common.conf;mdns.conf;eth_mdns.conf" -DEXTRA_DTC_OVERLAY_FILE=w5500-static-mac.overlay

See Ethernet with W5500 shield (Arceli) and Ethernet with W5500 shield (Seeed Studio board) below for shield-specific notes (wiring, MAC address overlay, pin mapping).

Ethernet with W5500 shield (Arceli)

Use this when the host leg should use Ethernet through the Zephyr ARCELI W5500 ETH shield on the nRF9151 DK. Merge eth_common.conf and eth_w5500.conf; devicetree comes from w5500-static-mac.overlay in this sample plus the Zephyr shield devicetree zephyr/boards/shields/arceli_eth_w5500/arceli_eth_w5500.overlay. For tethering, also append dect_rx_pool.conf and dlc_resilient.conf (recommended, see DECT-private RX pool (dect_rx_pool.conf) and Loss-resilient DLC profile (dlc_resilient.conf))—without the private DECT RX pool, sustained PC traffic can starve buffers and stall eth0 in poll mode.

Note

Arduino D8 (reset) and D9 (interrupt) are shared with BUTTON1 and BUTTON2 on the nRF9151 DK. The Ethernet Kconfig overlays disable the DK library to avoid conflicts with the Arceli shield.

  • From the sample directory (copy-paste each line):

    cd nrf/samples/dect/dect_tether_ipv6
    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=arceli_eth_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;dect_rx_pool.conf;dlc_resilient.conf" -DEXTRA_DTC_OVERLAY_FILE=w5500-static-mac.overlay
    
  • Wiring as in the Arceli ETH W5500 shield overlay. Connect the RJ45 port to your LAN (router/switch) or directly to a PC as needed for your test.

Ethernet MAC: w5500-static-mac.overlay sets a fixed locally administered local-mac-address—edit that file so each board on the same LAN is unique. For a random MAC each boot (zephyr,random-mac-address), use -DEXTRA_DTC_OVERLAY_FILE=w5500.overlay instead.

nRF9151 DK + Arceli ETH W5500 (Arduino header).

W5500 / shield signal

nRF9151 DK (Arduino/GPIO)

SCS

D10 (P0.10)

MOSI

D11 (P0.11)

MISO

D12 (P0.12)

SCK/CLK

D13 (P0.13)

INT

D9 (P0.09)

RESET

D8 (P0.08)

3.3V

Arduino 3.3V or DK VDD

GND

GND

Ethernet with W5500 shield (Seeed Studio board)

Use this when the host leg should use Ethernet through the Zephyr Seeed W5500 Ethernet Shield shield (Seeed Studio v1.1 shield was used) on the nRF9151 DK. Merge eth_common.conf, eth_w5500.conf, and eth_w5500_seeed.conf. For tethering, also append dect_rx_pool.conf and dlc_resilient.conf (recommended, see DECT-private RX pool (dect_rx_pool.conf) and Loss-resilient DLC profile (dlc_resilient.conf))—without the private DECT RX pool, sustained PC traffic can starve buffers and stall eth0 in poll mode. The Seeed shield (Rev 1.01) leaves the W5500 INTn disconnected, so the w5500-seeed*.overlay files remove int-gpios for devicetree polling mode and eth_w5500_seeed.conf sets a faster CONFIG_ETH_W5500_POLL_PERIOD. Devicetree comes from the Zephyr shield devicetree zephyr/boards/shields/seeed_w5500/seeed_w5500.overlay plus a sample overlay: default w5500-seeed-static-mac.overlay (fixed locally administered Ethernet MAC), or w5500-seeed.overlay for zephyr,random-mac-address (new MAC each boot).

Note

The sample w5500.overlay is Arceli-specific (targets &eth_w5500_arceli_eth_w5500). For seeed_w5500, use w5500-seeed-static-mac.overlay or w5500-seeed.overlay (targets &eth_w5500).

  • From the sample directory (copy-paste each line):

    cd nrf/samples/dect/dect_tether_ipv6
    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=seeed_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;eth_w5500_seeed.conf;dect_rx_pool.conf;dlc_resilient.conf" -DEXTRA_DTC_OVERLAY_FILE=w5500-seeed-static-mac.overlay
    
    • Edit local-mac-address in w5500-seeed-static-mac.overlay so each board on the same LAN has a unique MAC.

    • For a random Ethernet MAC each boot, use w5500-seeed.overlay instead:

      west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=seeed_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;eth_w5500_seeed.conf;dect_rx_pool.conf;dlc_resilient.conf" -DEXTRA_DTC_OVERLAY_FILE=w5500-seeed.overlay
      

DECT-private RX pool (dect_rx_pool.conf)

Under sustained bidirectional load (PC → DECT uplink + downstream return traffic), eth0 RX bursts allocate from the global Zephyr pools (CONFIG_NET_PKT_RX_COUNT / CONFIG_NET_BUF_RX_COUNT) and can starve dect0 RX, surfacing as RX packet allocation failed in ISR drops, followed by nrf_modem_dect_dlc_data_tx returned NRF_ENOMEM on the TX side and eth_w5500: TX semaphore timeout on the sink.

Append dect_rx_pool.conf last in EXTRA_CONF_FILE to enable CONFIG_DECT_MDM_RX_PRIVATE_POOL—a DECT-only net_pkt slab and net_buf pool isolated from the global RX pools:

cd nrf/samples/dect/dect_tether_ipv6
west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=seeed_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;eth_w5500_seeed.conf;dect_rx_pool.conf" -DEXTRA_DTC_OVERLAY_FILE=w5500-seeed-static-mac.overlay

Runtime inspection (with CONFIG_NET_BUF_POOL_USAGE=y and CONFIG_MEM_SLAB_TRACE_MAX_UTILIZATION=y already set by the overlay):

uart:~$ dect_mdm rx_pool
DECT private RX pool:
Address         Total   Free    MaxUsed Name
0x...           35      35      8       dect_mdm_rx_pkts (slab)
0x...           50      50      8       dect_mdm_rx_bufs (bufs, 128 B)

Bump PRIVATE_PKT_COUNT first if MaxUsed == Total under sustained traffic; raise PRIVATE_BUF_COUNT only if max-MTU downstream frames also become common (each consumes ceil(1500 / BUF_SIZE) fragments).

Loss-resilient DLC profile (dlc_resilient.conf)

Use dlc_resilient.conf when the PT reconnects too eagerly under RF interference or link congestion: the modem’s stock DLC defaults (60 s SDU lifetime, release on first discard) drop the association on a single discard-timer expiry. The overlay trades that for a more tolerant profile on the PT’s uplink (see the file’s comments for the exact values and rationale).

Append dlc_resilient.conf last in EXTRA_CONF_FILE, optionally combined with dect_rx_pool.conf:

cd nrf/samples/dect/dect_tether_ipv6
west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=seeed_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;eth_w5500_seeed.conf;dect_rx_pool.conf;dlc_resilient.conf" -DEXTRA_DTC_OVERLAY_FILE=w5500-seeed-static-mac.overlay

Both knobs are also runtime-tunable using the DECT L2 shell (dect sett --dlc_sdu_lifetime, --dlc_discard_release_assoc_count, --read).

Valid --dlc_sdu_lifetime values are 1..31 (0.5 ms .. 60 s, see enum dect_dlc_sdu_lifetime / nrf_modem_dect_dlc_sdu_lifetime) or 255 for INFINITY. Use 31 (60 s) to revert to the default at runtime.

mDNS / DNS-SD

To advertise _dect-nr._udp (same service name as dect_shell), merge overlays in this order: mdns-common.conf, mdns.conf, and (for Ethernet) eth_mdns.conf; add mdns_forward.conf last for the eth0 ↔ dect0 tap.

  • From the sample directory (copy-paste each line):

    DECT-only (append mDNS overlays):

    cd nrf/samples/dect/dect_tether_ipv6
    west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE="mdns-common.conf;mdns.conf"
    

    Arceli W5500—mDNS responder on eth0 and dect0:

    cd nrf/samples/dect/dect_tether_ipv6
    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=arceli_eth_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;mdns-common.conf;mdns.conf;eth_mdns.conf" -DEXTRA_DTC_OVERLAY_FILE=w5500-static-mac.overlay
    

    Arceli W5500—add mdns_forward.conf for the eth0 ↔ dect0 mDNS tap in dect_tether_ipv6_lib (CONFIG_DECT_TETHER_IPV6_MDNS_FORWARD):

    cd nrf/samples/dect/dect_tether_ipv6
    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=arceli_eth_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;mdns-common.conf;mdns.conf;eth_mdns.conf;mdns_forward.conf" -DEXTRA_DTC_OVERLAY_FILE=w5500-static-mac.overlay
    

    Seeed W5500 uses the same mDNS conf chain; change SHIELD, shield-specific conf, and EXTRA_DTC_OVERLAY_FILE as in the Ethernet sections above.

What this does:

  • Zephyr mDNS responder listens on UDP 5353 on each IPv6-capable interface (eth0 when present, and dect0).

  • src/mdns_dns_sd_listen.c binds UDP port CONFIG_SAMPLE_DECT_TETHER_IPV6_MDNS_DNS_SD_PORT (default 4700) on dect0 so DNS-SD sees the advertised service port as in use, matching the dect_shell pattern.

  • mdns_forward.conf turns on CONFIG_DECT_TETHER_IPV6_MDNS_FORWARD (and CONFIG_NET_SOCKETS_PACKET): an AF_PACKET tap in dect_tether_ipv6_lib (dect_tether_ipv6_mdns_fwd.c) that forwards IPv6 mDNS between eth0 and dect0 without IID NAT. Queries from Ethernet are forwarded to DECT only when the IPv6 source is ULA or GUA; fe80:: sources are skipped. DECT toward Ethernet forwards multicast to ff02::fb and unicast mDNS whose destination is ULA or GUA (so unicast replies to a DHCPv6 host can return on the tether).

Hostname / instance label defaults to CONFIG_NET_HOSTNAME in mdns.conf (dect-tether-ipv6). Change there if several devices share a LAN.

Dependencies

This sample uses the following nRF Connect SDK libraries:

In addition, it uses the following secure firmware component: