Author: Ken

  • PortFast

    就像我曾经说过,不同于产品设计和程序研发,有些问题的出现一定是有原因的,即使它是一个很小的问题,上周刘哥和龙哥的电脑相继出现无法获取IP地址的情况,使他们的工作受到了影响,让我深感愧疚,虽然他们的系统都是瘟到死Vista,但是,其实我早就发现了局域网自动分配地址的速度很慢,只是问题不够明显。虽然问题不明显,但我一直在思考这个问题,经过我英明的分析和搜索,原来这个问题是早有案例的……
    Using PortFast and Other Commands to Fix Workstation Startup Connectivity Delays
    http://www.cisco.com/en/US/products/hw/switches/ps700/products_tech_note09186a00800b1500.shtml#cnf2k
    —高科技分隔线—
    Introduction
    This document addresses initial connectivity delays that occur when workstations that are connected to switches have one of these two issues:
    *Unable to log in to a network domain, either Microsoft Windows NT or Novell
    *Unable to obtain a DHCP address
    The steps in this document are easy to implement and address the most common causes of workstation connectivity delays that you encounter during the workstation initialization/startup phase.
    —高科技分隔线—
    Spanning Tree
    If you have recently migrated from a hub environment to a switch environment, startup connectivity delays can appear because a switch works much differently than a hub. A switch provides connectivity at the data link layer, not at the physical layer. The switch uses a bridging algorithm in order to decide if packets that are received on a port need to be transmitted out other ports. The bridging algorithm is susceptible to physical loops in the network topology. Because of this susceptibility to loops, switches run the protocol STP that causes loops to be eliminated in the topology. When you run STP, all ports that are included in the spanning tree process become active much slower than they otherwise become active as STP detects and blocks loops. A bridged network that has physical loops, without STP, breaks. Despite the time that the process involves, STP is beneficial. STP that runs on Catalyst switches is an industry-standard specification (IEEE 802.1D).

    After a port on the switch has linked and joined the bridge group, STP runs on that port. A port that runs STP can be in one of five states:

    *blocking
    *listening
    *learning
    *forwarding
    *disabled

    STP dictates that the port starts out blocking, and then immediately moves through the listening and learning phases. By default, the port spends approximately 15 seconds listening and 15 seconds learning. During the listening state, the switch tries to determine where the port fits in the spanning tree topology. The switch especially wants to know whether this port is part of a physical loop. If the port is part of a loop, the port can be chosen to go into blocking mode. The blocking mode means that the port does not send or receive user data in order to eliminate loops. If the port is not part of a loop, the port proceeds to the learning state, in which the port learns which MAC addresses live off this port. This entire STP initialization process takes about 30 seconds.

    If you connect a workstation or a server with a single NIC card or an IP phone to a switch port, the connection cannot create a physical loop. These connections are considered leaf nodes. There is no reason to make the workstation wait 30 seconds while the switch checks for loops if the workstation cannot cause a loop. Cisco added the PortFast or fast-start feature. With this feature, the STP for this port assumes that the port is not part of a loop and immediately moves to the forwarding state and does not go through the blocking, listening, or learning states. This command does not turn STP off. This command makes STP skip a few initial steps (unnecessary steps, in this circumstance) on the selected port.
    —高科技分隔线—
    用中文来说,上面这一段话可以解读为:处于OSI二层的STP协议定义了一个交换机的端口的五种状态,你看上面有blocking,listening,learning,forwarding,disabled这么些状态,显然只有forwarding状态才是工作状态,而一个交换机端口从加电开始,先要经过listening,learning,forwarding这么个顺序来启动,主要是为了检测端口上有木有环路,以免造成网络风暴而致堵塞,看看需不需要blocking。

    遗憾的是,这每个过程至少需要十五秒的时间,于是就造成了dhcp超时,以致于电脑获取不到IP地址,而上面说到,刘哥和龙哥的问题,他们把电脑重启就解决了,是因为这个端口已经进入了forwarding状态,那莫这个问题应该怎么来解决呢?

    这篇文档中说到,Cisco added the PortFast or fast-start feature,思科添加了一个portfast功能,跳过listening,learning,直接进入forwarding状态。

    但为什么金阳办公区其它的电脑都木有问题,就刘哥和龙哥的瘟到死Vista出了问题,这究竟是为虾米呢?这说明瘟到死Vista启动网络链路的时间和系统主要部件启动时间一致,而瘟到死XP和瘟到死⑦在启动系统主要部件之前已经启动了网络链路,这也是自瘟到死NT以来一直的做法,可见瘟到死Vista的命运的确是早已注定…….

    那莫,如何开启portfast呢?这就太简单了,如图所示:
    conf t
    interface fastEthernet 0/1
    spanning-tree portfast


    那莫,为什么原有的STP协议中没有把这么方便的一个功能加进去呢?看上面那么大一段Warning就知道了~啊,原来是loops的后果很坏很严重……开启了portfast的端口只能接一个网络设备,也就是说,在开启了portfast得端口上,如果出现了环路,哇,居然可以network cannot recover,不过对于我们这种小型办公网络而言,最多也就是个网速超慢……总之呢,就是开启了portfast的端口,是不能接交换机,路由器,集线器等等设备的,也就是说,只能有一个NIC,一个MAC地址(当然是同时)。
    —还是高科技分隔线—
    Caution: Never use the PortFast feature on switch ports that connect to other switches, hubs, or routers. These connections can cause physical loops, and spanning tree must go through the full initialization procedure in these situations. A spanning tree loop can bring your network down. If you turn on PortFast for a port that is part of a physical loop, there can be a window of time when packets are continuously forwarded (and can even multiply) in such a way that the network cannot recover.
    —还是高科技分隔线—
    这篇文档居然还无聊地对端口up时间做了个benchmark(请参考原文中Timing Tests on the Catalyst 2900XL段落),结果是可以把三十秒的时间缩短为一秒……效果还是很明显的,等于是把网线插入电脑就可以上网了,零等待~
    于是我把办公室那个交换机的portfast功能也打开了,明天上班看下效果……当然,连服务器和无线AP以及上行防火墙的端口显然是不能打开的……

    点击按钮即可播放

    点这里下载MP3文件(3.72MB)

  • 居然是玫瑰花

    我想夏天快要来了,每到夏天的时候,我的右手就会止不住的抖,很像老年帕金森的症状,一年比一年愈加明显。

    尝试着把儒哥那台视频直播的服务器运行信息通过snmp直接返回到金阳这边的机器上,以便监测,未果,经过我英明的判断,国研机房显然没有DMZ整个机器,而只是开放了部分端口。

    中午正准备出去吃饭的时候,看见门口有一个心形的盒子,问了下门口正在吃饭的晓红姐,她说是别人送来给果姐的,居然是玫瑰花!还是粉色的,用一个心形的紫色盒子装着,我粗略的数了一下,大概有三十几朵,满满的挤在一起,煞是好看,旁边点缀的小草似乎是满天星,不过我觉得紫色的盒子颜色似乎不够华丽,和整体的感觉有一些差异,到底是谁送的呢?里面还有一张小卡片,不知道写的是什么。豪哥过来找琦姐说事情,没找着人,看见了果姐桌子上的花,大惊:哎哟谁这么有创意。由于果姐最近和我处于断绝关系的过程中,顺便也和儒哥断绝了关系,所以在她回到座位之后,我们依然不知道这盒玫瑰花是谁送的,根据我英明的分析,今天既不是她的生日,也没有听到她看见花之后给她男朋友打电话,所以这个花肯定不是她男朋友送的,难道是……


    我发现多芬的香皂用得太快了……可能是长得都比较小一号的缘故。

  • 艺术作品在金马甲上竞拍的可能

    《全城热恋》的故事太过紧凑,画面也不够唯美,本来二十年前的画面可以拍得很漂亮的,就算二十年前的不能拍得很漂亮,那么大S的那段,也还是比较酷,但还可以更写意一些,当然,这些都可能是因为情节太过紧凑导致的。

    昨天在葳君住所讨论关于艺术品拿到金马甲上竞拍的可能性,得知已有网站在做类似的事情,艺术品出售不同于普通的商品,就大概的程序而言,可能涉及到两个比较严峻的问题,
    第一点是艺术品的评估和鉴定,对于当代艺术作品而言,如果艺术家本人出售或代售,那这个会比较简单,因为艺术家本人会给出自己的定价,如果是传统艺术作品,祖传的花瓶或者清明上河图,这个真品和赝品的鉴定,在传统的艺术品交易行业,是由拍卖行组织专家直接鉴定,风险由拍卖行承担,艺术家或者藏品持有者并不对此负责,如果拿到金马甲上来做,这个问题由谁来解决?由金马甲出面让第三方的机构来评估?因为藏品持有者一般是不会做这个事情的,或者说金马甲只做那些已经转过手的,拥有合法身份,公开价格的艺术品,如果这样做,那么很显然,会丢失巨大的利润,因为当代艺术作品的升值空间才是最大的。
    第二点,就是艺术品通常会经多次转手,而每一次的转手,都会为它下一次的升值做铺垫,传统拍卖行的流拍,对一件艺术品的打击是巨大的,特别是当代艺术作品,所以寄卖的画廊通常会阻止流拍的可能,在艺术品可能流拍的时候直接拍下这件作品,虽然会付出不菲的手续费,但画廊可以预期在下一次的转手中,在这个价格的基础上再行获利,这是有风险的,如果放到金马甲上来做,如果我们要设立这样的机制,那么风险是存在的,如果没有类似的机制防止流拍,那么很快在艺术圈内就会产生抵制这个平台的情绪,很快就不会再有艺术家把作品拿到金马甲上来出售了。现有的类似网站,例如嘉德在线(嘉德国际拍卖有限公司)在竞拍方式上,实际上是综合了淘宝的代理出价特性和金马甲的限时竞价概念,但他们关注的市场显然不够高端,几百块几千块的艺术作品比比皆是,而当代艺术家作品在这个价格的,多是刚走出校园的学生。至于另外一种类似于银行基金的艺术品分拆出售方式,倒是很像金马甲之前做的事情,也就是银行购买一般人无法购买的,上千万或上亿的艺术作品,然后分拆为若干份,人们可以像买基金一样购买若干小份,待艺术品升值之后,即可获利,这种方式在国外应用较多,国内有少数银行参与,但是很显然,真正的收藏家不会这样来购买艺术品,而那些投机者又不会具备这样的眼光和鉴别能力,目标受众过于狭窄可能是这种模式在国内无法扩张的原因。葳君的手中有众多的当代艺术家资源,但他并不愿意匆忙的把这些艺术家的作品拿到金马甲上来,因为在艺术界,声誉比金钱要重要得多。