Поиск по этому блогу

16.07.2009

Что за.. Hierarchical Queueing Framework?

Ранее описывал пример использования иерархических очередей с применением политик. Что это такое можно прочитать здесь на доступном всем языке.
Хотелось бы еще раз повториться, но с описанием некоторой странной особенности, которую я себе никак не могу объяснить.
Имеется некий интерфейс, где скорость ограничена 10 Мбит/с
interface FastEthernet0/1/0
ip address 10.0.0.2 255.255.255.252
duplex auto
speed 10
service-policy output uplink

Политика выглядит следующим образом:
policy-map uplink
class EastNetwork
shape average 4000000
service-policy client.4Mbit
class class-default
fair-queue
policy-map client.4Mbit
class Realtime
priority percent 50
class Application
bandwidth percent 30
class V.signaling
bandwidth percent 1
class control
bandwidth percent 2
class class-default
fair-queue

Посмотрим, что получилось. Для класса Realtime должно быть выделено 50% = 2Мбит/с из имеющейся полосы в 4Мбит/с.
router#show policy-map interface fa0/1/0
FastEthernet0/1/0

Service-policy output: uplink

Class-map: EastNetwork (match-all)
17606674 packets, 8129896029 bytes
30 second offered rate 620000 bps, drop rate 0 bps
Match: access-group name EastNetwork
Queueing
queue limit 64 packets
(queue depth/total drops/no-buffer drops) 0/19782/0
(pkts output/bytes output) 17586891/8100697882
shape (average) cir 4000000, bc 16000, be 16000
target shape rate 4000000

Service-policy : client.4Mbit

queue stats for all priority classes:
Queueing
queue limit 64 packets
(queue depth/total drops/no-buffer drops) 0/0/0
(pkts output/bytes output) 7938196/1427751077

Class-map: Realtime (match-all)
7938196 packets, 1427751077 bytes
30 second offered rate 105000 bps, drop rate 0 bps
Match: protocol rtp
Priority: 50% (2000 kbps), burst bytes 50000, b/w exceed drops: 0
...

Все корректно. Теперь необходимо в политику uplink добавить еще один класс.
policy-map uplink
class EastNetwork
shape average 4000000
service-policy client.4Mbit
class WestNetwork
shape average 384000
service-policy client.384k
class class-default
fair-queue
policy-map client.386K
class Realtime
priority percent 70
class V.signaling
bandwidth percent 4
class class-default
fair-queue

Смотрим результат
router#show policy-map interface fa0/1/0
FastEthernet0/1/0

Service-policy output: uplink

Class-map: EastNetwork (match-all)
132401 packets, 34674598 bytes
30 second offered rate 275000 bps, drop rate 0 bps
Match: access-group name EastNetwork
Queueing
queue limit 64 packets
(queue depth/total drops/no-buffer drops) 0/71/0
(pkts output/bytes output) 132330/34567104
shape (average) cir 4000000, bc 16000, be 16000
target shape rate 4000000

Service-policy : client.4Mbit

queue stats for all priority classes:
Queueing
queue limit 64 packets
(queue depth/total drops/no-buffer drops) 0/0/0
(pkts output/bytes output) 81843/6056382

Class-map: Realtime (match-all)
81843 packets, 6056382 bytes
30 second offered rate 88000 bps, drop rate 0 bps
Match: protocol rtp
Priority: 50% (1666 kbps), burst bytes 41650, b/w exceed drops: 0
...

Т.е. 50% от 4000000 превратились в 1666 kbps?! Как такое может быть? Пока можно обойти эту проблему увеличив скорость на физическом интерфейсе
interface FastEthernet0/1/0
ip address 10.0.0.2 255.255.255.252
duplex auto
speed 100
service-policy output uplink

И проблема с выделяемой полосой отодвинулась на неопределенное время
...
Priority: 50% (2000 kbps)
...


Я не подбирал какие-то специальные значения для политик. Просто так получилось. Как подобная политика бы повела себя на WAN-интерфейсе, где скорость всего 2Мбит/с даже незнаю.