QoS and my math :-)

Unanswered Question
Oct 27th, 2008
User Badges:
  • Purple, 4500 points or more

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


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (2 ratings)
Loading.
Collin Clark Mon, 10/27/2008 - 07:15
User Badges:
  • Purple, 4500 points or more

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.

John Blakley Mon, 10/27/2008 - 07:17
User Badges:
  • Purple, 4500 points or more

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

Collin Clark Mon, 10/27/2008 - 07:19
User Badges:
  • Purple, 4500 points or more

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

John Blakley Mon, 11/03/2008 - 14:43
User Badges:
  • Purple, 4500 points or more

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

Collin Clark Tue, 11/04/2008 - 06:49
User Badges:
  • Purple, 4500 points or more

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 Mon, 10/27/2008 - 09:34
User Badges:
  • Super Bronze, 10000 points or more

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.

John Blakley Tue, 11/04/2008 - 06:58
User Badges:
  • Purple, 4500 points or more

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

Joseph W. Doherty Tue, 11/04/2008 - 09:31
User Badges:
  • Super Bronze, 10000 points or more

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.

John Blakley Tue, 11/04/2008 - 09:55
User Badges:
  • Purple, 4500 points or more

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


Joseph W. Doherty Tue, 11/04/2008 - 10:06
User Badges:
  • Super Bronze, 10000 points or more

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


John Blakley Tue, 11/04/2008 - 10:09
User Badges:
  • Purple, 4500 points or more

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

Joseph W. Doherty Tue, 11/04/2008 - 10:32
User Badges:
  • Super Bronze, 10000 points or more

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

John Blakley Tue, 11/04/2008 - 10:43
User Badges:
  • Purple, 4500 points or more

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

Actions

This Discussion