← Interview Prep

System Design — Network Monitoring (SNMP + gNMI)

Design a network monitoring system: requirements, SNMP polling vs gNMI streaming telemetry (and why both), the inventory-driven pipeline (collectors → Kafka → TSDB → alerting → Grafana), the metric model & cardinality control, symptom-based alerting, and scaling/HA/failure modes.

A common senior/system-design prompt: "design a monitoring system for a large network." The strong answer walks requirements → collection → pipeline → storage → alerting → scale → failure modes, and knows when to reach for SNMP polling vs gNMI streaming telemetry. Original, interview-focused notes.

The backbone: collectors gather metrics (SNMP poll + gNMI subscribe), a message bus buffers and fans them out, a time-series DB stores them, an alerting engine fires on symptoms, and dashboards visualize — all driven by an inventory / source of truth that says what to monitor.

Requirements first (say these)

Collection: SNMP vs gNMI

SNMPgNMI streaming telemetry
ModelPoll (collector asks every N s)Push (device streams on Subscribe)
Transport / encodingUDP / BER; OIDs & MIBsgRPC+TLS / protobuf; YANG (OpenConfig) paths
Resolution~30–60 s (polling load caps it)Sub-second; ON_CHANGE for state
Device costCPU spikes on walks; watch CoPPLower, steady; one session
CoverageUniversal (every device)Newer platforms only

The realistic answer is both: gNMI where supported (fast, efficient, ON_CHANGE for BGP/interface state), SNMP everywhere else and for legacy gear. Details: gNMI & Telemetry.

Architecture

  SoT / inventory (NetBox) ──▶ what to poll / subscribe, per device

  devices ──SNMP poll──▶ SNMP collectors ─┐
          ──gNMI Sub───▶ gNMI collectors  ─┤
                          (gnmic/Telegraf/  │─▶ message bus ─▶ stream proc ─▶ TSDB ─▶ Grafana
                           snmp_exporter)   │    (Kafka)        (normalize,    (Prom/     (dashboards)
          ──dial-out────▶ (device pushes)  ─┘                    label, enrich) VictoriaM)
                                                                        │
                                                                        ▼
                                                                   alerting (Alertmanager)
                                                                        │
                                                                   Slack / PagerDuty

Data model & cardinality

Alerting: symptoms, not noise

Scale & failure modes

Likely interview questions

  • SNMP vs gNMI — poll vs push, resolution, device cost; why use both?
  • Draw the pipeline: collectors → bus → TSDB → alerting/dashboards, and what the SoT drives.
  • Why put Kafka in the middle? (decouple, buffer, fan-out, backpressure)
  • What's the cardinality problem and how do you contain it?
  • How do you alert on BGP going down within a second? (gNMI ON_CHANGE)
  • Why alert on rates/symptoms, not raw counters?
  • How do you scale to 50k devices, and keep it HA and independent of the monitored network?
  • How do SNMP OIDs and OpenConfig paths map to one dashboard? (common metric model)