[][src]Crate smolapps

Collection of application-layer protocols built on top of smoltcp.

This crate aims to follow the same guinding principles of smoltcp: simplicity and robustness. It is a #![no_std]-first crate, designed for bare-metal, real-time systems. Heap allocations (if at all present) are reduced to a minimum, and will always be feature gated.

The following protocols are implemented at this time:

  • Simple Network Time Protocol (SNTPv4)
  • Trivial File Transfer Protocol (TFTP)

All protocols are feature-gated. This reduces both compilation time and binary size, the latter being a strong limiting factor in bare-metal applications.

For convenience, this crate re-exports smoltcp under the net name.


Examples on how to use the protocols and their implementations in this crate can be found in the source repository. All examples are provided to run on a hosted Linux environment.

Before running the examples, you need to create a TAP interface with Internet access usable by non-privileged users.

To spawn a TAP interface named tap0, run the following commands:

sudo ip tuntap add name tap0 mode tap user $USER
sudo ip link set tap0 up
sudo ip addr add dev tap0

To forward IPv4 traffic to/from the interface, run:

sudo iptables -t nat -A POSTROUTING -s -j MASQUERADE
sudo sysctl net.ipv4.ip_forward=1

Adjust the interface IP appropriately if you happen to already be on a network. If you do, remember to adjust the example accordingly.


The following features can be enabled at the crate level:


Compiles the SNTP protocol and client implementation. It has a dependency on socket-udp. Enabled by default.


Compiles the TFTP protocol and server implementation. It has a dependency on socket-udp. Enabled by default.


pub use smoltcp as net;



Simple Network Time Protocol client implementation.


Trivial File Transfer Protocol server implementation.