Sample Stream Mode
The gNMI-based Dial-in mode telemetry enables the "STREAM" type subscription with "SAMPLE" mode for the Subscribe RPC.
Sampling Stream Mode Data Flow Description: Subscribe Request and Response
Figure 6 illustrates a sample gnmic Subscribe Request and Subscribe Response between the collector and the OcNOS target device.
Step 1: Subscription Request Initiation
| • | The gnmic collector server initiates a Subscribe Request by sending a Subscribe RPC in Stream type. |
| • | This subscription request aims explicitly to gather data related to interface state counters and CPU state. |
| • | A fixed 30/45-second sampling interval is set for data collection. |
Step 2: Data Collection and Processing
| • | The gNMI server, within the OcNOS router, is responsible for data collection. |
| • | At regular 30/45-second intervals, it retrieves data from the sensor path, focusing on interface state counters and CPU State. |
| • | The received data undergoes a validation process, and the data is transformed into the required encoding type. |
Step 3: Continuous Subscription Response Streaming
| • | The gNMI Server responds to the subscription request by continuously streaming Subscribe Response data. |
| • | This streaming process maintains the same 30/45-second interval as the data collection. |
| • | The collected data is streamed in real-time to the gnmic collector server. |
Figure 6. Sampling Stream Mode Message Flow: Subscribe Request and Response
Sample Stream Mode Benefits
For "counters" type attributes, use a cadence-based sampling mode. This approach enables efficient data push from the target to the collector and smoothly accommodates multiple collectors while minimizing CPU cycles.
