This document describes the TOS/DiffServe feature. It has the following sections:
Introducing TOS/DiffServe
How DiffServe Works
DiffServe Configuration Tips
Example DiffServe Configuration
Steps to Implement Example DiffServe Policy
New and Modified IP Filter Commands
Introducing TOS/DiffServe
The purpose of TOS/DiffServe is to provide a means for IP routers and hosts to differentiate among various classes of IP traffic in order to control Quality of Service (QOS) characteristics such as latency, bandwidth, and packet dropping strategies. QOS lets you provide different service levels for different types of traffic.
The term TOS/DiffServe refers to the definition and interpretation of the field in the IP header originally called Type of Service (TOS) and more recently redefined as the DiffServe Code Point (DSCP) field.
RFC Compliance
OpenROUTE software provides a useful set of features that conform to the DiffServe RFCs for the purpose of providing multiple levels of service quality to data arriving at and exiting the router.
OpenROUTE software supports the differentiated services that the following RFCs require.
[ARCH] An Architecture for Differentiated Services, RFC 2475, December 1998.
[DSFIELD] Definition of the Differentiated Services Field (DS Field), RFC 2474, December 1998.
How DiffServe Works
The IP Dynamic Filters (IPDF) and Bandwidth Reservation System (BRS) features support the DiffServe concept.
IPDF can detect and rewrite the TOS/DiffServe field in the IP header. IPDF provides syntax for treating the old-style, 3-bit Precedence field (PREC), as well as syntax for treating the 6-bit DiffServe field (DSCP). The Precedence field is also called the Class Selector (CS).
BRS lets you allocate the bandwidth of an interface among a number of user-defined classes. BRS uses these classes to apply preferred treatment to some packets over others. BRS can use buffer tags assigned in IPDF to assign packets to its traffic classes.
DIR: Direction (inbound, outbound, or both)
PROTOCOL: Protocol (TCP, UDP, ICMP, etc.)
PTYPE: Recognizes some specific TCP and ICMP packet types.
SA or SOURCE: Source IP address
DA or DESTINATION: Destination IP address
SPORT: Source port number
DPORT: Destination port number
isPREC: Precedence value (Class Selector)
isDSCP: DSCP value, also called Codepoint
isTAG: recognizes packets the IPDF previously Tagged
DSCP: rewrite 6-bit DSCP (codepoint) value
PREC: rewrite 3-bit Precedence value (the Class Selector subset of DSCP)
Marking inbound packets is appropriate for interfaces where the peer sending the packet is not trusted, and the DSCP field needs to be rendered consistent with the router's operational policy.
Marking outbound packets is useful when the router is at the border of a network and must alter the DSCP field to meet the policies of the targeted peer in another DiffServe domain.
PassPass inbound packets to the routing engine and outbound packets to the transmitting interface. Does not compare the packet to any other filters.
IgnoreDoes not make a decision about passing or blocking the packet. The software continues to compare the packet to other filters in the profile.
BlockDrops the packet and does not compare the packet to any other filters.
The LOCAL class is for packets the router itself generates. Its purpose is the reservation of bandwidth for routing protocols and other administrative traffic that originates on the router. It permits the router to do its job even in the face of overloaded interfaces.
The DEFAULT class is the classic "best effort" service. Any packet not assigned to a user-defined class or the LOCAL class is assigned to the DEFAULT class.
For inbound traffic, IPSec processes the traffic first so that filters are applied to the inner IP packet after IPSec encapsulation is removed.
For outbound traffic, IP filters are applied to a packet before IPSec processes the packet. Thus, IPSec protection is wrapped around packets.

Real-time traffic, including Voice over IP (VoIP) traffic, is authorized to use the EF codepoint.
IP Precedence of 5 is assigned to voice traffic to provide preferred treatment to that traffic.
Default IP Precedence of zero (0) is assigned to all other traffic.
The following illustration shows how these profiles are applied to the router interfaces in Domain One.

of 46.
Note that all time-critical traffic to and from the Voice module is in UDP packets, which are the only significant use of UDP packets the Voice
module has.
The mark_local profile has the following filters:

Profile mark_foreign
The mark_foreign profile resides on the PPP WAN link. It is used to translate our neighbor network's TOS-based scheme into our own DiffServe scheme. Note that on outbound rules, if the packet has DSCP of zero, its PREC is already zero, as PREC is just the first 3 bits of DSCP.
The mark_foreign profile has the following filters:

Profile classifier
The classifier profile resides on all interfaces. It appears after the mark_local and mark_foreign profiles have marked packets' DSCP.
The classifier profile assigns buffer tags to packets. Buffer tags have only local meaning within the OpenROUTE software. The BRS feature uses the tags to assign packets to BRS traffic classes which, in turn, provide the differential treatment required by DiffServe. Receiving interfaces automatically untag buffers.
The filters in this profile tag all default traffic with tag 1 and tag all EF traffic with tag 10.
The classifier profile has the following filters:

Profile trace
The trace profile contains a filter that causes the Event Logging System (ELS) to generate messages. It resides on all router interfaces, and it appears after the marking and classifying profiles.
You can use trace to log the flow of packets through the system and to observe changes in DSCP and tag values. This is useful for debugging and verification operations.
Since trace can potentially generate vast amounts of ELS messages, it is usually useful only under controlled conditions. Its definition is included here to demonstrate the tracing of DSCP and tag values using ELS. You can disable these messages in IPDF without removing the filter from the active configuration. To do so, use the set filter trace.dump els = off command.
The trace profile has the following filters:

Profile firewall
The firewall profile is the place to put any rules that block or pass traffic according to a security policy.
For our example, the security policy admits all traffic. It resides on all router interfaces and it is the last profile attached to each interface. It is necessary because the default behavior for a profile is to Block (discard) packets that do not match a filter that has the action Pass.
The firewall profile's rules are to pass all inbound packets on to the router's forwarder, and pass all outbound packets on to the router's transmitters.
The firewall profile has the following filters:

Assigning Profiles to Interfaces
This section shows how to attach the profiles in the previous section to each interface.
To Interface 0, the local LAN interface, assign profiles in this order:
Assign 40% bandwidth to the DEFAULT class with NORMAL priority. Untagged traffic is queued in the DEFAULT class.
Add a class called EF and assign the remaining 50% bandwidth to the EF class.
Assign TAG10 to the EF class and assign a HIGH priority to the class, thus giving the traffic tagged with buffer tag 10 the preferential treatment our policy requires.
Entering Commands
It is wise to save a backup of the configuration in either the router's local memory or on an external TFTP server before you change your configuration. You can do so at the Boot configuration prompt.
Config>boot
TFTP Boot/dump configuration
Boot config>
Config> prompts so that service is not interrupted while you are entering the new configuration. Your new configuration does not take affect until you restart the router.
Monitor> prompts, but each change takes effect immediately, possibly affecting the operation of the router adversely. Once a configuration is up and running, using the MONITR process to make minor alterations is useful.
If you do enter commands at the Monitor> prompts, be sure to save each subsystem's changes before restarting the router, or they will be lost. If you are working in the Monitor process, you can revert to your saved configuration using the revert command or by restarting the router without first saving your changes.
0) Ethernet LAN,
1) PPP WAN to the neighbor network, and
2) Internal Voice module. The Voice module in this example uses IP address 192.168.1.10.
*config
Config>PROTOCOL ip
Internet protocol user configuration
IP config>filters
IP Filters Config>
IP Filters Config>add profile mark_local
IP Filters Config>add filter mark_local.dscp dir=in isdscp = 0-45,47-63 dscp=0 action=ignore
IP Filters Config>add filter mark_local.from_voice dir = in
sa = 192.168.1.10 protocol = udp dscp = 46 action = Ignore
IP Filters Config>add filter mark_local.to_voice dir = in
da = 192.168.1.10 protocol = udp dscp = 46 action = Ignore
IP Filters Config>add profile mark_foreign
IP Filters Config>add filter mark_foreign.from_prec5 dir=in isprec=5 dscp=46 action=Ignore
IP Filters Config>add filter mark_foreign.not_ef dir=in isprec=0-4,6-7 dscp=0 action=ignore
IP Filters Config>add profile classifier
IP Filters Config>add filter classifier.default dir=out tag=1 action=Ignore
IP Filters Config>add filter classifier.ef dir=out isdscp=46 tag=10 action=Ignore
IP Filters Config>add profile firewall
IP Filters Config>add filter firewall.null dir=both action=pass
IP Filters Config>add profile trace
The text in this ELS message shows the following information about each packet: the interface number on which the packet arrived, the direction, source address and port number, destination address and port number, the buffer tag value, and the DCSP value.
IP Filters Config>add filter trace.dump dir=both els=1 action=ignore elstext="DUMP: %i-%d %:a --> %:A TAG=%g DS=%C"
IP Filters Config>set interface 0 profiles = mark_local,classifier,trace,firewall
IP Filters Config>set interface 1 profiles =mark_foreign,classifier,trace,firewall
IP Filters Config>set interface 2 profiles = mark_local,classifier,trace,firewall
*config
Gateway user configuration
Config>network 0
Ethernet interface configuration
ETH config>brs
Bandwidth Reservation User Configuration
BRS Config <Ethernet1> enable
Please restart router for this command to take effect.
BRS Config <Ethernet1> exit
ETH config>exit
Config>
Config>NETWORK 1
Circuit Configuration
Circuit Config <NET-1> brs
Bandwidth Reservation User Configuration
BRS Config <WAN1> enable
Please restart router for this command to take effect.
BRS Config <WAN1> exit
Circuit Config <NET-1> exit
Config>
Config>NETWORK 2
Circuit Configuration
Circuit Config <NET-2> brs
Bandwidth Reservation User Configuration
BRS Config <NET-2> enable
Please restart router for this command to take effect.
BRS Config <WAN2> circuit
Circuit to reserve bandwidth [16]?
BRS Config <dlci 16>enable
Please restart router for this command to take effect.
BRS Config <dlci 16>exit
BRS Config <WAN2> exit
Circuit Config <NET-2> exit
Config>
Config> <
CTRL-P>*restart
Are you sure you want to restart the gateway? (Yes or [No]): yes
Note: Class names are case sensitive.
Config>NETWORK 0
Ethernet interface configuration
ETH config>brs
Bandwidth Reservation User Configuration
BRS Config <Ethernet1> add-class EF 50
BRS Config <Ethernet1> assign TAG10 EF high
BRS Config <Ethernet1> change-class DEFAULT 40
BRS Config <Ethernet1> default-class DEFAULT normal
BRS Config <Ethernet1> exit
ETH config>exit
Config>
Config>NETWORK 1
Ethernet interface configuration
ETH config>brs
Bandwidth Reservation User Configuration
BRS Config <Ethernet2> add-class EF 50
BRS Config <Ethernet2> assign TAG10 EF high
BRS Config <Ethernet2> change-class DEFAULT 40
BRS Config <Ethernet2> default-class DEFAULT normal
BRS Config <Ethernet2> exit
ETH config>exit
Config>
Config>NETWORK 2
Circuit Configuration
Circuit Config <NET-2> brs
Bandwidth Reservation User Configuration
BRS Config <WAN2> assign-circuit 16 DEFAULT
BRS Config <WAN2> change-circuit-class DEFAULT 90
BRS Config <WAN2> circuit
Circuit to reserve bandwidth [16]?
BRS Config <dlci 16>add-class EF 50
BRS Config <dlci 16>assign TAG10 EF high
BRS Config <dlci 16>change-class DEFAULT 40
BRS Config <dlci 16>default-class DEFAULT normal
BRS Config <dlci 16>exit
BRS Config <WAN2> exit
Circuit Config <NET-2> exit
Config>
Config>event
Event Logging System user configuration
ELS config>display event flt.11
ELS config> display subsystem flt all
ELS config> display subsystem brs all
Remember, enabling lots of ELS messages can generate a lot of message output. The router discards messages that overflow its message buffer, so such broad message enabling is useful only in controlled situations.
*restart Are you sure you want to restart the gateway? (Yes or [No]): yesConfig> <CTRL-P>
*config
Config>PROTOCOL ip
Internet protocol user configuration
IP config>filters
IP Filters Config>list interface
Listing Interface Information
Interface Attached Profiles
--------------------------------
0 mark_local
classifier
trace
firewall
1 mark_foreign
classifier
trace
firewall
2 mark_local
classifier
trace
firewall
Listing Filters Attached to Interface 0
Name Dir Address Port Protocol Idle
Action
-----------------------------------------------------------------------
mark_local.dscp In isDscp=0-45 Any dscp=0 Off
isDscp=47-63 Ignore
mark_local.voice In sa=192.168.1.10 UDP dscp=46
da=192.168.1.10 Ignore Off
classifier.default Out Any Tag=1 Off
Ignore
classifier.ef Out isDscp=46 Any Tag=10 Off
Ignore
trace.dump Both Any Ignore Off
ELS Event=1
ELS Text="Dump: %i-%d %:a --> %:A TAG=%g DS=%C"
firewall.null Both Any Pass Off
Listing Filters Attached to Interface 1
Name Dir Address Port Protocol Idle
Action
-----------------------------------------------------------------------
mark_foreign.from_prec5 In isPrec=ExpressFwd(5) Any dscp=46
Ignore Off
mark_foreign.not_ef In isPrec=0-4 Any dscp=0 Off
isPrec=6-7 Ignore
mark_foreign.to_prec5 Out isDscp=46 Any Prec=Express
Fwd(5) Ignore Off
classifier.default Out Any Tag=1 Off
Ignore
classifier.ef Out isDscp=46 Any Tag=10 Off
Ignore
trace.dump Both Any Ignore Off
ELS Event=1
ELS Text="Dump: %i-%d %:a --> %:A TAG=%g DS=%C"
firewall.null Both Any Pass Off
Listing Filters Attached to Interface 2
Name Dir Address Port Protocol Idle
Action
-----------------------------------------------------------------------
mark_local.dscp In isDscp=0-45 Any dscp=0 Off
isDscp=47-63 Ignore
mark_local.from_voice In sa=192.168.1.10 UDP dscp=46
Ignore Off
mark_local.to_voice In da=192.168.1.10 UDP dscp=46
Ignore Off
classifier.default Out Any Tag=1 Off
Ignore
classifier.ef Out isDscp=46 Any Tag=10 Off
Ignore
trace.dump Both Any Ignore Off
ELS Event=1
ELS Text="Dump: %i-%d %:a --> %:A TAG=%g DS=%C"
firewall.null Both Any Pass Off
BRS Config <Ethernet1> list
BANDWIDTH RESERVATION listing from SRAM
bandwidth reservation is enabled
interface number 0
maximum queue length 10 minimum queue length 3
total bandwidth allocated 100%
total classes defined (counting one local and one default) 3
class LOCAL has 10% bandwidth allocated
protocols and filters cannot be assigned to this class.
class DEFAULT has 40% bandwidth allocated
the following protocols and filters are assigned:
protocol IP with default priority
protocol ARP with default priority
class EF has 50% bandwidth allocated
the following protocols and filters are assigned:
filter TAG10 with priority HIGH
elstext
This elstext option is enhanced to support variables related to DiffServe.
When you set up a filter to generate an ELS message, you can include text to describe the event.
You can use the following variables in the text. When the software generates an ELS message, it substitutes the variable with the actual information. Be sure to put double quotation marks around the text.
add filter external.in elsevent=8 elstext= "packet from %a
going to %A blocked"When this filter recognizes a packet, it generates a message similar to this:
FLT.018 IPDF-8 packet from 128.185.22.2 going to 162.1.1.8 blocked
| Enter . . . | To . . . |
|---|---|
| isdscp= | Replace the existing isdscp setting. |
| isdscp+= | Add one or more values to the current setting. |
| isdscp-= | Remove one or more values from the current setting. |
add filter External.Client isdscp = 1-45,47-63
| Entry | Description |
|---|---|
| number | One number. |
| number-number | A range of numbers. |
| list | A comma-separated list of numbers and/or ranges of numbers. |
dscp
Modifies the DSCP field of packets that match this filter. The dscp option changes the value of the entire TOS/DiffServe field. To change just the precedence field, which makes up the first three bits of the TOS/DiffServe field, use the prec option.
add filter External.Client dscp=1
| Enter . . . | To . . . |
|---|---|
| isprec= | Replace the existing isprec setting. |
| isprec+= | Add one or more precedence to the current setting. |
| isprec-= |
Remove one or more precedence from the current setting.
Notes:
|
Example:
set filter External.Client isprec = ExpressFwd(5)set filter External.Client isprec = 1-4,7 prec
Modifies the value of the packet precedence field with the value you enter here. The precedence field makes up the first three bits of the DiffServe field. To change the value of the entire TOS/DiffServe field, use the dscp option.
| Enter . . . | To . . . |
|---|---|
| prec= | Replace the existing prec setting. |
| prec-= |
Remove the exiting precedence setting.
Notes:
|
set filter External.Client prec = Class4(4)
| Entry | Description |
|---|---|
| number | One precedence number. |
| name | The name of a well-known precedence name. Below is a list of well-known names. |