Showing posts with label MLAG. Show all posts
Showing posts with label MLAG. Show all posts

10/19/2021

Arista MLAG vs unstable STP

Before reloading an MLAG peer switch to perform an upgrade/downgrade, one of the key check-ups is to make sure the STP is restartable. Otherwise, traffic loss is expected. 

bn303.08:17:13(s1)#sh spanning-tree instance detail | grep rest
   Stp agent restartable                      :            False

Oct 19 08:16:15 bn303.aristanetworks.com Stp: %SPANTREE-6-STABLE_CHANGE: Stp state is now not stable
Oct 19 08:17:06 bn303.aristanetworks.com Stp: %SPANTREE-6-STABLE_CHANGE: Stp state is now stable

To find out which ports causing this issue, by using CLI - sh spanning-tree topology status detail, to search most recently changed ports, like

bn303.08:22:51(s1)#sh spanning-tree topology status detail | more
Topology: Cist
  Mapped Vlans: 1,4080-4087
  Cpu:                  forwarding (1 changes, last 7:40:20 ago)
  Ethernet8/16/1:       forwarding (3 changes, last 0:23:10 ago) <<<
  PeerEthernet8/16/1:   forwarding (3 changes, last 0:23:10 ago) <<<

The reason of unstable STP is because, the MLAG switch keeps receiving its own (actually from the active MLAG peer) BPDU and can't form an agreement. The solution can be either, shutting down the port or put it as no-switching port. 

4/30/2019

Arista MLAG reload-delay timers

In this blog post, I will cover the following MLAG related topics:
  • What is the MLAG reload-delay and why it is needed
  • The difference of 2 different timers
  • How to tune the timer values
After an MLAG peer boot up, all its ports are placed in err-disabled state (except the peer-link) with a reason of "mlag-issu". During the reload-delay, the MLAG agents sync all MAC and ARP information with the active peer. 

Another trigger of mlag reload delay is forwarding plane agent restart. On some platforms like TH or T3, a port speed change needs a hitful agent restart, which forces mlag interfaces to transition and starts reload-delay.

From 4.15.2F, the default reload-delay timers are different per platform:
  • All fixed systems: 300 sec
  • 7500* (Arad/Jericho): 1800 sec (due to long hw initialization time)
  • 7300* (Trident*/TH): 1200 sec
When to start the reload timer? The timers start to tick after the start of MLAG agent. In old releases, it is triggered by the sysdb agent. 

Can I lower the reload-delay timers? Yes, but be careful since if the interfaces exit err-disabled mode before sync is done, the mlag peer will blackhole the traffic. 

Which value should be used, it is highly based on system and configuration. You can look at the log messages closely. 

! this is MLAG agent up and timers are on
Apr 19 11:33:32 localhost Mlag: %AGENT-6-INITIALIZED: Agent 'Mlag' initialized; pid=3030
! LCs power on
Apr 19 11:34:08 R1 NorCalCard: %HARDWARE-6-CARD_POWERED_ON: Card Fabric3 has been powered on. model: 7512R-FM rev: 11.02 serial number: JPE16305615
....
Apr 19 11:34:24 R1 NorCalCard: %HARDWARE-6-CARD_POWERED_ON: Card Linecard11 has been powered on. model: 7500R-36Q-LC rev: 02.01 serial number: JPE16204252
! LC initialization
Apr 19 11:38:40 R1 SandFap: %SAND-6-INIT_SUCCEEDED: Initialization of Linecard12 switch asics succeeded.
....
Apr 19 11:43:12 R1 SandFap: %SAND-6-INIT_SUCCEEDED: Initialization of Linecard13 switch asics succeeded.
! interfaces up
Apr 19 11:43:01 R1 Ebra: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet12/26/3 (mlag.207_leaf_et9/3_et10/3=>et12/17/3), changed state to up
....
Apr 19 11:46:33 R1 Ebra: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet14/34/1 (peerLink=>mlagSec.et14/34/1.100g), changed state to up

This is the messages of a 7512N with 8 J/J+ LCs. So you can see, 13 mins after MLAG agent up, the last peer-link interface is up. Given 5 mins to allow IGP/iBGP session and corresponding hw programming finished, a 20-min (1200 sec) reload-delay timer should be safe with an additional 2-minute buffer. 

And there are 2 timers:
  • MLAG reload-delay timer: this is for all MLAG port-channel links. It can be changed by CLI - "reload-delay mlag <seconds>"
  • Non-MLAG reload-delay timer: most of the time, they are the timeout values for L3 uplinks. And can be modified by CLI - "reload-delay non-mlag <seconds>"
Before discussing how to tune them, let me give a good example to help your understandings:
  • Imagine there is a house which has a front door (non-MLAG/uplinks to go out) and a back door (MLAG interfaces/to reach hosts/tenants)
  • And there is a side to your neighbor (MLAG peer), which shares the same tenants/hosts. 
  • So the first thing to do is to communicate with your neighbor to have all the address information, to know who is where. 
  • With all the knowledge, open which door first?
    • First of all, the side door is opened first. (so peer-link doesn't have reload-delay and a BGP/IGP peering is required)
    • During the gap of the front and back door, the traffic will not be lost since there is a side door to exit. 
    • The opening of the back door will have half south-north traffic in, and will go thru the side door. Similar to front door, half north-south traffic. 
    • Most of the time, the MLAG interfaces are facing servers which means south-north traffic is much higher than the opposite traffic. 
  • So it is preferable to configure non-mlag reload delay <= mlag timer. 
  • The ONLY exception is, if "reload-delay mode lacp-standby" is enabled, non-mlag timer > mlag timer. This feature keeps the LACP interfaces up to speed up hardware programming. So if the north-south coming first, the router has to drop them because the MLAG port-channels are not really ready. 

Arista EOS: sand hardware-only LAG

CLI: 
platform sand lag hardware-only

目的:
  • 一般情况下,1-port LAG是software LAG;
  • 如果增加一个port,变成2-port LAG,就会变成hardware LAG,会有traffic interruption,特别是interface flap! 
  • 什么意思啊?很简单,如果是2-port LAG,断了一根线,变成1-port/software LAG,有Traffic impact. 如果这根线在Flapping,traffic就一直受影响
  • 所以索性一上来就是hw-LAG
  • 唯一的影响是,占有的资源(啥资源啊?不知道,LAG table?)会多一些

LACP rate fast vs MLAG

Arista does NOT recommend LACP rate fast enabled with MLAG, which is not reliable especially in scale environment.

In 4.20.2.1F Release Note, on page 21

"LACP PDU fast rate ("lacp rate fast" on an Arista switch) should not be configured on any port in an MLAG pair, or any port connected to an MLAG pair. (13950)"

12/17/2018

Arista EOS MLAG - domain name must be matched

snp262.vtepA1#sh run | sec mlag config
mlag configuration
   domain-id vtepA
   local-interface Vlan4094
   peer-address 200.255.134.2
   peer-link Port-Channel2000

snp263.vtepA2(config-mlag)#sh run sec mlag config
mlag configuration
   domain-id vtepA2  <<<<< a typo in mlag domain-name
   local-interface Vlan4094
   peer-address 200.255.134.1
   peer-link Port-Channel2000
   reload-delay mode lacp standby

snp263.vtepA2#sh mlag det | grep State
State                           :            inactive
Peer State                      :             unknown
State changes                   :                   3

snp263.vtepA2(config)#mlag config
snp263.vtepA2(config-mlag)#domain-id vtepA
snp263.vtepA2(config-mlag)#end

After correcting it, the mlag is up

snp263.vtepA2#sh mlag det | grep State
State                           :             primary
Peer State                      :           secondary
State changes                   :                   4

10/10/2018

20+ sec traffic seen during Mlag peer reload

https://eos.arista.com/mlag-issu/

The reason of such long period loss is most likely caused by STP flap or the STP is not stable before system reload. Another symptom is the output of "show hardware counter drop". If you see high # of drop due to dropVoqInPortNotVlanMember, it is likely the STP issue. 

Use these 2 commands to verify STP status:


bn303.14:47:42(config)#show mlag issu warnings
Stp is not restartable. Topology changes will occur during the upgrade
process.

bn303.14:49:21(config)#show spanning-tree bridge det | more
Stp Detailed Status:
   Stp agent restartable         :        False
   MST-PVST interoperation       :     Disabled

One of the reasons of unstable STP is, this switch receives its own BPDU on one port. That happens if both mlag peers have 1 port connected to same switch then form a loop. Even the STP kicks in and put the port in "discarding" mode, but this bouncing back BPDU still causing the STP unstable. 

In this case, use command - "show spanning topology status" to find those looped interfaces. 

bn302.14:49:44(config)#show spanning-tree topology status | more
Topology: Cist
  Mapped Vlans: 1
  Ethernet12/32/1:      forwarding
  Ethernet14/32/1:      forwarding
  PeerEthernet12/32/1:  discarding <<<<<< check this peer port
  Port-Channel2000:     forwarding

bn303.15:32:02(config)#tcpdump ver interface et12/32/1
....
15:32:21.036169 28:99:3a:84:8d:68 > 01:80:c2:00:00:00, 802.3, length 105: LLC, dsap STP (0x42) Individual, ssap STP (0x42) Command, ctrl 0x03: STP 802.1s, Rapid STP, CIST Flags [Proposal, Learn, Forward, Agreement], length 102
port-role Designated, CIST root-id 2000.46:4c:a8:a5:11:40, CIST ext-pathcost 0
CIST regional-root-id 2000.46:4c:a8:a5:11:40, CIST port-id 8789,
message-age 0.00s, max-age 20.00s, hello-time 2.00s, forwarding-delay 15.00s
v3len 64, MCID Name , rev 0,
digest 64b4d42c08d6bff5b647fc0be11d4ebb, CIST int-root-pathcost 0,
CIST bridge-id 2000.46:4c:a8:a5:11:40, CIST remaining-hops 20

9/25/2018

Mlag reload-delay timers tunning

General rules:
  • No.1 rule - side-way up first
    • Peer-link up first. Recommended (if not must) to have an iBGP peering between MLAG peers. So always have a side-way. 
    • Why need a side-way? Because there is for sure a gap between non-mlag (uplinks) and mlag (downlinks) ready to forward, in this case, there is a fire exit to avoid traffic drop. 
  • No.2 rule - non-mlag relay < mlag delay
    • "In a topology where non-mlag links are only L3 ports that want to reach hosts behind MLAG interface, then it is preferable to keep non-mlag reload-delay smaller compared to mlag reload-delay to have L3 protocols converge before the L2 links ( MLAG interfaces ) are brought up."
    • Why? don't overwhelm the peerLink. Most of the time, servers's ingress << egress. 
  • No.3 rule - if "lacp standby" enabled, mlag delay < non-mlag
    • Bring up interfaces to allow hw programing. So non-mlag (uplinks) up first, N-S traffic in but downlinks not ready. 
Primary和Secondary最大的区别是STP,Sec上的STP is held.

MLAG reboot/SSO, all ports except peerlink are in err-disabled state。这个期间,系统需要bring up hardware,Mlag peer可以sync states.  From 4.15.2F (released Sep 2015), the default-relay is automatically adjusted based on platform, 1800s in Sand(Arad/J/J+) modular, 1200s in Strata(Trident/TH) modular and 300s fixed.


如果non-mlag links都是L3 ports,最好是non-mlag delay < mlag delay,所以uplink先起来,等Mlag converged了,S-N已经有routes ready了。但是这个时候,会Attract N-S traffic,但是我们peerlink已经up了,就走peerlink, no loss.


LACP-standby就是可以更新LAG成员表,MAC地址表,ports appear as linkActive. 如果这个是ON,那么Non-Mlag delay >= Mlag delay. 不如N-S traffic进来,以为Mlag ports up,就drop了


如果使用VRRP,就需要configure VRRP reload daly time higher than MLAG reload delay.


Z1554

9/20/2018

Disable Mlag Peerlink

An EOS engineering command to shutdown the peerLink port-channel:

errordisable test interface po2000

9/12/2018

FHRP, VRRP and VARP

VARP (Z636)
  • "ip virtual mac <mac>" 
    • = treat <mac> as own mac;
    • 和MLAG合用=poor-man's VRRP,
    • 好处是active-active,
    • 坏处是static ARP on neighbor hosts,为啥坏啊?
  • 如果SVI有"ip virtual addr"
    • respond ARP req for vIP + vMAC, 但是srcMAC还是phyMAC;
    • GARP, srcMAC = vMAC, 刷switch MAC table
  • under bash, 还有command?
    • varp vlan3 1.2.3.4 00:1c:73:00:00:01
VRRP over MLAG (Z1223)
  • 传统上,MLAG最好的选择的是VARP,用VRRP is kinda dumb(DE's comments)
  • 最大的问题是,VRRP Backup不fwd traffic,而且peerlink上不学MAC,结果哪?
    • hash到backup的traffic,会被flood,连switch都没有,因为peerlink不学mac
    • 纪录在Y31356
    • Solution是write vrrp mac address into mlag host
  • 还有mlag reload delay + VRRP
    • peerlink先起来,vrrp prempt所以newly up peer becomes master
    • 可是the new peer还在reload delay,black hole traffic!!
    • 纪录在Y30494
    • Workaround: config preempt delay reload #1 > reload-delay #2
  • 这个Z1223最后没有做
FHRP: HSRP, VRRP and VARP
  • HSRP, VRRP and VARP use vMAC. GLBP uses phyMAC for LB; 
    • HSRP vMAC = 0000:0c07:ac**
    • VRRP vMAC = 0000:5e00:01xx, xx = VRID (1-256)
    • VARP vMAC = self-configured
    • GLBP其实也用vMAC,应该是不同的vMAC = phyMAC
  • Assigned MAC address (side note)
    • 00-00-5e, IANA (internet assign num association) ucast
      • 00-00-5e-00-01/02-xx, VRRP v4/v6
    • 01-00-5e, IANA mcast
      • 00-00-00 to 7f-ff-ff: v4 mcast
      • 90-00-01: bfd on LAG
  • 最大的区别是,Active-Active vs Active-Standby, 如何做到的?
    • 都用vMAC, hosts send packets with dstMAC = vMAC
    • VARP是active-active,直接route out. 
    • 而VRRP是bridge to peer via peerLink 
  • GARP是刷switch mac table + 通知全部的hosts, ip/MAC mapping of vMAC = vIP
    • GARP和普通ARP Reply一样,只是dstMAC = FF or hostMAC
    • 只有GARP pkt里面的srcMAC是vMAC. 这是唯一pkt!!. 其他data甚至ARP的srcMAC都是phyMAC. 
  • 需要phyIP吗?
    • 'ip virtual address' 无论有没有mask,都需要phyIP. 不过w/ mask可以是dummy ip. 
    • 'ip address virtual' 不要phyIP
  • VARP = ip virtual address  - IVA
    • GARP和ARP Reply一样,srcMAC, arp.sndMAC = vMAC
    • ARP request里面, 里外Eth/ARP都是Switch System MAC,arp.sndIP = phyIP,因为要确保Arp reply回到Src Mlag Peer!!!
  • VARP w/mask = ip virtual address w/ mask - IVAM
    • GARP + ARP Reply = VARP way
    • 关键是ARP Req, 没有phyIP under this subnet, 所以里外都是vMAC/vIP. 好了有问题了,如果Host ARP Reply hashed到里外一个Peer,咋办?
    • 所以这个VxLAN VARP必须有 ARP Sync!
  • VxLAN Anycast = ip address virtual + vMac
    • both Mlag peer都是一个Addr. 不需要phyIP, vIP就可以
    • 没有GARP,为啥?因为ARP reply另外都是vMAC,不需要GARP刷switch
    • host知道GW,必须靠ARP reply by mlag peer. 里外都是vMac + vIP. 
    • ARP Req = VARP w/mask, 因为没有phyIP;
    • 所以也需要ARP Sync. 

7/30/2018

VXLAN Routing with MLAG

VXLAN Routing with MLAG
https://eos.arista.com/vxlan-routing-with-mlag/
  • VXLAN routing routes pkt based on IP address in inner header, not outer VXLAN header. 
  • 有个示意图,可以帮助理解
    • 在SW-1其实就是简单的Inter VLAN SVI routing
    • 只是SVI-VLAN 20有个VTEP/VNI,所以可以Learn到DEST MAC of Svr2
    • Srv-2‘s GW SVI-VLAN-20 is on VTEP-1/SW-1
    • VNI 1020 链接左右的L2 Domain
  • Routing Topologies
    • Direct Routing - routing at 1st-hop leaf node for ALL subnets. 
    • Indirect Routing - only route for ONE subnet, reduce amt of ARP/MAC resource on leaf
    • Indirect is a derivative of direct
  • Direct Routing
    • works by creating anycast IP address:
      • Leaf acts as GW, owns and responds ARP req
    • 所有Leaf Config same "ip address virtual" and "ip virtual mac"
  • ip address virtual 10.10.10.254/24
    • No routing over an VLAN interface w/ "ip address virtual"
    • VTEP w/ "ip address virtual" will fwd any ARP responses to virtual router MAC to all neighbor VTEPs via HER(head-replication). So neighbor VTEPs host same ARP tables. 
    • in MLAG, ARP res to "virtual ip addr" are sync'ed with MLAG peer. 
    • Note: ARP sync between MLAG is done via VXLAN agent, hence "ip virtual address" is ONLY supported with VXLAN config
  • virtual VTEP:
    • 每个Leaf都有Virtual IP addr + MAC, 所以都可以response ARP req. 
    • 所以建立一个vVTEP. 不太明白
  • ARP Timer
    • Serv1 sends ARP req to VTEP1. By routing, VTEP1 would learn MAC of Serv4 via initial ARP req. 
    • But not via subsequent bi-directional data traffic, because returning traffic could be ECMP'd to VTEP2, which also routes and rewrite SrcMAc of  inner pkt by VTEP2 mac. 
    • To avoid MAC being flush (default timeout is 5 min), it is advised to config ARP aging timeout (default 4 hours) less than MAC timeout. 
    • So force a ARP refresh and re-learning MAC. 
  • Direct Routing Config:
    • VTEP only needs to announce its loopback/end-point into BGP. 
    • Then tenant subnets exit only on the leafs, NOT in BGP or on spines. 
    • show vxlan address-table
    • show mac address-table

VXLAN Bridging with MLAG

VXLAN Bridging with MLAG
  • Key takeaways:
    • FH VTEP Encap/Decap
    • Routing between MLAG peers
    • MLAG peers share the same loopback/VTI address
  • https://eos.arista.com/vxlan-with-mlag-configuration-guide/
  • Provides remote L2 connectivity between racks or DC;
  • Each MLAG domain(2 MLAG peers) has ONE logical VTEP
    • Same virtual tunnel ip address (VTI)
    • 因为两个MLAG Peer work as ONE physical switch
  • MAC Sync:
    • For encap/decap traffic, both local and remote MAC address need to be sync'ed between peers via peer-link
    • remote = remote MAC associated with remote VTEP ip address. 
Configuration (same on both Mlag peers)
    interface loopback1
     ip address 192.168.0.1/32
    interface vxlan1
     vlan source-interface loopback 1
     vxlan udp-port 4789
     vxlan vlan 10 vni 10
     vxlan vlan 10 flood 192.168.0.2

      MAC, ARP, Traffic例子
      • serverA (macA) under MLAG domain 1 (Peer1A和1B),比方说VLAN 10,sends ARP request
        • ARP Req 会被Hash over 1 link of 2-port LAG. 
      • Peer1A受到这个ARP req, 有4个Actions
        • Act#1: peer1A floods this ARP Req所有本地VLAN 10的端口,因为是Bcast Pkt
        • Act#2: peer1A floods it to peer1B,这是给peer1B上面的Singly端口
          • peer1B只会flood singly ports,而不会flood dual-home ports
        • Act#3: peer1A sync with 1B,peer1B知道 macA 是在Port-channel上面
          • 这个Sync是另外的 MLAG signaling, 
        • Act#4: peer1A ENCAP ARP in VXLAN and floods all VTEP
          • FH GW 负责encap/decap vxlan traffic
      • VXLAN pkt is ECMP'ed to spine then to remote Peer2A/B,
        • Pear2A/B 和 1A/B一样,share一个VTI address,所以逻辑上是一个
        • peer1A ECMP to one spine;
        • This spine 有2个path to VTEP 192.168.0.2, 比方说ECMP to peer2A
        • Peer2A首到ARP req, DECAP VXLAN pkt and learns MACa in from VTEP 192.168.0.1, 以下是标准的MLAG流程 和 Peer1A很类似
          • Act#1: Peer2A flood ARP req all local ports
          • Act#2: Peer2A flood it via peer-link for those singly ports on Peer2B
          • Act#3: Peer2A sync‘s with Peer2B, MACa from VTEP 192.168.0.1
            • peerRemoteDynamic
        • ServerB unicasts ARP response to ServerA
          • dstMAC = MAC.AAA; srcMAC = MAC.BBB
        • Now both peer2A/2B know MAC.AAA is on VTEP 192.168.0.1, and ARP response is encap into VXLAN and routed to peer1B
          • ENCAP ARP reply on FH device
        • 如果peer1B 收到这个ARP reply, 
          • Learns MAC.BBB from VTEP 192.168.0.2, remoteDynamic;
          • sync with peer1A
          • and pkt fwd down to port-ch 10
        Useful CLIs:
        • show mac address, Ports里面有Vx1
        • show vxlan address-table, 有Mac/Vtep/Port
          Switch over 例子,例如Peer1A lose all uplinks
          • First Hop MLAG Peer/VTEP,负责encap/decap pkts, 这个是Principle
          • 例如MLAG peer1A lost all uplinks,但是device is up running
            • 还是Peer1A encap/decap pkts
            • 需要Routing between peer via Peerlink
          • Best Practise是建议routing on a dedicated VLAN而不是Peerlink VLAN 

          7/24/2018

          Arista EOS - "ip virtual mac-address mlag-peer"

          Say, in a mlag environment, 

          • The hosts can not understand the vMAC in the ARP packets. For example, some F5 and Netapp devices only check the srcMAC of ARP reply, instead of the srcHwMAC inside the ARP.
          • These host hashes the traffic with gateway's system mac to 2 mlag peers. 
          • When mlagPeer1 receives packets with dstMAC = mlagPeer2 system MAC, it should forward it to peer2 via peerlink, not good, a totally waste of peerlink
          • We can configure "ip virtual-router mac-address mlag-peer", which enables the peer to consume packets destined to peer and route them directly. 

          psp111.14:56:21#sh platform trident l3  shadow my-station
          My Station Tcam:
          --------------------------------------------------------------------------------
          Id    Vlan/Mask                                  Mac/Mask       VVVVMACD         T/       ModId/    IngPort/
                                                                          4646PRPS       Mask         Mask        Mask
                                                                          UUMMLPUC
                                                                          CCCCS  D
          7         0/0x0       44:4c:a8:93:22:9b/ff:ff:ff:ff:ff:ff       00000000        0/1        0/0x0      0/0x7f
          8         0/0x0       44:4c:a8:93:22:9b/ff:ff:ff:ff:ff:ff       11001000        0/0        0/0x0       0/0x0
          9         0/0x0       01:00:5e:00:00:00/ff:ff:ff:00:00:00       00000100        0/0        0/0x0       0/0x0
          10        0/0x0       44:4c:a8:93:29:d5/ff:ff:ff:ff:ff:ff       11001100        0/0        0/0x0       0/0x0
          11        0/0x0       00:dc:00:02:00:01/ff:ff:ff:ff:ff:ff       11001100        0/0        0/0x0       0/0x0

          5/22/2018

          MLAG Fast Convergence - MAC Redirection/Promption

          https://eos.arista.com/eos-4-18-0f/mlag-unicast-convergence/

          Problem Description:


          Consider the following setup 

          • mlagA and mlagB are 2 mlag peers with port-ch 2000;
          • The host MAC - 0000:1111:2222 is learnt on MLAG 10 and A is the owner. 
            • In another way, MAC 0000:1111:2222 is A's local MAC and B's remote
          • A bit background:
            • The MAC address and ARP information are all sync'ed during boot-up;
            • After that, only MAC table is sync'ed, for example, A tells B that MAC a.b.c is from mlag po10, or singly interface, or remote vtep. 
            • So in the MAC table, the MAC has at least 4 states:
              • learnedDynamic (local mlag), 
              • peerDynamic (remote mlag), 
              • learnedRemoteDynamic (vxlan) 
              • peerRemoteDynamic (remote vxlan)
            • Get this information by command - show mac address mlag-peer



          Now saying we have 

          • link failure, which has 2 loss: down and up
            • when B's po 10 is down, all MAC are re-programmed from po 10 to po 2000, so be MAC move is done one by one in old releases before 4.18.1F. (#1)
            • when B's po1 10 is back up, the ACL on peerLink to block BUM traffic immediately to break L2 loop while the MAC move needs time to be completed. (#2)
          • node failure, which introduces 3 loss, down, up and delay timeout
            • node down, 100s msec loss depending on scale
            • node up, 100s msec loss (#3)
              • When the peerlink is up, why? At this time, peerB has no uplink or downlink up, which are all in reload-delay. 
              • Remember the MAC sync mentioned above? A needs to sync up with B on the MAC, so on A these MAC learnt from B will be flushed!!
              • A has to relearn these MAC, 50% all of sudden. Still ok for locally switched packets because the hw flooding kicks in. 
              • But bad for Vxlan, which requires software flood for the head-end-replication. 
            • reload-delay timeout, 100s msec, actually 2 times
              • Need to have iBGP or IGP L3 routing between 2 peers.
              • Since peerlink is up fast and much earlier than mlag/non-mlag interface. So when non-mlag or mlag interfaces are up, they can send the traffic to peer link before the optimal path converged. 
          Feature and solution

          So from 4.18F, a feature called MLAG fast MAC redirection is developed to address above issues. This feature has 2 aspects:

          1. MAC redirect, for #1 and #2 loss
          • With this feature, the the interface attribute of impacted MACs still point to MLAG po 10 in host table. So, no move at all. 
          • Strata and Sand implementation are slightly different but same idea. 
          • On Sand, it is to use a recirc channel on each Arad/Jericho chip to recycle the MLAG destined packets over to peer-link. 
          • Requirements and limitation:
            • Peerlink must be a LAG not Ethernet on Strata. 
            • On Sand "platform sand lag hardware-only" must be enabled, I believe only hw LAG can share member port - the recirc channel. 
            • MLAG ASU2 cannot co-exist. 
          2. MAC address promotion, targeting #3. 
          • When 1) peer reboot; 2) hitful restart of fwding plane, the remote MACs (learnt via peer switch) will be flushed, which cause
          • 1) before the MAC is re-learnt, packets needs to flooded. Still ok in pure L2/L3 environment because done by hw;
          • 2) software forward of Vxlan packets. That's a big issue because it results in drops by CoPP. 
          • Why the MACs are flushed?
            • when peerB is up, MAC are sync'ed from A to B. These remote MAC are flushed. No MAC, then flooding. 
          • Solution: 
            • when peerB is down, the ownership of MAC are transfered to peerA
            • when peerB recovers, *ALL* MAC are sync'ed from A to B
          • Details:
            • when peerB is down, peerA enters failover state;
            • peerDynamic, peerLearnedRemote to learnedDynamic, learnedRemoteDynamic
            • NOT single-leg host
          Misc:
          • From AD1554:
            • If all uplinks are L3 interfaces, then it is preferable to keep non-mlag reload-delay timer < mlag timer, so
              • Upstream/L3 up first before downstream/L2;
              • In this way, S-N traffic should be no loss. 
            • Enabled "reload-delay mode lacp standby", need to have non-mlag timre >= mlag timer,
              • MLAG interfaces with LACP are kept warm for LAG membership table, MAC table programming. 
              • But upstream/L3 must be up after L2/downstream/mlag interfaces, otherwise S/N traffic are blackhole'd. 
          • From AD3152:
            • SandL3Unicast - managing NH and ensuring EEDB no change
            • SandACL - programming DROP ACL on the peerLinkRecircPort avoid pkts from peerLink back to peerLink
            • Assigning LagMemberID is interesting, this peerLinkRecircPort needs a member id. what about overflown?
            • LAG member, C/D bit
              • C = collecting, D = Distributing
              • if static LAG, C/D=True, added to LAG
              • if LACP enabled, only C=True, D=True, member can be added. 
              • peerLinkRecircPort is always C/D=False/True
            • LC removal event
              • If all ports on this LC, 
                • L3 will have some downtime since losing all ARP entries; 
                • L2 should be fine once recirc port is programmed. 
              • If at least 1 member on another LC, L2/L3 should be fine
            • This is quite complicated! 
              • 3/1, 3/36, 4/1 are local member of mlag Po 10
              • all 3 ports down, all 3 members retained with C/D=False
              • PeerLinkRecicFap is added from either 3/0, 3/2 or 4/0 
              • If LC3 is pulled, peerLinkRecirFap 4/0 is added. 
              • And a lot of combination of events, LAG config change, member port down...
            • 4 events:
              • LC removal
              • LAG config change: unconfig and change config
              • Member port down or cable unplug
              • port-ch shutdown
          • CLIs:
            • show plat trident counter int e27/1
            • Drops counts in Vlan boundary = Vlan ID missed. In another word, the VLAN id programming on this interface is not done yet. 
          Reference:
          • PeerOne Vxlan + MLAG
          • AD3398, BG141435/96642
          • AD3152
          • AD1554

          4/11/2018

          Arista L3 Leaf/Spine Step by Step (0) - Overview

          (updated Dec 2018, add more platform)

          In this series of blog, I will demo a sample configuration a simple L3 Leaf/Spine DC network based on Arista EOS devices by using VXLAN, EVPN, MLAG, and BGP. Here are some reference links:
          This blog is NOT a detailed technical review on protocols or how it works. You can find them in the above links. But most of the times, these official documentation doesn't give details on configurations. So that's why I write up this detailed hands-on guide which focuses on the configuration and troubleshooting. 

          I will try to configure the whole topology step by step in the following order.
          • Step 1 - Basic config (BGP and MLAG)
          • Step 2 - VXLAN Bridging
          • Step 3 - VXLAN Routing
          • Step 4 - EVPN
          • Step 5 - Troubleshooting
          Here is the topology:


          • From above topology, we have
            • Spine Layer: 
              • 2 Spines - DCS-7512N
              • AS# = 65000
            • 1 x Bow-tie MLAG leaf (on the top of diagram):
              • Trident 2, DCS-7050QX2-32S-F
              • AS# = 65041
            • 2 x MLAG leaves: (left bottom)
              • Trident 2+ and Jericho (no need for recirculation)
              • AS# = 65021, 65022
            • 3 x Single Leaves: (right bottom)
              • Trident 2, Jericho and Tomahawk
              • AS# = 65011, 65012, 65013
          • Each router has 2 loopback:
            • loopback 0 = 200.255.255.<rtrid>/32, for routing/id
            • loopback10 = 200.255.200.<RtrId/VxlanId>/32, for vxlan src ip
          • RtrId/VxlanId (the red block in diagram):
            • spine1/2 = 100/200
            • BT MLAG peers = 1/2/11/22
              • VxlanId = 12
            • MLAG Leaves = 3/4/5/6
              • VxlanID = 34 and 56
            • Single Leves: 7/8/9
          • Interface IP address = 200.rtr-id1*rtr-id2.<seq>.rtrid/24
            • for example 200.101.1.1/24, router spine1 to r1
          • The basic MLAG and BGP configuration are quite straightforward:
            • BGP only advertises the Vxlan source loopback - 200.255.200.<rtrID>

          MLAG vs LACP fast rate

          Arista doesn't recommend LACP rate fast enabled with MLAG, which is not very reliable especially in scale environment.

          For example:

          mlagA/Primary  mlagB/Secondary
                  \          /
                   \        /
                    \      /
                    mlagLeaf

          When either primary or secondary peer reloads, the mlagLeaf will see LAG flaps during this process. 

          In 4.20.2.1F Release Note, on page 21

          LACP PDU fast rate ("lacp rate fast" on an Arista switch) should not be configured on any port in an MLAG pair, or any port connected to an MLAG pair. (13950)

          Reference:
          bug13950/SR 101110/Old post

          Max # of MLAGs supported on Arista switch

          One the biggest limitations of # MLAG support on an Arista switch, is the port-id. If you see the following the error message when configuring MLAG port-channels, it means you hit the ceiling. 
          Mar 25 23:44:55 Arista.EOS Ebra: %SYS-1-PORT_ID_ERROR: Unable to allocate a port ID for interface

          Well, this kind of failure is quite rare especially if your devices are only fixed 1RU or 2RU systems or the # of mlag port-channels is below 100. But if your system is a heavily loaded modular system like 7508 or 7512 with all LCs plugged, it may hit you surprisingly. 

          What is the port-id, why important?
          • The port-id is used in LACP and STP. In STP, the port-id field is 16-bit, after 4-bit for priority, only 12 bit left for port-id, which is 4096
          • 2 MLAG peers are considered as 1 virtual switch, which means MLAG agent also needs to assign a port-id for corresponding peer-port and track their status. So now the space is cut half to 2048
          • All physical ports need port-id, including ethernet and port-channel. 
          • Considering a 7508N chassis with 8 x 7500R-36CQ-LC LC, how many port-id consumed?
            • By default, 1 QSFP port reserve 4 port-ids, no matter the speed or up/down status - "transceiver qsfp default-mode 4x10G"
            • 1 36CQ-LC = 4 x 36 = 144 port-ids
            • 8 36CQ-LC = 144 x 8 = 1152
            • After all, we still have 2048 - 1152 = 896 port-ids available for port-channels. 
          • And still need some for L3 uplink, peer link and management interfaces, say 32. 
          • Now the max # is 896 - 32 = 864
          What happens if you have a 7512N with 12 x 36CQ LC?
          • 12 36CQ-LC = 144 x 12 = 1728 port-id
          • Max# of MLAG port-channel = 2048 - 1728 - 32 = 285
          • Opps! Surprising, right? A chassis with more slots and more LCs supports much fewer MLAGs. 
          • So the best system for scale MLAG is 7508 chassis with 8 x 36CQ LC. 
          How to check port-id usage?
          Arista.EOS#bash echo "ls -l /ar/Sysdb/interface/eth/portid"  | python -m Acons Sysdb | more
          Connecting to local unix socket @00002 ...
          Connected to process 2244
          .....
          default collection portId has:
              Ethernet10/1/1       !!! local ethernet ports
              Ethernet10/1/2
          .....
              Management1/1        !!! local management interfaces
              Management1/2
              PeerEthernet10/1/1   !!! remote ethernet ports
              PeerEthernet10/1/2
          ....
              PeerPort-Channel1001 !!! remote port-channels
              PeerPort-Channel1002
          ....
              Port-Channel1001     !!! local port-channels
              Port-Channel1002

          Arista.EOS#bash echo "ls -l /ar/Sysdb/interface/eth/portid"  | python -m Acons Sysdb | egrep "Eth|Man|Peer|Port" | wc -l

          4049

          A refresh post of 2 old blog posts, 1 and 2

          4/09/2018

          Arista EOS, MLAG (3) - MLAG peer gateway

          Arista: MLAG peer gateway 
          Cisco: vPC peer gateway

          Why do we need it?
          • Some vendors like NetApp and F5, they use switch system MAC to construct packets instead of virtual MAC. 
          • Or it is by a feature called fast path, which just flip the source and destination MAC. 
          • when mlagA receives a packet with destination mac of mlagB, it has to forward it to mlag peer via peer link, which is not a favored behavior
          Configuration: 
          • ip virtual-router mac mlag-peer
          How does it work?
          • MLAG peer create an additional MY_MAC entry with MLAG peer address. 
          • When it gets packet with this MAC, just route them instead of fwding via peer link
          Useful command and supported platforms
          • T2 and Arad
          • show ip virtual-router
          • show platform trident l3 shadom my-station

          Arista EOS, MLAG (2) - Dual-Primary Detection

          MLAG Dual-Primary Detection

          This is a long-waiting MLAG feature and was introduced from EOS 4.20.1F around late 2017. When peer link is down, the secondary takes over primary. But sometime, the problem is only on the peer link and the peer is still alive. Without this feature, there will be dual MLAG primary and caused traffic disruption like bursty traffic loop. 

          But if you enable this feature, MLAG will communicate with peer via management interface + peer link. Since out-of-band management interface is considered less chance to be clogged, it will prevent above dual primary scenario. 

          How does it work?
          • When peer link is down, the secondary takes over primary immediately. 
          • Meanwhile it starts the dual-primary detection. 
          • If the peer receives heartbeats, it concludes a dual-primary found. As a result, secondary peer will disable ALL interfaces to avoid loop. 
          • When peer link is up, it will start MLAG negotiation and recovers
          Here is the configuration:

          mlag configuration
            peer-address heartbeat 172.30.134.180 
            ! heartbeat via management ip address
            dual-primary detection delay 10 action errdisable all-interfaces

          How to verify:

          Arista.EOS#show mlag det
          MLAG Configuration:
          domain-id              :       pg.mlag.leaf1
          local-interface        :            Vlan4094
          peer-address           :       192.168.255.0
          peer-link              :    Port-Channel2000
          hb-peer-address        :      172.30.134.181
          peer-config            :          consistent

          MLAG Status:
          state                  :              Active
          negotiation status     :           Connected
          peer-link status       :                  Up
          local-int status       :                  Up
          system-id              :   46:4c:a8:97:83:7d
          dual-primary detection :          Configured

          What happen if heartbeat connection has issue? If there is misconfiguration like missing vrf in hb-peer-address line, or out-of-band management network has connection issue, the system will report

          Arista.EOS#sh mlag det
          MLAG Configuration:
          domain-id              :       pg.mlag.leaf1
          ......
          MLAG Detailed Status:
          ....
          Heartbeat timeouts since reboot :                   1
          UDP heartbeat alive             :               False

          Arista.EOS#show logg | grep MLAG-3

          Apr 10 00:06:28 Arista.EOS Mlag: %MLAG-3-PEER_HEARTBEAT_TIMEOUT: MLAG stopped receiving UDP heartbeats from the peer 172.30.134.180.

          MLAG split-brain

          When the mlag split brain happens (the trigger is to disconnect the peer link), both leaf could hash BPDU to 1 peer, and the other peer doesn't receive any BPDU, so all ports are in forwarding and causes a loop. 

          The STP may kick in and put ports in designated-dispute mode. But after 2 x fdWhile timer, another round of negotiation starts and form a bursty loop every 2 seconds. 

          An interesting RFE 11825. 

          Arista EOS, MLAG (1) - Basic Configuration

          Arista MLAG - basic configuration

          For the details, please refer above link. Here is the list of needed configurations:

          • Port-channel for peer link
          • VLAN for peer link
          • L3 SVI for peer link VLAN
          • MLAG configuration:
            • domain-id (must be matched on both peers)
            • local-interface (above L3 SVI)
            • peer-address 
            • peer-link
          • Useful commands:
            • show mlag detail
            • show mlag interface

          Arista EOS: trunk group

          From the below link of "MLAG - basic configuration", there have the following configuration of MLAG peer link VLAN:

          vlan 4094
            trunk group peerLink
          interface port-ch 2000 
            switch trunk group peerLink

          Why do we need to assign vlan 4094 to trunk group? Quota from the reference of EOS configuration - VLAN,  


          "VLANs configured in a trunk group are 'pruned' off all ports that are not associated with the trunk group". 

          • So if you have other ethernet or port-channels are configured as trunk, by default ALL VLANs are enabled if you don't specify the VLAN range. In this case, peerLink VLAN is also included. This is not an expected behavior or good practice, since the peerLink carries the critical control plane information. 
          • But if you configure VLAN in trunk group, you have to specify the physical interfaces are associated with this trunk group. This is to provide a casual configuration causing the disruption of peerLink Vlan