簡介
本檔案介紹如何在Nexus 9300(EX-FX-GX)模型中設定和疑難排解經通道GRE的QoS。
必要條件
需求
思科建議您瞭解以下主題:
採用元件
本文中的資訊係根據以下軟體和硬體版本:
- 硬體:N9K-C9336C-FX2
- 版本:9.3(8)
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
背景資訊
您可以使用通用路由封裝(GRE)作為各種乘客通訊協定的載體通訊協定。
圖中所見GRE通道的IP通道元件。原始乘客通訊協定封包會成為GRE負載,而裝置會將GRE標頭新增到封包中。
然後,裝置將傳輸協定報頭新增到資料包並傳輸它。

根據您對流量進行分類的方式以及您建立並應用於流量類的策略來處理流量。
要配置QoS功能,請執行以下步驟:
-
建立分類將入口資料包分類到匹配條件(如IP地址或QoS欄位)的nexus。
-
建立指定要對流量類(如監視、標籤或丟棄資料包)執行的操作的策略。
-
將策略應用於埠、埠通道、VLAN或子介面。
常用的DSCP值

網路圖表

設定
通過隧道GRE配置QoS的目標是為特定VLAN的流量設定DSCP,使其通過N9K-EX1和N9K-EX2之間的GRE隧道。
Nexus封裝流量並將其傳送到通道GRE上,而不會像您之前在VLAN中為DSCP值所做的一樣,將DSCP AF-11的值用於VLAN 9。
主機A
interface Ethernet1/3
switchport
switchport access vlan 9
no shutdown
interface Vlan9
no shutdown
ip address 192.168.9.9/24
主機B
interface Ethernet1/3
switchport
switchport access vlan 18
no shutdown
interface Vlan18
no shutdown
ip address 192.168.18.18/24
N9K-EX1介面配置
interface Ethernet1/1
ip address 10.10.10.1/30
no shutdown
interface Ethernet1/3
switchport
switchport access vlan 9
no shutdown
interface Tunnel1
ip address 172.16.1.1/30
tunnel source Ethernet1/1
tunnel destination 10.10.10.2
no shutdown
interface Vlan9
no shutdown
ip address 192.168.9.1/24
N9K-EX1路由配置
ip route 0.0.0.0/0 Tunnel
N9K-EX1 QoS配置
由於NXOS中的GRE通道介面不支援QoS,因此必須在VLAN設定中設定和應用服務原則。您可以看到,首先建立ACL以匹配源和目標,然後使用所需的DSCP設定QoS配置,最後使用服務策略進行VLAN配置。
ip access-list TAC-QoS-GRE
10 permit ip any 192.168.18.0/24
class-map type qos match-all CM-TAC-QoS-GRE
match access-group name TAC-QoS-GRE
policy-map type qos PM-TAC-QoS-GRE
class CM-TAC-QoS-GRE
set dscp 10
vlan configuration 9
service-policy type qos input PM-TAC-QoS-GRE
N9K-EX2介面配置
interface Ethernet1/1
ip address 10.10.10.2/30
no shutdown
interface Ethernet1/3
switchport
switchport access vlan 18
no shutdown
interface Tunnel1
ip address 172.16.1.2/30
tunnel source Ethernet1/1
tunnel destination 10.10.10.1
no shutdown
interface Vlan18
no shutdown
ip address 192.168.18.1/24
N9K-EX2路由配置
ip route 0.0.0.0/0 Tunnel
疑難排解
通道驗證
兩個命令:
- show ip interface brief
- show interface tunnel 1 brief
顯示通道是否處於開啟狀態。
N9K-EX1# show ip interface brief
IP Interface Status for VRF "default"(1)
Interface IP Address Interface Status
Vlan9 192.168.9.1 protocol-up/link-up/admin-up
Tunnel1 172.16.1.1 protocol-up/link-up/admin-up
Eth1/1 10.10.10.1 protocol-up/link-up/admin-up
N9K-EX1# show interface tunnel 1 brief
--------------------------------------------------------------------------------
---------------------------
Interface Status IP Address
Encap type MTU
--------------------------------------------------------------------------------
---------------------------
Tunnel1 up 172.16.1.1/30
GRE/IP 1476
兩個命令
- show interface tunnel 1
- show interface tunnel 1 counters
顯示類似資訊,如接收和傳輸的資料包。
N9K-EX1# show interface tunnel 1
Tunnel1 is up
Admin State: up
Internet address is 172.16.1.1/30
MTU 1476 bytes, BW 9 Kbit
Tunnel protocol/transport GRE/IP
Tunnel source 10.10.10.1 (Ethernet1/1), destination 10.10.10.2
Transport protocol is in VRF "default"
Tunnel interface is in VRF "default"
Last clearing of "show interface" counters never
Tx
3647 packets output, 459522 bytes
Rx
3647 packets input, 459522 bytes
N9K-EX1# show interface tunnel 1 counters
--------------------------------------------------------------------------------
--
Port InOctets InUcastPk
ts
--------------------------------------------------------------------------------
--
Tunnel1 459522 36
47
--------------------------------------------------------------------------------
--
Port InMcastPkts InBcastPk
ts
--------------------------------------------------------------------------------
--
Tunnel1 --
--
--------------------------------------------------------------------------------
--
Port OutOctets OutUcastPk
ts
--------------------------------------------------------------------------------
--
Tunnel1 459522 36
47
--------------------------------------------------------------------------------
--
Port OutMcastPkts OutBcastPk
ts
--------------------------------------------------------------------------------
--
Tunnel1 --
--
N9K-EX1#
流量擷取
SPAN擷取
此圖顯示N9K-EX1交換器上介面乙太網路1/3入口處擷取ARP要求。您可以看到該流量尚未標籤您想要使用的DSCP(AF11),因為捕獲是在交換機的輸入處。

該圖顯示N9K-EX2交換機上Ethernet 1/1介面的條目處捕獲ARP請求。您可以看到流量已經具有您需要使用的DSCP AF11值。您也注意到,封包封裝在Nexus和Nexus之間設定的通道中。

該圖顯示N9K-EX1交換機上Ethernet 1/3介面的輸出中捕獲ARP應答。您可以看到該流量仍具有您需要使用的DSCP AF11值。另請注意,封包並未封裝在兩個Nexus之間設定的通道。

此圖顯示N9K-EX2交換機上Ethernet 1/1介面的輸出中捕獲ARP應答。您可以看到該流量仍具有您需要使用的DSCP AF11值。您也注意到,封包封裝在Nexus和Nexus之間設定的通道中。

必須注意的是,封包擷取不顯示封裝的通道IP,因為Nexus使用實體的IP。這是使用GRE通道時Nexus的自然行為,因為它們使用實體IP來路由封包。
ELAM捕獲
使用帶有in-select 9的N9KEX-2上的ELAM捕獲來檢視外部l3和內部l3報頭。您必須按來源和目標IP進行過濾。
debug platform internal tah elam
trigger init in-select 9
reset
set inner ipv4 src_ip 192.168.9.9 dst_ip 192.168.18.18
start
report
您可以驗證Nexus是否通過介面1/1接收資料包。此外,您會看到外部l3報頭是直接連線的介面的物理IP地址,並且l3內部報頭具有主機A和主機B的IP。
SUGARBOWL ELAM REPORT SUMMARY
slot - 3, asic - 1, slice - 0
============================
Incoming Interface: Eth1/1
Src Idx : 0x41, Src BD : 4433
Outgoing Interface Info: dmod 2, dpid 10
Dst Idx : 0x3, Dst BD : 18
Packet Type: IPv4
Outer Dst IPv4 address: 10.10.10.2
Outer Src IPv4 address: 10.10.10.1
Ver = 4, DSCP = 10, Don't Fragment = 0
Proto = 47, TTL = 255, More Fragments = 0
Hdr len = 20, Pkt len = 108, Checksum = 0x3d7a
Inner Payload
Type: IPv4
Inner Dst IPv4 address: 192.168.18.18
Inner Src IPv4 address: 192.168.9.9
L4 Protocol : 47
L4 info not available
Drop Info:
----------
LUA:
LUB:
LUC:
LUD:
Final Drops:
QoS故障排除
您可以如圖所示檢查QoS配置。
N9K-EX1# show running-config ipqos
!Command: show running-config ipqos
!Running configuration last done at: Thu Apr 4 11:45:37 2024
!Time: Fri Apr 5 11:50:54 2024
version 9.3(8) Bios:version 08.39
class-map type qos match-all CM-TAC-QoS-GRE
match access-group name TAC-QoS-GRE
policy-map type qos PM-TAC-QoS-GRE
class CM-TAC-QoS-GRE
set dscp 10
vlan configuration 9
service-policy type qos input PM-TAC-QoS-GRE
您可以顯示在指定VLAN上配置的QoS策略,以及與與策略對映關聯的ACL匹配的資料包。
N9K-EX1# show policy-map vlan 9
Global statistics status : enabled
Vlan 9
Service-policy (qos) input: PM-TAC-QoS-GRE
SNMP Policy Index: 285219173
Class-map (qos): CM-TAC-QoS-GRE (match-all)
Slot 1
5 packets
Aggregate forwarded :
5 packets
Match: access-group TAC-QoS-GRE
set dscp 10
您還可以使用此處顯示的命令清除QoS統計資訊。
N9K-EX1# clear qos statistics
驗證軟體中程式設計的ACL。
N9K-EX1# show system internal access-list vlan 9 input entries detail
slot 1
=======
Flags: F - Fragment entry E - Port Expansion
D - DSCP Expansion M - ACL Expansion
T - Cross Feature Merge Expansion
N - NS Transit B - BCM Expansion C - COPP
INSTANCE 0x2
---------------
Tcam 1 resource usage:
----------------------
LBL B = 0x1
Bank 2
------
IPv4 Class
Policies: QoS
Netflow profile: 0
Netflow deny profile: 0
Entries:
[Index] Entry [Stats]
---------------------
[0x0000:0x0000:0x0700] permit ip 0.0.0.0/0 192.168.18.0/24 [5]
驗證硬體中程式設計的ACL。
N9K-EX1# show hardware access-list vlan 9 input entries detail
slot 1
=======
Flags: F - Fragment entry E - Port Expansion
D - DSCP Expansion M - ACL Expansion
T - Cross Feature Merge Expansion
N - NS Transit B - BCM Expansion C - COPP
INSTANCE 0x2
---------------
Tcam 1 resource usage:
----------------------
LBL B = 0x1
Bank 2
------
IPv4 Class
Policies: QoS
Netflow profile: 0
Netflow deny profile: 0
Entries:
[Index] Entry [Stats]
---------------------
[0x0000:0x0000:0x0700] permit ip 0.0.0.0/0 192.168.18.0/24 [5]
使用此處顯示的命令,您可以檢驗使用VLAN的連線埠。在本例中,它是VLAN ID 9,您也可以注意正在使用的QoS策略。
N9K-EX1# show system internal ipqos vlan-tbl 9
Vlan range asked: 9 - 9
=================================================
Vlan: 9, pointer: 0x132e3eb4, Node Type: VLAN
IfIndex array:
alloc count: 5, valid count: 1, array ptr : 0x13517aac 0: IfI
ndex: 0x1a000400 (Ethernet1/3) Policy Lists (1): Flags: 01
Type: INP QOS, Name: PM-TAC-QoS-GRE, Ghost Id: 0x45001c7, Real Id: 0x450
01c8
Defnode Id: 0x45001c9
=================================================
N9K-EX1#