【網絡】H3C交換機(S6820)配置ECN例子


目錄

 

一、無損網絡配置

1 環境簡介

2 配置步驟

3 確認

二、附錄

1、配置 WRED 命令和參數說明

命令和參數說明

 顯示和維護 WRED

WRED 配置示例 


同步測試

一、無損網絡配置

1 環境簡介

圖示:Server 1 and Server 2 通過 Device A 和Device B連接到Server 3 .

  • 在數據包傳輸路徑上的所有接口上啟用 PFC。本示例為 802.1p 優先級為 5 (802.1p priority 5)的數據包啟用無損傳輸。
  • ·在交換機連接服務器的接口上使能DCBX,以便交換機和服務器網卡協商ETS和PFC參數。
  • ·配置 ETS 以保證設備 A 的 25-5GigE 1/0/3 和設備 B 的 25-5GigE 1/0/2 上的 802.1p 優先級為 5 的數據包的帶寬。
  • ·在Device A的25GigE 1/0/3上配置ECN,當Device A發生擁塞時,Device A可以通知發送方調整報文發送速率。

NOTE:
在此示例中,設備 A 的 25-5GigE 1/0/3 上可能發生擁塞,因此僅在(此)接口上配置 ECN。如果實際情況下擁塞的位置無法預測,可以在網絡的所有接口上配置ECN。 

 

2 知識准備

  • RED和WRED是什么:

https://blog.csdn.net/bandaoyu/article/details/118567167

  • 配置WRED丟棄模板

【舉例】

# 配置基於隊列的WRED表queue-table1中隊列1的丟棄參數:丟棄級別為1,隊列平均長度的下限為10,隊列平均長度的上限為20,丟棄概率為30%。

<Sysname> system-view
[Sysname] qos wred queue table queue-table1
[Sysname-wred-table-queue-table1] queue 1 drop-level 1 low-limit 10 high-limit 20 discard-probability 30

【參數】
all:表示所有隊列。
queue-id:隊列編號。取值范圍為0~7。
drop-level drop-level:丟棄級別,在進行報文丟棄時參考的參數,0對應綠色報文、1對應黃色報文、2對應紅色報文。如果未指定本參數,后續配置的參數對該隊列所有丟棄級別的報文都生效。
low-limit low-limit:隊列平均長度的下限。取值范圍為0~38000。
high-limit high-limit:隊列平均長度的上限。取值范圍為0~3800且必須大於丟棄下限。
discard-probability discard-prob:丟棄概率,取值越大,計算出的丟棄概率越小。取值范圍為0~100。

【使用指導】
當隊列平均長度小於下限時,不丟棄報文。當隊列平均長度在上限和下限之間時,設備隨機丟棄報文,隊列越長,丟棄概率越高。當隊列平均長度超過上限時,丟棄所有到來的報文。

  • WRED丟棄模板中設置queue 的丟棄參數和應用ECN

[DeviceA] qos wred queue table  queue-table5                                  #表名=queue-table5
[DeviceA-wred-table-queue-table5] queue 5 weighting-constant 12  #配置WRED指數=12
[DeviceA-wred-table-queue-table5] queue 5 drop-level 0 low-limit 10 high-limit 20 discard-probability 30
[DeviceA-wred-table-queue-table5] queue 5
ecn                              #queue 5應用ECN
[DeviceA-wred-table-queue-table5] quit

 

  •  應用WRED丟棄模板

配置WRED丟棄模板后,需要在接口或端口隊列上應用,WRED丟棄模板才會生效。以下描述在端口隊列上應用WRED丟棄模板

[DeviceA] interface twenty-fivegige 1/0/3
[DeviceA-Twenty-FiveGigE1/0/3] qos wred
apply queue-table5

 

2.5  檢查配置結果
display qos wred table  查看WRED丟棄模板的配置結果。

參考:https://blog.csdn.net/satsuma_samurai/article/details/75029040

 

3 配置步驟

1. 配置設備 A:
# 配置 25-5GigE 1/0/1、25-5GigE 1/0/2 和 25-5GigE 1/0/3 以信任數據包中攜帶的 802.1p 優先級。在這些接口上啟用 PFC 並為 802.1p 優先級 5(priority 5) 啟用 PFC。

<DeviceA> system-view
[DeviceA] interface range twenty-fivegige 1/0/1 to twenty-fivegige 1/0/3
[DeviceA-if-range] qos trust dot1p
[DeviceA-if-range] priority-flow-control enable
[DeviceA-if-range] priority-flow-control no-drop dot1p 5
[DeviceA-if-range] quit

# 全局啟用 LLDP。

[DeviceA] lldp global enable

# 在 25-5GigE 1/0/1 和 25-5GigE 1/0/2 上啟用 LLDP。啟用這些接口以通告 DCBX TLV。在這些接口上將 DCBX 版本設置為 1.01 版。

[DeviceA] interface range twenty-fivegige 1/0/1 to twenty-fivegige 1/0/2
[DeviceA-if-range] lldp enable
[DeviceA-if-range] lldp tlv-enable dot1-tlv dcbx
[DeviceA-if-range] dcbx version rev101
[DeviceA-if-range] quit

