Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Remarking Diffserv Code Points to MPLS EXPs to Carry CoS Profiles Across a Service Provider’s L3VPN MPLS Network

This example is an introduction in how to rewrite (remark) DSCP class-of-service (CoS) code point values at the network border of a customer network and a service provider’s MPLS network while maintaining the original CoS profile of the traffic so that the traffic can be remarked with the original DSCP code points when it exits the MPLS network.

Requirements

To verify this procedure, this example uses a traffic generator. The traffic generator can be hardware-based or it can be software running on a server or host machine.

The functionality in this procedure is widely supported on devices that run Junos OS. The example shown here was tested and verified on MX Series routers running Junos OS Release 10.4.

Overview

The purpose of rewriting the IP DSCP code point values to MPLS EXP code point values is to carry the packet’s CoS profile across the service provider’s MPLS network. The rewriting is performed by the provider edge (PE) routers at the borders of the service provider’s network. See Figure 2.

Junos OS contains several DSCP default rewrite rules that might meet your requirements. You display them with the show class-of-service rewrite-rule command. A partial set of the default rewrite DSCP code point rule mappings is shown in the following table.

You can also define your own custom rewrite-rules table, or use a mixture of the default rewrite-rules and a custom table that you create. This example uses default rewrite-rules.

Table 1: Default rewrite rules

Map from Forwarding Class

PLP Value

MAP to DSCP/DSCP IPv6/EXP/IP Code Point Aliases

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

high

nc2/cs7

Junos OS uses the values shown in the following table for MPLS CoS in the EXP fields of the MPLS header.

Forwarding Class

Loss Priority

EXP 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

101

network-control

low

110

network-control

high

111

Figure 1 shows the MPLS packet structure.

Figure 1: MPLS Packet StructureMPLS Packet Structure
Note:

In addition to providing the necessary information to complete the purpose of this example, this example also includes all of the commands required to re-create the Layer 3 VPN (L3VPN) network as shown in Figure 2. A full explanation of the tasks required to configure an L3VPN network is not included in this example. If you require more information regarding configuring an L3VPN network, refer to the Layer 3 VPNs User Guide for Routing Devices available at http://juniper.net/documentation .

A thorough explanation of the required CoS rewriting and the underlying algorithms used in this example is beyond the scope of this document. For more information, refer to QOS-Enabled Networks—Tools and Foundations by Miguel Barreiros and Peter Lundqvist. This book is available at many online booksellers and at www.juniper.net/books .

Topology

This example uses the topology in Figure 2.

Figure 2: Rewriting CoS Information at the Network Border to Transit an MPLS Network ScenarioRewriting CoS Information at the Network Border to Transit an MPLS Network Scenario

Configuration

Procedure

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Device CE1

Device PE1

Device P1

Device P2

Device PE2

Device CE2

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

To configure Device CE1:

  1. Configure the device interfaces.

  2. Configure the BGP parameters

  3. Configure the policy option parameters.

  4. Configure the routing option parameters.

  5. Configure the DSCP code point rewrite parameters.

Step-by-Step Procedure

To configure Device PE1:

  1. Configure the device interfaces.

  2. Configure the routing option parameters.

  3. Configure the protocol parameters.

  4. Configure the routing instance parameters.

  5. Configure the class-of-service parameters that perform the DSCP code point to MPLS EXP rewriting.

Step-by-Step Procedure

To configure Device P1:

  1. Configure the device interfaces.

  2. Configure the routing option parameters.

  3. Configure the protocol parameters.

Step-by-Step Procedure

To configure Device P2:

  1. Configure the device interfaces.

  2. Configure the routing option parameters.

  3. Configure the protocol parameters.

Step-by-Step Procedure

To configure Device PE2:

  1. Configure the device interfaces.

  2. Configure the routing option parameters.

  3. Configure the protocol parameters.

  4. Configure the routing instance parameters.

  5. Configure the class-of-service parameters that perform the DSCP code point to MPLS EXP rewriting.

Step-by-Step Procedure

To configure Device CE2:

  1. Configure the device interfaces.

  2. Configure the protocol parameters.

  3. Configure the policy option parameters.

  4. Configure the routing option parameters.

  5. Configure the DSCP code point rewrite parameters.

Results

From configuration mode, confirm your configuration by entering the show interfaces, show protocols, show policy-options, show routing-options, show routing-instances, show firewall, and show class-of-service commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

If you are done configuring Device CE1, enter commit from configuration mode.

If you are done configuring Device PE1, enter commit from configuration mode.

If you are done configuring Device P1, enter commit from configuration mode.

If you are done configuring Device P2, enter commit from configuration mode.

If you are done configuring Device PE2, enter commit from configuration mode.

If you are done configuring Device CE2, enter commit from configuration mode.

Verification

Confirm that the configuration is working properly by verifying that the DSCP code points are maintained from CE1 to CE2.

Clearing the Firewall Counters

Purpose

Confirm that the firewall counters are cleared.

Action

On Device CE2, run the clear firewall all command to reset the firewall counters to 0.

Sending Traffic into the Network from TCP HTTP Ports 80 and 12345 and Monitoring the Results

Purpose

Send traffic into the network from the host connected to Device CE1 so that it that can be monitored at Device CE2.

Action

A different firewall is required on interface ge-2/0/7 to count the traffic that is being transmitted outbound to the destination. The following commands apply the firewall filter that counts the marked traffic as it is transmitted to the destination.

Note:

To capture traffic at Device CE1, apply this command set interfaces ge-1/0/1 unit 0 family inet filter output count, followed by the commands below.

Note:

To capture traffic at Device CE2, apply this command set interfaces ge-2/0/7 unit 0 family inet filter output count, followed by the commands below.

When you are done testing, you can leave the counting filter in place, or remove it.

  1. On host 1 use a traffic generator to send 20 TCP packets with a source port of 80 into the network, and repeat the task using a source port of 12345.

  2. On Device CE2, check the firewall counters by using the show firewall command.

Meaning

The code point for TCP packets to port 12345 is maintained as be. The code point for TCP packets to port 80 is maintained as ef.