《CCIE路由和交换认证考试指南(第5版) (第1卷)》——1.6节虚拟交换系统

简介:

本节书摘来自异步社区《CCIE路由和交换认证考试指南(第5版) (第1卷)》一书中的第1章,第1.6节虚拟交换系统,作者 【美】Narbik Kocharians(那比克 科查理安) , 【斯洛伐克】Peter Paluch(彼得 派拉奇),更多章节内容可以访问云栖社区“异步社区”公众号查看

1.6 虚拟交换系统
在所有现代网络中,我们发现最重要的事情是创建一个能够为设备、连接和服务,提供高可用性和高可靠性的拓扑。为了配置这些特性和功能,网络工程师通常使用的方法是创建冗余的二层交换环境,比如使用冗余的一对或多条链路来提供多路径。图1-10展示了常见的交换网络配置。


2d9d67f8c1ba8ce596966cdde1d35f5d9153e18f

可以看出,这些冗余网络设备和链路的应用和配置会快速提高网络设计和操作的复杂性。有一个方法可以解决这种复杂性设计,就是部署虚拟交换系统。这项技术能够实际地简化网络,因为它减少了网络设备的数量,工程师无需再对冗余的交换机和链路进行复杂管理了。运行IOS-XE(在本章后文“IOS-XE”小节中详细介绍)的Cisco Catalyst 6500和4500系列交换机能够支持该特性。

在本节的讨论中,我们使用VSS(虚拟交换系统)将一对Catalyst 4500或4500-X系列交换机合并到一台网络设备中。VSS管理冗余链路的方式,从外部设备看来,就像是管理单个Port-Channel。

这种部署方式简化了网络配置和操作,因为它不仅减少了三层路由邻居的整体数量,同时还提供了无环的二层拓扑。

1.6.1 虚拟交换系统
想要部署VSS最基本的原因是想要将一对交换机在逻辑上合并到一台网络设备中,这一点之前已经提过了。为了更好地理解其中的过程,我们需要进一步查看这个特性为逻辑拓扑做哪些事情。举例来说,位于网络中分布层的VSS会与低于自己的接入层和高于自己的核心层进行通信,就好像它是一台交换机,如图1-11所示。


ba2f5423a0e7d93f3a469764eb27d138f1160e55

从图1-11中可以看出,接入层的每台交换机各自使用一个逻辑的Port-Channel连接了两台VSS交换机,因为对于外部设备来说,VSS看起来就是一台单独的交换机——或者说逻辑交换机。VSS设备也做出了相应的改进,比如它们可以在Port-Channel上管理冗余特性和负载均衡特性,以此来掌控链路的行为,即使它实际上连接了两台设备。虽然我们倾向于把VSS配置中的这些交换机看作是独立的设备,但这么说并不准确。虽然这些交换机在物理上是相互分离的实体,但从操作和控制平面看来,它们实际上是一个单元。这种改进提供了无环的二层网络拓扑。由于减少了网络中路由对等体的数量,因此VSS也简化了三层网络拓扑,从而也将网络的简单化扩展到了数据平面中。

1.6.2 VSS主用和VSS备用交换机
前文中讨论的更新,提到了VSS中每台设备的操作,相关内容也可以延伸到“基于角色”的行为。在VSS的环境中,每台独立的交换机首先会为自己争取到一个VSS进程中的特定工作角色,然后根据自己的角色作出相应行为。每一次工程师创建或重启VSS时,对等体交换机之间都会协商各自的角色。最终结果就是一台设备成为VSS主用(Active)交换机,另一台设备成为VSS备用(Standby)交换机。

VSS主用交换机负责控制VSS,并在两台交换机上为交换模块运行二层和三层控制协议。VSS主用交换机也为VSS提供管理功能,比如模块的在线插拔(OIR)操作和接口的控制。

VSS主用和备用交换机在自己本地的接口上,为入向数据流量执行数据包转发。但VSS备用交换机会把所有控制流量发送到VSS主用交换机,让主用交换机进行  处理。

1.6.3 虚拟交换链路
前文提到过,为了使VSS中的两台交换机看起来像是一台网络设备,它们之间需要共享控制信息和数据流量;为了实现这种共享,它们需要具备各自的角色以及诸多不同用途的机制。在这些不同用途的机制设计中,最重要的是连接两台VSS设备的虚拟交换链路。

虚拟交换链路(VSL)是一条特殊的链路,它负责承载VSS两台交换机之间的控制流量和数据流量,详见图1-12。VSL通常被配置为EtherChannel,最多支持8条链路捆绑在一起。并不是只有这种特殊用途的链路能够在VSS对等体之间提供通信路径,但它的优势是能够为控制和管理平面的流量提供更高的优先级,使其优先于数据流量,从而保障控制和管理消息从不会被丢弃。多条VSL链路之间的数据流量负载均衡可以通过默认的方法实现,也可以通过配置EtherChannel负载均衡算法来实现。


5cfe4c93290e6e4fbec16c20ea9984ade1b921af

1.6.4 多机框EtherChannel(MEC)
读者从前文中已经可以看出EtherChannel的重要性了。EtherChannel(也可以称为Port-Channel)是两条或多条物理链路的集合,将这些物理链路合并成为一条逻辑链路。EtherChannel作为一个单独的逻辑实体,交换机可以在它之上运行二层协议。这一概念也使另一些协议进行了相应调整,比如生成树协议(STP),STP通常会阻塞设备之间的冗余链路,以防止产生交换环路。但我们这里所描述的概念是一种特殊类型的Port-Channel,它不仅可以建立在两台物理设备之间,还可以建立在多个机框(Chassis)之间;提供了普通EtherChannel环境中无法提供的硬件或设备故障倒换功能。这是因为VSS能够创建MEC,而MEC这个EtherChannel中的成员接口可以分布在多台VSS成员交换机上。非VSS交换机连接到VSS的话,MEC在它看来就是标准的EtherChannel,非VSS交换机可以使用双站(Dual-Homed)的方式进行连接。流经MEC的流量可以在VSS成员交换机中实现负载均衡,这与标准EtherChannel非常类似。Cisco MEC支持动态EtherChannel协议,包括工业标准的LACP(链路汇聚控制协议)和Cisco私有的PAgP(端口汇聚协议),MEC还支持静态EtherChannel配置。总的来说,VSS最多可以支持256条EtherChannel,这一数量限制是普通EtherChannel和MEC的总和。

1.6.5 基本VSS配置
为了创建VSS所需的最基本配置,首先需要在VSS的两台设备上创建相同的虚拟交换域。在VSS的两台交换机上,这个交换域体现为一个编号,这个编号必须在1~255的范围内。在分配好域编号后,工程是必须将其中一台路由器配置为switch 1,另一台交换机配置为switch 2,如例1-8所示。

例1-8 分配虚拟交换域和交换机号码

SW1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)# switch virtual domain 10
Domain ID 10 config will take effect only
after the exec command 'switch convert mode virtual' is issued
SW1(config-vs-domain)# switch 1
SW1(config-vs-domain)# exit
SW1(config)#

SW2# conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)# switch virtual domain 10
Domain ID 10 config will take effect only
after the exec command 'switch convert mode virtual' is issued
SW2(config-vs-domain)# switch 2
SW2(config-vs-domain)# exit
SW2(config)# 
接下来,工程师需要创建VSL,这需要在每台交换机上都创建一个唯一的Port-Channel,详见例1-9。在配置过程中,两个Port-Channel都是在VSS主动交换机上建立的。如果VSS备用交换机的VSL Port-Channel号码已经用于了其他用途,VSS将会启动为路由处理器冗余模式。为了避免这种情况,要确保使用的Port-Channel号码在两台交换机上都是可用的。

例1-9 配置VSL Port-Channel

SW1(config)# int port-channel 5
SW1(config-if)# switchport
SW1(config-if)# switch virtual link 1
SW1(config-if)# no shut
SW1(config-if)# exit
*Jan 24 05:19:57.092: %SPANTREE-6-PORTDEL_ALL_VLANS: Port-channel5 deleted from all
 Vlans

SW2(config)# int port-channel 10
SW2(config-if)# switchport
SW2(config-if)# switch virtual link 2
SW2(config-if)# no shut
SW2(config-if)# exit
SW2(config)#
*Jan 24 05:14:17.273: %SPANTREE-6-PORTDEL_ALL_VLANS: Port-channel10 deleted from
 all Vlans
现在已经配置好Port-Channel接口了,接下来需要将VSL物理成员接口添加到相应的Port-Channel中。在例1-10中,SW1上的接口GE 7/3和7/4将要与SW2上的接口GE 4/45和4/46连接在一起。

例1-10 配置VSL接口

SW1(config)# int range gig7/3 - 4
SW1(config-if-range)# switchport mode trunk
SW1(config-if-range)# channel-group 5 mode on
WARNING: Interface GigabitEthernet7/3 placed in restricted config mode. All
 extraneous configs removed!
WARNING: Interface GigabitEthernet7/4 placed in restricted config mode. All
 extraneous configs removed!
SW1(config-if-range)# exit

SW2(config)# int range gig4/45 - 46
SW2(config-if-range)# switchport mode trunk
SW2(config-if-range)# channel-group 10 mode on
WARNING: Interface GigabitEthernet4/45 placed in restricted config mode. All
 extraneous configs removed!
WARNING: Interface GigabitEthernet4/46 placed in restricted config mode. All
 extraneous configs removed!
SW2(config-if-range)# exit
注释:
在使用channel-group命令将接口放入VSL Port-Channel后,接口会进入“notconnect(无连接)”状态。接口状态会显示为“up”,但线路协议状态将显示为“down”。在交换机重启之前,接口将一直为up/down (notconnect)状态。
接着工程师需要在SW1上使用命令switch convert mode virtual,完成交换机转换过程。系统会提示工程师确认这一行为,这时输入yes,详见例1-11。这时系统会创建一个转换配置文件,并存入系统的bootflash中。

在两台交换机上都确认完毕后,运行配置文件(running-config)会被保存为启动配置文件(startup-config),并且交换机会重启。重启后,交换机就进入了虚拟交换模式。

例1-11 将交换机转换为虚拟交换模式

SW1# switch convert mode virtual

This command will convert all interface names
to naming convention "interface-type switch-number/slot/port",
save the running config to startup-config and

reload the switch.
Do you want to proceed? [yes/no]: yes
Converting interface names
Building configuration...
Compressed configuration from 6551 bytes to 2893 bytes[OK]
Saving converted configuration to bootflash: ...
Destination filename [startup-config.converted_vs-20130124-062921]?
Please stand by while rebooting the system...
Restarting system.

Rommon (G) Signature verification PASSED
Rommon (P) Signature verification PASSED
FPGA  (P) Signature verification PASSED

Similarly you need to enter the "switch convert mode virtual" command on Switch 2
 for converting to Virtual Switch Mode.

SW2# switch convert mode virtual

This command will convert all interface names
to naming convention "interface-type switch-number/slot/port",
save the running config to startup-config and
reload the switch.
Do you want to proceed? [yes/no]: yes
Converting interface names
Building configuration...
Compressed configuration from 6027 bytes to 2774 bytes[OK]
Saving converted configuration to bootflash: ...
Destination filename [startup-config.converted_vs-20130124-052526]?
Please stand by while rebooting the system...
Restarting system.

Rommon (G) Signature verification PASSED
Rommon (P) Signature verification PASSED
FPGA  (P) Signature verification PASSED



************************************************************
*                                *
* Welcome to Rom Monitor for WS-X45-SUP7-E System.     *
* Copyright (c) 2008-2012 by Cisco Systems, Inc.      *
* All rights reserved.                     *
*                                *
************************************************************

1.6.6 VSS检查过程
工程师可以使用简单的show命令来查看与特定VSS对相关的VSS配置信息,通过命令show switch virtual可以查看每台交换机的交换机号码和角色,详见例1-12。

例1-12 查看虚拟交换域编号

SW1# sh switch virtual

Executing the command on VSS member switch role = VSS Active, id = 1

Switch mode           : Virtual Switch
Virtual switch domain number  : 10
Local switch number       : 1
Local switch operational role  : Virtual Switch Active
Peer switch number        : 2
Peer switch operational role  : Virtual Switch Standby

Executing the command on VSS member switch role = VSS Standby, id = 2

Switch mode            : Virtual Switch
Virtual switch domain number  : 10
Local switch number       : 2
Local switch operational role  : Virtual Switch Standby
Peer switch number        : 1
Peer switch operational role  : Virtual Switch Active
要想让VSS正常运行,最重要的一点是确保一台交换机是主用交换机,另一台是备用交换机。备用交换机的控制模式应该与例1-13所示相同。

例1-13 备用交换机的控制模式

SW2-standby>
Standby console disabled

正如理论部分所讨论的,对于VSS来说,有很多角色和配置要求。工程师可以使用命令show switch virtual role来查看VSS中每台交换机的变量。例1-14展示了使用这条命令输出的类型和详细信息。

工程师可以使用命令show switch virtual link来查看有关VSL的信息,详见例1-15。

例1-14 虚拟角色分配和优先级

SW1# sh switch virtual role
Executing the command on VSS member switch role = VSS Active, id = 1
RRP information for Instance 1
--------------------------------------------------------------------
Valid Flags  Peer    Preferred Reserved
         Count    Peer    Peer
--------------------------------------------------------------------
TRUE  V     1       1     1
Switch Switch Status Preempt    Priority Role   Local    Remote
    Number     Oper(Conf)  Oper(Conf)      SID    SID
--------------------------------------------------------------------
LOCAL  1   UP    FALSE(N )  100(100) ACTIVE   0      0
REMOTE 2   UP    FALSE(N )  100(100) STANDBY   6834   6152

Peer 0 represents the local switch

Flags : V - Valid
In dual-active recovery mode: No

Executing the command on VSS member switch role = VSS Standby, id = 2

RRP information for Instance 2

--------------------------------------------------------------------
Valid Flags  Peer    Preferred Reserved
       Count      Peer    Peer

--------------------------------------------------------------------
TRUE  V   1         1      1

Switch Switch Status Preempt    Priority Role    Local    Remote
    Number    Oper(Conf)  Oper(Conf)      SID    SID
--------------------------------------------------------------------
LOCAL  2   UP   FALSE(N )   100(100) STANDBY  0    0
REMOTE 1   UP   FALSE(N )   100(100) ACTIVE   6152    6834

Peer 0 represents the local switch

Flags : V - Valid
In dual-active recovery mode: No
例1-15 虚拟交换链路详情

SW1# sh switch virtual link

Executing the command on VSS member switch role = VSS Active, id = 1

VSL Status : UP
VSL Uptime : 3 minutes
VSL Control Link : Gi1/7/4

Executing the command on VSS member switch role = VSS Standby, id = 2

VSL Status : UP
VSL Uptime : 3 minutes
VSL Control Link : Gi2/4/45

除此之外,工程师还可以使用命令show switch virtual link port-channel来查看有关VSL Port-Channel配置的信息,详见例1-16。

例1-16 查看VSL Port-Channel

SW1# sh switch virtual link port-channel

Executing the command on VSS member switch role = VSS Active, id = 1

Flags: D - dow-     P - bundled in port-channel
    I - stand-alone s - suspended
    H - Hot-standby (LACP only)
    R - Layer3    S - Layer2
    U - in use    N - not in use, no aggregation
    f - failed to allocate aggregator

    M - not in use, no aggregation due to minimum links not met
    m - not in use, port not aggregated due to minimum links not met
    u - unsuitable for bundling
    d - default port

    w - waiting to be aggregated

Group Port-channel Protocol Ports
------+-------------+---------+-------------------
5   Po5(SU)      -    Gi1/7/3(P) Gi1/7/4(P)
10   Po10(SU)     -    Gi2/4/45(P) Gi2/4/46(P)

Executing the command on VSS member switch role = VSS Standby, id = 2

Flags: D - dow-      P - bundled in port-channel
    I - stand-alone s - suspended
    H - Hot-standby (LACP only)
    R - Layer3    S - Layer2
    U - in use    N - not in use, no aggregation
    f - failed to allocate aggregator

    M - not in use, no aggregation due to minimum links not met
    m - not in use, port not aggregated due to minimum links not met
    u - unsuitable for bundling
    d - default port

    w - waiting to be aggregated

Group Port-channel Protocol Ports
------+-------------+-----------+-------------------
5   Po5(SU)      -     Gi1/7/3(P) Gi1/7/4(P)
10   Po10(SU)     -     Gi2/4/45(P) Gi2/4/46(P)

SW1#
相关实践学习
部署高可用架构
本场景主要介绍如何使用云服务器ECS、负载均衡SLB、云数据库RDS和数据传输服务产品来部署多可用区高可用架构。
负载均衡入门与产品使用指南
负载均衡(Server Load Balancer)是对多台云服务器进行流量分发的负载均衡服务,可以通过流量分发扩展应用系统对外的服务能力,通过消除单点故障提升应用系统的可用性。 本课程主要介绍负载均衡的相关技术以及阿里云负载均衡产品的使用方法。
相关文章
|
6月前
|
网络协议 安全 网络虚拟化
【Cisco】路由与交换笔记
【Cisco】路由与交换笔记
41 0
|
网络虚拟化
《CCIE路由和交换认证考试指南(第5版) (第1卷)》——导读
本节书摘来自异步社区《CCIE路由和交换认证考试指南(第5版) (第1卷)》一书中的目录,作者 【美】Narbik Kocharians(那比克 科查理安) , 【斯洛伐克】Peter Paluch(彼得 派拉奇),更多章节内容可以访问云栖社区“异步社区”公众号查看
1781 0
《CCIE路由和交换认证考试指南(第5版) (第2卷)》——导读
本节书摘来自异步社区《CCIE路由和交换认证考试指南(第5版) (第2卷)》一书中的目录,作者 【美】那比克 科查理安(Narbik Kocharians) , 特里 文森(Terry Vinson) , 瑞克 格拉齐亚尼(Rick Graziani),更多章节内容可以访问云栖社区“异步社区”公众号
1831 0