cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
762
Views
8
Helpful
13
Replies

QoS and my math :-)

John Blakley
VIP Alumni
VIP Alumni

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

HTH, John *** Please rate all useful posts ***
13 Replies 13

Collin Clark
VIP Alumni
VIP Alumni

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.

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

HTH, John *** Please rate all useful posts ***

Apply it in bound and let's see what happens.

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

HTH, John *** Please rate all useful posts ***

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.

Joseph W. Doherty
Hall of Fame
Hall of Fame

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.

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

HTH, John *** Please rate all useful posts ***

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.

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

HTH, John *** Please rate all useful posts ***

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

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

HTH, John *** Please rate all useful posts ***

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).

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

HTH, John *** Please rate all useful posts ***
Review Cisco Networking for a $25 gift card