Rewriting Packet Header Information
As the packet leaves the routing platform, the final CoS action is the application of a rewrite rule. Rewrite rules set the value of the CoS bits within the packet's header. The bit setting is determined by the packet's forwarding class and loss priority setting. Each rule examines the forwarding class and loss priority of the packet about to be transmitted and sets the bits to a value defined in the rule. In effect, the rewrite rule performs the opposite function of the behavior aggregate (BA) classifier used when the packet enters the router.
You always apply rewrite rules to egress interfaces, and you generally apply them on the edge of your network. This allows the downstream router in a neighboring network to classify each packet into the appropriate service group.
To configure class-of-service (CoS) rewrite rules, you can include the following statements at the
[edit class-of-service]hierarchy level of the configuration:class-of-service {interfaces {interface-name{unitlogical-unit-number{rewrite-rules {dscp (rewrite-name| default);dscp-ipv6 (rewrite-name| default);exp (rewrite-name| default)protocolprotocol-types;exp-push-push-push default;exp-swap-push-push default;frame-relay-de(rewrite-name| default);ieee-802.1(rewrite-name| default);inet-precedence (rewrite-name| default);}}}}rewrite-rules {(dscp | dscp-ipv6 | exp | frame-relay-de | ieee-802.1 | inet-precedence)rewrite-name{import (rewrite-name| default);forwarding-classclass-name{loss-prioritylevelcode-point (alias|bits);}}}}This chapter discusses the following topics:
- Applying a Default Rewrite Rule
- Configuring Rewrite Rules
- Assigning the Rewrite-Rules Configuration to the Output Logical Interface
- Rewriting EXP Bits on a Particular Node
- Rewriting MPLS and IPv4 Packet Headers
- Rewriting the EXP Bits of All Three Labels of an Outgoing Packet
- Rewriting IEEE 802.1p Packet Headers with MPLS EXP Value
- Rewriting Frame Relay Headers