1. ACI QoS Process Flow
ACIにおいて、QoSの Classification/ Marking は Ingress Leaf で処理されます。
Buffering、Queuing は Spine, Egress Leaf でも処理されます。 
2. Traffic Classification
ACI では 予約済みのClass が3 つと ユーザ定義可能なClassが3つ用意されています。
2-1: Reserved Classes (予約済み)
- Strict priority queue
- APIC Controller への全てのTraffic、または APICからのパケット
- Strict priority queue
- SUP からの Traffic
- Control traffic (LACP, ISIS, BGP, COOP, etc)
- ベストエフォート。
- DWRR スケジューリング。
- SPAN/ERSPAN Traffic は優先度:低 で扱われ、輻輳時はDROP
2-2: User Defined Classes (ユーザ定義)
3つのClassをユーザで定義できます。 () 内は nx-os mode における qos group
- Level 1 (qos group = 3)
- Level 2 (qos group = 2)
- Level 3 (qos group = 1) ※ QoS Class が指定されていない場合は Level3 がデフォルト適用


3. Classification Option & Configuration
3-1: QoS Policy in Contract
EPG間の全てのTrafficに対し、QoS Class を定義することが可能です。
例として Strict Priority Queue を設定した Level1 を定義することで、
設定されたEPG間のTrafficは優先処理されます。


3-2: Custom QoS (DSCP and Dot1p based )
Custom Qos ではmDSCP/Dot1p を元に、 QoS Level の設定, DSCPのマーキング、
リマーキングの設定が可能です。
設定は EPG Property のCustom QoS から行います。


具体的な DSCP/Dot1P の Range 設定、DSCP Target 設定は以下のように行います。
"DSCP to priority map" と "Dot1P Classifiers"の両方が設定された状態で、IP Packet
を受信した場合は、"DSCP to priority map" の処理が優先され、CoSはPreserveされま
せん。
また、その場合、DSCP値は DSCPTarget 値へ リマーキングされますが、Dot1Pの値
(CoS) は 0 となります。 (Not preserved)

IP Packet , non-IP Packet に関わらず、Cos値を維持するためには、以下の設定で
"Preserve COS (Dot1p Preserve)"にチェックを入れます。

3-3: EPG default class
Contract で QoS Policy が設定されていない場合、また、Custom QoS も設定され
ていない場合、QoS class に指定した User Defined Class が適用されます。
QoS class が未指定の場合は、Level3 がデフォルトで適用されます。

4. ACI QoS Classification Rules
以下は ACIにおけるQoS処理のフローを表しています。

5. CLI での確認
5-1: systemに設定されている qos class の確認
leaf-1# show system internal qos classes
-------------------------------------------------------
QOS Class
-------------------------------------------------------
Id: level3
Mtu: 9216
Buffer: min 0
Cong: algo 1 ecn 0
Sched: bw 20 meth WRR
Queue: limit 1522 meth Dynamic
-------------------------------------------------------
QOS Class
-------------------------------------------------------
Id: span
Mtu: 9216
Buffer: min 0
Cong: algo 0 ecn 0
Sched: bw 1 meth WRR
Queue: limit 1500 meth Dynamic
-------------------------------------------------------
QOS Class
-------------------------------------------------------
Id: control-plane
Mtu: 9216
Buffer: min 0
Cong: algo 0 ecn 0
Sched: bw 0 meth SP
Queue: limit 1500 meth Dynamic
-------------------------------------------------------
QOS Class
-------------------------------------------------------
Id: level2
Mtu: 9216
Buffer: min 0
Cong: algo 1 ecn 0
Sched: bw 20 meth WRR
Queue: limit 1522 meth Dynamic
-------------------------------------------------------
QOS Class
-------------------------------------------------------
Id: level1
Mtu: 9216
Buffer: min 0
Cong: algo 1 ecn 0
Sched: bw 20 meth SP <<< WRRからStrict Priority に変更
Queue: limit 1522 meth Dynamic
5-2: EPG Vlan の設定内容の確認
leaf-1# show system internal qos vlan all
Requested VLAN ALL
----------------------------------------------------------------
Vlan
-----------------------------------------------------------------
PI id: 14 (0xf8d6a84, 0xf8e43fc) flags 0x0
Type: VLAN Encap: 351
refcnt: 1 pinst: 87032231 def_nodeid: 87032232
Default Qos Group = 3 << QoS Class は Level1 (qos group 3 が Level1に該当)
Vlan list for this EPG (PI ids): 14
Policies
------------
DOT1P name: (null)
qos_grp: 3 from: 0 to: 4 markDscp: 40 << Custom QoS で設定された内容
DSCP name: (null)
qos_grp: 3 from: 0 to: 32 markDscp: 40 << Custom QoS で設定された内容
----------------------------------------------------------------
-- snip --
※PI id: は 設定対象となる EPG に関連付けられる vlan id
GUIで設定する encap vlan id: (この例では 351) とは異なる id
詳しくは http://aci-troubleshooting-book.readthedocs.io/en/latest/unicast.html を参照ください。
以下のように show vlan extended で確認可能。
leaf-1# show vlan extended
VLAN Name Status Ports
---- -------------------------------------------- --------- -------------------------------
14 cisco:Project-App:App_EPG active Eth1/1
6. References
Cisco APIC QoS - Cisco
Cisco Application Centric Infrastructure Fundamentals - Fabric Provisioning [Cisco Application Policy Infrastructure …