Community discussions

MikroTik App
 
anton78bon
just joined
Topic Author
Posts: 20
Joined: Tue Feb 13, 2007 7:00 am

[ASK] Downstream Bandwidth Management

Tue Apr 17, 2007 10:32 am

After I readed http://www.mikrotik.com/testdocs/ros/2.9/root/queue.php There are something I still dont understand.

Assume I have small Internet Connection ( 256 Kbps ), I use it sharing for my webserver and some of Http Clients ( Browser ) on my 100Mbps LAN.

I want to prioritize Incoming SMTP ( Receiving Email ) upon Receiving HTTP packets.

Is this posible????

I mean I can really priotitize SMTP downstream or I just prioritizing Packets from router to my LAN that fully has already received by router???
 
cmit
Forum Guru
Forum Guru
Posts: 1552
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Tue Apr 17, 2007 11:41 am

You can always only prioritize OUTGOING traffic, i.e. traffic leaving your router.
Explanation is simple: At the moment traffic is reaching your router over your internet connection it's too late to shape it, as it has already been sent over your internet connection. You can only shape traffic your router is sending to someone else (i.e. out to the LAN or out your internet connection).

Best regards,
Christian Meis
Best regards,
Christian Meis
 
User avatar
samsoft08
Long time Member
Long time Member
Posts: 617
Joined: Sat Nov 26, 2005 10:52 pm

Wed Apr 18, 2007 4:23 am

yes , thats waht i want to be confirmed dear Christian .. for a long time i was wondering what is the benifit of shaping the trafick that coming from my ISP through sat modem ..thats mean whatever i do with my MT , the full controll is belong to my ISP .. right ?? i'm talking about download .. so , even if i'm using PCQ i cant really controll the down trafick coming from sat modem , only i can shape it when it leave the MT going to clients , which is not a big deal for me , let them take what they can take from MT , my real problem is my sat modem and the band i have ( sat band ) theat band which is limited to a specific amount of data rate ... and thats mean if a client is downloading a big file and the packets come from my sat ISP , and the file is a large one , it may fill the band and other clients must wait untill his download finish , right ??
as a conclusion , its a waste of time making rules for priority and shaping the download packets if we cant really control the source , which is in my case the sat ISP who is in another country ..
 
cmit
Forum Guru
Forum Guru
Posts: 1552
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Wed Apr 18, 2007 8:49 am

Well, TCP provides for SOME mechanisms to slow down the sending of data when the sender detects that it cannot get the data through at that rate.

But in essence: Yes, you cannot do much regarding traffic shaping on the incoming (receiving) side. This part would have to be done on the senders' side (i.e. your ISP).
If you have the option to terminate your uplink with own hardware on "the other end" you could provide for this, but this is quite rare.

Usually you will have to live with the fact that you can really only control outgoing traffic completely.

Best regards,
Christian Meis
 
anton78bon
just joined
Topic Author
Posts: 20
Joined: Tue Feb 13, 2007 7:00 am

Wed Apr 18, 2007 10:11 am

Thanks a lot Christian for the confirmation, at least now I can try figure out something else...once again..thanks a lot...
 
User avatar
chvdr
Member
Member
Posts: 403
Joined: Thu Sep 22, 2005 8:53 pm

Wed Apr 18, 2007 10:25 am

Thanks a lot Christian for the confirmation, at least now I can try figure out something else...once again..thanks a lot...
there is no any mistakes... you can do any limit you want, just use right interface and right rule to limit with queues. believe me, everything works fine.

regards,
C. G.
 
anton78bon
just joined
Topic Author
Posts: 20
Joined: Tue Feb 13, 2007 7:00 am

Wed Apr 18, 2007 10:25 am

Wait a minute.....but this is not make sense......, i mean....if I can't shape my downstream bandwith then how the ISPs done it????
 
cmit
Forum Guru
Forum Guru
Posts: 1552
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Wed Apr 18, 2007 10:35 am

You mean how an ISP is limiting the bandwidth you are sending them (so they are receiving it?).

