CN111865787B - Traffic statistics method, network equipment and storage medium - Google Patents

Traffic statistics method, network equipment and storage medium Download PDF

Info

Publication number
CN111865787B
CN111865787B CN202010612744.4A CN202010612744A CN111865787B CN 111865787 B CN111865787 B CN 111865787B CN 202010612744 A CN202010612744 A CN 202010612744A CN 111865787 B CN111865787 B CN 111865787B
Authority
CN
China
Prior art keywords
policy
target
destination node
key data
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010612744.4A
Other languages
Chinese (zh)
Other versions
CN111865787A (en
Inventor
郭威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN202010612744.4A priority Critical patent/CN111865787B/en
Publication of CN111865787A publication Critical patent/CN111865787A/en
Application granted granted Critical
Publication of CN111865787B publication Critical patent/CN111865787B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/34Source routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/38Flow based routing

Abstract

The specification provides a traffic statistics method, a network device and a storage medium, wherein the method comprises the following steps: when the SR-TE Policy route corresponding to the destination node is determined to oscillate, first key data for carrying out flow statistics on the destination node is stored in a target data storage area of the equipment, and when the SR-TE Policy route corresponding to the destination node is determined to stop oscillating, the flow statistics on the flow reaching the destination node is carried out according to the first key data recorded in the target data storage area. By the method, the condition of inaccurate flow statistics caused by unstable SR-TE Policy route obtained dynamically can be avoided.

Description

Traffic statistics method, network equipment and storage medium
Technical Field
The disclosure relates to the field of communication technologies, and in particular, to a traffic statistics method, a network device, and a storage medium.
Background
SR-TE Policy (Segment Routing Policy ) provides a flexible forwarding path selection method, meeting different forwarding demands of users. When a plurality of paths exist between a source node and a destination node of the Segment Routing network, the SR-TE Policy is reasonably utilized to select a forwarding path, so that an administrator can conveniently manage and plan the network, and the forwarding pressure of network equipment can be effectively reduced.
One SR-TE Policy is identified by three parts:
BSID: the SID of the ingress node.
Color: the Color attribute of the forwarding path is used to distinguish multiple SR-TE policies between the same source and destination nodes.
End-point: the SR-TE Policy destination node can be identified by an IP address.
The SR-TE Policy route can be divided into two types, one is the SR-TE Policy route of static configuration, the other is the SR-TE Policy route of dynamic acquisition, and the SR-TE Policy route of dynamic acquisition is compared with SRPOLICY of local configuration, so that the SR-TE Policy route is not so stable, and the aspect of the statistical function is particularly obvious.
Disclosure of Invention
In order to solve the technical problems in the prior art, the specification provides a traffic statistics method, a network device and a storage medium, which can avoid the occurrence of inaccurate traffic statistics caused by unstable SR-TE Policy route obtained dynamically.
The embodiment of the specification provides a traffic statistics method, which is applied to a segment routing Policy SR-TE Policy network, and comprises the following steps:
when the SR-TE Policy route corresponding to the destination node is determined to oscillate, storing first key data for carrying out flow statistics on the destination node in a target data storage area of the equipment;
and when the SR-TE Policy route which reaches the destination node is determined to stop oscillating, carrying out flow statistics on the flow which reaches the destination node according to the first key data recorded in the target data storage area.
Optionally, the method for determining that the SR-TE Policy route corresponding to the destination node oscillates includes:
if the neighbor relation of the SR-TE Policy route is monitored to oscillate, the SR-TE Policy route can be considered to oscillate.
Optionally, selecting a target storage block from the data storage area of the device, setting a Policy identifier for the target storage block, and taking the target storage block with the Policy identifier as a target data storage area;
the storing the first key data for traffic statistics for the destination node in a target data storage area of the device specifically includes:
and storing the first key data in a target storage block with a Policy identifier in the device.
Optionally, after storing first key data for traffic statistics of the destination node in a target data storage area of the device, traffic statistics is performed for the destination node, and a result of the traffic statistics is used as temporary statistics data;
the flow statistics for the flow reaching the destination node according to the first key data recorded in the target data storage area specifically includes:
when the SR-TE Policy route corresponding to the destination node is determined to stop oscillating, obtaining second key data for carrying out traffic statistics again aiming at the destination node;
and accumulating the temporary statistical data to flow statistics according to second key data statistics according to whether the matching value of the second key data and the first key data reaches a preset matching value or not, and if the matching value reaches the preset matching value.
Optionally, the first key data and the second key data include: attribute information of SR-TE Policy.
According to the embodiment, when the SR-TE Policy route is oscillated, the first key data for carrying out flow statistics on the target node can be stored in the target data storage area of the device, so that the flow reaching the target node can be counted according to the first key data recorded in the storage area, temporary statistical data are formed, and when the fact that the SR-TE Policy route corresponding to the target node stops oscillating is determined, the flow reaching the target node can be counted according to the temporary statistical data.
The embodiment of the specification also provides a network device, which is applied to a segment routing Policy SR-TE Policy network, and comprises:
the judging module is used for judging whether the SR-TE Policy route corresponding to the destination node is oscillated or not;
the first processing module is used for storing first key data for carrying out flow statistics on a target node in a target data storage area of equipment when the judging module determines that the SR-TE Policy route corresponding to the target node is oscillated;
and the first processing module is used for carrying out flow statistics on the flow reaching the target node according to the first key data recorded in the target data storage area when the judging module determines that the SR-TE Policy route corresponding to the target node stops oscillating.
Optionally, the judging module is further configured to, when it is monitored that the neighbor relation of the SR-TE Policy route oscillates, consider that the SR-TE Policy route oscillates.
Optionally, selecting a target storage block from the data storage area of the device, setting a Policy identifier for the target storage block, and taking the target storage block with the Policy identifier as a target data storage area;
the first processing module is further configured to store the first key data in a target storage block with a Policy identifier in the device.
The embodiment of the specification also provides a network device, which is applied to a segment routing Policy SR-TE Policy network, and comprises: a processor and a machine-readable storage medium;
the machine-readable storage medium stores machine-executable instructions executable by the processor to cause the processor to: the method steps in the above embodiments are implemented.
The present description embodiments also provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: the method steps in the above embodiments are implemented.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and together with the description, serve to explain the principles of the specification.
Fig. 1 is a flow chart of a flow statistics method provided in an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present description as detailed in the accompanying claims.
The terminology used in the description presented herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
At present, the SR-TE Policy route issued by BGP is less stable compared with the SR-TE Policy route configured locally, and the statistical function is particularly obvious. Srpolicy consists of several parts, one is Srpolicy itself, down is a segment list, down is an out interface, the three layers are counted sequentially, one Srpolicy consists of a plurality of segments, the sum of the data statistics of all segments is the sum of the statistics of srpolics, the segment list consists of a plurality of out directions, and the sum of the statistics of the out directions is finally the sum of the statistics of the corresponding segment list.
In principle, the data of the statistical function will be emptied due to the change of some necessary parameters, such as the whole srnolicy, the deletion of the whole srnolicy structure or the change of the most critical parameters such as color; the overall segment is considered to change due to the change of the attribute of the outgoing direction index, and the previous data is emptied without reference value; the outgoing direction is cleared because the outgoing interface changes and no longer has a record meaning because of the key information of the outgoing, such as the address, thereby leading to statistical errors of the flow.
As shown in fig. 1, to solve the above technical problem, an embodiment of the present disclosure provides a traffic statistics method, where the method is applied to a segment routing Policy SR-TE Policy network, and the method includes:
s1, when the SR-TE Policy route corresponding to a destination node is determined to oscillate, storing first key data for carrying out flow statistics on the destination node in a target data storage area of equipment;
s2, when the SR-TE Policy route corresponding to the destination node is determined to stop oscillating, carrying out flow statistics on the flow reaching the destination node according to the first key data recorded in the target data storage area.
The embodiment can be used for node equipment in an SR-TE Policy network, in step S1, the node equipment can monitor whether the neighbor relation of the SR-TE Policy route reaching a target node oscillates or not through a network monitoring protocol, and if the neighbor relation oscillates, the SR-TE Policy route can be considered to oscillate.
At this time, the node device may obtain SR-TE Policy routing attribute information for the destination node, where in general, the node device may perform traffic monitoring according to the SR-TE Policy routing attribute information, for example: the SR-TE Policy routing attribute information comprises: name, color, end-point, BSID, etc., and a SID List of the Segment List (the SID List is a List containing message forwarding path information, and the SID in the SID List is a SID from each node to the next hop on the forwarding path.
Before executing step S1, the node device may further divide a plurality of storage modules from its own storage modules to store the first critical data, specifically, select a target storage block from the data storage area, add a specified identifier (the specified identifier is used as a policy identifier) to the target storage block, and use the target storage block with the specified identifier set as a target data storage area.
After the first key data is stored, when the node equipment determines that the traffic is still sent to the destination node, the node equipment can perform traffic statistics on the traffic sent to the destination node according to the first key data in the target data storage area, and temporary statistical data is formed.
When the step S2 is executed, and when the neighbor relation of the SR-TE Policy route corresponding to the destination node is monitored to be unchanged at the moment T through the network monitoring protocol, the SR-TE Policy route corresponding to the destination node can be considered to stop oscillating.
At this time, traffic statistics may be performed on the traffic arriving at the destination node according to the first critical data recorded in the target data storage area, specifically:
and taking the destination node as an index, acquiring first key data recorded in a target data storage area, and acquiring second key data generated after the SR-TE Policy route corresponding to the destination node stops oscillating, wherein the first key data and the second key data may be the same or different at the moment. In general, if the SR-TE Policy route corresponding to the destination node stops oscillating, the SR-TE Policy route used is the same as the route before the oscillating, and the first critical data is the same as the second critical data; otherwise, if the routes are different, the first critical data and the second critical data are different.
In this embodiment, after the first key data and the second key data are obtained according to the destination node, whether the first key data and the second key data are matched or not may be determined, where the first key data may be SR-TE Policy routing attribute information including: name, color, end-point, BSID and other SR-TEPolicy attribute information, and a SID List of a Segment List, and outputting interface information such as any one attribute or combination of multiple attributes in the interface address, the interface name and other routing information. When matching is performed, whether the corresponding attribute values are the same or not can be judged, if so, matching is performed, and if not, matching is performed.
When the first key data is matched with the second key data, the temporary statistical data is accumulated to traffic statistics according to the second key data, so that traffic statistics for the same destination node are ensured not to be interrupted.
When the first key data and the second key data are not matched, the power saving device may send traffic to the destination node through the newly established route (standby route) because the source route reaching the destination node is not available, at this time, part of the attributes in the second key data and part of the attributes in the first data, such as End-point attributes and/or Color attributes, may be matched, if part of the attributes are matched, the traffic is considered as traffic for the same destination node, at this time, temporary statistics data may be accumulated to traffic statistics according to statistics of the second key data, so as to ensure that traffic statistics for the same destination node are not interrupted.
Based on the same ideas as described above, the present specification also provides a network device, which may be a router, a switch, a server, and of course also a virtual router, a switch, etc. running in the server.
The network device is applied to a segment routing Policy SR-TE Policy network, and comprises:
the judging module is used for judging whether the SR-TE Policy route corresponding to the destination node is oscillated or not;
the first processing module is used for storing first key data for carrying out flow statistics on a target node in a target data storage area of equipment when the judging module determines that the SR-TE Policy route corresponding to the target node is oscillated;
and the first processing module is used for carrying out flow statistics on the flow reaching the target node according to the first key data recorded in the target data storage area when the judging module determines that the SR-TE Policy route corresponding to the target node stops oscillating.
Optionally, the judging module is further configured to, when it is monitored that the neighbor relation of the SR-TE Policy route oscillates, consider that the SR-TE Policy route oscillates.
Optionally, selecting a target storage block from the data storage area of the device, setting a Policy identifier for the target storage block, and taking the target storage block with the Policy identifier as a target data storage area;
the first processing module is further configured to store the first key data in a target storage block with a Policy identifier in the device.
The present specification also provides a network device applied to a segment routing policy SR-TEPolicy network, the network device comprising: a processor and a machine-readable storage medium;
the machine-readable storage medium stores machine-executable instructions executable by the processor to cause the processor to: the method steps in the above embodiments are implemented.
The present specification also provides a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: the method steps in the above embodiments are implemented.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Other embodiments of the present description will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.
It is to be understood that the present description is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
The foregoing description of the preferred embodiments is provided for the purpose of illustration only, and is not intended to limit the scope of the disclosure, since any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the disclosure are intended to be included within the scope of the disclosure.

Claims (8)

1. A method for traffic statistics, wherein the method is applied to a segment routing Policy SR-TE Policy network, the method comprising:
when the SR-TE Policy route corresponding to the destination node is determined to oscillate, storing first key data for carrying out flow statistics on the destination node in a target data storage area of the equipment;
when the SR-TE Policy route corresponding to the destination node is determined to stop oscillating, carrying out flow statistics on the flow reaching the destination node according to the first key data recorded in the target data storage area;
the method further comprises the steps of: after first key data for carrying out flow statistics on the target node is stored in a target data storage area of equipment, carrying out flow statistics on the target node, and taking a flow statistics result as temporary statistics data;
the flow statistics for the flow reaching the destination node according to the first key data recorded in the target data storage area specifically includes:
when the SR-TE Policy route corresponding to the destination node is determined to stop oscillating, obtaining second key data for carrying out traffic statistics again aiming at the destination node;
according to whether the matching value of the second key data and the first key data reaches a preset matching value or not, if so, accumulating the temporary statistical data into flow statistics according to second key data statistics;
wherein the first critical data and the second critical data comprise: routing attribute information for SR-TE Policy.
2. The method of claim 1 wherein the method for determining that the SR-TE Policy route corresponding to the destination node oscillates comprises:
if the neighbor relation of the SR-TE Policy route is monitored to oscillate, the SR-TE Policy route can be considered to oscillate.
3. The method according to claim 1, wherein a target memory block is selected from a data memory area of the device, a Policy identifier is set for the target memory block, and the target memory block with the Policy identifier set is used as a target data memory area;
the storing the first key data for traffic statistics for the destination node in a target data storage area of the device specifically includes:
and storing the first key data in a target storage block with a Policy identifier in the device.
4. A network device for use in a segment routing Policy, SR-TE Policy, network, the network device comprising:
the judging module is used for judging whether the SR-TE Policy route corresponding to the destination node is oscillated or not;
the first processing module is used for storing first key data for carrying out flow statistics on a target node in a target data storage area of equipment when the judging module determines that the SR-TE Policy route corresponding to the target node is oscillated;
the first processing module is used for carrying out flow statistics on the flow reaching the target node according to the first key data recorded in the target data storage area when the judging module determines that the SR-TE Policy route corresponding to the target node stops oscillating;
the first processing module is specifically configured to store first key data for traffic statistics for the destination node in a target data storage area of the device, perform traffic statistics for the destination node, and use a result of the traffic statistics as temporary statistical data;
when the SR-TE Policy route corresponding to the destination node is determined to stop oscillating, obtaining second key data for carrying out traffic statistics again aiming at the destination node;
according to whether the matching value of the second key data and the first key data reaches a preset matching value or not, if so, accumulating the temporary statistical data into flow statistics according to second key data statistics;
wherein the first critical data and the second critical data comprise: routing attribute information for SR-TE Policy.
5. The network device of claim 4, wherein the network device,
the judging module is further configured to, when it is monitored that the neighbor relation of the SR-TE Policy route oscillates, consider that the SR-TE Policy route oscillates.
6. The network device according to claim 4, wherein a target storage block is selected from a data storage area of the device, a Policy identifier is set for the target storage block, and the target storage block with the Policy identifier set is used as a target data storage area;
the first processing module is further configured to store the first key data in a target storage block with a Policy identifier in the device.
7. A network device for use in a segment routing Policy, SR-TE Policy, network, the network device comprising: a processor and a machine-readable storage medium;
the machine-readable storage medium stores machine-executable instructions executable by the processor to cause the processor to: method steps of any of claims 1-4 are achieved.
8. A machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: method steps of any of claims 1-4 are achieved.
CN202010612744.4A 2020-06-30 2020-06-30 Traffic statistics method, network equipment and storage medium Active CN111865787B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010612744.4A CN111865787B (en) 2020-06-30 2020-06-30 Traffic statistics method, network equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010612744.4A CN111865787B (en) 2020-06-30 2020-06-30 Traffic statistics method, network equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111865787A CN111865787A (en) 2020-10-30
CN111865787B true CN111865787B (en) 2023-10-24

Family

ID=72989720

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010612744.4A Active CN111865787B (en) 2020-06-30 2020-06-30 Traffic statistics method, network equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111865787B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112804145B (en) * 2020-12-31 2022-06-21 锐捷网络股份有限公司 Flow statistical method and device based on segmented identification list
CN112910777B (en) * 2021-01-28 2022-09-02 北京华三通信技术有限公司 Message processing method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105049350A (en) * 2014-04-17 2015-11-11 思科技术公司 Segment routing - egress peer engineering (SP-EPE)
CN105591908A (en) * 2015-09-17 2016-05-18 杭州华三通信技术有限公司 Route distribution method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10454821B2 (en) * 2016-10-14 2019-10-22 Cisco Technology, Inc. Creating and maintaining segment routed traffic engineering policies via border gateway protocol
US20190238449A1 (en) * 2017-01-31 2019-08-01 The Mode Group High performance software-defined core network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105049350A (en) * 2014-04-17 2015-11-11 思科技术公司 Segment routing - egress peer engineering (SP-EPE)
CN105591908A (en) * 2015-09-17 2016-05-18 杭州华三通信技术有限公司 Route distribution method and device

Also Published As

Publication number Publication date
CN111865787A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
US11108677B2 (en) Methods and apparatus for configuring a standby WAN link in an adaptive private network
US5732072A (en) Method for adaptive routing in a communication network
US8611232B2 (en) Method of simple and efficient failure resilient load balancing
US8179786B2 (en) Dynamic traffic rearrangement and restoration for MPLS networks with differentiated services capabilities
US6594268B1 (en) Adaptive routing system and method for QOS packet networks
US7420989B2 (en) Technique for identifying backup path for shared mesh protection
ES2689913T3 (en) Identification of routes taken through a network of interconnected devices
US20030202479A1 (en) Method and system for data in a collection and route discovery communication network
US8018941B2 (en) Demand-based distribution of internet protocol routing information across a network
US20040006640A1 (en) Notification to routing protocols of changes to routing information base
EP1980063B1 (en) Method of operating a network
US20090016356A1 (en) Method of operating a network
CN111865787B (en) Traffic statistics method, network equipment and storage medium
KR20120055955A (en) Open flow network system and method of controlling the same
CN108768796B (en) Link fault detection method and device
CN112104478B (en) Link switching method, device, equipment and machine readable storage medium
US20210234797A1 (en) Method, device, and system for determining route leak
GB2527273A (en) Executing loops
GB2514675A (en) Querying a traffic forwarding table
US10862805B1 (en) Intelligent offloading of services for a network device
EP2903347A1 (en) Network, network node, distribution method, and network node program
US7792936B2 (en) Method and apparatus for virtualizing network resources
CN112637077B (en) Dynamic route configuration method and device
US20050286412A1 (en) Transient notification system
CN107347034B (en) Link information processing method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant