Quality of Service Part 7: Service Policy

In part six of this blog series we discussed that Marking was considered to be what will be done with the traffic after it has been classified. Now, we will talk about service policy which are considered as the part of QoS where the policy is implemented.

Service Policy
Once you have defined the class-maps, and policy-maps, the policy is attached to the inbound or outbound packets using the service-policy command. It is possible to assign a single policy map to multiple interfaces or assign multiple policy maps to a single interface. There is a maximum of one service-policy command in each direction, inbound and outbound.

Example 1

Class-map ef
      Match access-group 10
Class-map af11
      Match access-group 20
Class-map af21
      Match access-group 30
Policy-map mark_traffic
      Class ef
      Set ip dscp ef
      Class af11
      Set ip dscp af11
      Class af21
      Set ip dscp af21
Interface serial0/0<
      Service-policy input mark_traffic
Access-list 10 permit
Access-list 20 permit
Access-list 30 permit

In the next part of this series on QoS we will look at congestion avoidance.

Author: Paul Stryer


In this article

Join the Conversation


  1. Kemal Reply

    Hi Paul,

    I am reading your QoS series of text and they are really good, thanks for providing those. However, just want to make a small note on this text “Quality of Service Part 7: Service Policy”. From your text it is not clear in which direction service policy needs to be set. What does it mean inbound/outband when it comes to position of router and traffic flow, that could be described as well. I am preparing also for this exam, and as double checking myself I am reading your texts, and that is what I have noticed. Again, you are doing good job and just keep on with it.


  2. Paul Stryer Reply


    First of all, thank you for reading my QoS series, it has been fun to write this blog series and gratifying to know so many people like you are getting so much out of this series.

    For the overall QoS policy remember the following: Who, What, Where.

    • Class Maps – are the “Who” portion of the policy, meaning who or what traffic do we care about. Each class of traffic is defined using a class map command.

    • Policy Maps – are the “What” portion of the QoS policy, meaning what process will be performed on the different classes of traffic.

    • Service Policy – are the “Where” portion of the QoS Policy, meaning where is the policy located or what interface do we put the service policy on. It is best practice to classify traffic as close to the source as you can.

    A single policy map can be assigned to multiple interfaces or multiple policy maps can be assigned to one interface. There is a maximum of one service policy per direction per interface, inbound or outbound.

    Use the service-policy interface configuration command to attach a traffic policy to an interface and specify the direction in which the policy should be applied. You can apply the service-policy to packets coming into the interface, or packets leaving the interface (hence the command “input” or “output”).

    When I was first learning access list from my mentor, he described inbound and outbound as follows. Pretend you are a little router dude that lives inside the router, if a packet is entering the router or interface that would be inbound. If a packet has been routed by the small router dude and is being sent out of the router that is outbound. The funny thing is anytime I have had to remember inbound and outbound for the past 12 years, I remember this conversation with my mentor, and laugh to myself about the thought of a little dude living inside the router.

    With regards to the service-policy command, input is inbound and output is outbound.

    interface FastEthernet0/0
    ip address
    cdp enable
    logging event link-status
    speed 100
    duplex full
    mls qos trust dscp
    service-policy input VoIP-Traffic
    service-policy output Data-Traffic

    There is a cool web page on Cisco’s web site that might also help with this section of your study.

    Quality of Service Interactive Voice Network Configuration Example

    Thank you again for your patronage of our blogs on the Global Knowledge web site.

    FYI – I just finished the next four entries of this series last night they should be on the site soon.

    Best Regards
    Paul Stryer

    1. Kemal Reply

      Good afternoon Paul,

      Thanks for your clarifications. It will help future readers to understand QoS stuff in details.

      I am happy to know that there will be some more blog posts about QoS published soon.

      Best regards,