Configuring Virtual Channels
For J Series devices and SRX210, SRX240, and SRX650 devices, you can configure virtual channels, which allow you to limit traffic sent from a corporate headquarters to branch offices. Virtual channels might be required when the headquarters site has an expected aggregate bandwidth higher than that of the individual branch offices. The router at the headquarters site must limit the traffic sent to each of the branch office routers to avoid oversubscribing their links. For instance, if branch 1 has a 1.5-megabits per second (Mbps) link and the headquarters router attempts to send 6 Mbps to branch 1, all of the traffic in excess of 1.5 Mbps is dropped in the ISP network.
For information about which devices support the features documented in this chapter, see the JUNOS Software Feature Support Reference for SRX Series and J Series Devices.
This chapter discusses the following topics:
- Configuring CoS Virtual Channels
- Creating a List of Virtual Channel Names
- Defining a Virtual Channel Group
- Applying a Virtual Channel Group to a Logical Interface
- Selecting Traffic to Be Transmitted from a Particular Virtual Channel
- Example: Configuring Virtual Channels
Configuring CoS Virtual Channels
To limit the traffic the headquarters router sends to each branch, you can configure virtual channels on a logical interface. Each virtual channel has a set of eight queues with a scheduler and an optional shaper. You can use an output firewall filter to direct traffic to a particular virtual channel. For example, a filter can direct all traffic with a destination address for branch office 1 to virtual channel 1, and all traffic with a destination address for branch office 2 to virtual channel 2.
When you configure virtual channels on an interface, the virtual channel group uses the same scheduler and shaper you configure at the [edit interfaces interface-name unit logical-unit-number] hierarchy level. In this way, virtual channels are an extension of regular scheduling and shaping and not an independent entity.
Although a virtual channel group is assigned to a logical interface, a virtual channel is not the same as a logical interface. The only features supported on a virtual channel are queuing, packet scheduling, and accounting. Rewrite rules and routing protocols apply to the entire logical interface.
To configure virtual channels, you can include the following statements at the [edit class-of-service], [edit firewall], and [edit interfaces] hierarchy levels of the configuration:
Creating a List of Virtual Channel Names
To create a list of virtual channels that you can assign to a virtual channel group, include the virtual-channels statement at the [edit class-of-service] hierarchy level:
Defining a Virtual Channel Group
To define a virtual channel group that you can assign to a logical interface, include the virtual-channel-groups statement at the [edit class-of-service] hierarchy level:
virtual-channel-group-name can be any name that you want. virtual-channel-name must be one of the names that you define at the [edit class-of-service virtual-channels] hierarchy level. You can include multiple virtual channel names in a group.
The scheduler map is required. map-name must be one of the scheduler maps that you configure at the [edit class-of-service scheduler-maps] hierarchy level. For more information, see Configuring Schedulers.
The shaping rate is optional. If you configure the shaping rate as a percentage, when the virtual channel is applied to a logical interface, the shaping rate is set to the specified percentage of the interface bandwidth. If you configure a shaper on a virtual channel, the shaper limits the maximum bandwidth transmitted by that virtual channel. Virtual channels without a shaper can use the full logical interface bandwidth. If there are multiple unshaped virtual channels, they share the available logical interface bandwidth equally.
When you apply the virtual channel group to a logical interface, a set of eight queues is created for each of the virtual channels in the group. The scheduler-map statement applies a scheduler to these queues. If you include the shaping-rate statement, a shaper is applied to the entire virtual channel.
You must configure one of the virtual channels in the group to be the default channel. Therefore, the default statement is required in the configuration of one virtual channel per channel group. Any traffic not explicitly directed to a particular channel is transmitted by this default virtual channel.
Applying a Virtual Channel Group to a Logical Interface
To apply a virtual channel group to a logical interface, include the virtual-channel-group statement at the [edit class-of-service interfaces interface-name unit logical-unit-number] hierarchy level:
For the corresponding physical interface, you must also include the per-unit-scheduler statement at the [edit interfaces interface-name] hierarchy level:
The per-unit-scheduler statement enables one set of output queues for each logical interface configured under the physical interface.
When you apply a virtual channel group to a logical interface, the software creates a set of eight queues for each of the virtual channels in the group.
If you apply a virtual channel group to multiple logical interfaces, the software creates a set of eight queues on each logical interface. The virtual channel names listed in the group are used on all the logical interfaces. We recommend specifying the scheduler and shaping rates in the virtual channel configuration in terms of percentages, rather than absolute rates. This allows you to apply the same virtual channel group to logical interfaces that have different bandwidths.
When you apply a virtual channel group to a logical interface, you cannot include the scheduler-map and shaping-rate statements at the [edit class-of-service interfaces interface-name unit logical-unit-number] hierarchy level. In other words, you can configure a scheduler map and a shaping rate on a logical interface, or you can configure virtual channels on the logical interface, but not both.
If you configure multiple logical interfaces on a single physical interface, each logical interface is guaranteed an equal fraction of the physical interface bandwidth:
If one or more logical interfaces do not completely use their allocation, the other logical interfaces share the excess bandwidth equally.
If you configure multiple virtual channels on a logical interface, they are each guaranteed an equal fraction of the logical interface bandwidth:
If you configure a shaper on a virtual channel, the shaper limits the maximum bandwidth transmitted by that virtual channel. Virtual channels without a shaper can use the full logical interface bandwidth. If there are multiple unshaped virtual channels, they share the available logical interface bandwidth equally.
Selecting Traffic to Be Transmitted from a Particular Virtual Channel
To select the traffic to be transmitted by a particular virtual channel, include the virtual-channel statement at the [edit firewall family family-name filter filter-name term term-name then] hierarchy level:
The virtual-channel statement is a firewall action modifier. For more information about firewall action modifiers, see the Junos Policy Framework Configuration Guide.
Example: Configuring Virtual Channels
This configuration creates four virtual channels on the interface t3-1/0/0.0. Three of them (branch1-vc, branch2-vc, and branch3-vc) are shaped to 1.5 Mbps. The fourth virtual channel is the default (default-vc), and it is not shaped, so it can use the full interface bandwidth. The output filter on the interface sends all traffic with a destination address matching 192.168.10.0/24 to branch1-vc, and similar configurations are set for branch2-vc and branch3-vc. Traffic not matching any of the addresses goes to the default, unshaped virtual channel.