This question/lab was created with Cisco networking hardware. I have asked this question else where with no responses.
I am new to QoS, but I have spent the last few days researching and I've learned a ton. However, I am still having issues accomplishing what I want. I am trying to configure QoS to prioritize two classes of traffic over all other types of traffic (the first class will have more priority over the second class). To test this theory and my configurations I've set up two routers one switch and two PCs. Here is a picture of the topology I am using... (I am using real hardware, packet tracer is only demonstrating the topology)
My goal is to have all three PCs ping R2 at the same time, and for PC0 to have the easiest/fastest transmission. I set up a choke point between R1 and R2 so I could test and make sure my PC0 packets were the least likely to be dropped. I configured the R1-R2 link to 10mbps, mtu 500, and hold-queue to 10 packets for both 'in' and 'out'. I then had R1 ping R2 with large ICMP packets and R2 ping R1 also with large ICMP packets. The idea is R1's pings, R2's pings and PC2's pings are all routine traffic and should be the traffic that is dropped if the queue is full. PC0's pings should never/rarely be dropped.
Here's an example of my configuration...
R1 Configuration
ip access-list extended class1-out_acl
permit ip 192.168.1.0 0.0.0.255 any
deny ip any any
ip access-list extended class2-out_acl
permit ip 192.168.2.0 0.0.0.255 any
deny ip any any
ip access-list extended class1-in_acl
permit ip any 192.168.1.0 0.0.0.255
deny ip any any
ip access-list extended class2-in_acl
permit ip any 192.168.2.0 0.0.0.255
deny ip any any
class-map match-all class1-out
match access-group name class1-out_acl
class-map match-all class2-out
match access-group name class2-out_acl
class-map match-all class1-in
match access-group name class1-in_acl
class-map match-all class2-in
match access-group name class2-in_acl
policy-map QOS-OUT
class class1-out
priority percent 20
set precedence 5
class class2-out
priority percent 20
set precedence 3
class class-default
fair-queue
random-detect
set precedence 0
policy-map QOS-IN
class class1-in
police 2000000 400000 400000 conform-action transmit exceed-action drop violate-action drop
class class2-in
police 2000000 400000 400000 conform-action transmit exceed-action drop violate-action drop
class class-default
police 5000000 1000000 1000000 conform-action transmit exceed-action drop violate-action drop
control-plane
service-policy input QOS-IN
interface GigabitEthernet0/1
mtu 500
speed 10
hold-queue 10 in
hold-queue 10 out
service-policy output QOS-OUT
R2's configuration is exactly the same EXCEPT for the ACLs. The ACL for class1-out becomes the ACL for class1-in and vice-versa. The same is true for the class2-in and class2-out ACLs. This is done so the class1 traffic is given 'priority' round trip.
I set PC0 and PC3 to both ping R2 with 5000 size pings for 300 times (didn't use PC1 during this test). I set R1 to ping R2 with 5000 size pings about 15000 times and the same for R2 pinging R1.
During the test, both routers and both PC's were dropping packets (as I expected, slightly surprised PC0 was dropping though). When my test was complete I found that PC2 had the best results, dropping only 5% at a 9ms average, while PC0 dropped 10% with an average of 11ms.
I ran [show policy-map interface] and my class1 packets were being picked out of the flood, but it doesn't seem that they have any priority. Using this command, I also noticed ALL of the packets were being classified under IP Precedence 0 (routine). Which is strange, because I set class1 to 5.
As I mentioned earlier, I am new to QoS so I'm sure I have made a mistake somewhere. Also, could someone please explain a good method/policy to use when setting the 'police' values. I picked these numbers slightly arbitrarily.
Once I have sorted out any configuration errors, my underlying question is... is there a standard or policy I can follow to 'match' for my input and output service policies to provide the same level of QoS to the traffic classes. Referencing my example above, I'm trying to use a priority percent of 20% for class1 on the exit interface while also policing the input interface to 2mbps (20% of 10mbps) for class1. This is my attempt at 'a-lining' the link to use the same prioritization of traffic (both for input and output). I wish I could just use a percentage for both input and output service policies, but my research makes me think this is not possible.