(19)
(11)EP 3 429 126 B1

(12)EUROPEAN PATENT SPECIFICATION

(45)Mention of the grant of the patent:
27.07.2022 Bulletin 2022/30

(21)Application number: 17773059.5

(22)Date of filing:  16.03.2017
(51)International Patent Classification (IPC): 
H04L 43/026(2022.01)
(52)Cooperative Patent Classification (CPC):
H04L 43/026
(86)International application number:
PCT/CN2017/076964
(87)International publication number:
WO 2017/167029 (05.10.2017 Gazette  2017/40)

(54)

CONTROL METHOD, DEVICE AND SYSTEM FOR TRAFFIC COUNTING

STEUERUNGSVERFAHREN, -VORRICHTUNG UND -SYSTEM ZUR VERKEHRSZÄHLUNG

PROCÉDÉ, DISPOSITIF ET SYSTÈME DE COMMANDE POUR UN COMPTAGE DE TRAFIC


(84)Designated Contracting States:
AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

(30)Priority: 29.03.2016 CN 201610185868

(43)Date of publication of application:
16.01.2019 Bulletin 2019/03

(73)Proprietor: Huawei Technologies Co., Ltd.
Longgang District Shenzhen, Guangdong 518129 (CN)

(72)Inventors:
  • ZHUANG, Shunwan
    Shenzhen Guangdong 518129 (CN)
  • ZHOU, Peng
    Shenzhen Guangdong 518129 (CN)
  • LI, Zhenbin
    Shenzhen Guangdong 518129 (CN)
  • NI, Hui
    Shenzhen Guangdong 518129 (CN)
  • WU, Nan
    Shenzhen Guangdong 518129 (CN)

(74)Representative: Gill Jennings & Every LLP 
The Broadgate Tower 20 Primrose Street
London EC2A 2ES
London EC2A 2ES (GB)


(56)References cited: : 
CN-A- 101 043 453
CN-A- 104 243 240
US-A1- 2014 325 649
US-B1- 7 254 114
CN-A- 103 685 057
CN-A- 105 871 602
US-A1- 2016 050 132
  
  • LIANG S HARES J YOU HUAWEI R RASZUK NOZOMI D MA CISCO SYSTEMS Q: "Carrying Label Information for BGP FlowSpec; draft-liang-idr-bgp-flowspec-label-02.txt" , CARRYING LABEL INFORMATION FOR BGP FLOWSPEC; DRAFT-LIANG-IDR-BGP-FLOWSPEC-LABEL-02.TXT, INTERNET ENGINEERING TASK FORCE, IETF; STANDARDWORKINGDRAFT, INTERNET SOCIETY (ISOC) 4, RUE DES FALAISES CH- 1205 GENEVA, SWITZERLAND, 21 March 2016 (2016-03-21), pages 1-9, XP015112202, [retrieved on 2016-03-21]
  • EDDY J DAILEY G CLARK MTI SYSTEMS W: "Experimental BGP Flow Specification Extensions; draft-eddy-idr-flowspec-exp-00.txt", EXPERIMENTAL BGP FLOW SPECIFICATION EXTENSIONS; DRAFT-EDDY-IDR-FLOWSPEC-EXP-00.TXT, INTERNET ENGINEERING TASK FORCE, IETF; STANDARDWORKINGDRAFT, INTERNET SOCIETY (ISOC) 4, RUE DES FALAISES CH- 1205 GENEVA, SWITZERLAND, 31 August 2015 (2015-08-31), pages 1-20, XP015107977, [retrieved on 2015-08-31]
  
Note: Within nine months from the publication of the mention of the grant of the European patent, any person may give notice to the European Patent Office of opposition to the European patent granted. Notice of opposition shall be filed in a written reasoned statement. It shall not be deemed to have been filed until the opposition fee has been paid. (Art. 99(1) European Patent Convention).


Description

TECHNICAL FIELD



[0001] The present invention relates to the field of communications technologies, and in particular, to a control method, apparatus, and system for collecting traffic statistics.

BACKGROUND



[0002] In a network, traffic statistics of a data flow between a customer (English: Customer) and an autonomous system (English: Autonomous Systems, AS for short) may be collected based on Border Gateway Protocol (English: Border Gateway Protocol, BGP for short) route propagation. A manner for collecting traffic statistics based on the BGP route propagation is also referred to as a BGP accounting (English: BGP Accounting) technology.

[0003] In the conventional BGP accounting technology, if traffic statistics of a data flow between a source AS and a destination AS need to be collected, an egress router (English: Egress Router) configured to access the destination AS may first set a specific community attribute for BGP routing information of the data flow, and then send, to an ingress router (English: Ingress Router) configured to access the source AS, the BGP routing information carrying the community attribute. After receiving the BGP routing information, the ingress router selects a specific traffic index (English: Traffic Index) based on the community attribute carried in the BGP routing information, and correspondingly saves the traffic index and the BGP routing information in a forwarding information base (English: Forwarding Information Base, FIB for short) of the ingress router. In this way, when processing a packet of the data flow, the ingress router may collect the traffic statistics of the data flow based on the traffic index corresponding to the BGP routing information in a forwarding table.

[0004] The inventor finds through research that in the conventional BGP accounting technology, for the data flow whose traffic statistics need to be collected, a skilled person needs to configure the egress router of the data flow, so that the configured egress router can set the specific community attribute in the BGP routing information corresponding to the data flow. In addition, the skilled person needs to configure the ingress router of the data flow, so that the configured ingress router can set the traffic index for the data flow based on the community attribute carried in the BGP routing information corresponding to the data flow, and collect the traffic statistics of the data flow based on the traffic index. It can be learned that, if traffic statistics of a large quantity of data flows in the network need to be collected, the skilled person needs to manually configure a large quantity of devices. As a result, the skilled person has heavy and complex configuration work.

[0005] Prior art Document D1 (US 2016/0050132 A1) discloses methods implemented in an electronic device are disclosed for dynamically collecting traffic flow in a SDN system. For each of a plurality of sets of traffic flows, the method causes a monitor to be configured to collect traffic statistics. The monitors are instructed to collect traffic statistics, and the traffic statistics are received. For each monitor, the method determines if the received traffic statistics are within a set of acceptable limits or not, wherein the set of acceptable limits includes one or more of an upper bound and a lower bound. For each of the sets of traffic flows of which the received traffic statistics were determined outside of the acceptable limits, the method causes a change of increase or decrease of collection of the traffic statistics of the traffic flows.

[0006] Prior art Document D2 (Carrying Label Information for BGP FlowSpec, XP015112202) discloses a method in which the label mapping information for a particular FlowSpec rule is piggybacked in the same Border Gateway Protocol (BGP) Update message that is used to distribute the FlowSpec rule. Based on the proposed method, the Label Switching Routers (LSRs) (except the ingress LSR) on the Label Switched Path (LSP) can use label to identify the traffic matching a particular FlowSpec rule; this facilitates monitoring and traffic statistics for FlowSpec rules.

SUMMARY



[0007] To resolve the foregoing technical problems, the present invention provides control methods, apparatus, and a system for collecting traffic statistics, so as to reduce a quantity of devices that need to be manually configured by a skilled person for implementing traffic statistics collection, thereby simplifying configuration work of the skilled person. The present invention is defined by the appended independent claims. Preferred embodiments are set out in the appended dependent claims.

[0008] According to a first aspect, the present invention provides a control method for collecting traffic statistics in accordance with appended claim 1.

[0009] According to a second aspect, the present invention provides a control method for collecting traffic statistics in accordance with appended claim 2.

[0010] According to a third aspect, the present invention provides a control node for collecting traffic statistics in accordance with appended claim 3.

[0011] Optionally, the traffic statistics collection policy is carried in a Border Gateway Protocol Flow Specification BGP FlowSpec protocol packet, network layer reachability information of the BGP FlowSpec protocol packet carries the matching identifier, and an extended community attribute of the BGP FlowSpec protocol packet carries the first command and the second command.

[0012] Optionally, the control node is further configured to:

receive statistics collection result report information sent by the forwarding node, where the statistics collection result report information carries an interface identifier of a target interface, the traffic identifier of the target data flow, and the traffic statistics collection result corresponding to the traffic identifier, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet; and

record the traffic statistics collection result corresponding to the traffic identifier as a traffic statistics collection result of the target data flow based on the statistics collection result report information.



[0013] Optionally, the statistics collection result report information is carried in a second

[0014] Border Gateway Protocol-Link State BGP-LS protocol packet.

[0015] Optionally, the control node is further configured to:

receive second interface report information sent by the forwarding node, where the second interface report information carries an interface identifier of the target interface and interface description information of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet, wherein the

second interface report information is carried in a third BGP-LS protocol packet.



[0016] According to a fourth aspect, the present invention provides a forwarding node in accordance with appended claim 8.

[0017] Optionally, the traffic statistics collection policy is carried in a BGP FlowSpec protocol packet, network layer reachability information of the BGP FlowSpec protocol packet carries the matching identifier, and an extended community attribute of the BGP FlowSpec carries the first command and the second command.

[0018] Optionally, in order to set the traffic identifier for the target data flow based on the first command and the matching identifier, the forwarding node is configured to:

search for a forwarding entry corresponding to the matching identifier, and use the forwarding entry corresponding to the matching identifier as a forwarding entry corresponding to the target data flow; and

apply, to the forwarding entry corresponding to the target data flow, the traffic identifier indicated by the first command.



[0019] Optionally, the forwarding node is further configured to:
send statistics collection result report information to the control node, where the statistics collection result report information carries an interface identifier of a target interface, the traffic identifier of the target data flow, and the traffic statistics collection result corresponding to the traffic identifier, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0020] Optionally, the forwarding node is further configured to:

send second interface report information to the control node, where the second interface report carries an interface identifier of a target interface and interface description information of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet, wherein the

second interface report information is carried in a second BGP-LS protocol packet.



[0021] According to a fifth aspect, the present invention provides a control system for collecting traffic statistics according to appended claim 13. The system includes a first network device and a second network device, the first network device is the control node in any one of implementations of the third aspect, and the second network device is the forwarding node in any one of implementations of the fourth aspect.

[0022] In comparison with the prior art, the present invention has the following advantages:
If the traffic statistics of the target data flow need to be collected, the statistics collection instruction triggered by a user operation may be sent to the control node. In response to the statistics collection instruction, the control node may generate the traffic statistics collection policy and send the traffic statistics collection policy to the forwarding node. Therefore, based on the commands carried in the traffic statistics collection policy, the forwarding node may set the traffic identifier for the target data flow and collect the traffic statistics of the target data flow into the traffic statistics collection result corresponding to the traffic identifier. It can be learned that because the control node delivers the traffic statistics collection policy to all forwarding nodes in a centralized manner, a skilled person only needs to initiate the statistics collection instruction to the control node, so that traffic statistics of a large quantity of data flows on all the forwarding nodes can be collected. Therefore, a quantity of devices that need to be manually configured by the skilled person is greatly reduced, thereby simplifying configuration work that needs to be of the skilled person.

BRIEF DESCRIPTION OF DRAWINGS



[0023] To describe the technical solutions in the embodiments of this application or in the prior art more clearly, the following briefly describes the accompanying drawings required for describing the embodiments or the prior art. Apparently, the accompanying drawings in the following description show some embodiments of this application, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.

FIG. 1 is a schematic diagram of a system framework related to an application scenario according to an embodiment of the present invention;

FIG. 2 is a flowchart of a control method for collecting traffic statistics according to an embodiment of the present invention;

FIG. 3 is a schematic diagram of an example format of interface report information according to an embodiment of the present invention;

FIG. 4 is a schematic diagram of an example format of another type of interface report information according to an embodiment of the present invention;

FIG. 5 is a schematic diagram of an example format of statistics collection result report information according to an embodiment of the present invention;

FIG. 6 is a flowchart of a control method for collecting traffic statistics according to an embodiment of the present invention;

FIG. 7 is a schematic structural diagram of a control apparatus for collecting traffic statistics according to an embodiment of the present invention;

FIG. 8 is a schematic structural diagram of a control apparatus for collecting traffic statistics according to an embodiment of the present invention;

FIG. 9 is a schematic structural diagram of a control system for collecting traffic statistics according to an embodiment of the present invention;

FIG. 10 is a schematic structural diagram of a network device according to an embodiment of the present invention; and

FIG. 11 is a schematic structural diagram of a network device according to an embodiment of the present invention.


DESCRIPTION OF EMBODIMENTS



[0024] To make a person skilled in the art understand the technical solutions in this application better, the following clearly and completely describes the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Apparently, the described embodiments are merely a part rather than all of the embodiments of this application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of this application without creative efforts shall fall within the protection scope of this application.

[0025] The inventor finds through research that for a target data flow between a source AS and a destination AS, an ingress router configured to access the source AS collects traffic statistics of the target data flow. Specifically, the ingress router has a traffic index corresponding to the target data flow, and the ingress router collects the traffic statistics of the target data flow into a traffic statistics collection result corresponding to the traffic index. In a conventional BGP accounting technology, to make the ingress router have the traffic index corresponding to the target data flow, both the ingress router and an egress router that is configured to access the destination AS need to be manually configured by a skilled person. After being manually configured by the skilled person, the egress router sets a specific community attribute in BGP routing information of the target data flow, so that the egress router sends, to the ingress router, the BGP routing information carrying the community attribute. In addition, after being manually configured by the skilled person and receiving the BGP routing information, the ingress router sets the corresponding traffic index for the target data flow based on the community attribute carried in the BGP routing information. If traffic statistics of a large quantity of data flows in a network need to be collected, the skilled person needs to manually configure an ingress router and an egress router for each data flow. It can be learned that the skilled person needs to manually configure an excessively large quantity of devices. As a result, the skilled person has heavy and complex configuration work.

[0026] To resolve the foregoing problem, the embodiments of the present invention provide a control method, apparatus, and system for collecting traffic statistics. If traffic statistics of a target data flow need to be collected, a control node may obtain a statistics collection instruction triggered by a user operation. In response to the statistics collection instruction, the control node may generate a traffic statistics collection policy and send the traffic statistics collection policy to a forwarding node. Therefore, based on a command carried in the traffic statistics collection policy, the forwarding node may set a traffic identifier for the target data flow and collect the traffic statistics of the target data flow into a traffic statistics collection result corresponding to the traffic identifier. It can be learned that because the control node delivers the traffic statistics collection policy to all forwarding nodes in a centralized manner, a skilled person only needs to initiate the statistics collection instruction to the control node, so that traffic statistics of a large quantity of data flows on all the forwarding nodes can be collected. Therefore, a quantity of devices that need to be manually configured by the skilled person is greatly reduced, thereby simplifying configuration work that needs to be of the skilled person.

[0027] For example, one of application scenarios of the embodiments of the present invention may be applied to a network system shown in FIG. 1. A control node and a forwarding node are deployed in the network system. The control node obtains a statistics collection instruction, and the statistics collection instruction is used to instruct to collect traffic statistics of a target data flow. The control node generates a traffic statistics collection policy according to the statistics collection instruction, and the traffic statistics collection policy includes a matching identifier of the target data flow, a first command, and a second command. The control node sends the traffic statistics collection policy to the forwarding node. After the forwarding node receives the traffic statistics collection policy sent by the control node, the forwarding node sets a traffic identifier for the target data flow based on the first command and the matching identifier, and adds, based on the second command, traffic generated by a target packet to a traffic statistics collection result corresponding to the traffic identifier. The target packet belongs to the target data flow, and the traffic statistics collection result corresponding to the traffic identifier is used to describe the traffic of the target data flow.

[0028] It may be understood that, for example, physical devices in the network system may include a plurality of forwarding devices 102. For another example, physical devices in the network system may include a controller 101 and a plurality of forwarding devices 102.

[0029] In an example, the control node may be implemented as an independent physical device such as an independent controller 101. Similarly, the forwarding node may be implemented as an independent physical device such as any independent forwarding device 102. In other words, each independent forwarding device 102 is a forwarding node.

[0030] In another example, the control node may be implemented as a program running on a physical device, for example, a program running on the controller 101 or a program running on any forwarding device 102. Similarly, the forwarding node may be implemented as a program running on a physical device, for example, a program running on a forwarding device 102. It may be understood that one physical device runs only one program. For example, the controller 101 runs only the control node, and each forwarding device 102 runs only one forwarding node. Alternatively, a plurality of different programs may run on a same forwarding device 102. For example, a plurality of different forwarding nodes may run on a same forwarding device 102. For another example, the control node and the forwarding node may run on a same forwarding device 102.

[0031] In still another example, the control node may be implemented as a virtual machine deployed on a physical device, for example, a virtual machine deployed on the controller 101 or a virtual machine running on a forwarding device 102. Similarly, the forwarding node may be implemented as a virtual machine deployed on a physical device, for example, a virtual machine deployed on a forwarding device 102. It may be understood that one physical device may be completely occupied by one virtual machine. For example, the controller 101 is completely occupied by the control node, and each forwarding device 102 is completely occupied by a forwarding node. Alternatively, one physical device may be jointly occupied by a plurality of virtual machines. For example, a same forwarding device 102 is jointly occupied by a plurality of forwarding nodes. For another example, a same forwarding device 102 is jointly occupied by the forwarding node and the control node. In this case, the controller 101 and the forwarding devices 102 may be general-purpose physical servers.

[0032] It should be noted that the foregoing application scenario is shown only to facilitate understanding of the embodiments of the present invention, but is not intended to limit the technical solutions provided in the embodiments of present invention.

[0033] With reference to accompanying drawings, the following describes in detail specific implementations of the control method, apparatus, and system for collecting traffic statistics in the present invention by using embodiments.

[0034] FIG. 2 is a flowchart of a control method for collecting traffic statistics according to an embodiment of the present invention. The method is described from a perspective of a control node in this embodiment. In this embodiment, for example, the method may specifically include the following steps.

[0035] Step 201: The control node obtains a statistics collection instruction, where the statistics collection instruction is used to instruct to collect traffic statistics of a target data flow.

[0036] If the traffic statistics of the target data flow need to be collected, a skilled person may initiate the statistics collection instruction to the control node by using a device used by the skilled person. After obtaining the statistics collection request, the control node 201 determines, according to the statistics collection instruction, the target data flow corresponding to the statistics collection instruction. The statistics collection instruction is used to instruct to collect the traffic statistics of the target data flow. Specifically, the statistics collection instruction is used to instruct the control node to send a traffic statistics collection policy corresponding to the target data flow to a forwarding node, so that the forwarding node collects the traffic statistics of the target data flow based on the instruction of the traffic statistics collection policy.

[0037] In some implementations, the physical device used by the skilled person and a physical device in which the control node is located may be a same physical device. For example, the skilled person may perform an operation on a physical controller in which the control node is located, so that the physical controller generates the statistics collection instruction and internally transmits the statistics collection instruction to the control node. In some other implementations, the physical device used by the skilled person and a physical device in which the control node is located may be different physical devices. For example, the skilled person performs an operation on a terminal device of the skilled person, and in response to the operation of the skilled person, the terminal device of the skilled person generates the statistics collection instruction and sends the statistics collection instruction to the control node on a physical controller.

[0038] In addition, the statistics collection instruction may be automatically initiated to the control node according to a pre-configured statistics collection rule. For example, the physical controller in which the control node is located has the pre-configured statistics collection rule. If a trigger occasion indicated by the statistics collection rule for the statistics collection instruction is met, the physical controller may generate the statistics collection instruction and internally transmit the statistics collection instruction to the control node.

[0039] It may be understood that the statistics collection instruction may instruct the control node to select a target interface to collect the traffic statistics of the target data flow, and the target interface is an interface configured to forward the target data flow. If the statistics collection instruction indicates the target interface, the control node may deliver the traffic statistics collection policy corresponding to the target data flow to the forwarding node on which the target interface is located, so that the forwarding node can collect the traffic statistics of the target data flow on the target interface.

[0040] It should be noted that the forwarding node may report related information of an interface of the forwarding node to the control node in advance, so that the control node feeds back the information to the skilled person. The skilled person may initiate, to the control node based on the interface information reported to the control node, the statistics collection instruction used to instruct to collect the traffic statistics of the target data flow on the target interface. Alternatively, the skilled person may set the statistics collection rule based on the interface information reported to the control node, and the statistics collection rule is used to trigger, on a specific occasion, the statistics collection instruction used to instruct to collect the traffic statistics of the target data flow on the target interface.

[0041] In some implementations, the interface information reported by the forwarding node to the control node may include an interface identifier and an interface name of the interface of the forwarding node. Specifically, before step 201, for example, the method in this embodiment may further include: receiving, by the control node, first interface report information sent by the forwarding node, where the first interface report information carries an interface identifier of a target interface and an interface name of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0042] For example, the first interface report information may be reported by using a Border Gateway Protocol-Link State (English: Border Gateway Protocol-Link State, BGP-LS for short) protocol packet. In other words, the first interface report information is carried in a first BGP-LS protocol packet sent by the forwarding node to the control node. Specifically, as shown in FIG. 3, for example, the first interface report information carried in the first BGP-LS protocol packet may be in a TLV (Type-Length-Value) format. A type value used to indicate the interface name may be written in a type field, for example, "TBD1 (Interface Name)" in FIG. 3. A length value of the first interface report information may be written in a length field, which occupies 2 bytes, for example, "Length (4 Octets)" in FIG. 3. The interface identifier may be written in a value field, which occupies 4 bytes, for example, "Interface Index (4 Octets)" in FIG. 3. The interface name may be written in another value field, which occupies a maximum of 64 bytes, for example, "Interface Name (variable Octets)" in FIG. 3. The interface identifier may be an interface index, that is, an index value allocated by the forwarding node to the interface of the forwarding node. A same forwarding node allocates different index values to different interfaces. For example, the interface name may be a character string including ASCII characters, and the character string ends with '\0'.

[0043] In some other implementations, the interface information reported by the forwarding node to the control node may include an interface identifier and interface description information of the interface of the forwarding node. Specifically, before step 201, for example, the method in this embodiment may further include: receiving, by the control node, second interface report information sent by the forwarding node, where the second interface report information carries an interface identifier of the target interface and interface description information of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet. The interface description information is information used to describe an interface feature. For example, interface description information of an interface on a router A may be "interface connecting a router A to a router B", may be "interface connecting a router A to a user a", or may be "100G interface connecting to a user b for a router A".

[0044] For example, the second interface report information may be reported by using a BGP-LS protocol packet. In other words, the second interface report information is carried in a second BGP-LS protocol packet sent by the forwarding node to the control node. Specifically, as shown in FIG. 4, for example, the second interface report information carried in the second BGP-LS protocol packet may be in a TLV (Type-Length-Value) format. A type value used to indicate the interface description information may be written in a type field, for example, "TBD2 (Interface Description)" in FIG. 4. A length value of the second interface report information may be written in a length field, which occupies 2 bytes, for example, "Length (4 Octets)" in FIG. 4. The interface identifier may be written in a value field, which occupies 4 bytes, for example, "Interface Index (4 Octets)" in FIG. 4. The interface description information may be written in another value field, which occupies a maximum of 256 bytes, for example, "Interface Description (variable Octets)" in FIG. 4. The interface identifier may be an interface index, that is, an index value allocated by the forwarding node to the interface of the forwarding node. A same forwarding node allocates different index values to different interfaces. For example, the interface description information may be a character string including ASCII characters, and the character string ends with '\0'.

[0045] In still some other implementations, the interface information reported by the forwarding node to the control node may include an interface identifier, an interface name, and interface description information of the interface of the forwarding node. Specifically, before step 201, for example, the method in this embodiment may further include: receiving, by the control node, the first interface report information sent by the forwarding node, and receiving, by the control node, the second interface report information sent by the forwarding node.

[0046] Step 202: The control node generates a traffic statistics collection policy according to the statistics collection instruction, where the traffic statistics collection policy includes a matching identifier of the target data flow, a first command, and a second command, the first command is used to instruct a forwarding node to set a traffic identifier for the target data flow based on the matching identifier, the second command is used to instruct the forwarding node to add traffic generated by a target packet to a traffic statistics collection result corresponding to the traffic identifier, the target packet belongs to the target data flow, and the traffic statistics collection result corresponding to the traffic identifier is used to describe the traffic of the target data flow.

[0047] Specifically, the statistics collection instruction indicates the target data flow and the target interface. Therefore, after receiving the statistics collection instruction, the control node may generate, according to the statistics collection instruction, the traffic statistics collection policy corresponding to the target data flow, and send the traffic statistics collection policy to the forwarding node on which the target interface is located.

[0048] The traffic statistics collection policy is used to trigger the forwarding node to collect the traffic statistics of the target data flow. Specifically, the traffic statistics collection policy includes the matching identifier of the target data flow, and the forwarding node can identify the target data flow based on the matching identifier. For example, the matching identifier may be an AS number list (English: AS Number List), a community list (English: Community List), an extended community list (English: Ext-Community List), or an IPv4 prefix list (English: IPv4 Prefix List) and/or an IPv6 prefix list (English: IPv6 Prefix List). In addition, the traffic statistics collection policy further includes the first command and the second command. The forwarding node sets the traffic identifier for the identified target data flow based on the first command. When forwarding the target packet that belongs to the target data flow, the forwarding node adds, based on the second command, the traffic generated by the target packet to the traffic statistics collection result corresponding to the traffic identifier that has been set.

[0049] In some implementations, for example, the traffic statistics collection policy may be delivered by using a Border Gateway Protocol Flow Specification (English: Border Gateway Protocol Flow Specification, BGP FlowSpec for short) protocol packet. In other words, the traffic statistics collection policy is carried in a BGP FlowSpec protocol packet delivered by the control node to the forwarding node. Specifically, the BGP FlowSpec protocol packet carries network layer reachability information (English: Network Layer Reachability Information, NLRI for short) and an extended community (English: Extended Community) attribute. The NLRI carries the matching identifier, and the extended community attribute carries the first command and the second command. For example, the first command carried in the extended community attribute may be "set-traffic-index". For example, the second command carried in the extended community attribute may be "specify-interface-index".

[0050] Step 203: The control node sends the traffic statistics collection policy to the forwarding node.

[0051] After the forwarding node receives the traffic statistics collection policy, the forwarding node sets the traffic identifier for the target data flow based on the first command in the traffic statistics collection policy. For example, a specific manner for setting the traffic identifier may be as follows: The forwarding node searches for a forwarding entry corresponding to the matching identifier, and uses the forwarding entry corresponding to the matching identifier as a forwarding entry corresponding to the target data flow; and the forwarding node applies, to the forwarding entry corresponding to the target data flow, the traffic identifier indicated by the first command. For example, a manner for applying the traffic identifier to the forwarding entry may be adding the traffic identifier to the forwarding entry corresponding to the target data flow. The traffic identifier may be specifically an index value allocated to the target data flow, namely, a traffic index.

[0052] After the forwarding node sets the traffic identifier for the target data flow, when forwarding the target packet that belongs to the target data flow, the forwarding node adds, based on the second command in the traffic statistics collection policy, the traffic generated by the target packet to the traffic statistics collection result corresponding to the traffic identifier that has been set. Specifically, based on the instruction of the second command, the forwarding node may configure a command line for the target interface indicated by the traffic statistics collection policy. The command line is used to enable the target interface to collect the traffic statistics of the target data flow. After configuring the command line, if the forwarding node receives the target packet that belongs to the target data flow, the forwarding node searches for the forwarding entry corresponding to the target data flow, to forward the target packet. After finding the forwarding entry and forwarding the target packet based on the forwarding entry, the forwarding node identifies the command line corresponding to the target interface configured to forward the target packet, and the forwarding node also identifies the traffic identifier in the forwarding entry. Based on the instruction of the command line, the forwarding node adds the traffic generated by the target packet to the traffic statistics collection result corresponding to the traffic identifier.

[0053] In some implementations of this embodiment, the traffic statistics collection result obtained by collecting the traffic statistics of the target data flow on the forwarding node may be uploaded to the control node. In this way, traffic statistics collection results of all data flows may be gathered on the control node and fed back to the skilled person. Specifically, after step 203, for example, the method in this embodiment may further include: receiving, by the control node, statistics collection result report information sent by the forwarding node; and recording, by the control node, the traffic statistics collection result corresponding to the traffic identifier as a traffic statistics collection result of the target data flow based on the statistics collection result report information. The statistics collection result report information may carry an interface identifier of a target interface, the traffic identifier of the target data flow, and the traffic statistics collection result corresponding to the traffic identifier. The target interface is an interface that is on the forwarding node and that is configured to forward the target packet. After the control node receives the statistics collection result report information, the control node determines, based on the interface identifier and the traffic identifier in the statistics collection result report information, that the statistics collection result report information is used to report the traffic statistics collection result of the target data flow, so as to record the traffic statistics collection result in the statistics collection result report information as the traffic statistics collection result of the target data flow.

[0054] For example, the statistics collection result report information may be reported by using a BGP-LS protocol packet. In other words, the statistics collection result report information is carried in a third BGP-LS protocol packet sent by the forwarding node to the control node. Specifically, as shown in FIG. 5, for example, the statistics collection result report information carried in the third BGP-LS protocol packet may be in a TLV (Type-Length-Value) format. A type value used to indicate traffic statistics collection may be written in a type field, for example, "TBD3 (Traffic Collection)" in FIG. 5. A length value of third optional information may be written in a length field, which occupies 2 bytes, for example, "Length (2 Octets)" in FIG. 5. The interface identifier may be written in a value field, which occupies 4 bytes, for example, "Interface Index (4 Octets)" in FIG. 5. The traffic identifier may be written in another value field, which occupies 4 bytes, for example, "Traffic Index (4 Octets)" in FIG 5. A most significant bit of the statistics collection result in a unit of byte may be written in still another value field, which occupies 4 bytes, for example, "Bytes Counter 1 (4 Octets)" in FIG. 5. A least significant bit of the statistics collection result in a unit of byte may be written in still another value field, which occupies 4 bytes, for example, "Bytes Counter 2 (4 Octets)" in FIG. 5. A most significant bit of the statistics collection result in a unit of packet may be written in still another value field, for example, "Packets Counter 1 (4 Octets)" in FIG. 5. A least significant bit of the statistics collection result in a unit of packet may be written in still another value field, which occupies 4 bytes, for example, "Packets Counter 2 (4 Octets)" in FIG. 5.

[0055] In this embodiment, if the traffic statistics of the target data flow need to be collected, the statistics collection instruction triggered by a user operation may be sent to the control node. In response to the statistics collection instruction, the control node may generate the traffic statistics collection policy and send the traffic statistics collection policy to the forwarding node. Therefore, based on the commands carried in the traffic statistics collection policy, the forwarding node may set the traffic identifier for the target data flow and collect the traffic statistics of the target data flow into the traffic statistics collection result corresponding to the traffic identifier. It can be learned that because the control node delivers the traffic statistics collection policy to all forwarding nodes in a centralized manner, the skilled person only needs to initiate the statistics collection instruction to the control node, so that traffic statistics of a large quantity of data flows on all the forwarding nodes can be collected. Therefore, a quantity of devices that need to be manually configured by the skilled person is greatly reduced, thereby simplifying configuration work that needs to be of the skilled person.

[0056] FIG. 6 is a flowchart of a control method for collecting traffic statistics according to an embodiment of the present invention. The method is described from a perspective of a forwarding node in this embodiment. In this embodiment, for example, the method may specifically include the following steps:

Step 601: The forwarding node receives a traffic statistics collection policy sent by a control node, where the traffic statistics collection policy carries a matching identifier of a target data flow, a first command, and a second command, the traffic statistics collection policy is generated by the control node according to a statistics collection instruction, and the statistics collection instruction is used to instruct to collect traffic statistics of the target data flow.

Step 602: The forwarding node sets a traffic identifier for the target data flow based on the first command and the matching identifier.

Step 603: The forwarding node adds, based on the second command, traffic generated by a target packet to a traffic statistics collection result corresponding to the traffic identifier.



[0057] The target packet belongs to the target data flow, and the traffic statistics collection result corresponding to the traffic identifier is used to describe the traffic of the target data flow.

[0058] Optionally, the traffic statistics collection policy is carried in a BGP FlowSpec protocol packet, network layer reachability information of the BGP FlowSpec protocol packet carries the matching identifier, and an extended community attribute of the BGP FlowSpec carries the first command and the second command.

[0059] Optionally, step 602 may include:

searching, by the forwarding node, for a forwarding entry corresponding to the matching identifier, and using the forwarding entry corresponding to the matching identifier as a forwarding entry corresponding to the target data flow; and

applying, by the forwarding node to the forwarding entry corresponding to the target data flow, the traffic identifier indicated by the first command.



[0060] Optionally, the method may further include:
sending, by the forwarding node, statistics collection result report information to the control node, where the statistics collection result report information carries an interface identifier of a target interface, the traffic identifier of the target data flow, and the traffic statistics collection result corresponding to the traffic identifier, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0061] Optionally, the statistics collection result report information is carried in a first BGP-LS protocol packet.

[0062] Optionally, the statistics collection result report information is in a TLV format. A type value used to indicate traffic statistics collection is written in a type field of the statistics collection result report information, a length value of the statistics collection result report information is written in a length field of the statistics collection result report information, and the interface identifier, the traffic identifier, and the traffic statistics collection result corresponding to the traffic identifier are written in a value field of the statistics collection result report information.

[0063] Optionally, the method further includes:
sending, by the forwarding node, first interface report information to the control node, where the first interface report information carries an interface identifier of a target interface and an interface name of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0064] The first interface report information is carried in a second BGP-LS protocol packet.

[0065] Optionally, the first interface report information is in a TLV format. A type value used to indicate the interface name is written in a type field of the first interface report information, a length value of the first interface report information is written in a length field of the first interface report information, and the interface identifier and the interface name are written in a value field of the first interface report information.

[0066] Optionally, the method may further include:
sending, by the forwarding node, second interface report information to the control node, where the second interface report carries an interface identifier of a target interface and interface description information of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0067] The second interface report information is carried in the third BGP-LS protocol packet.

[0068] Optionally, the second interface report information is in a TLV format. A type value used to indicate the interface description information is written in a type field of the second interface report information, a length value of the second interface report information is written in a length field of the third optional information, and the interface identifier and the interface description information are written in a value field of the second interface report information.

[0069] It should be noted that the forwarding node in this embodiment of the present invention is equivalent to the forwarding node mentioned in the embodiment shown in FIG. 2. For various specific implementations of the method performed by the forwarding node in this embodiment, refer to a detailed description of the embodiment shown in FIG. 2. Details are not described herein again.

[0070] In this embodiment, if the traffic statistics of the target data flow need to be collected, the statistics collection instruction triggered by a user operation may be sent to the control node. In response to the statistics collection instruction, the control node may generate the traffic statistics collection policy and send the traffic statistics collection policy to the forwarding node. Therefore, based on the commands carried in the traffic statistics collection policy, the forwarding node may set the traffic identifier for the target data flow and collect the traffic statistics of the target data flow into the traffic statistics collection result corresponding to the traffic identifier. It can be learned that because the control node delivers the traffic statistics collection policy to all forwarding nodes in a centralized manner, a skilled person only needs to initiate the statistics collection instruction to the control node, so that traffic statistics of a large quantity of data flows on all the forwarding nodes can be collected. Therefore, a quantity of devices that need to be manually configured by the skilled person is greatly reduced, thereby simplifying configuration work that needs to be of the skilled person.

[0071] FIG. 7 is a schematic structural diagram of a control apparatus for collecting traffic statistics according to an embodiment of the present invention. In this embodiment, a control node is deployed in the apparatus 700. For example, the apparatus 700 may specifically include:

an obtaining unit 701, configured to obtain a statistics collection instruction, where the statistics collection instruction is used to instruct to collect traffic statistics of a target data flow;

a generation unit 702, configured to generate a traffic statistics collection policy according to the statistics collection instruction, where the traffic statistics collection policy includes a matching identifier of the target data flow, a first command, and a second command, the first command is used to instruct a forwarding node to set a traffic identifier for the target data flow based on the matching identifier, the second command is used to instruct the forwarding node to add traffic generated by a target packet to a traffic statistics collection result corresponding to the traffic identifier, the target packet belongs to the target data flow, and the traffic statistics collection result corresponding to the traffic identifier is used to describe the traffic of the target data flow; and

a sending unit 703, configured to send the traffic statistics collection policy to the forwarding node.



[0072] For example, the apparatus 700 shown in FIG. 7 may be configured to perform the method shown in FIG. 2. Specifically, the obtaining unit 701 may be configured to perform step 201 in FIG. 2. The generation unit 702 may be configured to perform step 202 in FIG. 2. The sending unit 703 may be configured to perform step 203 in FIG. 2.

[0073] Optionally, the traffic statistics collection policy may be carried in a Border Gateway Protocol Flow Specification BGP FlowSpec protocol packet, network layer reachability information of the BGP FlowSpec protocol packet carries the matching identifier, and an extended community attribute of the BGP FlowSpec protocol packet carries the first command and the second command.

[0074] Optionally, the apparatus 700 may further include:

a first receiving unit, configured to receive statistics collection result report information sent by the forwarding node, where the statistics collection result report information carries an interface identifier of a target interface, the traffic identifier of the target data flow, and the traffic statistics collection result corresponding to the traffic identifier, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet; and

a recording unit, configured to record the traffic statistics collection result corresponding to the traffic identifier as a traffic statistics collection result of the target data flow based on the statistics collection result report information.



[0075] Optionally, the statistics collection result report information may be carried in a first Border Gateway Protocol-Link State BGP-LS protocol packet.

[0076] Optionally, the statistics collection result report information is in a TLV format. A type value used to indicate traffic statistics collection is written in a type field of the statistics collection result report information, a length value of the first optional information is written in a length field of the statistics collection result report information, and the interface identifier, the traffic identifier, and the traffic statistics collection result corresponding to the traffic identifier are written in a value field of the statistics collection result report information.

[0077] Optionally, the apparatus 700 may further include:
a second receiving unit, configured to receive first interface report information sent by the forwarding node, where the first interface report information carries an interface identifier of a target interface and an interface name of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0078] The first interface report information is carried in a second BGP-LS protocol packet.

[0079] Optionally, the first interface report information is in a TLV format. A type value used to indicate the interface name is written in a type field of the first interface report information, a length value of the first interface report information is written in a length field of the second optional information, and the interface identifier and the interface name of the target interface are written in a value field of the first interface report information.

[0080] Optionally, the apparatus 700 may further include:
a third receiving unit, configured to receive second interface report information sent by the forwarding node, where the second interface report information carries an interface identifier of the target interface and interface description information of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0081] The second interface report information is carried in a third BGP-LS protocol packet.

[0082] Optionally, the second interface report information is in a TLV format. A type value used to indicate the interface description information is written in a type field of the second interface report information, a length value of the second interface report information is written in a length field of the second interface report information, and the interface identifier and the interface description information are written in a value field of the second interface report information.

[0083] It should be noted that the control node in the embodiment shown in FIG. 2 is deployed in the apparatus 700 in this embodiment. For various specific implementations of the apparatus 700 in this embodiment, refer to a detailed description of the control node in the embodiment shown in FIG. 2. Details are not described herein again.

[0084] In this embodiment, if the traffic statistics of the target data flow need to be collected, the statistics collection instruction triggered by a user operation may be sent to the control node. In response to the statistics collection instruction, the control node may generate the traffic statistics collection policy and send the traffic statistics collection policy to the forwarding node. Therefore, based on the commands carried in the traffic statistics collection policy, the forwarding node may set the traffic identifier for the target data flow and collect the traffic statistics of the target data flow into the traffic statistics collection result corresponding to the traffic identifier. It can be learned that because the control node delivers the traffic statistics collection policy to all forwarding nodes in a centralized manner, a skilled person only needs to initiate the statistics collection instruction to the control node, so that traffic statistics of a large quantity of data flows on all the forwarding nodes can be collected. Therefore, a quantity of devices that need to be manually configured by the skilled person is greatly reduced, thereby simplifying configuration work that needs to be of the skilled person.

[0085] FIG. 8 is a schematic structural diagram of a control apparatus for collecting traffic statistics according to an embodiment of the present invention. In this embodiment, a forwarding node is deployed in the apparatus 800. For example, the apparatus 800 may specifically include:

a receiving unit 801, configured to receive a traffic statistics collection policy sent by a control node, where the traffic statistics collection policy carries a matching identifier of a target data flow, a first command, and a second command, the traffic statistics collection policy is generated by the control node according to a statistics collection instruction, and the statistics collection instruction is used to instruct to collect traffic statistics of the target data flow;

a setting unit 802, configured to set a traffic identifier for the target data flow based on the first command and the matching identifier; and

a statistics collection unit 803, configured to add, based on the second command, traffic generated by a target packet to a traffic statistics collection result corresponding to the traffic identifier.



[0086] The target packet belongs to the target data flow, and the traffic statistics collection result corresponding to the traffic identifier is used to describe the traffic of the target data flow.

[0087] For example, the apparatus 800 shown in FIG. 8 may be configured to perform the method shown in FIG. 6. Specifically, the receiving unit 801 may be configured to perform step 601 in FIG. 6. The setting unit 802 may be configured to perform step 602 in FIG. 6. The statistics collection unit 803 may be configured to perform step 603 in FIG. 6.

[0088] Optionally, the traffic statistics collection policy may be carried in a BGP FlowSpec protocol packet, network layer reachability information of the BGP FlowSpec protocol packet carries the matching identifier, and an extended community attribute of the BGP FlowSpec carries the first command and the second command.

[0089] Optionally, the setting unit 802 may include:

a searching subunit, configured to: search for a forwarding entry corresponding to the matching identifier, and use the forwarding entry corresponding to the matching identifier as a forwarding entry corresponding to the target data flow; and

an application subunit, configured to apply, to the forwarding entry corresponding to the target data flow, the traffic identifier indicated by the first command.



[0090] Optionally, the apparatus 800 further includes:
a first sending unit, configured to send statistics collection result report information to the control node, where the statistics collection result report information carries an interface identifier of a target interface, the traffic identifier of the target data flow, and the traffic statistics collection result corresponding to the traffic identifier, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0091] Optionally, the statistics collection result report information may be carried in a first BGP-LS protocol packet.

[0092] Optionally, the statistics collection result report information is in a TLV format. A type value used to indicate traffic statistics collection is written in a type field of the statistics collection result report information, a length value of the statistics collection result report information may be written in a length field of the statistics collection result report information, and the interface identifier, the traffic identifier, and the traffic statistics collection result corresponding to the traffic identifier are written in a value field of the statistics collection result report information.

[0093] Optionally, the apparatus 800 may further include:
a second sending unit, configured to send first interface report information to the control node, where the first interface report information carries an interface identifier of a target interface and an interface name of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0094] The first interface report information is carried in a second BGP-LS protocol packet.

[0095] Optionally, the first interface report information is in a TLV format. A type value used to indicate the interface name is written in a type field of the first interface report information, a length value of the first interface report information is written in a length field of the first interface report information, and the interface identifier and the interface name of the target interface are written in a value field of the first interface report information.

[0096] Optionally, the apparatus 800 may further include:
a third sending unit, configured to send second interface report information to the control node, where the second interface report carries an interface identifier of a target interface and interface description information of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0097] The second interface report information is carried in the third BGP-LS protocol packet.

[0098] Optionally, the second interface report information is in a TLV format. A type value used to indicate the interface description information is written in a type field of the second interface report information, a length value of the second interface report information is written in a length field of the second interface report information, and the interface identifier and the interface description information are written in a value field of the second interface report information.

[0099] It should be noted that the forwarding node in the embodiment shown in FIG. 2 is deployed in the apparatus 800 in this embodiment. For various specific implementations of the apparatus 800 in this embodiment, refer to a detailed description of the forwarding node in the embodiment shown in FIG. 2. Details are not described herein again.

[0100] In this embodiment, if the traffic statistics of the target data flow need to be collected, the statistics collection instruction triggered by a user operation may be sent to the control node. In response to the statistics collection instruction, the control node may generate the traffic statistics collection policy and send the traffic statistics collection policy to the forwarding node. Therefore, based on the commands carried in the traffic statistics collection policy, the forwarding node may set the traffic identifier for the target data flow and collect the traffic statistics of the target data flow into the traffic statistics collection result corresponding to the traffic identifier. It can be learned that because the control node delivers the traffic statistics collection policy to all forwarding nodes in a centralized manner, a skilled person only needs to initiate the statistics collection instruction to the control node, so that traffic statistics of a large quantity of data flows on all the forwarding nodes can be collected. Therefore, a quantity of devices that need to be manually configured by the skilled person is greatly reduced, thereby simplifying configuration work that needs to be of the skilled person.

[0101] FIG. 9 is a schematic structural diagram of a control system for collecting traffic statistics according to an embodiment of the present invention. In this embodiment, the system includes a first network device 902 and a second network device 902. The first network device 901 may be the apparatus 700 in any one of the foregoing implementations, and the second network device 902 may be the apparatus 800 in any one of the foregoing implementations.

[0102] It should be noted that the control node mentioned in the embodiment shown in FIG. 2 is configured in the first network device 901 in this embodiment, and the forwarding node mentioned in the embodiment shown in FIG. 2 is configured in the second network device 902 in this embodiment. For various specific implementations of the first network device 901 and the second network device 902 in this embodiment, refer to detailed descriptions of the embodiment shown in FIG. 2. Details are not described in this embodiment again.

[0103] In this embodiment, if traffic statistics of a target data flow need to be collected, a statistics collection instruction triggered by a user operation may be sent to the control node. In response to the statistics collection instruction, the control node may generate a traffic statistics collection policy and send the traffic statistics collection policy to the forwarding node. Therefore, based on a command carried in the traffic statistics collection policy, the forwarding node may set a traffic identifier for the target data flow and collect the traffic statistics of the target data flow into a traffic statistics collection result corresponding to the traffic identifier. It can be learned that because the control node delivers the traffic statistics collection policy to all forwarding nodes in a centralized manner, a skilled person only needs to initiate the statistics collection instruction to the control node, so that traffic statistics of a large quantity of data flows on all the forwarding nodes can be collected. Therefore, a quantity of devices that need to be manually configured by the skilled person is greatly reduced, thereby simplifying configuration work that needs to be of the skilled person.

[0104] FIG. 10 is a schematic structural diagram of a network device according to an embodiment of the present invention. The control node in the embodiment shown in FIG. 2 is deployed in the network device 1000 in this embodiment, and the network device 1000 may be configured to perform the method in the embodiment shown in FIG. 2. The network device 1000 includes a processor 1001, a memory 1002, a network interface 1003, and a bus system 1004.

[0105] The bus system 1004 is configured to couple all hardware components of the physical server 1000 together.

[0106] The network interface 1003 is configured to implement a communication connection between the physical server 1000 and at least one other network element through the Internet, a wide area network, a local area network, a metropolitan area network, or another manner.

[0107] The memory 1002 is configured to store a program instruction and data.

[0108] The processor 1001 is configured to read the instruction and the data that are stored in the memory 1002, so as to perform the following operations:

obtaining a statistics collection instruction, where the statistics collection instruction is used to instruct to collect traffic statistics of a target data flow;

generating a traffic statistics collection policy according to the statistics collection instruction, where the traffic statistics collection policy includes a matching identifier of the target data flow, a first command, and a second command, the first command is used to instruct a forwarding node to set a traffic identifier for the target data flow based on the matching identifier, the second command is used to instruct the forwarding node to add traffic generated by a target packet to a traffic statistics collection result corresponding to the traffic identifier, the target packet belongs to the target data flow, and the traffic statistics collection result corresponding to the traffic identifier is used to describe the traffic of the target data flow; and

sending the traffic statistics collection policy to the forwarding node.



[0109] Optionally, the traffic statistics collection policy is carried in a Border Gateway Protocol Flow Specification BGP FlowSpec protocol packet, network layer reachability information of the BGP FlowSpec protocol packet carries the matching identifier, and an extended community attribute of the BGP FlowSpec protocol packet carries the first command and the second command.

[0110] Optionally, the processor 1001 may further perform the following operations:

receiving statistics collection result report information sent by the forwarding node, where the statistics collection result report information carries an interface identifier of a target interface, the traffic identifier of the target data flow, and the traffic statistics collection result corresponding to the traffic identifier, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet; and

recording the traffic statistics collection result corresponding to the traffic identifier as a traffic statistics collection result of the target data flow based on the statistics collection result report information.



[0111] Optionally, the statistics collection result report information is carried in a first Border Gateway Protocol-Link State BGP-LS protocol packet.

[0112] Optionally, the statistics collection result report information is in a TLV format. A type value used to indicate traffic statistics collection is written in a type field of the statistics collection result report information, a length value of the statistics collection result report information is written in a length field of the statistics collection result report information, and the interface identifier, the traffic identifier, and the traffic statistics collection result corresponding to the traffic identifier are written in a value field of the statistics collection result report information.

[0113] Optionally, the processor 1001 may further perform the following operation:
receiving first interface report information sent by the forwarding node, where the first interface report information carries an interface identifier of a target interface and an interface name of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0114] The first interface report information is carried in a second BGP-LS protocol packet.

[0115] Optionally, the first interface report information is in a TLV format. A type value used to indicate the interface name is written in a type field of the first interface report information, a length value of the first interface report information is written in a length field of the first interface report information, and the interface identifier and the interface name are written in a value field of the first interface report information.

[0116] Optionally, the processor 1001 may further perform the following operation:
receiving second interface report information sent by the forwarding node, where the second interface report information carries an interface identifier of the target interface and interface description information of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0117] The second interface report information is carried in a third BGP-LS protocol packet.

[0118] Optionally, the second interface report information is in a TLV format. A type value used to indicate the interface description information is written in a type field of the second interface report information, a length value of the second interface report information is written in a length field of the third optional information, and the interface identifier and the interface description information are written in a value field of the second interface report information.

[0119] FIG. 11 is a schematic structural diagram of a network device according to an embodiment of the present invention. The forwarding node in the embodiment shown in FIG. 6 is deployed in the network device 1100 in this embodiment, and the network device 1100 may be configured to perform the method in the embodiment shown in FIG. 6. The network device 1100 includes a processor 1101, a memory 1102, a network interface 1103, and a bus system 1104.

[0120] The bus system 1104 is configured to couple all hardware components of the physical server 1100 together.

[0121] The network interface 1103 is configured to implement a communication connection between the physical server 1100 and at least one other network element through the Internet, a wide area network, a local area network, a metropolitan area network, or another manner.

[0122] The memory 1102 is configured to store a program instruction and data.

[0123] The processor 1101 is configured to read the instruction and the data that are stored in the memory 1102, so as to perform the following operations:

receiving a traffic statistics collection policy sent by a control node, where the traffic statistics collection policy carries a matching identifier of a target data flow, a first command, and a second command, the traffic statistics collection policy is generated by the control node according to a statistics collection instruction, and the statistics collection instruction is used to instruct to collect traffic statistics of the target data flow;

setting a traffic identifier for the target data flow based on the first command and the matching identifier; and

adding, based on the second command, traffic generated by a target packet to a traffic statistics collection result corresponding to the traffic identifier.



[0124] The target packet belongs to the target data flow, and the traffic statistics collection result corresponding to the traffic identifier is used to describe the traffic of the target data flow.

[0125] Optionally, the traffic statistics collection policy is carried in a BGP FlowSpec protocol packet, network layer reachability information of the BGP FlowSpec protocol packet carries the matching identifier, and an extended community attribute of the BGP FlowSpec carries the first command and the second command.

[0126] Optionally, to set the traffic identifier for the target data flow, the processor 1102 may perform the following operations:

searching for a forwarding entry corresponding to the matching identifier, and using the forwarding entry corresponding to the matching identifier as a forwarding entry corresponding to the target data flow; and

applying, to the forwarding entry corresponding to the target data flow, the traffic identifier indicated by the first command.



[0127] Optionally, the processor 1101 may further perform the following operation:
sending statistics collection result report information to the control node, where the statistics collection result report information carries an interface identifier of a target interface, the traffic identifier of the target data flow, and the traffic statistics collection result corresponding to the traffic identifier, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0128] Optionally, the statistics collection result report information is carried in a first BGP-LS protocol packet.

[0129] Optionally, the statistics collection result report information is in a TLV format. A type value used to indicate traffic statistics collection is written in a type field of the statistics collection result report information, a length value of the statistics collection result report information is written in a length field of the statistics collection result report information, and the interface identifier, the traffic identifier, and the traffic statistics collection result corresponding to the traffic identifier are written in a value field of the statistics collection result report information.

[0130] Optionally, the processor 1101 may further perform the following operation:
sending first interface report information to the control node, where the first interface report information carries an interface identifier of a target interface and an interface name of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0131] The first interface report information is carried in a second BGP-LS protocol packet.

[0132] Optionally, the first interface report information is in a TLV format. A type value used to indicate the interface name is written in a type field of the first interface report information, a length value of the first interface report information is written in a length field of the first interface report information, and the interface identifier and the interface name of the target interface are written in a value field of the first interface report information.

[0133] Optionally, the processor 1101 may further perform the following operation:
sending second interface report information to the control node, where the second interface report information carries an interface identifier of a target interface and interface description information of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.

[0134] The second interface report information is carried in the third BGP-LS protocol packet.

[0135] Optionally, the second interface report information is in a TLV format. A type value used to indicate the interface description information is written in a type field of the second interface report information, a length value of the second interface report information is written in a length field of the third optional information, and the interface identifier and the interface description information are written in a value field of the second interface report information.

[0136] The word "first" in names such as the "first BGP-LS protocol packet" and the "first optional information" mentioned in the embodiments of the present invention is merely used as a name identifier, and does not mean being the first in a sequence. This rule is also applicable to the word "second", "third", and the like.

[0137] It should be noted that the processor in the embodiments of the present invention may be an integrated circuit chip and has a signal processing capability. In an implementation process, steps in the foregoing methods can be implemented by using a hardware integrated logical circuit in the processor, or by using instructions in a form of software. These instructions may be implemented and controlled through cooperation of the processor, and are used to perform the methods disclosed in the embodiments of the present invention. The processor may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (application-specific integrated circuit), a field programmable gate array (Field Programmable Gate Array, FPGA) or another programmable logical device, a discrete gate or transistor logic device, or a discrete hardware component.

[0138] The general purpose processor may be a microprocessor or the processor may be any conventional processor, decoder, or the like. The steps of the method disclosed with reference to the embodiments of the present invention may be directly performed by a hardware processor, or may be performed by using a combination of hardware in the processor and a software module. A software module may be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, or the like.

[0139] In addition, it should be noted that the bus system may further include a power bus, a control bus, a status signal bus, and the like, in addition to a data bus. However, for clear description, various types of buses in FIG. 8 and FIG. 9 are marked as the bus system.

[0140] From the foregoing descriptions of the implementations, a person skilled in the art may clearly understand that some or all steps of the methods in the embodiments may be implemented by software in addition to a universal hardware platform. Based on such an understanding, the technical solutions of the present invention essentially or the part contributing to the prior art may be implemented in a form of a software product. The software product may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, or an optical disc, and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device such as media gateway) to perform the methods described in the embodiments or some parts of the embodiments of the present invention. The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one position, or may be distributed on a plurality of network units. The present invention is defined in the appended independent claims. Advantageous features are set out in the appended dependent claims.


Claims

1. A control method for collecting traffic statistics, comprising:

obtaining (201), by a control node, a statistics collection instruction, wherein the statistics collection instruction is used to instruct to collect traffic statistics of a target data flow;

generating (202), by the control node, a traffic statistics collection policy according to the statistics collection instruction, wherein the traffic statistics collection policy comprises a matching identifier of the target data flow, a first command, and a second command, the first command is used to instruct a forwarding node to set a traffic identifier for the target data flow based on the matching identifier, the second command is used to instruct the forwarding node to add traffic generated by a target packet to a traffic statistics collection result corresponding to the traffic identifier, the target packet belongs to the target data flow, and the traffic statistics collection result corresponding to the traffic identifier is used to describe the traffic of the target data flow;

sending (203), by the control node, the traffic statistics collection policy to the forwarding node; and the method further comprises:
receiving, by the control node, first interface report information sent by the forwarding node, where the first interface report information carries an interface identifier of a target interface and an interface name of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet, wherein the first interface report information is carried in a first Border Gateway Protocol-Link State, BGP-LS, protocol packet.


 
2. A control method for collecting traffic statistics, comprising:

receiving (601), by a forwarding node, a traffic statistics collection policy sent by a control node, wherein the traffic statistics collection policy carries a matching identifier of a target data flow, a first command, and a second command, the traffic statistics collection policy is generated by the control node according to a statistics collection instruction, and the statistics collection instruction is used to instruct to collect traffic statistics of the target data flow;

setting (602), by the forwarding node, a traffic identifier for the target data flow based on the first command and the matching identifier;

adding (603), by the forwarding node based on the second command, traffic generated by a target packet to a traffic statistics collection result corresponding to the traffic identifier, wherein

the target packet belongs to the target data flow, and the traffic statistics collection result corresponding to the traffic identifier is used to describe the traffic of the target data flow; and the method further comprises:
sending, by the forwarding node, first interface report information to the control node, where the first interface report information carries an interface identifier of a target interface and an interface name of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet, wherein the first interface report information is carried in a first Border Gateway Protocol-Link State, BGP-LS, protocol packet.


 
3. A control node for collecting traffic statistics, configured to:

obtain (201) a statistics collection instruction, wherein the statistics collection instruction is used to instruct to collect traffic statistics of a target data flow;

generate (202) a traffic statistics collection policy according to the statistics collection instruction, wherein the traffic statistics collection policy comprises a matching identifier of the target data flow, a first command, and a second command, the first command is used to instruct a forwarding node to set a traffic identifier for the target data flow based on the matching identifier, the second command is used to instruct the forwarding node to add traffic generated by a target packet to a traffic statistics collection result corresponding to the traffic identifier, the target packet belongs to the target data flow, and the traffic statistics collection result corresponding to the traffic identifier is used to describe the traffic of the target data flow;

send (203) the traffic statistics collection policy to the forwarding node; and the control node is further configured to:

receive first interface report information sent by the forwarding node, wherein the first interface report information carries an interface identifier of a target interface and an interface name of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet, wherein

the first interface report information is carried in a first Border Gateway Protocol-Link State, BGP-LS, protocol packet.


 
4. The control node according to claim 3, wherein the traffic statistics collection policy is carried in a Border Gateway Protocol Flow Specification, BGP FlowSpec, protocol packet, network layer reachability information of the BGP FlowSpec protocol packet carries the matching identifier, and an extended community attribute of the BGP FlowSpec protocol packet carries the first command and the second command.
 
5. The control node according to claim 3, further configured to:

receive statistics collection result report information sent by the forwarding node, wherein the statistics collection result report information carries an interface identifier of a target interface, the traffic identifier of the target data flow, and the traffic statistics collection result corresponding to the traffic identifier, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet; and

record the traffic statistics collection result corresponding to the traffic identifier as a traffic statistics collection result of the target data flow based on the statistics collection result report information.


 
6. The control node according to claim 5, wherein the statistics collection result report information is carried in a second BGP-LS protocol packet.
 
7. The control node according to claim 3, further configured to:

receive second interface report information sent by the forwarding node, wherein the second interface report information carries an interface identifier of a target interface and interface description information of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet, wherein

the second interface report information is carried in a third BGP-LS protocol packet.


 
8. A forwarding node for collecting traffic statistics, configured to:

receive (601) a traffic statistics collection policy sent by a control node, wherein the traffic statistics collection policy carries a matching identifier of a target data flow, a first command, and a second command, the traffic statistics collection policy is generated by the control node according to a statistics collection instruction, and the statistics collection instruction is used to instruct to collect traffic statistics of the target data flow;

set (602) a traffic identifier for the target data flow based on the first command and the matching identifier;

add (603), based on the second command, traffic generated by a target packet to a traffic statistics collection result corresponding to the traffic identifier, wherein

the target packet belongs to the target data flow, and the traffic statistics collection result corresponding to the traffic identifier is used to describe the traffic of the target data flow; and the forwarding node is further configured to:

send first interface report information to the control node, wherein the first interface report information carries an interface identifier of a target interface and an interface name of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet, wherein

the first interface report information is carried in a first Border Gateway Protocol-Link State, BGP-LS, protocol packet.


 
9. The forwarding node according to claim 8, wherein the traffic statistics collection policy is carried in a Border Gateway Protocol Flow Specification, BGP FlowSpec, protocol packet, network layer reachability information of the BGP FlowSpec protocol packet carries the matching identifier, and an extended community attribute of the BGP FlowSpec protocol packet carries the first command and the second command.
 
10. The forwarding node according to claim 8, wherein the forwarding node is, for setting the traffic identifier for the target data flow based on the first command and the matching identifier, configured to:

search for a forwarding entry corresponding to the matching identifier, and use the forwarding entry corresponding to the matching identifier as a forwarding entry corresponding to the target data flow; and

apply, to the forwarding entry corresponding to the target data flow, the traffic identifier indicated by the first command.


 
11. The forwarding node according to claim 8, further configured to:
send statistics collection result report information to the control node, wherein the statistics collection result report information carries an interface identifier of a target interface, the traffic identifier of the target data flow, and the traffic statistics collection result corresponding to the traffic identifier, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet.
 
12. The forwarding node according to claim 8, further configured to:

send second interface report information to the control node, wherein the second interface report information carries an interface identifier of a target interface and interface description information of the target interface, and the target interface is an interface that is on the forwarding node and that is configured to forward the target packet, wherein

the second interface report information is carried in a second BGP-LS protocol packet.


 
13. A control system for collecting traffic statistics, wherein the control system comprises a first network device and a second network device, the first network device is the control node according to any one of claims 3 to 8, and the second network device is the forwarding node according to any one of claims 9 to 14.
 


Ansprüche

1. Steuerverfahren zum Erfassen von Verkehrsstatistiken, das Folgendes umfasst:

Erhalten (201), durch einen Steuerknoten, einer Statistikerfassungsanweisung,

wobei die Statistikerfassungsanweisung verwendet wird, um die Erfassung von Verkehrsstatistiken eines Zieldatenflusses anzuweisen;

Erzeugen (202), durch den Steuerknoten, einer Verkehrsstatistik-Erfassungsrichtlinie gemäß der Statistikerfassungsanweisung,

wobei die Verkehrsstatistik-Erfassungsrichtlinie einen übereinstimmenden Identifikator des Zieldatenflusses, einen ersten Befehl und einen zweiten Befehl umfasst,

wobei der erste Befehl verwendet wird, um einen Weiterleitungsknoten anzuweisen, einen Verkehrsidentifikator für den Zieldatenfluss auf der Basis des übereinstimmenden Identifikators zu setzen, der zweite Befehl verwendet wird, um den Weiterleitungsknoten anzuweisen, von einem Zielpaket erzeugten Verkehr zu einem dem Verkehrsidentifikator entsprechenden Verkehrsstatistik-Erfassungsergebnis hinzuzufügen, das Zielpaket zu dem Zieldatenfluss gehört und das dem Verkehrsidentifikator entsprechende Verkehrsstatistik-Erfassungsergebnis verwendet wird, um den Verkehr des Zieldatenflusses zu beschreiben;

Senden (203), durch den Steuerknoten, der Verkehrsstatistik-Erfassungsrichtlinie an den Weiterleitungsknoten; und wobei das Verfahren ferner Folgendes umfasst:

Empfangen, durch den Steuerknoten, einer ersten Schnittstellenberichtsinformation, die vom Weiterleitungsknoten gesendet wurde,

wobei die erste Schnittstellenberichtsinformation einen Schnittstellenidentifikator einer Zielschnittstelle und einen Schnittstellennamen der Zielschnittstelle trägt, und die Zielschnittstelle eine Schnittstelle ist, die sich auf dem Weiterleitungsknoten befindet und die dazu ausgebildet ist, das Zielpaket weiterzuleiten,

wobei die erste Schnittstellenberichtsinformation in einem ersten "Border Gateway Protocol-Link State" (BGP-LS)-Protokollpaket übertragen wird.


 
2. Steuerverfahren zum Sammeln von Verkehrsstatistiken, das Folgendes umfasst:

Empfangen (601), durch einen Weiterleitungsknoten, einer von einem Steuerknoten gesendeten Verkehrsstatistik-Erfassungsrichtlinie,

wobei die Verkehrsstatistik-Erfassungsrichtlinie einen übereinstimmenden Identifikator eines Zieldatenflusses, einen ersten Befehl und einen zweiten Befehl trägt, die Verkehrsstatistik-Erfassungsrichtlinie von dem Steuerknoten gemäß einer Statistikerfassungsanweisung erzeugt wird und die Statistikerfassungsanweisung verwendet wird, um anzuweisen, Verkehrsstatistiken des Zieldatenflusses zu erfassen;

Festlegen (602), durch den Weiterleitungsknoten, eines Verkehrsidentifikators für den Zieldatenstrom auf der Basis des ersten Befehls und des übereinstimmenden Identifikators;

Hinzufügen (603), durch den Weiterleitungsknoten, auf der Basis des zweiten Befehls, des von einem Zielpaket erzeugten Verkehrs zu einem Verkehrsstatistik-Erfassungsergebnis, das dem Verkehrsidentifikator entspricht,

wobei das Zielpaket zu dem Zieldatenfluss gehört und das Verkehrsstatistik-Erfassungsergebnis, das dem Verkehrsidentifikator entspricht, verwendet wird, um den Verkehr des Zieldatenflusses zu beschreiben; und wobei das Verfahren ferner Folgendes umfasst:

Senden, durch den Weiterleitungsknoten, einer ersten Schnittstellenberichtsinformation an den Steuerknoten,

wobei die erste Schnittstellenberichtsinformation einen Schnittstellenidentifikator einer Zielschnittstelle und einen Schnittstellennamen der Zielschnittstelle trägt, und die Zielschnittstelle eine Schnittstelle ist, die sich auf dem Weiterleitungsknoten befindet und die dazu ausgebildet ist, das Zielpaket weiterzuleiten,

wobei die erste Schnittstellenberichtsinformation in einem ersten "Border Gateway Protocol-Link State" (BGP-LS)-Protokollpaket übertragen wird.


 
3. Steuerknoten zum Erfassen von Verkehrsstatistiken, der für Folgendes ausgebildet ist:

Erhalten (201) einer Statistikerfassungsanweisung, wobei die Statistikerfassungsanweisung verwendet wird, um die Erfassung von Verkehrsstatistiken eines Zieldatenflusses anzuweisen;

Erzeugen (202) einer Verkehrsstatistik-Erfassungsrichtlinie gemäß der Statistikerfassungsanweisung,

wobei die Verkehrsstatistik-Erfassungsrichtlinie einen übereinstimmenden Identifikator des Zieldatenflusses, einen ersten Befehl und einen zweiten Befehl umfasst,

wobei der erste Befehl verwendet wird, um einen Weiterleitungsknoten anzuweisen, einen Verkehrsidentifikator für den Zieldatenfluss auf der Basis des übereinstimmenden Identifikators zu setzen, der zweite Befehl verwendet wird, um den Weiterleitungsknoten anzuweisen, von einem Zielpaket erzeugten Verkehr zu einem dem Verkehrsidentifikator entsprechenden Verkehrsstatistik-Erfassungsergebnis hinzuzufügen, das Zielpaket zu dem Zieldatenfluss gehört und das dem Verkehrsidentifikator entsprechende Verkehrsstatistik-Erfassungsergebnis verwendet wird, um den Verkehr des Zieldatenflusses zu beschreiben;

Senden (203) der Verkehrsstatistik-Erfassungsrichtlinie an den Weiterleitungsknoten; und wobei der Steuerknoten ferner für Folgendes ausgebildet ist:

Empfangen der vom Weiterleitungsknoten gesendeten ersten Schnittstellenberichtsinformation,

wobei die erste Schnittstellenberichtsinformation einen Schnittstellenidentifikator einer Zielschnittstelle und einen Schnittstellennamen der Zielschnittstelle trägt, und die Zielschnittstelle eine Schnittstelle ist, die sich auf dem Weiterleitungsknoten befindet und die dazu ausgebildet ist, das Zielpaket weiterzuleiten,

wobei die erste Schnittstellenberichtsinformation in einem ersten "Border Gateway Protocol-Link State" (BGP-LS)-Protokollpaket übertragen wird.


 
4. Steuerknoten gemäß Anspruch 3,
wobei die Verkehrsstatistik-Erfassungsrichtlinie in einem "Border Gateway Protocol Flow Specification" (BGP "FlowSpec")-Protokollpaket übertragen wird, Netzwerkschicht-Erreichbarkeitsinformationen des BGP "FlowSpec"-Protokollpakets den übereinstimmenden Identifikator tragen und ein erweitertes Gemeinschaftsattribut des BGP FlowSpec-Protokollpakets den ersten Befehl und den zweiten Befehl trägt.
 
5. Steuerknoten gemäß Anspruch 3, der ferner für Folgendes ausgebildet ist:

Empfangen der vom Weiterleitungsknoten gesendeten Statistikerfassungsergebnis-Berichtsinformation,

wobei die Statistikerfassungsergebnis-Berichtsinformation einen Schnittstellenidentifikator einer Zielschnittstelle, den Verkehrsidentifikator des Zieldatenflusses und das dem Verkehrsidentifikator entsprechende Verkehrsstatistik-Erfassungsergebnis trägt und die Zielschnittstelle eine Schnittstelle ist, die sich auf dem Weiterleitungsknoten befindet, und die zum Weiterleiten des Zielpakets ausgebildet ist; und

Aufzeichnen des Verkehrsstatistik-Erfassungsergebnisses, das dem Verkehrsidentifikator entspricht, als Verkehrsstatistik-Erfassungsergebnis des Zieldatenflusses auf der Basis der Statistikerfassungsergebnis-Berichtsinformation.


 
6. Steuerknoten gemäß Anspruch 5,
wobei die Statistikerfassungsergebnis-Berichtsinformation in einem zweiten BGP-LS-Protokollpaket übertragen wird.
 
7. Steuerknoten gemäß Anspruch 3, der ferner für Folgendes ausgebildet ist:

Empfangen der vom Weiterleitungsknoten gesendeten zweiten Schnittstellenberichtsinformation,

wobei die zweite Schnittstellenberichtsinformation einen Schnittstellenidentifikator einer Zielschnittstelle und eine Schnittstellenbeschreibungsinformation der Zielschnittstelle trägt, und die Zielschnittstelle eine Schnittstelle ist, die sich auf dem Weiterleitungsknoten befindet und die dazu ausgebildet ist, das Zielpaket weiterzuleiten,

wobei die zweite Schnittstellenberichtsinformation in einem dritten BGP-LS-Protokollpaket übertragen wird.


 
8. Weiterleitungsknoten zum Erfassen von Verkehrsstatistiken, der für Folgendes ausgebildet ist:

Empfangen (601) einer von einem Steuerknoten gesendeten Verkehrsstatistik-Erfassungsrichtlinie,

wobei die Verkehrsstatistik-Erfassungsrichtlinie einen übereinstimmenden Identifikator eines Zieldatenflusses, einen ersten Befehl und einen zweiten Befehl trägt,

wobei die Verkehrsstatistik-Erfassungsrichtlinie durch den Steuerknoten gemäß einer Statistikerfassungsanweisung erzeugt wird und die Statistikerfassungsanweisung verwendet wird, um anzuweisen, Verkehrsstatistiken des Zieldatenflusses zu erfassen;

Festlegen (602) eines Verkehrsidentifikators für den Zieldatenfluss auf der Basis des ersten Befehls und des übereinstimmenden Identifikators;

Hinzufügen (603), auf der Basis des zweiten Befehls, des von einem Zielpaket erzeugten Verkehrs zu einem Verkehrsstatistik-Erfassungsergebnis, das dem Verkehrsidentifikator entspricht,

wobei das Zielpaket zu dem Zieldatenfluss gehört und das Verkehrsstatistik-Erfassungsergebnis, das dem Verkehrsidentifikator entspricht, verwendet wird, um den Verkehr des Zieldatenflusses zu beschreiben;

und der Weiterleitungsknoten ferner für Folgendes ausgebildet ist:

Senden der ersten Schnittstellenberichtsinformation an den Steuerknoten,

wobei die erste Schnittstellenberichtsinformation einen Schnittstellenidentifikator einer Zielschnittstelle und einen Schnittstellennamen der Zielschnittstelle trägt, und die Zielschnittstelle eine Schnittstelle ist, die sich auf dem Weiterleitungsknoten befindet und die dazu ausgebildet ist, das Zielpaket weiterzuleiten,

wobei die erste Schnittstellenberichtsinformation in einem ersten "Border Gateway Protocol-Link State" (BGP-LS)-Protokollpaket übertragen wird.


 
9. Weiterleitungsknoten gemäß Anspruch 8,
wobei die Verkehrsstatistik-Erfassungsrichtlinie in einem "Border Gateway Protocol Flow Specification" (BGP "FlowSpec")-Protokollpaket übertragen wird, Netzwerkschicht-Erreichbarkeitsinformationen des BGP "FlowSpec"-Protokollpakets den übereinstimmenden Identifikator tragen und ein erweitertes Gemeinschaftsattribut des BGP "FlowSpec"-Protokollpakets den ersten Befehl und den zweiten Befehl trägt.
 
10. Weiterleitungsknoten gemäß Anspruch 8,
wobei der Weiterleitungsknoten zum Festlegen des Verkehrsidentifikators für den Zieldatenfluss auf der Basis des ersten Befehls und des übereinstimmenden Identifikators für Folgendes ausgebildet ist:

Suchen nach einem Weiterleitungseintrag, der dem übereinstimmenden Identifikator entspricht, und Verwenden des Weiterleitungseintrags, der dem übereinstimmenden Identifikator entspricht, als ein Weiterleitungseintrag, der dem Zieldatenfluss entspricht; und

Anwenden, auf den dem Zieldatenstrom entsprechenden Weiterleitungseintrag, des durch den ersten Befehl angegebenen Verkehrsidentifikators.


 
11. Weiterleitungsknoten gemäß Anspruch 8, der ferner für Folgendes ausgebildet ist: Senden der Statistikerfassungsergebnis-Berichtsinformation an den Steuerknoten, wobei die Statistikerfassungsergebnis-Berichtsinformation einen Schnittstellenidentifikator einer Zielschnittstelle, den Verkehrsidentifikator des Zieldatenflusses und das dem Verkehrsidentifikator entsprechende Verkehrsstatistik-Erfassungsergebnis trägt und die Zielschnittstelle eine Schnittstelle ist, die sich auf dem Weiterleitungsknoten befindet, und die zum Weiterleiten des Zielpakets ausgebildet ist.
 
12. Weiterleitungsknoten gemäß Anspruch 8, der ferner für Folgendes ausgebildet ist:

Senden der zweiten Schnittstellenberichtsinformation an den Steuerknoten, wobei die zweite Schnittstellenberichtsinformation einen Schnittstellenidentifikator einer Zielschnittstelle und eine Schnittstellenbeschreibungsinformation der Zielschnittstelle trägt und die Zielschnittstelle eine Schnittstelle ist, die sich auf dem Weiterleitungsknoten befindet, und die zum Weiterleiten des Zielpakets ausgebildet ist,

wobei die zweite Schnittstellenberichtsinformation in einem zweiten BGP-LS-Protokollpaket übertragen wird.


 
13. Steuersystem zum Erfassen von Verkehrsstatistiken,
wobei das Steuersystem ein erstes Netzwerkgerät und ein zweites Netzwerkgerät umfasst, das erste Netzwerkgerät der Steuerknoten gemäß einem der Ansprüche 3 bis 8 ist und das zweite Netzwerkgerät der Weiterleitungsknoten gemäß einem der Ansprüche 9 bis 14 ist.
 


Revendications

1. Procédé de commande pour collecter des statistiques de trafic, comprenant les étapes consistant à :

obtenir (201), par un nœud de commande, une instruction de collecte de statistiques, l'instruction de collecte de statistiques étant utilisée pour donner l'instruction de collecter des statistiques de trafic d'un flux de données cible ;

générer (202), par le nœud de commande, une stratégie de collecte de statistiques de trafic selon l'instruction de collecte de statistiques, la stratégie de collecte de statistiques de trafic comprenant un identifiant de mise en correspondance du flux de données cible, une première commande et une seconde commande, la première commande étant utilisée pour donner l'instruction à un nœud de transfert de définir un identifiant de trafic pour le flux de données cible sur la base de l'identifiant de mise en correspondance, la seconde commande étant utilisée pour donner l'instruction au nœud de transfert d'ajouter un trafic généré par un paquet cible à un résultat de collecte de statistiques de trafic qui correspond à l'identifiant de trafic, le paquet cible appartenant au flux de données cible, et le résultat de collecte de statistiques de trafic qui correspond à l'identifiant de trafic étant utilisé pour décrire le trafic du flux de données cible ;

envoyer (203), par le nœud de commande, la stratégie de collecte de statistiques de trafic au nœud de transfert ; et le procédé comprenant en outre l'étape consistant à : recevoir, par le nœud de commande, des premières informations de rapport d'interface envoyées par le nœud de transfert, les premières informations de rapport d'interface transportant un identifiant d'interface d'une interface cible et un nom d'interface de l'interface cible, et l'interface cible étant une interface qui est sur le nœud de transfert et qui est configurée pour transférer le paquet cible, les premières informations de rapport d'interface étant transportées dans un premier paquet de protocole d'état de liaison sur protocole de passerelle frontière (BGP-LS).


 
2. Procédé de commande pour collecter des statistiques de trafic, comprenant les étapes consistant à :

recevoir (601), par un nœud de transfert, une stratégie de collecte de statistiques de trafic envoyée par un nœud de commande, la stratégie de collecte de statistiques de trafic transportant un identifiant de mise en correspondance d'un flux de données cible, une première commande et une seconde commande, la stratégie de collecte de statistiques de trafic étant générée par le nœud de commande selon une instruction de collecte de statistiques, et l'instruction de collecte de statistiques étant utilisée pour donner l'instruction de collecte des statistiques de trafic du flux de données cible ; définir (602), par le nœud de transfert, un identifiant de trafic pour le flux de données cible sur la base de la première commande et de l'identifiant de mise en correspondance ;

ajouter (603), par le nœud de transfert sur la base de la seconde commande, un trafic généré par un paquet cible à un résultat de collecte de statistiques de trafic qui correspond à l'identifiant de trafic,

le paquet cible appartenant au flux de données cible, et le résultat de collecte de statistiques de trafic qui correspond à l'identifiant de trafic étant utilisé pour décrire le trafic du flux de données cible ; et le procédé comprenant en outre l'étape consistant à :
envoyer, par le nœud de transfert, des premières informations de rapport d'interface au nœud de commande, les premières informations de rapport d'interface transportant un identifiant d'interface d'une interface cible et un nom d'interface de l'interface cible, et l'interface cible étant une interface qui est sur le nœud de transfert et qui est configurée pour transférer le paquet cible, les premières informations de rapport d'interface étant transportées dans un premier paquet de protocole d'état de liaison sur protocole de passerelle frontière (BGP-LS).


 
3. Nœud de commande pour collecter des statistiques de trafic, configuré pour :

obtenir (201) une instruction de collecte de statistiques, l'instruction de collecte de statistiques étant utilisée pour donner l'instruction de collecter des statistiques de trafic d'un flux de données cible ;

générer (202) une stratégie de collecte de statistiques de trafic selon l'instruction de collecte de statistiques, la stratégie de collecte de statistiques de trafic comprenant un identifiant de mise en correspondance du flux de données cible, une première commande et une seconde commande, la première commande étant utilisée pour donner l'instruction à un nœud de transfert de définir un identifiant de trafic pour le flux de données cible sur la base de l'identifiant de mise en correspondance, la seconde commande étant utilisée pour donner l'instruction au nœud de transfert d'ajouter un trafic généré par un paquet cible à un résultat de collecte de statistiques de trafic qui correspond à l'identifiant de trafic, le paquet cible appartenant au flux de données cible, et le résultat de collecte de statistiques de trafic qui correspond à l'identifiant de trafic étant utilisé pour décrire le trafic du flux de données cible ;

envoyer (203) la stratégie de collecte de statistiques de trafic au nœud de transfert ; et le nœud de commande étant en outre configuré pour :

recevoir des premières informations de rapport d'interface envoyées par le nœud de transfert, les premières informations de rapport d'interface transportant un identifiant d'interface d'une interface cible et un nom d'interface de l'interface cible, et l'interface cible étant une interface qui est sur le nœud de transfert et qui est configurée pour transférer le paquet cible,

les premières informations de rapport d'interface étant transportées dans un premier paquet de protocole d'état de liaison sur protocole de passerelle frontière (BGP-LS).


 
4. Nœud de commande selon la revendication 3, dans lequel la stratégie de collecte de statistiques de trafic est transportée dans un paquet de protocole de spécification de flux sur protocole de passerelle frontière (BGP FlowSpec), des informations d'accessibilité de couche de réseau du paquet de protocole BGP FlowSpec transportent l'identifiant de mise en correspondance, et un attribut communautaire étendu du paquet de protocole BGP FlowSpec transporte la première commande et la seconde commande.
 
5. Nœud de commande selon la revendication 3, configuré en outre pour :

recevoir des informations de rapport de résultat de collecte de statistiques envoyées par le nœud de transfert, les informations de rapport de résultat de collecte de statistiques transportant un identifiant d'interface d'une interface cible, l'identifiant de trafic du flux de données cible et le résultat de collecte de statistiques de trafic qui correspond à l'identifiant de trafic, et l'interface cible étant une interface qui est sur le nœud de transfert et qui est configurée pour transférer le paquet cible ; et

enregistrer le résultat de collecte de statistiques de trafic qui correspond à l'identifiant de trafic en tant que résultat de collecte de statistiques de trafic du flux de données cible sur la base des informations de rapport de résultat de collecte de statistiques.


 
6. Nœud de commande selon la revendication 5, dans lequel les informations de rapport de résultat de collecte de statistiques sont transportées dans un deuxième paquet de protocole BGP-LS.
 
7. Nœud de commande selon la revendication 3, configuré en outre pour :

recevoir des secondes informations de rapport d'interface envoyées par le nœud de transfert, les secondes informations de rapport d'interface transportant un identifiant d'interface d'une interface cible et des informations de description d'interface de l'interface cible, et l'interface cible étant une interface qui est sur le nœud de transfert et qui est configurée pour transférer le paquet cible,

les secondes informations de rapport d'interface étant transportées dans un troisième paquet de protocole BGP-LS.


 
8. Nœud de transfert pour collecter des statistiques de trafic, configuré pour :

recevoir (601) une stratégie de collecte de statistiques de trafic envoyée par un nœud de commande, la stratégie de collecte de statistiques de trafic transportant un identifiant de mise en correspondance d'un flux de données cible, une première commande et une seconde commande, la stratégie de collecte de statistiques de trafic étant générée par le nœud de commande selon une instruction de collecte de statistiques, et l'instruction de collecte de statistiques étant utilisée pour donner l'instruction de collecte des statistiques de trafic du flux de données cible ;

définir (602) un identifiant de trafic pour le flux de données cible sur la base de la première commande et de l'identifiant de mise en correspondance ;

ajouter (603), sur la base de la seconde commande, un trafic généré par un paquet cible à un résultat de collecte de statistiques de trafic qui correspond à l'identifiant de trafic, le paquet cible appartenant au flux de données cible, et le résultat de collecte de statistiques de trafic qui correspond à l'identifiant de trafic étant utilisé pour décrire le trafic du flux de données cible ; et le nœud de transfert étant en outre configuré pour : envoyer des premières informations de rapport d'interface au nœud de commande, les premières informations de rapport d'interface transportant un identifiant d'interface d'une interface cible et un nom d'interface de l'interface cible, et l'interface cible étant une interface qui est sur le nœud de transfert et qui est configurée pour transférer le paquet cible,

les premières informations de rapport d'interface étant transportées dans un premier paquet de protocole d'état de liaison sur protocole de passerelle frontière (BGP-LS).


 
9. Nœud de transfert selon la revendication 8, dans lequel la stratégie de collecte de statistiques de trafic est transportée dans un paquet de protocole de spécification de flux sur protocole de passerelle frontière (BGP FlowSpec), des informations d'accessibilité de couche de réseau du paquet de protocole BGP FlowSpec transportent l'identifiant de mise en correspondance, et un attribut communautaire étendu du paquet de protocole BGP FlowSpec transporte la première commande et la seconde commande.
 
10. Nœud de transfert selon la revendication 8, le nœud de transfert étant, pour définir l'identifiant de trafic pour le flux de données cible sur la base de la première commande et de l'identifiant de mise en correspondance, configuré pour :

rechercher une entrée de transfert qui correspond à l'identifiant de mise en correspondance et utiliser l'entrée de transfert qui correspond à l'identifiant de mise en correspondance en tant qu'entrée de transfert qui correspond au flux de données cible ; et

appliquer, à l'entrée de transfert qui correspond au flux de données cible, l'identifiant de trafic indiqué par la première commande.


 
11. Nœud de transfert selon la revendication 8, configuré en outre pour :
envoyer des informations de rapport de résultat de collecte de statistiques au nœud de commande, les informations de rapport de résultat de collecte de statistiques transportant un identifiant d'interface d'une interface cible, l'identifiant de trafic du flux de données cible et le résultat de collecte de statistiques de trafic qui correspond à l'identifiant de trafic, et l'interface cible étant une interface qui est sur le nœud de transfert et qui est configurée pour transférer le paquet cible.
 
12. Nœud de transfert selon la revendication 8, configuré en outre pour :

envoyer des secondes informations de rapport d'interface au nœud de commande, les secondes informations de rapport d'interface transportant un identifiant d'interface d'une interface cible et des informations de description d'interface de l'interface cible, et l'interface cible étant une interface qui est sur le nœud de transfert et qui est configurée pour transférer le paquet cible,

les secondes informations de rapport d'interface étant transportées dans un deuxième paquet de protocole BGP-LS.


 
13. Système de commande pour collecter des statistiques de trafic, le système de commande comprenant un premier dispositif de réseau et un second dispositif de réseau, le premier dispositif de réseau étant le nœud de commande selon l'une quelconque des revendications 3 à 8 et le second dispositif de réseau étant le nœud de transfert selon l'une quelconque des revendications 9 à 14.
 




Drawing























Cited references

REFERENCES CITED IN THE DESCRIPTION



This list of references cited by the applicant is for the reader's convenience only. It does not form part of the European patent document. Even though great care has been taken in compiling the references, errors or omissions cannot be excluded and the EPO disclaims all liability in this regard.

Patent documents cited in the description