Skip to content

add grpc gnmi support #20

@Raezil

Description

@Raezil

Summary

Currently, the gRPC transport implementation supports UTCP (Universal Tool Call Protocol) for tool registration and execution. This issue tracks the addition of gRPC gNMI (gRPC Network Management Interface) support to enable telemetry data retrieval and configuration management of network devices.

Motivation

gNMI is an industry-standard specification for network device management and telemetry streaming. Adding gNMI support would enable:

  • Real-time telemetry data collection from network devices
  • Configuration push/pull operations
  • Subscription-based monitoring with streaming responses
  • Compatibility with standard gNMI-compliant devices and simulators
  • Vendor-neutral network management capabilities

Proposed Changes

1. gNMI Protocol Buffer Definitions

  • Add gNMI service definitions (gnmi.proto) alongside existing UTCP definitions
  • Include gNMI RPC operations:
    • Get - retrieve current state
    • Set - modify configuration
    • Subscribe - streaming telemetry subscriptions
    • Capabilities - retrieve device capabilities

2. GrpcTransport Enhancements

  • Extend GrpcTransport to support both UTCP and gNMI service types
  • Add service type detection/routing logic
  • Implement gNMI-specific request handling

3. New GrpcProvider Configuration

  • Add service_type field to GrpcProvider (defaults to "utcp" for backward compatibility)
  • Support "gnmi" as an alternative service type
  • Allow provider-specific gNMI configuration (e.g., origin, target specifications)

4. gNMI Operations Implementation

  • subscribe_telemetry() - Stream telemetry data from devices
  • get_config() - Retrieve device configuration
  • set_config() - Apply configuration changes
  • get_capabilities() - Query device capabilities
  • Proper error handling for gNMI-specific status codes

5. Streaming Integration

  • Leverage existing StreamResult infrastructure for telemetry subscriptions
  • Handle gNMI subscription lifecycle (subscribe, receive, unsubscribe)
  • Parse and deserialize gNMI Update messages

6. Authentication & TLS

  • Extend existing auth mechanisms to support gNMI requirements
  • Ensure proper metadata handling for gNMI-specific headers
  • Support mutual TLS for device authentication

Implementation Considerations

  • Backward Compatibility: All changes should maintain existing UTCP functionality
  • Testing: Add comprehensive unit tests for gNMI operations with mock gNMI servers
  • Documentation: Update provider configuration docs with gNMI examples
  • Error Handling: Provide clear error messages for gNMI-specific failures
  • Performance: Consider connection pooling for multiple gNMI subscriptions

Acceptance Criteria

  • gNMI protocol buffers are generated and integrated
  • GrpcTransport supports service type routing (UTCP vs gNMI)
  • Core gNMI operations (Get, Set, Subscribe) are implemented
  • Streaming telemetry works end-to-end
  • Unit tests cover gNMI functionality with mock servers
  • TLS and authentication work with gNMI services
  • Documentation updated with gNMI examples and configuration

Related Issues

None currently

Additional Context

gNMI specification: https://github.com/openconfig/gnmi/blob/master/proto/gnmi/gnmi.proto

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions