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 to 64. 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