Guest

Cisco 10000 Series Routers

Set Inner CoS Bits for QinQ

  • Viewing Options

  • PDF (435.3 KB)
  • Feedback
Set Inner CoS Bits for QinQ

Table Of Contents

Set Inner CoS Bits for QinQ

Contents

Prerequisites for Set Inner CoS Bits for QinQ

Feature Overview

PPPoE—QinQ Support on Subinterfaces

Configuration Tasks

Configuring Inner CoS Bits for QinQ

Verifying Traffic Marking

Configuration Example

Configuring Inner CoS Bits for QinQ

Additional References

Related Documents

Standards

MIBs

RFCs

Command Reference

set cos


Set Inner CoS Bits for QinQ


First Published: September 2007

Revised: November 2009

This document describes the Set Inner CoS Bits for QinQ feature that allows you to mark both inner and outer VLAN tags of a QinQ frame with the same Class of Service (CoS) values.

History for the Set Inner CoS Bits for QinQ

Release
Modification

12.2(33)XNE

Support was added for the PRE4.


Finding Support Information for Platforms and Cisco IOS Software Images

Use Cisco Feature Navigator to find information about platform and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions.

Contents

Prerequisites for Set Inner CoS Bits for QinQ

Feature Overview

Configuration Tasks

Configuration Example

Additional References

Command Reference

Prerequisites for Set Inner CoS Bits for QinQ

You must configure Cisco Express Forwarding (CEF) on both the interface receiving the packet and the interface sending the packet. For information on CEF switching, refer to the Cisco IOS Switching Services Configuration Guide.

This feature requires a Performance Routing Engine 3 (PRE3) or later PRE.

Feature Overview

The Set Inner CoS Bits for QinQ feature allows you to mark both the inner and outer VLAN tags of a QinQ frame with the same CoS values.

The router uses the CoS values to determine how to prioritize packets and can also use CoS marking to perform Layer 2 to Layer 3 mapping. Using the CoS field, you can differentiate user-defined QoS services for packets leaving a router and entering a switch.

Switches already have the ability to match and set CoS values; therefore, a router can set the CoS value of a packet to enable Layer 2 to Layer 3 mapping. The switch can then process the Layer 2 CoS header marking.

1. You assign the CoS value for an inner or outer VLAN tag to a class in a policy map.

2. If no inner CoS marking is explicitly set, the default marking of 802.1p CoS values on encapsulated IP packets is set to the value of the IP header precedence bits.

3. The parallel express forwarding (PXF) copies the class-based CoS values to the inner and outer VLAN tags.

4. The Layer 3 IP header Type of Service (ToS) field to CoS mapping applies the class-based CoS values on the downstream traffic from the Layer Access Concentrator (LAC) to the subscriber.

This feature is supported only for the subinterfaces that are configured with an inner (customer) VLAN.

PPPoE—QinQ Support on Subinterfaces

PPPoE—QinQ Support adds another layer of IEEE 802.1Q tag (called metro tag or PE-VLAN) to the 802.1Q tagged packets that enter the network. This additional layer expands the VLAN space by tagging the tagged packets, thus producing a double-tagged frame. The expanded VLAN space allows the service provider to provide certain services, such as Internet access on specific VLANs for specific customers, and yet still allows the service provider to provide other types of services for their other customers on other VLANs.

Service providers can allow their customers to use this feature to safely assign their own VLAN IDs on subinterfaces because these subinterface VLAN IDs are encapsulated within a service provider-designated VLAN ID for that customer. Therefore no overlap of VLAN IDs among customers exists, nor does traffic from different customers become mixed.

The double-tagged frame is assigned on a subinterface with an expanded encapsulation dot1q command that specifies the two VLAN ID tags (outer VLAN ID and inner VLAN ID) terminated on the subinterface. See Figure 1.

Figure 1 Untagged, 802.1Q-Tagged, and Double-Tagged Ethernet Frames

PPPoE—QinQ Support is generally supported on whichever Cisco IOS features or protocols are supported on the subinterface. For example, you can configure a double-tagged frame to run PPPoE on the subinterface. IPoQinQ supports IP packets that are double-tagged for QinQ VLAN tag termination by forwarding IP traffic with the double-tagged (also known as stacked) 802.1Q headers.

For more information on PPPoE—QinQ Support, refer to the PPPoE—QinQ Support feature module.

Configuration Tasks

To configure and verify the CoS markings for inner and outer VLAN tags of a QinQ frame, perform the following tasks:

Configuring Inner CoS Bits for QinQ

Verifying Traffic Marking

Configuring Inner CoS Bits for QinQ

