Skip to content

PFC and Queue SNMP counters High Level Design

AndriiS edited this page Aug 31, 2017 · 6 revisions

PFC and Queue SNMP counters in SONiC

High Level Design Document

Rev 0.2

Table of Contents

List of Tables

Revision
Rev Date Author Change Description
0.1 Andrii Savka Initial version
0.2 Andrii Savka Updated SNMP counters OIDs

About this Manual

This document provides general information about the PFC and Queue SNMP counters feature implementation in SONiC.

Scope

This document describes the high level design of the PFC and Queue SNMP counters feature.

Definitions/Abbreviation

Table 2: Abbreviations
Definitions/Abbreviation Description
SNMP Simple Network Management Protocol
PFC Priority flow control
API Application Programmable Interface
SAI Switch Abstraction Interface

1 Overview

1.1 System Chart

Following diagram describes a top level overview of the SONiC SNMP architecture:

1.2 Modules description

1.2.1 SNMP agent

Stores the information from Counter DB in the local cash and handles the SNMP requests.

1.2.2 Counter DB

Located in the Redis DB instance #2 running inside the container "database". Redis DB works with the data in format of key-value tuples, needs no predefined schema and holds various counters like port counters, ACL counters, etc.

1.2.3 Orchestration Agent

This component is running in the "orchagent" docker container and is responsible for processing updates of the APP DB and do corresponding changes in the SAI DB via SAI Redis.

1.2.4 SAI Redis

SAI Redis is an implementation of the SAI API which translates API calls into SAI objects which are stored in the SAI DB.

1.2.5 SAI DB

Redis DB instance #1. Holds serialized SAI objects.

1.2.6 syncd

Reads SAI DB data (SAI objects) and performs appropriate calls to Switch SAI.

1.2.7 SAI (Redis and Switch)

An unified API which represent the switch state as a set of objects. In SONiC represented in two implementations - SAI DB frontend and ASIC SDK wrapper.

2 Requirements

The following counters should be supported in the SNMP agent:

2.1 PFC counters requirements

OID SNMP counter SAI counter
1.3.6.1.4.1.9.9.813.1.1 cpfcIfTable
1.3.6.1.4.1.9.9.813.1.1.1 cpfcIfEntry
1.3.6.1.4.1.9.9.813.1.1.1.1.ifindex cpfcIfRequests sum of SAI_PORT_STAT_PFC_[0-7]_RX_PKTS
1.3.6.1.4.1.9.9.813.1.1.1.2.ifindex cpfcIfIndications sum of SAI_PORT_STAT_PFC_[0-7]_RX_PKTS
1.3.6.1.4.1.9.9.813.1.2 cpfcIfPriorityTable
1.3.6.1.4.1.9.9.813.1.2.1 cpfcIfPriorityEntry
1.3.6.1.4.1.9.9.813.1.2.1.2.ifindex.prio requestsPerPriority SAI_PORT_STAT_PFC_[prio]_RX_PKTS
1.3.6.1.4.1.9.9.813.1.2.1.3.ifindex.prio indicationsPerPriority SAI_PORT_STAT_PFC_[prio]_TX_PKTS

2.2 Queue counters requirements

OID SNMP counter SAI counter
1.3.6.1.4.1.9.9.580.1.5.5 csqIfQosGroupStatsTable
1.3.6.1.4.1.9.9.580.1.5.5.1 csqIfQosGroupStatsEntry
1.3.6.1.4.1.9.9.580.1.5.5.1.4.IfIndex.IfDirection.QueueID.1 ucastSentPkts SAI_QUEUE_STAT_PACKETS
1.3.6.1.4.1.9.9.580.1.5.5.1.4.IfIndex.IfDirection.QueueID.2 ucastSentBytes SAI_QUEUE_STAT_BYTES
1.3.6.1.4.1.9.9.580.1.5.5.1.4.IfIndex.IfDirection.QueueID.3 mcastSentPkts SAI_QUEUE_STAT_PACKETS
1.3.6.1.4.1.9.9.580.1.5.5.1.4.IfIndex.IfDirection.QueueID.4 mcastSentBytes SAI_QUEUE_STAT_BYTES
1.3.6.1.4.1.9.9.580.1.5.5.1.4.IfIndex.IfDirection.QueueID.5 ucastDroppedPkts SAI_QUEUE_STAT_DROPPED_PACKETS
1.3.6.1.4.1.9.9.580.1.5.5.1.4.IfIndex.IfDirection.QueueID.6 ucastDroppedBytes SAI_QUEUE_STAT_DROPPED_BYTES
1.3.6.1.4.1.9.9.580.1.5.5.1.4.IfIndex.IfDirection.QueueID.7 mcastDroppedPkts SAI_QUEUE_STAT_DROPPED_PACKETS
1.3.6.1.4.1.9.9.580.1.5.5.1.4.IfIndex.IfDirection.QueueID.8 mcastDroppedBytes SAI_QUEUE_STAT_DROPPED_BYTES

3 Modules Design

3.1 Modules that need to be updated

3.1.1 SNMP agent

The new MIBs with appropriate MIB updaters should be implemented for PFC and Queue counters.

  • The ciscoPfcExtMIB MIB for PFC counters.
  • The ciscoSwitchQosMIB MIB for Queue counters.

3.1.2 Counter DB

The new PFC and Queue counters should be available for each port and priority.

The following PFC counters should be available for each port entry in the DB:

  • "COUNTERS:port_vid"
    • SAI_PORT_STAT_PFC_[0-7]_RX_PKTS
    • SAI_PORT_STAT_PFC_[0-7]_TX_PKTS

The following Queue counters should be available for each queue entry in the DB:

  • "COUNTERS:queue_vid"
    • SAI_QUEUE_ATTR_TYPE
    • SAI_QUEUE_STAT_BYTES
    • SAI_QUEUE_STAT_DROPPED_BYTES
    • SAI_QUEUE_STAT_PACKETS
    • SAI_QUEUE_STAT_DROPPED_PACKETS

3.1.3 Orchestration Agent

No update is needed.

3.1.4 SAI Redis

No update is needed.

3.1.5 SAI DB

No update is needed.

3.1.6 Syncd

The new functionality should be added. The Syncd should updates the Queue counters in the Counter DB.

3.1.7 SAI

No update is needed.

4 Flows

4.1 Update the ports and queues counters

5 Open Questions

  1. Would it better to introduce new SAI counters for cpfcIfRequests and cpfcIfIndications counters per port instead of summarizing PFC counter per priority?
Clone this wiki locally