WO2012119452A1 - Method, apparatus and network device for determining network traffic - Google Patents

Method, apparatus and network device for determining network traffic Download PDF

Info

Publication number
WO2012119452A1
WO2012119452A1 PCT/CN2011/081030 CN2011081030W WO2012119452A1 WO 2012119452 A1 WO2012119452 A1 WO 2012119452A1 CN 2011081030 W CN2011081030 W CN 2011081030W WO 2012119452 A1 WO2012119452 A1 WO 2012119452A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
data forwarding
network traffic
forwarding rate
storage space
Prior art date
Application number
PCT/CN2011/081030
Other languages
French (fr)
Chinese (zh)
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 中兴通讯股份有限公司
Publication of WO2012119452A1 publication Critical patent/WO2012119452A1/en

Links

Classifications

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

Definitions

  • the present invention relates to the field of data packet switching technologies, and in particular, to a network traffic determining method, apparatus, and network device. Background technique
  • the data forwarding rate is generally expressed in bits/s. That is, when the interface identifying a network device is 100M, the interface of the network device can support forwarding of 100 Mbits per second. rate. However, in reality, the data is transmitted in the form of a data packet, so the identification may be biased by the above data forwarding rate. This is because when a packet transmitted by an interface is mostly 1024 bytes, the interface can reach a rate of 100 Mbit/s, but when most of the packets transmitted by the interface are 64 bytes, the interface only Can reach a rate of 50 Mbit / s.
  • the data forwarding rate can be identified by pps, which is the number of packets that can be forwarded per second. For example, when the data forwarding rate of an interface is 30 Mpps, the interface can forward 30 M packets per second, and the length of each packet is identified by the minimum length of the packet.
  • pps the number of packets that can be forwarded per second.
  • the data forwarding rate of an interface is 30 Mpps
  • the interface can forward 30 M packets per second, and the length of each packet is identified by the minimum length of the packet.
  • the data is The packet is 64 bytes, and the packet is 40 bytes for the optical port (Packet over SDH, POS).
  • the embodiments of the present invention provide a method, a device, and a network device for determining network traffic, which are used to solve the problem that the prior art cannot accurately and effectively determine network traffic.
  • the data forwarding rate of the interface at each collection time in the statistical period is obtained in each statistical period of the network traffic
  • An obtaining module configured to obtain, for each interface of the network device, a data forwarding rate of the interface at each collection time in the statistics period in each statistical period of the network traffic;
  • a storage module configured to store the obtained data forwarding rate into a storage space for the interface
  • a determining module configured to determine network traffic of the interface according to each data forwarding rate stored in the storage space.
  • a network device provided by an embodiment of the present invention includes the foregoing device.
  • An embodiment of the present invention provides a method, a device, and a network device for determining a network traffic.
  • the method obtains a data forwarding rate of each interface at each collection time in a statistical period, and saves the obtained data forwarding rate to the storage space. , according to each data saved in the storage space The forwarding rate, which determines the network traffic of the interface.
  • the data forwarding rate of the interface is obtained at each collection time in the statistics period, and the network traffic of the interface is determined according to each data forwarding rate obtained, so that the short-term burst data pair can be effectively avoided. The impact of network traffic accuracy, thereby improving the accuracy of the determined network traffic.
  • FIG. 1 is a flowchart of determining network traffic according to an embodiment of the present invention
  • FIG. 3 is a specific implementation process for determining network traffic according to an embodiment of the present invention
  • FIG. 4 is another specific implementation process for determining network traffic according to an embodiment of the present invention
  • the embodiment of the present invention provides a method for determining network traffic, and a corresponding device and a network device, where the data forwarding rate of the interface at each collection time is obtained by obtaining the statistics period. According to the obtained data forwarding rate, the network traffic of the interface is determined, so that the impact of the short-term burst data on determining the accuracy of the network traffic can be effectively avoided, thereby improving the accuracy of the determined network traffic.
  • FIG. 1 is a flowchart of determining network traffic according to an embodiment of the present invention, where the process includes the following steps:
  • S101 For each interface of the network device, obtain the data forwarding rate of the interface at each collection time in the statistics period in each statistical period of the network traffic. Each statistical period includes at least two acquisition moments.
  • the network device can be a router or a switch.
  • the data forwarding rate of the interface when obtaining the data forwarding rate of the interface at each collection time, the data forwarding rate of the interface may be obtained in bit/s, or the data forwarding rate of the interface may be obtained in units of pps.
  • the data forwarding rate of all the data packets forwarded by the interface when the data forwarding rate of the interface is obtained, the data forwarding rate of all the data packets forwarded by the interface may be obtained according to all the data packets forwarded by the interface, or may be obtained for one type or some types of data packets.
  • the interface forwards the data forwarding rate of the one or several data packets.
  • S102 Store the obtained data forwarding rate into a storage space for the interface.
  • a corresponding storage space can be set for each interface in the network device, and used to store each data forwarding rate obtained.
  • the obtained data forwarding rate is stored in a storage space for the interface.
  • S103 Determine network traffic of the interface according to each data forwarding rate stored in the storage space.
  • the determining the network traffic of the interface includes:
  • network traffic of the interface may be separately determined for each interface in the network device.
  • the network traffic of the interface can be determined for the statistical period and the collection time. For each interface, the process of determining the network traffic of the interface is the same.
  • the obtained data forwarding rate of the interface at each collection time may be stored in a storage space for the interface.
  • the storage space is infinite
  • the obtained data forwarding rate can be directly stored into the storage space, where the infinite size is for the number of bytes included in the data forwarding rate, that is, the storage space is stored for a long time.
  • the data forwarding rate of the interface is not saturated. The longer time may be the time corresponding to the lifetime of the network device.
  • an alternative manner may be adopted, and the data forwarding rate is stored in a storage space for the interface.
  • storing the obtained data forwarding rate in the storage space for the interface including: determining whether the storage space is saturated; and when determining saturation, using the acquired data forwarding The rate replaces any data forwarding rate stored in the storage space, and is stored in the storage space; otherwise, the obtained data forwarding rate is directly stored into the storage space for the interface.
  • FIG. 2 is a process of determining network traffic when the storage space is not infinite, according to an embodiment of the present invention, the process includes the following steps:
  • S201 For each interface of the network device, obtain the data forwarding rate of the interface at each collection time in the statistics period in each statistical period of the network traffic.
  • step S202 Determine whether the storage space for the interface is saturated. If the determination result is yes, proceed to step S203; otherwise, proceed to step S204.
  • step S203 Replace any data forwarding rate stored in the storage space with the obtained data forwarding rate, and store the data forwarding rate in the storage space, and then proceed to step S205.
  • S204 The obtained data forwarding rate is directly stored into the storage space for the interface, and then step S205 is performed.
  • S205 Determine network traffic of the interface according to each data forwarding rate stored in the storage space.
  • the record is obtained for each saved data forwarding rate.
  • the acquisition time of the data forwarding rate in general, the acquisition time may be replaced by the acquisition time.
  • each data forwarding rate stored in the storage space and the acquisition time of each data forwarding rate may be used. Determine the network traffic for this interface.
  • determining, according to each statistical period, the network traffic of the interface in the statistics period including: according to each collection time in the statistical period, The data forwarding rate obtained at each collection time stored in the storage space is determined, and the network traffic of the interface in the statistical period is determined.
  • determining the network traffic of the interface according to each data forwarding rate stored in the storage space and obtaining the data forwarding rate determining an average of each data forwarding rate stored in the storage space. And determining, according to the obtained acquisition time of each data forwarding rate, a maximum value and a minimum value of the obtaining time, and determining a time period for performing traffic statistics according to the determined difference between the maximum value and the minimum value of the obtaining time, according to The average of the data forwarding rate determined and the time period of the traffic statistics are determined to determine the network traffic of the interface.
  • the data forwarding rate of the acquisition time in the statistics period is first searched, and the average value of the data forwarding rate is determined according to the found data forwarding rate. Determining, according to each acquired time, a maximum value and a minimum value of the acquisition time, and determining a time period corresponding to the difference between the maximum value and the minimum value, according to the determined average value of the data forwarding rate, and the time period , determine the network traffic of the interface during the statistical period.
  • the method further includes: determining the storage space. The time at which each data forwarding rate is stored in the storage time; the data forwarding rate obtained in the storage space is replaced with the data forwarding rate in the storage space.
  • the storage space for each interface corresponds to one slip interval
  • the slip region includes a plurality of storage units
  • each storage unit stores each data forwarding rate stored in chronological order.
  • the slip interval includes m (m is an integer greater than 1) storage units
  • each storage unit stores a data forwarding rate
  • the number of the m storage units is l ⁇ m, respectively, and the number is l ⁇
  • the data transfer rate of the interface acquired from the first acquisition time to the mth acquisition time is sequentially stored in each storage unit of m.
  • the data forwarding rate of the interface at the time of the m+1th acquisition is obtained, it can be known that the first m+1 of the acquisition time corresponding to the first acquisition time in the storage space is obtained.
  • the data forwarding rate at the acquisition time is stored in the storage unit numbered 1.
  • the data forwarding rate of the earliest acquisition time in the storage is replaced by the foregoing method, the data forwarding rate stored in the storage space is ensured, and the data forwarding rate obtained at the time when the network traffic is determined and the time difference is small, so The time period for determining the network traffic is small, so that when the network traffic is determined later, the recently obtained data forwarding rate is used for corresponding calculation to ensure the accuracy of the determined network traffic.
  • FIG. 3 is a specific implementation process for determining network traffic according to an embodiment of the present invention, where the process includes the following steps:
  • S301 For each interface of the network device, obtain the data forwarding rate of the interface at each collection time in the statistics period in each statistical period of the network traffic.
  • S302 Determine whether the storage space for the interface is saturated. If the determination result is yes, proceed to step S303; otherwise, proceed to step S304.
  • S303 Determine an acquisition time of each data forwarding rate stored in the storage space, and replace the data forwarding rate with the earliest acquisition time in the storage space by using the acquired data forwarding rate, and then proceed to step S305.
  • step S304 The obtained data forwarding rate is directly stored in the storage space for the interface, and then step S305 is performed.
  • S305 Determine network traffic of the interface according to each data forwarding rate stored in the storage space.
  • determining the network traffic for this interface includes:
  • the network traffic of the interface is determined as the network traffic of the interface; or, the determined network traffic of the interface is compared with the saved threshold interval of the network traffic of the interface, and the network traffic of the interface is compared according to the result of the comparison.
  • the threshold interval is updated, and the threshold interval of the network traffic is used as the determined network traffic of the interface.
  • the network traffic may be temporarily saved in the corresponding storage space, and the network traffic is provided to the user when the user uses the network traffic.
  • the corresponding threshold interval is saved in the storage space, and updating the threshold interval of the network traffic of the interface includes: determining the determined network traffic of the interface The corresponding minimum and maximum values of the threshold interval are compared; when the network traffic is less than the minimum value or greater than the maximum value, the threshold interval of the network traffic of the interface is updated.
  • the threshold interval corresponds to a maximum value and a minimum value.
  • the maximum value and the minimum value corresponding to the threshold interval are both 0.
  • FIG. 4 is another specific implementation process for determining network traffic according to an embodiment of the present invention, where the process includes the following steps:
  • step S402 Determine whether the storage space for the interface is saturated. When the determination result is yes, proceed to step S403; otherwise, proceed to step S404.
  • S403 Determine an acquisition time of each data forwarding rate stored in the storage space, and replace the data forwarding rate of the earliest acquisition time in the storage space by using the acquired data forwarding rate, and then proceed to step S405.
  • step S404 The obtained data forwarding rate is directly stored in the storage space for the interface, and then step S405 is performed.
  • S405 Determine network traffic of the interface according to each data forwarding rate stored in the storage space.
  • step S406 Comparing the determined network traffic of the interface with a corresponding minimum value and a maximum value of the threshold interval, determining whether the network traffic is greater than a maximum value or a minimum value, and when one of the solutions exists, performing step S407; otherwise, performing step S407; Go to step S408.
  • the network traffic threshold interval is provided to the user as the determined network traffic of the interface.
  • the above process is described by taking the storage space of the data forwarding rate as non-infinite. For example, when the storage space is infinite, the steps S401 and S404 to S408 may be directly performed.
  • FIG. 5 is a schematic structural diagram of a network traffic determining apparatus according to an embodiment of the present invention, where the apparatus includes:
  • the determining module 53 is configured to determine network traffic of the interface according to each data forwarding rate stored in the storage space.
  • the storage module 52 is specifically configured to directly store the data forwarding rate to a storage space for the interface when the storage space is infinite; otherwise, the data forwarding rate to be obtained is replaced by an alternative manner. Stored in the storage space for the interface.
  • the storage module 52 is specifically configured to determine whether the storage space is saturated. When the saturation is determined, any data forwarding rate stored in the storage space is replaced by the acquired data forwarding rate, and stored in the storage. In space, otherwise, the obtained data forwarding rate is directly stored into the storage space for the interface.
  • the storage module 52 is specifically configured to determine an acquisition time of each data forwarding rate stored in the storage space, and replace the data forwarding rate of the earliest acquisition time in the storage space by using the acquired data forwarding rate.
  • the determining module 53 is specifically configured to determine network traffic of the interface according to each data forwarding rate stored in the storage space and obtain an acquisition time of the data forwarding rate.
  • the determining module 53 is specifically configured to use the determined network traffic of the interface as the determined network traffic of the interface; or, compare the determined network traffic of the interface with a threshold interval of the saved network traffic of the interface. And updating the threshold interval of the network traffic of the interface according to the comparison result, and using the threshold interval of the network traffic as the determined network traffic of the interface.
  • the determining module 53 is specifically configured to compare network traffic of the interface with a corresponding minimum value and maximum value of the threshold interval; when the network traffic is less than a minimum value or greater than a maximum value, network traffic of the interface The threshold interval is updated.
  • the specific device may be located in a network device such as a switch or a router, and specifically may be located in a central processing unit (CPU), a network processor, a single chip microcomputer, and a field programmable gate array of the network device.
  • Column (FPGA) is medium.
  • an embodiment of the present invention further provides a network device, where the network device includes the device shown in FIG.
  • An embodiment of the present invention provides a method, a device, and a network device for determining a network traffic.
  • the method obtains a data forwarding rate of each interface at each collection time in a statistical period, and saves the obtained data forwarding rate to the storage space.
  • the network traffic of the interface is determined according to each data forwarding rate saved in the storage space.
  • the data forwarding rate of the interface is obtained at each collection time in the statistics period, and the network traffic of the interface is determined according to each data forwarding rate obtained, so that short-term burst data can be effectively avoided. Determine the impact of network traffic accuracy, thereby improving the accuracy of the determined network traffic.

