# Example: QoS Parameter Configuration for QoS Cell Mode and Byte Adjustment for Cell Shaping

The example in this section illustrates how to configure the byte adjustment application to adjust the shaping rate for downstream ATM traffic from the customer premise equipment (CPE) to Ethernet interfaces configured on an E320 router.

In this example, the QoS administrator manages the shaping rate using a combination of the byte adjustment application and cell shaping mode to account for different layer 2 encapsulations and the ATM cell pad, header, and trailer.

Figure 64 displays the Ethernet network to which the QoS administrator applies the byte adjustment.

Figure 64: Byte Adjustment for VC1 and VC2

In Figure 64, VLAN 1 and VLAN 2 map to the subscribers at VC1 and VC2.

The QoS administrator allocates a total of 10 Mbps of bandwidth for voice, video, and data services to VC1, and 2 Mbps of bandwidth of data traffic for VC2.

Table 28 lists the shaping rate and byte adjustment for both subscribers.

Table 28: Byte Adjustment for Subscribers VC1 and VC2

| VC1 | VC2
--- | --- | ---
Protocol | A3 encapsulation | A1 encapsulation
Byte Adjustment | -28 | -2
Voice Bandwidth | 1000000 bps | 1000000 bps
Video Bandwidth | 10000 bps | –
Data Bandwidth | 8000000 bps | –
Total Bandwidth | – | 1000000 bps

Configuring Traffic Classes

The QoS administrator configures the traffic classes and traffic-class groups for video and voice services.

1. Configure the traffic class named voice.
   host1(config)#traffic-class voice host1(config-traffic-class)#exit
2. Configure the traffic class named video.
   host1(config)#traffic-class video host1(config-traffic-class)#exit

Configuring the QoS Parameter Definition

The QoS administrator configures a parameter definition and the byte adjustment application. The QoS administrator then enables the QoS client to create a parameter instance of the byte adjustment from VLAN interfaces. All interfaces above the VLAN use the same byte adjustment value.

1. Configure a parameter definition named byte-adjustment.
   host1(config)#qos-parameter-define byte-adjustment application qos-byte-adjustment
2. Define the controlled-interface types for vlan and ip to adjust the shaping rate for the VLAN and IP queues.
   1. Configure the controlled-interface type for VLAN.
   2. Configure the controlled-interface type for IP.
      host1(config-qos-parameter-define)#controlled-interface-type vlan host1(config-qos-parameter-define)#controlled-interface-type ip host1(config-qos-parameter-define)#exit

Configuring the QoS Shaping Mode

The QoS administrator then configures the QoS shaping mode using the QoS cell mode application. When you configure the QoS shaping mode to cell mode on port 0 of the IOA, all ports on the IOA use the same value.

1. Configure a parameter definition named cell-mode.
   host1(config)#qos-parameter-define cell-mode application qos-cell-mode
2. Define the controlled-interface types for vlan and ip for the shaping mode.
   host1(config-qos-parameter-define)#controlled-interface-type vlan host1(config-qos-parameter-define)#controlled-interface-type ip host1(config-qos-parameter-define)#exit

Reference the Parameter Definition Within a Scheduler Profile

The QoS administrator configures the shaping rate and the shared-shaping rate within scheduler profiles for the subscribers at VC1 and VC2.

1. Configure the scheduler profile for the subscriber VC1.
   1. Configure the scheduler profile named vc1.
   2. Configure the shared-shaping rate of 10000000 with a burst of 10 milliseconds.
      host1(config)#scheduler-profile vc1 host1(config-scheduler-profile)#shared-shaping-rate 10000000 burst 10 milliseconds host1(config-scheduler-profile)#exit
2. Configure the scheduler profile for the voice service.
   1. Configure the scheduler profile named voice.
   2. Configure the shared-shaping rate of 100000 with a burst of 10 milliseconds.
      host1(config)#scheduler-profile voice host1(config-scheduler-profile)#shaping-rate 100000 burst 10 milliseconds host1(config-scheduler-profile)#exit
3. Configure the scheduler profile for the video service.
   1. Configure the scheduler profile named voice.
   2. Configure the shared-shaping rate of 8000000 with a burst of 10 milliseconds.
      host1(config)#scheduler-profile video host1(config-scheduler-profile)#shaping-rate 8000000 burst 10 milliseconds host1(config-scheduler-profile)#exit
4. Configure the scheduler profile for the subscriber VC2.
   1. Configure the scheduler profile named vc2.
   2. Configure the shared-shaping rate of 1000000 with a burst of 10 milliseconds.
      host1(config)#scheduler-profile vc2 host1(config-scheduler-profile)#shaping-rate 1000000 burst 10 m host1(config-scheduler-profile)#exit

Adding the Scheduler Profiles to a QoS Profile

After configuring the scheduler profiles, the QoS administrator then configures QoS profiles for subscribers VC1 and VC2.

1. Configure the vc1 QoS profile with a shared-shaping rate of 10 Mbps.
   1. Configure the QoS profile vc1.
   2. Configure the vlan node and reference the scheduler profile vc1.
   3. Configure the vlan queue and reference the voice traffic class and the voice scheduler profile.
   4. Configure the vlan queue and reference the video traffic class and the video scheduler profile.
      host1(config)#qos-profile vc1 host1(config-qos-profile)#vlan node scheduler-profile vc1 host1(config-qos-profile)#vlan queue traffic-class voice schedule-profile voice host1(config-qos-profile)#vlan queue traffic-class video schedule-profile video host1(config-qos-profile)#exit
2. Configure the vc2 QoS profile with a shaping rate of 1 Mbps.
   1. Configure the QoS profile vc2.
   2. Configure the vlan node and reference the scheduler profile vc2.
      host1(config)#qos-profile vc2 host1(config-qos-profile)#vlan node scheduler-profile vc2 host1(config-qos-profile)#exit

Attaching the Parameter Definition to an Interface

The QoS administrator creates logical interfaces for VLAN1 and VLAN2 and attaches the parameter definitions to them.

1. Attach the parameter definition to VLAN1.
   1. Configure the Gigabit Ethernet interface in slot 6, adapter 0, port 0.
   2. Configure the VLAN major interface.
   3. Configure the Gigabit Ethernet interface in slot 6, adapter 0, port 0, subinterface 1.
   4. Assign VLAN ID of 1.
   5. Create a parameter instance for byte-adjustment with a value of -28.
   6. Create a parameter instance for cell-mode with a value of 1 (cell shaping mode).
   7. Attach the QoS profile vc1 to the Gigabit Ethernet interface.
      host1(config)#interface gigabitEthernet 6/0/0 host1(config-if)#encapsulation vlan host1(config-if)#interface gigabitEthernet 6/0/0.1 host1(config-if)#vlan id 1 host1(config-if)#qos-parameter byte-adjustment -28 host1config-if)#qos-parameter cell-mode 1 host1(config-if)#qos-profile vc1 host1(config-if)#exit
2. Attach the parameter definition to VLAN2.
   1. Specify the Gigabit Ethernet interface in slot 6, adapter 0, port 1.
   2. Assign a VLAN ID of 2.
   3. Create a parameter instance for byte-adjustment with a value of -2.
   4. Create a parameter instance for cell-mode with a value of 1 (cell shaping mode).
   5. Attach the QoS profile vc2 to the Gigabit Ethernet interface.
      host1(config-if)#interface gigabitEthernet 6/0/1.1 host1(config-if)#vlan id 2 host1(config-if)#qos-parameter byte-adjustment -2 host1(config-if)#qos-parameter cell-mode 1 host1(config-if)#qos-profile vc2 host1(config-if)#exit

## Complete Configuration Example

You can use the complete configuration examples provided for each of the configurations in your own network. To customize the configuration example for your needs, copy the text into a text editor, and modify it.

To use the example for immediate use, copy it to the local console or Telnet session from which you access the router.

You can also save the example as a script (.scr) file that executes the commands as though they were entered at the terminal. For information about executing .scr files, see JunosE System Basics Configuration Guide.

From Global Configuration mode:

! Configure the traffic-classes for video and voice. traffic-class voice exit traffic-class video exit ! Create the byte-adjustment QoS parameter definition. qos-parameter-define byte-adjustment application qos-byte-adjustment controlled-interface-type vlan controlled-interface-type ip exit ! Create the cell-mode QoS parameter definition. qos-parameter-define cell-mode application qos-cell-mode
controlled-interface-type vlan controlled-interface-type ip exit ! Configure the vc1 and vc2 scheduler profiles. scheduler-profile vc1 shared-shaping-rate 10000000 burst 10 milliseconds exit scheduler-profile voice shaping-rate 100000 burst 10 milliseconds exit scheduler-profile video shaping-rate 8000000 burst 10 milliseconds exit scheduler-profile vc2 shaping-rate 1000000 burst 10 m exit ! Add the scheduler profiles to the vc1 QoS profile. qos-profile vc1 vlan node scheduler-profile vc1 vlan queue traffic-class voice schedule-profile voice vlan queue traffic-class video schedule-profile video exit qos-profile vc2 vlan node scheduler-profile vc2 ! Configure the byte adjustment for VLAN1 and VLAN2. interface gigabitEthernet 6/0/0 encapsulation vlan interface gigabitEthernet 6/0/0.1 vlan id 1 qos-parameter byte-adjustment -28 qos-parameter cell-mode 1 qos-profile vc1 interface gigabitEthernet 6/0/1.1 vlan id 2 qos-parameter byte-adjustment -2 qos-parameter cell-mode 1 qos-profile vc2

#### Related Documentation

- Cell Shaping Mode Using QoS Parameters Overview