NetFlow data processing method, electronic equipment and medium

By including target segment identifiers in NetFlow template flow and data flow, the problem of insufficient support for SRv6 in NetFlow technology is solved, effective monitoring and analysis of the SRv6 network is realized, and end-to-end traffic analysis and security monitoring are realized.

CN119052122AActive Publication Date: 2024-11-29CHINA MOBILE COMM LTD RES INST +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310619771.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-29
Publication Date
2024-11-29
Estimated Expiration
2043-05-29

AI Technical Summary

Technical Problem

The existing NetFlow technology lacks support for SRv6, which makes SRv6 packets unable to effectively monitor and network planning, and cannot implement end-to-end traffic analysis.

Method used

By including the target segment identifier field in the NetFlow template stream and data stream, it is used to characterize the segment identifier SID associated with the segment routing SRv6 of the IPv6 forwarding plane, and populate these identifiers in the IPv6 message, to the next level The second device sends a NetFlow template stream and a data stream so that the second device can parse and analyze the SRv6 network.

Benefits of technology

It realizes security monitoring, network planning, traffic analysis and IP statistics of SRv6 networks, and can conduct statistical analysis of packets according to VPNs, solving the problem that SRv6 packets are regarded as ordinary IPv6 packets for statistics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119052122A_ABST
    Figure CN119052122A_ABST
Patent Text Reader

Abstract

The invention provides a NetFlow data processing method, electronic equipment and a medium, and the method comprises the steps: configuring a NetFlow template flow and a NetFlow data flow, and determining whether an IPv6 message comprises a target segment identifier or not under the condition that first equipment transmits the IPv6 message; in the invention, under the condition that the IPv6 message comprises the target segment identifier, the target segment identifier is filled into a field in the NetFlow data stream, and the NetFlow template stream and the NetFlow data stream filled with the target segment identifier are sent to the second equipment, so that the second equipment can obtain the target segment identifier after receiving the NetFlow template stream and the NetFlow data stream, and the NetFlow template stream and the NetFlow data stream are sent to the second equipment. Network and security monitoring, network planning, flow analysis, IP statistics and the like of the SRv6 network can be completed, and statistical analysis can be carried out on messages according to the VPN.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a NetFlow data processing method, electronic equipment and medium. Background Art

[0002] Currently, NetFlow provides a statistical method for data packet flows through switches / routers. Based on this, the data provided by NetFlow can support network and security monitoring, network planning, traffic analysis, and IP statistics. However, in actual applications, the existing NetFlow lacks support for SRv6 (Segment Routing IPv6, segment routing based on the IPv6 forwarding plane), resulting in SRv6 packets being counted as ordinary IPv6 (Internet Protocol Version 6) packets. Since the destination IPv6 address in the SRv6 packet may change as the forwarding path changes, the statistical information cannot perform end-to-end traffic analysis on the SRv6 packet, nor can it achieve effective security monitoring and network planning for the SRv6 network. Summary of the invention

[0003] The embodiments of the present invention provide a NetFlow data processing method, an electronic device and a medium to solve the problem that NetFlow in the prior art lacks support for SRv6, resulting in that SRv6 messages can only be treated as ordinary IPv6 messages for integration, and effective security monitoring and network planning of SRv6 networks cannot be achieved.

[0004] To solve the above technical problems, the present invention is achieved as follows:

[0005] In a first aspect, an embodiment of the present invention provides a method for processing NetFlow data, which is applied to a first device, and the method includes: configuring a NetFlow template flow and a NetFlow data flow, wherein both the NetFlow template flow and the NetFlow data flow include a field for representing a target segment identifier, and the target segment identifier is used to represent a segment identifier SID associated with a segment routing SRv6 based on an IPv6 forwarding plane; when the first device transmits an IPv6 message, determining whether the IPv6 message includes the target segment identifier; when the IPv6 message includes the target segment identifier, filling the target segment identifier into the field in the NetFlow data flow, and sending the NetFlow template flow and the NetFlow data flow filled with the target segment identifier to a second device.

[0006] In a second aspect, an embodiment of the present invention provides a method for processing NetFlow data, which is applied to a second device, the method comprising: parsing a NetFlow template flow sent by a first device, and saving a parsing result, wherein the parsing result includes a template ID and template information; comparing a data ID in a NetFlow data flow sent by the first device with a template ID to determine a NetFlow template flow corresponding to the NetFlow data flow; and parsing the NetFlow data flow based on the template information to obtain a target segment identifier.

[0007] In a third aspect, an embodiment of the present invention provides a device, comprising: a configuration module, used to configure a NetFlow template flow and a NetFlow data flow, wherein both the NetFlow template flow and the NetFlow data flow include a field for representing a target segment identifier, and the target segment identifier is used to represent a segment identifier SID associated with a segment routing SRv6 based on an IPv6 forwarding plane; a first determination module, used to determine whether the IPv6 message includes the target segment identifier when the first device transmits an IPv6 message; a processing module, used to fill the target segment identifier into the field in the NetFlow data flow when the IPv6 message includes the target segment identifier, and send the NetFlow template flow and the NetFlow data flow filled with the target segment identifier to a second device.

[0008] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising a transceiver and a processor, wherein the processor is used to configure a NetFlow template flow and a NetFlow data flow, wherein both the NetFlow template flow and the NetFlow data flow include a field for representing a target segment identifier, and the target segment identifier is used to represent a segment identifier SID associated with a segment routing SRv6 based on an IPv6 forwarding plane, and when the first device transmits an IPv6 message, determine whether the IPv6 message includes the target segment identifier, and when the IPv6 message includes the target segment identifier, fill the target segment identifier into the field in the NetFlow data flow; the transceiver is used to send the NetFlow template flow and the NetFlow data flow filled with the target segment identifier to a second device.

[0009] In a fifth aspect, an embodiment of the present invention provides a device, comprising: a first parsing module, used to parse the NetFlow template flow sent by the first device and save the parsing result, wherein the parsing result includes a template ID and template information; a comparison module, used to compare the data ID in the NetFlow data flow sent by the first device with the template ID to determine the NetFlow template flow corresponding to the NetFlow data flow; a second parsing module, used to parse the NetFlow data flow based on the template information to obtain a target segment identifier.

[0010] In a sixth aspect, an embodiment of the present invention provides an electronic device, comprising a transceiver and a processor, wherein the transceiver is used to receive a NetFlow template flow and a NetFlow data flow sent by a first device; the processor is used to parse the NetFlow template flow sent by the first device, save the parsing result, and compare the data ID in the NetFlow data flow sent by the first device with the template ID to determine the NetFlow template flow corresponding to the NetFlow data flow, and parse the NetFlow data flow based on the template information to obtain a target segment identifier; wherein the parsing result includes the template ID and template information.

[0011] In a seventh aspect, an embodiment of the present invention provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the program implements the steps of the method for processing NetFlow data as described in the first aspect above; or, when the program is executed by the processor, the program implements the steps of the method for processing NetFlow data as described in the second aspect above.

[0012] In an eighth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the NetFlow data processing method as described in the first aspect are implemented; or, when the computer program is executed by a processor, the steps of the NetFlow data processing method as described in the second aspect are implemented.

[0013] In an embodiment of the present invention, when the first device configures the NetFlow template flow and the NetFlow data flow, the target segment identifier (such as SRv6 SID or SRv6 VPN SID) is included in the NetFlow template flow and the NetFlow data flow, so that the second device can obtain the target segment identifier after receiving the NetFlow template flow and the NetFlow data flow, so that the second device can subsequently complete the network and security monitoring, network planning, traffic analysis and IP statistics of the SRv6 network, and can perform statistical analysis on the messages according to the VPN, thereby solving the problem in the prior art that NetFlow lacks support for SRv6, resulting in SRv6 messages being treated as ordinary IPv6 messages and being unable to achieve effective security monitoring and network planning of the SRv6 network. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0015] Figure 1 is a flow chart of a method for processing NetFlow data provided by an embodiment of the present invention;

[0016] Figure 2 It is a schematic diagram of a message format corresponding to a NetFlow template flow when a target segment identifier provided by an embodiment of the present invention is an SRv6 SID;

[0017] Figure 3 It is a schematic diagram of a message format corresponding to a NetFlow template flow when a target segment identifier provided by an embodiment of the present invention is an SRv6 VPN SID;

[0018] Figure 4 It is a schematic diagram of a message format corresponding to a NetFlow data flow when a target segment identifier provided by an embodiment of the present invention is an SRv6 SID;

[0019] Figure 5 It is a schematic diagram of a message format corresponding to a NetFlow data flow when a target segment identifier provided by an embodiment of the present invention is an SRv6 VPN SID;

[0020] Figure 6 is a flow chart of another method for processing NetFlow data provided by an embodiment of the present invention;

[0021] Figure 7It is a schematic diagram of the network structure provided by an embodiment of the present invention;

[0022] Figure 8 It is a schematic diagram of a template flow and a data flow sent by PE1 when the target segment identifier is an SRv6 SID provided by an embodiment of the present invention;

[0023] Fig. 9 It is a schematic diagram of a template flow and a data flow sent by PE1 when the target segment identifier is an SRv6 VPN SID provided by an embodiment of the present invention;

[0024] Fig.10 is a schematic diagram of a device provided by an embodiment of the present invention;

[0025] Fig.11 is a schematic diagram of an electronic device provided by an embodiment of the present invention;

[0026] Fig.12 is a schematic diagram of another device provided by an embodiment of the present invention;

[0027] Fig.13 is a schematic diagram of another electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] First, NetFlow is explained. NetFlow[RFC3954][RFC7011] technology is a network flow information-based statistics and publishing technology. It can count and publish the communication volume and resource usage in the network, and provide network administrators with a means to access detailed information on communication volume.

[0030] A NetFlow system mainly consists of three parts: detector (NetFlow Monitor), collector (NetFlow collector) and reporting system (Flow Records). The detector is used to monitor network data. The collector is used to collect data sent by the detector. The reporting system is used to generate easy-to-read reports from the data collected by the collector.

[0031] Before outputting NetFlow data flow, the collector will first send a template flow carrying the template ID to the detector, and the detector will record the received template ID and template information.

[0032] The NetFlow data records output by the collector consist of data flows and detailed traffic statistics. These data flows can contain information related to the source and destination, the protocols and ports used in the end-to-end session, MPLS labels, and other information. After receiving the data record, the detector will match the template ID carried in the data flow with the corresponding template information and parse the data flow.

[0033] See also Figure 1 , Figure 1 is a flowchart of a method for processing NetFlow data provided by an embodiment of the present invention, which is used for a first device, such as Figure 1 As shown, the method comprises the following steps:

[0034] Step 101, configuring a NetFlow template flow and a NetFlow data flow, wherein both the NetFlow template flow and the NetFlow data flow include a field for representing a target segment identifier, and the target segment identifier is used to represent a SID (Segment Identifier) ​​associated with a segment routing SRv6 based on an IPv6 forwarding plane;

[0035] In the specific examples of the present application, the SID associated with SRv6 may refer to an SRv6 SID, or a G-SRv6 SID, and may further refer to an SRv6 VPN (Virtual Private Network) SID or a G-SRv6 VPN SID. In addition, the first device in the embodiment of the present application may be a detector of a NetFlow system, and the second device may be a collector in a NetFlow system. In addition, in some special application scenarios in the specific examples, the first device may also be a collector, and the second device may also be a detector. Furthermore, the first device in the specific example may be a router.

[0036] Step 102, when the first device transmits an IPv6 message, determining whether the IPv6 message includes a target segment identifier;

[0037] Step 103: When the IPv6 message includes a target segment identifier, fill the target segment identifier into a field in the NetFlow data flow, and send the NetFlow template flow and the NetFlow data flow filled with the target segment identifier to the second device.

[0038] It can be seen from steps 101 to 103 of the above-mentioned embodiment of the present application that when the first device configures the NetFlow template flow and the NetFlow data flow, the target segment identifier (such as SRv6 SID or SRv6 VPN SID, and G-SRv6 SID or G-SRv6 VPN SID) is included in the NetFlow template flow and the NetFlow data flow, so that the second device can obtain the target segment identifier after receiving the NetFlow template flow and the NetFlow data flow, so that the second device can subsequently complete the network and security monitoring, network planning, traffic analysis and IP statistics of the SRv6 network, and can perform statistical analysis on the messages according to the VPN, thereby solving the problem that NetFlow in the prior art lacks support for SRv6, resulting in SRv6 messages being treated as ordinary IPv6 messages and being unable to achieve effective security monitoring and network planning of the SRv6 network.

[0039] It should be noted that in the embodiment of the present application, when the first device is a detector, the second device is a collector; in other scenarios, the first device may also be a collector, and the second device is a detector. The specific settings can be made according to actual needs.

[0040] In an optional implementation manner of an embodiment of the present application, the message format corresponding to the NetFlow template flow in the embodiment of the present application includes at least a first field for representing whether it is a template flow, a second field for representing the length of the NetFlow template flow, a third field for representing the template ID, a fourth field for representing the number of fields in the NetFlow template flow, a fifth field for representing the field type, and a sixth field for representing the length of the field type.

[0041] It can be seen that in the embodiment of the present application, the existing NetFlow protocol is extended. In the specific example, if the current target segment identifier is SRv6 SID, a new SRv6 related value definition can be added in Field Type, such as SRv6_SID_1, SRv6_SID_2...SRv6_SID_M, as shown in Table 1 in the specific example. It should be noted that in the embodiment of the present application, a new G-SRv6 (Generalized Segment Routing IPv6, SRv6 header compression technology) related value definition can also be added to the Field Type of the NetFlow protocol according to demand, and the newly added G-SRv6 related value is similar to the newly added SRv6 related value, that is, it can be G-SRv6_SID_M.

[0042]

[0043]

[0044] Table 1

[0045] Based on Table 1, the format of the template message corresponding to the NetFlow template flow in the specific example is as follows Figure 2 As shown, FlowSet ID (corresponding to the first field) = 0 indicates that it is a template flow, and Length (corresponding to the second field) is used to indicate the length of the entire FlowSet, specifically including the FlowSet ID, Length and the length of all Template fields. TemplateID (corresponding to the third field) is used to identify the template, wherein each newly generated template will generate a unique TemplateID, and the optional value of TemplateID is 256 to 65535. Field Count (corresponding to the fourth field) is used to indicate the number of fields in this template. Field Type (corresponding to the fifth field) is used to identify the type of the field. Field Length (corresponding to the sixth field) is used to indicate the length of the corresponding Field type.

[0046] In the specific example, if the current target segment identifier is an SRv6 VPN SID, a new value definition of the Field Type field SRv6_VPN_SID is added, and the specific definition is shown in Table 2.

[0047]

[0048]

[0049] Table 2

[0050] Based on Table 2, the format of the template message corresponding to the NetFlow template flow in the specific example is as follows Figure 3 As shown, FlowSet ID (corresponding to the first field) = 0 indicates that it is a template flow. Length (corresponding to the second field) is used to indicate the length of the entire FlowSet, specifically including the FlowSet ID, Length and the length of all Template fields. TemplateID (corresponding to the third field) is used to identify the template, wherein each newly generated template will generate a unique TemplateID, with optional values ​​of 256 to 65535. Field Count (corresponding to the fourth field) is used to indicate the number of fields in this template. Field Type (corresponding to the fifth field) is used to indicate that the field type is SRv6_VPN_SID. Field Length (corresponding to the sixth field) is used to indicate the field length corresponding to the SRv6_VPN_SID type.

[0051] After introducing the format of the template message corresponding to the NetFlow template flow when the target segment identifier is SRv6 SID or SRv6 VPN SID, the format of the data message corresponding to the NetFlow data flow in the present application when the target segment identifier is SRv6 SID or SRv6VPN SID will be introduced below. Among them, the message format corresponding to the NetFlow data flow includes at least the seventh field for representing the data ID, the eighth field for representing the NetFlow data flow length, and the ninth field for representing the field content.

[0052] In a specific example, when the target segment identifier is an SRv6 SID, based on the above Table 1, the message format of the NetFlow data flow published in the embodiment of the present application is as follows: Figure 4 As shown, FlowSet ID (corresponding to the seventh field) is used to correspond to the Template ID in a template flow to indicate the template flow corresponding to the data flow. Length (corresponding to the eighth field above) is used for the length of the entire FlowSet, specifically including the FlowSet ID, Length and the length of all flow record contents. SRv6_SID_1 (corresponding to the ninth field) is used to identify the specific field content carried.

[0053] In a specific example, when the target segment identifier is an SRv6 VPN SID, based on the above Table 2, the message format of the NetFlow data flow published in the embodiment of the present application is as follows: Figure 5 As shown, FlowSet ID (corresponding to the seventh field) is used to correspond to a Template ID to identify the template flow corresponding to the data flow. Length (corresponding to the eighth field) is used to indicate the length of the entire FlowSet, which specifically includes the FlowSet ID, Length, and the length of all flow record contents. SRv6_VPN_SID (corresponding to the ninth field) is used to indicate the value of End.DT4 SID, End.DT6SID, or End.DT6 SID extracted by the collector from the SRv6 message.

[0054] In an optional implementation manner of the embodiment of the present application, the method for determining whether the IPv6 message includes the target segment identifier involved in the above step 102 may further include:

[0055] Step 11, determine whether the lower layer header type in the IPv6 message is SRH;

[0056] Step 12: When the type of the next header is SRH, parse the SRH to determine whether the SRH includes a target segment identifier.

[0057] Based on the above steps 11 and 12, further, in the case where the target segment identifier is an SRv6 SID and the NetFlow template flow includes an N-layer SRv6 SID, the method of filling the target segment identifier into the field in the NetFlow data flow involved in the above step 103 may further include:

[0058] Step 21, when the number of the parsed SRv6 SIDs is greater than or equal to N, fill the first N parsed SRv6 SIDs into N fields in the NetFlow data flow;

[0059] Step 22: When the number of parsed SRv6 SIDs is less than N, after the parsed SRv6 SIDs are filled into the NetFlow data flow, unfilled fields are filled with 0; wherein the value of N is a positive integer.

[0060] It can be seen that in the embodiment of the present application, it is defined that the SID list of the SRv6 message is included in the NetFlow message template and the NetFlow data flow, so that the subsequent second device can obtain the SRv6 SID list and analyze it to complete network and security monitoring, network planning, traffic analysis and IP statistics of the SRv6 network.

[0061] In combination with the above steps 11 and 12, and steps 21 and 22, the method of the above steps 101 to 103 in the specific example may further include:

[0062] Step 201: When the first device (equivalent to the detector) is configured with NetFlow to publish N-layer SRv6 SID, the first device will publish a template flow containing N-layer SRv6 SID information.

[0063] Step 202, when the first device receives / sends an IPv6 message, it determines whether the Next Header (lower layer header type) is an SRH extension header. If so, the SRH header is parsed to obtain the SID list and fill the NetFlow data flow. If the number of SIDs parsed in the message is greater than N, only the first N SIDs are filled according to the definition. If the number of SIDs parsed in the message is less than N, after the SIDs are filled according to the definition, the excess ones are filled with 0.

[0064] Step 203: When the second device (equivalent to the collector) receives the NetFlow template flow, it parses the template flow and stores the template information.

[0065] Step 204: When the second device receives the NetFlow data flow, it determines the template information corresponding to the data flow by comparing the FlowSet ID in the data flow with the Template ID in the template flow, and parses the data flow according to the template information.

[0066] From the above steps 201 to 204, it is defined that the SID list of the SRv6 message is included in the NetFlow message template and the data flow. Since each SRv6 SID is a complete IPv6 address, if the SRv6 SID is also added to the statistical information, not only can the forwarding path of the message be drawn through the SRv6 SID, but also the different SID types contained in the SRv6 SID can be analyzed, and their meanings can be analyzed to perform security monitoring of the network. That is to say, after the second device receives the NetFlow template flow and the NetFlow data flow, it can obtain the SRv6 SID list and analyze it to complete network and security monitoring, network planning, traffic analysis and IP statistics of the SRv6 network.

[0067] Based on the above steps 11 and 12, further, when the target segment identifier is an SRv6 VPN SID, the method of filling the target segment identifier into the field in the NetFlow data flow involved in step 103 in the embodiment of the present application may further include:

[0068] Step 31, fill the SRv6 VPN SID into the field in the NetFlow data flow.

[0069] It can be seen that in the embodiment of the present application, it is defined that the VPN SID in the SID list of the SRv6 message is included in the NetFlow message template and data flow, so that the subsequent second device can obtain the SRv6 SID list and analyze it to complete network and security monitoring, network planning, traffic analysis and IP statistics of the SRv6 network.

[0070] In combination with the above steps 11 and 12, and step 31, the method of the above steps 101 to 103 in the specific example may further include:

[0071] Step 301: The first device sends a template flow including SRv6_VPN_SID to a detector.

[0072] Step 302: When the first device receives / sends an IPv6 message, it processes the message.

[0073] Specifically, first determine whether the Next Header (lower layer header type) of the IPv6 message is an SRH extension header, if so, parse the SRH header. Then determine whether the SRH header contains a VPN SID, if so, obtain the VPN SID value and fill it in the NetFlow data flow SRv6_VPN_SID field.

[0074] Step 303: When the second device receives the NetFlow template flow, it parses the template flow and stores the template TemplateID and information.

[0075] Step 304: When the second device receives the NetFlow data flow, it determines the template information corresponding to the data flow by comparing the FlowSet ID in the data flow with the Template ID in the template flow, and parses the SRv6_VPN_SID field in the data flow according to the template information.

[0076] From the above steps 301 to 304, it is defined that the VPN SID of the SRv6 message is included in the NetFlow message template and data flow. Therefore, after the second device receives the NetFlow template flow and the NetFlow data flow, it can obtain the SRv6 VPNSID list and analyze it, and can perform statistical analysis on the message according to VPN.

[0077] Corresponding to the above Figure 1 , the embodiment of the present application also provides a method for processing NetFlow data, which is applied to a second device, such as Figure 6 As shown, the steps of the method include:

[0078] Step 601, parsing the NetFlow template flow sent by the first device and saving the parsing result, wherein the parsing result includes the template ID and template information;

[0079] Step 602, comparing the data ID in the NetFlow data flow sent by the first device with the template ID to determine the NetFlow template flow corresponding to the NetFlow data flow;

[0080] Step 603: parse the NetFlow data flow based on the template information to obtain a target segment identifier.

[0081] It can be seen that in the embodiment of the present application, the NetFlow template flow and the NetFlow data flow received by the second device include a target segment identifier. If the target segment identifier is SRv6 SID or SRv6VPN SID), the second device can obtain the SRv6 SID or SRv6 VPN SID after receiving the NetFlow template flow and the NetFlow data flow, and can complete network and security monitoring, network planning, traffic analysis and IP statistics of the SRv6 network, and can perform statistical analysis on the messages according to VPN.

[0082] The present application is explained below in conjunction with specific embodiments of the present application.

[0083] Example 1

[0084] In this embodiment, NetFlow related configuration information can be sent to the collector according to business needs through the network control plane or centralized SDN controller, network management system, etc. Figure 7 As shown in the figure, PE1 and P2 devices in the network act as collectors, and the controller is a detector and reporting system. Based on this, the locators of each node are as follows:

[0085] PE1 A:1::

[0086] P1 A:2::

[0087] P2 A:3::

[0088] PE2 A:4::

[0089] The path information of the SRv6 Policy between the user's CE1->CE2 nodes is arranged as a Segment list:<A:1::11End.X,A:2::11End.X,A:3::11End.X,A:4::100End.DT4 VPN SID> .

[0090] It should be noted that PE represents a high-end router, P represents an edge router, and CE represents a user.

[0091] If NetFlow reporting is configured on PE1 and P2, the template flows and data flows sent by PE1 and P2 are as follows: Figure 8 Based on this, taking PE1 as an example, the specific process steps include:

[0092] Step 701: PE1 publishes a template flow according to the NetFlow configuration. The template contains information about five SRv6 SIDs.

[0093] Step 702: PE1 guides CE1's traffic into the SRv6 Policy tunnel bearer, performs statistical sampling, and encapsulates the SRv6 SID information in the NetFlow data stream according to the SRH header information of the message. Since there are only four SRv6 SIDs in the message, the fifth SRv6 SID information is encapsulated as 0 and sent to the controller.

[0094] Step 703: The controller receives the NetFlow template flow published by PE1 and records the template format and Template ID.

[0095] Step 704: The controller receives the NetFlow data flow published by PE1, compares the FlowSet with the Template ID, determines the template format corresponding to the data flow, and parses and analyzes the message.

[0096] It can be seen that this embodiment defines that the SID list of the SRv6 message is included in the NetFlow message template and data flow, so that the controller can obtain and analyze the SRv6 SID list to complete network and security monitoring, network planning, traffic analysis and IP statistics of the SRv6 network.

[0097] Example 2

[0098] like Figure 7 The network physical topology shown in the figure, where the node locators are as follows:

[0099] PE1 A:1::

[0100] P1 A:2::

[0101] P2 A:3::

[0102] PE2 A:4::

[0103] The path information of the SRv6 Policy between the user's CE1->CE2 nodes is arranged as a Segment list:<A:1::11End.X,A:2::11End.X,A:3::11End.X,A:4::100End.DT4 VPN SID> .

[0104] If NetFlow reporting is configured on PE1 and P2, the template flows and data flows sent by PE1 and P2 are as follows: Fig. 9 The NetFlow template flow and data flow shown in the figure, based on this, take PE1 as an example, the specific process steps include:

[0105] Step 801: PE1 publishes a template flow according to NetFlow configuration, where the template contains SRv6_VPN_SID information.

[0106] In step 802, PE1 directs CE1's traffic into the SRv6 Policy tunnel bearer according to VPN, collects statistics and samples, finds A:4::100End.DT4 VPN SID in the SRH header information of the message, encapsulates A:4::100 in the SRv6_VPN_SID field in the NetFlow data flow, and sends it to the controller.

[0107] Step 803: The controller receives the NetFlow template flow published by PE1 and records the template format and Template ID.

[0108] Step 804: The controller receives the NetFlow data flow published by PE1, compares the FlowSet ID with the Template ID, determines the template format corresponding to the data flow, parses the data flow message, and obtains the SRv6_VPN_SID value as A:4::100.

[0109] It can be seen that in this specific embodiment, it is defined that the VPN SID in the SID list of the SRv6 message is included in the NetFlow message template and data flow, so that the controller can obtain the VPN SID and analyze it, complete the network and security monitoring, network planning, traffic analysis and IP statistics of the SRv6 network, and perform statistical analysis on the message according to VPN.

[0110] See also Fig.10 , Fig.10 is a schematic diagram of the structure of a device provided by an embodiment of the present invention, such as Fig.10 As shown, the first device includes:

[0111] A configuration module 1002 is used to configure a NetFlow template flow and a NetFlow data flow, wherein both the NetFlow template flow and the NetFlow data flow include a field for representing a target segment identifier, and the target segment identifier is used to represent a segment identifier SID associated with a segment routing SRv6 based on an IPv6 forwarding plane;

[0112] A first determination module 1004 is used to determine whether the IPv6 message includes a target segment identifier when the first device transmits the IPv6 message;

[0113] The processing module 1006 is used to fill the target segment identifier into a field in the NetFlow data flow when the IPv6 message includes the target segment identifier, and send the NetFlow template flow and the NetFlow data flow filled with the target segment identifier to the second device.

[0114] Optionally, the first determination module of the embodiment of the present application may further include: a judgment unit, used to determine whether the lower layer header type in the IPv6 message is a segment routing extension header SRH; a parsing unit, used to parse the SRH when the lower layer header type is SRH, to determine whether the SRH includes a target segment identifier.

[0115] Optionally, when the target segment identifier is an SRv6 SID and the NetFlow template flow includes N layers of SRv6 SIDs, the processing module 1006 may further include: a first filling unit, used to fill the first N parsed SRv6 SIDs into N fields in the NetFlow data flow when the number of parsed SRv6 SIDs is greater than or equal to N; a second filling unit, used to fill the parsed SRv6 SIDs into the NetFlow data flow when the number of parsed SRv6 SIDs is less than N, and then fill the unfilled fields with 0; wherein the value of N is a positive integer.

[0116] Optionally, when the target segment identifier is an SRv6 VPN SID, the processing module 1006 may further include: a third filling unit, configured to fill the SRv6 VPN SID into a field in the NetFlow data flow.

[0117] Optionally, the message format corresponding to the NetFlow template flow includes at least a first field for indicating whether it is a template flow, a second field for indicating the length of the NetFlow template flow, a third field for indicating the template ID, a fourth field for indicating the number of fields in the NetFlow template flow, a fifth field for indicating the field type, and a sixth field for indicating the length of the field type.

[0118] Optionally, the message format corresponding to the NetFlow data flow includes at least a seventh field for representing a data ID, an eighth field for representing a length of the NetFlow data flow, and a ninth field for representing field content.

[0119] It should be noted that the first device provided in the embodiment of the present invention is capable of executing the above Figure 1 For the apparatus of the method for processing NetFlow data in the implementation manner, all implementation methods in the above-mentioned method for processing NetFlow data are applicable to the first device, and can achieve the same or similar beneficial effects.

[0120] For details, see Fig.11 As shown, an embodiment of the present invention further provides an electronic device, including a bus 1101 , a transceiver 1102 , an antenna 1103 , a bus interface 1104 , a processor 1105 and a memory 1106 .

[0121] The processor 1105 is configured to configure a NetFlow template flow and a NetFlow data flow, wherein both the NetFlow template flow and the NetFlow data flow include a field for representing a target segment identifier, the target segment identifier is used to represent a segment identifier SID associated with a segment routing SRv6 based on an IPv6 forwarding plane, and when the first device transmits an IPv6 message, determine whether the IPv6 message includes the target segment identifier, and when the IPv6 message includes the target segment identifier, fill the target segment identifier into the field in the NetFlow data flow;

[0122] The transceiver 1102 is configured to send the NetFlow template flow and the NetFlow data flow filled with the target segment identifier to the second device.

[0123] Optionally, the embodiment of the present application Fig.11 The electronic devices in the Figure 1 The other method steps in the method have similar functions and will not be described in detail here.

[0124] exist Fig.11 In the embodiment, the bus architecture (represented by bus 1101) may include any number of interconnected buses and bridges, and bus 1101 links various circuits including one or more processors represented by processor 1105 and memory represented by memory 1106. Bus 1101 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 1104 provides an interface between bus 1101 and transceiver 1102. Transceiver 1102 may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. Data processed by processor 1105 is transmitted on a wireless medium via antenna 1103, and further, antenna 1103 also receives data and transmits the data to processor 1105.

[0125] The processor 1105 is responsible for managing the bus 1101 and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 1106 can be used to store data used by the processor 1105 when performing operations.

[0126] Optionally, the processor 1105 may be a CPU, an ASIC, an FPGA or a CPLD.

[0127] It should be noted that the electronic device provided in the embodiment of the present invention is capable of executing the above Figure 1 For the device of the method for processing NetFlow data in the implementation manner, all implementation methods in the above-mentioned method for processing NetFlow data are applicable to the electronic device and can achieve the same or similar beneficial effects.

[0128] See also Fig.12 , Fig.12 is a schematic diagram of the structure of a device provided by an embodiment of the present invention, such as Fig.12 As shown, the second device includes:

[0129] The first parsing module 1202 is used to parse the NetFlow template flow sent by the first device and save the parsing result, wherein the parsing result includes the template ID and template information;

[0130] A comparison module 1204 is used to compare the data ID in the NetFlow data flow sent by the first device with the template ID to determine the NetFlow template flow corresponding to the NetFlow data flow;

[0131] The second parsing module 1206 is used to parse the NetFlow data flow based on the template information to obtain a target segment identifier.

[0132] It should be noted that the second device provided in the embodiment of the present invention is capable of executing the above Figure 6 For the apparatus of the method for processing NetFlow data in the implementation manner, all implementation methods in the above-mentioned method for processing NetFlow data are applicable to the second device, and can achieve the same or similar beneficial effects.

[0133] For details, see Fig.13 As shown, an embodiment of the present invention further provides an electronic device, including a bus 1301 , a transceiver 1302 , an antenna 1303 , a bus interface 1304 , a processor 1305 and a memory 1306 .

[0134] The transceiver 1302 is configured to receive the NetFlow template flow and the NetFlow data flow sent by the first device;

[0135] Processor 1305 is used to parse the NetFlow template flow sent by the first device and save the parsing result, and compare the data ID in the NetFlow data flow sent by the first device with the template ID to determine the NetFlow template flow corresponding to the NetFlow data flow, and parse the NetFlow data flow based on the template information to obtain a target segment identifier; wherein the parsing result includes the template ID and the template information.

[0136] exist Fig.13 In the embodiment, the bus architecture (represented by bus 1301) may include any number of interconnected buses and bridges, and bus 1301 links various circuits including one or more processors represented by processor 1305 and memory represented by memory 1306. Bus 1301 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 1304 provides an interface between bus 1301 and transceiver 1302. Transceiver 1302 may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. Data processed by processor 1305 is transmitted on a wireless medium via antenna 1303, and further, antenna 1303 also receives data and transmits the data to processor 1305.

[0137] The processor 1305 is responsible for managing the bus 1301 and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 1306 can be used to store data used by the processor 1305 when performing operations.

[0138] Optionally, the processor 1305 may be a CPU, an ASIC, an FPGA or a CPLD.

[0139] The embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program is executed by the processor to implement the above Figure 1 or Figure 6 The various processes of the embodiment of the method for processing NetFlow data shown in the figure can achieve the same technical effect. To avoid repetition, they will not be described here.

[0140] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which implements the above-mentioned Figure 1 or Figure 6 The various processes of the embodiments of the method for processing NetFlow data shown in the figure can achieve the same technical effect, and are not described here to avoid repetition. Among them, the computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0141] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0142] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0143] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A method for processing NetFlow data, applied to a first device, It is characterized in that The method comprises: Configure a NetFlow template flow and a NetFlow data flow, wherein both the NetFlow template flow and the NetFlow data flow include a field for representing a target segment identifier, and the target segment identifier is used to represent a segment identifier SID associated with a segment routing SRv6 based on an IPv6 forwarding plane; In the case where the first device transmits an IPv6 message, determining whether the IPv6 message includes the target segment identifier; In the case where the IPv6 message includes the target segment identifier, the target segment identifier is filled into the field in the NetFlow data flow, and the NetFlow template flow and the NetFlow data flow filled with the target segment identifier are sent to the second device.

2. The method according to claim 1, It is characterized in that The determining whether the IPv6 message includes the target segment identifier comprises: Determine whether the lower layer header type in the IPv6 message is a segment routing extension header SRH; In a case where the lower layer header type is the SRH, the SRH is parsed to determine whether the SRH includes the target segment identifier.

3. The method according to claim 2, It is characterized in that In a case where the target segment identifier is an SRv6 SID and the NetFlow template flow includes an N-layer SRv6 SID, filling the target segment identifier into the field in the NetFlow data flow includes: When the number of the parsed SRv6 SIDs is greater than or equal to the N, filling the first N parsed SRv6 SIDs into the N fields in the NetFlow data flow; When the number of the parsed SRv6 SIDs is less than the N, after the parsed SRv6 SIDs are filled into the NetFlow data flow, the unfilled fields are filled with 0; The value of N is a positive integer.

4. The method according to claim 2, It is characterized in that In the case where the target segment identifier is an SRv6 VPN SID, filling the target segment identifier into the field in the NetFlow data flow includes: The SRv6 VPN SID is populated into the field in the NetFlow data flow.

5. The method according to claim 1, It is characterized in that The message format corresponding to the NetFlow template flow includes at least a first field for indicating whether it is a template flow, a second field for indicating the length of the NetFlow template flow, a third field for indicating the template ID, a fourth field for indicating the number of fields in the NetFlow template flow, a fifth field for indicating the field type, and a sixth field for indicating the length of the field type.

6. The method according to claim 1, It is characterized in that The message format corresponding to the NetFlow data flow includes at least a seventh field for representing a data ID, an eighth field for representing a length of the NetFlow data flow, and a ninth field for representing field content.

7. A method for processing NetFlow data, applied to a second device, It is characterized in that The method comprises: Parsing the NetFlow template flow sent by the first device and saving the parsing result, wherein the parsing result includes a template ID and template information; Compare the data ID in the NetFlow data flow sent by the first device with the template ID to determine the NetFlow template flow corresponding to the NetFlow data flow; The NetFlow data flow is parsed based on the template information to obtain a target segment identifier.

8. A device, It is characterized in that include: A configuration module, configured to configure a NetFlow template flow and a NetFlow data flow, wherein both the NetFlow template flow and the NetFlow data flow include a field for representing a target segment identifier, and the target segment identifier is used to represent a segment identifier SID associated with a segment routing SRv6 based on an IPv6 forwarding plane; A first determination module, configured to determine, when the first device transmits an IPv6 message, whether the IPv6 message includes the target segment identifier; A processing module is used to fill the target segment identifier into the field in the NetFlow data flow when the IPv6 message includes the target segment identifier, and send the NetFlow template flow and the NetFlow data flow filled with the target segment identifier to the second device.

9. An electronic device, It is characterized in that Including transceiver and processor, The processor is configured to configure a NetFlow template flow and a NetFlow data flow, wherein both the NetFlow template flow and the NetFlow data flow include a field for representing a target segment identifier, the target segment identifier is used to represent a segment identifier SID associated with a segment routing SRv6 based on an IPv6 forwarding plane, and when the first device transmits an IPv6 message, determine whether the IPv6 message includes the target segment identifier, and when the IPv6 message includes the target segment identifier, fill the target segment identifier into the field in the NetFlow data flow; The transceiver is used to send the NetFlow template flow and the NetFlow data flow filled with the target segment identifier to the second device.

10. A device, It is characterized in that include: A first parsing module, configured to parse the NetFlow template flow sent by the first device and save the parsing result, wherein the parsing result includes a template ID and template information; A comparison module, configured to compare a data ID in the NetFlow data flow sent by the first device with a template ID to determine a NetFlow template flow corresponding to the NetFlow data flow; The second parsing module is used to parse the NetFlow data flow based on the template information to obtain a target segment identifier.

11. An electronic device, It is characterized in that comprising a transceiver and a processor, wherein: The transceiver is used to receive the NetFlow template flow and the NetFlow data flow sent by the first device; The processor is used to parse the NetFlow template flow sent by the first device and save the parsing result, and compare the data ID in the NetFlow data flow sent by the first device with the template ID to determine the NetFlow template flow corresponding to the NetFlow data flow, and parse the NetFlow data flow based on the template information to obtain a target segment identifier; wherein the parsing result includes the template ID and the template information.

12. An electronic device, It is characterized in that include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the program implements the steps of the method for processing NetFlow data as described in any one of claims 1 to 6, or implements the steps of the method for processing NetFlow data as described in claim 7.

13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for processing NetFlow data according to any one of claims 1 to 6 are implemented, or the steps of the method for processing NetFlow data according to claim 7 are implemented.

Citation Information

Patent Citations

  • Message processing method and device, equipment and storage medium

    CN113411834A

  • Traffic hijacking point detection method and device, electronic equipment and storage medium

    CN113923040A

  • Message processing method, node and computer readable storage medium

    CN114650256A

  • In-band direct mode performance loss measurement in software defined networks

    US20190280927A1