Community discussions

MikroTik App
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

bandwitdh limit not working correctly

Thu Nov 22, 2007 2:34 pm

Hi, here is my problem I have a nat connection and im testing mikrotik to manage my hole network, first im tryin with my notebook, the MT server has 1 public ip and NAT to the rest. I copy the wiki examples from traffic shaper and the limit to my notebook seems to work fine, it was limit to 110k up 220k dw so the real transfer its around 26k for download.
the issue comes here, Im downloading at 26k at Ares and then I open a direct download like a nzone.com game and start downloading with getright and work at 15k download, making my main download speed at 40k and is set at 25k! I let you with all my mt config, hope anyone can help me or tell me what am I doing wrong.

SIMPLE QUEUE

Flags: X - disabled, I - invalid, D - dynamic
0 name="main" target-addresses=192.168.0.100/32 dst-address=0.0.0.0/0 interface=all parent=none direction=both

priority=8 queue=default-small/default-small
limit-at=0/0 max-limit=110000/220000 total-queue=default-small

1 name="http" dst-address=0.0.0.0/0 interface=all parent=main packet-marks=http direction=both priority=8

queue=default-small/default-small limit-at=0/0
max-limit=100000/200000 total-queue=default-small

2 name="p2p" dst-address=0.0.0.0/0 interface=all parent=main packet-marks=p2p direction=both priority=8

queue=default-small/default-small limit-at=0/0
max-limit=64000/64000 total-queue=default-small

3 name="other" dst-address=0.0.0.0/0 interface=all parent=main packet-marks=other direction=both priority=8

queue=default-small/default-small limit-at=0/0
max-limit=50000/100000 total-queue=default-small

4 name="queue39" target-addresses=192.168.1.0/24 dst-address=0.0.0.0/0 interface=all parent=none direction=both

priority=8
queue=default-small/default-small limit-at=0/0 max-limit=1000/1000 total-queue=default-small

5 name="queue38" target-addresses=192.168.0.0/24 dst-address=0.0.0.0/0 interface=all parent=none direction=both

priority=8
queue=default-small/default-small limit-at=0/0 max-limit=1000/1000 total-queue=default-small

MANGLE

Flags: X - disabled, I - invalid, D - dynamic
0 ;;; http
chain=prerouting action=mark-connection new-connection-mark=http_conn passthrough=yes dst-port=80 protocol=tcp

1 chain=prerouting action=mark-packet new-packet-mark=http passthrough=no connection-mark=http_conn

2 ;;; p2p
chain=prerouting action=mark-connection new-connection-mark=p2p_conn passthrough=yes p2p=all-p2p

3 chain=prerouting action=mark-packet new-packet-mark=p2p passthrough=no connection-mark=p2p_conn

4 ;;; other
chain=prerouting action=mark-connection new-connection-mark=other_conn passthrough=yes

5 chain=prerouting action=mark-packet new-packet-mark=other passthrough=no connection-mark=other_conn



NAT

0 chain=srcnat action=masquerade out-interface=wan


another issue I just discover, the "sub-queue" doesnt respect the main queue limit, as I said my main limit is 220k for download, if I set the "other_conn" limit to 1mb, the download get limited from the main queue at 512k aprox but then keep climbing now it 700k.
Even the Target Download screen in the mikrotik reports 672k of download and should limit to 220k and Ares is downloading at 83k real.

thank you.
 
galaxynet
Long time Member
Long time Member
Posts: 646
Joined: Fri Dec 17, 2004 2:52 pm
Contact:

Re: bandwitdh limit not working correctly

Sat Nov 24, 2007 6:08 pm

tamahome -

Well you almost have it but not quite.

Try this in mangle:
add chain=prerouting src-address=192.168.0.100/32 connection-state=new \
action=mark-connection new-connection-mark=http_conn passthrough=yes

add chain=prerouting src-address=192.168.0.100/32 action=mark-connection \
new-connection-mark=http_conn passthrough=yes

add chain=prerouting src-address=192.168.0.100/32 connection-state=related \
action=mark-connection new-connection-mark=http_conn passthrough=yes

add chain=prerouting connection-mark=http_conn action=mark-packet \
new-packet-mark=http_conn_packet passthrough=no


1) Mark new connections if any
2) Mark exisiting connections (once a connection is marked by 'new-connection' the subsequent data packets will not be marked unless we use this rule to mark them - why - because they are not 'new' anymore....)
3) Mark related connections - especially helpful in catching all p2p stuff....
3) Using the connection mark, mark ALL packets with connection mark = http_conn

Now you can use the queues to control up/down traffic based on the packet mark. This should control both data to and from your laptop.

You may need to adjust the depth of the queues to handle bursts of data - you cannot control how fast the data is sent to the MT, you certainly would like to avoid re-transmissions of the data so watch your queue depth, 10 packets, 50 packets, maybe even 500 packets deep.

Here how to use the queue based on your example above.

0 name="main" dst-address=0.0.0.0/0 interface=all parent=none direction=both
priority=8 queue=default-small/default-small limit-at=Set Limit Here
max-limit=Set MAX Limit Here total-queue=default-small

1 name="http" dst-address=0.0.0.0/0 interface=all parent=main packet-marks=http_conn
direction=both priority=8 queue=default-small/default-small
limit-at=100000/200000 max-limit=100000/200000 total-queue=default-small

Queue 0 ) Simply sets up you 'main' queue entry in Simple Queues

Queue 1 ) Limits bandwidth based on packet marks - this should catch ingress/egress of all packets either HTTP or related to an HTTP connection.


Thom

Who is online

Users browsing this forum: bonamin, TomSvitana and 68 guests