Abstract

Disclosed are a method, apparatus and network device for determining network traffic; the method determines the network traffic of an interface by obtaining the data forwarding rate of each interface at each collection time point within a statistical period, storing the obtained data forwarding rate to a storage space, and determining the network traffic of the interface according to each data forwarding rate stored in the storage space. According to the present invention, the data forwarding rate of the interface at each collection time point within the statistical period is obtained and the network traffic is determined according to the obtained data forwarding rate, thus able to effectively prevent the impact caused by short-term burst data on the accuracy of network traffic determination, thereby improving the accuracy of network traffic determination.

Description

一种网络流量确定方法、 装置及网络设备 技术领域  Method, device and network device for determining network traffic
本发明涉及数据分组交换技术领域, 尤其涉及一种网络流量确定方法、 装置及网络设备。 背景技术  The present invention relates to the field of data packet switching technologies, and in particular, to a network traffic determining method, apparatus, and network device. Background technique
路由器和交换机等进行数据转发的网络设备, 其数据转发速率一般采 用 bit/s来表示, 也就是说当标识某一网络设备的接口为 100M时, 该网络 设备的接口可以支持每秒 100Mbit 的转发速率。 但是实际上数据是以数据 包的形式来传输的, 所以以上述数据转发速率来标识可能会出现偏差。 这 是因为当某一接口传输的数据包大部分都是 1024字节时, 该接口可以达到 100Mbit/s的速率,但是当该接口传输的数据包大部分都是 64字节时,该接 口只能达到 50Mbit/s的速率。  For network devices that forward data such as routers and switches, the data forwarding rate is generally expressed in bits/s. That is, when the interface identifying a network device is 100M, the interface of the network device can support forwarding of 100 Mbits per second. rate. However, in reality, the data is transmitted in the form of a data packet, so the identification may be biased by the above data forwarding rate. This is because when a packet transmitted by an interface is mostly 1024 bytes, the interface can reach a rate of 100 Mbit/s, but when most of the packets transmitted by the interface are 64 bytes, the interface only Can reach a rate of 50 Mbit / s.
因此为了准确的标识某一接口的数据转发速率, 数据转发速率可以采 用 pps来标识, pps为每秒可以转发的数据包的数目。 例如: 当标识某一接 口的数据转发速率为 30Mpps时, 则表示该接口每秒可以转发 30M个数据 包, 并且其中每个数据包的长度采用数据包的最小长度来标识, 对于以太 网该数据包为 64字节, 对于光口 ( Packet over SDH, POS )该数据包为 40 字节。  Therefore, in order to accurately identify the data forwarding rate of an interface, the data forwarding rate can be identified by pps, which is the number of packets that can be forwarded per second. For example, when the data forwarding rate of an interface is 30 Mpps, the interface can forward 30 M packets per second, and the length of each packet is identified by the minimum length of the packet. For Ethernet, the data is The packet is 64 bytes, and the packet is 40 bytes for the optical port (Packet over SDH, POS).
另外, 随着数据业务的开展, 用户对进行数据转发的网络设备的数据 转发速率提出了越来越高的要求, 但是随着数据转发速率的提高网络设备 的价格也会相应的提高。 因此为了提高数据转发的速率并降低系统的成本, 一般随着数据业务的开展, 通过已安装的网络设备对数据流量进行统计, 为之后的网络设备升级提供依据。 但现有技术中, 在对网络流量进行计算时, 一般根据每个时间点上转 发的数据包的字节数确定, 但是对于数据的传输, 其突发性很大, 即某一 个时间点该网络设备传输的数据包包含的字节数可能比较大, 但另一时间 点该网络设备传输的数据包包含的字节数可能比较少, 因此该网络流量的 统计方法, 无法准确、 有效的确定网络设备的网络流量。 发明内容 In addition, with the development of data services, users have higher and higher requirements on the data forwarding rate of network devices that perform data forwarding. However, as the data forwarding rate increases, the price of network devices will increase accordingly. Therefore, in order to improve the rate of data forwarding and reduce the cost of the system, data traffic is counted through the installed network equipment to provide a basis for subsequent network equipment upgrades. However, in the prior art, when calculating network traffic, it is generally determined according to the number of bytes of data packets forwarded at each time point, but for data transmission, the burstiness is large, that is, at a certain time point. The number of bytes transmitted by the network device may be relatively large, but at another point in time, the number of bytes transmitted by the network device may be less, so the statistical method of the network traffic cannot be accurately and effectively determined. Network traffic for network devices. Summary of the invention
有鉴于此, 本发明实施例提供一种网络流量确定方法、 装置及网络设 备, 用以解决现有技术无法准确、 有效确定网络流量的问题。  In view of this, the embodiments of the present invention provide a method, a device, and a network device for determining network traffic, which are used to solve the problem that the prior art cannot accurately and effectively determine network traffic.
本发明实施例提供的一种网络流量确定方法, 包括:  A method for determining network traffic according to an embodiment of the present invention includes:
针对网络设备的每个接口, 在网络流量的每个统计周期内, 获取所述 统计周期内每个采集时刻所述接口的数据转发速率;  For each interface of the network device, the data forwarding rate of the interface at each collection time in the statistical period is obtained in each statistical period of the network traffic;
将获取的所述数据转发速率存储到针对所述接口的存储空间中; 根据所述存储空间中存储的每个数据转发速率, 确定所述接口的网络 流量。  And storing the obtained data forwarding rate into a storage space for the interface; determining network traffic of the interface according to each data forwarding rate stored in the storage space.
本发明实施例提供的一种网络流量确定装置, 包括:  A network traffic determining apparatus provided by an embodiment of the present invention includes:
获取模块, 用于针对网络设备的每个接口, 在网络流量的每个统计周 期内, 获取所述统计周期内每个采集时刻所述接口的数据转发速率;  An obtaining module, configured to obtain, for each interface of the network device, a data forwarding rate of the interface at each collection time in the statistics period in each statistical period of the network traffic;
存储模块, 用于将获取的所述数据转发速率存储到针对所述接口的存 储空间中;  a storage module, configured to store the obtained data forwarding rate into a storage space for the interface;
确定模块, 用于根据所述存储空间中存储的每个数据转发速率, 确定 所述接口的网络流量。  And a determining module, configured to determine network traffic of the interface according to each data forwarding rate stored in the storage space.
本发明实施例提供的一种网络设备, 包括上述所述的装置。  A network device provided by an embodiment of the present invention includes the foregoing device.
本发明实施例提供了一种网络流量确定方法、 装置及网络设备, 该方 法通过获取统计周期内每个接口在每个采集时刻的数据转发速率, 并将获 取的该数据转发速率保存到存储空间中, 根据存储空间中保存的每个数据 转发速率, 确定该接口的网络流量。 由于在本发明实施例中获取统计周期 内每个采集时刻该接口的数据转发速率, 根据获取的每个数据转发速率, 确定该接口的网络流量, 因此可以有效的避免短时突发数据对确定网络流 量准确性的影响, 从而提高了确定的网络流量的准确性。 附图说明 An embodiment of the present invention provides a method, a device, and a network device for determining a network traffic. The method obtains a data forwarding rate of each interface at each collection time in a statistical period, and saves the obtained data forwarding rate to the storage space. , according to each data saved in the storage space The forwarding rate, which determines the network traffic of the interface. In the embodiment of the present invention, the data forwarding rate of the interface is obtained at each collection time in the statistics period, and the network traffic of the interface is determined according to each data forwarding rate obtained, so that the short-term burst data pair can be effectively avoided. The impact of network traffic accuracy, thereby improving the accuracy of the determined network traffic. DRAWINGS
图 1为本发明实施例提供的一种网络流量的确定过程;  FIG. 1 is a flowchart of determining network traffic according to an embodiment of the present invention;
图 2 为本发明实施例提供的当该存储空间并非无限大时, 确定网络流 量的过程;  2 is a process of determining network traffic when the storage space is not infinite, according to an embodiment of the present invention;
图 3为本发明实施例提供的确定网络流量的一个具体实现过程; 图 4为本发明实施例提供的进行网络流量确定的另一具体实现过程; 图 5为本发明实施例提供的一种网络流量确定装置的结构示意图。 具体实施方式  FIG. 3 is a specific implementation process for determining network traffic according to an embodiment of the present invention; FIG. 4 is another specific implementation process for determining network traffic according to an embodiment of the present invention; FIG. Schematic diagram of the structure of the flow determining device. detailed description
本发明实施例为了提高确定网络流量的准确性, 提供了一种网络流量 的确定方法, 及相应的装置和网络设备, 该方法中通过获取统计周期内, 每个采集时刻接口的数据转发速率, 根据获取的每个数据转发速率, 确定 该接口的网络流量, 因此可以有效的避免短时突发数据对确定网络流量准 确性的影响, 从而提高了确定的网络流量的准确性。  In order to improve the accuracy of determining the network traffic, the embodiment of the present invention provides a method for determining network traffic, and a corresponding device and a network device, where the data forwarding rate of the interface at each collection time is obtained by obtaining the statistics period. According to the obtained data forwarding rate, the network traffic of the interface is determined, so that the impact of the short-term burst data on determining the accuracy of the network traffic can be effectively avoided, thereby improving the accuracy of the determined network traffic.
为了使本发明所要解决的技术问题、 技术方案及有益效果更加清楚、 明白, 以下结合附图和实施例, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实施例仅仅用以解释本发明, 并不用于限定本发明。  The present invention will be further described in detail below with reference to the accompanying drawings and embodiments in order to make the present invention. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
图 1 为本发明实施例提供的一种网络流量的确定过程, 该过程包括以 下步驟:  FIG. 1 is a flowchart of determining network traffic according to an embodiment of the present invention, where the process includes the following steps:
S101 : 针对网络设备的每个接口, 在网络流量的每个统计周期内, 获 取该统计周期内每个采集时刻该接口的数据转发速率。 其中, 每个统计周期包括至少两个采集时刻。 S101: For each interface of the network device, obtain the data forwarding rate of the interface at each collection time in the statistics period in each statistical period of the network traffic. Each statistical period includes at least two acquisition moments.
该网络设备可以为路由器或交换机。  The network device can be a router or a switch.
另外, 在获取每个采集时刻该接口的数据转发速率时, 可以以 bit/s为 单位获取该接口的数据转发速率,或者也可以以 pps为单位获取该接口的数 据转发速率。 同时在获取该接口的数据转发速率时, 可以根据该接口转发 的所有数据包, 获取该接口的转发该所有数据包的数据转发速率, 也可以 针对某一种, 或某几种数据包, 获取该接口转发该一种或几种数据包的数 据转发速率。  In addition, when obtaining the data forwarding rate of the interface at each collection time, the data forwarding rate of the interface may be obtained in bit/s, or the data forwarding rate of the interface may be obtained in units of pps. At the same time, when the data forwarding rate of the interface is obtained, the data forwarding rate of all the data packets forwarded by the interface may be obtained according to all the data packets forwarded by the interface, or may be obtained for one type or some types of data packets. The interface forwards the data forwarding rate of the one or several data packets.
S102: 将获取的所述数据转发速率存储到针对所述接口的存储空间中。 在该网络设备中可以针对每个接口都设置对应的存储空间, 用于存储 获取的每个数据转发速率。  S102: Store the obtained data forwarding rate into a storage space for the interface. A corresponding storage space can be set for each interface in the network device, and used to store each data forwarding rate obtained.
其中, 将获取的所述数据转发速率存储到针对所述接口的存储空间中 , 具体包括: 当所述存储空间无限大时, 直接将所述数据转发速率存储到针 对所述接口的存储空间;  And storing the obtained data forwarding rate in the storage space for the interface, specifically: when the storage space is infinite, directly storing the data forwarding rate to a storage space for the interface;
否则, 采用替换的方式, 将获取的所述数据转发速率存储到针对所述 接口的存储空间中。  Otherwise, in an alternative manner, the obtained data forwarding rate is stored in a storage space for the interface.
S103: 根据所述存储空间中存储的每个数据转发速率, 确定该接口的 网络流量。  S103: Determine network traffic of the interface according to each data forwarding rate stored in the storage space.
所述确定该接口的网络流量包括:  The determining the network traffic of the interface includes:
根据所述存储空间中存储的每个数据转发速率, 以及获取该数据转发 速率的获取时刻, 确定该接口的网络流量。  Determining network traffic of the interface according to each data forwarding rate stored in the storage space and obtaining an acquisition time of the data forwarding rate.
在本发明实施例中可以针对网络设备中的每个接口, 分别确定该接口 的网络流量。 在确定每个接口的网络流量时, 可以根据每个接口分别设置 对应的统计周期以及采集时刻, 或者, 也可以针对所有的接口设置相同的 统计周期以及采集时刻。 当针对每个接口分别设置了对应了统计周期以及 采集时刻后, 即可针对统计周期以及采集时刻, 确定该接口的网络流量, 而针对每个接口, 确定该接口网络流量的过程都是相同的。 In the embodiment of the present invention, network traffic of the interface may be separately determined for each interface in the network device. When determining the network traffic of each interface, you can set the corresponding statistics period and collection time according to each interface. Alternatively, you can set the same statistics period and collection time for all interfaces. When each interface is set to correspond to the statistical period and After the collection time, the network traffic of the interface can be determined for the statistical period and the collection time. For each interface, the process of determining the network traffic of the interface is the same.
具体的, 在确定接口的网络流量时, 可以将获取到的每个采集时刻的 接口的数据转发速率存储到针对该接口的存储空间中。 当该存储空间无限 大时, 可以直接将获取的该数据转发速率存储到该存储空间中, 其中该无 限大是针对该数据转发速率包含的字节数而言, 即该存储空间保存较长时 间内该接口的数据转发速率不会饱和, 该较长时间可以是该网络设备的使 用寿命对应的时间。  Specifically, when determining the network traffic of the interface, the obtained data forwarding rate of the interface at each collection time may be stored in a storage space for the interface. When the storage space is infinite, the obtained data forwarding rate can be directly stored into the storage space, where the infinite size is for the number of bytes included in the data forwarding rate, that is, the storage space is stored for a long time. The data forwarding rate of the interface is not saturated. The longer time may be the time corresponding to the lifetime of the network device.
当该存储空间并非无限大, 将获取的该数据转发速率存储到该存储空 间时, 可以采用替换的方式, 将该数据转发速率存储到针对所述接口的存 储空间中。 具体的, 采用替换的方式, 将获取的所述数据转发速率存储到 针对所述接口的存储空间中, 包括: 判断所述存储空间是否已经饱和; 当 确定饱和时, 采用获取的所述数据转发速率替换该存储空间中已存储的任 一数据转发速率, 存储到所述存储空间中; 否则, 直接将获取的所述数据 转发速率存储到针对所述接口的存储空间中。  When the storage space is not infinite, when the obtained data forwarding rate is stored in the storage space, an alternative manner may be adopted, and the data forwarding rate is stored in a storage space for the interface. Specifically, in an alternative manner, storing the obtained data forwarding rate in the storage space for the interface, including: determining whether the storage space is saturated; and when determining saturation, using the acquired data forwarding The rate replaces any data forwarding rate stored in the storage space, and is stored in the storage space; otherwise, the obtained data forwarding rate is directly stored into the storage space for the interface.
图 2 为本发明实施例提供的当该存储空间并非无限大时, 确定网络流 量的过程, 该过程包括以下步驟:  FIG. 2 is a process of determining network traffic when the storage space is not infinite, according to an embodiment of the present invention, the process includes the following steps:
S201 : 针对网络设备的每个接口, 在网络流量的每个统计周期内, 获 取该统计周期内每个采集时刻该接口的数据转发速率。  S201: For each interface of the network device, obtain the data forwarding rate of the interface at each collection time in the statistics period in each statistical period of the network traffic.
S202: 判断针对该接口的存储空间是否已经饱和, 当判断结果为是时, 进行步驟 S203 , 否则, 进行步驟 S204。  S202: Determine whether the storage space for the interface is saturated. If the determination result is yes, proceed to step S203; otherwise, proceed to step S204.
S203: 采用获取的所述数据转发速率替换该存储空间中已存储的任一 数据转发速率, 存储到所述存储空间中, 之后进行步驟 S205。  S203: Replace any data forwarding rate stored in the storage space with the obtained data forwarding rate, and store the data forwarding rate in the storage space, and then proceed to step S205.
S204: 直接将获取的所述数据转发速率存储到针对所述接口的存储空 间中, 之后进行步驟 S205。 S205 : 根据所述存储空间中存储的每个数据转发速率, 确定该接口的 网络流量。 S204: The obtained data forwarding rate is directly stored into the storage space for the interface, and then step S205 is performed. S205: Determine network traffic of the interface according to each data forwarding rate stored in the storage space.
为了便于网络流量的确定, 在本发明实施例中当获取了接口的数据转 发速率, 并将该数据转发速率存储到针对该接口的存储空间中时, 针对保 存的每个数据转发速率, 记录获取该数据转发速率的获取时刻, 一般情况 下该获取时刻可以采用采集时刻代替。 具体的, 当根据该存储空间中存储 的每个数据转发速率, 确定该接口的网络流量时, 可以根据该存储空间中 存储的每个数据转发速率, 以及该每个数据转发速率的获取时刻, 确定该 接口的网络流量。 并且还可以针对每个统计周期, 确定该统计周期内的该 接口的网络流量, 在确定该统计周期内该接口的网络流量时, 包括: 根据 所述统计周期内的每个采集时刻, 以及所述存储空间中存储的该每个采集 时刻获取的数据转发速率, 确定该统计周期内该接口的网络流量。  In order to facilitate the determination of the network traffic, in the embodiment of the present invention, when the data forwarding rate of the interface is obtained, and the data forwarding rate is stored in the storage space for the interface, the record is obtained for each saved data forwarding rate. The acquisition time of the data forwarding rate, in general, the acquisition time may be replaced by the acquisition time. Specifically, when determining the network traffic of the interface according to each data forwarding rate stored in the storage space, each data forwarding rate stored in the storage space and the acquisition time of each data forwarding rate may be used. Determine the network traffic for this interface. And determining, according to each statistical period, the network traffic of the interface in the statistics period, where determining the network traffic of the interface in the statistics period, including: according to each collection time in the statistical period, The data forwarding rate obtained at each collection time stored in the storage space is determined, and the network traffic of the interface in the statistical period is determined.
具体的, 在根据所述存储空间中存储的每个数据转发速率, 以及获取 该数据转发速率的获取时刻, 确定该接口的网络流量时, 确定该存储空间 中存储的每个数据转发速率的平均值, 根据获取的该每个数据转发速率的 获取时刻, 确定该获取时刻的最大值和最小值, 根据确定的该获取时刻的 最大值和最小值的差, 确定进行流量统计的时间段, 根据确定的该数据转 发速率的平均值, 以及该进行流量统计的时间段的积, 确定该接口的网络 流量。  Specifically, when determining the network traffic of the interface according to each data forwarding rate stored in the storage space and obtaining the data forwarding rate, determining an average of each data forwarding rate stored in the storage space. And determining, according to the obtained acquisition time of each data forwarding rate, a maximum value and a minimum value of the obtaining time, and determining a time period for performing traffic statistics according to the determined difference between the maximum value and the minimum value of the obtaining time, according to The average of the data forwarding rate determined and the time period of the traffic statistics are determined to determine the network traffic of the interface.
而在针对该统计周期, 确定该统计周期内该接口的网络流量时, 首先 查找获取时刻在该统计周期内的数据转发速率, 根据查找到的数据转发速 率, 确定数据转发速率的平均值, 针对根据查找到的每个获取时刻, 确定 该获取时刻的最大值和最小值, 并确定该最大值和最小值的差对应的时间 段, 根据确定的该数据转发速率的平均值, 以及该时间段, 确定该接口在 该统计周期内的网络流量。 为了保证该接口的网络流量确定的准确性, 在本发明实施例中采用获 取的该数据转发速率替换该存储空间中已存储的任一数据转发速率时, 可 以进一步的包括: 确定所述存储空间中已存储的每个数据转发速率的获取 时刻; 采用该获取的所述数据转发速率, 替换该存储空间中获取时刻最早 的数据转发速率。 When determining the network traffic of the interface in the statistics period, the data forwarding rate of the acquisition time in the statistics period is first searched, and the average value of the data forwarding rate is determined according to the found data forwarding rate. Determining, according to each acquired time, a maximum value and a minimum value of the acquisition time, and determining a time period corresponding to the difference between the maximum value and the minimum value, according to the determined average value of the data forwarding rate, and the time period , determine the network traffic of the interface during the statistical period. In order to ensure the accuracy of the network traffic determination of the interface, in the embodiment of the present invention, when the data forwarding rate is used to replace any data forwarding rate stored in the storage space, the method further includes: determining the storage space. The time at which each data forwarding rate is stored in the storage time; the data forwarding rate obtained in the storage space is replaced with the data forwarding rate in the storage space.
即可以认为针对每个接口的存储空间都对应一个滑差区间, 该滑差区 间中包括多个存储单元, 每个存储单元保存有按照时间顺序存储的每个数 据转发速率。 例如当该滑差区间包括 m ( m为大于 1的整数)个存储单元 中, 每个存储单元存储一个数据转发速率, 该 m个存储单元的编号分别为 l~m, 则在编号为 l~m的每个存储单元中依次存储第 1采集时刻〜第 m采 集时刻获取到的接口的数据转发速率。 当第 m+1采集时刻到来, 获取到该 第 m+1采集时刻该接口的数据转发速率时, 可知该存储空间中第 1采集时 刻对应的获取时刻最早, 则将获取的该第 m+1采集时刻的该数据转发速率 存储到该编号为 1的存储单元中。  That is, it can be considered that the storage space for each interface corresponds to one slip interval, and the slip region includes a plurality of storage units, and each storage unit stores each data forwarding rate stored in chronological order. For example, when the slip interval includes m (m is an integer greater than 1) storage units, each storage unit stores a data forwarding rate, and the number of the m storage units is l~m, respectively, and the number is l~ The data transfer rate of the interface acquired from the first acquisition time to the mth acquisition time is sequentially stored in each storage unit of m. When the m+1th acquisition time comes, and the data forwarding rate of the interface at the time of the m+1th acquisition is obtained, it can be known that the first m+1 of the acquisition time corresponding to the first acquisition time in the storage space is obtained. The data forwarding rate at the acquisition time is stored in the storage unit numbered 1.
当采用上述方法替换该存储中获取时刻最早的数据转发速率时, 可以 保证该存储空间中存储的数据转发速率, 都是与网络流量确定时刻, 时间 差较小的时刻获取的数据转发速率, 因此该进行网络流量确定的时间段较 小, 从而可以保证在后续进行网络流量确定时, 采用最近获取的数据转发 速率进行相应的计算, 保证确定的网络流量的准确性。  When the data forwarding rate of the earliest acquisition time in the storage is replaced by the foregoing method, the data forwarding rate stored in the storage space is ensured, and the data forwarding rate obtained at the time when the network traffic is determined and the time difference is small, so The time period for determining the network traffic is small, so that when the network traffic is determined later, the recently obtained data forwarding rate is used for corresponding calculation to ensure the accuracy of the determined network traffic.
图 3 为本发明实施例提供的确定网络流量的一个具体实现过程, 该过 程包括以下步驟:  FIG. 3 is a specific implementation process for determining network traffic according to an embodiment of the present invention, where the process includes the following steps:
S301 : 针对网络设备的每个接口, 在网络流量的每个统计周期内, 获 取该统计周期内每个采集时刻该接口的数据转发速率。  S301: For each interface of the network device, obtain the data forwarding rate of the interface at each collection time in the statistics period in each statistical period of the network traffic.
S302: 判断针对该接口的存储空间是否已经饱和, 当判断结果为是时, 进行步驟 S303 , 否则, 进行步驟 S304。 S303 : 确定所述存储空间中已存储的每个数据转发速率的获取时刻, 采用该获取的所述数据转发速率, 替换该存储空间中获取时刻最早的数据 转发速率, 之后进行步驟 S305。 S302: Determine whether the storage space for the interface is saturated. If the determination result is yes, proceed to step S303; otherwise, proceed to step S304. S303: Determine an acquisition time of each data forwarding rate stored in the storage space, and replace the data forwarding rate with the earliest acquisition time in the storage space by using the acquired data forwarding rate, and then proceed to step S305.
S304: 直接将获取的所述数据转发速率存储到针对所述接口的存储空 间中, 之后进行步驟 S305。  S304: The obtained data forwarding rate is directly stored in the storage space for the interface, and then step S305 is performed.
S305 : 根据所述存储空间中存储的每个数据转发速率, 确定该接口的 网络流量。  S305: Determine network traffic of the interface according to each data forwarding rate stored in the storage space.
另外, 确定该接口的网络流量包括:  In addition, determining the network traffic for this interface includes:
将确定该接口的网络流量, 作为该接口的网络流量; 或, 将确定的该 接口的网络流量, 与保存的该接口的网络流量的阈值区间比较, 根据比较 的结果对该接口的网络流量的阈值区间进行更新, 将该网络流量的阈值区 间作为确定的该接口的网络流量。  The network traffic of the interface is determined as the network traffic of the interface; or, the determined network traffic of the interface is compared with the saved threshold interval of the network traffic of the interface, and the network traffic of the interface is compared according to the result of the comparison. The threshold interval is updated, and the threshold interval of the network traffic is used as the determined network traffic of the interface.
即在本发明实施例中当确定了接口的网络流量后, 可以暂时将该网络 流量保存在对应的存储空间中, 待用户使用时将该网络流量提供给用户。 另外为了进一步保证提供的网络流量的准确性, 在本发明实施例中该存储 空间中保存对应的阈值区间, 对该接口的网络流量的阈值区间进行更新包 括: 将确定的该接口的网络流量与所述阈值区间的对应的最小值及最大值 比较; 当所述网络流量小于最小值或大于最大值时, 对该接口的网络流量 的阈值区间进行更新。  That is, in the embodiment of the present invention, after the network traffic of the interface is determined, the network traffic may be temporarily saved in the corresponding storage space, and the network traffic is provided to the user when the user uses the network traffic. In addition, in order to further ensure the accuracy of the provided network traffic, in the embodiment of the present invention, the corresponding threshold interval is saved in the storage space, and updating the threshold interval of the network traffic of the interface includes: determining the determined network traffic of the interface The corresponding minimum and maximum values of the threshold interval are compared; when the network traffic is less than the minimum value or greater than the maximum value, the threshold interval of the network traffic of the interface is updated.
该阈值区间对应一个最大值和最小值, 在初始化状态下, 阈值区间对 应的最大值和最小值都为 0, 当获取了该接口的网络流量后, 采用上述方法 对该网络流量进行更新即可。  The threshold interval corresponds to a maximum value and a minimum value. In the initialization state, the maximum value and the minimum value corresponding to the threshold interval are both 0. After the network traffic of the interface is obtained, the network traffic is updated by using the foregoing method. .
图 4为本发明实施例提供的进行网络流量确定的另一具体实现过程, 该过程包括以下步驟:  FIG. 4 is another specific implementation process for determining network traffic according to an embodiment of the present invention, where the process includes the following steps:
S401 : 针对网络设备的每个接口, 在网络流量的每个统计周期内, 获 取该统计周期内每个采集时刻该接口的数据转发速率。 S401: for each interface of the network device, in each statistical period of network traffic, The data forwarding rate of the interface at each collection time in the statistics period is taken.
S402: 判断针对该接口的存储空间是否已经饱和, 当判断结果为是时, 进行步驟 S403 , 否则, 进行步驟 S404。  S402: Determine whether the storage space for the interface is saturated. When the determination result is yes, proceed to step S403; otherwise, proceed to step S404.
S403 : 确定所述存储空间中已存储的每个数据转发速率的获取时刻, 采用该获取的所述数据转发速率, 替换该存储空间中获取时刻最早的数据 转发速率, 之后进行步驟 S405。  S403: Determine an acquisition time of each data forwarding rate stored in the storage space, and replace the data forwarding rate of the earliest acquisition time in the storage space by using the acquired data forwarding rate, and then proceed to step S405.
S404: 直接将获取的所述数据转发速率存储到针对所述接口的存储空 间中, 之后进行步驟 S405。  S404: The obtained data forwarding rate is directly stored in the storage space for the interface, and then step S405 is performed.
S405 : 根据所述存储空间中存储的每个数据转发速率, 确定该接口的 网络流量。  S405: Determine network traffic of the interface according to each data forwarding rate stored in the storage space.
S406: 将确定的该接口的网络流量与所述阈值区间的对应的最小值及 最大值比较, 判断该网络流量是否大于最大值或小于最小值, 当其中的一 个存在时, 进行步驟 S407 , 否则, 进行步驟 S408。  S406: Comparing the determined network traffic of the interface with a corresponding minimum value and a maximum value of the threshold interval, determining whether the network traffic is greater than a maximum value or a minimum value, and when one of the solutions exists, performing step S407; otherwise, performing step S407; Go to step S408.
S407: 当确定的网络流量大于最大值时, 采用确定的该网络流量对阈 值区间的最大值进行更新, 当确定的网络流量小于最小值时, 采用确定的 该网络流量对阈值区间的最小值进行更新。  S407: When the determined network traffic is greater than the maximum value, the determined network traffic is used to update the maximum value of the threshold interval. When the determined network traffic is less than the minimum value, the determined network traffic is used to determine the minimum value of the threshold interval. Update.
S408: 保持该网络流量阈值区间不变。  S408: Keep the network traffic threshold interval unchanged.
当用户需要获取该网络流量时, 将该网络流量阈值区间作为确定的该 接口的网络流量提供给用户。  When the user needs to obtain the network traffic, the network traffic threshold interval is provided to the user as the determined network traffic of the interface.
上述过程是以存储数据转发速率的存储空间非无限大为例进行说明 的, 当该存储空间为无限大时, 直接执行步驟 S401、 S404~ S408即可。  The above process is described by taking the storage space of the data forwarding rate as non-infinite. For example, when the storage space is infinite, the steps S401 and S404 to S408 may be directly performed.
图 5 为本发明实施例提供的一种网络流量确定装置的结构示意图, 该 装置包括:  FIG. 5 is a schematic structural diagram of a network traffic determining apparatus according to an embodiment of the present invention, where the apparatus includes:
获耳 4莫块 51 , 用于针对网络设备的每个接口, 在网络流量的每个统计 周期内, 获取该统计周期内每个采集时刻该接口的数据转发速率; 存储模块 52 , 用于将获取的所述数据转发速率存储到针对所述接口的 存储空间中; Obtaining the data forwarding rate of the interface at each collection time in the statistical period in each statistical period of the network traffic for each interface of the network device; a storage module 52, configured to store the obtained data forwarding rate into a storage space for the interface;
确定模块 53 , 用于根据所述存储空间中存储的每个数据转发速率, 确 定该接口的网络流量。  The determining module 53 is configured to determine network traffic of the interface according to each data forwarding rate stored in the storage space.
所述存储模块 52 , 具体用于当所述存储空间无限大时, 直接将所述数 据转发速率存储到针对所述接口的存储空间; 否则, 采用替换的方式, 将 获取的所述数据转发速率存储到针对所述接口的存储空间中。  The storage module 52 is specifically configured to directly store the data forwarding rate to a storage space for the interface when the storage space is infinite; otherwise, the data forwarding rate to be obtained is replaced by an alternative manner. Stored in the storage space for the interface.
所述存储模块 52 , 具体用于判断所述存储空间是否已经饱和; 当确定 饱和时, 采用获取的所述数据转发速率替换该存储空间中已存储的任一数 据转发速率, 存储到所述存储空间中, 否则, 直接将获取的所述数据转发 速率存储到针对所述接口的存储空间中。  The storage module 52 is specifically configured to determine whether the storage space is saturated. When the saturation is determined, any data forwarding rate stored in the storage space is replaced by the acquired data forwarding rate, and stored in the storage. In space, otherwise, the obtained data forwarding rate is directly stored into the storage space for the interface.
所述存储模块 52 , 具体用于确定所述存储空间中已存储的每个数据转 发速率的获取时刻; 采用该获取的所述数据转发速率, 替换该存储空间中 获取时刻最早的数据转发速率。  The storage module 52 is specifically configured to determine an acquisition time of each data forwarding rate stored in the storage space, and replace the data forwarding rate of the earliest acquisition time in the storage space by using the acquired data forwarding rate.
所述确定模块 53 , 具体用于根据所述存储空间中存储的每个数据转发 速率, 以及获取该数据转发速率的获取时刻, 确定该接口的网络流量。  The determining module 53 is specifically configured to determine network traffic of the interface according to each data forwarding rate stored in the storage space and obtain an acquisition time of the data forwarding rate.
所述确定模块 53 , 具体用于将确定的该接口的网络流量, 作为确定的 该接口的网络流量; 或, 将确定的该接口的网络流量, 与保存的该接口的 网络流量的阈值区间比较, 根据比较的结果对该接口的网络流量的阈值区 间进行更新, 将该网络流量的阈值区间作为确定的该接口的网络流量。  The determining module 53 is specifically configured to use the determined network traffic of the interface as the determined network traffic of the interface; or, compare the determined network traffic of the interface with a threshold interval of the saved network traffic of the interface. And updating the threshold interval of the network traffic of the interface according to the comparison result, and using the threshold interval of the network traffic as the determined network traffic of the interface.
所述确定模块 53 , 具体用于将该接口的网络流量与所述阈值区间的对 应的最小值及最大值比较; 当所述网络流量小于最小值或大于最大值时, 对该接口的网络流量的阈值区间进行更新。  The determining module 53 is specifically configured to compare network traffic of the interface with a corresponding minimum value and maximum value of the threshold interval; when the network traffic is less than a minimum value or greater than a maximum value, network traffic of the interface The threshold interval is updated.
具体的该装置可以位于交换机或路由器等网络设备中, 具体的可以位 于网络设备的中央处理器(CPU )、 网络处理器、 单片机、 现场可编程门阵 列 (FPGA ) 中等。 The specific device may be located in a network device such as a switch or a router, and specifically may be located in a central processing unit (CPU), a network processor, a single chip microcomputer, and a field programmable gate array of the network device. Column (FPGA) is medium.
另外, 本发明实施例还提供了一种网络设备, 该网络设备包括如图 5 所示的装置。  In addition, an embodiment of the present invention further provides a network device, where the network device includes the device shown in FIG.
本发明实施例提供了一种网络流量确定方法、 装置及网络设备, 该方 法通过获取统计周期内每个接口在每个采集时刻的数据转发速率, 并将获 取的该数据转发速率保存到存储空间中, 根据存储空间中保存的每个数据 转发速率, 确定该接口的网络流量。 由于在本发明实施例中获取统计周期 内每个采集时刻该接口的数据转发速率, 根据获取的每个数据转发速率, 确定该接口的网络流量, 因此可以有效的避免短时突发数据, 对确定网络 流量准确性的影响, 从而提高了确定的网络流量的准确性。  An embodiment of the present invention provides a method, a device, and a network device for determining a network traffic. The method obtains a data forwarding rate of each interface at each collection time in a statistical period, and saves the obtained data forwarding rate to the storage space. The network traffic of the interface is determined according to each data forwarding rate saved in the storage space. In the embodiment of the present invention, the data forwarding rate of the interface is obtained at each collection time in the statistics period, and the network traffic of the interface is determined according to each data forwarding rate obtained, so that short-term burst data can be effectively avoided. Determine the impact of network traffic accuracy, thereby improving the accuracy of the determined network traffic.
上述说明示出并描述了本发明的一个优选实施例, 但如前所述, 应当 理解本发明并非局限于本文所披露的形式, 不应看作是对其他实施例的排 除, 而可用于各种其他组合、 修改和环境, 并能够在本文所述发明构想范 围内, 通过上述教导或相关领域的技术或知识进行改动。 而本领域人员所 进行的改动和变化不脱离本发明的精神和范围, 则都应在本发明所附权利 要求的保护范围内。  The above description shows and describes a preferred embodiment of the present invention, but as described above, it should be understood that the present invention is not limited to the forms disclosed herein, and should not be construed as Other combinations, modifications, and environments are possible and can be modified by the teachings or related art or knowledge within the scope of the inventive concept described herein. All changes and modifications made by those skilled in the art are intended to be within the scope of the appended claims.

Claims

权利要求书 Claim
1、 一种网络流量确定方法, 其特征在于, 包括:  A method for determining network traffic, characterized in that it comprises:
针对网络设备的每个接口, 在网络流量的每个统计周期内, 获取所述 统计周期内每个采集时刻所述接口的数据转发速率;  For each interface of the network device, the data forwarding rate of the interface at each collection time in the statistical period is obtained in each statistical period of the network traffic;
将获取的所述数据转发速率存储到针对所述接口的存储空间中; 根据所述存储空间中存储的每个数据转发速率, 确定所述接口的网络 流量。  And storing the obtained data forwarding rate into a storage space for the interface; determining network traffic of the interface according to each data forwarding rate stored in the storage space.
2、 如权利要求 1所述的方法, 其特征在于, 将获取的所述数据转发速 率存储到针对所述接口的存储空间中, 包括:  2. The method of claim 1, wherein storing the obtained data forwarding rate into a storage space for the interface comprises:
当所述存储空间无限大时, 直接将所述数据转发速率存储到针对所述 接口的存储空间;  When the storage space is infinite, the data forwarding rate is directly stored to a storage space for the interface;
否则, 采用替换的方式, 将获取的所述数据转发速率存储到针对所述 接口的存储空间中。  Otherwise, in an alternative manner, the obtained data forwarding rate is stored in a storage space for the interface.
3、 如权利要求 2所述的方法, 其特征在于, 所述采用替换的方式, 将 获取的所述数据转发速率存储到针对所述接口的存储空间中, 包括:  The method of claim 2, wherein the storing the obtained data forwarding rate in the storage space for the interface comprises:
判断所述存储空间是否已经饱和;  Determining whether the storage space is saturated;
当确定饱和时, 确定所述存储空间中已存储的每个数据转发速率的获 取时刻, 采用获取的所述数据转发速率, 替换所述存储空间中获取时刻最 早的数据转发速率;  When the saturation is determined, determining an acquisition time of each data forwarding rate stored in the storage space, and using the acquired data forwarding rate, replacing the data forwarding rate of the earliest acquisition time in the storage space;
当确定所述存储空间未饱和时, 直接将获取的所述数据转发速率存储 到针对所述接口的存储空间中。  When it is determined that the storage space is not saturated, the acquired data forwarding rate is directly stored into a storage space for the interface.
4、 如权利要求 1 ~3任一所述的方法, 其特征在于, 确定所述接口的网 络流量包括:  The method according to any one of claims 1 to 3, wherein determining the network traffic of the interface comprises:
根据所述存储空间中存储的每个数据转发速率, 以及获取所述数据转 发速率的获取时刻, 确定所述接口的网络流量。 Determining network traffic of the interface according to each data forwarding rate stored in the storage space and obtaining an acquisition time of the data forwarding rate.
5、 如权利要求 1所述的方法, 其特征在于, 确定所述接口的网络流量 包括: 5. The method of claim 1, wherein determining network traffic of the interface comprises:
将确定的所述接口的网络流量, 作为所述接口的网络流量; 或, 将确定的所述接口的网络流量, 与保存的所述接口的网络流量的阈值 区间比较, 根据比较的结果对所述接口的网络流量的阈值区间进行更新, 将更新的网络流量的阈值区间作为确定的所述接口的网络流量。  And determining the network traffic of the interface as the network traffic of the interface; or comparing the determined network traffic of the interface with a threshold interval of the saved network traffic of the interface, according to the comparison result The threshold interval of the network traffic of the interface is updated, and the threshold interval of the updated network traffic is used as the determined network traffic of the interface.
6、 如权利要求 5所述的方法, 其特征在于, 根据比较结果对所述接口 的网络流量的阈值区间进行更新包括:  6. The method according to claim 5, wherein updating the threshold interval of the network traffic of the interface according to the comparison result comprises:
将确定的所述接口的网络流量与所述阈值区间的对应的最小值及最大 值比较;  Comparing the determined network traffic of the interface with a corresponding minimum and maximum value of the threshold interval;
当所述网络流量小于最小值或大于最大值时, 对所述接口的网络流量 的阈值区间进行更新。  When the network traffic is less than the minimum value or greater than the maximum value, the threshold interval of the network traffic of the interface is updated.
7、 一种网络流量确定装置, 其特征在于, 所述装置包括:  7. A network traffic determining device, the device comprising:
获取模块, 用于针对网络设备的每个接口, 在网络流量的每个统计周 期内, 获取所述统计周期内每个采集时刻所述接口的数据转发速率;  An obtaining module, configured to obtain, for each interface of the network device, a data forwarding rate of the interface at each collection time in the statistics period in each statistical period of the network traffic;
存储模块, 用于将获取的所述数据转发速率存储到针对所述接口的存 储空间中;  a storage module, configured to store the obtained data forwarding rate into a storage space for the interface;
确定模块, 用于根据所述存储空间中存储的每个数据转发速率, 确定 所述接口的网络流量。  And a determining module, configured to determine network traffic of the interface according to each data forwarding rate stored in the storage space.
8、 如权利要求 7所述的装置, 其特征在于, 所述存储模块, 具体用于 当所述存储空间无限大时, 直接将所述数据转发速率存储到针对所述接口 的存储空间; 否则, 判断所述存储空间是否已经饱和;  The device according to claim 7, wherein the storage module is specifically configured to directly store the data forwarding rate to a storage space for the interface when the storage space is infinite; , determining whether the storage space is saturated;
当饱和时, 确定所述存储空间中已存储的每个数据转发速率的获取时 刻, 采用获取的所述数据转发速率, 替换所述存储空间中获取时刻最早的 数据转发速率, 当未饱和时, 直接将获取的所述数据转发速率存储到针对 所述接口的存储空间中。 When saturated, determining an acquisition time of each data forwarding rate stored in the storage space, using the acquired data forwarding rate, replacing the data forwarding rate of the earliest acquisition time in the storage space, when not saturated, Directly storing the obtained data forwarding rate to The storage space of the interface.
9、 如权利要求 7~8任一所述的装置, 其特征在于, 所述确定模块, 具 体用于根据所述存储空间中存储的每个数据转发速率, 以及获取所述数据 转发速率的获取时刻, 确定所述接口的网络流量。  The device according to any one of claims 7 to 8, wherein the determining module is specifically configured to acquire, according to each data forwarding rate stored in the storage space, and obtain the data forwarding rate. At the moment, determine the network traffic of the interface.
10、 一种网络设备, 其特征在于, 所述网络设备包括上述权利要求 7~9 任一所述的装置。  A network device, characterized in that the network device comprises the device according to any one of claims 7 to 9.
PCT/CN2011/081030 2011-03-09 2011-10-20 Method, apparatus and network device for determining network traffic WO2012119452A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110055849.5A CN102143071B (en) 2011-03-09 2011-03-09 Method and device for determining network flow as well as network equipment
CN201110055849.5 2011-03-09

Publications (1)

Publication Number Publication Date
WO2012119452A1 true WO2012119452A1 (en) 2012-09-13

Family

ID=44410306

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/081030 WO2012119452A1 (en) 2011-03-09 2011-10-20 Method, apparatus and network device for determining network traffic

Country Status (2)

Country Link
CN (1) CN102143071B (en)
WO (1) WO2012119452A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143071B (en) * 2011-03-09 2015-06-03 中兴通讯股份有限公司 Method and device for determining network flow as well as network equipment
CN103078766B (en) * 2012-12-31 2015-11-25 北京星网锐捷网络技术有限公司 The auditing method of network traffics, device and the network equipment
CN104655218A (en) * 2015-02-03 2015-05-27 成都秦川科技发展有限公司 Safety cut-out type intelligent gas meter with self learning function
CN105162698B (en) * 2015-10-10 2019-03-12 浪潮(北京)电子信息产业有限公司 Method and apparatus of the Cloud Server based on memory models adjustment SDN network path
CN105871735A (en) * 2015-11-16 2016-08-17 乐视致新电子科技(天津)有限公司 Traffic speed obtaining method and device and routing device
CN108989138A (en) * 2017-05-31 2018-12-11 中兴通讯股份有限公司 Data transmission method, device, system and gateway

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101155086A (en) * 2006-09-26 2008-04-02 中兴通讯股份有限公司 Network flux statistical method for broad band and narrow band integrated access equipment
CN101860454A (en) * 2010-06-24 2010-10-13 杭州华三通信技术有限公司 Network performance data processing method and device thereof
CN102143071A (en) * 2011-03-09 2011-08-03 中兴通讯股份有限公司 Method and device for determining network flow as well as network equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101610246B (en) * 2008-06-17 2012-07-11 北京航空航天大学 Method for inferring source-target flow component of link layer of local area network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101155086A (en) * 2006-09-26 2008-04-02 中兴通讯股份有限公司 Network flux statistical method for broad band and narrow band integrated access equipment
CN101860454A (en) * 2010-06-24 2010-10-13 杭州华三通信技术有限公司 Network performance data processing method and device thereof
CN102143071A (en) * 2011-03-09 2011-08-03 中兴通讯股份有限公司 Method and device for determining network flow as well as network equipment

Also Published As

Publication number Publication date
CN102143071A (en) 2011-08-03
CN102143071B (en) 2015-06-03

Similar Documents

Publication Publication Date Title
US10097464B1 (en) Sampling based on large flow detection for network visibility monitoring
US9979624B1 (en) Large flow detection for network visibility monitoring
EP2614621B1 (en) Content router forwarding plane architecture
EP2915299B1 (en) A method for dynamic load balancing of network flows on lag interfaces
US10742532B2 (en) Non-intrusive mechanism to measure network function packet processing delay
US10536360B1 (en) Counters for large flow detection
US9106443B2 (en) Forwarding table optimization with flow data
WO2012119452A1 (en) Method, apparatus and network device for determining network traffic
US8005012B1 (en) Traffic analysis of data flows
US8799507B2 (en) Longest prefix match searches with variable numbers of prefixes
US10003515B1 (en) Network visibility monitoring
US11316804B2 (en) Forwarding entry update method and apparatus in a memory
JP5967222B2 (en) Packet processing apparatus, flow entry arrangement method and program
US9667722B2 (en) Method and system for non-tagged based latency calculation
US9548929B2 (en) Frame transfer apparatus and frame transfer method
US9832066B2 (en) Port number extension method and switch
US9137158B2 (en) Communication apparatus and communication method
JP5348138B2 (en) Packet loss frequency measurement system, packet loss frequency measurement method and program
US10805206B1 (en) Method for rerouting traffic in software defined networking network and switch thereof
CN111835641A (en) Fault detection method, server and acquisition equipment
CA3221912A1 (en) Method for distributing multipath flows in a direct interconnect network
CN107086965B (en) ARP (Address resolution protocol) table entry generation method and device and switch
CN113965492A (en) Data flow statistical method and device
JP2009296158A (en) Communication data statistical apparatus and communication data statistical method
JP4871330B2 (en) Flow determination method, communication apparatus, and program

Legal Events

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

Ref document number: 11860458

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: 11860458

Country of ref document: EP

Kind code of ref document: A1