【网络】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

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值