WO2015143620A1 - 一种数据流统计方法、系统和装置 - Google Patents

一种数据流统计方法、系统和装置 Download PDF

Info

Publication number
WO2015143620A1
WO2015143620A1 PCT/CN2014/074016 CN2014074016W WO2015143620A1 WO 2015143620 A1 WO2015143620 A1 WO 2015143620A1 CN 2014074016 W CN2014074016 W CN 2014074016W WO 2015143620 A1 WO2015143620 A1 WO 2015143620A1
Authority
WO
WIPO (PCT)
Prior art keywords
flow
identification information
entry
counted
flow entry
Prior art date
Application number
PCT/CN2014/074016
Other languages
English (en)
French (fr)
Inventor
沈伟锋
赵秀楚
张小波
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2014/074016 priority Critical patent/WO2015143620A1/zh
Priority to CN201480000193.9A priority patent/CN105191212B/zh
Publication of WO2015143620A1 publication Critical patent/WO2015143620A1/zh
Priority to US15/274,511 priority patent/US10148596B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • H04L49/3009Header conversion, routing tables or routing tags
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/40Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks using virtualisation of network functions or resources, e.g. SDN or NFV entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/64Hybrid switching systems
    • H04L12/6418Hybrid transport
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/142Network analysis or design using statistical or mathematical methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/02Capturing of monitoring data
    • H04L43/026Capturing of monitoring data using flow identification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a data stream statistics method, system and apparatus. Background technique
  • the purpose of the network traffic analysis system is to monitor the traffic running on the network device and the network, discover the abnormal conditions in the network in time, and remind the network administrators to take necessary measures to ensure the normal operation of the network.
  • Openflow is a protocol for implementing Software Defined Network (SDN).
  • SDN Software Defined Network
  • the basic idea of Openflow network is to realize the separation of data forwarding layer and control layer.
  • the OpenFlow switch is responsible for forwarding the data layer, and the controller (Controller) implements the control layer function.
  • the switch communicates with the controller through the Openflow protocol, and the controller manages the switch through the Openflow protocol.
  • the OpenFlow switch is responsible for data forwarding. After receiving the data packet, the OpenFlow switch matches the flow entry in the flow table. If the upstream entry matches the upstream entry, the packet is forwarded according to the flow entry.
  • the OpenFlow switch has a separate counter field in each flow entry, which is used to count matching packets, so it can naturally support the statistics of the data flow.
  • the OpenFlow.2 version and subsequent versions introduce a multi-flow table structure.
  • the switch includes one or more flow tables for step-by-step lookup for searching and forwarding.
  • One data stream is forwarded by matching multiple flow tables step by step.
  • the flow table compression is implemented, but inevitably brings the following problems: Each data stream is matched and forwarded through a combination of flow table entries of the multi-flow table, and each flow entry is no longer directed to a single data flow, so a single data flow
  • the complete information cannot be obtained from the flow table, that is, the statistics of the data flow cannot be obtained from the counter field of the flow entry.
  • Embodiments of the present invention provide a data flow statistics method, system, and apparatus, which implement mutual integration of statistical information.
  • a first aspect of the embodiments of the present invention provides a data flow statistics method, which is applied to statistics that a switch processes a data flow object by receiving a data packet, where the method includes: Matching a first part of the data packet with a first flow entry in the first flow table; if the first partial field matches the first flow entry, and the first flow entry is the And collecting, by the first flow entry, the first identifier information and the at least one second identifier information in the first flow entry;
  • the first identifier information is used to identify that the first part of the field matches the first flow entry, and the at least one second identifier is used to identify at least one second part of the data packet. Matching with the second flow entry in the at least one second flow table.
  • the first record is recorded in the global statistical identifier An identification information.
  • the first part of the data packet is The first flow entry in the first flow table is matched, and previously includes:
  • configuration information for performing statistics on the to-be-statisticd flow object where the configuration information includes at least two flow entry items corresponding to the to-be-statisticized flow object, and the at least two flow entry items respectively Matching identification information.
  • the method further includes:
  • Recording the first identifier information in the global statistic identifier includes: And writing, by the attribute of the metadata in the first flow entry, the first identification information and the at least one second identification information.
  • a second aspect of the embodiments of the present invention provides a data flow statistics method, including:
  • the controller determines, according to the feature information of the flow object to be counted, at least two flow entry items corresponding to the to-be-statisticd flow object;
  • the controller sends, to the switch, configuration information for performing statistics on the to-be-statisticd flow object, where the configuration information includes the at least two flow entry items, and each flow entry of the at least two flow entry items Matching the identification information, so that the switch performs statistics on the to-be-statisticd flow object according to the at least two flow entry items and the identification information that matches the respective flow entry.
  • the method further includes: the controller sending a query request to the switch, where the query request includes identifier information corresponding to the to-be-statisticd flow object ;
  • the controller receives the statistics information in the first flow entry that is searched by the switch according to the query request, and the identifier information included in the query request is recorded in the first flow entry.
  • a third aspect of the embodiments of the present invention provides a data flow statistics apparatus, which is configured to perform statistics on a statistical flow object by using a received data packet, and specifically includes:
  • a matching unit configured to match a first part field in the data packet with a first flow table item in the first flow table
  • a recording unit configured to: if the first part field matched by the matching unit matches the first flow entry, and the first flow entry is the last flow entry corresponding to the to-be-statisticd flow object, and the And the at least one second identifier information is included in the global statistic identifier, and the first identifier information and the at least one second identifier information are recorded in the first flow entry, where the first identifier information is used to identify the first And the at least one second identifier information is used to identify at least one second partial field in the data packet and the second one in the at least one second flow table, respectively; Match the items;
  • a statistic unit configured to perform statistics of the to-be-statisticd flow object in the first flow entry, and record statistical information of the to-be-statisticd flow object.
  • the recording unit is further configured to: if the first part field matched by the matching unit matches the first flow entry, and the first flow entry is not the last flow entry corresponding to the to-be-statisticd flow object, And the first identifier information is recorded in the global statistical identifier.
  • the apparatus further includes:
  • a configuration receiving unit configured to receive configuration information that is sent by the controller for performing statistics on the to-be-statisticd flow object, where the configuration information includes at least two flow entry items corresponding to the to-be-statisticized flow object, and respectively At least two flow table entries match the identification information.
  • the apparatus further includes:
  • a query receiving unit configured to receive a query request sent by the controller, where the query request includes identifier information corresponding to the to-be-statisticd flow object;
  • a statistics sending unit configured to search, in the first flow table, the first flow entry corresponding to the identifier information included in the query request received by the query receiving unit, and the location in the first flow entry
  • the statistical information is sent to the controller.
  • the recording unit is specifically configured to write the first identification information and the at least one second identification information under the attribute of the metadata in the first flow entry.
  • a fourth aspect of the embodiments of the present invention provides a controller, including:
  • a flow entry determining unit configured to determine, according to the feature information of the flow object to be counted, at least two flow entries corresponding to the to-be-statisticd flow object;
  • An identifier determining unit configured to determine identifier information that matches each of the at least two flow entry items determined by the flow entry determining unit;
  • a configuration sending unit configured to send, to the switch, configuration information for performing statistics on the to-be-statisticd flow object, where the configuration information includes at least two flow entry items determined by the flow entry determination unit, and the identifier determination unit determines Identification information that matches each of the at least two flow entries, so that the switch matches the at least two flow entries and the respective flow entries The identification information is used to perform statistics on the flow object to be counted.
  • the controller further includes: a query sending unit, configured to send a query request to the switch, where the query request includes the to-be-statisticd flow object corresponding to Identification information;
  • a statistical receiving unit configured to receive the statistical information in the first flow entry that is searched by the switch according to the query request sent by the query sending unit, where the first flow entry records the identification information included in the query request.
  • a fifth aspect of the embodiments of the present invention provides a switch, which is applied to statistics of a flow object to be processed by a received data packet, including a processor and a memory connected to the bus, where:
  • the memory is configured to store an execution instruction
  • the processor is configured to communicate with the memory, and execute the execution instruction, so that the switch performs a method of: matching a first part field in the data packet with a first flow entry in a first flow table And if the first part field matches the first flow entry, and the first flow entry is the last flow entry corresponding to the to-be-statisticd flow object, and the global statistical identifier includes at least one
  • the second identifier information is used to record the first identifier information and the at least one second identifier information in the first flow entry, and perform statistics on the to-be-statisticd flow object in the first flow entry, and record the to-be-stated Statistics of the flow object;
  • the first identifier information is used to identify that the first part of the field matches the first flow entry, and the at least one second identifier is used to identify at least one second part of the data packet. Matching with the second flow entry in the at least one second flow table.
  • the method of executing the execution instruction by the processor to cause the switch to perform further includes: if the first partial field matches the first flow entry, and the first flow entry is not corresponding to the to-be-statisticd flow object The last flow entry is recorded in the global statistical identifier.
  • the switch further includes a receiver connected to the bus:
  • the receiver is configured to receive, by the controller, a statistical calculation for the to-be-statisticd flow object
  • the configuration information includes at least two flow entry items corresponding to the to-be-statisticd flow object, and identification information respectively matching the at least two flow entry items.
  • the switch further includes a transmitter connected to the bus, where: the receiver And the method further includes: receiving the query request sent by the controller, where the query request includes the identifier information corresponding to the to-be-statisticd flow object;
  • the method for the processor to execute the execution instruction to cause the switch to execute further comprising: searching, in the first flow table, the first flow table corresponding to the identifier information included in a query request received by the receiver Item
  • the transmitter is configured to send the statistics information in the first flow entry to the controller.
  • the method of executing the execution instruction by the processor to cause the switch to execute specifically includes: writing the first identification information and the at least one second identification information under an attribute of the metadata in the first flow entry.
  • a sixth aspect of the embodiments of the present invention provides a controller, including: a processor and a transmitter and a memory connected to a bus, where:
  • the memory is configured to store an execution instruction
  • the processor is configured to communicate with the memory, and execute the execution instruction, so that the controller performs a method of: determining, according to feature information of the flow object to be counted, at least two flows corresponding to the to-be-statisticd flow object An entry that determines identifier information that matches each of the at least two flow entry entries;
  • the transmitter is configured to send, to the switch, configuration information for performing statistics on the to-be-statisticd flow object, where the configuration information includes the at least two flow entry entries, and each of the at least two flow entry entries
  • the identifier of the flow to be counted is performed by the switch according to the at least two flow entries and the identifier information that matches the flow entry.
  • the controller further includes a receiver connected to the bus, where: The transmitter is further configured to send a query request to the switch, where the query request includes identifier information corresponding to the to-be-statisticd flow object;
  • the receiver is configured to receive the statistics information in the first flow entry that is searched by the switch according to the query request sent by the transmitter, where the first flow entry records the identification information included in the query request.
  • a seventh aspect of the embodiments of the present invention provides a data flow statistics system, including a controller, and one or more switches.
  • the switch is a data flow statistics device according to the third aspect of the embodiment of the present invention, or the possible implementation manner of any one of the first to fourth possible implementation manners of the third aspect;
  • the controller is a controller as described in the fourth aspect of the embodiments of the invention, or the first possible implementation of the fourth aspect.
  • An eighth aspect of the embodiments of the present invention provides a data flow statistics system, including a controller, and one or more switches.
  • the switch is the switch according to the fifth aspect of the embodiment of the present invention, or the possible implementation manner of any one of the first to fourth possible implementation manners of the fifth aspect;
  • the controller is a controller as described in the sixth aspect of the embodiments of the invention, or the first possible implementation of the sixth aspect.
  • the switch records the first identifier information and the at least one second identifier information in the first flow entry, and The statistics of the flow object to be counted are recorded in the first flow entry, and the statistical information of the flow object to be counted is recorded.
  • the identifier information is recorded to identify the flow object that has passed the flow entry, and the flow object is counted in the flow entry of the multiple flow table.
  • the information does not count the data flow through the flow entry in isolation, and realizes the combination of statistical information, which helps the controller to further analyze the data traffic.
  • FIG. 2 is a flowchart of a data flow statistics method according to Embodiment 1 of the present invention
  • FIG. 3 is a flowchart of another data flow statistics method according to Embodiment 1 of the present invention
  • FIG. 4 is a method implementation of the present invention. A flowchart of a data flow statistics method provided in the second embodiment
  • FIG. 5 is a flowchart of another data flow statistics method according to Embodiment 2 of the method of the present invention
  • FIG. 6 is a data flow statistics of a switch in Embodiment 3 of the method of the present invention
  • FIG. 7 is a schematic structural diagram of a data flow statistical device according to Embodiment 1 of the present invention
  • FIG. 8 is a schematic structural diagram of another data flow statistical device according to Embodiment 1 of the present invention
  • FIG. 10 is a schematic structural diagram of a controller provided in Embodiment 3 of the device of the present invention.
  • FIG. 11 is a schematic structural diagram of another controller according to Embodiment 3 of the apparatus of the present invention
  • FIG. 12 is a schematic structural diagram of another controller provided in Embodiment 4 of the apparatus of the present invention.
  • the system may include a controller and at least one switch (m switches in FIG. 1), wherein the controller manages each switch through a protocol of openfolw data traffic; and each switch has a similar structure, and may include and a controller A management channel is connected, and multiple flow tables can be stored in each switch, and each flow table includes at least two flow entries.
  • the method in this embodiment is a method performed by the switch, which is mainly used in the multi-stream expression in the switch, and the switch processes the statistical method of the flow object through the received data packet.
  • the flowchart is as shown in FIG. 2, and includes:
  • Step 101 Match the first part field in the received data packet with the first flow entry in the first flow table, and if it matches, further determine whether the first flow entry is the last flow corresponding to the flow object to be counted. If the entries do not match, the switch discards the packet and does not perform statistics.
  • the switch can perform statistics on the statistics flow object according to the configuration of the controller, for example, the media access control (MAC) address is xx. xx. xx. xx. xx.80, the destination network protocol The (IP) address is 192.168.0.3, and the port (port) is a flow object of 80.
  • the one or more features of the flow object may correspond to one flow entry, and each flow entry may include a matching field.
  • Match field ) and counter ( counter ), can also include priority ( priority ), timeout time, a set of commands to match packets and a small piece of text information (Cookies ), etc.
  • Match field mainly used for The data packet is matched, and may include any one or more of information such as a port, an address, and a protocol;
  • the priority is used to query the flow entry. If multiple flow entries match the query request, the priority of the flow entry is selected. Specifically, the flow entry with the higher priority is selected. a counter for counting data streams that match the matching fields above;
  • Timeout period which is the maximum time count or data stream valid time
  • Cookie which is the opaque data value selected by the controller, is used by the controller to filter stream statistics, stream changes, and stream deletes, but cannot be used when matching packets.
  • the switch after receiving the data packet, the switch needs to match each field in the data packet with a corresponding flow entry in multiple flow tables stored in the switch.
  • the switch needs to record when the field in the data packet matches the first flow entry in a flow table (such as the first flow table).
  • the first identification information and if any one of the fields of the data packet does not match a flow entry, the switch can discard the data packet.
  • the switch performs steps 102 and 103, if the first flow entry is not If the last flow entry corresponding to the flow object is to be counted, step 104 is performed.
  • the first identifier information is used to identify that the first part of the data packet matches the first flow entry
  • the at least one second identifier is used to identify the at least one second part of the data packet and the at least one second flow respectively.
  • the second flow entry in the table matches; and if the at least one second identification information is not included in the global statistical identifier, the switch discards the data packet.
  • Step 102 Record, in the first flow entry, the first identifier information and the at least one second identifier information in the global statistics identifier.
  • the information used to identify a part of the data packet matching the flow entry may be the same or different.
  • the first identifier information is 01
  • the second part of the data packet is used to identify the second part of the data packet.
  • the information matching the flow entry can be 01 or 10.
  • Step 103 Perform statistics on the flow object to be counted in the first flow entry, and record statistics of the flow object to be counted. Specifically, the statistics are performed by using a counter in the first flow entry, that is, adding the current counter value. 1.
  • Step 104 Record the first identifier information in the global statistical identifier. Further, in this case, the switch may also perform statistics by using a counter in the first flow entry, that is, the counter of the first flow entry is incremented by one.
  • the switch when the switch receives a data packet, the switch sets a corresponding global statistical identifier, specifically, the attribute of the metadata of the data packet is used as a global statistical identifier, and Each of the first identifier information and the at least one second identifier information may be written in the attribute of the metadata in the first flow entry when the switch performs the foregoing step 102. .
  • the switch can set the N-bit in the global statistic identifier to record the identification information of each field of the data packet that matches the flow entry corresponding to the flow object to be statistic, where the size of N and the flow object to be statistic The number of corresponding flow entries is the same. It should be noted that, as the data packet is discarded, or as the data packet is transferred out of the switch, The global statistics ID of the number of packets is also discarded.
  • the method performed by the switch to match other second flow entries is similar to the method performed when the first flow entry is matched. The difference is that the processed information is different, so that multiple flow entry pairs are used.
  • Each flow entry of the data packet is matched step by step, and each identification information is recorded in the global statistical table of the data packet, so that each identification information is recorded in the last flow entry corresponding to the flow object to be counted.
  • the plurality of partial fields in the identification data packet are respectively matched with the plurality of flow entry items corresponding to the flow object to be counted, and the number of paths passing through the multiple flow entry can be counted by using a counter in the last flow entry.
  • the switch records the first identifier information and the at least one second identifier information in the first flow entry, and The statistics of the flow objects to be counted are recorded in the first-class entries, and the statistics of the flow objects to be counted are recorded.
  • the identifier information is recorded to identify the flow object that has passed the flow entry, and the flow object is counted in the flow entry of the multiple flow table.
  • the information does not count the data flow through the flow entry in isolation, and realizes the combination of statistical information, which helps the controller to further analyze the data traffic.
  • the foregoing steps 101 to 104 are performed by the switch, and the statistics of the to-be-statisticd flow object are mainly configured by the controller.
  • the switch Before performing the foregoing step 101, the switch may perform step 105. After the statistics flow object is counted, the switch can also perform steps 16 and 107 to send the statistics of the controller query to the controller, specifically:
  • Step 105 The switch receives configuration information that is sent by the controller to collect statistics on the to-be-statisticd flow object, where the configuration information includes at least two flow entry items corresponding to the flow object to be counted, and identifier information that matches each flow entry.
  • the identifier information that matches the flow entry is the same, or different, for example, the identifier information that matches the first flow entry is the identifier information a, and the identifier information that matches the second flow entry is the identifier information b, Where a and b may be the same or different.
  • Step 106 The switch receives the query request sent by the controller, where the query request includes each identifier information corresponding to the to-be-statisticd flow object that is requested to be queried.
  • Step 107 The switch searches, in the first flow table, the identifier information included in the query request. Corresponding first flow entry, and sending statistics in the first flow entry to the controller. Specifically, the switch may send information about the counter in the first flow entry to the controller.
  • the controller can control the statistics of the switch to the statistical flow object, and can also query the statistical information, so that the controller can further analyze the flow object to be statistically counted by each switch in the network.
  • Another method for collecting data streams is also provided, which is mainly applied to the system shown in FIG. 1 above, which is mainly a statistical method for a switch to treat a statistical stream object by using a received data packet, and the method of the embodiment is performed by a controller.
  • the method, the flow chart shown in Figure 4 includes:
  • Step 201 The controller determines, according to the feature information of the flow object to be counted, at least two flow entries corresponding to the flow object to be counted, wherein the feature information of the flow target to be counted may include information such as a MAC address, an IP address, a protocol, or a port.
  • Step 202 The controller determines the identifier information that matches each of the at least two flow entry entries, where the identifier information that matches each flow entry may be the same or different.
  • Step 203 The controller sends, to the switch, configuration information for performing statistics on the flow object, where the configuration information includes the at least two flow entries, and each of the at least two flow entries respectively Matching the identification information, so that after receiving the configuration information, the switch can perform statistics on the flow object to be counted according to at least two flow entry items and the identification information matching each flow entry. Specifically, The methods of steps 101 to 104 are performed, and no comment is made here.
  • the controller may send the identifier information that matches each flow entry to the switch for statistics, so that the switch may record each identifier information in the last flow entry corresponding to the flow object to be collected to identify the A flow object of multiple flow entries, and statistics of such flow objects, so that the statistical information in the flow entry does not count the data flow passing through the flow entry in isolation, thereby realizing the mutual combination of statistical information. Help the controller to further analyze the data traffic.
  • the controller can follow the above steps.
  • 201 to 203 control the switch to perform statistics on the flow object to be counted, and perform the following steps 204 and 205 to query the statistics of the flow object passing through the plurality of flow entry items, specifically:
  • Step 204 The controller sends a query request to the switch, where the query request includes the identifier information corresponding to the to-be-statisticd flow object, where the identifier information may include the to-be-statistic stream requested by the query request. Identification information that matches objects to multiple flow table entries.
  • Step 205 The controller receives the statistical information in the first flow entry that is searched by the switch according to the query request, and the identifier information included in the query request is recorded in the first flow entry that is searched.
  • the controller may query the switch for the statistical information, and the statistic information that is queried may include the statistics of the to-be-statisticd flow object that has passed the multiple flow entry, instead of the independent statistics in each flow entry.
  • the information can be used to facilitate further analysis of the data flow counted by each switch in the network.
  • the data flow statistics method of the embodiment of the present invention is described in a specific application example, and can be mainly applied to the system shown in FIG. 1, specifically:
  • the controller sends configuration information to the switch.
  • the configuration information includes three flow entries.
  • the matching fields included in the flow entry are: MAC address xx.xx.xx.xx.xx.xx.80, destination IP address.
  • the address is 192.168.0.3, and the port (port) is 80.
  • the structure of the flow entry can be as shown in Figure 6.
  • the configuration information also includes the identification information that matches the three flow entries.
  • the switch when the switch receives the packet, the switch will include the packet.
  • the MAC address matches the flow entry 1 in flow table 1 first. If it matches the matching field xx.xx.xx.xx.xx.80 in flow entry 1, the switch will be in the global statistics identifier.
  • the identification information 01 is written in, for example, the metadata attribute of the data packet.
  • the switch matches the destination IP address contained in the data packet with the flow entry 2 in the flow table 2. If the matching field 192.168.0.3 in the flow entry 2 matches, the switch 2 continues in the global statistics identifier. Write identification information 01.
  • the switch matches the port included in the data packet with the flow entry 2, if it matches the matching field 80 in the flow entry 3 in the flow table 3, and the flow entry 3 is the last corresponding to the flow object to be counted.
  • a flow entry in which the global statistical identifier includes the identification information 0101 that matches the flow entry 1 and 2 respectively, the switch writes the identification information under the metadata attribute of the matching field in the flow entry 3. 010101, including each identifier information that matches the flow entry 1 to 3 respectively; and the switch adds 1 to the value of the counter of the matching field in the flow entry 3 to perform statistics.
  • the controller needs to query the statistics of the statistics of a certain flow object, the controller sends a query request to the switch, and the query request includes the identifier information corresponding to the flow object to be counted. For example, 010101; the switch will query in the stored flow table 3, and find that the flow entry 3 includes the identification information 010101, the switch will send the information of the counter in the flow entry to the controller.
  • a data flow statistics device such as a switch, is configured to perform statistics on the flow object to be processed by the received data packet.
  • the structure diagram is as shown in FIG. 7, and specifically includes:
  • the matching unit 11 is configured to match the first part field in the data packet with the first flow table item in the first flow table.
  • the recording unit 12 is configured to: if the first part field matches the first flow entry, and the first flow entry is the last flow entry corresponding to the to-be-statisticd flow object, and the global statistical identifier And including at least one second identifier information, where the first identifier information and the at least one second identifier information are recorded in the first flow entry; wherein the first identifier information is used to identify the first part field and The first flow entry is matched, and the at least one second identification information is used to identify that at least one second partial field in the data packet matches a second flow entry in the at least one second flow table.
  • the recording unit 12 can also discard the data packet. Specifically, the recording unit 12 may specifically write the first identification information and the at least one second identification information under the attribute of the metadata in the first flow entry.
  • the statistic unit 13 is configured to perform statistics on the to-be-statisticd flow object in the first flow entry, and record the statistical information of the to-be-statisticd flow object, that is, the count value of the counter in the first flow entry is incremented by one.
  • the foregoing recording unit 12 is further configured to: when the first flow entry is not the last flow entry corresponding to the to-be-stated flow object, record the first identification information in the global statistical identifier.
  • the matching unit 11 if a part of the data packet matched by the matching unit 11 matches a certain flow entry of the row in the flow table (such as the first flow entry), and the first flow table
  • the item is the last flow entry corresponding to the flow of the flow
  • the at least one second identification information is recorded in the global statistical identifier of the data
  • the recording unit 12 records the first identification information in the first flow entry.
  • At least one second identification information, and the statistics unit 13 performs statistics on the flow object to be counted in the first flow entry, and records statistical information of the flow object to be counted.
  • each identification information is recorded to identify the flow that passes through multiple flow entries. Objects, and statistics of such flow objects, so that the statistics in the flow entries of multiple flow tables do not count the data flows through the flow entries in isolation, thereby realizing the combination of statistical information and facilitating control. Further analysis of data traffic.
  • the data statistics device may include a configuration receiving unit 14, a query receiving unit 15, and a statistical sending unit 16, in addition to the structure shown in FIG.
  • the configuration receiving unit 14 is configured to receive configuration information that is sent by the controller for performing statistics on the to-be-statisticd flow object, where the configuration information includes at least two flow entry items corresponding to the to-be-statisticd flow object, and respectively The identifier information that matches at least two flow entry items is the same; the identifier information that matches each flow table entry is the same, or different.
  • the query receiving unit 15 is configured to receive the query request sent by the controller, where the query request includes the identifier information corresponding to the to-be-statisticd flow object;
  • the statistics sending unit 16 is configured to search, in the first flow table, the first flow entry corresponding to the identifier information included in the query request by the query receiving unit 15 and the location in the first flow entry The statistical information is sent to the controller.
  • the recording unit 12 records the first identification information and the at least one second identification information according to the configuration information; and when the query receiving unit 15 receives the query request, The statistics sending unit 16 searches for the corresponding statistical information, such as the value of the counter, in the last flow entry corresponding to the queried flow object.
  • a switch is provided for applying statistics on a statistical flow object by using a received data packet.
  • the schematic diagram of the structure is as shown in FIG. 9. It may include a processor 21 connected to the bus, the memory 24, and may also include a transmission connected to the bus. Machine 22 and receiver 23, wherein:
  • the memory 24 is configured to store execution instructions. Specifically, the memory 24 is used to store a program, the program may include program code, and the program code includes an execution instruction. The memory 24 is further configured to store data received from the transmitter 22, and may also store information such as necessary files for processing the data by the processor 21.
  • the memory 24 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
  • Transmitter 22 and receiver 23 are ports through which the switch communicates with other devices.
  • the processor 21 is configured to communicate with the memory 24, and execute the execution instruction, so that the switch performs a method of: matching a first part field in the data packet with a first flow entry in a first flow table And if the first part field matches the first flow entry, and the first flow entry is the last flow entry corresponding to the to-be-statisticd flow object, and the global statistical identifier includes at least one
  • the second identifier information is used to record the first identifier information and the at least one second identifier information in the first flow entry; perform statistics on the to-be-statisticd flow object in the first flow entry, and record the to-be-stated Statistics of the flow object, that is, the count value of the counter in the first flow entry is incremented by one.
  • the first identifier information is used to identify that the first part of the field matches the first flow entry
  • the at least one second identifier is used to identify at least one second part of the data packet. Matching with the second flow entry in the at least one second flow table. And executing, by the processor 21, the execution instruction, when the switch records the first identification information and the at least one second identification information, specifically writing the first identifier under the attribute of the metadata in the first flow entry Information and at least two second identification information.
  • the processor 21 executes the execution instruction so that the switch can also discard the data packet.
  • the method for the processor 21 to execute the execution instruction to the switch further includes: if the first partial field matches the first flow entry, and the first flow entry is not corresponding to the to-be-statistic flow object The last flow entry records the first identification information in the global statistical identifier.
  • the processor 21 of the switch executes the execution instruction stored in the memory 24, and may record the identification information in the last flow entry corresponding to the flow object to be collected to identify the flow object that passes through multiple flow entries. And statistics of such flow objects, so that the statistical information in the flow entry does not count the data flow through the flow entry in isolation, and realizes the combination of statistical information, which helps the controller to further the data traffic. analysis.
  • the receiver 23 in the switch is configured to receive configuration information that is sent by the controller and that is to be collected by the controller, where the configuration information includes at least the corresponding stream object to be counted.
  • the configuration information includes at least the corresponding stream object to be counted.
  • Two flow entry entries, and identifier information respectively matching the at least two flow entry entries; the identifier information matching the respective flow entry entries is the same, or different.
  • the processor 21 is executing the execution instruction, so that the switch records the first identification information and the at least one according to the configuration information. Second identification information.
  • the receiver 23 in the switch is further configured to receive a query request sent by the controller, where the query request includes identifier information corresponding to the to-be-statisticd stream object;
  • the method of executing the execution instruction to cause the switch to perform further includes: searching, in the first flow table, the first flow entry corresponding to the identifier information included in the query request received by the receiver 23;
  • the machine 22 is configured to send the statistics information in the first flow entry that is searched by the processor 21 to the controller.
  • a controller is provided, and a schematic structural diagram thereof is shown in FIG. 10, including:
  • the flow entry determining unit 31 is configured to determine, according to the feature information of the flow object to be counted, at least two flow entries corresponding to the to-be-statisticd flow object, where the feature information of the to-be-statisticd flow object may include a MAC address, an IP address, and a protocol. Or port and other information.
  • the identifier determining unit 32 is configured to determine identifier information that is matched with each of the at least two flow entries determined by the flow entry determining unit 31, where the identifier information that matches each flow entry may be the same. , can also be different.
  • the configuration sending unit 33 is configured to send, to the switch, configuration information for performing statistics on the to-be-statisticd flow object, where the configuration information includes at least two flow entry items determined by the flow entry determination unit 31, and the identifier is determined.
  • the identification information that is matched by each of the at least two flow entries determined by the unit 32, so that the switch performs, according to the at least two flow entries, and the identification information that matches the respective flow entry.
  • the statistics of the stream object to be counted.
  • the configuration sending unit 33 may send the identifier information that matches each flow entry to the switch for statistics, so that the switch can record the identifier in the last flow entry corresponding to the flow object to be counted.
  • the information is used to identify the flow objects that pass through the flow entries, and the statistics of the flow information are not counted in the flow table. Combined, it helps the controller to further analyze the data traffic.
  • the controller may further include: a query sending unit 34 and a statistics receiving unit 35, in addition to the structure shown in FIG. 10, wherein: the query sending unit 34 uses And sending the query request to the switch, where the query request includes the identifier information corresponding to the to-be-statisticd flow object, where the identifier information may include the query request The identification information of the to-be-statisticd flow object to be queried to match the multiple flow entry items.
  • the statistics receiving unit 35 is configured to receive the statistics information in the first flow entry that is searched by the switch according to the query request sent by the query sending unit, and the first flow entry records the information included in the query request. Identification information.
  • the query sending unit 34 may query the switch for the statistical information, and the statistical information received by the statistical receiving unit 35 may include the statistics of the flow objects that pass through the multiple flow entries, instead of the flow entries.
  • Independent statistical information which can facilitate the controller to further analyze the data flow of each switch in the network.
  • a controller is provided, which is shown in FIG. 12, and may include a processor 41 connected to the bus, a memory 44, and may further include a transmitter 42 and a receiver connected to the bus.
  • the memory 44 is used to store execution instructions. Specifically, the memory may store a program, the program may include program code, and the program code includes an execution instruction. The memory 44 is further used to store data received from the transmitter 42, and may also store information such as necessary files for processing the data by the processor 41. Memory 44 may include high speed RAM memory and may also include non-volatile memory, such as at least one disk memory. Transmitter 42 and receiver 43 are ports through which the switch communicates with other devices.
  • the processor 41 is configured to communicate with the memory 44, and execute the execution instruction, so that the controller performs: determining, according to the feature information of the flow object to be counted, at least two flow entries corresponding to the to-be-statisticd flow object; And identifier information that matches each of the at least two flow entries, where the identifier information that matches each flow entry may be the same or different.
  • the transmitter 42 is configured to send the switch to the switch.
  • Statistic configuration information of the statistics flow object where the configuration information includes at least two flow entry items determined by the controller, and identifier information matching each flow entry of the at least two flow entry items,
  • the switch performs statistics on the to-be-statisticd flow object according to the at least two flow entry items and the identification information that matches the respective flow entry.
  • the switch can record the identifier information in the last flow entry corresponding to the flow object to be identifiable to identify the flow object that has passed the flow entry, and collect statistics on the flow object so that the statistics in the flow entry are not
  • the data flow through the flow entry is counted only in isolation, which realizes the combination of statistical information and helps the controller to stream the data. Further analysis of the amount.
  • the transmitter 42 in the controller is further configured to send a query request to the switch, where the query request includes identifier information corresponding to the to-be-statisticd stream object, where the identifier information may include The query requesting the identification information of each of the feature information of the to-be-statisticd flow object that is requested to be queried to match the plurality of flow entry items, and the receiver 43 is configured to receive the query that the switch searches according to the query request sent by the transmitter 42.
  • the statistic information in the first flow entry, where the identifier information included in the query request is recorded in the first flow entry.
  • the statistical information received by the receiver 43 may include statistics on the flow objects passing through the multiple flow entries, instead of the independent statistics in the flow entries, so that the controller can conveniently count the statistics of each switch in the network.
  • the data stream is further analyzed.
  • the system embodiment of the present invention further provides a data flow statistics system.
  • the structure of the system may be as shown in FIG. 1 , including a controller, and one or more switches.
  • the structure of the switch may be the data flow as described in the foregoing device embodiment 1.
  • the structure of the controller, the structure of the controller, and the structure of the controller as described in the foregoing device embodiment 3 are not described herein.
  • the system embodiment of the present invention further provides a data flow statistics system.
  • the structure of the system may be as shown in FIG. 1 , including a controller, and one or more switches.
  • the structure of the switch may be the data flow as described in the foregoing device embodiment 2.
  • the structure of the controller may be the same as that of the controller described in the foregoing device embodiment 4, and details are not described herein.
  • the program may be stored in a computer readable storage medium, and the storage medium may include: ROM, RAM, disk or CD, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Algebra (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Pure & Applied Mathematics (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

一种数据流统计方法、系统、装置和交换机及控制器,应用于通信技术领域。数据流统计方法应用于交换机通过接收的数据流对待统计流对象的统计,包括:如果数据包中的某一部分字段与某一流表中行的某一流表项(比如第一流表项)相匹配时,且该第一流表项是待统计流对象对应的最后一个流表项,并在该数据的全局统计标识中已记录了至少一个第二标识信息,则交换机会在第一流表项中记录第一标识信息及至少一个第二标识信息,并在第一流表项中进行待统计流对象的统计,记录待统计流对象的统计信息。这样实现了对待统计流对象的统计。

Description

一种数据流统计方法、 系统和装置
技术领域
本发明涉及通信技术领域, 特别涉及数据流统计方法、 系统和装置。 背景技术
随着网络技术的发展和网络规模日益扩大,网络设备种类和网络所承载的 业务种类不断增多,使得网络出现各种故障或性能问题的可能性大大增加。 同 时, 用户服务质量的要求却在不断提高, 这样就导致了网络管理的难度更大。 网络流量分析系统的目的是通过对网络设备和网络运行的流量进行监测,及时 的发现网络中的异常情况, 提醒网管人员釆取必要措施以保证网络的正常运 行。
Openflow是实现软件定义网络 ( Software defined network, SDN ) 的一种 协议, Openflow 网络的基本思想是实现了数据转发层和控制层的分离。 其中 OpenFlow交换机负责数据层的转发, 而控制器 (Controller ) 实现了控制层的 功能。 交换机通过 Openflow协议与控制器通信,控制器通过 Openflow协议管 理交换机。 OpenFlow交换机主要负责数据的转发, OpenFlow交换机接收到数 据包后, 在流表中匹配流表项, 如果匹配上流表项, 则按照该流表项转发数据 包。 OpenFlow 交换机在每条流表项中都有单独的计数器(counter )域, 用来 对匹配数据包进行计数, 所以可以自然的支持数据流的统计。
而 OpenFlowl.2版本及其后续版本中引入了多流表结构,交换机包括用于 查找和转发的一个或多个逐级查找的流表,一个数据流经过逐级匹配多个流表 进行转发, 实现了流表压缩, 却不可避免地带来如下问题: 每个数据流是通过 多流表的流表项组合实现匹配转发,每个流表项均不再针对单一数据流, 所以 单一数据流的完整信息无法从流表中获得, 即无法从流表项的 counter域中获 取数据流的统计数据。
发明内容
本发明实施例提供数据流统计方法、 系统和装置, 实现了统计信息的相互 结合。
本发明实施例第一方面提供一种数据流统计方法,应用于交换机通过接收 到数据包对待统计流对象的统计, 所述方法包括: 将所述数据包中的第一部分字段与第一流表中的第一流表项进行匹配; 如果所述第一部分字段与所述第一流表项相匹配,且所述第一流表项是所 述待统计流对象对应的最后一个流表项,且所述全局统计标识中包括至少一个 第二标识信息,则在所述第一流表项中记录第一标识信息及所述至少一个第二 标识信息;
在所述第一流表项中进行所述待统计流对象的统计,记录所述待统计流对 象的统计信息;
其中,所述第一标识信息用于标识所述第一部分字段与所述第一流表项相 匹配,所述至少一个第二标识信息用于标识所述数据包中的至少一个第二部分 字段分别与至少一个第二流表中的第二流表项相匹配。
在本发明实施例第一方面的第一种可能实现方式中:
如果所述第一部分字段与所述第一流表项相匹配,且所述第一流表项不是 所述待统计流对象对应的最后一个流表项,则在所述全局统计标识中记录所述 第一标识信息。
结合发明实施例第一方面, 或第一方面的第一种可能实现方式,在本发明 实施例第一方面的第二种可能实现方式中,所述将所述数据包中的第一部分字 段与第一流表中的第一流表项进行匹配, 之前还包括:
接收控制器发送的对于所述待统计流对象进行统计的配置信息,所述配置 信息中包括所述待统计流对象对应的至少两个流表项,及分别与所述至少两个 流表项相匹配的标识信息。
结合发明实施例第一方面第二种可能实现方式,在本发明实施例第一方面 的第三种可能实现方式中, 所述方法还包括:
接收所述控制器发送的查询请求,所述查询请求中包括所述待统计流对象 对应的标识信息;
在所述第一流表中查找所述查询请求中包含的所述标识信息对应的所述 第一流表项, 并将所述第一流表项中的所述统计信息发送给所述控制器。
结合发明实施例第一方面,或第一方面的第一种到第三种可能实现方式中 任一可能实现方式,在本发明实施例第一方面的第四种可能实现方式中, 所述 在所述全局统计标识中记录所述第一标识信息, 具体包括: 在所述第一流表项中元数据的属性下写入所述第一标识信息和至少一个 第二标识信息。
本发明实施例第二方面提供一种数据流统计方法, 包括:
控制器根据待统计流对象的特征信息确定所述待统计流对象对应的至少 两个流表项;
所述控制器确定与所述至少两个流表项中各个流表项分别相匹配的标识 信息;
所述控制器向交换机发送对于待统计流对象进行统计的配置信息,所述配 置信息中包括所述至少两个流表项,及与所述至少两个流表项中的各个流表项 相匹配的标识信息, 以便所述交换机根据所述至少两个流表项,及与所述各个 流表项相匹配的标识信息进行所述待统计流对象的统计。
本发明实施例第二方面的第一种可能实现方式中, 所述方法还包括: 所述控制器向所述交换机发送查询请求,所述查询请求中包括所述待统计 流对象对应的标识信息;
所述控制器接收所述交换机根据所述查询请求查找的第一流表项中的统 计信息, 所述第一流表项中记录了所述查询请求中包含的标识信息。
本发明实施例第三方面提供一种数据流统计装置,用于通过接收的数据包 对待统计流对象进行统计, 具体包括:
匹配单元,用于将所述数据包中的第一部分字段与第一流表中的第一流表 项进行匹配;
记录单元,用于如果所述匹配单元匹配的第一部分字段与所述第一流表项 相匹配,且所述第一流表项是所述待统计流对象对应的最后一个流表项,且所 述全局统计标识中包括至少一个第二标识信息,则在所述第一流表项中记录第 一标识信息及所述至少一个第二标识信息; 其中, 所述第一标识信息用于标识 所述第一部分字段与所述第一流表项相匹配,所述至少一个第二标识信息用于 标识所述数据包中的至少一个第二部分字段分别与至少一个第二流表中的第 二;克表项相匹配;
统计单元, 用于在所述第一流表项中进行所述待统计流对象的统计,记录 所述待统计流对象的统计信息。 本发明实施例第三方面的第一种可能实现方式中:
所述记录单元,还用于如果所述匹配单元匹配的第一部分字段与所述第一 流表项相匹配,且所述第一流表项不是所述待统计流对象对应的最后一个流表 项, 则在所述全局统计标识中记录所述第一标识信息。
结合发明实施例第三方面, 或第三方面的第一种可能实现方式,在本发明 实施例第三方面的第二种可能实现方式中, 所述装置还包括:
配置接收单元,用于接收控制器发送的对于所述待统计流对象进行统计的 配置信息, 所述配置信息中包括所述待统计流对象对应的至少两个流表项, 及 分别与所述至少两个流表项相匹配的标识信息。
结合发明实施例第三方面第二种可能实现方式,在本发明实施例第三方面 的第三种可能实现方式中, 所述装置还包括:
查询接收单元, 用于接收所述控制器发送的查询请求, 所述查询请求中包 括所述待统计流对象对应的标识信息;
统计发送单元,用于在所述第一流表中查找所述查询接收单元接收的查询 请求中包含的所述标识信息对应的所述第一流表项,并将所述第一流表项中的 所述统计信息发送给所述控制器。
结合发明实施例第三方面,或第三方面的第一种到第三种可能实现方式中 任一种可能实现方式, 在本发明实施例第三方面的第四种可能实现方式中: 所述记录单元,具体用于在所述第一流表项中元数据的属性下写入所述第 一标识信息和至少一个第二标识信息。
本发明实施例第四方面提供一种控制器, 包括:
流表项确定单元,用于根据待统计流对象的特征信息确定所述待统计流对 象对应的至少两个流表项;
标识确定单元,用于确定与所述流表项确定单元确定的至少两个流表项中 各个流表项分别相匹配的标识信息;
配置发送单元, 用于向交换机发送对于待统计流对象进行统计的配置信 息, 所述配置信息中包括所述流表项确定单元确定的至少两个流表项,及所述 标识确定单元确定的与所述至少两个流表项中的各个流表项相匹配的标识信 息, 以便所述交换机根据所述至少两个流表项, 及与所述各个流表项相匹配的 标识信息进行所述待统计流对象的统计。
本发明实施例第四方面的第一种可能实现方式中, 所述控制器还包括: 查询发送单元, 用于向所述交换机发送查询请求, 所述查询请求中包括所 述待统计流对象对应的标识信息;
统计接收单元,用于接收所述交换机根据所述查询发送单元发送的查询请 求查找的第一流表项中的统计信息,所述第一流表项中记录了所述查询请求中 包含的标识信息。
本发明实施例第五方面提供一种交换机,应用于通过接收的数据包对待统 计流对象的统计, 包括连接在总线的处理器、 存储器, 其中:
所述存储器, 用于存储执行指令;
所述处理器, 用于与所述存储器之间通信,执行所述执行指令使得所述交 换机执行如下方法:将所述数据包中的第一部分字段与第一流表中的第一流表 项进行匹配; 如果所述第一部分字段与所述第一流表项相匹配,且所述第一流 表项是所述待统计流对象对应的最后一个流表项,且所述全局统计标识中包括 至少一个第二标识信息,则在所述第一流表项中记录第一标识信息及所述至少 一个第二标识信息; 在所述第一流表项中进行所述待统计流对象的统计,记录 所述待统计流对象的统计信息;
其中,所述第一标识信息用于标识所述第一部分字段与所述第一流表项相 匹配,所述至少一个第二标识信息用于标识所述数据包中的至少一个第二部分 字段分别与至少一个第二流表中的第二流表项相匹配。
本发明实施例第五方面的第一种可能实现方式中:
所述处理器执行所述执行指令使得所述交换机执行的方法还包括:如果所 述第一部分字段与所述第一流表项相匹配,且所述第一流表项不是所述待统计 流对象对应的最后一个流表项,则在所述全局统计标识中记录所述第一标识信 息。
结合本发明实施例第五方面, 或第五方面的第一种可能实现方式,在本发 明实施例第五方面的第二种可能实现方式中,所述交换机还包括连接在总线的 接收机:
所述接收机,用于接收控制器发送的对于所述待统计流对象进行统计的配 置信息, 所述配置信息中包括所述待统计流对象对应的至少两个流表项,及分 别与所述至少两个流表项相匹配的标识信息。
结合本发明实施例第五方面第二种可能实现方式,在本发明实施例第五方 面的第三种可能实现方式中, 所述交换机还包括连接在总线的发射机, 其中: 所述接收机,还用于接收所述控制器发送的查询请求, 所述查询请求中包 括所述待统计流对象对应的标识信息;
所述处理器执行所述执行指令使得所述交换机执行的方法,还包括: 在所 述第一流表中查找所述接收机接收的查询请求中包含的所述标识信息对应的 所述第一流表项;
所述发射机, 用于将所述第一流表项中的所述统计信息发送给所述控制 器。
结合本发明实施例第五方面,或第五方面的第一种到第三种可能实现方式 中任一种可能实现方式, 在本发明实施例第五方面的第四种可能实现方式中: 所述处理器执行所述执行指令使得所述交换机执行的方法具体包括:在所 述第一流表项中元数据的属性下写入所述第一标识信息和至少一个第二标识 信息。
本发明实施例第六方面提供一种控制器, 包括: 连接在总线的处理器和发 射机、 存储器, 其中:
所述存储器, 用于存储执行指令;
所述处理器, 用于与所述存储器之间通信,执行所述执行指令使得所述控 制器执行如下方法:根据待统计流对象的特征信息确定所述待统计流对象对应 的至少两个流表项;确定与所述至少两个流表项中各个流表项分别相匹配的标 识信息;
所述发射机, 用于向交换机发送对于待统计流对象进行统计的配置信息, 所述配置信息中包括所述至少两个流表项,及与所述至少两个流表项中的各个 流表项相匹配的标识信息, 以便所述交换机根据所述至少两个流表项,及与所 述各个流表项相匹配的标识信息进行所述待统计流对象的统计。
本发明实施例第六方面的第一种可能实现方式中,所述控制器还包括连接 在所述总线的接收机, 其中: 所述发射机,还用于向所述交换机发送查询请求, 所述查询请求中包括所 述待统计流对象对应的标识信息;
所述接收机,用于接收所述交换机根据所述发射机发送的查询请求查找的 第一流表项中的统计信息,所述第一流表项中记录了所述查询请求中包含的标 识信息。
本发明实施例第七方面提供一种数据流统计系统, 包括控制器, 和一个或 多个交换机,
所述交换机是如本发明实施例第三方面,或第三方面的第一种到第四种可 能实现方式中任一种可能实现方式所述的数据流统计装置;
所述控制器是如本发明实施例第四方面,或第四方面的第一种可能实现方 式所述的控制器。
本发明实施例第八方面提供一种数据流统计系统, 包括控制器, 和一个或 多个交换机,
所述交换机是如本发明实施例第五方面,或第五方面的第一种到第四种可 能实现方式中任一种可能实现方式所述的交换机;
所述控制器是如本发明实施例第六方面,或第六方面的第一种可能实现方 式所述的控制器。
可见,在本发明实施例中,如果数据包中的某一部分字段与某一流表中的 某一流表项(比如第一流表项)相匹配时, 且该第一流表项是待统计流对象对 应的最后一个流表项,并在该数据的全局统计标识中已记录了至少一个第二标 识信息,则交换机会在第一流表项中记录第一标识信息及至少一个第二标识信 息, 并在第一流表项中进行待统计流对象的统计,记录待统计流对象的统计信 息。这样可以在待统计流对象对应的最后一个流表项中,记录各个标识信息来 标识经过多个流表项的流对象, 并统计这类流对象,使得多个流表的流表项中 统计的信息并不会孤立地只统计经过该流表项的数据流,实现了统计信息的相 互结合, 有助于控制器对数据流量的进一步的分析。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施 例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲,在不付 出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。 图 2是本发明方法实施例一提供的一种数据流统计方法的流程图; 图 3是本发明方法实施例一提供的另一种数据流统计方法的流程图; 图 4是本发明方法实施例二提供的一种数据流统计方法的流程图; 图 5是本发明方法实施例二提供另一种数据流统计方法的流程图; 图 6是本发明方法实施例三中交换机进行数据流统计的示意图; 图 7是本发明设备实施例一提供的一种数据流统计装置的结构示意图; 图 8是本发明设备实施例一提供的另一种数据流统计装置的结构示意图; 图 9是本发明设备实施例二提供的一种交换机的结构示意图;
图 10是本发明设备实施例三提供的一种控制器的结构示意图;
图 11是本发明设备实施例三提供的另一种控制器的结构示意图; 图 12是本发明设备实施例四提供的另一种控制器的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有作出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
本发明的说明书和权利要求书及上述附图中的术语"第一"、 "第二"、 "第 三""第四"等 (如果存在)是用于区别类似的对象, 而不必用于描述特定的顺 序或先后次序。应该理解这样使用的数据在适当情况下可以互换, 以便这里描 述的本发明的实施例例如能够以除了在这里图示或描述的那些以外的顺序实 施。 此外, 术语"包括"和"具有"以及他们的任何变形, 意图在于覆盖不排它的 包含, 例如, 包含了一系列步骤或单元的过程、 方法、 系统、 产品或设备不必 限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些 过程、 方法、 产品或设备固有的其它步骤或单元。
本发明方法实施例一
提供一种数据流统计方法, 主要可以应用于如图 1所示的系统中,在该系 统中可以包括控制器和至少一个交换机(图 1中为 m个交换机), 其中, 控制 器是通过 openfolw数据流量的协议管理各个交换机; 且每个交换机的结构都 类似,都可以包括与控制器连接的管理通道,且在每个交换机中可以储存多个 流表, 而每个流表会包括至少两个流表项。
本实施例中的方法是交换机所执行的方法,主要是在交换机中的多流表情 况下, 交换机通过接收的数据包对待统计流对象的统计方法, 流程图如图 2 所示, 包括:
步骤 101, 将接收的数据包中的第一部分字段与第一流表中的第一流表项 进行匹配,如果相匹配, 则需要进一步确定该第一流表项是否是待统计流对象 对应的最后一个流表项, 如果不相匹配, 则交换机会丟弃该数据包, 不会进行 统计。
可以理解, 交换机可以根据控制器的配置, 对待统计流对象进行统计, 比 如对媒体访问控制((Media Access Control, MAC )地址为 xx. xx. xx. xx. xx. xx.80, 目的网络协议(IP )地址为 192.168.0.3, 且端口 (port )为 80等的流对象进行 统计。其中流对象的一个或多个特征可以对应一个流表项,每个流表项都可以 包括匹配字段 ( match field )和计数器( counter ),还可以包括优先级( priority )、 超时时间、一组用来匹配数据包的命令和一小段文本信息(Cookie )等。其中: 匹配字段, 主要是用于对数据包进行匹配, 可以包括端口、 地址和协议等 信息中的任一个或多个信息;
优先级, 主要用于是查询流表项的过程中,如果同时有多个流表项都与查 询请求相匹配,标识选择该流表项的优先级,具体是选择优先级较高的流表项; 计数器, 用于对与上述匹配字段相匹配的数据流进行计数;
指令, 用于修改行动集或流水线处理;
超时时间, 是最大时间计数或数据流有效时间
Cookie, 是由控制器选择的不透明数据值, 控制器用来过滤流统计数据、 流改变和流删除, 但在对数据包匹配时不能使用。
本实施例中, 当交换机在接收到数据包后, 需要将数据包中的各个字段与 交换机中储存的多个流表中对应的流表项进行匹配。其中, 当数据包中的字段 与某一个流表(比如第一流表)中的第一流表项相匹配时, 则交换机需要记录 第一标识信息; 而如果数据包的任何一个字段与某一流表项不相匹配, 则交换 机可以丟弃该数据包。
进一步地,如果第一流表项是待统计流对象对应的最后一个流表项,且在 全局统计标识中包括至少一个第二标识信息,则交换机会执行步骤 102和 103, 如果第一流表项不是待统计流对象对应的最后一个流表项, 则会执行步骤 104。
其中,第一标识信息用于标识数据包中的第一部分字段与第一流表项相匹 配,至少一个第二标识信息用于标识数据包中的至少一个第二部分字段分别与 至少一个第二流表中的第二流表项相匹配;且如果在全局统计标识中未包括该 至少一个第二标识信息, 则交换机会丟弃该数据包。
步骤 102, 在第一流表项中记录第一标识信息及上述全局统计标识中的所 述至少一个第二标识信息。
这里用于标识数据包中某一部分字段与某一流表项相匹配的信息可以都 相同, 也可以不同, 比如上述第一标识信息为 01, 而用于标识数据包中第二 部分字段与第二流表项相匹配的信息可以为 01, 也可以为 10等。
步骤 103, 在第一流表项中进行待统计流对象的统计, 记录待统计流对象 的统计信息, 具体地, 是通过第一流表项中的计数器进行统计, 即在当前计数 器值的基础上加 1。
步骤 104, 在全局统计标识中记录上述第一标识信息。 进一步地, 在这种 情况下, 交换机也可以通过第一流表项中的计数器进行统计, 即将第一流表项 中计数器的计数值加 1。
在一种具体实现方式中, 交换机会在接收到一个数据包时,会设置一个对 应的全局统计标识, 具体地, 是将数据包的元数据 ( metadata ) 的属性作为全 局统计标识, 并在该全局统计标识中记录各个标识信息, 而当交换机在执行上 述步骤 102的记录时,具体可以在所述第一流表项中元数据的属性下写入上述 第一标识信息和至少一个第二标识信息。且交换机可以在全局统计标识中设置 N位,分别用来记录该数据包的各个字段分别与待统计流对象对应的各个流表 项相匹配的各个标识信息, 其中 N的大小与待统计流对象对应的流表项的数 量一致。 需要说明的是, 随着数据包的丟弃, 或随着数据包转出该交换机, 一 个数包的全局统计标识也会被丟弃。
其中交换机在对其它第二流表项进行匹配时的方法,与上述对第一流表项 进行匹配时所执行的方法类似, 不同的是, 处理的信息不一样, 这样通过多个 流表项对数据包的各个流表项进行逐级匹配,并逐级地在数据包的全局统计表 中记录各个标识信息,这样在待统计流对象对应的最后一个流表项中记录各个 标识信息,就可标识数据包中多个部分字段分别与待统计流对象对应的多个流 表项相匹配,并可以通过最后一个流表项中的计数器来统计经过该多个流表项 的路径的数量。
可见,在本实施例中,如果数据包中的某一部分字段与某一流表中的某一 流表项(比如第一流表项)相匹配时, 且该第一流表项是待统计流对象对应的 最后一个流表项,并在该数据的全局统计标识中已记录了至少一个第二标识信 息, 则交换机会在第一流表项中记录第一标识信息及至少一个第二标识信息, 并在第一流表项中进行待统计流对象的统计, 记录待统计流对象的统计信息。 这样可以在待统计流对象对应的最后一个流表项中,记录各个标识信息来标识 经过多个流表项的流对象, 并统计这类流对象,使得多个流表的流表项中统计 的信息并不会孤立地只统计经过该流表项的数据流,实现了统计信息的相互结 合, 有助于控制器对数据流量的进一步的分析。
参考图 3所示,在具体的实施例中, 上述步骤 101到 104是由交换机进行 待统计流对象的统计主要是由控制器来配置的, 则在执行上述步骤 101之前, 交换机可以执行步骤 105; 且在对待统计流对象进行统计后, 交换机还可以执 行步骤 16和 107, 以将控制器查询的统计信息发送给控制器, 具体地:
步骤 105, 交换机接收控制器发送的对于待统计流对象进行统计的配置信 息, 该配置信息中包括待统计流对象对应的至少两个流表项,及分别与各个流 表项相匹配的标识信息, 其中与各个流表项相匹配的标识信息相同, 或不同, 比如与第一流表项相匹配的标识信息为标识信息 a, 与第二流表项相匹配的标 识信息为标识信息 b等, 其中 a与 b可以相同, 也可以不同。
步骤 106, 交换机接收控制器发送的查询请求, 查询请求中包括请求查询 的待统计流对象对应的各个标识信息。
步骤 107, 交换机在第一流表中查找上述查询请求中包含的所述标识信息 对应的第一流表项, 并将第一流表项中的统计信息发送给控制器。 具体地, 交 换机可以将第一流表项中的计数器的信息发送给控制器。
可见, 通过上述步骤 105到 107, 控制器可以控制交换机对待统计流对象 的统计,也可以查询统计信息, 这样可以方便控制器对网络中各个交换机统计 的待统计流对象进行进一步的分析。
本发明方法实施例二
还提供另一种数据流统计方法, 主要应用于上述图 1所示的系统中, 主要 是交换机通过接收的数据包对待统计流对象的统计方法,本是实施例的方法是 由控制器所执行的方法, 流程图如图 4所示, 包括:
步骤 201, 控制器根据待统计流对象的特征信息确定待统计流对象对应的 至少两个流表项,其中待统计流对象的特征信息可以包括 MAC地址、 IP地址、 协议或端口等信息。
步骤 202, 控制器确定与上述至少两个流表项中的各个流表项相匹配的标 识信息, 这里与各个流表项相匹配的标识信息可以相同, 也可以不同。
步骤 203, 控制器向交换机发送对待统计流对象进行统计的配置信息, 该 配置信息中包括所述至少两个流表项,及分别与所述至少两个流表项中的各个 流表项相匹配的标识信息, 这样当交换机接收到该配置信息后, 就可以根据至 少两个流表项, 及与各个流表项相匹配的标识信息进行待统计流对象的统计, 具体地, 可以按照上述步骤 101到 104的方法进行统计, 在此不进行赞述。
在本实施例中,控制器可以将与各个流表项相匹配的标识信息发送给交换 机进行统计, 这样交换机可以在待统计流对象对应的最后一个流表项中,记录 各个标识信息来标识经过多个流表项的流对象, 并统计这类流对象,使得流表 项中统计的信息并不会孤立地只统计该经过该流表项的数据流,实现了统计信 息的相互结合, 有助于控制器对数据流量的进一步的分析。
参考图 5 所示, 在一个具体的实施例中, 控制器除了可以按照上述步骤
201到 203控制交换机进行待统计流对象的统计, 还可以执行如下步骤 204和 205来查询经过多个流表项的流对象的统计信息, 具体地:
步骤 204, 控制器向交换机发送查询请求, 查询请求中包括待统计流对象 对应的标识信息,这里的标识信息可以包括该查询请求所请求查询的待统计流 对象分别与多个流表项相匹配的标识信息。
步骤 205, 控制器接收交换机根据查询请求查找的第一流表项中的统计信 息, 查找的第一流表项中记录了查询请求中包含的标识信息。
通过上述步骤 204到 205, 控制器可以向交换机查询统计信息, 且查询到 的统计信息中可以包括对经过多个流表项的待统计流对象的统计信息,而不是 各个流表项中独立统计的信息,这样可以方便控制器对网络中各个交换机统计 的数据流进行进一步的分析。
本发明方法实施例三
以一个具体的应用例来说明本发明实施例的数据流统计方法,主要可以应 用于如图 1所示的系统中, 具体地:
控制器发送配置信息给交换机,在配置信息中包括三个流表项,在流表项 中包含的匹配字段分别为: MAC地址为 xx.xx.xx.xx.xx.xx.80, 目的 IP地址为 192.168.0.3 , 且端口 (port ) 为 80, 其中流表项的结构可以如图 6所示; 在配 置信息中还包括与这三个流表项相匹配的标识信息, 都为 01。
参考图 6 所示, 当交换机接收到数据包, 交换机中会将数据包中包含的
MAC地址先与流表 1中的流表项 1进行匹配, 如果与流表项 1中的匹配字段 xx.xx.xx.xx.xx.xx.80相匹配, 则交换机就会在全局统计标识中比如数据包的的 元数据 ( metadata )属性下写入标识信息 01。
交换机会将数据包中包含的目的 IP地址与流表 2中的流表项 2进行匹配, 如果与流表项 2中的匹配字段 192.168.0.3相匹配, 则交换机 2就在全局统计 标识中继续写入标识信息 01。
交换机会将数据包中包含的端口与流表项 2进行匹配,如果与流表 3中的 流表项 3中的匹配字段 80相匹配, 而该流表项 3是待统计流对象对应的最后 一个流表项, 在全局统计标识又包括分别与流表项 1和 2相匹配的标识信息 0101 , 则交换机就在流表项 3中该匹配字段的元数据(metadata )属性下写入 标识信息 010101, 包括了分别流表项 1到 3相匹配的各个标识信息; 且交换 机会将流表项 3中该匹配字段的计数器的值加 1进行统计。
这样控制器如果需要查询交换机对某一个流对象统计的统计信息时,会发 送查询请求给交换机, 在查询请求中包括需要统计的流对象对应的标识信息, 比如 010101 ; 则交换机会在的储存的流表 3中进行查询, 发现流表项 3中包 括该标识信息 010101, 则交换机会将该流表项中计数器的信息发送给控制器。
本发明设备实施例一
提供一种数据流统计装置, 比如交换机等, 用于通过接收的数据包对待统 计流对象进行统计, 其结构示意图如图 7所示, 具体包括:
匹配单元 11, 用于将所述数据包中的第一部分字段与第一流表中的第一 流表项进行匹配。
记录单元 12, 用于如果所述第一部分字段与所述第一流表项相匹配, 且 所述第一流表项是所述待统计流对象对应的最后一个流表项,且所述全局统计 标识中包括至少一个第二标识信息,则在所述第一流表项中记录第一标识信息 及所述至少一个第二标识信息; 其中, 所述第一标识信息用于标识所述第一部 分字段与所述第一流表项相匹配,所述至少一个第二标识信息用于标识所述数 据包中的至少一个第二部分字段分别与至少一个第二流表中的第二流表项相 匹配。
可以理解,如果数据包中的第一部分字段与第一流表项不相匹配时, 该记 录单元 12还可以丟弃该数据包。具体地,记录单元 12具体可以在所述第一流 表项中元数据的属性下写入所述第一标识信息和至少一个第二标识信息。
统计单元 13, 用于在所述第一流表项中进行所述待统计流对象的统计, 记录所述待统计流对象的统计信息, 即将第一流表项中计数器的计数值加 1。
进一步地, 上述记录单元 12, 还用于如果所述第一流表项不是所述待统 计流对象对应的最后一个流表项,则在所述全局统计标识中记录所述第一标识 信息。
在本实施例的数据流统计装置中, 如果匹配单元 11 匹配的数据包中的某 一部分字段与某一流表中行的某一流表项(比如第一流表项)相匹配时, 且该 第一流表项是待统计流对象对应的最后一个流表项,并在该数据的全局统计标 识中已记录了至少一个第二标识信息, 则记录单元 12会在第一流表项中记录 第一标识信息及至少一个第二标识信息, 并由统计单元 13在第一流表项中进 行待统计流对象的统计,记录待统计流对象的统计信息。这样可以在待统计流 对象对应的最后一个流表项中,记录各个标识信息来标识经过多个流表项的流 对象, 并统计这类流对象,使得多个流表的流表项中统计的信息并不会孤立地 只统计经过该流表项的数据流, 实现了统计信息的相互结合,有助于控制器对 数据流量的进一步的分析。
参考图 8所示,在一个具体的实施例中,数据统计装置除了可以包括如图 7所示的结构外, 还可以包括配置接收单元 14、 查询接收单元 15和统计发送 单元 16, 其中:
配置接收单元 14, 用于接收控制器发送的对于所述待统计流对象进行统 计的配置信息, 所述配置信息中包括所述待统计流对象对应的至少两个流表 项,及分别与所述至少两个流表项相匹配的标识信息; 所述与各个流表项相匹 配的标识信息相同, 或不同。
查询接收单元 15, 用于接收所述控制器发送的查询请求, 所述查询请求 中包括所述待统计流对象对应的标识信息;
统计发送单元 16, 用于在所述第一流表中查找所述查询接收单元 15查询 请求中包含的所述标识信息对应的所述第一流表项,并将所述第一流表项中的 所述统计信息发送给所述控制器。
本实施例的装置中, 当配置接收单元 14接收到配置信息后, 记录单元 12 会根据配置信息记录第一标识信息和至少一个第二标识信息;且当查询接收单 元 15在接收到查询请求后,统计发送单元 16会在所查询的流对象对应的最后 一个流表项中查找相应的统计信息, 比如计数器的值等。
本发明设备实施例二
提供一种交换机,应用于通过接收的数据包对待统计流对象的统计, 其结 构示意图如图 9所示, 可以包括连接在总线的处理器 21, 存储器 24, 且还可 以包括连接到总线的发射机 22和接收机 23 , 其中:
存储器 24, 用于存储执行指令。 具体的, 存储器 24用于存储程序, 程序可 以包括程序代码, 上述程序代码包括执行指令。 存储器 24, 进一步用来储存从 发射机 22接收的数据,且还可以储存处理器 21处理数据的必要文件等信息。存 储器 24可能包含高速 RAM存储器,也可能还包括非易失性存储器 ( non-volatile memory ), 例如至少一个磁盘存储器。 发射机 22和接收机 23是交换机与其它设 备通信的端口。 处理器 21, 用于与所述存储器 24之间通信, 执行所述执行指令使得所述 交换机执行如下方法:将所述数据包中的第一部分字段与第一流表中的第一流 表项进行匹配; 如果所述第一部分字段与所述第一流表项相匹配,且所述第一 流表项是所述待统计流对象对应的最后一个流表项,且所述全局统计标识中包 括至少一个第二标识信息,则在所述第一流表项中记录第一标识信息及所述至 少一个第二标识信息; 在所述第一流表项中进行所述待统计流对象的统计, 记 录所述待统计流对象的统计信息, 即将第一流表项中计数器的计数值加 1。 其 中, 所述第一标识信息用于标识所述第一部分字段与所述第一流表项相匹配, 所述至少一个第二标识信息用于标识所述数据包中的至少一个第二部分字段 分别与至少一个第二流表中的第二流表项相匹配。 且处理器 21执行所述执行 指令使得所述交换机在记录第一标识信息和至少一个第二标识信息时,具体是 在所述第一流表项中元数据的属性下写入所述第一标识信息和至少两个第二 标识信息。
其中,如果数据包中的第一部分字段与第一流表项不相匹配时, 该处理器 21执行所述执行指令使得所述交换机还可以丟弃该数据包。
处理器 21执行所述执行指令使得所述交换机执行的方法还包括: 如果所 述第一部分字段与所述第一流表项相匹配,且所述第一流表项不是所述待统计 流对象对应的最后一个流表项,则在所述全局统计标识中记录所述第一标识信 息。
可见, 本实施例中, 交换机的处理器 21执行存储器 24存储的执行指令, 可以在待统计流对象对应的最后一个流表项中,记录标识信息来标识经过多个 流表项的流对象, 并统计这类流对象,使得流表项中统计的信息并不会孤立地 只统计经过该流表项的数据流, 实现了统计信息的相互结合,有助于控制器对 数据流量的进一步的分析。
在一个具体的实施例中, 交换机中的接收机 23, 用于接收控制器发送的 对于所述待统计流对象进行统计的配置信息,所述配置信息中包括所述待统计 流对象对应的至少两个流表项,及分别与所述至少两个流表项相匹配的标识信 息; 所述与各个流表项相匹配的标识信息相同, 或不同。 则处理器 21在执行 所述执行指令使得交换机会根据配置信息进行记录第一标识信息和至少一个 第二标识信息。
在另一个具体的实施例中, 交换机中的接收机 23, 还用于接收所述控制 器发送的查询请求, 所述查询请求中包括所述待统计流对象对应的标识信息; 这时处理器 21执行所述执行指令使得所述交换机执行的方法还包括: 在所述 第一流表中查找所述接收机 23接收的查询请求中包含的所述标识信息对应的 所述第一流表项; 发射机 22, 用于将所述处理器 21查找的第一流表项中的所 述统计信息发送给所述控制器。
本发明设备实施例三
提供一种控制器, 其结构示意图如图 10所示, 包括:
流表项确定单元 31, 用于根据待统计流对象的特征信息确定所述待统计 流对象对应的至少两个流表项, 其中待统计流对象的特征信息可以包括 MAC 地址、 IP地址、 协议或端口等信息。
标识确定单元 32, 用于确定与所述流表项确定单元 31确定的至少两个流 表项中各个流表项分别相匹配的标识信息,这里与各个流表项相匹配的标识信 息可以相同, 也可以不同。
配置发送单元 33, 用于向交换机发送对于待统计流对象进行统计的配置 信息, 所述配置信息中包括所述流表项确定单元 31确定的至少两个流表项, 及与所述标识确定单元 32确定的至少两个流表项中的各个流表项相匹配的标 识信息, 以便所述交换机根据所述至少两个流表项,及与所述各个流表项相匹 配的标识信息进行所述待统计流对象的统计。
在本实施例的控制器中, 配置发送单元 33可以将与各个流表项相匹配的 标识信息发送给交换机进行统计,这样交换机可以在待统计流对象对应的最后 一个流表项中,记录标识信息来标识经过多个流表项的流对象, 并统计这类流 对象, 使得流表项中统计的信息并不会孤立地只统计经过该流表项的数据流, 实现了统计信息的相互结合, 有助于控制器对数据流量的进一步的分析。
参考图 11所示, 在一个具体的实施例中, 控制器除了可以包括上述图 10 所示的结构外, 还可以包括: 查询发送单元 34和统计接收单元 35, 其中: 查询发送单元 34, 用于向所述交换机发送查询请求, 所述查询请求中包 括所述待统计流对象对应的标识信息,这里的标识信息可以包括该查询请求所 请求查询的待统计流对象分别与多个流表项相匹配的标识信息。
统计接收单元 35, 用于接收所述交换机根据所述查询发送单元剧 34发送 的查询请求查找的第一流表项中的统计信息,所述第一流表项中记录了所述查 询请求中包含的标识信息。
本实施例中, 查询发送单元 34可以向交换机查询统计信息, 且统计接收 单元 35 接收到的统计信息中可以包括对经过多个流表项的流对象的统计信 息, 而不是各个流表项中独立统计的信息, 这样可以方便控制器对网络中各个 交换机统计的数据流进行进一步的分析。
本发明设备实施例四
提供一种控制器, 其结构示意图如图 12所示, 可以包括连接在总线的处 理器 41、 存储器 44, 且还可以包括连接到总线的发射机 42和接收机 43, 其 中:
存储器 44用于存储执行指令。 具体的, 存储器可以存储程序, 程序可以包 括程序代码, 上述程序代码包括执行指令。 存储器 44, 进一步用来储存从发射 机 42接收的数据,且还可以储存处理器 41处理数据的必要文件等信息。存储器 44可能包含高速 RAM存储器, 也可能还包括非易失性存储器 (non-volatile memory ), 例如至少一个磁盘存储器。 发射机 42和接收机 43是交换机与其它设 备通信的端口。
处理器 41, 用于与存储器 44之间通信, 执行所述执行指令使得控制器执 行如下方法:根据待统计流对象的特征信息确定所述待统计流对象对应的至少 两个流表项; 确定与所述至少两个流表项中各个流表项分别相匹配的标识信 息, 这里与各个流表项相匹配的标识信息可以相同, 也可以不同; 发射机 42, 用于向交换机发送对于待统计流对象进行统计的配置信息,所述配置信息中包 括所述控制器确定的至少两个流表项,及与所述至少两个流表项中的各个流表 项相匹配的标识信息, 以便所述交换机根据所述至少两个流表项,及与所述各 个流表项相匹配的标识信息进行所述待统计流对象的统计。这样交换机可以在 待统计流对象对应的最后一个流表项中,记录标识信息来标识经过多个流表项 的流对象, 并统计这类流对象,使得流表项中统计的信息并不会孤立地只统计 经过该流表项的数据流, 实现了统计信息的相互结合,有助于控制器对数据流 量的进一步的分析。
在一个具体的实施例中, 控制器中的发射机 42, 还用于向所述交换机发 送查询请求, 所述查询请求中包括所述待统计流对象对应的标识信息, 这里的 标识信息可以包括该查询请求所请求查询的待统计流对象的各个特征信息分 别与多个流表项相匹配的标识信息; 接收机 43, 用于接收所述交换机根据所 述发射机 42发送的查询请求查找的第一流表项中的统计信息, 所述第一流表 项中记录了所述查询请求中包含的标识信息。 这样接收机 43接收到的统计信 息中可以包括对经过多个流表项的流对象的统计信息,而不是各个流表项中独 立统计的信息,这样可以方便控制器对网络中各个交换机统计的数据流进行进 一步的分析。
本发明系统实施例还一种数据流统计系统, 其结构示意图可以如图 1 所 示, 包括控制器, 和一个或多个交换机, 交换机的结构可以如上述设备实施例 一中所述的数据流统计装置或交换机的结构,控制器的结构可以如上述设备实 施例三中所述的控制器的结构, 在此不进行赘述。
本发明系统实施例还一种数据流统计系统, 其结构示意图可以如图 1 所 示, 包括控制器, 和一个或多个交换机, 交换机的结构可以如上述设备实施例 二中所述的数据流统计装置或交换机的结构,控制器的结构可以如上述设备实 施例四中所述的控制器的结构, 在此不进行赘述。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步 骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读 存储介质中, 存储介质可以包括: ROM、 RAM, 磁盘或光盘等。
以上对本发明实施例所提供的数据流统计方法、 系统、装置和交换机及控 了阐述, 以上实施例的说明只是用于帮助理解本发明的方法及其核心思想; 同 时, 对于本领域的一般技术人员, 依据本发明的思想, 在具体实施方式及应用 范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims

权 利 要 求
1、 一种数据流统计方法, 其特征在于, 应用于交换机通过接收到数据包 对待统计流对象的统计, 所述方法包括:
将所述数据包中的第一部分字段与第一流表中的第一流表项进行匹配; 如果所述第一部分字段与所述第一流表项相匹配,且所述第一流表项是所 述待统计流对象对应的最后一个流表项,且所述全局统计标识中包括至少一个 第二标识信息,则在所述第一流表项中记录第一标识信息及所述至少一个第二 标识信息;
在所述第一流表项中进行所述待统计流对象的统计,记录所述待统计流对 象的统计信息;
其中,所述第一标识信息用于标识所述第一部分字段与所述第一流表项相 匹配,所述至少一个第二标识信息用于标识所述数据包中的至少一个第二部分 字段分别与至少一个第二流表中的第二流表项相匹配。
2、 如权利要求 1所述的方法, 其特征在于,
如果所述第一部分字段与所述第一流表项相匹配, 且所述第一流表项不 是所述待统计流对象对应的最后一个流表项,则在所述全局统计标识中记录所 述第一标识信息。
3、 如权利要求 1或 2所述的方法, 其特征在于, 所述将所述数据包中的 第一部分字段与第一流表中的第一流表项进行匹配, 之前还包括:
接收控制器发送的对于所述待统计流对象进行统计的配置信息,所述配置 信息中包括所述待统计流对象对应的至少两个流表项,及分别与所述至少两个 流表项相匹配的标识信息。
4、 如权利要求 3所述的方法, 其特征在于, 所述方法还包括:
接收所述控制器发送的查询请求,所述查询请求中包括所述待统计流对象 对应的标识信息;
在所述第一流表中查找所述查询请求中包含的所述标识信息对应的所述 第一流表项, 并将所述第一流表项中的所述统计信息发送给所述控制器。
5、 如权利要求 1至 4任一项所述的方法, 其特征在于, 所述在所述全局 统计标识中记录所述第一标识信息, 具体包括: 在所述第一流表项中元数据的属性下写入所述第一标识信息和至少一个 第二标识信息。
6、 一种数据流统计方法, 其特征在于, 包括:
控制器根据待统计流对象的特征信息确定所述待统计流对象对应的至少 两个流表项;
所述控制器确定与所述至少两个流表项中各个流表项分别相匹配的标识 信息;
所述控制器向交换机发送对于待统计流对象进行统计的配置信息,所述配 置信息中包括所述至少两个流表项,及与所述至少两个流表项中的各个流表项 相匹配的标识信息, 以便所述交换机根据所述至少两个流表项,及与所述各个 流表项相匹配的标识信息进行所述待统计流对象的统计。
7、 如权利要求 6所述的方法, 其特征在于, 所述方法还包括: 所述控制器向所述交换机发送查询请求,所述查询请求中包括所述待统计 流对象对应的标识信息;
所述控制器接收所述交换机根据所述查询请求查找的第一流表项中的统 计信息, 所述第一流表项中记录了所述查询请求中包含的标识信息。
8、 一种数据流统计装置, 其特征在于, 用于通过接收的数据包对待统计 流对象进行统计, 具体包括:
匹配单元,用于将所述数据包中的第一部分字段与第一流表中的第一流表 项进行匹配;
记录单元,用于如果所述匹配单元匹配的第一部分字段与所述第一流表项 相匹配,且所述第一流表项是所述待统计流对象对应的最后一个流表项,且所 述全局统计标识中包括至少一个第二标识信息,则在所述第一流表项中记录第 一标识信息及所述至少一个第二标识信息; 其中, 所述第一标识信息用于标识 所述第一部分字段与所述第一流表项相匹配,所述至少一个第二标识信息用于 标识所述数据包中的至少一个第二部分字段分别与至少一个第二流表中的第 二;克表项相匹配;
统计单元, 用于在所述第一流表项中进行所述待统计流对象的统计,记录 所述待统计流对象的统计信息。
9、 如权利要求 8所述的装置, 其特征在于, 所述记录单元, 还用于如果 所述匹配单元匹配的第一部分字段与所述第一流表项相匹配,且所述第一流表 项不是所述待统计流对象对应的最后一个流表项,则在所述全局统计标识中记 录所述第一标识信息。
10、 如权利要求 8或 9所述的装置, 其特征在于, 所述装置还包括: 配置接收单元,用于接收控制器发送的对于所述待统计流对象进行统计的 配置信息, 所述配置信息中包括所述待统计流对象对应的至少两个流表项, 及 分别与所述至少两个流表项相匹配的标识信息。
11、 如权利要求 10所述的装置, 其特征在于, 所述装置还包括: 查询接收单元, 用于接收所述控制器发送的查询请求, 所述查询请求中包 括所述待统计流对象对应的标识信息;
统计发送单元,用于在所述第一流表中查找所述查询接收单元接收的查询 请求中包含的所述标识信息对应的所述第一流表项,并将所述第一流表项中的 所述统计信息发送给所述控制器。
12、 如权利要求 8至 11任一项所述的装置, 其特征在于,
所述记录单元,具体用于在所述第一流表项中元数据的属性下写入所述第 一标识信息和至少一个第二标识信息。
13、 一种控制器, 其特征在于, 包括:
流表项确定单元,用于根据待统计流对象的特征信息确定所述待统计流对 象对应的至少两个流表项;
标识确定单元,用于确定与所述流表项确定单元确定的至少两个流表项中 各个流表项分别相匹配的标识信息;
配置发送单元, 用于向交换机发送对于待统计流对象进行统计的配置信 息, 所述配置信息中包括所述流表项确定单元确定的至少两个流表项,及所述 标识确定单元确定的与所述至少两个流表项中的各个流表项相匹配的标识信 息, 以便所述交换机根据所述至少两个流表项, 及与所述各个流表项相匹配的 标识信息进行所述待统计流对象的统计。
14、 如权利要求 13所述的控制器, 其特征在于, 还包括:
查询发送单元, 用于向所述交换机发送查询请求, 所述查询请求中包括所 述待统计流对象对应的标识信息;
统计接收单元,用于接收所述交换机根据所述查询发送单元发送的查询请 求查找的第一流表项中的统计信息,所述第一流表项中记录了所述查询请求中 包含的标识信息。
15、 一种交换机, 其特征在于, 应用于通过接收的数据包对待统计流对象 的统计, 包括连接在总线的处理器、 存储器, 其中:
所述存储器, 用于存储执行指令;
所述处理器, 用于与所述存储器之间通信,执行所述执行指令使得所述交 换机执行如下方法:将所述数据包中的第一部分字段与第一流表中的第一流表 项进行匹配; 如果所述第一部分字段与所述第一流表项相匹配,且所述第一流 表项是所述待统计流对象对应的最后一个流表项,且所述全局统计标识中包括 至少一个第二标识信息,则在所述第一流表项中记录第一标识信息及所述至少 一个第二标识信息; 在所述第一流表项中进行所述待统计流对象的统计,记录 所述待统计流对象的统计信息;
其中,所述第一标识信息用于标识所述第一部分字段与所述第一流表项相 匹配,所述至少一个第二标识信息用于标识所述数据包中的至少一个第二部分 字段分别与至少一个第二流表中的第二流表项相匹配。
16、 如权利要求 15所述的交换机, 其特征在于,
所述处理器执行所述执行指令使得所述交换机执行的方法还包括:如果所 述第一部分字段与所述第一流表项相匹配,且所述第一流表项不是所述待统计 流对象对应的最后一个流表项,则在所述全局统计标识中记录所述第一标识信 息。
17、 如权利要求 15或 16所述的交换机, 其特征在于, 还包括连接在总线 的接收机:
所述接收机,用于接收控制器发送的对于所述待统计流对象进行统计的配 置信息, 所述配置信息中包括所述待统计流对象对应的至少两个流表项,及分 别与所述至少两个流表项相匹配的标识信息。
18、 如权利要求 17所述的交换机, 其特征在于, 还包括连接在总线的发 射机, 其中: 所述接收机,还用于接收所述控制器发送的查询请求, 所述查询请求中包 括所述待统计流对象对应的标识信息;
所述处理器执行所述执行指令使得所述交换机执行的方法,还包括: 在所 述第一流表中查找所述接收机接收的查询请求中包含的所述标识信息对应的 所述第一流表项;
所述发射机, 用于将所述第一流表项中的所述统计信息发送给所述控制 器。
19、 如权利要求 15至 18任一项所述的交换机, 其特征在于,
所述处理器执行所述执行指令使得所述交换机执行的方法具体包括:在所 述第一流表项中元数据的属性下写入所述第一标识信息和至少一个第二标识 信息。
20、 一种控制器, 其特征在于, 包括: 连接在总线的处理器和发射机、 存 储器, 其中:
所述存储器, 用于存储执行指令;
所述处理器, 用于与所述存储器之间通信,执行所述执行指令使得所述控 制器执行如下方法:根据待统计流对象的特征信息确定所述待统计流对象对应 的至少两个流表项;确定与所述至少两个流表项中各个流表项分别相匹配的标 识信息;
所述发射机, 用于向交换机发送对于待统计流对象进行统计的配置信息, 所述配置信息中包括所述至少两个流表项,及与所述至少两个流表项中的各个 流表项相匹配的标识信息, 以便所述交换机根据所述至少两个流表项,及与所 述各个流表项相匹配的标识信息进行所述待统计流对象的统计。
21、 如权利要求 20所述的控制器, 其特征在于, 还包括连接在所述总线 的接收机, 其中:
所述发射机,还用于向所述交换机发送查询请求, 所述查询请求中包括所 述待统计流对象对应的标识信息;
所述接收机,用于接收所述交换机根据所述发射机发送的查询请求查找的 第一流表项中的统计信息,所述第一流表项中记录了所述查询请求中包含的标 识信息。
22、 一种数据流统计系统, 其特征在于, 包括控制器, 和一个或多个交换 所述交换机是如权利要求 8至 12任一项所述的数据流统计装置; 所述控制器是如权利要求 13或 14所述的控制器。
23、 一种数据流统计系统, 其特征在于, 包括控制器, 和一个或多个交换 所述交换机是如权利要求 15至 19任一项所述的交换机;
所述控制器是如权利要求 20或 21所述的控制器。
PCT/CN2014/074016 2014-03-25 2014-03-25 一种数据流统计方法、系统和装置 WO2015143620A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/CN2014/074016 WO2015143620A1 (zh) 2014-03-25 2014-03-25 一种数据流统计方法、系统和装置
CN201480000193.9A CN105191212B (zh) 2014-03-25 2014-03-25 一种数据流统计方法、系统和装置
US15/274,511 US10148596B2 (en) 2014-03-25 2016-09-23 Data flow statistics collection method, system, and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/074016 WO2015143620A1 (zh) 2014-03-25 2014-03-25 一种数据流统计方法、系统和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/274,511 Continuation US10148596B2 (en) 2014-03-25 2016-09-23 Data flow statistics collection method, system, and apparatus

Publications (1)

Publication Number Publication Date
WO2015143620A1 true WO2015143620A1 (zh) 2015-10-01

Family

ID=54193863

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/074016 WO2015143620A1 (zh) 2014-03-25 2014-03-25 一种数据流统计方法、系统和装置

Country Status (3)

Country Link
US (1) US10148596B2 (zh)
CN (1) CN105191212B (zh)
WO (1) WO2015143620A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10608930B2 (en) * 2017-05-23 2020-03-31 Cisco Technology, Inc. Network statistics estimation and prediction
CN111190941A (zh) * 2019-12-30 2020-05-22 北京奇艺世纪科技有限公司 一种信息统计方法及装置
CN111130946B (zh) * 2019-12-30 2022-03-25 联想(北京)有限公司 一种深度报文识别的加速方法、装置和存储介质
CN112714021B (zh) * 2020-12-29 2023-04-18 北京格林威尔科技发展有限公司 基于分组网络、光传送网络中流统计结果获取方法和装置
CN113569200A (zh) * 2021-08-03 2021-10-29 北京金山云网络技术有限公司 数据统计的方法、装置及服务器
CN114500418B (zh) * 2022-02-11 2023-10-20 珠海星云智联科技有限公司 数据统计方法及相关装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075911A (zh) * 2006-05-18 2007-11-21 阿拉克斯拉网络株式会社 统计信息收集系统及统计信息收集装置
CN103314557A (zh) * 2011-01-17 2013-09-18 日本电气株式会社 网络系统、控制器、交换机和业务监控方法
WO2014040240A1 (zh) * 2012-09-12 2014-03-20 华为技术有限公司 一种在线计费方法、设备及网络系统

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4512196B2 (ja) * 2005-10-20 2010-07-28 アラクサラネットワークス株式会社 異常トラヒックの検出方法およびパケット中継装置
KR101422381B1 (ko) * 2010-04-19 2014-07-22 닛본 덴끼 가부시끼가이샤 스위치 및 플로우 테이블 제어 방법
KR101414753B1 (ko) * 2010-11-22 2014-07-04 닛본 덴끼 가부시끼가이샤 통신 시스템, 통신 디바이스, 컨트롤러, 및 패킷 플로우의 포워딩 경로의 제어 방법 및 프로그램
US9001827B2 (en) * 2010-12-17 2015-04-07 Big Switch Networks, Inc. Methods for configuring network switches
US8873398B2 (en) * 2011-05-23 2014-10-28 Telefonaktiebolaget L M Ericsson (Publ) Implementing EPC in a cloud computer with openflow data plane
US8964563B2 (en) * 2011-07-08 2015-02-24 Telefonaktiebolaget L M Ericsson (Publ) Controller driven OAM for OpenFlow
US8711860B2 (en) * 2011-12-22 2014-04-29 Telefonaktiebolaget L M Ericsson (Publ) Controller for flexible and extensible flow processing in software-defined networks
US9413667B2 (en) * 2013-02-15 2016-08-09 Telefonaktiebolaget Lm Ericsson (Publ) Methods and network nodes for traffic steering based on per-flow policies
US9407560B2 (en) * 2013-03-15 2016-08-02 International Business Machines Corporation Software defined network-based load balancing for physical and virtual networks
US10515118B2 (en) * 2013-06-24 2019-12-24 Micro Focus Llc Processing a data flow graph of a hybrid flow
US9548896B2 (en) * 2013-12-27 2017-01-17 Big Switch Networks, Inc. Systems and methods for performing network service insertion

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075911A (zh) * 2006-05-18 2007-11-21 阿拉克斯拉网络株式会社 统计信息收集系统及统计信息收集装置
CN103314557A (zh) * 2011-01-17 2013-09-18 日本电气株式会社 网络系统、控制器、交换机和业务监控方法
WO2014040240A1 (zh) * 2012-09-12 2014-03-20 华为技术有限公司 一种在线计费方法、设备及网络系统

Also Published As

Publication number Publication date
CN105191212B (zh) 2019-03-26
US20170012902A1 (en) 2017-01-12
US10148596B2 (en) 2018-12-04
CN105191212A (zh) 2015-12-23

Similar Documents

Publication Publication Date Title
WO2015143620A1 (zh) 一种数据流统计方法、系统和装置
US10911355B2 (en) Multi-site telemetry tracking for fabric traffic using in-band telemetry
JP5623585B2 (ja) フロー統計に用いる方法、装置及びシステム
US8694627B2 (en) Method and apparatus for correlating end to end measurements through control plane monitoring of wireless traffic
US9106443B2 (en) Forwarding table optimization with flow data
US10462038B2 (en) Control apparatus, communication system, tunnel endpoint control method, and program
WO2015101119A1 (zh) 一种流表匹配的方法、装置和OpenFlow交换系统
JP2012050090A5 (zh)
CN107070895B (zh) 一种基于sdn的数据流溯源方法
CN108270699B (zh) 报文处理方法、分流交换机及聚合网络
CN100525240C (zh) 数据分组通信设备
US9590922B2 (en) Programmable and high performance switch for data center networks
US9674728B2 (en) Method and apparatus for managing a degree of parallelism of streams
US9892030B2 (en) Method and apparatus for improving non-uniform memory access
TW201112708A (en) Light host management protocol on multicast capable router
WO2015161409A1 (zh) 一种负载均衡的实现方法及设备、系统
TWI250753B (en) Locate the incoming port of a MAC address in ethernet switch network
JP6299754B2 (ja) 制御装置、制御方法、通信システム及びプログラム
JP6299753B2 (ja) 制御装置、制御方法、通信システム及びプログラム
US8724473B2 (en) Locating signatures in packets
CN107819697B (zh) 数据传输方法、交换机及数据中心
US8611343B2 (en) Method and apparatus for providing a two-layer architecture for processing wireless traffic
JP5935897B2 (ja) 通信ノード、通信システム、制御装置、パケット転送方法及びプログラム
US20200012737A1 (en) Efficient time based correlation of data streams
WO2019001101A1 (zh) 路由路径分析方法及设备

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201480000193.9

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14886849

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14886849

Country of ref document: EP

Kind code of ref document: A1