Глава 5. Hierarchical scheduling

Материал из Juniper Exam Wiki
Перейти к навигации Перейти к поиску

Overview

С hierarchical sched устройство обеспечивает обработку нескольких абонентов, групп абонентов (units), разных классов у подписчика.

Выполняет те же функции, что и port-based scheduling: в каком порядке пакеты передать, сколько пакетов забуфферизировать, определить скорость, как обрабатывать разные пакеты в условиях запора.

Но есть особенности:

  1. H-CoS - предоставляет более тонкую обработку по нескольким уровням.
  2. H-CoS предоставляет возможность централизовать CoS для downstream устройств, которые не имеют функционала CoS (либо не сконфигурирован CoS на downstream device, которые CoS как таковой поддерживают).
  3. H-CoS поддерживают не все устройства. Поддерживают устр-ва, использующие ASICs.

C-VLAN: customer-vlan, inner tag. Scheduling и shaping обычно используются для C-VLAN для установления min и max пропускной способности для клиента.

S-VLAN: service-vlan, outer-tag. Scheduling и shaping обычно работают в S-vlan, для предоставления CoS нижележащим устр-вам с небольшим буффреризированием и простым scheduler.

Traffic control profile: конфигурационный компонент, состоящия из scheduling и queueing свойств. Применяется к физическому интерфейсу, логическому и набору интерфейсов.

Interface set: группа логических интерфейсов, определенных нами.

CIR: committed interface rate: гарантированная скорость, назначенная на interface set или логический интерфейс.

PIR: peak interface rate: макс скорость, сконфигурированная для порта, логического интерфейса или interface set.

4 уровня обработки:

1. Port (physical interface). Каждый порт может иметь несколько interface sets. Поддерживает shaping.

2. Interface set (VLAN or logical interface group). Каждый может иметь 1 или более логических интерфейсов. Поддерживает CIR, PIR.

3. Logical interface (VLAN). Может быть до 8 очередей. Поддерживает CIR, PIR.

4. Queue. Здесь обычная обработка трафика по заданным параметрам.

Может быть до 8 очередей для 1 VLAN. Каждая очередь имеет свои свойства.

Scheduler modes

1. Per-unit (Port based) scheduler (то, что мы изучали в предыдущей главе 5):

a) port-level shaping
b) VLAN scheduling and queueing
c) full queue scheduling
NO interface sets!

2. Hierarchical scheduler:

a) port-level shaping
b) interface-set scheduling and queueing
c) VLAN scheduling and queueing
d) full queue scheduling

Включение нужного режиме делается на уровне настройки физического интерфейса:

set interfaces ge-0/0/0 per-unit-scheduler ...
or
set interfaces ge-0/0/0 hierarchical-scheduler ...

Hierarchical scheduling levels

Level 1 - Port

Shaping: PIR - max rate for port. Пакеты, превышающие PIR не дропаются, а хранятся в буффере.

Config: Для установления PIR нужно сконфигурировать traffic-control-profile, затем применить его на порт.

Пример:

set class-of-service traffic-control-profile profile shaping-rate 100m
set class-of-service interfaces ge-0/0/0 output-traffic-control-profile profile

Level 2 - Interface set

Создание Interfaces-sets: 2 варианта объединить интерфейсы в группу: собрать группу из разных вланов, определить группу двутеггированных вланов по S-vlan (outer).

set interfaces ge-0/0/0 hierarchical-scheduling
set interfaces ge-0/0/0 flexible-vlan-tagging
set interfaces ge-0/0/0 unit 100 vlan-id 100
set interfaces ge-0/0/0 unit 200 vlan-id 200
set interfaces ge-0/0/0 unit 1000 vlan-tags outer 1234 inner 1000
set interfaces ge-0/0/0 unit 1100 vlan-tags outer 1234 inner 1100

Для таких интерфейсов можем задать группы:

set interfaces interface-set A interface ge-0/0/0 unit 100
set interfaces interface-set A interface ge-0/0/0 unit 200
set interfaces interface-set B interface ge-0/0/0 vlan-tags-outer 1234

Особенности:

1. Нельзя использовать interface-range

2. В interface-set нельзя использовать одновременно logical int и S-vlan.

3. Один физ интерфейс для одного interface-set.

4. Logical int или S-vlan может принадлежать только одному interface-set.

Shaping: используем CIP и PIR (гарантированная и максимальная скорости)

Scheduling: CIR и PIR также используются для обозначения относительного веса данного interface-set'а, учитывая другие interface-set для данного порта.

- CIR mode: If any interface sets within port has defined CIR, bandwidth sharing among the interface sets is based on the CIR of the interface sets.