To configure both the inner and outer VLAN tags of a QinQ frame, enter the following commands beginning in global configuration mode:

 
Command
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode. If prompted, enter your password.

Step 2 

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3 

class-map class-map-name [match-all | match-any]

Example:

Router(config)# class-map c1

Creates a class map to be used for matching packets to a specified class. Enters class-map configuration mode.

class-map-name is the name of the class for the class map. The name can be a maximum of 40 alphanumeric characters.

match-all determines how packets are evaluated when multiple match criteria exist. Matches statements under this class map based on the logical AND function. One statement and another are accepted. If you do not specify the match-all or match-any keyword, the default keyword is match-all.

match-any determines how packets are evaluated when multiple match criteria exist. Matches statements under this class map based on the logical OR function. One statement or another is accepted.

Step 4 

match ip {dscp dscp-list | precedence precedence-list}

Example:

Router(config-cmap)# match ip precedence 5

Specifies the match criteria to classify traffic.

dscp dscp-list specifies a list of up to eight IP Differentiated Services Code Point (DSCP) values to match against incoming packets. Separate each value with a space. The range is 0 to 63.

ip precedence precedence-list specifies a list of up to eight IP-precedence values to match against incoming packets. Separate each value with a space. The range is 0 to 7.

Step 5 

exit

Example:

Router(config-cmap)# exit

Exits class-map configuration mode.

Step 6 

Router(config)# policy-map policy-name

Example:

Router(config)# policy-map tos2cos

Specifies the name of the service policy to configure. Enters policy-map configuration mode.

policy-map-name is the name of the policy map.

Step 7 

Router(config-pmap)# class class-map-name

Example:

Router(config-pmap)# class c1

Assigns the traffic class and enters policy-map class configuration mode.

class-map-name is the name of the previously configured class map and is the traffic class for which you want to define QoS actions.

Step 8 

Router(config-pmap-c)# set cos value

Example:

Router(config-pmap-c)# set cos 3

Specifies the Layer 2 CoS value of an outgoing packet.

value is an IEEE 802.1Q CoS value from 0 to 7.

Step 9 

Router(config-pmap-c)# set ip precedence value
Example:
Router(config-pmap-c)# set ip precedence 1

Specifies the precedence value in the IP header.

value is the precedence-bit value in the IP header. The following values from 0 to 7 are allowed:

0—routine

1—priority

2—immediate

3—flash

4—flash-override

5—critical

6—internet

7—network

Step 10 

class class-default

Example:

Router(config-pmap-c)# class class-default

Configures or modifies the parent class-default class.

Note You can configure only the class-default class in a parent policy. Do not configure any other traffic class.

Step 11 

Router(config-pmap-c)# set cos value

Example:

Router# set cos 4

Specifies the Layer 2 CoS value of an inbound packet.

value is an IEEE 802.1Q CoS value from 0 to 7.

Step 12 

exit

Example:

Router(config-pmap-c)# exit

Exits policy-map class configuration mode.

Step 13 

exit

Example:

Router(config-pmap)# exit

Exits policy-map configuration mode.

Step 14 

Router(config)# interface type 
number.subinterface-number
Example:

Router(config)# interface gigabitethernet 1/0/0.100

Configures a subinterface for PPP over Ethernet (PPPoE) QinQ support. Enters subinterface configuration mode.

Step 15 

encapsulation dot1q vlan-id second-dot1q {any | vlan-id[,vlan-id[-vlan-id]]}

Example:

Router(config-subif)# encapsulation dot1q 100 second-dot1q 200

(Optional) Enables IEEE 802.1Q encapsulation of traffic on a subinterface in a virtual LAN (VLAN).

vlan-id is the VLAN ID, an integer in the range 1 to 4094. Hyphen must be entered to separate the starting and ending VLAN ID values that are used to define a range of VLAN IDs. (Optional) Comma must be entered to separate each VLAN ID range from the next range.

second-dot1q supports the IEEE 802.1QinQ VLAN Tag Termination feature to configure an inner VLAN ID.

any is any second tag in the range 1 to 4094.

Step 16 

Router(config-subif)# pppoe enable [group group-name] 
Example:

Router(config-subif)# pppoe enable

(Optional) Enables PPPoE sessions on a subinterface.

(Optional) group specifies that a PPPoE profile will be used by PPPoE sessions on the interface.

(Optional) group-name is the name of the PPPoE profile to be used by PPPoE sessions on the subinterface.

Step 17 

Router(config-subif)# service-policy output 
policy-map-name
Example:

Router(config-subif)# service-policy output tos2cos

Attaches the policy map you specify to the subinterface. The router applies the service policy to packets on the subinterface in the output direction.

