-- ARISTA-VXLAN-MIB: Arista VXLAN information
-- Copyright (c) 2020 Arista Networks, Inc.  All rights reserved.

ARISTA-VXLAN-MIB DEFINITIONS ::= BEGIN

IMPORTS
    MODULE-IDENTITY, OBJECT-TYPE,
    Counter64, Unsigned32              FROM SNMPv2-SMI
    MODULE-COMPLIANCE, OBJECT-GROUP    FROM SNMPv2-CONF
    InetAddress, InetAddressType       FROM INET-ADDRESS-MIB
    InterfaceIndex                     FROM IF-MIB
    aristaMibs                         FROM ARISTA-SMI-MIB;

aristaVxlanMIB MODULE-IDENTITY
    LAST-UPDATED "202209150000Z"
    ORGANIZATION "Arista Networks, Inc."
    CONTACT-INFO
        "Arista Networks, Inc.

         Postal: 5453 Great America Parkway
                 Santa Clara, CA 95054

         Tel: +1 408 547-5500

         E-mail: snmp@arista.com"
    DESCRIPTION
            "The MIB module for VXLAN counters and status information
            on Arista devices."

    REVISION    "202209150000Z"
    DESCRIPTION "Added support for exporting counters per VXLAN tunnel
            interface."
    REVISION    "202006010000Z"
    DESCRIPTION "Initial version."
    ::= { aristaMibs 28 }

aristaVxlanMibNotifications OBJECT IDENTIFIER
    ::= { aristaVxlanMIB 0 }

aristaVxlanMibObjects OBJECT IDENTIFIER
    ::= { aristaVxlanMIB 1 }

aristaVxlanMibConformance OBJECT IDENTIFIER
    ::= { aristaVxlanMIB 2 }

-- Notifications --

-- Objects --

-- Per VTEP counters table --

aristaVxlanVtepCountersTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF AristaVxlanVtepCountersEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "This table contains VXLAN counters per remote VTEP."
    ::= { aristaVxlanMibObjects 1 }

aristaVxlanVtepCountersEntry OBJECT-TYPE
    SYNTAX      AristaVxlanVtepCountersEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "Decap (ingress) and encap (egress) counters for a given remote
        VTEP."
    INDEX       { aristaVxlanVtepAddressType, aristaVxlanVtepAddress }
    ::= { aristaVxlanVtepCountersTable 1 }

AristaVxlanVtepCountersEntry ::= SEQUENCE {
    -- INDEX
    aristaVxlanVtepAddressType          InetAddressType,
    aristaVxlanVtepAddress              InetAddress,
    -- Decap counters
    aristaVxlanVtepDecapBytes           Counter64,
    aristaVxlanVtepDecapPkts            Counter64,
    aristaVxlanVtepDecapKnownUcastBytes Counter64,
    aristaVxlanVtepDecapKnownUcastPkts  Counter64,
    aristaVxlanVtepDecapBUMBytes        Counter64,
    aristaVxlanVtepDecapBUMPkts         Counter64,
    aristaVxlanVtepDecapDropExcptBytes  Counter64,
    aristaVxlanVtepDecapDropExcptPkts   Counter64,
    -- Encap counters
    aristaVxlanVtepEncapBytes           Counter64,
    aristaVxlanVtepEncapPkts            Counter64,
    aristaVxlanVtepEncapBUMPkts         Counter64,
    aristaVxlanVtepEncapDropExcptPkts   Counter64
}

aristaVxlanVtepAddressType OBJECT-TYPE
    SYNTAX      InetAddressType
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The address type of the remote VTEP that identifies this entry."
    ::= { aristaVxlanVtepCountersEntry 1 }

aristaVxlanVtepAddress OBJECT-TYPE
    SYNTAX      InetAddress (SIZE(0..20))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The address of the remote VTEP that identifies this entry.
        
        Since the InetAddress Textual Convention defines its size as
        0..255, and since this object is used as an index, we must further
        limit the size here to account for the limit of 128 sub-identifiers
        specified in SMIv2, STD 58. The size is limited to 20 to account
        for an ipv6z address (16 bytes for the ipv6 address + 4 bytes for
        the zone index)."
    ::= { aristaVxlanVtepCountersEntry 2 }

aristaVxlanVtepDecapBytes OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of bytes decapsulated from this VTEP."
    ::= { aristaVxlanVtepCountersEntry 3 }

aristaVxlanVtepDecapPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of packets decapsulated from this VTEP."
    ::= { aristaVxlanVtepCountersEntry 4 }

aristaVxlanVtepDecapKnownUcastBytes OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of L2 known unicast bytes decapsulated from this VTEP."
    ::= { aristaVxlanVtepCountersEntry 5 }

aristaVxlanVtepDecapKnownUcastPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of L2 known unicast packets decapsulated from this
        VTEP."
    ::= { aristaVxlanVtepCountersEntry 6 }

aristaVxlanVtepDecapBUMBytes OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of L2 BUM (Broadcast, Unknown, and Multicast) bytes
        decapsulated from this VTEP."
    ::= { aristaVxlanVtepCountersEntry 7 }

aristaVxlanVtepDecapBUMPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of L2 BUM (Broadcast, Unknown, and Multicast) packets
        decapsulated from this VTEP."
    ::= { aristaVxlanVtepCountersEntry 8 }

aristaVxlanVtepDecapDropExcptBytes OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of dropped and exception bytes decapsulated from this
        VTEP."
    ::= { aristaVxlanVtepCountersEntry 9 }

aristaVxlanVtepDecapDropExcptPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of dropped and exception packets decapsulated from this
        VTEP."
    ::= { aristaVxlanVtepCountersEntry 10 }

aristaVxlanVtepEncapBytes OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of bytes encapsulated to this VTEP."
    ::= { aristaVxlanVtepCountersEntry 11 }

aristaVxlanVtepEncapPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of packets encapsulated to this VTEP."
    ::= { aristaVxlanVtepCountersEntry 12 }

aristaVxlanVtepEncapBUMPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of BUM (Broadcast, Unknown, and Multicast) packets
        encapsulated to this VTEP."
    ::= { aristaVxlanVtepCountersEntry 13 }

aristaVxlanVtepEncapDropExcptPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of dropped and exception packets encapsulated to this
        VTEP."
    ::= { aristaVxlanVtepCountersEntry 14 }

-- Per VNI counters table --

aristaVxlanVniCountersTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF AristaVxlanVniCountersEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "This table contains VXLAN counters per VNI."
    ::= { aristaVxlanMibObjects 2 }

aristaVxlanVniCountersEntry OBJECT-TYPE
    SYNTAX      AristaVxlanVniCountersEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "Decap (ingress) and encap (egress) counters for a given VNI."
    INDEX       { aristaVxlanVni }
    ::= { aristaVxlanVniCountersTable 1 }

AristaVxlanVniCountersEntry ::= SEQUENCE {
    -- INDEX
    aristaVxlanVni                     Unsigned32,
    -- Decap counters
    aristaVxlanVniDecapBytes           Counter64,
    aristaVxlanVniDecapPkts            Counter64,
    aristaVxlanVniDecapKnownUcastBytes Counter64,
    aristaVxlanVniDecapKnownUcastPkts  Counter64,
    aristaVxlanVniDecapBUMBytes        Counter64,
    aristaVxlanVniDecapBUMPkts         Counter64,
    aristaVxlanVniDecapDropExcptBytes  Counter64,
    aristaVxlanVniDecapDropExcptPkts   Counter64,
    -- Encap counters
    aristaVxlanVniEncapBytes           Counter64,
    aristaVxlanVniEncapPkts            Counter64,
    aristaVxlanVniEncapBUMBytes        Counter64,
    aristaVxlanVniEncapBUMPkts         Counter64,
    aristaVxlanVniEncapDropPkts        Counter64
}

aristaVxlanVni OBJECT-TYPE
    SYNTAX      Unsigned32
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The VNI that identififies this entry."
    ::= { aristaVxlanVniCountersEntry 1 }

aristaVxlanVniDecapBytes OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of bytes decapsulated for this VNI."
    ::= { aristaVxlanVniCountersEntry 2 }

aristaVxlanVniDecapPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of packets decapsulated for this VNI."
    ::= { aristaVxlanVniCountersEntry 3 }

aristaVxlanVniDecapKnownUcastBytes OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of L2 known unicast bytes decapsulated for this VNI."
    ::= { aristaVxlanVniCountersEntry 4 }

aristaVxlanVniDecapKnownUcastPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of L2 known unicast packets decapsulated for this VNI."
    ::= { aristaVxlanVniCountersEntry 5 }

aristaVxlanVniDecapBUMBytes OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of L2 BUM (Broadcast, Unknown, and Multicast) bytes
        decapsulated for this VNI."
    ::= { aristaVxlanVniCountersEntry 6 }

aristaVxlanVniDecapBUMPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of L2 BUM (Broadcast, Unknown, and Multicast) packets
        decapsulated for this VNI."
    ::= { aristaVxlanVniCountersEntry 7 }

aristaVxlanVniDecapDropExcptBytes OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of dropped and exception bytes decapsulated for this
        VNI."
    ::= { aristaVxlanVniCountersEntry 8 }

aristaVxlanVniDecapDropExcptPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of dropped and exception packets decapsulated for this
        VNI."
    ::= { aristaVxlanVniCountersEntry 9 }

aristaVxlanVniEncapBytes OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of bytes encapsulated for this VNI."
    ::= { aristaVxlanVniCountersEntry 10 }

aristaVxlanVniEncapPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of packets encapsulated for this VNI."
    ::= { aristaVxlanVniCountersEntry 11 }

aristaVxlanVniEncapBUMBytes OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of L2 BUM (Broadcast, Unknown, and Multicast) bytes
        for this VNI before replication for encapsulation."
    ::= { aristaVxlanVniCountersEntry 12 }

aristaVxlanVniEncapBUMPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of L2 BUM (Broadcast, Unknown, and Multicast) packets
        for this VNI before replication for encapsulation."
    ::= { aristaVxlanVniCountersEntry 13 }

aristaVxlanVniEncapDropPkts OBJECT-TYPE
    SYNTAX      Counter64
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of dropped and exception packets encapsulated for this
        VNI."
    ::= { aristaVxlanVniCountersEntry 14 }

-- Per VTI, VNI counters table --

aristaVxlanVtiVniCountersTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF AristaVxlanVtiVniCountersEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "On specific EOS devices multiple VXLAN tunnel interfaces (VTI) can
        be configured with unique VNI associations. If such a configuration
        is supported and the device has the capability to maintain counters
        for each unique VTI and VNI, then this table will contain the
        relevant counter information."
    ::= { aristaVxlanMibObjects 3 }

aristaVxlanVtiVniCountersEntry OBJECT-TYPE
    SYNTAX      AristaVxlanVtiVniCountersEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "Decap (ingress) and encap (egress) counters for a given VNI unique
        to a specific VTI.
        Each conceptual row is uniquely identified by the ifIndex of the
        VTI (aristaVxlanVtiIndex) and a single VNI associated with that
        VTI (aristaVxlanVni)."
    INDEX       { aristaVxlanVtiIndex, aristaVxlanVni }
    ::= { aristaVxlanVtiVniCountersTable 1 }

AristaVxlanVtiVniCountersEntry ::= SEQUENCE {
    -- INDEX
    aristaVxlanVtiIndex                InterfaceIndex,
    -- Decap counters
    aristaVxlanVtiVniDecapBytes        Counter64,
    aristaVxlanVtiVniDecapPkts         Counter64,
    -- Encap counters
    aristaVxlanVtiVniEncapBytes        Counter64,
    aristaVxlanVtiVniEncapPkts         Counter64
}

