cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4150
Views
1
Helpful
4
Replies

YANG models to Protobuf encoding

hariharan.a
Level 1
Level 1

Does YDK has support for protobuf encoding ? That is given a YANG model, can YDK generate encoders/decoders to send/receive data in protobuf format.

The below link says, its one of the non-standard approaches.

http://events.linuxfoundation.org/sites/events/files/slides/ONS-SDN-metrics-from-SDOs-ward.pdf

I am looking for a way to decode telemetry data that is sent through grpc/protobuf with a given YANG model. That is YANG model -> cpp code -> (protobuf encoding/decoding) <-> grpc (transport)

Thanks,

Hari

4 Replies 4

einarnn
Cisco Employee
Cisco Employee

Hari,

It really depends what kind of protobuf you are looking at here. As you note, there isn't a standard for this as such. We work with a fairly simple protobuf envelope most of the time, with real data nested in the envelope. The nested format has two different formats:

  • Simple recursive key-value encoding.

  • "Strongly typed" .proto, based on an underlying YANG model.

You can see some of the IDL we use on XR & NX here:

https://github.com/cisco/bigmuddy-network-telemetry-proto/blob/master/proto_archive/telemetry.proto

In either case, you have a .proto file available for the data, so why not just use that .proto definition?

Cheers,

Einar

Thanks Einar. As you know, the key-value encoding wont be much useful in production for large and high frequency data sets due to its size.

Strongly typed.proto is preferred for the above case. As far the .proto definition, is there a way to get the definitions for each IOS-XR release (like the yang models) in github ? The bigmuddy-network-telemetry .proto definitions are 7 months old and couldnt figure for which IOS-XR version they are. 

- Hari

Making proto files part of the YDK model bundle generation could certainly be an interesting enhancement 🤔

sfloresk
Cisco Employee
Cisco Employee

If you are using XR, you can find the protobuf files per version at https://github.com/ios-xr/model-driven-telemetry/tree/master/protos 

Hope this helps

-- Santi