10-27-2008 07:12 AM - edited 03-04-2019 12:05 AM
This is more of a "me bad at math" I'm sure.
Okay, I have a 871W router at the house. I enabled QoS and policing for bittorrent traffic. I started a download of a linux iso, and I got outrageous speed (almost 600kbps).
My config is like this:
class-map match-any BITTORRENT
match protocol bittorrent
policy-map OUTBOUND
class BITTORRENT
police 8000
exceed-action drop
violate-action drop
int fa4
service-policy output OUTBOUND
When I do a "show policy-map int fa4", I show tons of packets being dropped, so I "know" the config is working.
My question is more of a mathematical question:
The first option is in bps (8000 - some ungodly number)
The second and third options are BYTES per second. I'm having a hard time trying to figure these out. I "figured" that setting it at 8000 would mean 8k, but why would I get up to 600k in transfer rate?
I'm VERY new to QoS, but I'm really interested in getting it to work properly.
Thanks,
--John
10-27-2008 07:15 AM
The policy is applied OUT of the interface, not IN. You're downloading traffic which would be in bound on the interface. Sending traffic would be out bound on it.
Hope that helps.
10-27-2008 07:17 AM
So, my math was right, but the direction is wrong?
I should apply the same policy inbound, and then I would see a difference?
Thanks!!
John
10-27-2008 07:19 AM
Apply it in bound and let's see what happens.
11-03-2008 02:43 PM
Collin,
I was finally able to get around to try and apply this policy inbound, but it won't let me because it's CBWFQ. Any other suggestions? I've got the class map matching on the protocol type.
Thanks!
John
11-04-2008 06:49 AM
I just tested it on an 871 and it worked (applying it). What's the exact error? Please post your QoS config if it's different from your original post. Thanks.
10-27-2008 09:34 AM
As Collin notes, you want to apply the policer traffic such that it takes into account the traffic flow's direction. If the source is from the internet, you can apply the policy outbound on your LAN facing interface (if just one) or inbound on your WAN facing interface. Normally the latter to police the traffic ASAP. Note, since you're policing downsteam of your likely bottleneck (WAN link), it's possible for traffic to still flood that link, with bursts, before the policer rate limits it.
If I remember correctly, the latter parameters are not in bps or Bps, but is the byte size for, indirectly, the token buckets. These effectively determines how much actual traffic rates can vary from the average rate while still enforcing an average rate. The defaults are normally a good place to start.
11-04-2008 06:58 AM
Here's my actual config from the router (I was able to remote in to get it):
class-map match-all BITTORRENT
match protocol bittorrent
class-map match-any ROKU-OUTBOUND
match ip precedence 5
class-map match-all ROKU-INBOUND
match access-group name ROKU
!
policy-map ROKU
class ROKU-INBOUND
set ip precedence 5
policy-map OUTBOUND
class ROKU-OUTBOUND
priority percent 25
class BITTORRENT
police cir 8000
conform-action transmit
exceed-action drop
violate-action drop
class class-default
fair-queue 256
!
!
interface FastEthernet4
ip nat outside
ip virtual-reassembly
no cdp enable
service-policy output OUTBOUND
!
This is the error:
Nemesis(config-if)#service-policy input OUTBOUND
CBWFQ : Can be enabled as an output feature only
Nemesis(config-if)#
This is a "from scratch" setup, so it's probably not right. I'm still trying to learn QoS.
Thanks!
John
11-04-2008 09:31 AM
Nemesis(config-if)#service-policy input OUTBOUND
CBWFQ : Can be enabled as an output feature only
policy-map OUTBOUND
class ROKU-OUTBOUND
priority percent 25
class BITTORRENT
police cir 8000
conform-action transmit
exceed-action drop
violate-action drop
class class-default
fair-queue 256
For inbound usage, suspect LLQ class (bold above) is the issue. Try removing that class.
11-04-2008 09:55 AM
Joseph,
Thanks for the response. I removed it, but same issue.
policy-map OUTBOUND
class ROKU-OUTBOUND
priority percent 25
class BITTORRENT
police cir 8000
conform-action transmit
exceed-action drop
violate-action drop
class class-default
fair-queue 256
!
Nemesis(config-if)#policy-map OUTBOUND
Nemesis(config-pmap)#no class ROKU-OUTBOUND
Nemesis(config-pmap)#int fa4
Nemesis(config-if)#service-policy input OUTBOUND
CBWFQ : Can be enabled as an output feature only
Nemesis(config-if)#
Thanks,
John
11-04-2008 10:06 AM
Your post still shows:
policy-map OUTBOUND
class ROKU-OUTBOUND
priority percent 25
class BITTORRENT
police cir 8000
conform-action transmit
exceed-action drop
violate-action drop
class class-default
fair-queue 256
11-04-2008 10:09 AM
Oh sorry, read a little further down. I showed the steps that I removed it, then I went to the interface and tried to apply it again. I didn't show the policy map again.
Thanks,
John
11-04-2008 10:32 AM
Oh, so you did.
There one more you need to remove (which I missed):
class class-default
fair-queue 256
Removing FQ alone might do it, as should removing the class (where it will be implicit).
11-04-2008 10:43 AM
Okay, so removing class-default from the policy map did it. I went ahead and put the class-map ROKU back in, and that kept me from putting it as input again, so both statements "class ROKU-INBOUND" and class-default fair queue was keeping me from being able to do it.
Is the fair-queue line only for outbound traffic? I guess it would make sense. Why would you want to queue traffic inbound? :-)
Thanks Joseph!
John
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide