目录

简介

本文档提供了对虚拟交换系统(VSS)网络中的数据包流进行故障排除的指南。尽管此示例重点讨论的是 VSS 网络的故障排除,但所论述的一般原则对任何采用冗余链路设计的网络都适用。

先决条件

要求

Cisco 建议您了解以下主题:

使用的组件

本文档中的信息基于 Cisco Catalyst 6500 系列交换机,其中配有 Supervisor VS-S720-10G-3C/XL 并运行 Cisco IOS® 软件版本 12.2(33)SXH1 或更高版本。

本文档中的信息都是基于特定实验室环境中的设备编写的。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。

规则

有关文档规则的详细信息,请参阅 Cisco 技术提示规则。

背景信息

有关使用 VSS 的典型网络设计,请参阅网络图。当为 VSS 配置两台 Cisco 交换机时,它们对网络显示为单个逻辑交换机。为实现冗余,每个连接到虚拟交换机的节点都应至少包含一个连接到每个物理机箱的链路。使用冗余链路的首选方法是通过多机箱EtherChannel(MEC),但也可以使用等价多路径(ECMP)。MEC 是优于 ECMP 的首选连接方法,因为当一台交换机发生故障时,MEC 可实现更快的单播和多播收敛次数。

有关详细信息,请参阅上游链路恢复部分(Cisco Catalyst 6500 虚拟交换系统部署最佳实践)。

VSS的虚拟化特性使人们需要使用新的故障排除工具来跟踪网络中数据包的路径。常见的数据包路径故障排除方法(例如查看 MAC 地址表或路由表以确定下一跳)会返回一个端口信道接口或多个下一跳接口,因此对于 VSS 网络不是很有用。本文档旨在显示Catalyst 6500平台上可用的哪些Cisco CLI命令可用于收集有关数据包路径的更有用的数据。

网络图

本文档使用以下网络设置:

vss-pf-tshoot1.gif

了解 Catalyst 6500 交换机上的 EtherChannel

确定负载平衡算法

在所有Cisco Catalyst交换机中,EtherChannel链路都根据数据包报头中某些字段的哈希值(例如源和目的MAC、IP或第4层端口号)进行选择。由于此信息对于特定流中的所有数据包均相同,因此 EtherChannel 负载平衡有时也称作基于流

在 Catalyst 6500 交换机上,可以使用 show etherchannel load-balance 命令找到用于此哈希的字段。

PFC-3B#show etherchannel load-balance
EtherChannel Load-Balancing Configuration:
        src-dst-ip
        mpls label-ip

EtherChannel Load-Balancing Addresses Used Per-Protocol:
Non-IP: Source XOR Destination MAC address
  IPv4: Source XOR Destination IP address
  IPv6: Source XOR Destination IP address
  MPLS: Label or IP

如此处所示,对非 IP 数据流(如 IPX 和 AppleTalk)的哈希处理基于源和目标 MAC 地址,而对 IPv4 和 IPv6 数据流的哈希处理则基于源和目标 IP 地址。对 MPLS 数据包的哈希处理不在本文档的讨论范围之内。以上设置为 Catalyst 6500 上的默认值。

没有其他可用于 IPv6 或非 IP 数据包的负载平衡配置选项。但对于 IPv4 数据包,有其他可能的负载平衡配置,如下所示:

EtherChannel 负载平衡配置可通过 port-channel load-balance 命令进行更改。

SW1(config)#port-channel load-balance ?
  dst-ip                 Dst IP Addr
  dst-mac                Dst Mac Addr
  dst-mixed-ip-port      Dst IP Addr and TCP/UDP Port 
  dst-port               Dst TCP/UDP Port
  mpls                   Load Balancing for MPLS packets
  src-dst-ip             Src XOR Dst IP Addr
  src-dst-mac            Src XOR Dst Mac Addr
  src-dst-mixed-ip-port  Src XOR Dst IP Addr and TCP/UDP Port
  src-dst-port           Src XOR Dst TCP/UDP Port
  src-ip                 Src IP Addr
  src-mac                Src Mac Addr
  src-mixed-ip-port      Src IP Addr and TCP/UDP Port
  src-port               Src TCP/UDP Port