- PIR mode: If no interface sets CIR defined, bandwidth sharing among interface sets base on the PIR of the interface sets.

Когда траффик превышает PIR, интерфейс прекращает передачу пакетов.

set class-of-service traffic-control-profile  profile  shaping-rate 75m guaranteed-rate 50m
set class-of-service interface-set A output-traffic-control-profile profile

Level 3 - logical interface (VLAN)

Shaping: CIR, PIR, Scheduler map - ассоциирует влан с его очередью.

Scheduling: CIR и PIR определяю относительный вес влана среди других вланов на том же порту.

- CIR mode: If any vlan within port has defined CIR, bandwidth is shared among vlans in proportion on their CIR.

- PIR mode: If noone vlan within port has defined CIR, bandwidth is shared among vlans in proportion on their PIR.

Когда траффик превышает PIR, во влане прекращается передача пакетов.

set class-of-service traffic-control-profile profile schedule-map sched-exmple shaping-rate 30m guaranteed-rate 20m
set interfaces ge-0/0/0 unit 100 output-traffic-control-profile profile

Без указания guaranteed-rate для traffic-control-profile будет выделено значение bandwidth = 2 MTU.

Level 4 - Queue

Scheduling: самый обычный scheduler для port-level с обычными параметрами: transm-rate, priority, delay buffer, RED drop profiles. + Можно задавать H-Cos scheduling, оно будет немногим отличаться от обычного.

Сам конфиг приводить не буду, но нужно:

  1. Сконфигурировать scheduler: transm-rate, priority, delay-buffer, drop-profile, drop-profile-map.
  2. Сконфигурировать scheduler-map.
  3. Применить scheduler-map к интерфейсу в рамках class-of-service конфигурации.

При этом, важный момент: для port-based scheduling, scheduler map применяется к интерфейсу.

А для H-COS scheduler map применяет на Level 3 к определенному unit.

Remaining traffic

Оставшийся трафик включает в себя units, которым не были присвоены какие-то traffic-contro-profile и набор из вланов, которые не были включены к какие-либо interface-sets.

Remaining scheduler: простой scheduler, который применяется к вланам, которым не назначили конкретных traffic-control-profiles. Короче это scheduler, который применяется к remaining traffic.

Цепочка: Port -> Interface set -> vlan -> queue.

Для тех вланов, которых входят в interface set, но которым не назначены определенные traffic-control-profile, будут использовать remaining scheduler, заданный для interface set.

Для тех вланов, которые не были включены в interface set, будут использоваться remaining scheduler, заданный для port.

Remaining vlans - Interface set

set class-of-service traffic-control-profiles profile-remaining scheduler-map sched-example shaping-rate 50m guaranteed-rate 10m
set class-of-service interface-set A output-traffic-control-profile profile
set class-of-service interface-set A output-traffic-control-profile-remaining profile-remaining

Remaining vlans - Port

set class-of-service traffic-control-profiles profile-remaining scheduler-map sched-example shaping-rate 50m guaranteed-rate 10m
set class-of-service interface ge-0/0/0 output-traffic-control-profile profile
set class-of-service interface ge-0/0/0 output-traffic-control-profile-remaining profile-remaining

Queue properties in Hierarchical Scheduling

Priority

В port-level queueing очереди "соревнуются" за пропускную способность порта.

В hierarchical queueing вланы "соревнуются" за проп способность порта. => приоритет очереди определяется утилизацией проп способности влана, которому сопоставленая данная очередь.

CIR < VLAN - приоритеты очереди остаются обычными: strict-high, high, med-high, med-low, low..

CIR > VLAN > PIR - все приоритеты (за исключением strict-high) становятся excess.

Работа Queueing priority:

Алгоритм планировщика, использующего HCoS включает в себя PQ-DWRR (выбор очереди и передача пакета) и Intelligent Prioritization.

Для port-level queueing: если очередь с меньшим приоритетом уже передает пакет, то очередь с большим приоритетом должна подождать пока та очередь закончит передачу пакета до того как она распределить снова (scheduled again).

Для HCOS: приоритет отправки пакета определен для очередей с разными приоритетами. Сначала идет передача из очередей с strict-high и high приоритетами. Затем передача пакетов из medium-high и medium-low, затем low, затем excess.

Transmission rate

Полоса, которая не используется вланами называет избыточной (excess). Эта полоса может быть распределена между вланами пропорционально CIR (если не определен CIR, то смотрят по PIR) (дефолтное поведение), либо может быть разделена равными частями.

mode per port: применяется ко всем interface sets.

mode per interface-set: применяется ко всем вланам. Перебивает per port settings.

Чтобы маршрутизатор более точно распределил избыточную полосу между вланами, в качестве excess-bandw нужно задать max queue bandtwidth = max effeective guaranteed rate.

set class-of-service interfaces interface-set A excess-bandwidth-share equal

set class-of-service interfaces ge-0/0/0 exceed-bandwidth-share proportional 14000000

Buffer size

В отличие от port-level, где buffer size определяется определяется с помощью interface bandidth, для vlan размер определяется через traffic control profile, который задан явно в конфигурации.

- vlan bandwidth is not implicitly known: must be configured in traffic-control-profile. - delay buffer rate - configurable parameter, provides reference for buffer size calculation. - buffer size is calculated implicitly using CIR (if no deay buffer rate) or PIR (if no CIR).

В HCOS delay buffers не эластичны - не поддерживают динамического выделения памяти.

На практике получается так, что delay buffer вланов становится ориентиром для scheduler.

Level 1-3 поддерживают delay buffer.

Каждый уровень использует уровень ниже как ориентир для полосы пропускания.

Сумма буфферов на каждом уровне не должна превышать значения нижнего уровня.

[edit class-of-service]
 traffic-control-profiles {
     L1-port-prof {
         shaping-rate 100m;
         delay-buffer-rate 200; }
     L2-interface-sets-prof {
         shaping-rate 100m;
         guaranteed-rate 75m;
         delay-buffer-rate 100m; }
     L3-unit-prof {
         shaping-rate 30m;
         guaranteed-rate 20m;
         delay-buffer-rate 35m; }}
[edit class-of-service interfaces]
   interface-set A {
       output-traffic-control-profile L2-interface-sets-prof; }
[edit class-of-service interfaces]
   xe-0/0/0 {
       output-traffic-control-profile L1-port-prof;
       unit 181 {
           output-traffic-control-profile L3-unit-prof; }}

RED drop profiles Используется только сегментная.

Задаются 2 точки и между ними рисуется прямая.

  • minimum queue depth: below it drop probability = 0
  • maximum queue depth: above it drop probability = 100

Задаем только 2 точки!!

[edit class-of-service]
 drop-profiles {
     test {
         fill-level 25 drop-probability 0;
         fill-level 90 drop-probability 90; } }

Configuration steps

  1. Configure physical interface for HCOS: add hierarchical-scheduler statement.
  2. Configure interface sets.
  3. Configure schedulers, including drop profile.
  4. Configure scheduler-maps: associate schedulers and forwarding classes. schedulers do nothing until they are referenced in a scheduler-map.
  5. Configure traffic-control profiles: associate scheduler-maps to vlans.
  6. Apply traffic-control-profile to ports, interface-sets and vlans.
[edit interfaces xe-0/0/0]
    hierarchical-scheduler;
[edit interfaces]
  interface-set A {
      interface xe-0/0/0 {
          unit 285;
          unit 311; }}
[edit class-of-service]
 drop-profiles {
     aggressive {
         fill-level 5 drop-probability 50;
         fill-level 60 drop-probability 100; }
     tolerant {
         fill-level 25 drop-probability 0;
         fill-level 100 drop-probability 100; }}
[edit class-of-service schedulers]
  sched0 {
      transmit-rate percent 20;
      buffer-size percent 20;
      drop-profile-map loss-priority low protocol any drop-profile tolerant; }
  sched1 {
      transmit-rate percent 80;
      buffer-size percent 80;
      drop-profile-map loss-priority high protocol any drop-profile aggressive; }
[edit class-of-service schedulers]
  sched0 {
      transmit-rate percent 20;
      buffer-size percent 20;
      drop-profile-map loss-priority low protocol any drop-profile tolerant; }
  sched1 {
      transmit-rate percent 80;
      buffer-size percent 80;
      drop-profile-map loss-priority high protocol any drop-profile aggressive; }
 [edit class-of-service]
 traffic-control-profiles {
   set-A {
       shaping-rate 200m;
       guaranteed-rate 20m; }
   PIR-200-CIR-5 {
       scheduler-map schedule-0-1;
       shaping-rate 200m;
       guaranteed-rate 5m; }
   PIR-200-CIR-25 {
       scheduler-map schedule-0-1;
       shaping-rate 200m;
       guaranteed-rate 25m; }}
[edit class-of-service interfaces]
   interface-set A {
       excess-bandwidth-share proportional 6400g;
       output-traffic-control-profile set-A;
       output-traffic-control-profile-remaining PIR-200-CIR-25; }
   ge-0/0/0 {
       excess-bandwidth-share proportional 6400g;
       output-traffic-control-profile-remaining PIR-200-CIR-25;
       unit 246 {
           output-traffic-control-profile PIR-200-CIR-5; }
       unit 248 {
           output-traffic-control-profile PIR-200-CIR-5; }}