aristaVxlanVtiIndex OBJECT-TYPE
    SYNTAX          InterfaceIndex
    MAX-ACCESS      not-accessible
    STATUS          current
    DESCRIPTION
        "The ifIndex of the VXLAN tunnel interface (VTI) that identififies
        this entry."
    ::= { aristaVxlanVtiVniCountersEntry 1 }

aristaVxlanVtiVniDecapBytes OBJECT-TYPE
    SYNTAX                  Counter64
    MAX-ACCESS              read-only
    STATUS                  current
    DESCRIPTION
        "The number of bytes decapsulated for this VNI unique to the given
        VTI."
    ::= { aristaVxlanVtiVniCountersEntry 2 }

aristaVxlanVtiVniDecapPkts OBJECT-TYPE
    SYNTAX                 Counter64
    MAX-ACCESS             read-only
    STATUS                 current
    DESCRIPTION
        "The number of packets decapsulated for this VNI unique to the given
        VTI."
    ::= { aristaVxlanVtiVniCountersEntry 3 }

aristaVxlanVtiVniEncapBytes OBJECT-TYPE
    SYNTAX                  Counter64
    MAX-ACCESS              read-only
    STATUS                  current
    DESCRIPTION
        "The number of bytes encapsulated for this VNI unique to the given
        VTI."
    ::= { aristaVxlanVtiVniCountersEntry 4 }

aristaVxlanVtiVniEncapPkts OBJECT-TYPE
    SYNTAX                 Counter64
    MAX-ACCESS             read-only
    STATUS                 current
    DESCRIPTION
        "The number of packets encapsulated for this VNI unique to the given
        VTI."
    ::= { aristaVxlanVtiVniCountersEntry 5 }

-- Conformance and Compliance --

aristaVxlanMibCompliances OBJECT IDENTIFIER
    ::= { aristaVxlanMibConformance 1 }

aristaVxlanMibGroups OBJECT IDENTIFIER
    ::= { aristaVxlanMibConformance 2 }

aristaVxlanMibCompliance MODULE-COMPLIANCE
    STATUS     current
    DESCRIPTION
        "The compliance statement for Arista switches that implement
        the ARISTA-VXLAN-MIB."
    MODULE     -- this module
    MANDATORY-GROUPS {
        aristaVxlanMibCountersGroup
    }
    ::= { aristaVxlanMibCompliances 1 }

aristaVxlanMibCountersGroup OBJECT-GROUP
    OBJECTS {
        aristaVxlanVtepDecapBytes,
        aristaVxlanVtepDecapPkts,
        aristaVxlanVtepDecapKnownUcastBytes,
        aristaVxlanVtepDecapKnownUcastPkts,
        aristaVxlanVtepDecapBUMBytes,
        aristaVxlanVtepDecapBUMPkts,
        aristaVxlanVtepDecapDropExcptBytes,
        aristaVxlanVtepDecapDropExcptPkts,
        aristaVxlanVtepEncapBytes,
        aristaVxlanVtepEncapPkts,
        aristaVxlanVtepEncapBUMPkts,
        aristaVxlanVtepEncapDropExcptPkts,
        aristaVxlanVniDecapBytes,
        aristaVxlanVniDecapPkts,
        aristaVxlanVniDecapKnownUcastBytes,
        aristaVxlanVniDecapKnownUcastPkts,
        aristaVxlanVniDecapBUMBytes,
        aristaVxlanVniDecapBUMPkts,
        aristaVxlanVniDecapDropExcptBytes,
        aristaVxlanVniDecapDropExcptPkts,
        aristaVxlanVniEncapBytes,
        aristaVxlanVniEncapPkts,
        aristaVxlanVniEncapBUMBytes,
        aristaVxlanVniEncapBUMPkts,
        aristaVxlanVniEncapDropPkts,
        aristaVxlanVtiVniDecapBytes,
        aristaVxlanVtiVniDecapPkts,
        aristaVxlanVtiVniEncapBytes,
        aristaVxlanVtiVniEncapPkts

    }
    STATUS      current
    DESCRIPTION
        "The collection of objects that provide VXLAN counters."
    ::= { aristaVxlanMibGroups 1 }

END