Beware: There's a difference between just limiting the (overall) bandwidth (this can be done more or less efficient and exact by just dropping "excess" incoming packets - the sender will start sending slower).
But you cannot shape incoming traffic, in the sense of setting priorities, limiting the bandwidth certain services can use etc.

Best regards,
Christian Meis
 
User avatar
chvdr
Member
Member
Posts: 403
Joined: Thu Sep 22, 2005 8:53 pm

Wed Apr 18, 2007 10:36 am

Wait a minute.....but this is not make sense......, i mean....if I can't shape my downstream bandwith then how the ISPs done it????
it makes sense when you limit your user's download (your router's upload to every single user). On your router's Local iface.

regards,
C. G.
 
anton78bon
just joined
Topic Author
Posts: 20
Joined: Tue Feb 13, 2007 7:00 am

Sat Apr 21, 2007 3:56 am

Wait a minute.....but this is not make sense......, i mean....if I can't shape my downstream bandwith then how the ISPs done it????
it makes sense when you limit your user's download (your router's upload to every single user). On your router's Local iface.

regards,
C. G.
You mean how an ISP is limiting the bandwidth you are sending them (so they are receiving it?).

Beware: There's a difference between just limiting the (overall) bandwidth (this can be done more or less efficient and exact by just dropping "excess" incoming packets - the sender will start sending slower).
But you cannot shape incoming traffic, in the sense of setting priorities, limiting the bandwidth certain services can use etc.

Best regards,
Christian Meis
Sorry guys for very late reply..got some problems here...
Here i give an example :

Let say there are 1 small ISP with 1 Mbps downstream bandwith, and share it with 4 dedicate 256 kbps each clients.
- Client A
- Client B
- Client C
- Client D

Client A is downloading from ..uhhmm..let say hxxp://ourdownload.com

how to limit download rate from hxxp://ourdownload.com to ISP, before ISP forward it to Client A.

I mean..if the router in ISP actually limiting sending Bandwith from ISP to Client A, then if Client B,C,D has no activity then download rate from hxxp://ourdownload.com to ISP can be more then 256 kbps but only 256 kbps send from ISP to Client A.

Is this how an ISP do it??? I think somehow there are other way(s)..
 
User avatar
chvdr
Member
Member
Posts: 403
Joined: Thu Sep 22, 2005 8:53 pm

Sat Apr 21, 2007 4:47 pm

use this sampleif you want to equally share your 1Mbps and "dynamically equalize or shape traffic for multiple users". but if you want to shape absolutely your lan hosts, try to use examples in manual, e.g. this sample.

kind regards,
C. G.
 
User avatar
samsoft08
Long time Member
Long time Member
Posts: 617
Joined: Sat Nov 26, 2005 10:52 pm

Sun Apr 22, 2007 2:51 am

first : I didnt find PCQ is perfect , always we can see some users got higher bandwidth than the other .
second : let's go back to Christian reply when he said : Well, TCP provides for SOME mechanisms to slow down the sending of data when the sender detects that it cannot get the data through at that rate.
this is perfictly true , and it means we can actually limit the user download
rate , and the user trafick which is coming from the ISP ..
i tested it , its true ..
but doesnt this effects the prioritizing also ? if we can control the users requests with priority ?
 
karyal
Member Candidate
Member Candidate
Posts: 168
Joined: Sat Nov 12, 2005 12:09 pm

Sun Apr 22, 2007 3:13 pm

You mean how an ISP is limiting the bandwidth you are sending them (so they are receiving it?).

Beware: There's a difference between just limiting the (overall) bandwidth (this can be done more or less efficient and exact by just dropping "excess" incoming packets - the sender will start sending slower).
But you cannot shape incoming traffic, in the sense of setting priorities, limiting the bandwidth certain services can use etc.

Best regards,
Christian Meis
This is not completely true/correct IMHO (please note i do not use MT shaping, i use TC with HTB, but as i understand MT traffic shaper is in fact base on TC and its queueing disciplines)..
It is true that you cannot shape incoming traffic, but you can transform your incoming traffic to outgoing traffic shaping on the right interface...
It is true that you can successfuly shape with a very good precision some kind of traffic (i.e. tcp), and it's a little less precise, up to a complete desperation in case of a DOS, to shape UDP.
Actually we're successfully shaping around 2000 customers, using around 6000 rules on the border (and yes, it does take cpu power, we just had to switch to a dual core just for that, and it's still loaded at around 60%).
You have to keep in mind anyway that while outgoing traffic play nicely, incoming does not, and it is shaped AFTER it reaches you box, which acts like some kind of "buffer". This means that if you're shaping 10Mbits outgoing to your network (which is your users download) you can reach 12 or even 14 mbit/ on the "incoming" interface of your shaper box, which can lead to saturation on your link anyway, messing all the things up.
You have to pay the price of reducing your bandwith of at least a 10%, up to 30% (anyway usually 15/20% is a quite a realistic amount).
There is no easy way to see what's the exact value, you have to try and see how far you can push your link, as even the connection you use (wheter introduces overhead by using ATM like on DSL, or does not, like fiber) affects the results.
I would suggest you to take a look at LARTC.ORG
It's very TC related but have some very useful explanation on the general concepts of shaping and how it work.
Bye,
Ricky
 
User avatar
samsoft08
Long time Member
Long time Member
Posts: 617
Joined: Sat Nov 26, 2005 10:52 pm

Sun Apr 22, 2007 6:01 pm

you mean its worthless to limit a user to as an example 128K ,while the link between my modem and the ISP is saturated with let's say 500K of the user download ? may be its true ..
but the user download depends on his upload , so if I limited his upload I can as a result limit his download and the link will not be saturated ..

and if I give for example the HTTP in the upload traffic the highest priority doesnt this mean the HTTP will get the highest priority in the download traffic coming from the ISP ..??
 
karyal
Member Candidate
Member Candidate
Posts: 168
Joined: Sat Nov 12, 2005 12:09 pm

Sun Apr 22, 2007 6:22 pm

you mean its worthless to limit a user to as an example 128K ,while the link between my modem and the ISP is saturated with let's say 500K of the user download ? may be its true ..
No i'm not :D i'm just saying is that it's not that easy to limit the user...

If A is the ISP, RA is the router interface talking to your isp, RB is the router inteface talking to your network and B is the user in your network:

A ---- RA -- RB ---- B

To limit B to 128K you have to limit OUTGOING traffic from RB not traffic incoming to RA
Tipical HTB approach is:
First you create two pfifo root class to limit traffic outgoing from RA and RB to 400K
Create a an HTB class, attached to the RB root, limited at 128K
Mark traffic outgoing from RB with destination B
Create a an HTB class, attached to the RA root, limited at 128K
Mark traffic outgoing from RA with source B

this way you get B user to use no more than 128/128 on the link.
You can also work with rates so that you can give different PCR/MCR to each user
but the user download depends on his upload , so if I limited his upload I can as a result limit his download and the link will not be saturated ..
It depends on the protocol.. limiting his TCP upload will slow down TCP downloads, but limiting UDP upload will do nothing, as UDP does not expects a ny kind of feedback
and if I give for example the HTTP in the upload traffic the highest priority doesnt this mean the HTTP will get the highest priority in the download traffic coming from the ISP ..??
You cannot control the ISP queuing rules, you can control just yours.. this is why you have to limit the max rate to 400, so that the queue is happening on you box, not at the isp side..
 
User avatar
samsoft08
Long time Member
Long time Member
Posts: 617
Joined: Sat Nov 26, 2005 10:52 pm

Sun Apr 22, 2007 9:21 pm

in your example , the final result is limiting the user to 128k/128k , but cant we limit him with a simple Queue ? its easier and without any additional rules !!!!
my most important thing here is traffic going from A to AB , this link ( we are using SAT bandwidth ) is so expensive and very limited !!!! so this is what i want to avoid saturation ... i dont want a single user to take all that band ..
if I limit RB to B with 128K , does it limit A to RA for user B to 128K or it may reach more than 128k if the user is downloading a big file ?
 
karyal
Member Candidate
Member Candidate
Posts: 168
Joined: Sat Nov 12, 2005 12:09 pm

