A First Telemetry Lab on a Virtual Router
You can read about streaming telemetry until the acronyms blur — gNMI, gRPC, YANG, sample-interval — and still not know it. The knowing arrives in one specific moment. A terminal on your own screen prints a router's interface counter once per second. The number leaps the instant you start a file transfer. Everything before that moment is vocabulary. Everything after it is muscle memory.
This guide is the weekend project that gets you to that moment for free. The lab has three pieces. One is a virtual router: a real network operating system running as a VM. Another is a collector: a small Linux VM running an open-source tool that subscribes to the router's data. The last is a dashboard to draw the results. Deliberately, this guide describes classes of tools and the generic shape of each step rather than one vendor's exact commands. Specific tools rise and fall, but the shape of a telemetry lab has settled. The shape is what you are here to learn. Wherever your chosen tool differs, its documentation fills the last inch.
Assumed knowledge: you can create a VM and use a Linux shell. That is all. By the end you will have enabled a telemetry service and made your first subscription. You will have generated traffic, watched one-second counters dance, and graphed it. And — because it is a lab — you will have broken it in the four classic ways and fixed it.
In this guide
- The lab at a glance
- Step 1: Get a virtual router
- Step 2: Turn on the telemetry service
- Step 3: Stand up the collector
- Step 4: Your first subscription
- Step 5: Make the counters dance
- Step 6: Graph it
- When it breaks: the four classic snags
- What the lab teaches that reading cannot
- The lab checklist and where to go next
The lab at a glance
Here is the whole build, so you know where each step is headed:
| Piece | What it is | Job in the lab |
|---|---|---|
| Virtual router | A vendor or community network OS as a VM or container | Runs the gNMI service and pushes the data |
| Collector VM | Small Linux VM with an open-source gNMI collector tool | Subscribes to paths, prints and stores the stream |
| Dashboard | Any time-series database plus graphing front end | Turns stored samples into moving graphs |
| Two traffic endpoints (optional) | Any two VMs on either side of the router | Generate traffic so the counters have something to say |
Everything runs on one desktop hypervisor on an isolated lab network — nothing touches production. The collector VM can double as one traffic endpoint, so the minimum build is just three VMs. One vocabulary note before we start. This lab uses the dial-in style of telemetry. The collector connects to the device and asks for a subscription. This is the style standardized by gNMI, the gRPC-based management interface. The acronym-stack guide unpacks all three layers. Dial-in is the right first lab: one listening service on the router, one connecting client, easy to reason about when something misbehaves.
Step 1: Get a virtual router
You need a network OS that speaks gNMI, in a form that runs on your machine. Two classes to shop from:
- Vendor virtual images. Most major network vendors publish virtual machine or container images of the same operating system that runs on their hardware. Free or registration-gated lab licenses exist for exactly this kind of learning. These images give you the most realistic experience — the same configuration syntax and the same telemetry behavior you would meet on real iron.
- Community and open network OSes. Several community-maintained routing platforms also run happily as VMs or containers. Quality varies; the selection rule below still decides.
The selection rule, regardless of class: read the feature list before downloading and confirm it mentions gNMI, streaming telemetry, or model-driven telemetry. A virtual router without a gNMI service is a fine routing lab and a useless telemetry lab. While you are on the vendor's site, also grab the configuration guide — the chapter named something like Programmability or Telemetry is your map for Step 2.
Sizing is modest: a couple of virtual CPUs and 4 to 8 GB of RAM covers most VM-packaged network OSes. Container-packaged ones are lighter still. Give the router three network connections. Put a management interface on the same lab network as your future collector VM. Add two data interfaces, each on its own isolated network. That way, traffic between your two endpoint VMs has to route through the router. Boot it, set an IP on the management interface, and create an admin account. The same credentials will later go in the collector's config. When you can ping the router from the collector VM, Step 1 is done.
Step 2: Turn on the telemetry service
Out of the box, the gNMI service is usually off. Turning it on is three decisions on every platform, whatever the syntax: enable the service, pick the port, and settle transport security. The generic shape looks like this — your OS's actual syntax will differ, but you will recognize every line:
# Generic shape only - find the real syntax in your NOS's
# "Programmability" or "Telemetry" configuration chapter
system
grpc-server lab
services gnmi
port 9339
tls-profile lab-cert # or, for the lab: insecure / no-tls
no shutdown
The port is yours to choose. The IANA-registered port for gNMI is 9339, but vendor defaults vary. Pick one and write it down. You will type it into everything else. The interesting decision is TLS. gRPC, the transport under gNMI, expects encrypted connections with certificates, and real deployments use them. For a first lab you have two honest options. Generate a quick self-signed certificate on the router and tell the collector to accept it. Or run the service in its insecure/plaintext mode if the platform offers one.
Lab shortcuts are for labs. Flags with names like insecure or skip-verify exist so learners can defer the certificate lesson, not skip it forever. On a production network those flags would send device credentials and telemetry across the wire unprotected, or leave you connecting to a device nothing has authenticated. Use them freely on an isolated lab network; treat them as a firing offense outside one.
Finish the step by verifying the service is actually listening — every platform has a show/status command for its gRPC server. Confirm it reports the service up, on your port, before you blame anything else in Step 4.
Step 3: Stand up the collector
The collector side of the ecosystem is refreshingly simple. The open-source world has several capable gNMI collector tools, and they share one shape. Each is a small daemon (or CLI tool) that connects to targets and subscribes to a list of paths. It writes what arrives to the console, to files, or to a time-series database. Install one on a small Linux VM. A couple of vCPUs and a few GB of RAM is plenty for a lab.
Whatever tool you pick, its configuration needs the same five facts, usually in a YAML-ish file:
# Generic sketch - names vary by tool, the facts do not
targets:
lab-router:
address: 192.168.56.10:9339
username: labadmin
password: labpassword
skip-verify: true # LAB ONLY - see the note above
subscriptions:
interface-counters:
paths:
- /interfaces/interface/state/counters
mode: sample
sample-interval: 1s
Read that sketch as a checklist. It says where the device is (address and port from Step 2) and who is asking (the account from Step 1). It says how to treat TLS, what to subscribe to (a path list), and how (mode and cadence). The sample mode means "send the value every interval". You will meet its sibling on-change ("send it only when it changes") near the end of the lab. Do not start the daemon yet — first we explore by hand, which is where the real learning is.
Step 4: Your first subscription
Most collector tools expose gNMI's verbs directly as one-shot commands. And the exploration ritual on a new device is always the same three, in order: capabilities, then get, then subscribe. You may have pointed snmpwalk at an unfamiliar device to see what it will admit to. This is the same ritual with better manners. It is the streaming cousin of the first walk you ever ran.
Capabilities asks the device: which data models do you support, and which encodings? The answer is ground truth for everything that follows — a path only works if it lives in a model this list contains:
$ <tool> capabilities (flags vary by tool; the verb does not) supported models: openconfig-interfaces openconfig-system <vendor>-native-models ... supported encodings: JSON, PROTO
Seeing an interfaces model in the list, sanity-check a path with get — a one-shot read, no stream yet. Ask for one interface's counters (interface naming varies by OS; use a name from your own device):
$ <tool> get --path /interfaces/interface[name=eth1]/state/counters /interfaces/interface[name=eth1]/state/counters: in-octets: 912734 out-octets: 847211 in-errors: 0
A real answer here proves the whole chain: service up, port right, credentials good, path valid. Now the main event — subscribe, with a one-second sample interval:
$ <tool> subscribe --path /interfaces/interface[name=eth1]/state/counters/in-octets --sample-interval 1s 12:40:01 in-octets: 912801 12:40:02 in-octets: 912855 12:40:03 in-octets: 912920 ...
Notice what did not happen: no second request. You asked once; the router now pushes, once per second, until you stop it. That quiet difference — one subscription replacing an endless drumbeat of polls — is the entire architectural idea of streaming telemetry, running live on your desk. The path you subscribed to is a YANG path: a slash-separated address into the device's data model. It does the job OIDs do in SNMP, but with names instead of numbers. Choosing paths well is its own small skill. The gNMI/gRPC/YANG guide covers it. But the interfaces model used here is the standard first stop on almost any device.
Step 5: Make the counters dance
A stream of near-identical numbers proves the plumbing; it does not deliver the payoff. For that, the router needs traffic. Set up your two endpoint VMs, one on each of the router's data networks, and confirm they can reach each other through the router. Then arrange the moment properly, because it is worth savoring. Put the subscribe command in one window, streaming in-octets for the data interface your traffic will enter. Start something heavy in another. Use iperf between the endpoints if you have it, or simply a multi-gigabyte file copy.
Watch the stream. Idle, the counter creeps — a few hundred bytes of background chatter per second. The instant the transfer starts, the per-second jumps go from hundreds to millions. You will see the ramp as the transfer accelerates and the steady plateau while it runs. Maybe there will be brief dips where it breathes. Then comes the cliff the moment it finishes. You are watching the true shape of an event, at one-second resolution, live.
Here is the sobering comparison, and the real lesson of the whole weekend. A five-minute poll of that same counter would have compressed everything you just watched into a single averaged data point. It would be one unremarkable step in a graph, its ramp, plateau, dips, and cliff all smeared into one number. Polling photographs the network every five minutes; streaming films it. Your two-minute transfer at least leaves a bump in the photograph. The thirty-second events that plague real networks — the microburst, the brief flap — can vanish between two frames entirely. You now know, from your own eyes rather than a diagram, exactly what fidelity means in the SNMP-versus-streaming comparison.
Step 6: Graph it
Scrolling text is truth; graphs are understanding. Switch the collector from console output to its daemon mode, writing into a time-series database. That is the class of database built for timestamped measurements. Put any graphing dashboard on top. The open-source ecosystem has several well-worn pairings, and most collector tools list their supported outputs right in the documentation. Any of them will do for a lab.
Your first graph will re-teach a lesson you may know from SNMP. And it is worth re-learning here: in-octets is a counter — a running total since boot, not a speed. Graph the raw value and you get a dull, ever-climbing ramp. The number you actually want is the rate. Subtract the previous sample from each sample, then divide by the time between them. Multiply by eight to turn bytes into bits per second. Every dashboard has a rate or derivative function that does exactly this. It is the same subtract-and-divide arithmetic behind every SNMP bandwidth graph ever drawn. It is just computed every second instead of every five minutes.
Build one panel: rate of in-octets on your traffic interface, live view, last fifteen minutes. Run the transfer again and watch the mountain draw itself — sharp edges, visible dips, a true summit. Then mentally overlay the single flat-topped bump a five-minute poller would have drawn instead. Pin that comparison somewhere in your head; it is the whole argument, in one picture you made yourself.
When it breaks: the four classic snags
The lab will break at least once this weekend; that is part of its curriculum. Nearly every first-lab failure is one of these four:
| Symptom | What it usually is | The diagnostic |
|---|---|---|
| Connection errors mentioning handshake, certificate, or authority | TLS trust: the collector will not accept the router's certificate (or one side speaks TLS and the other plaintext) | Read the error text — certificate words mean trust, not reachability. In the lab: set skip-verify or import the self-signed cert; make sure both ends agree on secure vs. insecure |
| Subscription starts cleanly, then… silence | The path is wrong or unsupported — gNMI often accepts a syntactically valid path and simply has nothing at it | Re-run capabilities and confirm the model exists on this device; run a get on the parent path (drop the last segment) and see what actually lives there |
connection refused or timeout, instantly | Nothing listening: service not enabled, wrong port, or a firewall between the VMs | On the router, re-check the gRPC server status and port; from the collector VM, test plain TCP reachability to that port before blaming anything gNMI-level |
| Stream starts, then stutters: gaps, drops, collector errors | Cadence set hotter than the device or collector can sustain, or too many paths at once | Back off to a 10-second interval and one narrow path; confirm stability; then tighten one dial at a time until you find the comfortable limit |
Notice the debugging order hiding in that table: reachability first (TCP), then trust (TLS), then the path (capabilities and get), then the cadence. Working the layers bottom-up like that is exactly how you will someday debug a production telemetry problem. The lab just lets you meet each layer's failure on a Saturday instead of during an outage.
What the lab teaches that reading cannot
Three things live in your hands now rather than your notes. First, subscription semantics: you have felt the difference between asking repeatedly and asking once. You have met the long-lived stream and the collector that must always be listening. You have seen how data arrives on the device's schedule rather than yours. Second, the path-discovery ritual: capabilities, get, subscribe is now a reflex. It works on any gNMI device you will ever meet, exactly the way walking a device was your reflex in SNMP land. Third, the operational feel: you know what healthy streaming looks like on a console, so you will recognize unhealthy when you see it.
Try one more experiment before you power down, because it delivers the second payoff moment. Change your subscription's mode from sample to on-change. Point it at interface state instead of counters — the path ending in oper-status. Nothing will arrive. That is correct; nothing is changing. Now administratively shut one of the router's data interfaces. The update lands on your console the instant you hit enter — not up to five minutes later at the next poll, now. That is event streaming with delivery guarantees, the thing SNMP traps always gestured at. Having seen both modes, you have seen the two faces of telemetry: high-resolution measurement and instant event notification. From here, ideas multiply on their own — stream CPU and memory paths, add a second router, let the collector watch both.
The lab checklist and where to go next
The whole weekend, as a checklist with honest time estimates — unhurried ones, including the reading:
| Step | Done when… | Time |
|---|---|---|
| 1. Virtual router running | You can ping its management IP from the collector VM | 1–2 hours (mostly download) |
| 2. Telemetry service on | The gRPC server shows as up, on your chosen port | 30–60 minutes |
| 3. Collector installed | Tool runs; config file holds target, credentials, TLS choice | 30–45 minutes |
| 4. First subscription | Capabilities, get, and a one-second stream on your console | 30–60 minutes |
| 5. Counters dancing | Traffic through the router visibly moves the stream | 15–30 minutes |
| 6. Graphed | A live rate graph draws your test transfer | 45–90 minutes |
| Bonus: on-change | A shut interface reports itself instantly | 15 minutes |
| Breakage budget | You met at least one of the four snags and fixed it | 1–2 hours, on the house |
Call it one honest weekend afternoon plus an evening, or two relaxed evenings. When the lab is done, you are equipped for the real questions. Could your production gear do this at all, and do your problems justify it? That is the readiness checklist. How does streaming compare, tradeoff by tradeoff, with the SNMP setup you already trust? The rest of the Streaming Telemetry guides carry on from here, and they will read differently now that the acronyms have calluses on them.
Put this into practice with SysPeep Monitor
While your lab router streams one-second counters, your production network still needs its steady, unglamorous watcher. That is SysPeep Monitor's territory. It auto-discovers devices and polls health and port status over SNMP, WMI, and SSH. It alerts you — quietly — when something real changes. Run the free trial on one Windows machine and let it mind the shop while you experiment.
Download Free TrialLearn About SysPeep