# 在 25-GigE 1/0/3 上啟用字節計數 WRR。將隊列5(queue 5)(802.1p優先級5默認映射到本地優先級5)分配給SP組。

[DeviceA] interface twenty-fivegige 1/0/3
[DeviceA-Twenty-FiveGigE1/0/3] qos wrr byte-count
[DeviceA-Twenty-FiveGigE1/0/3] qos wrr 5 group sp
[DeviceA-Twenty-FiveGigE1/0/3] quit

# 創建 WRED 表queue-table5。在 WRED 表中,設置 WRED 的指數以計算平均隊列大小和 WRED 參數,並為隊列 5 (queue 5)啟用 ECN。將 WRED 表queue-table5 應用到 25-GigE 1/0/3。

#參數說明見附錄1

                     #創建wred模板(內含啟用ECN)

[DeviceA] qos wred queue table queue-table5  
[DeviceA-wred-table-queue-table5] queue 5 weighting-constant 12  #配置WRED指數
[DeviceA-wred-table-queue-table5] queue 5 drop-level 0 low-limit 10 high-limit 20 discard-probability 30
[DeviceA-wred-table-queue-table5] queue 5
ecn
[DeviceA-wred-table-queue-table5] quit

#wred模板應用到要啟用的端口
[DeviceA] interface twenty-fivegige 1/0/3
[DeviceA-Twenty-FiveGigE1/0/3] qos wred
apply queue-table5

2. 配置設備 B:
# 配置 25-5GigE 1/0/1 和 25-5GigE 1/0/2 以信任數據包中攜帶的 802.1p 優先級。在這些接口上啟用 PFC 並為 802.1p 優先級 5 啟用 PFC。

<DeviceB> system-view
[DeviceB] interface range twenty-fivegige 1/0/1 to twenty-fivegige 1/0/2
[DeviceB-if-range] qos trust dot1p
[DeviceB-if-range] priority-flow-control enable
[DeviceB-if-range] priority-flow-control no-drop dot1p 5
[DeviceB-if-range] quit

# 全局啟用 LLDP。

[DeviceB] lldp global enable

# 在 25GigE 1/0/2 上啟用 LLDP。啟用接口以通告 DCBX TLV。在界面上將 DCBX 版本設置為 1.01 版。

[DeviceB]interface twenty-fivegige 1/0/2
[DeviceB-Twenty-FiveGigE1/0/2] lldp enable
[DeviceB-Twenty-FiveGigE1/0/2] lldp tlv-enable dot1-tlv dcbx
[DeviceB-Twenty-FiveGigE1/0/2] dcbx version rev101
[DeviceB-Twenty-FiveGigE1/0/2] quit

# 在 25GigE 1/0/2 上啟用字節計數 WRR。將隊列5(802.1p優先級5默認映射到本地優先級5)分配給SP組。

[DeviceB] interface twenty-fivegige 1/0/2
[DeviceB-Twenty-FiveGigE1/0/2] qos wrr byte-count
[DeviceB-Twenty-FiveGigE1/0/2] qos wrr 5 group sp

3 確認

<H3C>display qos wred table  #顯示所有,發現 display qos wred table name 1無法使用

# 顯示Device B丟包的信息。

<DeviceB> display packet-drop summary
All interfaces:

  Packets dropped due to Fast Filter Processor (FFP): 0
  Packets dropped due to STP non-forwarding state: 0
  Packets dropped due to insufficient data buffer. Input dropped: 0 Output dropped: 0
  Packets of ECN marked: 1622267130
  Packets of WRED droped: 0

輸出顯示在設備 B 上丟棄了零個數據包。

# 顯示Device B上25GigE 1/0/2的帶寬使用情況。

<DeviceB> display counters rate outbound interface Twenty-FiveGigE 1/0/2
Usage: Bandwidth utilization in percentage

Interface            Usage (%)   Total (pps)   Broadcast (pps)   Multicast (pps)
WGE1/0/2                    100        2825427                  --                  --

Overflow: More than 14 digits.
--: Not supported.

輸出顯示,Twenty-F​​iveGigE 1/0/2 的帶寬使用率為 100%。

原文:http://www.h3c.com/en/Support/Resource_Center/Technical_Documents/Home/Switches/00-Public/Trending/Technologies/RDMA_Technology_White_Paper-6W100/

 

二、附錄

1、配置 WRED 命令和參數說明

(摘自:http://www.h3c.com/en/d_201905/1179602_294551_0.htm

S6820交換機Qos命令:http://www.h3c.com/cn/d_201904/1164329_30005_0.htm#_Toc5703597

命令和參數說明

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Create a WRED table and enter its view.

qos wred queue table table-name

N/A

3.     (Optional.) Set the WRED exponent for average queue size calculation.

queue queue-id weighting-constant exponent

The default setting is 9.

4.     (Optional.) Configure the other WRED parameters.

queue queue-id [ drop-level drop-level ] low-limit low-limit high-limit high-limit [ discard-probability discard-prob ]

By default, the lower limit is 100, the upper limit is 1000, and the drop probability is 10.

5.     (Optional.) Enable ECN for a queue.

queue queue-id ecn

By default, ECN is not enabled on a queue.

6.     Return to system view.

quit

N/A

7.     Enter interface view.

interface interface-type interface-number

N/A

8.     Apply the WRED table to the interface.

qos wred apply [ table-name ]

By default, no WRED table is applied to an interface, and tail drop is used on an interface.

A WRED table can be applied to multiple interfaces. For a WRED table already applied to an interface, you can modify the values of the WRED table, but you cannot remove the WRED table.

 顯示和維護 WRED

在任意視圖下執行顯示命令。

Task

Command

Display WRED configuration and statistics for an interface.

display qos wred interface [ interface-type interface-number ]

Display the configuration of WRED tables.

display qos wred table [ name table-name ] [ slot slot-number ]

<H3C>display qos wred table  #顯示所有,發現 display qos wred table name 1無法使用

 

 

# 顯示WRED表1的配置情況,表1是一個已經配置好的WRED參數表。
<Sysname> display qos wred table name 1
Table name: 1
Table type: Queue based WRED
QID   gmin  gmax  gprob  ymin  ymax  yprob  rmin  rmax  rprob  exponent  ECN
----------------------------------------------------------------------------

0     100   1000  10     100   1000  10     100   1000  10     9         N
1     100   1000  10     100   1000  10     100   1000  10     9         N
2     100   1000  10     100   1000  10     100   1000  10     9         N
3     100   1000  10     100   1000  10     100   1000  10     9         N
4     100   1000  10     100   1000  10     100   1000  10     9         N
5     100   1000  10     100   1000  10     100   1000  10     9         N
6     100   1000  10     100   1000  10     100   1000  10     9         N
7     100   1000  10     100   1000  10     100   1000  10     9         N

字段

描述

Table name

WRED表名

Table type

WRED表類型

QID

隊列ID

gmin

綠色報文的隊列下限

gmax

綠色報文的隊列上限

gprob

綠色報文的丟棄概率

ymin

黃色報文的隊列下限

ymax

黃色報文的隊列上限

yprob

黃色報文的丟棄概率

rmin

紅色報文的隊列下限

rmax

紅色報文的隊列上限

rprob

紅色報文的丟棄概率

exponent

計算平均隊列長度指數

ECN

是否對該隊列開啟了擁塞通知功能,Y表示開啟,N表示未開啟

 

WRED 配置示例 

 

 

Network requirements
Configure WRED on interface Ten-GigabitEthernet 1/1/2, so that the packets are dropped as follows when congestion occurs:

·     For the interface to preferentially forward higher-priority traffic, configure a lower drop probability for a queue with a greater queue ID. Set different drop parameters for queue 0, queue 3, and queue 7.

·     Drop packets according to their colors:
¡     In queue 0, set the drop probability to 25%, 50%, and 75% for green, yellow, and red packets, respectively.
¡     In queue 3, set the drop probability to 5%, 10%, and 25% for green, yellow, and red packets, respectively.
¡     In queue 7, set the drop probability to 1%, 5%, and 10% for green, yellow, and red packets, respectively.

·     Enable ECN for queue 7.

Configuration procedure
# Configure a queue-based WRED table, and set different drop parameters for packets with different drop levels in different queues.

<Sysname> system-view
[Sysname] qos wred queue table queue-table1
[Sysname-wred-table-queue-table1] queue 0 drop-level 0 low-limit 128 high-limit 512 discard-probability 25
[Sysname-wred-table-queue-table1] queue 0 drop-level 1 low-limit 128 high-limit 512 discard-probability 50
[Sysname-wred-table-queue-table1] queue 0 drop-level 2 low-limit 128 high-limit 512 discard-probability 75
[Sysname-wred-table-queue-table1] queue 3 drop-level 0 low-limit 256 high-limit 640 discard-probability 5
[Sysname-wred-table-queue-table1] queue 3 drop-level 1 low-limit 256 high-limit 640 discard-probability 10
[Sysname-wred-table-queue-table1] queue 3 drop-level 2 low-limit 256 high-limit 640 discard-probability 25
[Sysname-wred-table-queue-table1] queue 7 drop-level 0 low-limit 512 high-limit 1024 discard-probability 1
[Sysname-wred-table-queue-table1] queue 7 drop-level 1 low-limit 512 high-limit 1024 discard-probability 5
[Sysname-wred-table-queue-table1] queue 7 drop-level 2 low-limit 512 high-limit 1024 discard-probability 10
[Sysname-wred-table-queue-table1] queue 7 ecn
[Sysname-wred-table-queue-table1] quit

# Apply the queue-based WRED table to interface Ten-GigabitEthernet 1/1/2.

[Sysname] interface Ten-GigabitEthernet 1/1/2
[Sysname-Ten-GigabitEthernet1/1/2] qos wred apply queue-table1
[Sysname-Ten-GigabitEthernet1/1/2] quit


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM