Packet marking
Packet marking is a QoS traffic differentiation model that
-
assigns a priority value to each packet to indicate its relative importance in the network
-
embeds this priority value into header fields such as IP precedence, Differentiated Services Code Point (DSCP), Class of Service (CoS), or MPLS Experimental (EXP) bits, and
-
enables consistent forwarding treatment and queuing decisions across interfaces and network domains.
You can use packet marking in input policy maps to set or modify the attributes for traffic belonging to a specific class. For example, you can change the CoS value in a class or set DSCP or IP precedence values for a specific type of traffic. These new values are then used to determine how the traffic should be treated.
Types of packet marking
QoS uses packet and frame markings at different layers of the network stack to identify traffic classes, assign priorities, and influence queuing or drop behavior.
The primary marking categories are organized by the protocol layer at which they operate.
Layer 3 QoS markings
-
Differentiated Services Code Point (DSCP): a six-bit field that defines per-hop behavior for traffic classes.
-
IP Precedence: a three-bit field in the IP header that represents eight levels of priority.
-
MPLS Experimental (EXP) bits: a three-bit field in the MPLS header that conveys packet priority across MPLS networks.
Layer 2 QoS markings
-
Class of Service (CoS): a three-bit field in the 802.1Q VLAN tag that specifies a priority level (0-7) for a Layer 2 Ethernet frame.
-
Priority Code Point (PCP): a three-bit field in the 802.1Q VLAN tag that indicates frame priority at Layer 2.
-
Drop Eligibility Indicator (DEI): a one-bit field in the 802.1Q VLAN tag that indicates frame drop precedence.
For more information on the different types of packet marking, refer to the Types of packet classification section in the Classify Packets to Identify Specific Traffic chapter.
ECN—a system-controlled marking mechanism
Explicit Congestion Notification (ECN) is not to be confused with QoS packet marking mechanisms such as DSCP, CoS, or MPLS EXP, because ECN does not classify or prioritize traffic. Instead of defining how packets are queued or forwarded, ECN signals network congestion between devices by using two bits in the IP header. Routers and switches set or clear these bits dynamically when congestion is detected, allowing end hosts to reduce transmission rates without dropping packets.
Unlike DSCP or CoS markings, which administrators configure through Modular QoS CLI (MQC) policies to define per-hop behavior and resource allocation, ECN is system-controlled and not user-configurable.
Packet marking commands
The table lists the packet marking commands available in Modular QoS CLI (MQC) and shows their applicability for ingress and egress traffic directions, supported value ranges, and conditional or unconditional usage.
| QoS marking command | Range | Unconditional marking—applicable direction | Conditional marking—availability |
|---|---|---|---|
| set ip encapsulation | 0-63 | ingress | No |
| set discard-class | 0-1 | ingress | No |
| set dscp | 0-63 | ingress, egress | No |
| set mpls experimental topmost | 0-7 | ingress, egress | No |
| set precedence | 0-7 | ingress, egress | No |
| set qos-group | 0-31 | ingress | No |
| set cos | 0-7 | ingress, egress | No |
| set dei | 0-1 | ingress, egress | No |
Default QoS marking behavior for VLAN and MPLS encapsulations
When a packet enters or leaves a router, additional encapsulations such as VLAN tags or MPLS labels may be added to the frame. To maintain consistent QoS behavior, the router applies default marking profiles that specify which CoS or EXP values are written into those encapsulations. These profiles define how unclassified or unmarked traffic is treated, allowing the device to maintain a predictable baseline for scheduling, shaping, and congestion management operations.
During initialization, the system automatically creates one ingress default QoS mapping profile and one egress default QoS mapping profile for each device. These mappings determine the default CoS and EXP field values for all tagged or labeled traffic when no explicit class-based policy overrides them.
Feedback