Cisconinja’s Blog

Marking DSCP values with Policy-Based Routing

Posted by Andy on November 26, 2008

I recently read Wendell Odom’s QoS Exam Certification Guide.  One of the appendixes that covers legacy methods for marking traffic describes how policy-based routing can be used as a marking tool.  According to the book, PBR can be used to mark IP precedence but not DSCP – possibly because class-based marking is the most common type of marking now used, so it may not have been considered necessary to update PBR in IOS to follow the DiffServ standard.  The following diagram shows the two different ways that the IP header Terms of Service (ToS) byte has been defined:




I recalled that route maps (which are what PBR uses to perform marking) allow the delay, throughput, reliability, and monetary cost bits (collectively known as the ToS field in the Pre-DiffServ standard) to be set, which correspond to the last 3 bits of the DSCP field and 1st bit of the ECN field in the DiffServ standard.  This made me wonder: Will IOS allow both the IP precedence and the ToS field to be marked with PBR?  Will it be interpreted by DiffServ capable devices as the correct DSCP value?  To find out, I set up a simple lab scenario to test it out:




R2 will be using PBR to mark traffic that is sourced from R1.  We will attempt to mark ICMP traffic with a DSCP value of Expedited Forwarding (EF) and then ping from R1 to R3 to test it out.  IOS displays the following options for setting the ToS field within a route map:




To set any one of the four bits that make up this field, we can enter the keyword of the bit we want to set.  To set multiple bits, we must enter the decimal value of the combined bits we want to set.  To obtain the EF DSCP value (101110), we will need to set the IP precedence to 5 (101) and the ToS to 12 (1100).  Note that the last bit of the ToS field is not a part of the DSCP field in the DiffServ standard, so we are leaving it set to 0.  Our PBR configuration on R2 is:




To verify, we will ping from R1 to R3.  The ICMP traffic should match route map clause 10 and have the IP precedence set to 5 and ToS set to 12.  A capture taken on R2’s F0/1 interface is shown below in Wireshark:




Wireshark correctly interprets it as DSCP EF, just as we hoped.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: