Anda di halaman 1dari 16

Packet Header Rewrite

© 2010 Juniper Networks, Inc. All rights reserved. | www.juniper.net


CoS Processing—Packet Header Rewrite

Ingress
BA Policing Multifield Forwarding
Classifier (Ingress) Classifier Policy

Fabric

Scheduler Shaper RED


Egress Scheduler Shaper RED
Rewrite Scheduler Shaper RED Multifield Policing
Marker Scheduler Shaper RED Classifier (Egress)

© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 2


Packet Header Rewrite Overview

 Role of packet header rewrite:


•Convey a packet’s CoS profile to the next-hop device
• Set the value of the CoS bits within the packet’s header as it leaves
the current device
• Assign CoS value based on forwarding class and PLP
•Perform the opposite function of the BA classifier
• BA classifier translates incoming packet’s CoS value to forwarding
class and PLP
• Packet header rewrite translates outgoing packet’s forwarding
class and PLP to CoS value
•Contribute to CoS consistency and continuity throughout the
network

© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 3


Packet Header Rewrite Options

 The Junos operating system supports the following


packet header rewrite markings:
•IPv4 DSCP
•IPv6 DSCP
•IP precedence bits
•MPLS EXP bits
•IEEE 802.1p CoS bits
•IEEE 802.1ad drop eligible indicator (DEI) bit

© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 4


Rewrite Tables

 Rewrite rules and tables


•Rewrite rule: Mapping between forwarding class and PLP to
CoS value for a particular protocol
•Set of rewrite rules forms a rewrite table
•Can configure multiple rewrite tables per protocol
• Same forwarding class and PLP can map to different CoS values
• Apply per interface

[edit class-of-service] Syntax


rewrite-rules {
(dscp | dscp-ipv6 | exp | ieee-802.1 | ieee802.1ad | inet-precedence) rewrite-name
{
import (rewrite-name | default);
forwarding-class class-name {
loss-priority level code-point (alias | bits);
}
}
}

© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 5


Default Rewrite Tables
 Default rewrite tables
•Several exist; most are not used by default
• Must be explicitly enabled on a logical interface
•Exception: MPLS-enabled interfaces use default MPLS EXP
rewrite rule
user@R1> show class-of-service interface ge-2/0/1
. . .
Logical interface: ge-2/0/1.0, Index: 70
Object Name Type Index
Rewrite exp-default exp (mpls-any) 33
Classifier exp-default exp 10
Classifier ipprec-compatibility ip 13

user@R1> show class-of-service rewrite-rule Default rewrite rule (when MPLS


. . .
is enabled on the interface)
Rewrite rule: exp-default, Code point type: exp, Index: 33
Forwarding class Loss priority Code point
best-effort low 000
best-effort high 001
expedited-forwarding low 010
expedited-forwarding high 011
assured-forwarding low 100
assured-forwarding high With the exception
101 of MPLS-
network-control low 110
network-control high enabled interfaces,
111 packet header
© 2010 Juniper Networks, Inc. All rights reserved. rewrite is disabled by default.
www.juniper.net | 6
Default Rewrite Rule Mappings

 Default rewrite rule mappings


•Based on default bit definitions of DSCP, DSCP IPv6, EXP,
IEEE, and IP CoS
•The Junos OS detects packets matching the forwarding class
and PLP values; maps header bits of predefined code-point
aliases Map from Forwarding Map to DSCP/DSCP
PLP Value
Class IPv6/EXP/IEEE/IP
expedited-forwarding low ef
expedited-forwarding high ef
assured-forwarding low af11
assured-forwarding High af12 (DSCP/DSCP IPv6/EXP)
best-effort low be
best-effort high be
network-control low nc1/cs6
network-control
© 2010 Juniper Networks, Inc. All rights reserved.
high nc2/cs7 www.juniper.net | 7
Configuring Rewrite Rules—Default Rewrite
Tables
 Perform packet header rewrite under the class-
of-service stanza
1. Apply the rewrite table to an interface (within class-of-
service stanza)
[edit]
user@R1# show class-of-service interfaces
ge-0/0/0 {
unit 0 {
rewrite-rules {
dscp default;
exp default;
ieee-802.1 default;
}
}
}
Apply rewrite tables with the
rewrite-rules statement.

© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 8


Configuring Rewrite Rules—Custom Rewrite
Tables (1 of 2)
 Perform packet header rewrite under the class-
of-service stanza
1. Define a custom rewrite table
2. Apply the rewrite table to an interface
Define the Apply to an interface
custom rewrite table (within class-of-service stanza)
[edit class-of-service] [edit class-of-service]
user@R1# show rewrite-rules user@R1# show interfaces
dscp custom-ipv4-rewrite-table { ge-0/0/3 {
forwarding-class BestEffort { unit 0 {
loss-priority high code-points 000000; rewrite-rules {
loss-priority low code-points 000001; dscp custom-ipv4-rewrite-table;
} }
forwarding-class Priority-data { }
loss-priority high code-points 000010; }
loss-priority low code-points 000011;
}
. . .
Apply rewrite tables with the
rewrite-rules statement.
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 9
Configuring Rewrite Rules—Custom Rewrite
Tables (2 of 2)
 import simplifies new rewrite table configuration
•Imported rewrite table acts as a template
• Can import default or custom rewrite tables
•New entries overwrite corresponding imported values
[edit]
user@R1# show class-of-service
rewrite-rules {
exp custom-exp-rewrite-table { Default EXP rewrite rule has code
import default;
forwarding-class best-effort { point 001 for high loss priority
loss-priority high code-points 000;
}
}
}

[edit]
user@R1# run show class-of-service rewrite-rules name custom-exp-
rewrite-table
Rewrite rule: custom-exp-rewrite-table, Code point type: exp, Index:
33
Forwarding class Loss priority Code point
best-effort low 000
best-effort high 000
. . .
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 10
Where to Use Packet Header Rewrite

 Generally within a network


•Push CoS values into network; create trusted markings
•Other devices can leverage traffic’s existing CoS values
Traffic flow
C2 PE2 P1
fe-0/0/3 fe-1/1/1 fe-2/0/1
Apply rewrite on PE
interfaces into CoS domain
CoS Domain

P2 PE1 C1
fe-1/0/2 fe-1/1/1
fe-0/0/2

Configuration for PE1


appears on the next page
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 11
PE1 Configuration Sample
1. Define rewrite rules

[edit class-of-service] [edit class-of-service]


rewrite-rules { interfaces {
dscp voice { fe-1/0/0 {
import default; unit 0 {
forwarding-class best-effort { rewrite-rules {
loss-priority low code-point 000000; dscp voice;
loss-priority high code-point 000001; }
} }
} }
} fe-0/0/2 {
Default DSCP rewrite rule has code unit 0 {
point 000000 for high loss priority rewrite-rules {
dscp voice;
}
}
}
2. Apply them to interfaces facing }
the CoS domain ingress

© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 12


Rewrite Combinations (1 of 2)

 Rewrite rules based on protocol


•Table applied to packet is determined based on protocol
• Example: MPLS packet gets EXP rewrite table
 Packets have multiple protocols
•Can rewrite one CoS value
• Example: IPv4 packet over Ethernet using VLANs; can set DSCP or
IEEE 802.1p
•Can rewrite both CoS values
• Example: IPv4 packet over MPLS; can set DSCP and EXP
simultaneously

© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 13


Rewrite Combinations (2 of 2)

 Options: Outgoing VLAN- Locations (Re) Writable


Packet’s tagged IP
MPLS EXP IP DSCP IEEE 802.1p
Protocols ? Precedence
Native IP
Native IP
IP in MPLS
IP in MPLS
CCC/TCC
VPLS

 Example: Rewriting EXP, IP precedence and 802.1p


[edit class-of-service interfaces]
ge-0/0/0 { Rewrite both IP precedence and
unit 0 { MPLS EXP to the same value
rewrite-rules {
exp exp-ipv4-rewrite-policy1 protocol mpls-inet-both;
ieee-802.1 ieee-1p-policy1 vlan-tag outer-and-inner;
}
} Apply IEEE 802.1p rewrite rule to
both outer and inner VLAN tags

© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 14


Usage Notes for Rewrite Rules and
Combinations

 Guidelines:
•Can generally configure multiple rewrite rules for a logical
interface, but…
•Capabilities vary by platform
•Highly hardware-dependent
• Based on PIC, FPC, platform capabilities
• Supported configurations and combinations vary per platform
• Some platforms have specific caveats
•Check Junos Class of Service Configuration Guide for
detailed information

© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 15

Anda mungkin juga menyukai