Key Telemetry Technologies: Huawei Netengine 8000 M14 and M8 Series Router Product Documentation
Key Telemetry Technologies: Huawei Netengine 8000 M14 and M8 Series Router Product Documentation
Key Telemetry Technologies: Huawei Netengine 8000 M14 and M8 Series Router Product Documentation
This document describes key technologies only on the Telemetry device side.
Original Data
Telemetry collects data from the forwarding, control, and management planes of network devices. Currently, the data that can be collected includes interface traffic statistics,
CPU usage, and memory usage.
Data Model
Telemetry collects data based on the YANG model.
YANG is a data modeling language developed to define configuration data modules, status data models, RPC models, and notification mechanisms for transmission protocols.
Encoding Format
Support for the Google Protocol Buffers (GPB) Encoding Format
Google Protocol Buffers (GPB) encoding is a language-neutral, platform-neutral, and extensible mechanism for serializing structured data of communications protocols and data
storage.
Telemetry uses the encoding format GPB (the file name extension of a file encoded in GPB format is .proto) and provides a mechanism for serializing structured data flexibly,
efficiently, and automatically. The GPB format is binary encoding and has good performance and high efficiency.
GPB uses the .proto file to describe a dictionary for encoding, which is the data structure description. You can use a tool such as Protoc (for example, the protoc-3.0.2-windows-
x86_64.exe file) to automatically generate code (for example, Java code) based on the .proto file. Then, perform secondary development based on the automatically generated
code to encode and decode GPB, thereby implementing device interworking. Table 1 compares GPB encoding and decoding.
{ {
1:"HUAWEI" "node_id_str":"HUAWEI",
2:"s4" "subscription_id_str":"s4",
3:"huawei-ifm:ifm/interfaces/interface" "sensor_path":"huawei-ifm:ifm/interfaces/interface",
4:46 "collection_id":46,
5:1515727243419 "collection_start_time":"2018/1/12 11:20:43.419",
6:1515727243514 "msg_timestamp":"2018/1/12 11:20:43.514",
7{ "data_gpb":{
1[{ "row":[{
1: 1515727243419 "timestamp":"2018/1/12 11:20:43.419",
2 { "content":{
5{ "interfaces":{
1[{ "interface":[{
5:1 "ifAdminStatus":1,
16:2 "ifIndex":2,
25:"Eth-Trunk1" "ifName":"Eth-Trunk1"
}] }]
} }
} }
}] }]
} },
8:1515727243419 "collection_end_time":"2018/1/12 11:20:43.419",
9:10000 "current_period":10000,
10:"OK" "except_desc":"OK",
11:"NetEngine 8000" "product_name":"NetEngine 8000",
12:0 "encoding":Encoding_GPB
} }
{
"node_id_str":"HUAWEI",
"subscription_id_str":"s4",
"sensor_path":"huawei-ifm:ifm/interfaces/interface",
"collection_id":46,
"collection_start_time":"2018/1/12 11:20:43.419",
"msg_timestamp":"2018/1/12 11:20:43.514",
"collection_end_time":"2018/1/12 11:20:43.419",
"current_period":10000,
"except_desc":"OK",
"product_name":"NetEngine 8000",
"encoding":Encoding_JSON,
"data_str":{
"row":[{
"timestamp":"2018/1/12 11:20:43.419",
"content":{
"interfaces":{
"interface":[{
"ifAdminStatus":1,
"ifIndex":2,
"ifName":"Eth-Trunk1"
}]
}
}
}]
}
}
For data transmitted between devices and collectors, the data encoded in the GPB format has a higher information load capability than that encoded in other formats
(JSON or XML). GPB encoding ensures Telemetry data throughput capabilities and reduces the CPU usage and bandwidth.
If telemetry uses the JSON encoding format, the data packets sent to the collector do not contain the typesetting characters such as carriage return or space to reduce the
size of JSON encoding data.
Transport Protocol
Support for Google Remote Procedure Call Protocol (gRPC)
gRPC is a high-performance general RPC open-source software framework running over HTTP2 protocols. Both communication parties perform secondary development based
on the framework, so that they focus on services and do not need to pay attention to bottom-layer communication implemented by the gRPC software framework.
Telemetry uses the gRPC protocol to report the data encoded in GPB format to the collector.
The gRPC protocol applies to telemetry static subscription and dynamic subscription.
Table 3 Layers
Layer Description
TCP layer This is a bottom-layer communication protocol, which is based on TCP connections.
HTTP2 layer The HTTP2 protocol carries gRPC, using HTTP2 features such as bidirectional streams, flow control,
header compression, and multiplexing request of a single connection.
gRPC layer This layer defines the protocol interaction format for remote procedure calls.
Data model layer RPC layer Telemetry static subscription: defined in the huawei-grpc-dialout.proto file.
NOTE: Telemetry dynamic subscription: defined in the huawei-grpc-dialin.proto file.
The data model
layer is divided Telemetry layer When the encoding format of the data to be sent to the collector is GPB, it is defined in the
into three huawei-telemetry.proto file.
layers, which
are defined in
When the encoding format of the data to be sent to the collector is JSON, you do not need to use
different .proto the .proto files at the telemetry layer for decoding.
files. To
establish a gRPC Service data layer If the encoding format of the data to be sent is GPB, the encoding field in the huawei-
connection
between the telemetry.proto file is Encoding_GPB (with the value of 0), the data_gpb field carries
collector and a sampling data in GPB format, and the data_str field is empty.
network device,
use the .proto NOTE:
files for The data_gpb field needs to be decoded by the corresponding service .proto file. The
interconnection. sensor_path field in the huawei-telemetry.proto file identifies the specific
The .proto files service .proto file. For example, if the value of the sensor_path field is huawei-
on the two ends ifm:ifm/interfaces/interface , the corresponding data structure is defined in the
must be the
same, which
huawei-ifm.proto file.
facilitates If the encoding format of the data to be sent is JSON, the encoding field in the huawei-
decoding. telemetry.proto file is Encoding_JSON (with the value of 1), the data_str field carries
sampling data in JSON format, and the data_gpb field is empty.
NOTE:
If the JSON encoding format is used, you only need to use the .proto files at the RPC
layer for decoding. The .proto file at the telemetry layer and the corresponding service
.proto file are not required.
huawei-grpc-dialout.proto is the RPC header file. When a device functions as the client to push data, this file defines the RPC interface. The following table
describes the file content and meaning.
huawei-grpc-dialout.proto
huawei-grpc-dialin.proto is the RPC header file. When a device functions as the server to push data, this file defines the RPC interface. The following table describes
the file content and meaning.
huawei-grpc-dialin.proto
huawei-grpc-dialin.proto
}
message SubsReply { //Subscribing response parameter.
uint32 subscription_id = 1; //If the subscribing is successful, the subscription ID is returned. If the subscribing fails, 0 is retu
uint64 request_id = 2; //ID of the subscribing request.
string response_code = 3; //Return code. The value 200 indicates a success.
oneof MessageData {
bytes message = 4; //If an error occurs, the error description is returned. If no error occurs, the GPB encoding data is
string message_json = 5; //If no error occurs, the JSON encoding data is sent.
}
}
message CancelArgs { //Unsubscribing request parameter.
uint64 request_id = 1; //Request ID, which is transferred by the invoker.
uint32 subscription_id = 2; //ID of the subscription to be canceled.
}
message CancelReply { //Unsubscribing response parameter.
uint64 request_id = 1; //Request ID, which is transferred by the invoker.
string response_code = 2; //Return code. The value 200 indicates a success.
string message = 3; //Error description.
}
huawei-telemetry.proto is the telemetry header definition file. It defines the data header when telemetry data sampled is sent, including key information, such as the
sampling path and sampling timestamp. The following table describes the file content and meaning.
huawei-telemetry.proto
huawei-telemetry.proto
Table 4 Layers
Layer Description
Data model layer Message header For the definition of message header architecture, see UDP based Publication Channel for Streaming Telemetry.
NOTE: Telemetry layer When the encoding format of the data to be sent to the collector is GPB, it is defined in the
The data model huawei-telemetry.proto file.
layer is divided
into three When the encoding format of the data to be sent to the collector is JSON, you do not need to use
layers, which the .proto files at the telemetry layer for decoding.
are defined in
different .proto
files except the
Service data layer If the encoding format of the data to be sent is GPB, the encoding field in the huawei-
Message header. telemetry.proto file is Encoding_GPB (with the value of 0), the data_gpb field carries
To establish a sampling data in GPB format, and the data_str field is empty.
UDP connection
between the NOTE:
The data_gpb field needs to be decoded by the corresponding service .proto file. The
collector and a
network device,
sensor_path field in the huawei-telemetry.proto file identifies the specific service
.proto file. For example, if the value of the sensor_path field is huawei-
use the .proto
files for
ifm:ifm/interfaces/interface , the corresponding data structure is defined in the
interconnection.
The .proto files
huawei-ifm.proto file.
on the two ends
must be the
If the encoding format of the data to be sent is JSON, the encoding field in the huawei-
same, which telemetry.proto file is Encoding_JSON (with the value of 1), the data_str field carries
facilitates sampling data in JSON format, and the data_gpb field is empty.
decoding. For
description of NOTE:
the .proto If the JSON encoding format is used, you only need to use the .proto files at the RPC
files, see the layer for decoding. The .proto file at the telemetry layer and the corresponding service
relevant content .proto file are not required.
of gRPC.
Push Mode
The Telemetry push mode enables network devices to periodically push data to the NMS, avoiding repeated query and improving monitoring performance. Figure 3 shows the
push process.
Figure 3 Sampling process in telemetry push mode