SKBPRIO(8)
๐ NAME ๐
okay bestie, meet skbprio, the SKB Priority Queue! It's a manual page from the Linux docs (SKBPRIO(8)) and it is lowkey iconic โจ
๐ง SYNOPSIS ๐ง
tc qdisc ... add skbprio [ limit packets ]
๐ธ DESCRIPTION ๐ธ
okay so SKB Priority Queue is a queueing discipline built to protect the most important packets during a denial-of-service (DoS) attack ๐ก๏ธ๐ฅ. Every packet has a priority stored in skb->priority, and a higher value puts the packet closer to the exit of the queue ๐ฆ. When the queue is full, the lowest priority packet in the queue gets dropped to make room, but only if the incoming packet has higher priority. If the incoming packet is lower than everything already waiting, it gets dropped instead ๐.
Without SKB priority queue, you have to slap length limits on each individual sub-queue, and there's no easy way to set one global limit across all priorities. SKBprio is the main character here: it enforces a global queue length limit and doesn't restrict the length of individual sub-queues ๐ .
SKB Priority Queue doesn't care how skb->priority gets assigned ๐คทโโ๏ธ. A super common move is to copy the 6-bit DS field of IPv4 and IPv6 packets using tc-skbedit(8). Quick note: if skb->priority is greater than or equal to 64, it's treated as 63. Anything less than 64 is taken at face value ๐.
This is how routers can locally decide which packets to drop under a DoS attack ๐ซถ. The idea is that priorities get assigned so the higher the priority, the more expected behavior a source shows. That gives sources a reason to play by the rules, periodt โจ.
๐ ALGORITHM ๐
Skbprio keeps 64 lists, one for each priority from 0 to 63 ๐. When a packet gets enqueued, it goes at the tail of its priority list. When a packet is ready to head out to the network, it's pulled from the head of the highest priority list ๐.
When the queue is full, the packet at the tail of the lowest priority list gets dropped to make room for the ingress packet, if the ingress packet is higher priority. Otherwise, the ingress packet is the one that gets dropped ๐ญ.
The vibe is that high priority packets get as much bandwidth as possible, and low priority packets only get serviced when there's enough bandwidth left over ๐.
๐ PARAMETERS ๐
limitโ the maximum queue size, measured in packets. It defaults to64. The valid range is[0, UINT32_MAX]๐.
๐ฆ SEE ALSO ๐ฆ
tc-prio(8), tc-skbedit(8) โจ
๐ฉโ๐ป AUTHORS ๐ฉโ๐ป
Nishanth Devarajan <devarajn@uci.edu>, Michel Machado <michel@digirati.com.br> ๐ซถ
This manpage is maintained by Bert Hubert <ahu@ds9a.nl> ๐
Okay that's the whole tea, bestie ๐ต๐ this was an iproute2 page, last updated 13 August 2018. Stay iconic, stay Linux-literate ๐ธ๐
๐ฆ 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