Configuring Byte Count 972

Configure the byte-count queues carefully, because if the setting is too high, the algorithm will
take longer than necessary to move from one queue to the next. This is not a problem while the
processor empties the queue, but if it takes the processor too long to get back to other queues,
they could fill up and start to drop packets.
This is why it’s important to understand how to configure the bandwidth percentage relationship
by using the byte-count command. Because frame sizes vary from protocol to protocol,
you’ll need to know the average frame sizes of the protocols using the custom queued interface to
define the byte count efficiently. You can do this by using simple math.
Suppose you have a router that uses IP, IPX, and SNA as its protocols. Let’s arbitrarily assign
frame sizes, realizing that the values aren’t the real ones. Assign a frame size of 800 bytes to IP,
1,000 bytes to IPX, and 1,500 bytes to SNA. You calculate a simple ratio by taking the highest
frame value and dividing it by the frame size of each protocol:
IP = 1,500 ÷ 800 = 1.875
IPX = 1,500 ÷ 1,000 = 1.5
SNA = 1,500 ÷ 1,500 = 1.0
These values equal your frame size ratios. To assign correct bandwidth percentages, multiply
each ratio by the bandwidth percentage you want to assign to that protocol. For example, assign
40 percent to IP, 30 percent to IPX, and 30 percent to SNA:
IP = 1.875 × (0.4) = 0.75
IPX = 1.5 × (0.3) = 0.45
SNA = 1 × (0.3) = 0.30
These values now need to be normalized by dividing the results by the smallest value:
IP = 0.75 ÷ 0.3 = 2.5
IPX = 0.45 ÷ 0.3 = 1.5
SNA = 0.3 ÷ 0.3 = 1
Custom queuing will send only complete frames. Because the ratios are fractions, you must
round them up to the nearest integer values that maintain the same ratio. To arrive at the nearest
integer value, multiply the original ratios by a common number that will cause the ratios to
become integers. In this case, you can multiply everything by 2 and get the resulting ratio of
5:3:2. What does this mean? Well, five frames of IP, three frames of IPX, and two frames of SNA
will be sent. Because of the protocols’ varying frame size, the bandwidth percentage works out
just the way you calculated:
IP = 5 frames × 800 bytes = 4,000 bytes
IPX = 3 frames × 1,000 bytes = 3,000 bytes
SNA = 2 frames × 1,500 bytes = 3,000 bytes
Total bandwidth is 10,000 bytes. Percentages are verified by dividing the protocol rate
by the total. After doing the math, you verify that IP = 40 percent, IPX = 30 percent, and
SNA = 30 percent.
Now that the byte count has been calculated (4,000, 3,000, and 3,000), you can apply the
results in the queue-list command. The custom queuing algorithm will forward 4,000 bytes
worth of IP packets, move to the IPX queue and forward 3,000 bytes, and then go to the SNA
queue and forward 3,000 bytes.
The following queue list does not follow the IP, IPX, and SNA example we’ve
been discussing.

See the following example on how to configure and apply custom queuing lists:
Router_B#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router_B(config)#queue-list 1 interface Ethernet0 1
Router_B(config)#queue-list 1 protocol ip 2 tcp 23
Router_B(config)#queue-list 1 protocol ip 3 tcp 80
Router_B(config)#queue-list 1 protocol ip 4 udp snmp
Router_B(config)#queue-list 1 protocol ip 5
Router_B(config)#queue-list 1 default 6
Router_B(config)#queue-list 1 queue 1 limit 40
Router_B(config)#queue-list 1 queue 5 byte-count 4000
Router_B(config)#queue-list 1 queue 4 byte-count 500
Router_B(config)#queue-list 1 queue 3 byte-count 4000
Router_B(config)#queue-list 1 queue 2 byte-count 1000
Router_B(config)#interface serial0
Router_B(config-if)#custom-queue-list 1
Router_B(config-if)#^Z
Router_B#
After analyzing the list, you can see that six queues were configured. The first one was configured
to handle incoming traffic from interface Ethernet 0, and the second is reserved for
Telnet traffic. Queue number 3 is configured for WWW traffic, and the fourth is configured
to handle SNMP traffic. The fifth queue will handle all other IP traffic, while queue number 6
is set up as the default queue where all unspecified traffic will go. A limit of 40 packets was
placed on queue 1 (from the default of 20), and the byte count was changed from the default
value of 1,500 for queues 2, 3, 4, and 5. Finally, after the queue list was created, it was applied
to interface serial 0.
Here is what the configuration looks like:
!
interface Serial0
ip address 10.1.1.1
255.255.255.0
custom-queue-list 1
!
queue-list 1 protocol ip 2 tcp telnet
queue-list 1 protocol ip 3 tcp www
queue-list 1 protocol ip 4 udp snmp
queue-list 1 protocol ip 5
queue-list 1 default 6
queue-list 1 interface Ethernet0 1
queue-list 1 queue 1 limit 40

queue-list 1 queue 2 byte-count 1000
queue-list 1 queue 3 byte-count 4000
queue-list 1 queue 4 byte-count 500
queue-list 1 queue 5 byte-count 4000
As with the other queuing algorithms, you need to verify both the configuration and the
status of custom queuing. Issuing the same command as before, except this time substituting
custom for priority, produces the following output:
Router_B#show queueing custom
Current custom queue configuration:
List Queue Args
1 6 default
1 1 interface Ethernet0
1 2 protocol ip tcp port telnet
1 3 protocol ip tcp port www
1 4 protocol ip udp port snmp
1 5 protocol ip
1 1 limit 40
1 2 byte-count 1000
1 3 byte-count 4000
1 4 byte-count 500
1 5 byte-count 4000
Router_B#
This output information gives you a breakdown of the custom queue lists configured
on the device, detailing queue assignments and any limits or byte counts assigned to each
custom queue.

Configuring Custom Queuing

Configuring custom queuing is similar to configuring priority queuing, but instead of completing
three tasks, you must complete five. As with priority queuing, you have to configure a list
to separate types of incoming traffic into their desired queues. After that, you must configure a
default queue for the traffic that will be unassigned to any of the other queues. After the specific
and default queues are defined, you can adjust the capacity or size of each queue or just stick
with the default settings.
When that’s complete, specify the transfer rate, or byte count, for each queue. This is important—
the byte count determines the percentage of bandwidth reserved for a specified queue, with a default
of 1,500 bytes as the denominator. After these parameters are set, apply them to an interface.
The commands used to configure the queuing list, default queue, queue size, and transmit
rate follow:
queue-list list-number default queue-number
queue-list list-number interface interface-type interface-number queue-number
queue-list list-number lowest-custom queue-number
queue-list list-number protocol protocol-name queue-number queue-keyword
keyword-value
queue-list list-number queue [queue-number byte-count byte-count-number | limit
limit-number]
queue-list list-number stun [queue-number | address STUN-group-number]
The syntax can be presented in many ways to configure the desired command. The listnumber
is a value from 1 to 16 and associates the list with the given number. The following are
available options:
default The default option designates a custom queue for packets that do not match another
queue-list.
interface The interface option assigns incoming packets on the specified interface to a
custom queue. When the interface option is specified, you must supply the interfacetype
and interface-number as well. The interface-type is the type of physical interface,
and interface-number is the interface’s physical port.
lowest-custom The lowest-custom option specifies the lowest queue number considered a
custom queue.
protocol The protocol option indicates that the packets are to be sent to the custom queue
if they are of the protocol specified. The protocol option also requires additional information.
Obviously, the protocol-name must be specified. In Table 30.1, a sample of available protocol
names is listed, but available protocols are dependent upon the feature set and version of IOS.
After the protocol-name, you might supply the keyword-value to refine the protocols and
port numbers used for filtering.
queue The queue option allows for specific queue parameters to be configured. The parameters
for the queue are discussed later in this section.
stun The stun option establishes queuing priority for STUN packets.
TABLE 3 0 . 1 Sample of Available Protocol Names
Protocol Name Description
aarp AppleTalk ARP
apollo Apollo
appletalk AppleTalk
arp IP ARP
bridge Bridging
bstun Block Serial Tunnel
cdp Cisco Discovery Protocol
compressedtcp Compressed TCP
decnet DECnet
decnet_node DECnet Node
decnet_router-l1 DECnet Router L1
decnet_router-l2 DECnet Router L2

To define the operational parameters for the custom queues, you use the queue option. After
specifying the queue-number, you’re given two parameters to configure:
limit The limit parameter enables you to change the number of packets allowed in the queue.
The range is from 0 to 32,767, with the default being 20.
byte-count The byte-count parameter specifies the average number of bytes forwarded from
each queue during a queue cycle.

Custom Queuingz

Custom queuing functions on the concept of sharing bandwidth among traffic types. Instead of
assigning a priority classification to a specific traffic or packet type, custom queuing forwards
traffic in the different queues by using the FIFO method within each queue. Custom queuing
offers the ability to customize the amount of actual bandwidth that a specified traffic type uses.
While remaining within the limits of the physical line’s capacity, virtual pipes are configured
through the custom queuing option. Varying amounts of the total bandwidth are reserved for various
specific traffic types, and if the bandwidth isn’t being fully utilized by its assigned traffic type,
other types can borrow its bandwidth. The configured limits go into effect during high levels of
utilization or when congestion on the line causes different traffic types to compete for bandwidth.
Figure 30.5 shows each queue being processed, one after the other. After this begins, the
algorithm checks the first queue, processes the data within it, and then moves to the next—if it
comes across an empty one, it will simply move on to the next one without hesitating. Each
queue’s byte count specifies the amount of data that will be forwarded from that queue, which
directs the algorithm to move to the next queue after it has been reached. Custom queuing permits
a maximum of 16 configurable queues. The system queue is for network specific traffic,
including system datagrams such as SNMP and routing updates.
FIGURE 3 0 . 5 Custom queuing algorithm
S0
High priority
(keepalives)
Custom queue
list for S0
20 entries
Default
2
1
0 (System)
Deliver x number
of bytes per cycle
3
14
15
16
Figure 30.6 shows how the bandwidth allocation via custom queuing looks relative to the
physical connection. Using the frame size of the protocols and configuring the byte count for
each queue will configure appropriate bandwidth allocations for each traffic type. In other
words, when a particular queue is being processed, packets are sent until the number of bytes
sent exceeds the queue byte count defined

Verifying Priority Queuing

To make sure the queuing configuration is working and configured properly, you can use the
same command used to verify WFQ with the added option for priority queuing.
The following command output summarizes the preceding configured priority list:
Router_C#show queueing priority
Current priority queue configuration:
List Queue Args
1 high protocol ip gt 1000
1 low protocol ip lt 256
1 normal protocol ip
1 normal interface Serial1
1 high interface Ethernet0
1 high limit 40
1 medium limit 80
1 normal limit 120
1 low limit 160
Router_C#

Configuring Priority Queuing network

Implementing priority queuing on an interface requires three steps:
1. Create a priority list that the processor will use to determine packet priority.
2. Adjust the size of the queues if desired.
3. Apply the priority list to the desired interfaces.
Let’s go over how to build a priority list by using the following commands:
priority-list list-number protocol protocol-name] {high | medium | normal | low}
queue-keyword keyword-value
priority-list list-number interface interface-type {high | medium | normal | low}
The list-number parameter identifies the specific priority list, and the valid values are
1 through 16. The protocol parameter directs the router to assign packets to the appropriate
queue based on the protocol, and protocol-name defines which protocol to match.
The queue-keyword and keyword-value parameters enable packets to be classified by
their byte count, access list, protocol port number, or name and fragmentation. With the
interface parameter, any traffic coming from the interface is assigned to the specified
queue. Next, after specifying the protocol or interface, the type of queue needs to be
defined—high, medium, normal, or low.
priority-list list-number default queue-number
The same priority-list command can be used to configure a default queue for traffic that
doesn’t match the protocols or interfaces defined in the priority list.
priority-list list-number queue-limit [high-limit [medium-limit [normal-limit
[low-limit]]]]
The queue-limit parameter is used to specify the maximum number of packets allowed
in each of the priority queues. The configuration of the queue size must be handled carefully,
because if a packet is forwarded to the appropriate queue but the queue is full, the packet will
be discarded—even if bandwidth is available. This means that enabling priority queuing on an
interface can be useless (even destructive) if queues aren’t accurately configured to respond to
actual network needs. It’s important to make the queues large enough to accommodate congestion
so that the influx of packets can be accepted and stored until they can be forwarded.
After creating the priority list, you can apply that list to an interface in interface configuration
mode with the following command:
priority-group list
The list parameter is the priority list number, from 1 to 16, to use on this interface. After
the list is applied to the interface, it is implicitly applied to outbound traffic. All packets will be
checked against the priority list before entering their corresponding queue. The ones that don’t
match will be placed in the default queue. Here’s an example:
Router_C#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router_C(config)#priority-list 1 protocol ip high gt 1000
Router_C(config)#priority-list 1 protocol ip low lt 256
Router_C(config)#priority-list 1 protocol ip normal
Router_C(config)#priority-list 1 interface serial 1 normal
Router_C(config)#priority-list 1 interface ethernet 0 high
Router_C(config)#priority-list 1 default normal
Router_C(config)#priority-list 1 queue-limit 40 80 120 160
Router_C(config)#interface serial 0
Router_C(config-if)#priority-group 1
Router_C(config-if)#^Z
Router_C#
The first line of the priority list assigns high priority to all IP traffic with a packet size greater
than (gt) 1,000 bytes. The second line assigns low priority to IP traffic with a packet size less
than (lt) 256 bytes. The third line assigns all remaining IP traffic to the normal queue. The
fourth line assigns all incoming traffic on serial 1 to the normal queue also. All incoming traffic
on Ethernet 0 is assigned a high priority, and any remaining traffic will be assigned normal priority.
The size of each queue is defined by the queue-limit parameter, and the numbers follow
the order of high, medium, normal, and low queue sizes.
Following is an example of what the interface configuration looks like. The priority list has
been assigned to the interface with the priority-group command. You can see the final form
of the applied priority list in the following configuration snippet:
!
interface Serial0
ip address 172.16.40.6 255.255.255.252
priority-group 1
!
priority-list 1 protocol ip high gt 1000
priority-list 1 protocol ip low lt 256
priority-list 1 protocol ip normal
priority-list 1 interface Serial1 normal
priority-list 1 interface Ethernet0 high
priority-list 1 queue-limit 40 80 120 160
As with access control lists, the order of a matching packet is important. A 1,500-byte packet
on Serial 0 would match the first and fourth lines, but would only be queued by the first instruction,
placing it in the high-priority queue.

Assigning Priorities

Priority queuing uses the packet header information consisting of either the TCP port or the
protocol as a classification mechanism. When a packet enters the router, it’s compared against
a list that will assign a priority to it and forward it to the corresponding queue.
Priority queuing can assign a packet to one of four priorities—high, medium, normal, and
low—with a separate dispatching algorithm to manage the traffic in all four. Figure 30.4 shows
how these queues are serviced. You can see that the algorithm starts with the high-priority
queue processing all the data there. When that queue is empty, the dispatching algorithm moves
down to the medium-priority queue, and so on down the priority chain, performing a cascade
check of each queue before moving on. So if the algorithm finds packets in a higher priority
queue, it will process them first before moving on. This is where problems can develop; packets
in the lower priority queues could be totally neglected in favor of the higher priority ones if
they’re continually busy with the arrival of new packets.

Priority Queuing

Unlike weighted fair queuing, which occurs on a session basis, priority queuing occurs on a packetby-
packet basis and is ideal in network environments that carry time-sensitive traffic. When congestion
occurs on low-speed interfaces, priority queuing guarantees that traffic assigned a high priority
will be sent first. On the negative side, if the queue for high-priority traffic is always full and monopolizing
bandwidth, packets in the other queues will be severely delayed or dropped.

Verifying Weighted Fair Queuing

Now that WFQ is configured on the router’s serial 0 interface, let’s see what it’s doing. To verify the
configuration and operation of the queuing system, you can issue the following two commands:
show queueing [fair | priority | custom]
show queue [
interface-type interface-number
]
Results from these commands on Router C can be seen next. Since WFQ is the only type
of queuing that’s been enabled on this router, it isn’t necessary to issue the optional commands
of
fair
,
custom
, or
priority
.
Router_C#
show queueing
Current fair queue configuration:
Interface Discard Dynamic Reserved
threshold queue count queue count
Serial0 96 256 0
Serial1 64 256 0
Current priority queue configuration:
Current custom queue configuration:
Current RED queue configuration:
Router_C#
This command shows that WFQ is enabled on both serial interfaces and that the discard
threshold for serial 0 was changed from 64 to 96. There’s a maximum of 256 dynamic queues
for both interfaces—the default value. The lines following the interface information are empty
because their corresponding queuing algorithms haven’t been configured yet.
The next command displays more detailed information pertaining to the specified interface:
Router_C#
show queue serial0
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/96/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
This command displays the input queue information, which is the current size of the queue,
the maximum size of the queue, and the number of conversations that have been dropped. The
queuing strategy is defined as weighted fair, or WFQ. The output queue (usually the one with
the most activity) defines the current size, the maximum total number of output queue entries, the
number of conversations per queue, and the number of conversations dropped. The conversations
section represents the number of conversations in the queue. The active number describes the
number of current active conversations. The max active keeps a record of the maximum number
of active conversations at any one time, and max total gives the total number of all conversations
possible within the queue. Reserved queues are also displayed with the current number allocated
and maximum number of allocated queues.

Configuring Weighted Fair Queuing

You’re now ready to learn how to configure WFQ. For all interfaces having a line speed equal to
or lower than 2.048Mbps (E-1 speed), WFQ is on by default. Here’s an example of how WFQ is
configured on an interface. You can use the
fair-queue
command to alter the default settings:
Router_C#
config t
Enter configuration commands, one per line. End with CNTL/Z.
Router_C(config)#
interface serial0
Router_C(config-if)#
fair-queue 96
Router_C(config-if)#^
Z
Router_C#
To understand what was configured, look at the syntax of the command:
fair-queue
[
congestive-discard-threshold
[
dynamic-queues
[
reservable-queues
]]]
congestive-discard-threshold
This value specifies the number of messages allowed in each
queue. The default is 64 messages, with a range 16–4,096. When a conversation reaches this
threshold, new message packets will be dropped.
dynamic-queues
Dynamic queues are exactly that—queues established dynamically to handle
conversations that don’t have special requirements. The valid values for this parameter are 16,
32, 64, 128, 256, 512, 1024, 2048, and 4096, with the default value being 256; ISDN BRI has
a default of 16.
reservable-queues
This parameter defines the number of queues established to handle special
conversations. The available range is from 0 to 1,000. The default is 0. These queues are for
interfaces that use Resource Reservation Protocol (RSVP).