Sun Apr 22, 2007 9:39 pm

in your example , the final result is limiting the user to 128k/128k , but cant we limit him with a simple Queue ? its easier and without any additional rules !!!!
Yes, in my example you have just one rule, and simple queing fits.. but if you want to have http, pop3, and all the rest to both share the same pcr (128k), but assign 100K to http, 20k to pop3, 8K to all the rest, simple queing won't fit anymore..
my most important thing here is traffic going from A to AB , this link ( we are using SAT bandwidth ) is so expensive and very limited !!!! so this is what i want to avoid saturation ... i dont want a single user to take all that band ..
if I limit RB to B with 128K , does it limit A to RA for user B to 128K or it may reach more than 128k if the user is downloading a big file ?
In the end, it does limit to 128K (more or less). I would say it limits up to to 128K + 20% - just keep in mind you cannot have 100% accuracy (even if you can reach a very high level)..
 
anton78bon
just joined
Topic Author
Posts: 20
Joined: Tue Feb 13, 2007 7:00 am

Mon Apr 23, 2007 5:15 am

You mean how an ISP is limiting the bandwidth you are sending them (so they are receiving it?).

Beware: There's a difference between just limiting the (overall) bandwidth (this can be done more or less efficient and exact by just dropping "excess" incoming packets - the sender will start sending slower).
But you cannot shape incoming traffic, in the sense of setting priorities, limiting the bandwidth certain services can use etc.

Best regards,
Christian Meis
This is not completely true/correct IMHO (please note i do not use MT shaping, i use TC with HTB, but as i understand MT traffic shaper is in fact base on TC and its queueing disciplines)..
It is true that you cannot shape incoming traffic, but you can transform your incoming traffic to outgoing traffic shaping on the right interface...
It is true that you can successfuly shape with a very good precision some kind of traffic (i.e. tcp), and it's a little less precise, up to a complete desperation in case of a DOS, to shape UDP.
Actually we're successfully shaping around 2000 customers, using around 6000 rules on the border (and yes, it does take cpu power, we just had to switch to a dual core just for that, and it's still loaded at around 60%).
You have to keep in mind anyway that while outgoing traffic play nicely, incoming does not, and it is shaped AFTER it reaches you box, which acts like some kind of "buffer". This means that if you're shaping 10Mbits outgoing to your network (which is your users download) you can reach 12 or even 14 mbit/ on the "incoming" interface of your shaper box, which can lead to saturation on your link anyway, messing all the things up.
You have to pay the price of reducing your bandwith of at least a 10%, up to 30% (anyway usually 15/20% is a quite a realistic amount).
There is no easy way to see what's the exact value, you have to try and see how far you can push your link, as even the connection you use (wheter introduces overhead by using ATM like on DSL, or does not, like fiber) affects the results.
I would suggest you to take a look at LARTC.ORG
It's very TC related but have some very useful explanation on the general concepts of shaping and how it work.
Bye,
Ricky
\\


i just starting for digging here http://lartc.org well..they confirmed what christian said "But you cannot shape incoming traffic". And true shaping down-traffic (A ---- RA) indirectly can be done by shaping up-traffic.. its still need a lot of reading on how i guess, but if someone can give some instants examples...pleasee...
 
anton78bon
just joined
Topic Author
Posts: 20
Joined: Tue Feb 13, 2007 7:00 am

Wed Apr 25, 2007 4:16 am

Guyss....still dont have any luck on this with http://lartc.org/howto...anybody can help please..... :(
 
dot-bot
Member Candidate
Member Candidate
Posts: 164
Joined: Tue Oct 11, 2005 7:05 pm

Mon May 21, 2007 9:00 pm

I thought the packet-drop technique works just fine ? And when you limit RB-B the TCP WINDOW adjusts accordingly ? :shock:

Also why limit to 400K? (karyal's post) It should work just as fine when limited to the max of the link - 500K.

Who is online

Users browsing this forum: dave864, Google [Bot], Google Feedfetcher, keithy, sindy, xvo and 64 guests