output indicates to apply the service policy to outbound packets.

policy-map-name is the name of the policy map.

Step 18 

Router(config-subif)# exit
Example:

Router(config-subif)# exit

Exits subinterface configuration mode.

Verifying Traffic Marking

The router collects statistical information about the number of packets and bytes marked. To verify traffic marking, enter any of the following commands in privileged EXEC configuration mode:

Command
Purpose

Router# show policy-map

Displays configuration information for all configured policy maps.

Router# show policy-map policy-map-name

Displays configuration information for the policy map you specify.

Router# show policy-map interface

Displays configuration and statistical information for all of the output policies that are attached to an interface.

Router# show policy-map interface interface

Displays configuration and statistical information for the output policies attached to the interface you specify.

interface is the name of the interface or subinterface whose policy configuration you want to display.

Router# show policy-map interface interface [output]

Displays the configuration of all classes configured for all outbound policy maps attached to the specified interface.

interface is the name of the interface or subinterface whose policy configuration you want to display.

output indicates to display the statistics for the attached outbound policy.

Note If you do not specify output, the router shows information about all classes that are configured for all policies attached to the interface you specify.

Router# show policy-map policy-map-name class class-name

Displays the configuration of the class you specify for the policy map you specify.

policy-map-name is the name of the policy map that contains the class configuration you want to display.

class-name is the name of the class whose configuration you want to display.


Configuration Example

This section provides the following configuration example:

Configuring Inner CoS Bits for QinQ

Configuring Inner CoS Bits for QinQ

Example 1 shows how to configure the inner and outer VLAN tags of a QinQ frame with CoS values. In the example, a policy map called tos2cos is created. The class map named c1 and the default policy class map use the same CoS value on outbound and inbound packets on the Gigabit Ethernet 2/0/1 interface.

Example 1 Configuring Inner CoS Bits for QinQ

Router> enable
Router# configure terminal
Router(config)# class-map c1 
Router(config-cmap)# match ip precedence 5 
Router(config-cmap)# exit 
Router(config)# policy-map tos2cos
Router(config-pmap)# class c1
Router(config-pmap-c)# set cos 3 
Router(config-pmap-c)# set ip precedence 2 
Router(config-pmap-c)# class class-default 
Router(config-pmap-c)# set cos 3 
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Router(config)# interface GigabitEthernet 1/0/0.100
Router(config-subif)# encapsulation dot1q 100 
Router(config-subif)# pppoe enable
Router(config-subif)# service-policy output tos2cos 
Router(config-subif)# exit 

Additional References

The following sections provide references related to the Set Inner CoS Bits for QinQfeature.

Related Documents

Related Topic
Document Title

PPPoE—QinQ Support

PPPoE—QinQ Support feature module

Classification and Marking

Cisco IOS Quality of Service Solutions Configuration Guide, Release 12.2

Part 1: Classification > Configuring Class-Based Packet Marking

Class-Based Marking, Release 12.0(26)S feature module

Configuring Packet Marking on Frame Relay PVCs

QoS Packet Marking, Implementing Quality of Service

Class of Service Marking

Service Provider Quality of Service Design Guide

Cisco IOS Quality of Service Solutions Configuration Guide, Release 12.2

Part 1: Classification > Configuring Class-Based Packet Marking

IP Precedence Marking

Service Provider Quality of Service Design Guide

Cisco IOS Quality of Service Solutions Configuration Guide, Release 12.2

Part 1: Classification > Configuring Class-Based Packet Marking


Standards

Standard
Title

No new or modified standards are supported by this feature, and support for existing standards was not modified by this feature.


MIBs

MIB
MIBs Link

No new or modified MIBs are supported by this feature, and support for existing MIBs was not modified by this feature.

To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator at:

http://www.cisco.com/go/mibs


RFCs

RFC
Title

No new or modified RFCs are supported by this feature, and support for existing RFCs was not modified by this feature.


Command Reference

This section documents modified commands. All other commands used with this feature are documented in the Cisco IOS Command Reference publication for your Cisco IOS software release.

set cos

set cos

To set the Layer 2 class of service (CoS) value of an outgoing packet, use the set cos command in policy-map class configuration mode. To remove a specific CoS value setting, use the no form of this command.

set cos {cos-value | from-field [table table-map-name]}

no set cos {cos-value | from-field [table table-map-name]}

Cisco 10000 Series Router

set cos cos-value

Syntax Description

cos-value

Specific IEEE 802.1Q CoS value from 0 to 7.

from-field

Specific packet-marking category to be used to set the CoS value of the packet. If you are using a table map for mapping and converting packet-marking values, this establishes the "map from" packet-marking category. Packet-marking category keywords are as follows:

precedence

dscp

table

(Optional) Indicates that the values set in a specified table map will be used to set the CoS value.

table-map-name

(Optional) Name of the table map used to specify the CoS value. The table map name can be a maximum of 64 alphanumeric characters.


Defaults

No CoS value is set for the outgoing packet.

Command Modes

Policy-map class configuration

Command History

Release
Modification

12.1(5)T

This command was introduced.

12.2(13)T

This command was modified for Enhanced Packet Marking to allow a mapping table (table map) to be used to convert and propagate packet-marking values.

12.0(16)BX

This command was implemented on the Cisco 10000 series router for the ESR-PRE2.

12.0(31)S

This command was integrated into Cisco IOS Release 12.0(31)S.

12.2(33)SRA

This command was integrated into Cisco IOS Release 12.2(33)SRA.

12.2(31)SB

This command was integrated into Cisco IOS Release 12.2(31)SB and implemented on the Cisco 10000 series router.

12.2SX

This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.


Usage Guidelines

CoS packet marking is supported only in the Cisco Express Forwarding switching path.

If a user wants to mark a packet that is being sent to a switch, the set cos command should be used by a router. Switches can leverage Layer 2 header information, including a CoS value marking.

The set cos command can be used only in service policies that are attached in the output direction of an interface. Packets entering an interface cannot be set with a CoS value.

The match cos and set cos commands can be used together to allow routers and switches to interoperate and provide quality of service (QoS) based on the CoS markings.

Layer 2 to Layer 3 mapping can be configured by matching on the CoS value because switches already can match and set CoS values. If a packet that needs to be marked to differentiate user-defined QoS services is leaving a router and entering a switch, the router should set the CoS value of the packet because the switch can process the Layer 2 header.

Using This Command with the Enhanced Packet Marking Feature

You can use this command as part of the Enhanced Packet Marking feature to specify the "from-field" packet-marking category to be used for mapping and setting the CoS value. The "from-field" packet-marking categories are as follows:

Precedence

Differentiated services code point (DSCP)

If you specify a "from-field" category but do not specify the table keyword and the applicable table-map-name argument, the default action is to copy the value associated with the "from-field" category as the CoS value. For instance, if you configure the set cos precedence command, the precedence value will be copied and used as the CoS value.

You can do the same for the DSCP marking category. That is, you can configure the set cos dscp command, and the DSCP value is copied and used as the CoS value.


Note If you configure the set cos dscp command, only the first three bits (the class selector bits) of the DSCP field are used.


Examples

In the following example, the policy map called cos-set is created to assign different CoS values for different types of traffic. This example assumes that the class maps called voice and video-data are already created.

Router(config)# policy-map cos-set 
Router(config-pmap)# class voice 
Router(config-pmap-c)# set cos 1 
Router(config-pmap-c)# exit 
Router(config-pmap)# class video-data 
Router(config-pmap-c)# set cos 2 
Router(config-pmap-c)# end

Enhanced Packet Marking Example

In the following example, the policy map called policy-cos is created to use the values defined in a table map called table-map1. The table map called table-map1 was created earlier with the table-map (value mapping) command. For more information about the table-map (value mapping) command, see the table-map (value mapping) command page.

In this example, the setting of the CoS value is based on the precedence value defined in table-map1:

Router(config)# policy-map policy-cos 
Router(config-pmap)# class class-default 
Router(config-pmap-c)# set cos precedence table table-map1
Router(config-pmap-c)# end

Note The set cos command is applied when you create a service policy in QoS policy-map configuration mode and attach the service policy to an interface or ATM virtual circuit (VC). For information on attaching a service policy, refer to the "Modular Quality of Service Command-Line Interface Overview" chapter of the Cisco IOS Quality of Service Solutions Configuration Guide.


Related Commands

Command
Description

match cos

Matches a packet on the basis of Layer 2 CoS marking.

policy-map

Creates or modifies a policy map that can be attached to one or more interfaces to specify a service policy.

service-policy

Attaches a policy map to an input interface or VC, or an output interface or VC, to be used as the service policy for that interface or VC.

set dscp

Marks a packet by setting the Layer 3 DSCP value in the ToS byte.

set precedence

Sets the precedence value in the packet header.

show policy-map

Displays the configuration of all classes for a specified service policy map or all classes for all existing policy maps.

show policy-map class

Displays the configuration for the specified class of the specified policy map.

show policy-map interface

Displays the configuration of all classes configured for all service policies on the specified interface or displays the classes for the service policy for a specific PVC on the interface.