VPC-Virtua Port Channel 18-Aug
VPC-Virtua Port Channel 18-Aug
VPC-Virtua Port Channel 18-Aug
https://www.cisco.com/c/dam/en/us/td/docs/switches/datacenter/sw/
design/vpc_design/vpc_best_practices_design_guide.pdf
Benefits of vPC:
• A virtual port channel (vPC) allows links that are physically connected to two different Cisco
Nexus 7000 Series devices to appear as a single port channel to a third device. The third device
can be a switch, server, or any other networking device that supports link aggregation
technology.
• Unlike VSS and stacking, in vPC each peer device in the vPC domain runs its own control plane
• If there is any issue in the control plane of one peer, it will not impact another peer.
• In the figure, we have 2 switches i.e., SW1 & SW2 and a L3 device ABC. Suppose we are running
any layer 3 protocol like OSPF between the switch and the ABC, now if you login into the ABC
device and try to check its OSPF neighbors, in the case of stacking and VSS, you will see only one
neighbor from the prospective of the ABC device, because here both switches have a single
control plane. And in vPC case you will see 2 OSPF neighbors from the prospective of the ABC
device, because here both switches have their own control plane. That is why, if there any
problem in the control plane of any device then it will be not populated to another vPC device.
• vPC technology is supported since NX-OS 4.1.3 (i.e., since the introduction of the NEXUS 7k
platform in 2009)
• vPC feature is included in the base NX-OS software license, so no need to purchase any
additional license for vPC.
• vPC is a layer 2 technology, we can’t have L3 port-channel in vPC.
• Exceptions:
1. vPC master sticky-bit set to 0 or 1. (vPC master sticky bit is a Programmed protection Mechanism,
introduced to avoid unnecessary role change.)
vPC terminologies
vPC • It is a port-channel between the vPC peers and the downstream devices.
• A vPC is a L2 port type: swtchport mode trunk or switchport mode access
N7K-1(config)#feature vpc
• Select the interface which you want to configure as a peer keep-alive line and
configure an IP address on both the peers.
• If you are using the management interface for keepalive then Now go to under
vpc domain and run the following command:
• And if you are using a regular Gig ethernet port then use the following
command under vpc domain id:
• Now you may think, let’s connect both the SUP on both switches back-
to-back with their respective mgmt0 interface, but this will not solve the
problem because let’s suppose SWH-A have SUP-1A & SUP-2A and
SWH-B have SUP-1B & SUP2B.
Now in this situation suppose the SUP-1 on both sides are active and
suddenly SUP-1A goes down and now SUP-2A became the active SUP.
So, on SWH-1, SUP-2A’s mgmt0 interface active and on SWH-2, SUP-1B’s
mgmt0 interface active, and this is not allowed, so, connecting both side
on mgmt0 interface in case of dual SUP is not recommended.
N7K-1(config)#interface port-channel 1
• Member port must be 10G ports. Peer-link is not supported on 1G line cards of FEX
ports, even if the FEX port is of 10G.
• M1 & M2 line cards supports up to 8 member ports while F1, F2, F2E, F3 & M3 support
up to 16 member ports.
• Must use same type of line cards on both peer devices. Logic behind using same line
cards: Each port type has its own different hardware characteristics in terms of
forwarding, queuing and security, hence, to avoid any forwarding plane issues different
line cards combinations are not supported in vPC.
• Use at least 2 different line card’s ports to increase high availability of peer-link.
• Configure the vPC member ports:
N7k-1(config)#exit
N7k-1(config)#interface port-channel 2
• Must use same type of line cards on both peer devices, logic behind this is same as for vPC peer-
link.
Consistency
Both switched in the vPC domain maintain distinct planes. Cisco fabric services (CFS) protocol do the
comparison of the configuration of the peer devices and if there is a difference in the configuration
means configuration is not consistent, then based on the type of consistency it will take some action.
System configuration must be kept in sync, with an automated consistency check to help ensure correct
network behavior.
• Type-1:
• For Global configuration type 1 inconsistency check, only vPC member ports on the
secondary peer device are set to down state.
• For vPC interface configuration type 1 inconsistency check, only vPC member ports on
secondary peer device are set to down state.
• Type-2:
• For global configuration type 2 inconsistency check, all vPC member ports remain in up
state and vPC systems trigger to protective actions.
• For vPC interface configuration type 2 inconsistency check, the misconfigured vPC
remains in up state. However, depending on the discrepancy type, vPC systems will
trigger protective actions. The most typical one deals with allowed VLAN in vPC interface
trunking configuration. In that case, vPC systems will disable from the vPC interface
VLAN that do not match on both sides.
In the vPC environment, BPDUs are controlled by the primary device only, regardless the root
bridge (means to say that it does not matter who is the root bridge i.e., either primary switch or
the secondary switch, only the primary switch will process the BPDU) and are send to all the
designated ports.
Secondary device is not going to generate BPDUs. If a secondary switch receives BPDU msg from
a downstream switch which is running in vPC environment then the secondary switch will not
entertain/process the BPDU, it will just forward the BPDUs to the primary switch via vPC peer-
link.
But what if the secondary switch receives a BPDU msg from a downstream switch which is not
running in vPC environment?
o In that situation secondary switch will process that BPDU.
Issue in default behavior:
o In the upper written default behavior, when the root bridge goes down then there will
be an outage of 3 seconds because the downstream device came to know that the root
bridge goes down that’s why it's ports will go into the designated state. When the
switch came back online there will also an outage of 3 seconds because again the root
bridge selection happens, and that’s why there will be a change in the port states of the
downstream device. So, there will be total 6 second outage in our network.
Solution: vPC peer-switch
vPC peer-switch
This feature allows the primary and secondary switch to use a single MAC address, so that,
whenever the root bridge goes down the downstream device will never come to know that the
root bridge is down because another switch will become root bridge without any outage
because they both are already using same MAC address to fool the downstream device.
NOTE: The MAC address which these switches now use will be same as the LACP ID.
BPDU flow in this feature:
o In this situation both primary and secondary devices will send/generate/process BPDU
messages, so the downstream switch will receive duplicate BPDUs. If the downstream
switch sends any BPDU to the secondary device, then this peer is not going to forward
the received BPDU to the primary switch.
Enabling the feature:
o Under the vPC domain and run the following command:
vpc domain 1
peer-switch
Recommendations:
o To use this feature successfully we need to make sure that configured priority is same
on both the switches.
HSRP & VRRP operate in active-active mode from the data plane perspective, unlike
classical networks where we have the active/standby concept.
o This means if we configure HSRP or VRRP in vPC environment then both
switches will forward the traffic which they received from the downstream
devices.
No additional configuration requires for this. This is the default behavior.
Bur from the control plane perspective still the active/standby concept is followed.
o Because only the HSRP active switch will respond to ARP for VIP MAC address.
o If the HSRP standby switch receives any request for the VIP MAC address, then it
will forward the request to the HSRP active device.
o NOTE: No matter which switch is vPC primary device, only the HSRP active
switch will entertain the ARP requests.
Recommendation:
o For ease of troubleshooting/operation make sure that the “primary” vPC switch
will become HSRP/VRRP “active” device for the control plane perspective.
o Don’t use HSRP/VRRP object tracking in vPC domain.
Reason: can cause traffic blackholing: explained below
Example: Suppose here we are tracking the WAN link on both switches, for both VLAN interfaces.
Suddenly the link between N7K-2 & WAN device goes down, due to that the VLAN 10 & 20 interfaces on
N7k-2 goes down. Now the server-2 trying to reach the server-1, so because of port-channel hashing
algorithm some traffic will sent towards n7k-1 and some towards n7k-2. The packets which are sent
towards n7k-1 will reach to server 2, without any issue. But the packets which are sent towards to n7k-
2, will reach to n7k-2 and then get forwarded towards n7k-1, but now n7k-1 will not forward these
packets on the vPC towards the server-1 because on the loop avoidance mechanism in 7k switch and so
these packets will get dropped at n7k-1.
The vPC peer-gateway capability allows a vPC to route packets that are addressed to the
router MAC address of the vPC peer.
This functionality is used to overcome scenarios with misconfigurations and issues that
arise with load balancers or network attached storage (NAS) devices that try to optimize
packet forwarding.
Example: In this topology nx-2 and nx-3 are acting as the gateway fof VLAN 100 and VLAN
200. Nx-2 and nx-3 have a vPC configured for the web server and nx-1, which connects to
the NAS. NX-1 is only switching (not routing) packets to or from the NAS device.
When the web server sends a packet to the NAS device (172.32.100.22), it computes a
hash to identify which link it should send the packets on to reach the NAS device. Assume
that the web server sends the packet to nx-2, which then changes the packet’s sour e MAC
address to 00c1.5c00.0011 (part of the routing process) and forwards the packet on the nx-
1. NX-1 forwards (switches) the packet on to the NAS device.
Now the NAS devices create the reply packet and, when generating the packet headers,
uses the destination MAC address of the HSRP gateway 00c1.1234.0001 and forward the
packet to the NX-1. NX-1 computes a hash based on the source and destination IP and
forward the packet towards NX-3. NX-2 and NX-3 both have the destination MAC address for
the HSRP gateway and can then route the packet for the 172.32.200.0/24 network and
forward it back to the web server. This is the correct and normal forwarding behavior.
The problem occurs when the NAS server enables a feature for optimizing packet flow.
After the NAS device receives the packets from the web server and generate the reply
packet headers, it just uses the source and destination MAC addresses from the packet it
originally received. When NX-1 receive the reply packet, it calculates the hash and forward
the packet towards NX-3. Now NX-3 does not have the MAC address 00c1.5c00.0011 (NX-2’s
VLAN 100 interface) and can’t forward the packet toward NX-2. The packet is dropped
because packet received on vPC member port can’t be forwarded across the peer-link, as a
loop-prevention mechanism.
Enabling a vPC peed-gateway on NX-2 and NX-3 allows NX-3 to route packets destined
for NX-2’s MAC addresses, and vice versa. The vPC peer-gateway feature is enabled with the
command “peer-gateway” under he vPC domain configuration. The vPC peer-gateway
functionality is verified with the “show vpc” command.
Peer devices will listen for the SVI MAC of another peer.
We can activate it anytime, no traffic impact.
Was designed for devices like NAS that do not follow the standard arp process to
retrieve MAC of the gateway or F5 which uses the source MAC for return traffic to keep
the path symmetrical.
If WAN link on the peer goes down, it can use the backup path over peer-link for the
routed traffic.
Because of the peer-link feature we have G bit set for the next hop Ips MAC address.
Now our traffic will be software switched and we can experience heavy packets drops or
delay due to CoPP and hardware rate limiter.
So, in the situation we need to enable this “vPC peer-gateway exclude VLAN” feature so
that the traffic will not be software switched. Now it will do hardware switch.
To enable this feature: go under vpc domain and then:
Peer-gateway exclude vlan <vlan-list>
Case-1:
Case-2:
vPC peer-link is down and after some time primary fails completely. Then?
On vPC secondary device, vPC member ports and the SVIs will stay in a down
state until the primary is back.
Quick Fix: We can take the configuration backup on the secondary device and the
remove the vPC configuration from the vPC member ports. But the is not a
recommended solution. After removing the vPC configuration those ports will came
up immediately.
Both peer devices went down but only one came UP.
All the vPC member ports and the SVIs will stay in down state until another peer
came UP. Because if you check the output in “show vPC role” then you will find
that the role is “none established” because vPC configuration order will not
complete until there are two devices in the vPC domain.
Quick Fix: We can take the configuration backup on the secondary device and the
remove the vPC configuration from the vPC member ports. But the is not a
recommended solution. After removing the vPC configuration those ports will come
up immediately.
Case-4:
Even though orphan ports are not part of vPC their SVI will also be shut down
and will also be isolated.
Solution: Use the below command under the vPC domain configuration, to keep
the orphan ports up on the secondary device during peer-link failure.
It happens when vPC keep-alive link goes down and after the peer-link goes
down.
Both devices will be in primary role.
vPC orphan ports can be isolated on both peers.
Peer-gateway feature will no longer works as HSRP is also broken because of
peer-link down and we can have issue.
New MAC addresses will no longer sync between peers.
NOTE: And when the peer-link and the keep alive link came UP the roles of the peer
devices will be reversed. Means now the old primary device will become operational
secondary and the old secondary device will become operational primary because of
“master-sticky bit set to 1” on secondary device.
Case-6: vPC orphan ports stays active on secondary during peer-link fails.
When peer link goes down secondary device shuts down the vPC member ports
(orphan ports stays up) and the vPC VLAN SVIs.
Devices link LB/FW can creare problems in this situation.
Solution:
Case-7:
Solution:
NOTE: in the output of show track you will see that track 3 is UP. If both
objects in the track 3 goes down then only track 3 goes down, if one on the object is
UP it will remain UP.
When both the objects go down then the track 3 will also goes down.
Then via keep-alive link, the primary device tells the secondary device to change the
status of the vPC member port and vPC SVI, to UP.
vPC “self-solation” command. Run this command under the vPC domain
configuration. Using this feature we will get the same result as object
tracking.
NX-OS 7.2 or later