Bandwidth management and queues

Hello!

I’m trying to achieve something but I’m kiddna stucked:)

Here is what I want to achieve:

  • max speed for wlan is 40MBits
  • I won’t wont to limit users
  • I would limit HTTP connections after downloading more then XX MB
  • I would limit SMTP and IMAP connections after downloading more that XX MB
  • I would limit everything else after total download is more then XX MB

An example:

  • everyone can download from http with full speed until download doesnt reach XX MB. After downloading XX MB, download speed is capped. If he starts another download in the mean time, the new download starts with full speed. That way you can download programs, updates,… and is not limited with burst time…
  • same goes for IMAP, SMTP
  • everything else also starts full speed, but when the sum download of everything else reaches XX MB, it gets capped, but the above protocols still get full speed.

So far I have http and mail solved. I mark packages based on connection bytes and put them in multiple pcq queue, where I limit them. I have troubles with the last rule. I can’t use the same queue, since it works ‘per connection’. How to solve that? One example is limiting torrent speed, where the upper solution only limits every client from whom I’m downloding, but with 30 clients, I can still achieve max wlan speed…

Matej

Just to bump this a little…

So, what I want to achieve, is to group and mark all unmarked traffic by user and send it to a certain queue, which will then limit the speed according to max-limit.

Currently I’m marking it like that:

Marking connections:

 chain=forward action=mark-connection new-connection-mark=wifi-connection passthrough=yes src-address=10.10.10.0/24

Marking packages:

chain=forward action=mark-packet passthrough=yes protocol=udp connection-mark=wifi-connection  new-packet-mark=wifi-no-mark  connection-bytes=0-5000000 
chain=forward action=mark-packet passthrough=yes protocol=udp connection-mark=wifi-connection  new-packet-mark=wifi-low-no-mark  connection-bytes=5000001-0

Queues:

/queue tree add name="Other-HIGH" parent=Download packet-mark=wifi-no-mark limit-at=0 queue=pcq-download priority=4 max-limit=3M burst-limit=0 burst-threshold=0 burst-time=0s 
/queue tree add name="Other-LOW" parent=Download packet-mark=wifi-low-no-mark limit-at=0 queue=pcq-download priority=5 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s

Problem still persist. If client is downloading torrents, it downloads from multiple users/sources and the upper solution doesnt seem to work. Total speed gets limited to 3M, so that works. The problem is, that when client downloads more then 5MB, it is not moved to 2nd queue, since he’s downloading from multiple queue and mantle doesnt change mark when TOTAL download is more than 5MB. How to achieve that?

Matej