Network Monitoring and Performance Questions
Network telemetry and performance operations: SNMP polling and traps (including counter wraparound and SNMPv3 access), NetFlow, sFlow and IPFIX flow export, sampling and its accuracy, streaming telemetry (gNMI), and eBPF or packet-capture telemetry; interface-level metrics (utilization, errors, discards, queue depth, microbursts), active synthetic probing alongside passive counters, link-flap detection, baselining and anomaly detection on network signals including elephant-flow spotting, network SLIs and SLOs, alerting, alert-storm suppression and NOC dashboards, telemetry pipeline design, storage, retention, downsampling and cardinality for network data (including securing the collection path and handling bursty remote sites), BGP and link-state monitoring including prefix hijack and route-leak detection, and network capacity monitoring, percentile utilization and bandwidth headroom planning. Also covers measuring and tuning network-level latency, jitter, packet loss and throughput (bufferbloat, queueing, TCP tuning for long paths). Excludes the generic metrics, logs and traces stack and alert design, the layered fault-isolation method and packet-capture troubleshooting, TCP and protocol fundamentals, application and CDN latency engineering, cloud VPC design and security detection.
Your 10,000-device network is polled over SNMP every five minutes, and the team wants to move to model-driven streaming telemetry. Make the case, describe what changes in tooling and device load, and explain how you would migrate without losing visibility.
Sample Answer
Direct answer
Make the case for streaming telemetry on resolution and timeliness, not on "it is newer", and commit to a hybrid migration: stream the signals where 5-minute averages are blind (interface counters and queue drops on links that matter, neighbor and interface state as events), keep SNMP running in parallel until the new data has been proven equal, and retire SNMP polling only per device cohort and per metric. Streaming does not make the load disappear. It moves it from the devices answering polls to collectors and a time-series database (TSDB), and it multiplies the number of data points, so the case has to be sized.
The case, in terms an operator cares about
- Resolution. A 5-minute SNMP (Simple Network Management Protocol) average hides short bursts: a 400 Mbit/s average on a 1,000 Mbit/s link can contain 20 seconds at line rate (400 x 300 = 120,000 megabits in the window; the burst accounts for 20 x 1,000 = 20,000, so 120,000 - 20,000 = 100,000 remain; spread over the other 280 s that is about 357 Mbit/s). A 30-second stream exposes it.
- Events instead of waiting for the next poll. In gNMI (gRPC Network Management Interface, the OpenConfig streaming and configuration protocol; gRPC is a remote-procedure-call framework) a subscription can use SAMPLE mode (send at a fixed interval), ON_CHANGE (send when a value changes, with an optional heartbeat that re-sends periodically) or TARGET_DEFINED (the device picks the mode per leaf, where a leaf is one individual value in the model tree, such as a single counter). Interface state and neighbor state arrive when they change, not up to 5 minutes later.
- Structured, modelled data. Paths come from YANG models (a data-modelling language for network devices), including vendor-neutral OpenConfig models, so the same query shape can work across vendors where they implement them. SNMP needs per-vendor MIB (Management Information Base) knowledge and OID (numeric object name) lookups.
- Transport security. The gNMI specification requires the session to be encrypted with TLS (Transport Layer Security, the encryption used by HTTPS) and forbids falling back to an unencrypted session, with mutual X.509 certificate authentication supported (each side proves its identity with a certificate, so devices and collectors both verify each other). SNMPv2c has no encryption.
- No poll-cycle skew. Devices push on their own clock, so there is no poller cycle taking minutes to finish across 10,000 devices.
What changes in tooling and load (computed)
Assume 48 interfaces and 10 counters each, so 480 values per device:
| Method | Interval | Values per second | Points per day |
|---|---|---|---|
| SNMP polling | 300 s | 16,000 | 1.38 billion |
| gNMI SAMPLE | 30 s | 160,000 | 13.82 billion |
| gNMI SAMPLE | 10 s | 480,000 | 41.47 billion |
(10,000 devices x 480 values / interval; x 86,400 s per day.) Going from 5 minutes to 30 seconds is 10x the data, to 10 seconds 30x. That drives the TSDB and storage bill, so do not stream everything at the finest interval: stream interface counters and queue drops at 30 seconds on uplinks and WAN edges, event-style state on change, and keep slow-moving inventory and low-value counters on coarse polling.
A subscription is a few lines. With the open-source gnmic client, gnmic -a <device>:<port> subscribe --path "/interfaces/interface/state/counters" --mode stream --stream-mode sample --sample-interval 30s asks the device to push the interface counters every 30 seconds until stopped (flag names per the gnmic documentation; the address and path are placeholders to adapt to your device and its model).
Tooling changes: a gNMI collector tier with certificate management (a certificate authority and rotation, since TLS is mandatory), a TSDB sized for the table above, subscription definitions kept in version control, and a per-vendor path catalogue (OpenConfig where supported, native models where not). SNMP stays for inventory and for devices that cannot stream.
Device load: I will not claim a number. Whether streaming costs a platform more or less CPU than being polled depends on the platform and the path set, and has to be measured: enable the subscription on a canary device per hardware model and compare control-plane CPU with and without it.
Migration without losing visibility
- Inventory and capability matrix. Which of the 10,000 devices support gNMI and which paths, by model and software version. Anything that cannot stream stays on SNMP.
- Canary cohort. A canary is a small first group that tests the change before everyone gets it, and a cohort is a group of devices handled together: one model per site type, streaming at the planned interval, with CPU and memory watched.
- Dual-run. Stream and poll the same counters for a defined period. Compare the rate computed from streamed counters over each 5-minute window with the SNMP rate; set a tolerance (for example 1%) and investigate every outlier before proceeding. For example (illustrative numbers), if a counter moved by 15,000,000,000 bytes in a 5-minute window, SNMP gives 15,000,000,000 x 8 / 300 = 400.0 Mbit/s; the first and last streamed samples in the same window show 15,020,000,000 bytes, which is 400.5 Mbit/s, a 0.13% difference, inside the 1% tolerance. A 5% difference would be investigated before that cohort moves on.
- Close the silence gap. A push system fails quietly: a dead subscription simply stops sending. Alert on missing data per device and use ON_CHANGE heartbeats so "no change" is distinguishable from "no stream".
- Move dashboards and alerts to the new source cohort by cohort, with rollback by switching the data source back, because SNMP is still running.
- Retire SNMP polling per metric only after a full cycle of the busiest period (month end, a peak event) has matched. Keep SNMP traps or a low-rate poll as a heartbeat fallback.
Pitfalls
- Treating a 10x to 30x rise in data points as free; it is a TSDB cost and retention decision (keep fine data short, roll up for long-term).
- Counter semantics: use 64-bit counters in both worlds. RFC 2863 gives 34 seconds as the minimum wrap time of a 32-bit octet counter at 1 Gbit/s.
- Cutting over before parity is proven, then discovering the streamed rate differs from the old one for a reason nobody can explain.
Architect network observability across cloud, on-prem and edge covering about 50,000 devices, with sub-second alerting for critical failures and long-term trend retention. Where do you standardize, what do you collect, and how do you keep alert volume under control?
Sample Answer
Scale first. Assume about 40 interfaces and 6 series each across 50,000 devices: 12 million series, 400,000 samples per second at a 30-second interval (computed: 50,000 x 40 x 6 = 12,000,000 series, divided by 30 s). Raw storage at 2 bytes per sample (ESTIMATE; Prometheus documents 1 to 2) is about 2.1 TB for 30 days: 400,000 x 2 B = 800,000 B/s, x 86,400 s = 69.12 GB per day, x 30 days = 2.07 TB. One server will not do that, so the design is regional collection plus central query.
Where to standardize
- Identity and labels from one inventory (source of truth). Every device, in every domain, carries
device,site,region,device_role,team,envfrom the inventory, never from the device. Alert routing and dashboards depend on these labels being identical everywhere. - Metric names and units (base units,
_totalon counters), the same scheme for cloud, on-prem and edge, so a dashboard works across all three. - Transports: every device class needs a baseline: SNMP (Simple Network Management Protocol) v3 for counters and state, IPFIX (IP Flow Information Export, records of who talked to whom) for flows, syslog for events. Where devices support it, gNMI (a streaming management protocol: the device sends data to the collector instead of being polled) carries counters and state changes, with OpenConfig (vendor-neutral data models) so the same path means the same thing across vendors; SNMP v3 is the fallback. The sub-second machinery below (BFD, on-change streaming) applies only to the few thousand critical paths. Cloud networks feed the same store from the provider's metrics and flow logs.
- Severity taxonomy:
criticalmeans page a human now,warningmeans ticket,infomeans dashboard only.
What to collect
- Counters: interface rates, errors, discards, operational status, every 30 to 60 seconds, per region.
- State changes: link, BGP session and BFD state via on-change streaming events.
- Flows: sampled IPFIX per site, aggregated regionally.
- Synthetic probes between sites and to key services (ICMP, DNS, HTTP).
- Syslog and configuration-change events.
- Retention: 30 days raw, 5-minute rollups for 13 months, hourly beyond (long-term store through remote write). A rollup is a pre-computed lower-resolution copy: one averaged point per 5 minutes replaces ten 30-second samples, so old data costs far less to store and query.
Sub-second alerting for critical failures, stated honestly. Scraping cannot do it: polling every 30 seconds adds up to 30 seconds. Sub-second detection happens on the device (BFD (Bidirectional Forwarding Detection), designed in RFC 5880 for low-latency failure detection, and hardware link-down). To get the alert to people quickly, subscribe to critical state with gNMI STREAM / ON_CHANGE, which the specification defines as sending an update when the value changes, into an event pipeline that feeds the alert manager. Apply this only to a few thousand critical paths (core links, border, WAN edges), not all 50,000 devices. An illustrative timeline: at t = 0 the link fails. BFD with a 50 ms interval and a miss count of 3 (illustrative settings; detection time is the interval times the count, per RFC 5880) declares the session down at about 0.15 s. The device sends the ON_CHANGE update (expected within milliseconds on hardware that supports it; an assumption to measure, not a guarantee), the event pipeline turns it into an alert and hands it to Alertmanager, and the critical route then waits its group_wait (5 s in the config below, so related alerts can join the page and inhibition can apply) before the first notification. So detection is sub-second, while the page arrives after roughly group_wait plus delivery time; lowering group_wait buys speed at the cost of more duplicate pages. End-to-end latency (device event to page) is a number to MEASURE by injecting a link failure in a lab, not to assume.
Alert volume control (Alertmanager, config validated with amtool check-config)
Four terms used below: grouping bundles alerts that share chosen labels into one notification; inhibition automatically mutes alerts whose cause is already alerting; a mute time interval is a recurring named window in which a route sends nothing; a silence is a one-off manual mute with matchers and an expiry, created in the UI or API.
route:
receiver: noc-queue
group_by: [alertname, region, device_role]
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
routes:
- matchers: ['severity="critical"']
continue: true
receiver: noc-page
group_by: [region, site]
group_wait: 5s
- matchers: ['team="security"']
receiver: secops-queue
- matchers: ['severity="warning"', 'team="neteng"']
receiver: neteng-ticket
mute_time_intervals: [weekly-core-maintenance]
inhibit_rules:
- source_matchers: ['alertname="DeviceDown"']
target_matchers: ['alertname=~"InterfaceDown|HighLatency|BGPSessionDown"']
equal: [device]
- source_matchers: ['alertname="SiteIsolated"']
target_matchers: ['alertname=~"DeviceDown|InterfaceDown"']
equal: [site]
time_intervals:
- name: weekly-core-maintenance
time_intervals:
- times: [{start_time: '02:00', end_time: '04:00'}]
weekdays: ['tuesday']
(Receiver definitions are omitted here; amtool needs them present.) Reading it:
routeis the root of the routing tree.receiveris the default destination andgroup_bylists the labels whose values define a group: alerts with the samealertname,regionanddevice_rolego out as one notification.group_wait: 30sis how long a new group waits before its first notification, so related alerts can arrive and be bundled.group_interval: 5mis how long to wait before notifying about new alerts added to a group already notified.repeat_interval: 4his how often a still-firing, unchanged group is reminded.- Under
routes, child routes are tried top to bottom and the first match wins unless the route setscontinue: true. The first one matches every critical alert whatever its owner, sends it tonoc-page, groups it byregion, siteinstead, overrides the wait withgroup_wait: 5sso pages go out sooner, and setscontinue: trueso a security-owned critical alert is also offered to the next route instead of stopping here (checked withamtool config routes test: critical alerts for team neteng or noc resolve tonoc-page, and critical for team security resolves tonoc-pageandsecops-queue). The next sends security-owned alerts to a queue. The third sends NetEng warnings to tickets and refers by name to a mute window. inhibit_rules: when an alert matchingsource_matchersis firing, alerts matchingtarget_matchersare suppressed, but only if both carry the same value for each label inequal. SoInterfaceDownis muted only for the device that is down, not for every device.time_intervalsdefines the named windowweekly-core-maintenance: Tuesdays 02:00 to 04:00 in UTC, which is the default; addlocation(an IANA timezone name such as Europe/London) to the interval if the window should follow local time.- Dedup and grouping: hundreds of alerts from one site outage collapse into one notification per
region, sitegroup. - Inhibition: when a device is down, its interface, latency and BGP alerts are suppressed (matching on the same
device); when a site is isolated, device and interface alerts for thatsiteare suppressed. - Maintenance windows: recurring work uses
mute_time_intervals(note the root route cannot have mute times, so they sit on child routes); one-off work uses a silence created for the change window. - Role-based routing and escalation: NOC receives every critical alert as a page (anything unmatched lands in the
noc-queueticket queue, which does not page). NetEng gets warnings as tickets. Security gets only alerts labelledteam="security". If a NOC page is unacknowledged for a set time (the paging tool's escalation policy, for example 15 minutes), it escalates to the NetEng on-call and then to the owning team lead. - Alert quality bar: review monthly the share of pages that led to human action, and demote or delete rules that fall below your bar (for example half).
Dashboards by audience: NOC gets a site-state map and the active alert list; NetEng gets per-device and per-interface trends, capacity forecasts and change timelines; Security gets flow anomalies and configuration changes; leadership gets availability per region.
Define SLIs and SLOs for network availability and latency for an internal application team. How would you measure them, from where, and what objectives would you set?
Sample Answer
Direct answer
An SLI (service-level indicator) is a measured ratio of good events to valid events. An SLO (service-level objective) is the target for that ratio over a window. For an internal app team I would define two: availability (the fraction of synthetic TCP connection probes to the app's service addresses that succeed) and latency (the fraction of successful probes whose connection time is under a stated limit). Measure them from probers placed in the networks where the app's users and callers actually sit, and start with 99.9 percent availability and a 99 percent latency objective set from four weeks of measured baseline, tightening only when the data supports it.
SLI definitions
| SLI | Good event | Valid event | Window |
|---|---|---|---|
| Availability | TCP connect succeeds within the timeout | every probe attempt from a healthy prober | rolling 30 days |
| Latency | TCP connect time under the limit T | every successful probe | rolling 30 days |
A worked reading of the definitions: one prober sends a probe every 10 seconds, so 360 an hour. If the prober cannot reach its own gateway for 10 minutes, those 60 attempts are not valid events, because they say nothing about the app's network. Of the other 300, suppose 299 connect (good events) and 1 times out (a bad event): availability for the hour is 299/300. For latency, the valid events are the 299 that connected, and a good one is a connection under the limit T.
Use a ratio of events, not an average: an average latency of 5 ms can sit beside a bad 1 percent tail. Use TCP connect (or a small HTTP request to a health listener) rather than only ICMP ping: ping can be rate-limited or handled on a different path from application traffic, so it can report fine while the app suffers.
Where to measure
- Vantage points: at least three probers across the client-side segments (for example two sites and one cloud network) so one broken prober cannot look like a network outage. A prober that cannot reach its own gateway is excluded from "valid" rather than counted as a failure.
- Target: a dedicated lightweight listener on the same subnet or load balancer as the app, so an app bug is not billed to the network, while the path under test is the one the app uses.
- Complement, do not replace: interface errors, drops and device counters (gathered by SNMP polling or streaming telemetry) explain a violation; they are not the SLI, because a link can be healthy on counters and still unreachable from a client.
Objectives
- Availability 99.9 percent over 30 days. The allowed downtime (the error budget) is 30×24×60×0.001=43.2 minutes. With 3 probers every 10 seconds that is 25,920 probes a day, 777,600 in 30 days, and 777 failed probes are allowed (99.9 percent of 777,600 is 777.6).
- Latency: 99 percent of probes under T. Derive T from the baseline, for example baseline p99 (99th percentile: 99 percent of samples are at or below it) of 4 ms and an app that tolerates 20 ms gives a starting limit of 10 ms. The choice: the limit must sit well above normal variation, or noise burns budget, and well below the app's tolerance, or the network leaves the app no room. 10 ms is 2.5 times the baseline and half of the tolerance, a starting point to adjust against the measured data. These figures are illustrative: use your measured ones.
- The network SLO must be tighter than the app's. If the app promises 99.9 percent and the network is also 99.9 percent, availability in series multiplies: 0.999×0.999=0.998001, so about 99.8 percent. A 99.99 percent network objective gives 4.32 minutes of budget a month, only 10 percent of the app's 43.2.
Alerting on the SLO
Alert on how fast the budget is being spent (burn rate: 1 means exactly on pace to use the whole budget by the end of the window, so the 43.2 minute budget lasts 30 days; a burn rate of 14.4 would empty it in 30 / 14.4 = about 2.1 days). A burn rate of 14.4 sustained for one hour uses 2 percent of the 30 day budget (14.4 x 1 / 720 hours = 0.02). Page on a fast burn over a short window and ticket on a slow burn over days.
Trade-offs and pitfalls
- 100 percent is not a target: every change window and carrier fault would violate it. Decide up front whether planned maintenance counts (I would count it, and schedule it inside the budget).
- A single vantage point measures that vantage point.
- Probe load is real traffic: 3 probers at one probe per 10 seconds is trivial, thousands of probers are not.
- Revisit objectives quarterly: if the budget is never spent the objective is too loose to guide decisions, if it is always exhausted the team stops trusting it.
Your team debates keeping continuous packet capture running on a critical 40G link versus relying on flow data alone. What does each give you, what does capture cost in storage, privacy and operations, and what would you decide?
Sample Answer
Direct answer
Run flow export (IPFIX, the IP Flow Information Export standard, or NetFlow, its Cisco-originated predecessor; both make the router or switch send summary records per conversation) on the link all the time, and treat packet capture as a narrow, short-retention tool that you can freeze when something goes wrong. Do not store every packet of a 40G link continuously: at line rate that is hundreds of terabytes a day, and it concentrates sensitive payload in one place. Flow tells you who talked to whom and how much. Capture tells you what actually happened inside a conversation.
What each one gives you
- Flow data. RFC 7011 defines a flow as a set of packets passing an observation point during a time interval that share common properties (typically the addresses, ports and protocol). A flow record carries counters and timestamps, not payload. It answers: which hosts and applications use the link, when did a transfer start, is a new destination suddenly receiving gigabytes, is a DDoS (distributed denial-of-service) pattern forming. Busy links often export sampled flows (1 packet in N), so small or short flows can be missed.
- Packet capture (PCAP, packet capture file format). Every header, and optionally payload, with arrival times. It answers what flow cannot: which side retransmitted, what window size was advertised, where a TCP handshake stalled, what DNS answer came back, whether a TLS handshake failed, in what order packets arrived.
What continuous capture costs
Storage, computed for 40 Gbit/s of traffic counted in both directions together (40 Gbit/s divided by 8 is 5 GB/s). A full-duplex 40G link can carry 40 Gbit/s each way, so if both directions run flat out the real figures are double the 100% row: 10 GB/s, 864 TB per day. The 25% busy rows assume a link averaging a quarter of its capacity; that figure is chosen for the example, so replace it with your own measured utilisation:
| Case | Rate | Per day |
|---|---|---|
| Full packets, link 100% busy | 5 GB/s | 432 TB |
| Full packets, link 25% busy | 1.25 GB/s | 108 TB |
| Seven days of full packets at 25% busy | 756 TB | |
| Headers only (128-byte snap length, meaning only the first 128 bytes of each packet are kept), 25% busy, 800-byte average packet (assumed) | 1,562,500 packets/s x 128 B = 0.2 GB/s | 17.28 TB |
- Operations. Sustaining gigabytes per second of disk writes needs striped NVMe (fast flash storage drives, combined so writes spread across them) or a purpose-built capture appliance, plus a large capture buffer and a dedicated capture NIC (network interface card), because a general-purpose server running a default capture will drop packets before the disk is the limit (ESTIMATE, depends on hardware). Retrieval needs an index, or you grep terabytes. Capture only works if it sees both directions: a full-duplex 40G link can carry 40 Gbit/s each way, so mirroring both directions to one 40G monitor port can need up to 80 Gbit/s. Use a passive optical TAP (test access point, a device that copies the light on a fibre link without touching the traffic) or a packet broker (a device that gathers copies from many taps, filters them and fans them out to the capture hosts). Choose by what you need: a TAP for a complete, loss-free copy of one link; a broker when several tools or links share the copies; SPAN (switch port mirroring) when no extra hardware is available. A SPAN session shares the switch's resources and can silently lose mirrored frames when the monitor port is oversubscribed.
- Privacy and legal. Payload holds credentials, session cookies, personal data and anything sent unencrypted. Even with TLS, the capture still shows the endpoints and, unless encrypted DNS or Encrypted Client Hello is in use, the DNS names and the server names in the TLS handshake. Once stored it becomes a high-value target and a retention liability. Controls: truncate packets to headers, encrypt at rest, restrict and audit who can read PCAPs, set a short retention, and get sign-off from security and legal on a documented purpose.
Worked example: a bounded capture
tcpdump -i eth2 -B 262144 -s 128 -w /cap/ring.pcap -C 1000 -W 200 'host 203.0.113.10'
-i eth2listens on the interface named eth2 (illustrative name), and-w /cap/ring.pcapwrites raw packets to that file instead of printing them.- The quoted
'host 203.0.113.10'is a filter: only packets to or from that address are kept (203.0.113.10 is a documentation-range address, illustrative). -s 128keeps the first 128 bytes of each packet (the tcpdump default snapshot length is 262144 bytes).-C 1000starts a new file every 1,000,000,000 bytes (the unit is millions of bytes, not MiB) and-W 200keeps 200 files, overwriting the oldest: a rotating 200 GB buffer. The files are named with a numeric suffix,ring.pcap000onward, so the ring is a set of files rather than one.-B 262144sets the OS capture buffer to 262144 KiB (256 MiB).- tcpdump gives up root privileges after opening the interface (see its
-Zoption), so/capmust be writable by the user it drops to, or it stops withPermission deniedonring.pcap000. - At the 0.2 GB/s headers-only rate above, 200 GB lasts 200 / 0.2 = 1,000 seconds, about 17 minutes. That is long enough to cover an alert and a human reacting only if the alert fires automatically and copies the files out.
On start tcpdump prints one line to the terminal. A short test run in a container (debian stable, tcpdump 4.99.5, interface eth0, with the directory writable) printed:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 128 bytes
0 packets captured
0 packets received by filter
0 packets dropped by kernel
Read it as: the capture started on that interface, the snapshot length is the -s 128 you asked for, the three counts appear when you stop it (here no packet matched the filter), and the last line is the one to watch in production, because a nonzero "dropped by kernel" count means the capture host could not keep up and the evidence has holes.
Decision
- Always on: flow export from the 40G link's routers or switches, plus interface counters and a loss and latency probe.
- Capture: a header-only ring buffer, scoped by filter to the critical service's addresses, behind a TAP or packet broker, frozen automatically when flow or probe thresholds trip. Full payload capture only for a named investigation with an end date.
- What would flip it: a regulatory or forensic requirement (for example a network detection and response system, a security product that analyses stored network traffic for attacks and must retain packets) justifies continuous header capture with a funded storage and access-control plan. If the link only carries encrypted traffic and incidents are always resolved from flow plus endpoint logs, drop capture to on-demand.
Pitfalls
- Choosing flow because it is cheap, then discovering during an incident that retransmission and handshake questions cannot be answered from it.
- A "continuous" capture that is actually dropping packets and nobody checks the drop counters, so the evidence has holes.
- Keeping payload for years because nobody owns deletion.
During a load test, packet loss climbs sharply as throughput rises, and you suspect switch buffer overflow. How do you confirm it, and what are your options to fix it across device configuration and network design?
Sample Answer
Direct answer
Confirm it by showing that drops appear at one egress queue exactly when offered load exceeds what that port can drain, that the device's drop counter matches the loss and retransmits the test sees, and that wire errors are zero. Then fix the bottleneck rather than only the symptom: shape or pace at the sender, use ECN (Explicit Congestion Notification) marking instead of tail drop, size and class the queues deliberately, and remove the speed mismatch or incast in the design.
How to confirm
- Define the test. Step the offered load (for example 10%, 25%, 50%, 75%, 100% of the suspect path) and record loss at each step. Buffer overflow shows a knee (the point where the curve bends sharply upward): near zero loss, then loss rising sharply once the offered rate exceeds the bottleneck or a burst exceeds the queue.
- Find the hop. Read egress discard counters on every device on the path before and after each step. The hop whose discards rise with the test is the bottleneck. Check that input errors and CRC counters stay at zero, which excludes bad optics, and look at host NIC statistics (for example
ip -s link, which prints RX and TX errors and drops). - Tie the counter to what the test saw. Executed in a Linux lab (two hosts, a router namespace, egress limited to 100 Mbit/s with a 30,000-byte queue, using
tc, Linux's traffic-control tool, with its token bucket filter, which lets packets out at the configured rate and queues or drops the excess; the traffic comes fromiperf3, a tool that generates TCP or UDP test traffic and reports loss and retransmits):
# UDP, offered 300 Mbit/s into the 100 Mbit/s egress
receiver: 87792/129446 datagrams lost (68%)
tc -s qdisc show dev r-b: Sent 62066229 bytes 41673 pkt (dropped 87811, ...)
# TCP, same 30000-byte queue
iperf3 sender: 59 retransmits qdisc: dropped 58
# TCP, queue enlarged to 1,000,000 bytes
iperf3 sender: 0 retransmits qdisc: dropped 0, "lat 79.7ms"
To reproduce it, this is the lab script (run as root, for example in a privileged Debian container with iproute2 and iperf3 installed; it creates three network namespaces, a (sender), r (router) and b (receiver), joined by veth pairs, with the tbf queue on the router's egress toward b):
ip netns add a; ip netns add r; ip netns add b
ip link add a-r type veth peer name r-a; ip link add r-b type veth peer name b-r
ip link set a-r netns a; ip link set r-a netns r; ip link set r-b netns r; ip link set b-r netns b
ip -n a addr add 10.0.1.1/24 dev a-r; ip -n r addr add 10.0.1.2/24 dev r-a
ip -n r addr add 10.0.2.2/24 dev r-b; ip -n b addr add 10.0.2.1/24 dev b-r
for n in a r b; do ip -n "$n" link set lo up; done
ip -n a link set a-r up; ip -n r link set r-a up; ip -n r link set r-b up; ip -n b link set b-r up
ip netns exec r sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'
ip -n a route add 10.0.2.0/24 via 10.0.1.2; ip -n b route add 10.0.1.0/24 via 10.0.2.2
ip netns exec r tc qdisc add dev r-b root tbf rate 100mbit burst 15000 limit 30000
ip netns exec b iperf3 -s -D
ip netns exec a iperf3 -c 10.0.2.1 -u -b 300M -t 5
ip netns exec r tc -s qdisc show dev r-b
ip netns exec a iperf3 -c 10.0.2.1 -t 5
ip netns exec r tc qdisc replace dev r-b root tbf rate 100mbit burst 15000 limit 1000000
ip netns exec a iperf3 -c 10.0.2.1 -t 5
ip netns exec r tc -s qdisc show dev r-b
Re-running this exact script gave 90063/129656 datagrams lost (69%) against dropped 90081 in the queue counter, a gap of 18, so the counters agree the way the numbers below do. The burst value matters: it is the bucket of bytes tbf may send at once, and a very small burst (3,750 bytes in a test) delivered only about 25 Mbit/s on one VM, so keep it at 15,000 bytes. Counts differ from run to run and across kernels; judge the pattern, not the digits.
Reading the lines: 87792/129446 datagrams lost (68%) is the receiver counting by the sequence numbers the sender stamped, and dropped 87811 is the queue's own counter of packets it discarded because the 30,000-byte queue was full. The loss fraction matches the arithmetic: 87,792 / 129,446 = 67.8%, so 129,446 - 87,792 = 41,654 datagrams arrived, 32.2% of what was offered, which at 300 Mbit/s offered is about 96.5 Mbit/s of delivered traffic, just under the 100 Mbit/s the egress allows. Loss of about 68% is what you expect when roughly one third of the offered rate fits. The queue's drop counter agrees with the receiver's loss to within 19 of 87,811 packets (0.02%); the two counters count slightly different things (the queue counts every packet that reaches it, the receiver counts only the test datagrams, and they are read at slightly different moments), so exact equality is not expected and a gap this small does not change the conclusion, and for TCP the sender's retransmits and the queue's drops move together (59 versus 58 in that run) without being equal: other runs of the same lab gave 928 retransmits against 340 drops, and 35 retransmits against 13 drops even with the 1,000,000-byte queue, because one drop can lead to several retransmitted segments and tc counts packets handed to the queue, which with segmentation offload can be a bundle of segments. The deep-queue run shows the trade-off: zero drops in that run (a deep queue makes loss rare, not impossible), but a full 1,000,000-byte queue at 100 Mbit/s holds 1,000,000 x 8 / 100,000,000 = 0.08 s, about 80 ms, of added delay. The lat 79.7ms in the qdisc output is tc reporting that same bound, the longest a packet can wait behind a full queue of that size (the tbf documentation defines latency as the maximum time a packet can sit in the filter; the printed value is the drain time of the limit minus the time to send one burst, so 80 ms less a fraction of a millisecond, and a 15,000-byte burst printed 78.8 ms). (The lab limits only one hop; on a real switch the same evidence comes from the per-queue discard counters and queue-depth telemetry.)
4. Rule out lookalikes. A policer drops at a configured rate regardless of queue state (check policer counters), an MTU (maximum transmission unit) mismatch drops only large packets, and an overloaded load generator or host drops before the network.
Options to fix, device configuration
- Queue and threshold tuning. Give the traffic class its own queue with a limit sized to the burst you must absorb. Larger is not free: drop probability falls but queueing delay rises.
- ECN with active queue management. ECN lets a router tell the sender to slow down without losing a packet (RFC 3168). One marked packet goes like this:
- During the TCP handshake the two hosts negotiate ECN: the client's SYN carries the ECE and CWR flags, and the server's SYN-ACK carries ECE.
- The sender then marks its packets ECT(0) or ECT(1) in the IP header, meaning "this flow understands ECN".
- A router whose queue is filling, and which would have dropped the packet, sets CE (Congestion Experienced) in the IP header instead and forwards it.
- The receiver sees CE and sets the ECE flag (ECN-Echo) on its ACKs, and keeps doing so until the sender confirms.
- The sender treats ECE like a loss, halving its congestion window, and sets CWR (Congestion Window Reduced) on its next data packet. No packet was lost and nothing was retransmitted.
Configure the marking threshold on the queue with the platform's ECN or WRED (weighted random early detection, which starts marking or dropping probabilistically as the queue grows) feature, and enable ECN on the end hosts. Without both ends it only drops.
- Class-based queueing and policing. Protect priority traffic in its own queue and let bulk traffic take the drops.
Options to fix, network design
- Remove the speed mismatch or fan-in: add uplink capacity, use ECMP (equal-cost multipath, which spreads flows across several equal-cost links) or link aggregation so the many-to-one path has enough egress.
- Spread incast senders (stagger starts, add an intermediate aggregation tier).
- Pace at the source: sender-side shaping or TCP pacing to the bottleneck rate turns bursts into a steady stream that small buffers can absorb.
- Use a deeper-buffer platform only at the point where a speed step-down is unavoidable (for example 100G aggregation into 10G sites).
Recommendation
First enable ECN marking and shape at the sender to the bottleneck rate, because those fix the cause (a burst the port cannot absorb) at low cost. Add capacity if utilization is also high over minutes. Re-run the same step test and require the knee to move or disappear.
Pitfalls
- Adding a huge queue, seeing drops stop, and shipping 80 ms of bufferbloat (delay caused by oversized queues that stay full) to every interactive flow.
- Enabling ECN on the switch without verifying the hosts negotiate it.
- Calling it a buffer problem when a policer or MTU mismatch is the cause.
Unlock Full Question Bank
Get access to all Network Monitoring and Performance interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.