QOS learning pains..

So im going to have a few networks
Production - 10.130.0.0/22
Vendors - 10.150.0.0/22
Guest - 10.68.0.0/22
Streaming - 10.70.0.0/24
Now my entire internet connection will be 2Gig down and 300 UP.
What my goal is, is that I want all of these networks to at any given time to have access to all this bandwidth.
But what I also want is that if needed..
I need production to be able to have
500 down GUARANTEED and 50 UP Guaranteed
Vendors to have GUARANTEED 500 Down and 50UP GUARANTEED
And for streaming I need them to have 500 Down GUARANTEED and 200 UP guaranteed..

So if all networks are pretty much hitting those maxes that is where I need the bandwidth to be prioritized

Ive tried to lab this out and its been pretty hard for me to know if im doing any of this right as im one person and its pretty hard to stress out all these networks and watch the behavior.. so I went to the forbidden road of asking CHATGPT and it gave me these results.. I was wondering if there was any real substance to this approach.. I must admit.. a decent amount of my learning has been sort of reverse engineering finished products and learning them on the way back to the solution.. so like a solution.. ok what is in place on this config for it to all work… remove it all.. and add it all back to see where and how each change adds to make everything work.. well anyways.. here are the commands..

really appreciate any comments that could help me trust or distrust this..

/ip firewall mangle
add chain=forward src-address=10.130.0.0/22 action=mark-connection new-connection-mark=production_conn passthrough=yes
add chain=forward src-address=10.150.0.0/22 action=mark-connection new-connection-mark=vendors_conn passthrough=yes
add chain=forward src-address=10.70.0.0/24 action=mark-connection new-connection-mark=streaming_conn passthrough=yes


add chain=forward connection-mark=production_conn action=mark-packet new-packet-mark=production_packet passthrough=no
add chain=forward connection-mark=vendors_conn action=mark-packet new-packet-mark=vendors_packet passthrough=no
add chain=forward connection-mark=streaming_conn action=mark-packet new-packet-mark=streaming_packet passthrough=no


/queue tree
add name="Production_Down" parent=global down max-limit=500M queue=default packet-mark=production_packet
add name="Production_Up" parent=global up max-limit=50M queue=default packet-mark=production_packet

add name="Vendors_Down" parent=global down max-limit=500M queue=default packet-mark=vendors_packet
add name="Vendors_Up" parent=global up max-limit=50M queue=default packet-mark=vendors_packet

add name="Streaming_Down" parent=global down max-limit=500M queue=default packet-mark=streaming_packet
add name="Streaming_Up" parent=global up max-limit=200M queue=default packet-mark=streaming_packet

/queue tree
set [find name="Production_Down"] priority=1
set [find name="Production_Up"] priority=1

set [find name="Vendors_Down"] priority=2
set [find name="Vendors_Up"] priority=2

set [find name="Streaming_Down"] priority=3
set [find name="Streaming_Up"] priority=3

add name="Guest_Down" parent=global down max-limit=2G queue=default packet-mark=guest_packet
add name="Guest_Up" parent=global up max-limit=300M queue=default packet-mark=guest_packet

These ChatGPT generated commands are all wrong.

Some points:

  • max-limit needs to be set to max available bandwith on all queues, 2G on download and 300M on upload queues so that can reach max bandwith when available


  • limit-at for non quest queues needs to be set to guaranteed bandwith


  • priority for non quest queues needs to be set to same priority (eg. priority=1)


  • priority for quest queues needs to be set to lower priority than non quest queues (eg. priority=8)


  • limit-at for quest download queue can be set to 450 (2000 - 500 * 3) - 50 to have some reserve, or less, depends how much you want to leave bandwith for guests on max load


  • limit-at for quest upload queue lacks bandwidth on max load: 300 - 50 * 2 - 200 = 0, I’m not sure how it behaves when set to 0, all queued packets can be dropped in this queue on max load


  • there is no global down or global up parent interface like is generated with ChatGPT for creating queue in tree, to separate upload and download queues, packets for upload and download needs to be marked separated by mangle rules (eg. production_packet_up and production_packet_down), depending on packet chain and interface or address

.

Yeah that is the issue with GPT.. it frequently doesn’t spit out what is best to do.. questions.. lol.. forgive my ignorance.. what do you mean by “quest” or “non-quest”

also I was able to get someone to some feed back on reddit and I appreciate that at least the priorities were set in a different order.

this makes more sense having the parent queues..

/queue type
add kind=fq-codel name=fq-codel-default
/queue simple
add max-limit=300M/2G name=total target=10.0.0.0/8
add limit-at=200M/500M max-limit=290M/1950M name=streaming parent=total queue=fq-codel-default/fq-codel-default priority=5/5 target=10.70.0.0/24
add limit-at=50M/500M max-limit=290M/1950M name=production parent=total queue=fq-codel-default/fq-codel-default priority=6/6 target=10.130.0.0/22
add limit-at=50M/500M max-limit=290M/1950M name=vendors parent=total queue=fq-codel-default/fq-codel-default priority=7/7 target=10.150.0.0/22
add max-limit=290M/1950M name=guest parent=total queue=pcq-upload-default/pcq-download-default priority=8/8 target=10.68.0.0/22

Typo error, wrong character q vs g :slight_smile: I meant quest as guest queues “Guest_*”, non guest - others.

If you want to go with simple queues, use same principles as I wrote above. Don’t have experience with simple queues but as I see queues which needs to guarantee bandwidth are in different priorities, which means one with higher prio. will tend to reach max rate while lower will be reduced to guaranteed limit, it will not be equally splitted above guarantee limit when available, if you are ok with that use it…

This is happening on a RB5009 – I know I have to have fasttrack disabled.. I hope this guy can handle that bandwidth and 1k to 2k clients on it NATTING and dhcp.

goes like this

Internet–2.5g–>RB5009—10Gb—>CRS310-------1Gig to all the edge switches..

I don’t do RouterOS scripting very often and as the syntax isn’t entirely natural, I’ve been using ChatGPT with great success today with even some of the basics. Quite scary really.