还必须注意的一点的是,由于在 Supervisor 720-10GE 上引入了 PFC-3C(XL),负载平衡算法略有改动。在PFC-3C上,除了为IPv4和IPv6数据包配置的字段外,散列算法始终将VLAN考虑在内。

例如,在src-dst-ip enhanced的默认配置中(如下所示),PFC会考虑源和目标IP以及VLAN以计算哈希值。请注意,用作输入的VLAN应是数据包的入口VLAN。如果入口接口配置为第3层,则必须输入该接口的内部VLAN,如show vlan internal usage命令所示。

PFC-3C#show etherchannel load-balance
EtherChannel Load-Balancing Configuration:
        src-dst-ip enhanced
        mpls label-ip

EtherChannel Load-Balancing Addresses Used Per-Protocol:
Non-IP: Source XOR Destination MAC address
  IPv4: Source XOR Destination IP address
  IPv6: Source XOR Destination IP address
  MPLS: Label or IP

确定输出接口 – 独立 Catalyst 6500

确定系统的负载平衡算法后,可以使用此 CLI 为特定的数据包确定所选 EtherChannel 中的物理接口(仅在版本 12.2(33)SXH 及更高版本中可用)。

Router#show etherchannel load-balance hash-result interface port-channel 1 ?
  ip      IP address
  ipv6    IPv6
  l4port  Layer 4 port number
  mac     Mac address
  mixed   Mixed mode: IP address and Layer 4 port number
  mpls    MPLS

之前的命令需谨慎使用,因为它不会验证数据输入是否与负载平衡算法中使用的数据相匹配。如果输入到该 CLI 中的信息过多或过少,都会出现提示返回一个物理接口。但返回的接口可能不正确。以下是一些正确使用的命令示例:

注意:由于空间限制,某些命令会移至第二行。

在使用 src-dst-ip 算法的 PFC-3B 系统上:

PFC-3B#show etherchannel load-balance hash-result interface port-channel 
1 ip 10.1.1.1 10.2.2.2

Computed RBH: 0x1
Would select Gig3/2 of Po1

在使用 src-dst-ip 增强算法的 PFC-3C 系统上:

PFC-3C#show etherchannel load-balance hash-result interface port-channel 
1 ip 10.1.1.1 vlan 10 10.2.2.2

Computed RBH: 0x1
Would select Gig3/2 of Po1

在采用src-dst-ip增强算法的PFC-3C系统上,入口接口为第3层:

PFC-3C#show vlan internal usage | include Port-channel 2

1013 Port-channel 2
PFC-3C#
PFC-3C#show etherchannel load-balance hash-result interface port-channel 1 
ip 10.1.1.1 vlan 1013 10.2.2.2

Computed RBH: 0x1
Would select Gig3/2 of Po1

在使用 src-dst-mixed-ip-port 增强算法的 PFC-3CXL 系统上:

PFC-3CXL#show etherchannel load-balance hash-result interface port-channel 
1 mixed 10.1.1.1 1600 10 10.2.2.2 80

Computed RBH: 0x1
Would select Gig3/2 of Po1

确定输出接口 – VSS

独立 Catalyst 6500 和 VSS EtherChannel 哈希处理之间存在一个非常重要的差别。这个差别是,VSS 会始终将数据流转发至同一交换机上的可用 EtherChannel 链路。这样是为了最大程度地缓解 VSL 上的拥塞状况。无论交换机之间的带宽是否平均分配,都是如此。换句话说,如果一台 VSS 交换机有 4 条链路在 EtherChannel 中处于活动状态,而其他交换机仅有 1 条活动链路,则具有 1 条活动链路的交换机会尝试将所有本地数据流都转发到该条链路之外,而非通过 VSL 发送任何数据流。

由于存在这种差别,因此在使用 hash-result 命令时需要指定 VSS 交换机编号。如果没有在 hash-result CLI 中输入交换机 ID,则 VSS 会假定为 switch 1。

在使用 src-dst-ip 增强算法的 PFC-3C VSS 系统上:

VSS-3C#show etherchannel load-balance hash-result interface port-channel 
1 switch 1 ip 10.1.1.1 vlan 10 10.2.2.2

Computed RBH: 0x1
Would select Gig3/2 of Po1

在使用 src-dst-mixed-ip-port 增强算法的 PFC-3CXL VSS 系统上:

VSS-3CXL#show etherchannel load-balance hash-result interface port-channel 
1 switch 2 mixed 10.1.1.1 1600 10 10.2.2.2 80

Computed RBH: 0x1
Would select Gig3/2 of Po1

了解 Catalyst 6500 交换机上的 ECMP

确定负载平衡算法

等价多路径(ECMP)是指路由器具有多条等价路径到前缀,从而在每条路径上对流量进行负载均衡的情况。Catalyst 6500 上的负载平衡在 MLS CEF 内实施,且和 EtherChannel 一样都是基于流的。

Catalyst 6500 提供了一些哈希算法的选项:

VSS(config)#mls ip cef load-sharing ?
  full    load balancing algorithm to include L4 ports
  simple  load balancing algorithm recommended for a single-stage CEF router

VSS(config)#mls ip cef load-sharing full ?
  simple        load balancing algorithm recommended for a single-stage CEF router
  <cr>

关键字 simple 和 CEF 极化不在本文档的讨论范围之内。有关详细信息,请参阅使用 Cisco 快速转发调整负载平衡

目前没有 CLI 可用于检查正在使用的负载共享算法。要找出正在使用的方法,最佳方式是通过 show running-config 命令检查正在运行的配置。如果目前没有以 mls ip cef load-sharing 开头的配置,则正在使用的是默认的源和目标不等权重算法。

确定输出接口 – 独立 Catalyst 6500

在独立交换机上,可以使用此命令确定 ECMP 的输出接口。

VSS#show mls cef exact-route ?
  A.B.C.D  src IP address
  vrf      Show numeric VPN Routing/Forwarding ID

在下一个示例中,存在到10.100.4.0/24的等价路由。这是对此子网中的两个目标使用exact-route命令的示例。

SW1#show mls cef exact-route 10.100.3.1 10.100.4.1

Interface: Gi3/14, Next Hop: 10.100.2.1, Vlan: 1067, Destination Mac: 000b.000b.000b

SW1#show mls cef exact-route 10.100.3.1 10.100.4.2

Interface: Gi3/13, Next Hop: 10.100.1.1, Vlan: 1066, Destination Mac: 000c.000c.000c

如果系统已配置为完全负载共享模式(其中第4层端口包含在哈希中),则命令的输入方式如下:

SW1#show mls cef exact-route 10.100.3.1 10.100.4.1

% System is configured in full load-sharing mode. Layer 4 ports needed

SW1#show mls cef exact-route 10.100.3.1 1024 10.100.4.1 80

Interface: Gi3/14, Next Hop: 10.100.2.1, Vlan: 1067, Destination Mac: 000b.000b.000b

SW1#show mls cef exact-route 10.100.3.1 1024 10.100.4.1 81

Interface: Gi3/13, Next Hop: 10.100.1.1, Vlan: 1066, Destination Mac: 000c.000c.000c

如此处所示,exact-route 命令内置了健全性检查,可避免返回无效接口。如果输入的信息太少,当系统处于完全模式时第4层端口丢失,则会出现错误。如果提供的信息太多,例如默认模式下的第4层端口,则忽略无关信息并返回正确的接口。

确定输出接口 – VSS

和 EtherChannel 的情况相同,VSS 会对自身编程,以便始终发送尝试以将数据流发送到本地交换机上的 ECMP 链路,而非通过 VSL。通过将每个交换机的 MLS CEF 编程为仅包含本地交换机 ECMP 邻接关系,可以实现此目的。鉴于此,为获得有用的输出,有必要将交换机 ID 包含在确切的路由 CLI 中。如果没有输入交换机编号,VSS 将提供与活动交换机相关的信息。

VSS#show mls cef exact-route 10.100.4.1 10.100.3.1 switch 1

Interface: Gi1/1/13, Next Hop: 10.100.1.2, Vlan: 1095, Destination Mac: 0013.5f1d.32c0

VSS#show mls cef exact-route 10.100.4.1 10.100.3.1 switch 2

Interface: Gi2/1/13, Next Hop: 10.100.2.2, Vlan: 1136, Destination Mac: 0013.5f1d.32c0

故障排除情况

以下故障排除情况的目的在于显示如何利用先前所了解的概念跟踪从 Host1 到 Host2 的数据包流。每种情况都涉及不同的网络拓扑或情形。

情况 1 - 使用第 2 层 MEC 的两台接入层主机之间的数据包流

vss-pf-tshoot2.gif

拓扑信息:

  1. 跟踪从 Host1 到 VSS 分布层的路径

    由于 Host2 与 Host1 所在的 VLAN 不同,Host1 的子网掩码决定数据包必须进入 VSS 分布层进行路由。要找到 Host1 与 VSS 分布层之间的数据包的路径,必须首先确定 Host1 的默认网关的 MAC 地址。在大多数操作系统中,打开命令提示符并发出 arp -a 将显示默认网关的 IP 到 MAC 映射。在 Host1 上发出此命令时,对于 10.0.1.1 返回的 MAC 为 000a.000a.000a。现在可以在 SW1 的 MAC 地址表中查找此 MAC。

    SW1#show mac-address-table address 000a.000a.000a
    
    Legend: * - primary entry
            age - seconds since last seen
            n/a - not available
    
      vlan   mac address     type    learn     age              ports
    ------+----------------+--------+-----+----------+--------------------------
    Supervisor:
    *    10  000a.000a.000a   dynamic  Yes          0   Po1

    此输出显示与主机1的默认网关对应的MAC地址是通过端口通道1获知的。但此输出未显示的是为特定数据包选择了etherchannel中的哪条链路。为了对此进行确定,必须首先检查 EtherChannel 负载平衡算法。

    SW1#show etherchannel load-balance
    EtherChannel Load-Balancing Configuration:
            src-dst-ip
            mpls label-ip
    
    EtherChannel Load-Balancing Addresses Used Per-Protocol:
    Non-IP: Source XOR Destination MAC address
      IPv4: Source XOR Destination IP address
      IPv6: Source XOR Destination IP address
      MPLS: Label or IP

    此输出显示,IPv4 数据包的算法为 src-dst-ip。然后,将相关的流信息输入到 hash-result 命令中。

    SW1#show etherchannel load-balance hash-result interface port-channel 
    1  ip  10.1.1.1 10.0.2.30
    
    Computed RBH: 0x1
    Would select Gig3/2 of Po1

    既然物理输出点已知,因此 CDP 表可以显示其映射到 VSS 中的哪台物理交换机。

    SW1#show cdp neighbor
    Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                      S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
    
    Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
    VSS              Gig 3/2            157         R S I     WS-C6509-EGig 2/1/1
    VSS              Gig 3/1            128         R S I     WS-C6509-EGig 1/1/1
  2. 跟踪通过 VSS 分布层的路径

    首先,检查路由表以确定 Host2 所在的位置。

    VSS#show ip route 10.0.2.30
    
    Routing entry for 10.0.2.0/24
      Known via "connected", distance 0, metric 0 (connected, via interface)
      Routing Descriptor Blocks:
      * directly connected, via Vlan20
          Route metric is 0, traffic share count is 1

    此前的输出显示,Host2是第3层,与Vlan20中的VSS相邻。要查找到Host2的物理设备,请查看ARP表以查找其MAC地址。

    VSS#show ip arp
    Protocol  Address          Age (min)  Hardware Addr   Type   Interface
    Internet  10.0.2.1                15   0002.0002.0002  ARPA   Vlan20

    然后,从此输出中获取 Host2 的 MAC 地址,并使用此地址在 MAC 地址表中查找输出接口。

    VSS#show mac-address-table address 0002.0002.0002
    
    Legend: * - primary entry
            age - seconds since last seen
            n/a - not available
    
      vlan   mac address     type    learn     age              ports
    ------+----------------+--------+-----+----------+--------------------------
        20  0002.0002.0002   dynamic  Yes        210   Po2

    从前面的CDP输出中回想到,此流的数据包进入Gig2/1/1上的VSS,该VSS对应于交换机2、模块1、端口1。同样,使用hash-result命令确定从VSS的物理退出点:

    VSS#show etherchannel load-balance
    EtherChannel Load-Balancing Configuration:
            src-dst-mixed-ip-port enhanced
            mpls label-ip
    
    EtherChannel Load-Balancing Addresses Used Per-Protocol:
    Non-IP: Source XOR Destination MAC address
      IPv4: Source XOR Destination IP address 
      IPv6: Source XOR Destination IP address
      MPLS: Label or IP
    
    VSS#show etherchannel load-balance hash-result interface port-channel 
    2 switch 2 ip 10.0.1.15 vlan 10 10.0.2.30
    
    
    Computed RBH: 0x6
    Would select Gi2/1/13 of Po2

    现在,使用 CDP 表查找有关指向 Host2 的下游交换机的信息。

    VSS#show cdp nei                                                         
    Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge  
                      S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone, 
                      D - Remote, C - CVTA, M - Two-port Mac Relay             
    
    Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
    SW2              Gig 2/1/13        129             R S I  WS-C6503- Gig 3/14
    SW2              Gig 1/1/13        129             R S I  WS-C6503- Gig 3/13
  3. 跟踪指向 Host2 的路径

    最后,登录 SW2,再次使用 MAC 地址表确定 Host2 所连接到的确切端口。

    SW2#show mac-address-table address 0002.0002.0002
    
    Legend: * - primary entry
            age - seconds since last seen
            n/a - not available
    
      vlan   mac address     type    learn     age              ports
    ------+----------------+--------+-----+----------+--------------------------
        20  0002.0002.0002   dynamic  Yes        140   Gi3/40

