UDE

udetftpd
Login

udetftpd

Purpose: serving boot files to the machines on a switch.

udetftpd is a read-only TFTP server that joins a switch as an IPv4 host, like udedhcpd. Every option is in udetftpd(8); the full example is Network booting.

A first server

udeswitch -T 0 &
udedhcpd -a 10.0.0.1/24 -B 10.0.0.2 -b pxelinux.0 &
udetftpd -a 10.0.0.2/24 -r /srv/tftp &

-a is the server's own address and -r the directory it serves; both are required. udedhcpd -B points clients at it and -b names the file to load. Each request and each finished transfer is logged (-q turns that off), and the counters are printed on exit.

A configuration file

-C / --configuration FILE, or UDE_CONFIG, reads the [udetftpd] table of a TOML file; the command line overrides it, and --check-config reports unknown keys. The keys are the long options with _ for -: connection (--switch, which [global] connection also sets), address, root (relative to the file's directory), max_blksize, max_window, timeout, retries, max_transfers and quiet. The same file can configure udedhcpd with next_server and boot_file:

[global]
connection = "udp://127.0.0.1:7500"

[udedhcpd]
subnet = "10.0.0.1/24"
next_server = "10.0.0.2"
boot_file = ["ipxe=boot.ipxe", "pxelinux.0"]

[udetftpd]
address = "10.0.0.2/24"
root = "/srv/tftp"
udedhcpd -C lab.toml &
udetftpd -C lab.toml &

What clients can ask for

Files of any length up to 2 GiB work: the block number wraps from 65535 to 0. Up to -c transfers (64) run at once, each on its own port.

What it refuses

TFTP has no passwords: every host on the switch can read every file in the root, so serve a directory of boot files, not a home directory.

client 10.0.0.100 udetftpd 10.0.0.2:69 RRQ pxelinux.0, blksize 1432 OACK, from a new port ACK 0 DATA 1, 2, ... (a window)
C: box "client" "10.0.0.100" fit
T: box "udetftpd" "10.0.0.2:69" fit at C + (3.2, 0)
arrow from C.e + (0, 0.3) to T.w + (0, 0.3) "RRQ pxelinux.0, blksize 1432" above
arrow from T.w + (0, 0.05) to C.e + (0, 0.05) "OACK, from a new port" above
arrow from C.e + (0, -0.2) to T.w + (0, -0.2) "ACK 0" above
arrow from T.w + (0, -0.45) to C.e + (0, -0.45) "DATA 1, 2, ... (a window)" below