一直以来在一个典型的交换三角网络内,存在这样的一个问题:一台没有接入任何一台服务器二层交换机的两个uplink口的RX方向上竟然存在很大的流量。通过在此交换机上抓这两个uplink口的数据包,发现存在很多unicast的包。而从三层交换机上面通过查找arp表和mac表后证明这些数据包不应该会下发到此交换机上。此问题查找了很久都没有找到原因。今天在某朋友的提示下,查看了block-unicast的命令解释。
Understanding How Unicast Flood Blocking Works
You can enable unicast flood blocking on any Ethernet port on a per-port basis. Unicast flood blocking provides you the option to drop the unicast flood packets on an Ethernet port that has only one host that is connected to the port. All the Ethernet ports on a switch are configured to allow unicast flooding; unicast flood blocking allows you to drop the unicast flood packets before they reach the port.
Caution You must have a static CAM entry that is associated with the Ethernet port before you enable unicast flood blocking. If you do not have a static CAM entry that is associated with the port, you will lose network connectivity if you enable unicast flood blocking. You can verify that a static CAM entry exists by entering the show cam static command.
---摘自 [url]http://www.cisco.com/en/US/docs/switches/lan/catalyst6500/catos/8.x/configuration/guide/uniflood.html[/url]
反正此二层交换机下面没有接服务器,于是便在三层交换机的下联此二层交换机的端口上启用了命令:switch block unicast。然后查看二层交换机的端口速率变化,发现很快速率就降到了300K左右,效果非常明显。呵呵,虽然没有从根本上解决上面描述的流量异常转发现象。
然后我通过在此二层交换机下面接入一台服务器(ip=1.1.1.1)来测试启用block-unicast特性的效果。
1,在没有启用block-unicast特性时,在远端长ping 1.1.1.1,然后在三层交换机上面清除此服务器的mac表项,发现根本没有任何丢包;
2,在启用了block-unicast特性后,在远端长ping 1.1.1.1,然后在三层交换机上面清除此服务器的mac表项,发现time-out了,大概丢包15个。
下面来分析一下原因,也即 block-unicast特性的处理机制:在端口A上启用了此特性后,所有发给端口A的数据包都要查看一下端口A的相关mac表项,如果此表项有数据包的目的mac地址,就进行转发;否则丢弃。直到此mac相关的arp表项超时,进行arp洪泛后,交换机学习此mac入mac表,才能通信。
总结:在生产网络上,需要谨慎使用此特性,一般不启用,默认也是不启用。当然在二层交换机的access模式端口可以结合端口安全sticky特性来启用block-unicast。

0

收藏

chris_lee

90篇文章,37W+人气,0粉丝

Ctrl+Enter 发布

发布

取消

推荐专栏更多

5366d1f50328a62facbf5db1d91c319a.png
VMware vSAN中小企业应用案例

掌握VMware超融合技术

共41章 | 王春海
¥51.00 346人订阅
9d82eccb4e3c371eaeac41193bbef757.png
基于Kubernetes企业级容器云平台落地与实践

容器私有云平台实践之路

共15章 | 李振良OK
¥51.00 596人订阅
45862f289339dc922ffda669fd74ad9b.jpg
网工2.0晋级攻略 ——零基础入门Python/Ansible

网络工程师2.0进阶指南

共30章 | 姜汁啤酒
¥51.00 1567人订阅
629650e188ddde78b213e564c2e9ebff.jpg
负载均衡高手炼成记

高并发架构之路

共15章 | sery
¥51.00 507人订阅
dc6736c5fd50474b5df8b76b040e3d03.jpg
带你玩转高可用

前百度高级工程师的架构高可用实战

共15章 | 曹林华
¥51.00 462人订阅
f92360e227f9d91cdff7ea95120630ef.png
left-qr.jpg

扫一扫,领取大礼包

0

1
分享
qr-url?url=https%3A%2F%2Fblog.51cto.com%2Fipneter%2F92230
chris_lee
noavatar_middle.gif