数据包流程图

vss-pf-tshoot8.gif

情况 2 - 使用第 2 层 MEC 的两台接入层主机之间的数据包流 – 冗余错误

vss-pf-tshoot3.gif

  1. 跟踪从 Host1 到 VSS 分布层的路径

    步骤与情况 1 的步骤 1 相同。

  2. 跟踪通过 VSS 分布层的路径

    除了 Distr-VSS switch 2 与 SW2 之间的链路中断,该情况与情况 1 相同。因此,port-channel2 中没有活动链路存在于 switch 2 上,在此情况下,从 Host1 发出的数据包将进入 VSS。因此,数据包必须通过VSL和出口交换机1。此哈希结果输出显示:

    VSS#show etherchannel load-balance hash-result interface port-channel 2 
    switch 2 ip 10.0.1.15 vlan 10 10.0.2.30
    
    Computed RBH: 0x6
    Would select Gi1/1/13 of Po2

    hash-result 命令还可用于确定选择用于发送帧的 VSL 链路。在此情况下,Port-channel10 是 switch 1 上的 VSL,而 Port-channel20 是 switch 2 上的 VSL。

    VSS#show etherchannel load-balance hash-result int port-channel 20 
    switch 2 ip 10.0.1.15 vlan  10 10.0.2.30
    
    Computed RBH: 0x6
    Would select Te2/5/4 of Po20

    现在,使用 CDP 表查找有关指向 Host2 的下游交换机的信息。

    VSS#show cdp nei                                                         
    Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge  
                      S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone, 
                      D - Remote, C - CVTA, M - Two-port Mac Relay             
    
    Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
    SW2              Gig 2/1/13        129             R S I  WS-C6503- Gig 3/14
    SW2              Gig 1/1/13        129             R S I  WS-C6503- Gig 3/13
    
  3. 跟踪指向 Host2 的路径

    最后,登录 SW2,再次使用 MAC 地址表确定 Host2 所连接到的确切端口。

    SW2#show mac-address-table address 0002.0002.0002
    
    Legend: * - primary entry
            age - seconds since last seen
            n/a - not available
    
      vlan   mac address     type    learn     age              ports
    ------+----------------+--------+-----+----------+--------------------------
        20  0002.0002.0002   dynamic  Yes        140   Gi3/40

数据包流程图

vss-pf-tshoot9.gif

情况 3 - 使用第 3 层 MEC 的两台接入层主机之间的数据包流

vss-pf-tshoot6.gif

拓扑信息

  1. 跟踪从 Host1 到 VSS 分布层的路径

    由于Host1由SW1在第3层终止,因此第一步是查看SW1的路由表以确定Host2所在的位置。

    SW1#show ip route 10.0.2.30
    
    Routing entry for 10.0.2.0/24
      Known via "static", distance 1, metric 0
      Routing Descriptor Blocks:
      * 10.100.1.1
          Route metric is 0, traffic share count is 1
    
    SW1#show ip route 10.100.1.1
    
    Routing entry for 10.100.1.0/24
      Known via "connected", distance 0, metric 0 (connected, via interface)
      Routing Descriptor Blocks:
      * directly connected, via Port-Channel1
          Route metric is 0, traffic share count is 1
    
    SW1#sh etherchannel 1 summary
    Flags:  D - down        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
    Number of channel-groups in use: 4
    Number of aggregators:           4
    
    Group  Port-channel  Protocol    Ports
    ------+-------------+-----------+-----------------------------------------------
    1      Po1(RU)         LACP      Gi3/1(P)       Gi3/2(P)      
    Last applied Hash Distribution Algorithm:   -
    
    SW1#show cdp neighbor
    Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                      S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
    
    Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
    VSS              Gig 3/2            126         R S I     WS-C6509-EGig 2/1/1
    VSS              Gig 3/1            128         R S I     WS-C6509-EGig 1/1/1
    

    以上输出显示通过10.100.1.1到达目的地的单条路由,该路由与Port-channel1对应。show etherchannel命令输出显示Port-channel1由Gig3/1和Gig3/2组成,而CDP表显示两者都连接到VSS,每台物理交换机有一条链路。然后,必须使用 etherchannel hash-result 命令确定从 Host1 到 Host2 的确切输出点。

    SW1#show etherchannel load-balance
    EtherChannel Load-Balancing Configuration:
            src-dst-ip
            mpls label-ip
    
    EtherChannel Load-Balancing Addresses Used Per-Protocol:
    Non-IP: Source XOR Destination MAC address
      IPv4: Source XOR Destination IP address
      IPv6: Source XOR Destination IP address
      MPLS: Label or IP
    

    此输出显示,IPv4 数据包的算法为 src-dst-ip。然后,将相关的流信息输入到 hash-result CLI 中:

    SW1#show etherchannel load-balance hash-result interface port-channel 1 ip 10.1.1.1 10.0.2.30
    
    Computed RBH: 0x1
    Would select Gig3/2 of Po1
    

    现在很明显,数据流将通过 Gi3/2 离开 SW1,然后进入 switch 1 的 Gig2/1/1 上的 VSS。

  2. 跟踪通过 VSS 分布层的路径

    然后,必须检查 VSS 上的路由表条目。

    VSS#show ip route 10.0.2.30
    
    Routing entry for 10.0.2.0/24
      Known via "static", distance 1, metric 0
      Routing Descriptor Blocks:
      * 10.200.1.2
          Route metric is 0, traffic share count is 1
    
    VSS#show ip route 10.200.1.2
    
    Routing entry for 10.200.1.0/24
      Known via "connected", distance 0, metric 0 (connected, via interface)
      Routing Descriptor Blocks:
      * directly connected, via Port-channel2
          Route metric is 0, traffic share count is 1
    

    从前面的CDP输出中回想到,此流的数据包进入Gig2/1/1上的VSS,该VSS对应于交换机2、模块1、端口1。同样,使用hash-result命令确定从VSS的物理退出点,确保首先查找Po1的内部VLAN:

    VSS#show etherchannel load-balance
    EtherChannel Load-Balancing Configuration:
            src-dst-mixed-ip-port enhanced
            mpls label-ip
    
    EtherChannel Load-Balancing Addresses Used Per-Protocol:
    Non-IP: Source XOR Destination MAC address
      IPv4: Source XOR Destination IP address 
      IPv6: Source XOR Destination IP address
      MPLS: Label or IP
    
    VSS#show vlan internal usage | include Port-channel 1
    
    1026 Port-channel 1
    
    VSS#show etherchannel load-balance hash-result interface port-channel 2 switch 2 ip 10.0.1.15 vlan 1026 10.0.2.30
    
    Computed RBH: 0x6
    Would select Gi2/1/13 of Po2
    

    现在,使用 CDP 表查找有关指向 Host2 的下游交换机的信息。

    VSS#show cdp nei                                                         
    Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge  
                      S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone, 
                      D - Remote, C - CVTA, M - Two-port Mac Relay             
    
    Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
    SW2              Gig 2/1/13        129             R S I  WS-C6503- Gig 3/14
    SW2              Gig 1/1/13        129             R S I  WS-C6503- Gig 3/13
    

    此信息显示,根据之前的 CDP 输出,数据包将通过 Gig2/1/13 离开 VSS,然后进入 Gig3/14 上的 SW2。

  3. 跟踪指向 Host2 的路径

    最后,登录 SW2,再次使用 MAC 地址表确定 Host2 所连接到的确切端口。

    SW2#show mac-address-table address 0002.0002.0002
    
    Legend: * - primary entry
            age - seconds since last seen
            n/a - not available
    
      vlan   mac address     type    learn     age              ports
    ------+----------------+--------+-----+----------+--------------------------
        20  0002.0002.0002   dynamic  Yes        140   Gi3/40

数据包流程图

vss-pf-tshoot10.gif

情况 4 - 使用第 3 层 MEC 的两台接入层主机之间的数据包流 – 冗余错误

vss-pf-tshoot7.gif

  1. 跟踪从 Host1 到 VSS 分布层的路径

    步骤与情况 3 的步骤 1 相同。

  2. 跟踪通过 VSS 分布层的路径

    除了 Distr-VSS switch 2 与 SW2 之间的链路中断,该情况与情况 3 相同。因此,交换机2上不存在端口通道2中的活动链路,Host1的数据包进入VSS,因此数据包必须经过VSL和出口交换机1。下面的哈希结果输出显示了这一点。

    VSS#show etherchannel load-balance hash-result interface port-channel 2 switch 2 ip 10.0.1.15 vlan 1026 10.0.2.30
    
    Computed RBH: 0x6
    Would select Gi1/1/13 of Po2
    

    hash-result 命令还可用于确定选择用于发送帧的 VSL 链路。在此情况下,Port-channel10 是 switch 1 上的 VSL,而 Port-channel20 是 switch 2 上的 VSL。

    VSS#show etherchannel load-balance hash-result int port-channel 20 switch 2 ip 10.0.1.15 vlan 1026 10.0.2.30
    
    Computed RBH: 0x6
    Would select Te2/5/4 of Po20
    
  3. 跟踪指向 Host2 的路径

    最后,登录 SW2,再次使用 MAC 地址表确定 Host2 所连接到的确切端口。

    SW2#show mac-address-table address 0002.0002.0002
    
    Legend: * - primary entry
            age - seconds since last seen
            n/a - not available
    
      vlan   mac address     type    learn     age              ports
    ------+----------------+--------+-----+----------+--------------------------
        20  0002.0002.0002   dynamic  Yes        140   Gi3/40

数据包流程图

vss-pf-tshoot11.gif

情况 5 - 使用 ECMP 的两台接入层主机之间的数据包流

vss-pf-tshoot4.gif

拓扑信息

  1. 跟踪从 Host1 到 VSS 分布层的路径

    由于SW1在第3层终止了Host1,因此第一步是查看SW1路由表,确定Host2所在的位置。

    SW1#show ip route 10.0.2.30
    
    Routing entry for 10.0.2.0/24
      Known via "static", distance 1, metric 0
      Routing Descriptor Blocks:
      * 10.100.1.1
          Route metric is 0, traffic share count is 1
        10.100.2.1
          Route metric is 0, traffic share count is 1
    
    SW1#show ip route 10.100.1.1
    
    Routing entry for 10.100.1.0/24
      Known via "connected", distance 0, metric 0 (connected, via interface)
      Routing Descriptor Blocks:
      * directly connected, via GigabitEthernet3/1
          Route metric is 0, traffic share count is 1
    
    SW1#show ip route 10.100.2.1
    
    Routing entry for 10.100.2.0/24
      Known via "connected", distance 0, metric 0 (connected, via interface)
      Routing Descriptor Blocks:
      * directly connected, via GigabitEthernet3/2
          Route metric is 0, traffic share count is 1
    
    SW1#show cdp neighbor
    Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                      S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
    
    Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
    VSS              Gig 3/2            126         R S I     WS-C6509-EGig 2/1/1
    VSS              Gig 3/1            128         R S I     WS-C6509-EGig 1/1/1

    之前的输出显示了通过 10.100.1.1 和 10.100.2.1 的等成本路由,其分别通过 Gig3/1 和 Gig3/2 进行连接。CDP 表显示 Gig3/1 和 Gig3/2 均与 VSS 连接,每台物理交换机使用一条链路。然后,必须使用 exact-route 命令确定从 Host1 到 Host2 的确切输出点。

    SW1#show mls cef exact-route 10.0.1.15 10.0.2.30
    
    Interface: Gi3/1, Next Hop: 10.100.1.1, Vlan: 1030, Destination Mac: 000a.000a.000a

    现在很明显,数据流将通过 Gi3/1 离开 SW1,然后进入 switch 1 的 Gig1/1/1 上的 VSS。

  2. 跟踪通过 VSS 分布层的路径

    然后,必须检查 VSS 上的路由表条目。

    VSS#show ip route 10.0.2.30
    
    Routing entry for 10.0.2.0/24
      Known via "static", distance 1, metric 0
      Routing Descriptor Blocks:
        10.200.2.2
          Route metric is 0, traffic share count is 1
      * 10.200.1.2
          Route metric is 0, traffic share count is 1
    
    VSS#show ip route 10.200.2.2
    
    Routing entry for 10.200.2.0/24
      Known via "connected", distance 0, metric 0 (connected, via interface)
      Routing Descriptor Blocks:
      * directly connected, via GigabitEthernet2/1/13
          Route metric is 0, traffic share count is 1
    
    VSS#show ip route 10.200.1.2
    
    Routing entry for 10.200.1.0/24
      Known via "connected", distance 0, metric 0 (connected, via interface)
      Routing Descriptor Blocks:
      * directly connected, via GigabitEthernet1/1/13
          Route metric is 0, traffic share count is 1
    
    VSS#show cdp nei
    Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                      S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
                      D - Remote, C - CVTA, M - Two-port Mac Relay
    
    Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
    SW2              Gig 1/1/13        121             R S I  WS-C6503- Gig 3/13
    SW2              Gig 2/1/13        121             R S I  WS-C6503- Gig 3/14

    此时,再次出现适用于目标的等成本路径,每台交换机都有一个输出点。由于之前已确定数据包会进入 switch 1 上的 VSS,因此下一步就是发出 exact-route 命令以指定 switch 1。

    VSS#show mls cef exact-route 10.0.1.15 10.0.2.30 switch 1
    
    Interface: Gi1/1/13, Next Hop: 10.200.1.2, Vlan: 1095, Destination Mac: 000b.000b.000b

    此信息显示,根据之前的 CDP 输出,数据包将通过 Gig1/1/13 离开 VSS,然后进入 Gig3/13 上的 SW2。

  3. 跟踪指向 Host2 的路径

    最后,登录 SW2,再次使用 MAC 地址表确定 Host2 所连接到的确切端口。

    SW2#show mac-address-table address 0002.0002.0002
    
    Legend: * - primary entry
            age - seconds since last seen
            n/a - not available
    
      vlan   mac address     type    learn     age              ports
    ------+----------------+--------+-----+----------+--------------------------
        20  0002.0002.0002   dynamic  Yes        140   Gi3/40

数据包流程图

vss-pf-tshoot12.gif

情况 6 - 使用 ECMP 的两台接入层主机之间的数据包流 – 冗余错误

vss-pf-tshoot5.gif

  1. 跟踪从 Host1 到 VSS 分布层的路径

    步骤与情况 5 的步骤 1 相同。

  2. 跟踪通过 VSS 分布层的路径

    hash-result 命令还可用于确定选择用于发送帧的 VSL 链路。在此情况下,Port-channel10 是 switch 1 上的 VSL,而 Port-channel20 是 switch 2 上的 VSL。入口VLAN将是Gig1/1/1的内部VLAN,即入口接口。

    VSS#show vlan internal usage | include 1/1/1
    
    1026 GigabitEthernet1/1/1
    
    VSS#show etherchannel load-balance hash-result int port-channel 10 switch
    1 ip 10.0.1.15 vlan 1026 10.0.2.30
    
    Computed RBH: 0x4
    Would select Te1/5/5 of Po10
  3. 跟踪指向 Host2 的路径

    最后,登录 SW2,再次使用 MAC 地址表确定 Host2 所连接到的确切端口。

    SW2#show mac-address-table address 0002.0002.0002
    
    Legend: * - primary entry
            age - seconds since last seen
            n/a - not available
    
      vlan   mac address     type    learn     age              ports
    ------+----------------+--------+-----+----------+--------------------------
        20  0002.0002.0002   dynamic  Yes        140   Gi3/40

数据包流程图

vss-pf-tshoot13.gif

相关信息