ETF(8)
๐ ETF(8) ๐
Linux ๐
โจ NAME โจ
okay so ETF stands for Earliest TxTime First (ETF) Qdisc ๐ it's a queueing discipline that's literally all about timing your packets perfectly ๐ฆ
๐ซ SYNOPSIS ๐ซ
tc qdisc ... dev dev parent classid [ handle major: ] etf clockid
clockid [ delta delta_nsecs ] [ deadline_mode ] [ offload ]
๐ธ DESCRIPTION ๐ธ
bestie, the ETF (Earliest TxTime First) qdisc lets apps decide the exact moment a packet gets dequeued from the traffic control layer and handed off to the netdevice ๐ญ if offload is configured and the network interface card supports it, it will also control when packets leave the network controller ๐ฅ
ETF does this by holding packets in a buffer until a set amount of time before their transmission time (aka the txtime, or deadline) โฐ you set that amount with the delta option ๐ซถ
the qdisc keeps an rb-tree internally, so packets are always kept in order by their txtime and get dequeued following the (next) earliest txtime first ๐ it's giving organized, no cap โจ
it relies on the SO_TXTIME socket option and the SCM_TXTIME CMSG in each packet field to set up how time-dependent sockets behave: which clockid is the reference, whether the txtime for that socket is in deadline or strict mode, and whether packet drops should get reported on the socket's error queue ๐ง see socket(7) for more info!!
the etf qdisc will drop any packet with a txtime in the past, or any packet that expires while it's waiting to be dequeued ๐ rip to those
this queueing discipline is meant for TSN (Time Sensitive Networking) apps, and it gives you traffic shaping that vendors and NIC documentation usually call "Launch Time" or "Time-Based Scheduling" ๐ main character energy for sure
ETF is supposed to sit under another qdisc that sorts packet flows into traffic classes, like mqprio(8) ๐
๐ PARAMETERS ๐
clockid- this is the clock the qdisc's internal timer uses to measure time and schedule events โฑ๏ธ the qdisc expects packets going through it to use this same clockid as the reference for their txtime timestamps, and it will drop packets from sockets that don't follow that ๐
- for more on time and clocks on Linux, check out time(7) and clock_gettime(3) ๐
delta- after enqueueing or dequeueing a packet, the qdisc schedules its next wake-up for the next txtime minus this delta value โจ so delta works like a fudge factor for your system's scheduler latency ๐ซถ
- this value has to be in nanoseconds, and the default is
0nanoseconds
deadline_mode- when deadline_mode is set, the qdisc treats txtime differently: instead of a 'strict' transmission time, it becomes a deadline ๐ฅ in practice, during the dequeue flow etf(8) sets the txtime of the packet being dequeued to 'now' ๐
- it's disabled by default
offload- when offload is set, etf(8) tries to configure the network interface so time-based transmission arbitration is enabled in the controller ๐ NICs docs usually call this "Launch Time" or "Time-Based Scheduling" too
- it's disabled by default
skip_sock_check- okay so etf(8) currently drops any packet that doesn't have a socket attached, or whose socket doesn't have the
SO_TXTIMEsocket option set ๐ญ but that breaks if the launchtime is set by another entity inside the kernel (like some other Qdisc) ๐ - setting
skip_sock_checkskips the check for a socket attached to the packet โจ
- okay so etf(8) currently drops any packet that doesn't have a socket attached, or whose socket doesn't have the
๐ EXAMPLES ๐
ETF is used to enforce Quality of Service ๐ it controls when each packet should be dequeued and transmitted, and it can limit the data rate of a traffic class ๐ธ to split packets into traffic classes, you can use mqprio(8), and configure it like this:
# tc qdisc add dev eth0 handle 100: parent root mqprio num_tc 3 \
map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 \
queues 1@0 1@1 2@2 \
hw 0
to replace the current queueing discipline with ETF in traffic class number 0, issue:
# tc qdisc replace dev eth0 parent 100:1 etf \
clockid CLOCK_TAI delta 300000 offload
with the options above, etf is set to use CLOCK_TAI as its clockid_t, schedules packets 300 us before their txtime, and enables the functionality on the network interface card ๐ฆ deadline mode isn't configured for this one, so no deadline vibes here ๐
๐ AUTHORS ๐
- Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com> ๐ซถ
- Vinicius Costa Gomes <vinicius.gomes@intel.com> ๐ซถ
that's a wrap, bestie!! ๐ iproute2 ยท 05 Jul 2018 โจ stay timed, stay iconic ๐ ๐
๐ฆ where this page comes from
- alpine 3.22: iproute2-doc 6.15.0-r0 ยท GPL-2.0-or-later
- alpine 3.23: iproute2-doc 6.17.0-r0 ยท GPL-2.0-or-later
- alpine 3.24: iproute2-doc 7.0.0-r0 ยท GPL-2.0-or-later
- arch rolling: iproute2 7.2.0-1
- arch rolling: iproute2 7.3.0-1 ยท GPL-2.0-or-later
- centos-stream 10: iproute-tc 7.0.0-2.el10 ยท GPL-2.0-or-later
- centos-stream 9: iproute-tc 6.17.0-3.el9 ยท GPL-2.0-or-later
- debian bookworm: iproute2 6.1.0-3 ยท GPL-2.0-only
- debian trixie: iproute2 6.15.0-1 ยท GPL-2.0-only
- fedora 43: iproute-tc 6.14.0-2.fc43 ยท GPL-2.0-or-later
- fedora 44: iproute-tc 6.17.0-2.fc44 ยท GPL-2.0-or-later
- nixos 26.05: iproute2 7.0.0
- nixpkgs unstable: iproute2 7.2.0
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- ubuntu jammy: iproute2 5.15.0-1ubuntu2 ยท GPL-2.0-only
- ubuntu jammy: iproute2 5.15.0-1ubuntu2.2 ยท GPL-2.0-only
- ubuntu noble: iproute2 6.1.0-1ubuntu6 ยท GPL-2.0-only
- ubuntu noble: iproute2 6.1.0-1ubuntu6.4 ยท GPL-2.0-only
- ubuntu questing: iproute2 6.16.0-1ubuntu2
- ubuntu questing: iproute2 6.16.0-1ubuntu2.1 ยท GPL-2.0-only
- ubuntu questing: iproute2 6.16.0-1ubuntu2.2
- ubuntu resolute: iproute2 6.19.0-1ubuntu1 ยท GPL-2.0-only
- ubuntu resolute: iproute2 6.19.0-1ubuntu1.1 ยท GPL-2.0-only
- ubuntu stonking: iproute2 7.2.0-1ubuntu1 ยท GPL-2.0-only
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms