gNXI Tools - gRPC Network Management/Operations Interface Tools

Overview

License GoDoc Go Report Card Build Status Code coverage master

gNxI Tools

  • gNMI - gRPC Network Management Interface
  • gNOI - gRPC Network Operations Interface

A collection of tools for Network Management that use the gNMI and gNOI protocols.

Summary

Notes about these tools:

  • They are intended for testing and as reference implementation of the protocol.
  • They log to stderr by default, disable with -logtostderr=false.
  • They use glog's log levels, use -v 1 to log proto message exchanges.

gNMI Clients:

gNMI Targets:

gNOI Clients

gNOI Targets

Helpers

Documentation

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

Install go in your system https://golang.org/doc/install. Requires golang1.14+.

Download sources

go get github.com/google/gnxi
ls $GOPATH/src/github.com/google/gnxi

Building and installing binaries

cd $GOPATH
mkdir bin
# This reads the go modules dependencies for installation
cd src/github.com/google/gnxi
go install ./...
ls -la $GOPATH/bin

Generating certificates

cd $GOPATH/bin
./../src/github.com/google/gnxi/certs/generate.sh

Running a client

cd $GOPATH/bin
./gnoi_reset \
    -target_addr localhost:9339 \
    -target_name target.com \
    -rollback_os \
    -zero_fill \
    -key client.key \
    -cert client.crt \
    -ca ca.crt

Optionally define $GOBIN as $GOPATH/bin and add it to your path to run the binaries from any folder.

export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

Disclaimer

Issues
  • Removing pathlen information in accordance with RFC5280 4.2.1.9

    Removing pathlen information in accordance with RFC5280 4.2.1.9

    According to https://tools.ietf.org/html/rfc5280 the pathlen information must be omitted if the CA boolean is false. In this case, since you never assert the CA to be true (hence default false) you must remove the pathlen information.

    opened by alisharif2 8
  • gnmi get is giving metadata credentials not present though notls is given and tls has been disabled on device i am accessing

    gnmi get is giving metadata credentials not present though notls is given and tls has been disabled on device i am accessing

    ./gnmi_get -target_name "device_name" -xpath "/interfaces/interface[name=Ethernet16]" -target_addr "@IP:32767 -alsologtostderr -notls true

    or

    ./gnmi_get -target_name "device_name" -xpath "/interfaces/interface[name=Ethernet16]" -target_addr "@IP:32767 -alsologtostderr -insecure true

    or

    (though notls and insecure was given i tried below) ./gnmi_get -target_name "device_name" -xpath "/interfaces/interface[name=Ethernet16]" -target_addr "@IP:32767 -alsologtostderr -notls true -insecure true -username ''username" -password "password"

    all the above are giving same result as below

    == GetRequest: path: < elem: < name: "interfaces"

    elem: < name: "interface" key: < key: "name" value: "Ethernet16" >

    encoding: JSON_IETF

    F0204 13:12:23.567015 25776 gnmi_get.go:130] Get failed: rpc error: code = Unauthenticated desc = gNMI: get: metadata credentials not present

    Am i sending anyparmeters wrong or doing anything wrong?

    opened by sandeepabvp 7
  • CertificateId in GenerateCSR instead of LoadCertificateRequest

    CertificateId in GenerateCSR instead of LoadCertificateRequest

    • Put CertificateId as part of GenerateCSRRequest msg, not LoadCertificateRequest msg.
    • For Install and Rotate Addresses https://github.com/google/gnxi/issues/73
    bug gnoi 
    opened by Reshad-Rahman 7
  •  too many arguments in call to ytypes.Unmarshal

    too many arguments in call to ytypes.Unmarshal

    @larryleguo @samribeiro Hi When we try to build the gnmi project and gnmi target (I need gnmi target which is dependent to gnmi package) using Go modules or dep, we get an error like this:

    pkg/gnmi/modeldata/gostruct/generated.go:71:63: undefined: ytypes.UnmarshalOpt pkg/gnmi/modeldata/gostruct/generated.go:81:25: too many arguments in call to ytypes.Unmarshal

    Any ideas? It looks like there are some conflicts somewhere.

    opened by adibrastegarnia 7
  • Issues with xpath

    Issues with xpath

    Hello,

    I'm facing two issues with the xpath parsing both resulting in a "xpath component parse error".

    It seems that '-' are not supported in the xpath when used for a key like in: --xpath '/state/chassis[chassis-number=1]/name/' It results in a "main.XpathError: xpath component parse error: chassis[chassis-number=1]".

    It seems that '/' are stripped from the xpath, even when used as a key value like in: --xpath '/state/port[port_id=1/1/1]/statistics/out-packets' It results in a "main.XpathError: xpath component parse error: port[port_id=1"

    (I cross-checked the xpath syntax with gnmi_get, which does not give errors on the xpaths described above)

    Any ideas ?

    Thanks, Oli

    gnmi py 
    opened by oli-couvreur 7
  • Implemented Factory Reset server for mock target

    Implemented Factory Reset server for mock target

    Related issue: #98 The strategy is to allow the target to pass in the Settings object which will tell the server what cases it should error on. These could be passed in as flags or otherwise when it's added to the CLI.

    Also added proto definition and pb.go's

    enhancement gnoi 
    opened by ericm 6
  • Backup perf experiment scripts for gateway machine

    Backup perf experiment scripts for gateway machine

    This is a temporary solution to back up perf experiment scripts for gateway machines. Gateway machines are intended to be non google machine. So, it is better to back up these scripts to github.

    opened by river8 6
  • Getting subtree encoded as JSON in one update message

    Getting subtree encoded as JSON in one update message

    Hi guys, I have question regarding encoding of data. According to gNMI specification, section 2.3.1, I assumed, that when I will send get request to target, with a path which does not point to leaf node, then in response message will be one notification with one update message which value will be JSON encoded subtree located under this path.

    But instead in response message I receive notification message with separate update message for each leaf node in that subtree. My question is, if I am missing something from official gNMI specification, or I had to setup gnxi target in some special way in order to receive whole subtree as JSON encoded value of one update message.

    bug 
    opened by CoCumis 5
  • Update README's and openflow.json

    Update README's and openflow.json

    (M) gnmi_target/README.md -fix the run example (add missing '')

    (M) README.md -update main README to include go version requirement.

    (M) gnmi_target/openconfig-openflow.json -Update JSON to include a "state" container. (gnmi_get example fails without this). If this is not appropriate, alternative would be change the gnmi_get example to use a path of: "/system/openflow/controllers/controller[name=main]/connections/connection[aux-id=0]" (eg leave off the '/state/address')

    opened by mike-albano 5
  • allow loading multiple CAs into bundle

    allow loading multiple CAs into bundle

    The current client doesn't allow loading multiple certificates at once in a single install/rotate operation.

    New argument: other_cas Comma separated list of filename prefixes that the client will use to the load the associated .pem and .key files

    Usage:

    ./gnoi_cert -target_addr localhost:9339 -target_name 10.85.68.161 -logtostderr -ca device_rootCA.pem -ca_key device_rootCA.key -op provision -cert_id gnoi_demo \
    -other_cas client_intermediateCA_B,client_intermediateCA_C,client_rootCA_B,client_rootCA_C,device_intermediateCA,device_rootCA -ip_address 10.85.68.161 -organization gnoi_dem -time_out 1m
    
    enhancement gnoi 
    opened by alisharif2 3
  • Added bug fixes and improvements to orchestrator package

    Added bug fixes and improvements to orchestrator package

    There were a few things needed to get the orchestrator working so I implemented them. These include:

    • Printing image build status to stdout

    • Fixing run check for docker containers

    • Fixing exec creation in the RunContainer stage

    • Adding method to tar into /tmp and read into dockers CopyToContainer method

    • Adding certs to containers on runtime

    • Refactored formatting

    • Fixing unit tests

    bug enhancement gnxi_tester 
    opened by ericm 3
  • Make the basic testacases atomic.

    Make the basic testacases atomic.

    Based on usage, it makes more sense for the basic testcases to be atomic, one single test method that reflects better the sequential nature of the tests.

    opened by JoseIgnacioTamayo 0
  • Add Docker images.

    Add Docker images.

    This allows to easily run the Demo without installing anything on the host.

    Also, this could facilitate the use of oc_config_validate in Docker-based environments.

    The Demo script was updated to run correctly inside a container

    opened by JoseIgnacioTamayo 0
  • gnmi_set: IPv6 address parsing error in  -update xpath

    gnmi_set: IPv6 address parsing error in -update xpath

    gnmi_set -target_addr 172.18.0.6:50052 -target_name 172.18.0.7 --insecure -password admin -username admin -update /interfaces/interface[name=ethernet-1/1]/subinterfaces/subinterface[index=1]/ipv6/addresses/address[ip='2001:192:58:3:1::1']/config/prefix-length:120

    F0317 06:41:44.037370 24434 gnmi_set.go:72] error in parsing xpath "/interfaces/interface[name=ethernet-1/1]/subinterfaces/subinterface[index=1]/ipv6/addresses/address[ip=2001" to gnmi path

    Seems like this was once broken before?

    opened by maheshnayak1 0
  • subscription is not implemented in gnmi_target

    subscription is not implemented in gnmi_target

    Hi,

    I am tried to use gnmi_subscribe with gnmi_target. it seems subscribe option is not implemented. I get below error

    gnmi_subscribe.go:127] Error using STREAM mode: rpc error: code = Unimplemented desc = Subscribe is not implemented.

    Any help bringing up the subscription implementation in the target?

    enhancement gnmi 
    opened by rkkilari 0
  • Multiple models for gnmi target

    Multiple models for gnmi target

    In the current implementation of gnmi target, a single model is initialized and used for implementing of the server. I would like to know how we can run multiple models using a single gnmi agent? Does it make sense to do that?

    enhancement gnmi 
    opened by adibrastegarnia 8
Owner
Google
Google ❤️ Open Source
Google
A suite of gRPC debugging tools. Like Fiddler/Charles but for gRPC.

grpc-tools A suite of tools for gRPC debugging and development. Like Fiddler/Charles but for gRPC! The main tool is grpc-dump which transparently inte

Bradley Kemp 1.1k Jun 23, 2022
Optimize Windows's network/NIC driver settings for NewTek's NDI(Network-Device-Interface).

windows-ndi-optimizer[WIP] Optimize Windows's network/NIC driver settings for NewTek's NDI(Network-Device-Interface). How it works This is batchfile d

Nil Hiiragi 3 Apr 15, 2022
gRPC User Management Service

Installation Clone the repo git clone https://github.com/geekbim/Go-gRPC.git Generate Protobuf sh run-proto.sh Running PostgreSQL Container sh postgre

Abimanyu Gatya Dhaneswara 0 Oct 11, 2021
grpc-http1: A gRPC via HTTP/1 Enabling Library for Go

grpc-http1: A gRPC via HTTP/1 Enabling Library for Go This library enables using all the functionality of a gRPC server even if it is exposed behind a

StackRox 80 Jun 15, 2022
Server and client implementation of the grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs from gRPC go introduction

Description This is an implementation of a gRPC client and server that provides route guidance from gRPC Basics: Go tutorial. It demonstrates how to u

Joram Wambugu 0 Nov 24, 2021
Go based grpc - grpc gateway micro service example

go-grpc-gateway-server This repository provides an example for go based microservice. Go micro services developed based on gRPC protobuf's and also us

Suresh Yekasiri 0 Dec 8, 2021
Simple grpc web and grpc transcoding with Envoy

gRPC Web and gRPC Transcoding with Envoy This is a simple stand-alone set of con

null 0 Dec 25, 2021
Go-grpc - This is grpc server for golang.

go-grpc This is grpc server for golang. protocのインストール brew install protoc Golang用のプラグインのインストール go install google.golang.org/protobuf/cmd/protoc-gen-go

jotaro yuza 1 Jan 2, 2022
GRPC - Creating a gRPC service from scratch

#Go gRPC services course Creating a gRPC service from scratch Command line colle

Rafael Diaz Miles 1 Jan 2, 2022
Totem - A Go library that can turn a single gRPC stream into bidirectional unary gRPC servers

Totem is a Go library that can turn a single gRPC stream into bidirectional unar

Joe Kralicky 2 Jan 10, 2022
Grpc-gateway-map-null - gRPC Gateway test using nullable values in map

Demonstrate gRPC gateway behavior with nullable values in maps Using grpc-gatewa

null 1 Jan 6, 2022
Todo-app-grpc - Go/GRPC codebase containing RealWorld examples (CRUD, auth, advanced patterns, etc)

Go/GRPC codebase containing RealWorld examples (CRUD, auth, advanced patterns, e

Sammi Aldhi Yanto 3 Jun 13, 2022
GRPC - A client-server mockup, using gRPC to expose functionality.

gRPC This is a mockup application that I built to help me visualise and understand the basic concepts of gRPC. In this exchange, the client can use a

Fergal Bittles 0 Jan 4, 2022
Raft-grpc-demo - Some example code for how to use Hashicorp's Raft implementation with gRPC

raft-grpc-example This is some example code for how to use Hashicorp's Raft impl

dougsong 1 Jan 4, 2022
Benthos-input-grpc - gRPC custom benthos input

gRPC custom benthos input Create a custom benthos input that receives messages f

Marco Amador 2 May 18, 2022
Go-grpc-template - A small template for quickly bootstrapping a, developer platform independent gRPC golang application

go-grpc-template A small template for quickly bootstrapping a developer platform

null 1 Jan 20, 2022
Grpc-train - Train booking demo using gRPC

gRPC Demo: Train Booking Service Description Usage Contributing Development Tool

Fadi Asfour 0 Feb 6, 2022
This repo contains a sample app exposing a gRPC health endpoint to demo Kubernetes gRPC probes.

This repo contains a sample app exposing a health endpoint by implementing grpc_health_v1. Usecase is to demo the gRPC readiness and liveness probes introduced in Kubernetes 1.23.

Nico Meisenzahl 1 Feb 9, 2022
Go-grpc-tutorial - Simple gRPC server/client using go

Simple gRPC server/client using go Run server go run usermgmt_server/usermgmt_

Renner Poveda 0 Feb 14, 2022