this post was submitted on 13 Jun 2026
-68 points (24.6% liked)
Technology
85645 readers
3512 users here now
This is a most excellent place for technology news and articles.
Our Rules
- Follow the lemmy.world rules.
- Only tech related news or articles.
- Be excellent to each other!
- Mod approved content bots can post up to 10 articles per day.
- Threads asking for personal tech support may be deleted.
- Politics threads may be removed.
- No memes allowed as posts, OK to post as comments.
- Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
- Check for duplicates before posting, duplicates may be removed
- Accounts 7 days and younger will have their posts automatically removed.
Approved Bots
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The algorithm is super easy:
A stream is defined as something that shares the same Source IP, Target IP, Source port, Target port and protocol, so e.g. "TCP 192.168.0.2:45231 -> 80.0.0.1:443". This 5-tuple is guaranteed to be unique at a certain time.
The router counts how many packets each stream had in the last second.
If the bandwith is at its limit and two streams want to send a packet, prioritize the one that had fewer packets in the last second.
This covers all of your bases:
The cool thing is, this algorithm needs extremely little space in RAM and is extremely easy on the CPU too. To store a stream's data you need 13 bytes for the metadata plus 3 bytes for the package counter, netting 16 bytes per stream. That's 64 concurrent streams per Kilobyte of used RAM. A megabyte fits 64k streams. You can implement that algorithm on an original Gameboy and it wouldn't sweat.
Also, remember that this algorithm only looks at the last second or so of data, so it can drop all idle sessions within just one second. 64k concurrent streams within one second is enough for professional-grade office routers.
Source: I actually spent the first 7 years of my carreer at a company that makes routers and switches and developed the software for them. 128MB RAM was what our mid-range models had, and every single model we had had traffic priorisation.
In fact, our network-provider-grade routers and switches had dedicated network metadata RAM, and they were usually limited to 4-16MB.
The only reason your router even has 128MB RAM or more is so that it can display a fancy configuration web page with images.
ok, I was probably biased by all the slow routers I had, but to my defense even the openwrt wiki mentions that SQM might not be useful with routers that have a slow CPU:
https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm
I don't know what were your companies consumer base, but where I live basically everyone has the cheapest old consumer routers that are on the very limits of the openwrt hardware requirements.
The openwrt docs reference this post: forum.openwrt.org/t/so-you-have-500mbps-1gbps-fiber-and-need-a-router-read-this-first/90305
They talk about a router from 2009 not being able to handle CPU-only SQM on a gigabit internet connection.
If you have a gigabit internet connection you don't need SQM.