Figure 1 shows the format of the header of a NetStream packet exported in V9 format. This header corresponds to the Header field in Figure 1. Table 1 describes the fields in the header.
Field |
Description |
---|---|
version |
Version number of the format in which NetStream packets are exported. Value 0x09 indicates the V9 format. |
count |
Number of FlowSet records (including records in the template FlowSet and data FlowSet) exported in a NetStream packet. |
system up time |
Period (in milliseconds) from the time the system is booted to the time a NetStream packet was generated. |
unix_secs |
Integer number of seconds elapsed from 00:00:00, January 1st, 1970 to the time a NetStream packet was generated. |
package sequence |
Sequence number of an exported packet. You can check whether a NetStream packet is dropped based on the flow sequence value. NOTE:
The meaning of this field in the header of the NetStream packet exported in V9 is different from that in V5 or V8 format. In V5 and V8, this field indicates the sequence number of all flows. |
source id |
Source ID used to uniquely identify a device exporting packets. The value occupies 4 bytes. The Source ID field is equal to the Engine Type and Engine ID fields in the header of a NetStream packet exported in V5 or V8 format. The Source ID field value can be defined. |
The exported packet information in V9 is Export Packet, which consists of Packet Header, Template FlowSet, and Data FlowSet. shows the format of the exported packet information.
Both a template FlowSet and a data FlowSet contain template IDs, but these FlowSets are independent of each other. Upon receipt of a NetStream packet, an NSC parses data records in a data FlowSet and obtains a template ID. Although the NSC also obtains a template ID carried in a template FlowSet, the NSC can only use this template ID to parse the following exported NetStream packets.
The template flowset and data flowset are optional in the Export Packet area. The possible combinations are as follows:
The fields are described as follows:
Template Record: corresponds to each data record in Export Packet. Stream information in a data record is parsed based on a template record.
Template ID: identifies a template. Each template has a specific ID. A data record contains a template ID used to select a template.
Indicates a combination of one or multiple data records.
Data Record: corresponds to a NetStream record.
Template FlowSet Format
Figure 3 shows the template FlowSet format.
In this example, a template FlowSet contains two template records. Table 2 describes the fields in CFM packets.
Field |
Description |
---|---|
FlowSet ID |
ID of a template FlowSet. The FlowSet ID value can be: For a template FlowSet: 0 to 255 For a data FlowSet: 256 to 511 An NDC uses FlowSet IDs to distinguish template records from data records in an exported NetStream packet. |
Length |
Total length of the template FlowSet. The Length field contents are represented in the type-length-value (TLV) format, and its value is equal to the sum of the following lengths: Lengths of the FlowSet ID field and the Length field itself Length of each template record carried in the template FlowSet Length of each template record carried in the template FlowSetA single template FlowSet contains multiple template IDs. The length value helps determine the position of the next template or data FlowSet record. |
Template ID |
ID of a template record in the template FlowSet. A template record is mapped to a specific type of NetStream data to be exported. The template ID is unique on a device. A template ID is equal to a data FLowSet ID and ranges from 256 to 511. |
Field Count |
Number of fields in a template record. A template FlowSet includes one or more template records. The Field Count value helps determine the end of an existing template record and the start of the next one. |
Field Type |
Type of data in a template record. The value can be defined. For example, if statistics are collected based on the destination IP address, protocol type, ToS, and MPLS label, a field type is used to define each of these four attributes. |
Field Length |
Length (in bytes) of a defined field type. For example, if the field type is set to a destination IP address, the field length value is 4 bytes. |
Data FlowSet Format
Figure 4 Data FlowSet packet format shows the Data FlowSet packet format.
In this example, a data FlowSet contains two data records. The data FlowSet ID is used to parse the two data records. Table 3 describes the fields carried in the data FlowSet.
Field |
Description |
---|---|
FlowSet ID = Template ID |
ID of a data FlowSet. A data FlowSet ID is equal to a template ID in a template FlowSet. An NDC and a display application use a FlowSet ID to map to the type and length of a field. |
Length |
Length of a data FlowSet. The Length field contents are represented in the TLV format, and its value is equal to the sum of the following lengths: Lengths of the FlowSet ID field and the length field itself Length of each data record carried in the data FlowSet Length of padding bits |
record n -field n |
Field value in each data record of the data FlowSet. |
Padding |
A 32–bit field at the end of the data FlowSet. Note that the length field includes the length of padding bits. |
Relationship Between a Data Stream Format and the V9 Template Format
Figure 5 shows the relationship between the data stream format and the V9 template format.