CN109905283A - A traffic statistics method, device and computer-readable storage medium - Google Patents
A traffic statistics method, device and computer-readable storage medium Download PDFInfo
- Publication number
- CN109905283A CN109905283A CN201711285748.0A CN201711285748A CN109905283A CN 109905283 A CN109905283 A CN 109905283A CN 201711285748 A CN201711285748 A CN 201711285748A CN 109905283 A CN109905283 A CN 109905283A
- Authority
- CN
- China
- Prior art keywords
- evb
- traffic
- server
- switch
- flow
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 67
- 230000005540 biological transmission Effects 0.000 claims abstract description 105
- 238000004891 communication Methods 0.000 claims abstract description 52
- 238000004590 computer program Methods 0.000 claims description 33
- 238000010586 diagram Methods 0.000 description 11
- 230000005291 magnetic effect Effects 0.000 description 7
- 230000001360 synchronised effect Effects 0.000 description 7
- 238000001514 detection method Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 6
- WYTGDNHDOZPMIW-RCBQFDQVSA-N alstonine Natural products C1=CC2=C3C=CC=CC3=NC2=C2N1C[C@H]1[C@H](C)OC=C(C(=O)OC)[C@H]1C2 WYTGDNHDOZPMIW-RCBQFDQVSA-N 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 239000002699 waste material Substances 0.000 description 3
- 241000270295 Serpentes Species 0.000 description 2
- 235000019800 disodium phosphate Nutrition 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 239000004606 Fillers/Extenders Substances 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000005294 ferromagnetic effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000004549 pulsed laser deposition Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明公开了一种流量统计方法、装置及存储介质,包括:EVB服务器通过虚拟交换机对VM的传输数据进行统计得到所述VM的流量参数,根据所述流量参数和所述VM的通讯标识生成流量状态通知,并发送所述流量状态通知至边缘虚拟桥EVB交换机;所述EVB交换机接收所述EVB服务器发送的所述流量状态通知,对所述流量状态通知进行解析得到所述流量参数和所述VM的通讯标识,利用所述流量参数对所述VM进行流量统计。
The invention discloses a traffic statistics method, device and storage medium, comprising: an EVB server collects statistics on the transmission data of a VM through a virtual switch to obtain traffic parameters of the VM, and generates traffic parameters according to the traffic parameters and the communication identifier of the VM traffic status notification, and send the traffic status notification to the edge virtual bridge EVB switch; the EVB switch receives the traffic status notification sent by the EVB server, and parses the traffic status notification to obtain the traffic parameters and all The communication identifier of the VM is used to perform traffic statistics on the VM by using the traffic parameter.
Description
技术领域technical field
本发明涉及无线通信技术领域,尤其涉及一种流量统计方法、装置及计算机可读存储介质。The present invention relates to the field of wireless communication technologies, and in particular, to a traffic statistics method, an apparatus and a computer-readable storage medium.
背景技术Background technique
云计算已经成为当前IT巨头建设的重点,虚拟化数据中心作为云计算的重要组成部分其重要性可见一斑.从主机等计算资源的角度看,数据中心虚拟化,包含多虚一与一虚多两个方向,都提供了计算资源被按需调配的手段。系统虚拟化以缩短业务部署时间,提高资源使用效率为主要目的,通过某种方式隐藏底层物理硬件的过程,从而让多个操作系统可以透明地使用和共享它,主要是在一个物理系统上的多操作系统同时并存的技术。Cloud computing has become the focus of the construction of current IT giants. The importance of virtualized data centers as an important part of cloud computing is evident. From the perspective of computing resources such as hosts, data center virtualization includes multiple virtual ones and one virtual multiples Both directions provide a means for computing resources to be allocated on demand. The main purpose of system virtualization is to shorten the time of business deployment and improve the efficiency of resource use. It hides the process of the underlying physical hardware in some way, so that multiple operating systems can transparently use and share it, mainly on one physical system. The technology that multiple operating systems coexist at the same time.
边缘虚拟桥(Edge Virtual Bridging,EVB)技术是当前用于解决虚拟化环境的虚拟机(Virtual Machine,VM)与网络之间的连接与管理边界问题而产生。并在此标准802.1Qbg定义的框架基础上可以实现VM生命周期与网络的自动化关联、网络属性的灵活变更。Edge virtual bridge (Edge Virtual Bridging, EVB) technology is currently used to solve the problem of connection and management boundary between a virtual machine (Virtual Machine, VM) and a network in a virtualized environment. And on the basis of the framework defined by this standard 802.1Qbg, the automatic association between the VM life cycle and the network, and the flexible change of network attributes can be realized.
EVB原来由802.1Qbg和802.1Qbh组成,数据层面的实现一共有四种:其中802.1Qbg包含了三种,即虚拟网络桥(Virtual Ethernet Bridging,VEB)模式、虚拟网络端口聚合(Virtual Ethernet Port Aggregator,VEPA)模式和多通道Multi Channel模式;802.1Qbh为端口扩展(Port Extender,PE)模式。当前802.1Qbh已经在EVB内取消,因此EVB目前也就是802.1Qbg。从技术实现的角度,以及某些特殊应用场景下,802.1Qbg的不同模式是可以同时存在的,并且技术上要求能够多层级联,这在标准预备文档中也进行了描述。但在更多的场景下,并不需要复杂的级联拓扑和层次,标准在使用上建议了一个基本的EVB架构。EVB was originally composed of 802.1Qbg and 802.1Qbh. There are four implementations of the data plane: 802.1Qbg includes three, namely Virtual Ethernet Bridging (VEB) mode, Virtual Ethernet Port Aggregator (Virtual Ethernet Port Aggregator, VEPA) mode and multi-channel Multi Channel mode; 802.1Qbh is a port extension (Port Extender, PE) mode. Currently, 802.1Qbh has been cancelled in EVB, so EVB is currently 802.1Qbg. From the perspective of technical implementation and in some special application scenarios, different modes of 802.1Qbg can exist at the same time, and it is technically required to be able to be cascaded in multiple layers, which is also described in the standard preparatory document. But in more scenarios, complex cascade topologies and layers are not required, and the standard recommends a basic EVB architecture for use.
虚拟化数据中心给网络侧带来了一些挑战,如图1所述,VM跟普通EVB服务器设备一样,每个VM有着自己的虚拟网卡(virtual NIC),每个virtual NIC有着自己的媒体访问控制(medium access control,MAC)地址和IP地址。虚拟交换机(Virtual Switch)即vSwitch相当于一个虚拟的二层交换机,ABCDE分别是vSwitch上的虚拟端口,该vSwitch连接虚拟网卡和物理网卡,将VM上的数据报文从物理网口转发出去。根据需要,vSwitch还可以支持二层转发、安全控制、端口镜像等功能。这种方案对于网络管理员而言,无法看到vSwitch,这样导致vSwitch游离于网络整体管理之外,不利于整体网络安全监控的实现。Virtualized data centers bring some challenges to the network side. As shown in Figure 1, VMs are the same as ordinary EVB server devices. Each VM has its own virtual NIC (virtual NIC), and each virtual NIC has its own media access control. (medium access control, MAC) address and IP address. A virtual switch (Virtual Switch), that is, a vSwitch is equivalent to a virtual Layer 2 switch. ABCDE are virtual ports on the vSwitch. The vSwitch connects the virtual NIC and the physical NIC, and forwards data packets on the VM from the physical network port. As required, vSwitch can also support Layer 2 forwarding, security control, port mirroring and other functions. In this solution, the network administrator cannot see the vSwitch, which causes the vSwitch to be separated from the overall network management, which is not conducive to the realization of overall network security monitoring.
为了将EVB服务器从复杂的网络交换工作中脱离出来,回归到原先的服务应用功能上,而将报文转发及网络策略控制交还给网络设备来完成,考虑另外一种实现VM网络通讯的方法,这就是IEEE 802.1Qbg标准所要说明的内容,它指定了一种EVB标准,该标准基于VEPA技术。通过VEPA技术,来自于VM的所有流量都会被转发到邻近的物理接入交换机,使得网络接入交换机能够看到VM的报文流。这种情况下,当目标VM也位于同一个EVB服务器时被转回到相同的物理EVB服务器,流量作了一个180度的转向,如图2所示,同一宿主EVB服务器Station内部的VM之间的流量都需要经过网络设备来进行蛇形转发。这样网络设备就可以知道Station内部的VM之间的流量信息。In order to separate the EVB server from the complex network switching work, return to the original service application function, and return the message forwarding and network policy control to the network device to complete, consider another method to realize the VM network communication, That's what the IEEE 802.1Qbg standard is about, specifying an EVB standard based on VEPA technology. Through the VEPA technology, all traffic from the VM is forwarded to the adjacent physical access switch, so that the network access switch can see the VM's packet flow. In this case, when the target VM is also located on the same EVB server, it is transferred back to the same physical EVB server, and the traffic is turned 180 degrees. As shown in Figure 2, between VMs within the same host EVB server Station All traffic needs to go through network devices for snake forwarding. In this way, the network device can know the traffic information between the VMs inside the Station.
现有的VEPA技术可以使网络管理员监控同一个Station内部VM之间的网络流量,把控整个数据中心网络的流量信息,但是带来的后果是把本来可以在VM内部直接转发的报文,需要绕一圈到网络设备的同一个端口进行180度的蛇形转发,对网络设备的带宽资源是很大的浪费,也带来了不必要的带宽延时。The existing VEPA technology enables network administrators to monitor the network traffic between VMs in the same Station and control the traffic information of the entire data center network, but the consequence is that the packets that could have been directly forwarded inside the VM are transferred. It is necessary to make a 180-degree serpentine forwarding to the same port of the network device, which is a great waste of the bandwidth resources of the network device, and also brings unnecessary bandwidth delay.
发明内容SUMMARY OF THE INVENTION
为解决现有存在的技术问题,本发明实施例提供一种流量统计方法、装置及计算机可读存储介质,能够监控EVB服务器的网络流量的同时,还避免蛇形转发。In order to solve the existing technical problems, the embodiments of the present invention provide a traffic statistics method, an apparatus and a computer-readable storage medium, which can monitor the network traffic of the EVB server and avoid serpentine forwarding.
本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is realized as follows:
本发明实施例提供一种流量统计方法,所述方法包括:An embodiment of the present invention provides a traffic statistics method, the method includes:
通过虚拟交换机对虚拟机VM的传输数据进行统计得到所述VM的流量参数;Statistics are performed on the transmission data of the virtual machine VM through the virtual switch to obtain the traffic parameters of the VM;
根据所述流量参数和所述VM的通讯标识生成流量状态通知,并发送所述流量状态通知至边缘虚拟桥EVB交换机。A traffic status notification is generated according to the traffic parameters and the communication identifier of the VM, and the traffic status notification is sent to the edge virtual bridge EVB switch.
上述方案中,所述方法还包括:In the above scheme, the method also includes:
判断所述传输数据的源地址和目的地址是否属于同一边缘虚拟桥EVB服务器;Determine whether the source address and destination address of the transmission data belong to the same edge virtual bridge EVB server;
确定所述传输数据的源地址和目的地址属于同一EVB服务器时,通过第一路径传输所述传输数据,所述第一路径为所述EVB服务器的内部路径;When it is determined that the source address and the destination address of the transmission data belong to the same EVB server, the transmission data is transmitted through a first path, and the first path is an internal path of the EVB server;
确定所述传输数据的源地址和目的地址不属于同一EVB服务器时,通过第二路径传输所述传输数据,所述第二路径为所述EVB服务器和所述EVB交换机之间的路径。When it is determined that the source address and the destination address of the transmission data do not belong to the same EVB server, the transmission data is transmitted through a second path, where the second path is a path between the EVB server and the EVB switch.
上述方案中,在发送所述流量状态通知至EVB交换机之前,所述方法还包括:In the above solution, before sending the traffic status notification to the EVB switch, the method further includes:
确定所述虚拟交换机对应的虚拟服务商通道;determining the virtual service provider channel corresponding to the virtual switch;
为所述流量状态通知添加所述虚拟服务商通道的通道标识。A channel identifier of the virtual service provider channel is added to the traffic status notification.
上述方案中,所述方法还包括:In the above scheme, the method also includes:
基于隧道发现配置协议CDCP在状态通知中设置流量统计标识生成所述流量状态通知。The traffic status notification is generated by setting the traffic statistics identifier in the status notification based on the tunnel discovery configuration protocol CDCP.
本发明实施例还提供一种流量统计方法,所述方法包括:The embodiment of the present invention also provides a traffic statistics method, the method includes:
接收边缘虚拟桥EVB服务器发送的流量状态通知,对所述流量状态通知进行解析得到流量参数和虚拟机VM的通讯标识,所述流量参数通过所述EVB服务器的虚拟交换机对所述VM的传输数据进行统计得到;Receive the traffic status notification sent by the edge virtual bridge EVB server, parse the traffic status notification to obtain traffic parameters and the communication identifier of the virtual machine VM, and the traffic parameters transmit data to the VM through the virtual switch of the EVB server. get statistics;
利用所述流量参数对所述VM进行流量统计。Perform traffic statistics on the VM by using the traffic parameters.
上述方案中,在对所述流量状态通知进行解析得到流量参数和VM的通讯标识之前,所述方法还包括:In the above scheme, before the traffic state notification is parsed to obtain the traffic parameter and the communication identifier of the VM, the method further includes:
对所述流量状态通知进行解析得到虚拟服务商通道的通道标识;Analyzing the traffic status notification to obtain the channel identifier of the virtual service provider channel;
根据所述虚拟服务商通道的通道标识确定所述流量参数所属的虚拟交换机。The virtual switch to which the traffic parameter belongs is determined according to the channel identifier of the virtual service provider channel.
上述方案中,所述方法还包括:In the above scheme, the method also includes:
基于隧道发现配置协议CDCP对接收的状态通知进行解析,检测到解析结果中包括流量统计标识,确定所述状态通知为流量状态通知。The received status notification is parsed based on the tunnel discovery configuration protocol CDCP, and it is detected that the analysis result includes a traffic statistics identifier, and it is determined that the status notification is a traffic status notification.
本发明实施例还一种流量统计方法,所述方法包括:边缘虚拟桥EVB服务器通过虚拟交换机对虚拟机VM的传输数据进行统计得到所述VM的流量参数,根据所述流量参数和所述VM的通讯标识生成流量状态通知,并发送所述流量状态通知至边缘虚拟桥EVB交换机;所述EVB交换机接收所述EVB服务器发送的所述流量状态通知,对所述流量状态通知进行解析得到所述流量参数和所述VM的通讯标识,利用所述流量参数对所述VM进行流量统计。An embodiment of the present invention also provides a traffic statistics method, the method includes: an edge virtual bridge EVB server collects statistics on the transmission data of a virtual machine VM through a virtual switch to obtain traffic parameters of the VM, and according to the traffic parameters and the VM The communication identifier generates a traffic status notification, and sends the traffic status notification to the edge virtual bridge EVB switch; the EVB switch receives the traffic status notification sent by the EVB server, and parses the traffic status notification to obtain the Traffic parameters and the communication identifier of the VM, and use the traffic parameters to perform traffic statistics on the VM.
为实现上述流量统计方法,本发明实施例还提供一种流量统计装置,所述装置包括:第一处理器和第一收发器;其中,To implement the above traffic statistics method, an embodiment of the present invention further provides a traffic statistics device, the device includes: a first processor and a first transceiver; wherein,
所述第一处理器,用于通过虚拟交换机对虚拟机VM的传输数据进行统计得到所述VM的流量参数;根据所述流量参数和所述VM的通讯标识生成流量状态通知;The first processor is configured to perform statistics on the transmission data of the virtual machine VM through the virtual switch to obtain the traffic parameter of the VM; generate a traffic status notification according to the traffic parameter and the communication identifier of the VM;
所述第一收发器,用于发送所述流量状态通知至边缘虚拟桥EVB交换机。The first transceiver is configured to send the traffic state notification to the edge virtual bridge EVB switch.
上述方案中,所述第一处理器还用于:判断所述传输数据的源地址和目的地址是否属于同一边缘虚拟桥EVB服务器;In the above solution, the first processor is further configured to: determine whether the source address and the destination address of the transmission data belong to the same edge virtual bridge EVB server;
确定所述传输数据的源地址和目的地址属于同一EVB服务器时,控制所述第一收发器通过第一路径传输所述传输数据,所述第一路径为所述EVB服务器的内部路径;When it is determined that the source address and the destination address of the transmission data belong to the same EVB server, control the first transceiver to transmit the transmission data through a first path, and the first path is an internal path of the EVB server;
确定所述传输数据的源地址和目的地址不属于同一EVB服务器时,控制所述第一收发器通过第二路径传输所述传输数据,所述第二路径为所述EVB服务器和所述EVB交换机之间的路径。When it is determined that the source address and the destination address of the transmission data do not belong to the same EVB server, control the first transceiver to transmit the transmission data through a second path, where the second path is the EVB server and the EVB switch path between.
上述方案中,所述第一处理器还用于:In the above solution, the first processor is also used for:
基于隧道发现配置协议CDCP在状态通知中设置流量统计标识生成所述流量状态通知。The traffic status notification is generated by setting the traffic statistics identifier in the status notification based on the tunnel discovery configuration protocol CDCP.
为实现上述流量统计方法,本发明实施例还提供一种流量统计装置,所述装置包括:第二处理器、第二收发器;其中,To implement the above traffic statistics method, an embodiment of the present invention further provides a traffic statistics device, the device includes: a second processor and a second transceiver; wherein,
所述第二收发器,用于接收边缘虚拟桥EVB服务器发送的流量状态通知;The second transceiver is configured to receive the traffic status notification sent by the edge virtual bridge EVB server;
所述第二处理器,用于对所述流量状态通知进行解析得到流量参数和虚拟机VM的通讯标识,利用所述流量参数对所述VM进行流量统计;所述流量参数通过所述EVB服务器的虚拟交换机对所述VM的传输数据进行统计得到。The second processor is configured to parse the traffic state notification to obtain traffic parameters and the communication identifier of the virtual machine VM, and use the traffic parameters to perform traffic statistics on the VM; the traffic parameters pass the EVB server The virtual switch obtains statistics on the transmission data of the VM.
上述方案中,所述第二处理器还用于:In the above solution, the second processor is also used for:
基于隧道发现配置协议CDCP对接收的状态通知进行解析,检测到解析结果中包括流量统计标识,确定所述状态通知为流量状态通知。The received status notification is parsed based on the tunnel discovery configuration protocol CDCP, and it is detected that the analysis result includes a traffic statistics identifier, and it is determined that the status notification is a traffic status notification.
为实现上述流量统计方法,本发明实施例还提供一种流量统计系统,所述系统包括边缘虚拟桥EVB服务器和边缘虚拟桥EVB交换机;其中,To implement the above traffic statistics method, an embodiment of the present invention further provides a traffic statistics system, the system includes an edge virtual bridge EVB server and an edge virtual bridge EVB switch; wherein,
所述EVB服务器通过虚拟交换机对虚拟机VM的传输数据进行统计得到所述VM的流量参数,根据所述流量参数和所述VM的通讯标识生成流量状态通知,并发送所述流量状态通知至所述EVB交换机;The EVB server collects statistics on the transmission data of the virtual machine VM through the virtual switch to obtain the traffic parameters of the VM, generates a traffic status notification according to the traffic parameters and the communication identifier of the VM, and sends the traffic status notification to the VM. The EVB switch described above;
所述EVB交换机接收所述EVB服务器发送的所述流量状态通知,对所述流量状态通知进行解析得到所述流量参数和所述VM的通讯标识,利用所述流量参数对所述VM进行流量统计。The EVB switch receives the traffic status notification sent by the EVB server, parses the traffic status notification to obtain the traffic parameter and the communication identifier of the VM, and uses the traffic parameter to perform traffic statistics on the VM .
本发明实施例还提供一种流量统计装置,所述装置包括:处理器、存储器;所述存储器上存储有能够在所述处理器上运行的计算机程序;其中,所述处理器用于运行所述计算机程序时,执行上述EVB服务器侧任一方法的步骤;或执行上述EVB交换机侧任一方法的步骤。An embodiment of the present invention further provides a traffic statistics device, the device includes: a processor and a memory; the memory stores a computer program that can run on the processor; wherein the processor is configured to run the When a computer program is used, the steps of any method on the EVB server side are executed; or the steps of any method on the EVB switch side are executed.
本发明实施例还提供一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时,实现上述EVB服务器侧任一方法的步骤,或实现上述EVB交换机侧任一方法的步骤。An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, it implements the steps of any method on the EVB server side, or implements the above EVB Steps for either method on the switch side.
本发明实施例提供的流量统计方法、装置及计算机可读存储介质,将EVB服务器的VM的传输数据的流量参数通过流量状态通知发送给EVB交换机,EVB交换机通过接收到的流量状态通知对EVB服务器的VM的流量进行流量统计;如此,在EVB服务器内部可实现传输数据的流量的统计,避免蛇形转发,同时,能够通过流量参数的发送实现EVB交换机对EVB服务器内部VM的网络流量的统计和监控。The traffic statistics method, device, and computer-readable storage medium provided by the embodiments of the present invention send the traffic parameters of the data transmitted by the VM of the EVB server to the EVB switch through the traffic status notification, and the EVB switch sends the EVB server to the EVB server through the received traffic status notification. In this way, the traffic statistics of the transmitted data can be realized in the EVB server to avoid serpentine forwarding. At the same time, the EVB switch can realize the statistics and analysis of the network traffic of the VMs in the EVB server by sending the traffic parameters. monitor.
附图说明Description of drawings
在附图(其不一定是按比例绘制的)中,相似的附图标记可在不同的视图中描述相似的部件。附图以示例而非限制的方式大体示出了本文中所讨论的各个实施例。In the drawings, which are not necessarily to scale, like reference numerals may describe like parts in the different views. The accompanying drawings generally illustrate, by way of example and not limitation, the various embodiments discussed herein.
图1为虚拟数据中心网络结构示意图;1 is a schematic diagram of a virtual data center network structure;
图2为蛇形转发的路径示意图;Fig. 2 is the schematic diagram of the path of serpentine forwarding;
图3为本发明实施例一提供的流量统计方法的流程示意图;3 is a schematic flowchart of a traffic statistics method according to Embodiment 1 of the present invention;
图4为本发明实施例二提供的流量统计方法的流程示意图;4 is a schematic flowchart of a traffic statistics method according to Embodiment 2 of the present invention;
图5为本发明实施例三提供的流量统计方法的流程示意图;5 is a schematic flowchart of a traffic statistics method according to Embodiment 3 of the present invention;
图6为本发明实施例四提供的网络结构示意图;6 is a schematic diagram of a network structure according to Embodiment 4 of the present invention;
图7为本发明实施例四提供的EVB服务器与EVB交换机传输的消息交互示意图;7 is a schematic diagram of message interaction between an EVB server and an EVB switch according to Embodiment 4 of the present invention;
图8为CDCP消息结构示意图;8 is a schematic diagram of a CDCP message structure;
图9为本发明实施例四提供的基于CDCP的流量状态通知的消息结构示意图;9 is a schematic diagram of a message structure of a CDCP-based traffic status notification provided by Embodiment 4 of the present invention;
图10为本发明实施例五或六提供的流量统计装置硬件结构示意图;FIG. 10 is a schematic diagram of a hardware structure of a traffic statistics device according to Embodiment 5 or 6 of the present invention;
图11为本发明实施例七提供的流量统计装置结构示意图;FIG. 11 is a schematic structural diagram of a traffic statistics device according to Embodiment 7 of the present invention;
图12为本发明实施例八或九提供的流量统计装置硬件结构示意图;FIG. 12 is a schematic diagram of a hardware structure of a traffic statistics device according to Embodiment 8 or 9 of the present invention;
具体实施方式Detailed ways
下面结合附图及实施例对本发明再作进一步详细的描述。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments.
在本发明实施例中,EVB服务器通过虚拟交换机对VM的传输数据进行统计得到所述VM的流量参数,根据所述流量参数和所述VM的通讯标识生成流量状态通知,并发送所述流量状态通知至EVB交换机;所述EVB交换机接收所述EVB服务器发送的所述流量状态通知,对所述流量状态通知进行解析得到所述流量参数和所述VM的通讯标识,利用所述流量参数对所述VM进行流量统计。In the embodiment of the present invention, the EVB server collects statistics on the transmission data of the VM through the virtual switch to obtain the traffic parameters of the VM, generates a traffic status notification according to the traffic parameters and the communication identifier of the VM, and sends the traffic status Notify the EVB switch; the EVB switch receives the traffic status notification sent by the EVB server, parses the traffic status notification to obtain the traffic parameter and the communication identifier of the VM, and uses the traffic parameter to The VM performs traffic statistics.
进一步地,在进行传输数据的传输时,将源地址和目标地址属于同一EVB服务器的传输数据在EVB服务器内进行传输,将源地址和目标地址不属于同一EVB服务器的传输数据通过EVB交换机进行传输。Further, when transmitting the transmission data, the transmission data whose source address and destination address belong to the same EVB server are transmitted in the EVB server, and the transmission data whose source address and destination address do not belong to the same EVB server are transmitted through the EVB switch. .
实施例一Example 1
本发明实施例提供一种流量统计方法,应用于EVB服务器,如图3所示,该方法包括:An embodiment of the present invention provides a traffic statistics method, which is applied to an EVB server. As shown in FIG. 3 , the method includes:
S301、通过虚拟交换机对VM的传输数据进行统计得到所述VM的流量参数;S301, by performing statistics on the transmission data of the VM through a virtual switch to obtain the traffic parameters of the VM;
在进行传输数据的转发时,判断所述传输数据的源地址和目的地址是否属于同一EVB服务器;确定所述传输数据的源地址和目的地址属于同一EVB服务器时,通过第一路径传输所述传输数据,所述第一路径为所述EVB服务器的内部路径;确定所述传输数据的源地址和目的地址不属于同一EVB服务器时,通过第二路径传输所述传输数据,所述第二路径为所述EVB服务器和所述EVB交换机之间的路径。其中,可将发出数据的源VM作为源地址,将接收数据的目标VM作为目标地址。When forwarding the transmission data, determine whether the source address and destination address of the transmission data belong to the same EVB server; when it is determined that the source address and destination address of the transmission data belong to the same EVB server, transmit the transmission through the first path data, the first path is the internal path of the EVB server; when it is determined that the source address and destination address of the transmission data do not belong to the same EVB server, the transmission data is transmitted through the second path, and the second path is The path between the EVB server and the EVB switch. Wherein, the source VM that sends out data can be used as the source address, and the target VM that receives the data can be used as the target address.
EVB服务器中包括VM和虚拟交换机,VM的传输数据通过虚拟交换机进行交换控制实现VM的传输数据的转发。其中,一个EVB服务器中可包括一个或多个VM。根据发送数据的源VM和接收数据的目标VM所属的EVB服务器是否为同一个EVB服务器,将传输数据区分为两类数据:内部传输数据和外部传输数据,内部传输数据的传输路径为第一路径,外部传输数据的传输路径为第二路径。The EVB server includes a VM and a virtual switch, and the transmission data of the VM is exchanged and controlled through the virtual switch to realize the forwarding of the transmission data of the VM. Wherein, one EVB server may include one or more VMs. According to whether the EVB server to which the source VM that sends the data and the target VM that receives the data belong are the same EVB server, the transmission data is divided into two types of data: internal transmission data and external transmission data, and the transmission path of the internal transmission data is the first path , the transmission path of the external transmission data is the second path.
内部传输数据的源VM和目标VM属于同一EVB服务器。当数据为内部传输数据时,源VM发出的传输数据发送至源VM对应的源虚拟交换机,源虚拟交换机经过对目标地址的识别,将数据转发至目标虚拟交换机,目标虚拟交换机则将传输数据转发至目标VM,实现EVB服务器内部转发。这里,源虚拟交换机和目标虚拟交换机可为同一个虚拟交换机,也可为同一EVB服务器内不同的虚拟交换机。这里,传输数据的第一路径为EVB服务器的内部路径。The source and destination VMs that transfer data internally belong to the same EVB server. When the data is internal transmission data, the transmission data sent by the source VM is sent to the source virtual switch corresponding to the source VM. After identifying the target address, the source virtual switch forwards the data to the target virtual switch, and the target virtual switch forwards the transmission data. To the target VM, the internal forwarding of the EVB server is realized. Here, the source virtual switch and the target virtual switch may be the same virtual switch, or may be different virtual switches in the same EVB server. Here, the first path for transmitting data is the internal path of the EVB server.
外部传输数据的源VM和目标VM属于不同的EVB服务器。当数据为外部传输数据时,对于不同的传输数据,EVB服务器既可作为发出数据的源EVB服务器,也可作为接收数据的目标EVB服务器。The source VM and the target VM for externally transferring data belong to different EVB servers. When the data is external transmission data, for different transmission data, the EVB server can be used as both the source EVB server that sends the data and the target EVB server that receives the data.
在进行传输数据的转发时,源EVB服务器中的源VM的传输数据发送至源VM对应的源虚拟交换机,源虚拟交换机经过对目标地址的识别,将传输数据转发至与源EVB服务器对应的源EVB交换机,源EVB交换机将传输数据转发至目标EVB服务器对应的目标EVB交换机,目标EVB交换机将传输数据转发目标EVB服务器内的目标VM。这里,源EVB交换机和目标EVB交换机可为同一个EVB交换机,也可为不同的EVB交换机。这里,传输数据的第二路径为EVB服务器与EVB交换机之间的路径。When forwarding the transmission data, the transmission data of the source VM in the source EVB server is sent to the source virtual switch corresponding to the source VM. After identifying the target address, the source virtual switch forwards the transmission data to the source corresponding to the source EVB server. The EVB switch, the source EVB switch forwards the transmission data to the target EVB switch corresponding to the target EVB server, and the target EVB switch forwards the transmission data to the target VM in the target EVB server. Here, the source EVB switch and the target EVB switch may be the same EVB switch, or may be different EVB switches. Here, the second path for data transmission is the path between the EVB server and the EVB switch.
这里,当通过传输数据时,可通过VM对应的虚拟交换机对传输数据进行统计,得到的传输数据的流量参数,其中,流量参数可包括:入接口报文的最大速率、出接口报文的最大速率、接收报文总数量、发送报文总数量、接口接收的单播报文的数目、接口发送的单播报文的数目、接口接收的组播报文的数目、接口发送的组播报文的数目、接口接收的广播报文的数目、接口发送的广播报文的数目、接口接收的超大帧长报文数目、接口发送的超大帧长报文数目、接口在物理层检测时发现的丢弃报文数目、接口在物理层检测时发现的错误报文总数目、接口接收的CRC错误报文数目等与流量统计有关的参数。Here, when transmitting data, the virtual switch corresponding to the VM can collect statistics on the transmitted data to obtain the traffic parameters of the transmitted data, where the traffic parameters can include: the maximum rate of incoming interface packets, and the maximum rate of outgoing interface packets. rate, the total number of received packets, the total number of sent packets, the number of unicast packets received by the interface, the number of unicast packets sent by the interface, the number of multicast packets received by the interface, and the number of multicast packets sent by the interface. number, the number of broadcast packets received by the interface, the number of broadcast packets sent by the interface, the number of jumbo frame length packets received by the interface, the number of jumbo frame length packets sent by the interface, and the discarded packets detected by the interface during physical layer detection. Parameters related to traffic statistics, such as the number of packets, the total number of error packets detected by the interface during physical layer detection, and the number of CRC error packets received by the interface.
在实际应用中,流量统计参数可为上述参数中的一个或多个的组合,也可根据实际需求对流量统计参数进行设置。In practical applications, the traffic statistics parameters may be a combination of one or more of the above parameters, and the traffic statistics parameters may also be set according to actual requirements.
S302、根据所述流量参数和所述VM的通讯标识生成流量状态通知,并发送所述流量状态通知至EVB交换机。S302. Generate a traffic state notification according to the traffic parameter and the communication identifier of the VM, and send the traffic state notification to the EVB switch.
在统计得到VM的流量参数后,通过流量状态通知将流量参数发送至EVB交换机。在生成流量状态通知时,将VM的流量参数和VM的通讯标识同时封装在流量状态通知中,VM的通讯标识可为VM的MAC地址。After statistics on the traffic parameters of the VM are obtained, the traffic parameters are sent to the EVB switch through the traffic status notification. When generating the traffic status notification, the traffic parameters of the VM and the communication identifier of the VM are encapsulated in the traffic status notification at the same time, and the communication identifier of the VM may be the MAC address of the VM.
在一些实施例中,基于隧道发现配置协议(channel discovery andconfiguration protocol,CDCP)在状态通知中设置流量统计标识生成所述流量状态通知。具体的,可将状态通知的保留字段设置为自定义的流量统计标识,从而生成流量状态通知,以表征该状态通知携带流量参数,以和未携带流量参数的状态通知进行区分,流量统计标识可根据用户需求进行设置,比如:保留字段为0x1。In some embodiments, the traffic status notification is generated by setting a traffic statistics flag in the status notification based on a channel discovery and configuration protocol (CDCP). Specifically, the reserved field of the status notification can be set as a custom traffic statistic identifier, so as to generate a traffic status notification to indicate that the status notification carries the traffic parameters to distinguish it from the status notification that does not carry the traffic parameters. The traffic statistic identifier can be Set according to user needs, for example: the reserved field is 0x1.
在生成流量状态通知时,可在具有流量统计标识的状态通知的基础上新增一个流量统计信息字段,将流量参数和VM的通讯标识封装在该流量统计信息字段。比如:在状态通知的服务信道标识(S-channel ID,SCID)/服务VLAN标识(S-VLAN ID,SVID)对中增加流量统计字段。When generating the traffic status notification, a traffic statistics information field may be added on the basis of the status notification with the traffic statistics identifier, and the traffic parameters and the communication identifier of the VM are encapsulated in the traffic statistics information field. For example, a traffic statistics field is added to the service channel identifier (S-channel ID, SCID)/service VLAN identifier (S-VLAN ID, SVID) pair of the status notification.
在一些实施例中,在发送所述流量状态通知至EVB交换机之前,确定所述虚拟交换机对应的虚拟服务商通道;为所述流量状态通知添加所述虚拟服务商通道的通道标识,以通过虚拟交换机对应的服务商通道来发送所述流量状态通知。In some embodiments, before sending the traffic status notification to the EVB switch, a virtual service provider channel corresponding to the virtual switch is determined; and a channel identifier of the virtual service provider channel is added to the traffic status notification to pass the virtual The service provider channel corresponding to the switch sends the traffic status notification.
当EVB服务器中包括多个虚拟交换机时,多个虚拟交换机和EVB交换机之间存在多个虚拟服务商通道,且多个虚拟服务商通道通过EVB服务器和EVB交换机一个物理通道来实现。此时,发送流量状态通知的虚拟交换机向EVB交换机发送请求消息以请求创建虚拟服务商通道;EVB交换机根据请求消息对应的虚拟交换机分配虚拟服务商通道并创建虚拟服务商通道,创建后,向EVB服务器返回虚拟服务商通道创建通知。当EVB服务器接收到EVB交换机返回的虚拟服务商通道创建通知时,通过创建的服务商通道向EVB交换机发送流量状态通知。EVB服务器在发送流量状态通知之前,为流量状态通知添加该虚拟服务商通道的通道标识,以标识该流量状态通知所属的虚拟服务商通道。这里,通道标识的形式可根据实际需求进行设置。When the EVB server includes multiple virtual switches, multiple virtual service provider channels exist between the multiple virtual switches and the EVB switch, and the multiple virtual service provider channels are implemented through one physical channel between the EVB server and the EVB switch. At this time, the virtual switch that sends the traffic status notification sends a request message to the EVB switch to request the creation of a virtual service provider channel; the EVB switch allocates a virtual service provider channel and creates a virtual service provider channel according to the virtual switch corresponding to the request message. The server returns a virtual service provider channel creation notification. When the EVB server receives the virtual service provider channel creation notification returned by the EVB switch, it sends a traffic status notification to the EVB switch through the created service provider channel. Before sending the traffic state notification, the EVB server adds the channel identifier of the virtual service provider channel to the traffic state notification, so as to identify the virtual service provider channel to which the traffic state notification belongs. Here, the form of the channel identification can be set according to actual needs.
EVB服务器在该虚拟交换机开始传输数据时,为该虚拟交换机创建虚拟服务商通道。在传输数据的传输的过程中,可周期性向EVB交换机发送流量状态通知,发出的流量状态通知中携带的流量参数为发出时刻所统计的流量参数,在传输数据传输完成后,向EVB交换机发送请求消息以删除该虚拟交换机对应的虚拟服务商通道。When the virtual switch starts to transmit data, the EVB server creates a virtual service provider channel for the virtual switch. In the process of data transmission, it can periodically send traffic status notifications to the EVB switch. The traffic parameters carried in the issued traffic status notifications are the traffic parameters counted at the time of sending. After the data transmission is completed, a request is sent to the EVB switch. message to delete the virtual service provider channel corresponding to the virtual switch.
需要说明的是,EVB服务器可同时通过不同的虚拟服务商通道向EVB交换机发送多个虚拟交换机的流量状态通知。It should be noted that the EVB server can simultaneously send traffic status notifications of multiple virtual switches to the EVB switch through different virtual service provider channels.
当EVB交换机接收到流量状态通知时,对流量状态通知进行解析,得到EVB服务器发送的流量参数和流量参数所属的VM。When the EVB switch receives the traffic status notification, it parses the traffic status notification to obtain the traffic parameters sent by the EVB server and the VM to which the traffic parameters belong.
在本发明实施例中,EVB服务器通过虚拟交换机对VM的传输数据进行统计得到VM的流量参数,根据所述流量参数和所述VM的通讯标识生成流量状态通知,并发送所述流量状态通知至EVB交换机;能够通过流量参数的发送实现EVB交换机对EVB服务器内部VM的网络流量的统计和监控,并且由EVB服务器进行流量统计,避免了蛇形转发。In the embodiment of the present invention, the EVB server collects statistics on the transmission data of the VM through the virtual switch to obtain the traffic parameters of the VM, generates a traffic status notification according to the traffic parameters and the communication identifier of the VM, and sends the traffic status notification to EVB switch: It can realize the statistics and monitoring of the network traffic of the internal VM of the EVB server by the EVB switch through the sending of traffic parameters, and the EVB server conducts traffic statistics to avoid snake-like forwarding.
进一步地,在进行传输数据的传输时,将源地址和目标地址属于同一EVB服务器的传输数据在EVB服务器内进行传输,将源地址和目标地址不属于同一EVB服务器的传输数据通过EVB交换机进行传输,从而降低了宽带资源的浪费,减少了传输时延。Further, when transmitting the transmission data, the transmission data whose source address and destination address belong to the same EVB server are transmitted in the EVB server, and the transmission data whose source address and destination address do not belong to the same EVB server are transmitted through the EVB switch. , thereby reducing the waste of broadband resources and reducing the transmission delay.
实施例二Embodiment 2
本发明实施例提供一种流量统计方法,应用于EVB交换机,如图4所示,包括:An embodiment of the present invention provides a traffic statistics method, which is applied to an EVB switch, as shown in FIG. 4 , including:
S401、接收EVB服务器发送的流量状态通知,对所述流量状态通知进行解析得到流量参数和VM的通讯标识;S401. Receive a traffic status notification sent by an EVB server, and parse the traffic status notification to obtain a traffic parameter and a communication identifier of the VM;
所述流量参数通过所述EVB服务器的虚拟交换机对所述VM的传输数据进行统计得到。The traffic parameter is obtained by collecting statistics on the transmission data of the VM by the virtual switch of the EVB server.
当EVB服务器内的VM进行的传输数据的传输时,EVB服务器通过传输数据的VM对应的虚拟交换机对VM的传输数据进行统计,其中,传输数据包括第一路径的传输数据和第二路径的传输数据,第一路径为EVB服务器的内部路径,第二路径为EVB服务器与EVB交换机之间的路径。当虚拟交换机对VM的传输数据进行统计得到该VM对应的流量参数后,将流量参数和VM的通讯标识进行封装,生成流量状态标识,并将生成的流量状态标识发送至EVB交换机。When the VM in the EVB server transmits the transmission data, the EVB server collects statistics on the transmission data of the VM through the virtual switch corresponding to the VM that transmits the data, wherein the transmission data includes the transmission data of the first path and the transmission of the second path For data, the first path is the internal path of the EVB server, and the second path is the path between the EVB server and the EVB switch. After the virtual switch collects statistics on the transmission data of the VM to obtain the traffic parameters corresponding to the VM, it encapsulates the traffic parameters and the communication identifier of the VM to generate a traffic state identifier, and sends the generated traffic state identifier to the EVB switch.
EVB交换机接收到流量状态通知,对流量状态通知进行解析,解析出流量状态通知携带的流量参数和VM的通讯标识,其中,流量参数可包括:入接口报文的最大速率、出接口报文的最大速率、接收报文总数量、发送报文总数量、接口接收的单播报文的数目、接口发送的单播报文的数目、接口接收的组播报文的数目、接口发送的组播报文的数目、接口接收的广播报文的数目、接口发送的广播报文的数目、接口接收的超大帧长报文数目、接口发送的超大帧长报文数目、接口在物理层检测时发现的丢弃报文数目、接口在物理层检测时发现的错误报文总数目、接口接收的CRC错误报文数目等与流量统计有关的参数。VM的通讯标识可为VM的MAC地址。The EVB switch receives the traffic status notification, parses the traffic status notification, and parses out the traffic parameters carried in the traffic status notification and the communication identifier of the VM, where the traffic parameters may include: the maximum rate of incoming interface packets, the Maximum rate, total number of received packets, total number of sent packets, number of unicast packets received by the interface, number of unicast packets sent by the interface, number of multicast packets received by the interface, multicast packets sent by the interface The number of broadcast packets received by the interface, the number of broadcast packets sent by the interface, the number of jumbo frame length packets received by the interface, the number of jumbo frame length packets sent by the interface, and the discards found by the interface during physical layer detection. Parameters related to traffic statistics, such as the number of packets, the total number of error packets detected by the interface during physical layer detection, and the number of CRC error packets received by the interface. The communication identifier of the VM may be the MAC address of the VM.
一些实施例中,流量状态通知为添加有流量统计标识的状态通知。当EVB交换机接收到状态通知时,基于CDCP对所述状态通知进行解析,检测到解析结果中包括流量统计标识,确定所述状态通知为流量状态通知。确定所述状态通知为流量状态通知时,确定接收到的状态通知中携带有流量参数,对流量参数对应的字段进行解析得到流量参数。这里,当状态通知的保留字段设置为自定义的流量统计标识时,确定该状态通知为流量状态通知,以表征该状态通知携带流量参数,以和未携带流量参数的状态通知进行区分,流量统计标识可根据用户需求进行设置,比如:保留字段为0x1。In some embodiments, the traffic status notification is a status notification added with a traffic statistics identifier. When the EVB switch receives the status notification, it parses the status notification based on CDCP, detects that the analysis result includes a traffic statistics identifier, and determines that the status notification is a traffic status notification. When it is determined that the state notification is a traffic state notification, it is determined that the received state notification carries a traffic parameter, and the field corresponding to the traffic parameter is parsed to obtain the traffic parameter. Here, when the reserved field of the status notification is set to a custom traffic statistics identifier, it is determined that the status notification is a traffic status notification, so as to indicate that the status notification carries traffic parameters, so as to distinguish it from the status notifications that do not carry traffic parameters. The identifier can be set according to user needs, for example: the reserved field is 0x1.
当基于CDCP对所述状态通知进行解析时,可通过识别状态通知中新增的流量统计信息字段来确定流量参数和VM的通讯标识,比如:状态通知的SCID/SVID对中增加的流量统计字段。When parsing the status notification based on CDCP, the traffic parameters and the communication identifier of the VM can be determined by identifying the newly added traffic statistics field in the status notification, for example: the traffic statistics field added in the SCID/SVID pair of the status notification .
在一些实施例中,在对所述流量状态通知进行解析得到流量参数和VM的通讯标识之前,对所述流量状态通知进行解析得到虚拟服务商通道的通道标识;根据所述虚拟服务商通道的通道标识确定所述流量参数所属的虚拟交换机。这里,EVB交换机与EVB服务器的多个虚拟交换机之间存在多个虚拟服务商通道,且多个虚拟服务商通道通过EVB交换机与EVB服务器之间的一个物理通道来实现。当EVB交换机接收到EVB服务器的请求消息以请求创建虚拟服务商通道时,根据虚拟服务商通道配置为发送请求的虚拟交换机分配虚拟服务商通道,并为该虚拟交换机创建虚拟服务商通道,在创建虚拟服务商通道后向EVB服务器返回虚拟服务商通道创建通知,通过创建的虚拟服务商通道接收EVB服务器发送的该虚拟交换机的流量状态通知。EVB服务器在发送状态流量通知前,将虚拟服务商通道的通道标识添加在流量状态通知中,在EVB交换机接收到流量状态通知时,剥离流量状态通知携带的虚拟服务商通道的通道标识并识别该通道标识,以确定传输流量状态通知的虚拟服务商通道,进一步确定流量状态通知携带的流量参数所属的虚拟交换机。In some embodiments, before the traffic status notification is parsed to obtain the traffic parameters and the communication identifier of the VM, the traffic status notification is parsed to obtain the channel identifier of the virtual service provider channel; The channel identifier determines the virtual switch to which the traffic parameter belongs. Here, there are multiple virtual service provider channels between the EVB switch and multiple virtual switches of the EVB server, and the multiple virtual service provider channels are implemented through a physical channel between the EVB switch and the EVB server. When the EVB switch receives a request message from the EVB server to request the creation of a virtual service provider channel, it allocates a virtual service provider channel to the virtual switch that sends the request according to the configuration of the virtual service provider channel, and creates a virtual service provider channel for the virtual switch. After the virtual service provider channel, the virtual service provider channel creation notification is returned to the EVB server, and the traffic status notification of the virtual switch sent by the EVB server is received through the created virtual service provider channel. Before sending the status traffic notification, the EVB server adds the channel ID of the virtual service provider channel to the traffic status notification. When the EVB switch receives the traffic status notification, it strips the channel ID of the virtual service provider channel carried in the traffic status notification and identifies the The channel identifier is used to determine the virtual service provider channel for transmitting the traffic status notification, and further determine the virtual switch to which the traffic parameters carried in the traffic status notification belong.
在进行传输数据的传输过程中,EVB交换机可周期性的接收到EVB服务器发送的一虚拟交换机的流量状态通知,接收到的流量状态通知中携带的流量参数为发出时刻所统计的流量参数。在接收到EVB服务器发送的请求消息以删除创建的虚拟服务商通道时,可删除虚拟服务商通道,直到再次接收EVB服务器发送的针对同一虚拟交换机的创建虚拟服务商通道的请求消息,以再次创建该虚拟交换机对应的虚拟服务商通道。In the process of transmitting data, the EVB switch can periodically receive a traffic status notification of a virtual switch sent by the EVB server, and the traffic parameters carried in the received traffic status notification are the traffic parameters counted at the time of sending. When receiving a request message sent by the EVB server to delete the created virtual service provider channel, the virtual service provider channel can be deleted until the request message for creating a virtual service provider channel for the same virtual switch sent by the EVB server is received again to create a new virtual service provider channel The virtual service provider channel corresponding to the virtual switch.
需要说明的是,EVB交换机在创建虚拟服务商通道时,创建的虚拟服务商通道与虚拟交换机对应,即虚拟服务商通道与虚拟交换机之间具有一一对应的关系。EVB交换机和EVB服务器之间可同时创建多个虚拟交换机对应的虚拟服务商通道,以接收不同的虚拟交换机的流量状态通知,以获取EVB服务器的内部传输数据的流量参数。It should be noted that when the EVB switch creates a virtual service provider channel, the created virtual service provider channel corresponds to the virtual switch, that is, there is a one-to-one correspondence between the virtual service provider channel and the virtual switch. Virtual service provider channels corresponding to multiple virtual switches can be created simultaneously between the EVB switch and the EVB server, so as to receive traffic status notifications from different virtual switches, and to obtain the traffic parameters of the internal data transmission of the EVB server.
S402、利用所述流量参数对所述VM进行流量统计;S402, using the traffic parameter to perform traffic statistics on the VM;
当EVB交换机获取VM的流量参数后,利用流量参数对该VM的流量进行流量统计。在实际的应用中,EVB交换机通过交换机发送的同一VM的多条流量状态通知中携带的流量参数对该VM进行流量统计。After the EVB switch obtains the traffic parameters of the VM, it uses the traffic parameters to collect statistics on the traffic of the VM. In practical applications, the EVB switch performs traffic statistics on the VM through the traffic parameters carried in multiple traffic status notifications of the same VM sent by the switch.
可通过多同一EVB服务器中的各VM的流量的统计来实现对服务器的流量的统计。The statistics of the traffic of the server can be realized by the statistics of the traffic of each VM in the same EVB server.
当EVB交换机确定EVB服务器的VM的流量后,可将统计的流量上报给网管系统,供网管人员查阅。After the EVB switch determines the traffic of the VM of the EVB server, it can report the statistics traffic to the network management system for the network management personnel to check.
在本发明实施例中,由EVB交换机通过从EVB接收的流量状态通知来对EVB内的VM的流量进行统计,不需要EVB基于转发的数据进行流量统计,避免了服务器内部转发的数据需要经过蛇形转发,降低了宽带资源的浪费,减少了传输时延。In the embodiment of the present invention, the EVB switch collects statistics on the traffic of the VMs in the EVB through the traffic status notification received from the EVB, and the EVB does not need to perform traffic statistics based on the forwarded data, which avoids the need for the data forwarded by the server to pass through the snake. forwarding, which reduces the waste of broadband resources and reduces the transmission delay.
实施例三Embodiment 3
本发明实施例提供一种流量统计方法,应用于包括EVB服务器和EVB交换机的网络系统,如图5所示,包括:An embodiment of the present invention provides a traffic statistics method, which is applied to a network system including an EVB server and an EVB switch, as shown in FIG. 5 , including:
S501、EVB服务器通过虚拟交换机对VM的传输数据进行统计得到所述VM的流量参数,根据所述流量参数和所述VM的通讯标识生成流量状态通知,并发送所述流量状态通知至EVB交换机;S501, the EVB server collects statistics on the transmission data of the VM through the virtual switch to obtain the traffic parameters of the VM, generates a traffic status notification according to the traffic parameters and the communication identifier of the VM, and sends the traffic status notification to the EVB switch;
S502、EVB交换机接收所述EVB服务器发送的所述流量状态通知,对所述流量状态通知进行解析得到所述流量参数和所述VM的通讯标识,利用所述流量参数对所述VM进行流量统计。S502. The EVB switch receives the traffic status notification sent by the EVB server, parses the traffic status notification to obtain the traffic parameter and the communication identifier of the VM, and uses the traffic parameter to perform traffic statistics on the VM .
在一些实施例中,EVB服务器判断所述传输数据的源地址和目的地址是否属于同一EVB服务器;确定所述传输数据的源地址和目的地址属于同一EVB服务器时,通过第一路径传输所述传输数据,所述第一路径为所述EVB服务器的内部路径;确定所述传输数据的源地址和目的地址不属于同一EVB服务器时,通过第二路径传输所述传输数据,所述第二路径为所述EVB服务器和所述EVB交换机之间的路径。In some embodiments, the EVB server determines whether the source address and the destination address of the transmission data belong to the same EVB server; when it is determined that the source address and the destination address of the transmission data belong to the same EVB server, the transmission is transmitted through the first path data, the first path is the internal path of the EVB server; when it is determined that the source address and destination address of the transmission data do not belong to the same EVB server, the transmission data is transmitted through the second path, and the second path is The path between the EVB server and the EVB switch.
在一些实施例中,EVB服务器在发送所述流量状态通知至EVB交换机之前,确定所述虚拟交换机对应的虚拟服务商通道;为所述流量状态通知添加所述虚拟服务商通道的通道标识。In some embodiments, before sending the traffic status notification to the EVB switch, the EVB server determines a virtual service provider channel corresponding to the virtual switch; and adds a channel identifier of the virtual service provider channel to the traffic status notification.
此时,EVB交换机在对所述流量状态通知进行解析得到流量参数和VM的通讯标识之前,对所述流量状态通知进行解析得到虚拟服务商通道的通道标识;根据所述虚拟服务商通道的通道标识确定所述流量参数所属的虚拟交换机。At this time, the EVB switch parses the traffic state notification to obtain the channel identifier of the virtual service provider channel before obtaining the traffic parameters and the communication identifier of the VM by parsing the traffic state notification; according to the channel of the virtual service provider channel Identify the virtual switch to which the traffic parameter belongs.
在一些实施例中,EVB服务器基于CDCP在状态通知中设置流量统计标识生成所述流量状态通知。此时,EVB交换机基于CDCP对接收的状态通知进行解析,检测到解析结果中包括流量统计标识,确定所述状态通知为流量状态通知。In some embodiments, the EVB server generates the traffic status notification based on the CDCP setting the traffic statistics flag in the status notification. At this time, the EVB switch parses the received status notification based on CDCP, detects that the analysis result includes a traffic statistics identifier, and determines that the status notification is a traffic status notification.
实施例四Embodiment 4
下面结合具体的应用实施例对本发明实施例提供的流量统计方法再作详细的描述。The traffic statistics method provided by the embodiment of the present invention is described in detail below with reference to specific application embodiments.
EVB服务器(station)和EVB交换机(bridge)组成的系统结构如图6所示,station包括VM、vSwitch和服务商组件(S-component),bridge包括S-component,station和bridge之间的虚拟通道称为虚拟服务商通道S-channel。The system structure composed of EVB server (station) and EVB switch (bridge) is shown in Figure 6. Station includes VM, vSwitch and service provider component (S-component), bridge includes S-component, and virtual channel between station and bridge It is called the virtual service provider channel S-channel.
CDCP是一个基于链路层发现协议(link layer discovery protocol,LLDP)的配置供S-channel的S-VLAN(服务商VLAN)的协议,通过在报文中以TLV格式封装设备自身信息进行发送,用于发现二层直连设备。CDCP is a link layer discovery protocol (LLDP)-based protocol for configuring the S-VLAN (service provider VLAN) of the S-channel. It is sent by encapsulating the device's own information in the TLV format in the message. Used to discover Layer 2 directly connected devices.
CDCP是专门用于建立Multi Channel模式下S-Component与网络连接的通道,EVB服务器上的虚拟交换机的VEB/VEPA均通过S-channel和EVB交换机接,S-channel是一个虚拟连接,它利用了两端的S-VLAN组件来进行连接。CDCP is a channel specially used to establish the connection between S-Component and the network in Multi Channel mode. The VEB/VEPA of the virtual switch on the EVB server is connected through the S-channel and the EVB switch. The S-channel is a virtual connection, which uses The S-VLAN components at both ends are connected.
S-channel两端端点称为服务商通道端点(S-channel Access Port,CAP),CAP负责在报文进入S-channel时候封装通道标识S-tag,在报文离开S-channel时候剥离S-tag。由于所有虚拟连接都是在同一个物理链路上传输的,所以该S-tag用途是来标识每个虚拟交换机所对应的通道。也就是一个vSwitch就对应一个S-channel。S-VLAN组件能够识别、插入、移除S-tag使得能够在EVB交换机上运作多个S-channel。The endpoints at both ends of the S-channel are called service provider channel endpoints (S-channel Access Port, CAP). The CAP is responsible for encapsulating the channel identifier S-tag when the packet enters the S-channel, and stripping the S-tag when the packet leaves the S-channel. tag. Since all virtual connections are transmitted on the same physical link, the purpose of this S-tag is to identify the channel corresponding to each virtual switch. That is, a vSwitch corresponds to an S-channel. The S-VLAN component can identify, insert, and remove S-tags enabling the operation of multiple S-channels on EVB switches.
如图7所示,S-Channel配置由EVB交换机决定,并保存在EVB交换机上,由EVB服务器向EVB交换机发起S-Channel资源请求,EVB交换机分配S-VLAN。Station的以太网接口上使能EVB交换机功能后,EVB交换机通过LLDP报文向外发布状态通告701。当VM有创建S-Channel的请求,或者原有的请求发生变化时,通道请求消息702向EVB交换机发出创建S-Channel的请求报文。EVB交换机为其分配SVID以创建对应的S-Channel接口,随后回复响应报文703通知EVB服务器分配S-Channel的SVID。EVB服务器和EVB交换机在后续的报文中携带当前S-Channel的通道标识发送流量状态通告704。这里,可周期性的发送流量状态通告704。EVB交换机也可周期性地向EVB服务器发送状态通知701。EVB服务器周期性的向EVB交换机发送CDCP的流量状态通告,携带流量参数和VM的通讯标识,交换机解析流量状态通告就可以知道每个VM对应的流量信息了。As shown in Figure 7, the S-Channel configuration is determined by the EVB switch and saved on the EVB switch. The EVB server initiates an S-Channel resource request to the EVB switch, and the EVB switch allocates the S-VLAN. After the EVB switch function is enabled on the Ethernet interface of the Station, the EVB switch advertises status notification 701 through LLDP packets. When the VM has a request to create an S-Channel, or the original request changes, the channel request message 702 sends a request message for creating an S-Channel to the EVB switch. The EVB switch assigns an SVID to it to create a corresponding S-Channel interface, and then replies with a response packet 703 to notify the EVB server to assign the SVID of the S-Channel. The EVB server and the EVB switch carry the channel identifier of the current S-Channel in the subsequent packets to send the traffic status notification 704 . Here, traffic status advertisements 704 may be sent periodically. The EVB switch may also periodically send status notifications 701 to the EVB server. The EVB server periodically sends the CDCP traffic status notification to the EVB switch, carrying the traffic parameters and the VM's communication identifier. The switch parses the traffic status notification to know the traffic information corresponding to each VM.
需要说明的是,也可通过通道请求消息702向EVB交换机发出删除S-Channel的请求报文,EVB交换机为其释放SVID以删除对应的S-Channel接口,随后回复响应报文703通知EVB服务器删除S-Channel的SVID,将S-Channel删除。It should be noted that the request message for deleting the S-Channel can also be sent to the EVB switch through the channel request message 702, and the EVB switch releases the SVID for it to delete the corresponding S-Channel interface, and then replies with the response message 703 to notify the EVB server to delete it. The SVID of the S-Channel, delete the S-Channel.
CPCP协议TLV字段如图8所示,各字段的含义如表1所示。The TLV field of the CPCP protocol is shown in Figure 8, and the meaning of each field is shown in Table 1.
表1 CPCP协议TLV字段的含义Table 1 The meaning of the TLV field of the CPCP protocol
承载流量参数的流量状态通知的TLV字段如图9所示,其中,Resv1保留字段默认取值为0,当状态通知的Resv1为0时,为普通的状态通知。可自定义一个取值0x1,代表本次Station发给Bridge的状态通告里面携带流量参数。0x2-0x7为保留字段,可根据用户需求进行设置。流量通知消息中携带流量参数和VM的通讯标识的vSwitch Statistic字段由表2所示的字段组成。The TLV field of the traffic status notification carrying the traffic parameters is shown in Figure 9, where the Resv1 reserved field is 0 by default. When the Resv1 of the status notification is 0, it is a common status notification. A value of 0x1 can be customized, which means that the status notification sent by the Station to the Bridge carries the traffic parameters. 0x2-0x7 are reserved fields and can be set according to user needs. The vSwitch Statistic field that carries the traffic parameters and the VM's communication identifier in the traffic notification message consists of the fields shown in Table 2.
表2 vSwitch Statistic字段的组成实例Table 2 Composition examples of vSwitch Statistic fields
需要说明的是,表2中的字段为vSwitch Statistic所包括的流量参数的示例,在实际应用中,可根据实际需求对流量参数的具体信息进行设置。It should be noted that the fields in Table 2 are examples of the traffic parameters included in the vSwitch Statistic. In practical applications, the specific information of the traffic parameters can be set according to actual requirements.
实施例五Embodiment 5
为实现本发明实施例一的方法,本发明实施例还提供了一种流量统计装置,该装置包括第一处理器和第一收发器;其中,To implement the method of Embodiment 1 of the present invention, the embodiment of the present invention further provides a traffic statistics device, the device includes a first processor and a first transceiver; wherein,
第一处理器,用于通过虚拟交换机对VM的传输数据进行统计得到所述VM的流量参数;根据所述流量参数和所述VM的通讯标识生成流量状态通知;a first processor, configured to perform statistics on the transmission data of the VM through the virtual switch to obtain the traffic parameter of the VM; generate a traffic status notification according to the traffic parameter and the communication identifier of the VM;
第一收发器,用于发送所述流量状态通知至EVB交换机。The first transceiver is configured to send the traffic status notification to the EVB switch.
在一些实施例中,第一处理器还用于:判断所述传输数据的源地址和目的地址是否属于同一EVB服务器;确定所述传输数据的源地址和目的地址属于同一EVB服务器时,控制所述第一收发器通过第一路径传输所述传输数据,所述第一路径为所述EVB服务器的内部路径;确定所述传输数据的源地址和目的地址不属于同一EVB服务器时,控制所述第一收发器通过第二路径传输所述传输数据,所述第二路径为所述EVB服务器和所述EVB交换机之间的路径。In some embodiments, the first processor is further configured to: determine whether the source address and the destination address of the transmitted data belong to the same EVB server; when it is determined that the source address and the destination address of the transmitted data belong to the same EVB server, control the The first transceiver transmits the transmission data through a first path, and the first path is an internal path of the EVB server; when it is determined that the source address and destination address of the transmission data do not belong to the same EVB server, control the The first transceiver transmits the transmission data through a second path, and the second path is a path between the EVB server and the EVB switch.
在一些实施例中,第一处理器还用于:确定所述虚拟交换机对应的虚拟服务商通道;为所述流量状态通知添加所述虚拟服务商通道的通道标识。In some embodiments, the first processor is further configured to: determine a virtual service provider channel corresponding to the virtual switch; and add a channel identifier of the virtual service provider channel to the traffic status notification.
在一些实施例中,第一处理器还用于:基于CDCP在状态通知中设置流量统计标识生成所述流量状态通知。In some embodiments, the first processor is further configured to: set the traffic statistics flag in the state notification based on the CDCP to generate the traffic status notification.
实施例六Embodiment 6
为实现本发明实施例二的方法,本发明实施例还提供了一种流量统计装置,该装置包括第二处理器和第二收发器;其中,In order to implement the method of Embodiment 2 of the present invention, the embodiment of the present invention further provides a traffic statistics device, the device includes a second processor and a second transceiver; wherein,
第二收发器,用于接收EVB服务器发送的流量状态通知;a second transceiver, configured to receive a traffic status notification sent by the EVB server;
第二处理器,用于对所述流量状态通知进行解析得到流量参数和VM的通讯标识,利用所述流量参数对所述VM进行流量统计;所述流量参数通过所述EVB服务器的虚拟交换机对所述VM的传输数据进行统计得到。The second processor is configured to parse the traffic status notification to obtain traffic parameters and the communication identifier of the VM, and use the traffic parameters to perform traffic statistics on the VM; the traffic parameters are paired with the virtual switch of the EVB server. The transmission data of the VM is obtained by statistics.
在一些实施例中,第二处理器还用于:对所述流量状态通知进行解析得到虚拟服务商通道的通道标识;根据所述虚拟服务商通道的通道标识确定所述流量参数所属的虚拟交换机。In some embodiments, the second processor is further configured to: parse the traffic status notification to obtain a channel identifier of the virtual service provider channel; determine the virtual switch to which the traffic parameter belongs according to the channel identifier of the virtual service provider channel .
在一些实施例中,第二处理器还用于:基于隧道发现配置协议CDCP对接收的状态通知进行解析,检测到解析结果中包括流量统计标识,确定所述状态通知为流量状态通知。In some embodiments, the second processor is further configured to: parse the received status notification based on the tunnel discovery configuration protocol CDCP, detect that the parsing result includes a traffic statistics identifier, and determine that the status notification is a traffic status notification.
需要说明的是,本发明实施例五或实施例六提供的流量统计装置可通过图10所示的装置实现,图10所示的流量统计装置包括:至少一个处理器1001和收发器1002。流量统计装置中的各个组件通过总线系统1003耦合在一起。可理解,总线系统1003用于实现这些组件之间的连接通信。其中第一处理器或第二处理器与处理器1001对应,第一收发器或第二收发器与收发器1001对应。It should be noted that, the traffic statistics device provided in Embodiment 5 or Embodiment 6 of the present invention may be implemented by the device shown in FIG. 10 . The traffic statistics device shown in FIG. 10 includes: at least one processor 1001 and a transceiver 1002 . The various components in the traffic statistics device are coupled together through the bus system 1003 . It can be understood that the bus system 1003 is used to realize the connection communication between these components. The first processor or the second processor corresponds to the processor 1001 , and the first transceiver or the second transceiver corresponds to the transceiver 1001 .
实施例七Embodiment 7
本发明实施例还提供一种流量统计系统,如图11所示,所述系统包括EVB服务器1101和EVB交换机1102;其中,An embodiment of the present invention further provides a traffic statistics system. As shown in FIG. 11 , the system includes an EVB server 1101 and an EVB switch 1102; wherein,
EVB服务器1101通过虚拟交换机对VM的传输数据进行统计得到所述VM的流量参数,根据所述流量参数和所述VM的通讯标识生成流量状态通知,并发送所述流量状态通知至EVB交换机1102;The EVB server 1101 obtains the traffic parameters of the VM by collecting statistics on the transmission data of the VM through the virtual switch, generates a traffic status notification according to the traffic parameters and the communication identifier of the VM, and sends the traffic status notification to the EVB switch 1102;
EVB交换机1102接收EVB服务器1101发送的所述流量状态通知,对所述流量状态通知进行解析得到所述流量参数和所述VM的通讯标识,利用所述流量参数对所述VM进行流量统计。The EVB switch 1102 receives the traffic state notification sent by the EVB server 1101, parses the traffic state notification to obtain the traffic parameter and the communication identifier of the VM, and uses the traffic parameter to perform traffic statistics on the VM.
实施例八Embodiment 8
基于此,为了实现本发明实施例一的方法,本发明实施例还提供了一种流量统计装置,该装置包括:处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序;Based on this, in order to implement the method of Embodiment 1 of the present invention, an embodiment of the present invention further provides a traffic statistics device, the device includes: a processor, a memory, and a device stored on the memory and capable of running on the processor the computer program;
其中,处理器用于运行所述计算机程序时,执行:Wherein, when the processor is used to run the computer program, execute:
通过虚拟交换机对VM的传输数据进行统计得到所述VM的流量参数;根据所述流量参数和所述VM的通讯标识生成流量状态通知,并发送所述流量状态通知至EVB交换机。The traffic parameters of the VM are obtained by collecting statistics on the transmission data of the VM through the virtual switch; a traffic status notification is generated according to the traffic parameters and the communication identifier of the VM, and the traffic status notification is sent to the EVB switch.
在一些实施例中,处理器用于运行所述计算机程序时,还执行:判断所述传输数据的源地址和目的地址是否属于同一EVB服务器;确定所述传输数据的源地址和目的地址属于同一EVB服务器时,控制所述第一收发器通过第一路径传输所述传输数据,所述第一路径为所述EVB服务器的内部路径;确定所述传输数据的源地址和目的地址不属于同一EVB服务器时,控制所述第一收发器通过第二路径传输所述传输数据,所述第二路径为所述EVB服务器和所述EVB交换机之间的路径。In some embodiments, when the processor is configured to run the computer program, the processor further executes: judging whether the source address and the destination address of the transmission data belong to the same EVB server; determining that the source address and the destination address of the transmission data belong to the same EVB When the server is used, the first transceiver is controlled to transmit the transmission data through a first path, and the first path is an internal path of the EVB server; it is determined that the source address and the destination address of the transmission data do not belong to the same EVB server When the first transceiver is controlled to transmit the transmission data through a second path, the second path is a path between the EVB server and the EVB switch.
在一些实施例中,处理器用于运行所述计算机程序时,在发送所述流量状态通知至EVB交换机之前,还执行:确定所述虚拟交换机对应的虚拟服务商通道;为所述流量状态通知添加所述虚拟服务商通道的通道标识。In some embodiments, when the processor is configured to run the computer program, before sending the traffic status notification to the EVB switch, the processor further executes: determining a virtual service provider channel corresponding to the virtual switch; adding an addition to the traffic status notification The channel identifier of the virtual service provider channel.
在一些实施例中,处理器用于运行所述计算机程序时,还执行:基于CDCP在状态通知中设置流量统计标识生成所述流量状态通知。In some embodiments, when the processor is configured to run the computer program, the processor further executes: generating the traffic status notification based on setting a traffic statistics flag in the status notification based on the CDCP.
实施例九Embodiment 9
基于此,为了实现本发明实施例二的方法,本发明实施例还提供了一种流量统计装置,该装置包括:处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序;Based on this, in order to implement the method of the second embodiment of the present invention, the embodiment of the present invention further provides a traffic statistics device, the device includes: a processor, a memory, and a device stored on the memory and capable of running on the processor the computer program;
其中,处理器用于运行所述计算机程序时,执行:Wherein, when the processor is used to run the computer program, execute:
接收EVB服务器发送的流量状态通知,对所述流量状态通知进行解析得到流量参数和VM的通讯标识,所述流量参数通过所述EVB服务器的虚拟交换机对所述VM的传输数据进行统计得到;利用所述流量参数对所述VM进行流量统计。Receive the traffic status notification sent by the EVB server, parse the traffic status notification to obtain traffic parameters and the communication identifier of the VM, and the traffic parameters are obtained by performing statistics on the transmission data of the VM through the virtual switch of the EVB server; using The traffic parameter performs traffic statistics on the VM.
在一些实施例中,处理器用于运行所述计算机程序时,在对所述流量状态通知进行解析得到流量参数和VM的通讯标识之前,还执行:In some embodiments, when the processor is configured to run the computer program, before parsing the traffic status notification to obtain the traffic parameters and the communication identifier of the VM, the processor further executes:
对所述流量状态通知进行解析得到虚拟服务商通道的通道标识;根据所述虚拟服务商通道的通道标识确定所述流量参数所属的虚拟交换机。The channel identifier of the virtual service provider channel is obtained by parsing the traffic state notification; the virtual switch to which the traffic parameter belongs is determined according to the channel identifier of the virtual service provider channel.
在一些实施例中,处理器用于运行所述计算机程序时,还执行:基于CDCP对接收的状态通知进行解析,检测到解析结果中包括流量统计标识,确定所述状态通知为流量状态通知。In some embodiments, when the processor is configured to run the computer program, the processor further performs: parsing the received status notification based on CDCP, detecting that the parsing result includes a traffic statistics identifier, and determining that the status notification is a traffic status notification.
图12是本发明实施利八或实施例九的流量统计装置的结构示意图,图12所示的流量统计装置包括:至少一个处理器1201和存储器1202。流量统计装置中的各个组件通过总线系统1203耦合在一起。可理解,总线系统1203用于实现这些组件之间的连接通信。FIG. 12 is a schematic structural diagram of a traffic statistics device according to Embodiment 8 or Embodiment 9 of the present invention. The traffic statistics device shown in FIG. 12 includes: at least one processor 1201 and a memory 1202 . The various components in the traffic statistics device are coupled together through the bus system 1203 . It can be understood that the bus system 1203 is used to realize the connection and communication between these components.
可以理解,存储器1202可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM,Read OnlyMemory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random AccessMemory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,SynchronousDynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本发明实施例描述的存储器1202旨在包括但不限于这些和任意其它适合类型的存储器。It will be appreciated that the memory 1202 may be either volatile memory or non-volatile memory, and may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read-Only Memory) Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), Magnetic Random Access Memory (FRAM, ferromagnetic random access memory), Flash Memory, Magnetic Surface Memory, Optical disk, or Compact Disc Read-Only Memory (CD-ROM); the magnetic surface memory can be a magnetic disk memory or a magnetic tape memory. The volatile memory may be Random Access Memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory Memory (DRAM, Dynamic Random Access Memory), Synchronous Dynamic Random Access Memory (SDRAM, SynchronousDynamic Random Access Memory), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), Synchronous Link Dynamic Random Access Memory (SLDRAM, SyncLink Dynamic Random Access Memory), Direct Memory Bus Random Access Memory (DRRAM, Direct Rambus Random Access Memory) . The memory 1202 described in the embodiments of the present invention is intended to include, but not be limited to, these and any other suitable types of memory.
本发明实施例中的存储器1202用于存储各种类型的数据以支持实施例八或实施例九的流量统计装置的操作。The memory 1202 in this embodiment of the present invention is used to store various types of data to support the operation of the traffic statistics apparatus of the eighth embodiment or the ninth embodiment.
上述本发明实施例揭示的方法可以应用于处理器1201中,或者由处理器1201实现。处理器1201可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1201中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1201可以是通用处理器、数字信号处理器(DSP,Digital Signal Processor),或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器1201可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器1202,处理器1201读取存储器1202中的信息,结合其硬件完成前述方法的步骤。The methods disclosed in the above embodiments of the present invention may be applied to the processor 1201 or implemented by the processor 1201 . The processor 1201 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method may be completed by an integrated logic circuit of hardware in the processor 1201 or an instruction in the form of software. The above-mentioned processor 1201 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. The processor 1201 may implement or execute the methods, steps, and logical block diagrams disclosed in the embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, the storage medium is located in the memory 1202, the processor 1201 reads the information in the memory 1202, and completes the steps of the foregoing method in combination with its hardware.
在示例性实施例中,实施例八或实施例九的流量统计装置可以被一个或多个应用专用集成电路(ASIC,Application Specific Integrated Circuit)、DSP、可编程逻辑器件(PLD,Programmable Logic Device)、复杂可编程逻辑器件(CPLD,Complex ProgrammableLogic Device)、现场可编程门阵列(FPGA,Field-Programmable Gate Array)、通用处理器、控制器、微控制器(MCU,Micro Controller Unit)、微处理器(Microprocessor)、或其他电子元件实现,用于执行前述方法。In an exemplary embodiment, the traffic statistics apparatus of Embodiment 8 or Embodiment 9 may be implemented by one or more Application Specific Integrated Circuits (ASIC, Application Specific Integrated Circuits), DSPs, and Programmable Logic Devices (PLDs, Programmable Logic Devices). , Complex Programmable Logic Device (CPLD, Complex Programmable Logic Device), Field Programmable Gate Array (FPGA, Field-Programmable Gate Array), General Purpose Processor, Controller, Micro Controller (MCU, Micro Controller Unit), Microprocessor (Microprocessor), or other electronic components to implement the aforementioned method.
实施例十Embodiment ten
在示例性实施例中,本发明实施例还提供了一种计算机可读存储介质,例如包括计算机程序的存储器1202,上述计算机程序可由流量统计装置的处理器1201执行,以完成前述方法所述步骤。计算机可读存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、FlashMemory、磁表面存储器、光盘、或CD-ROM等存储器。In an exemplary embodiment, the embodiment of the present invention further provides a computer-readable storage medium, such as a memory 1202 including a computer program, and the computer program can be executed by the processor 1201 of the traffic statistics apparatus to complete the steps of the foregoing method. . The computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, FlashMemory, magnetic surface memory, optical disk, or CD-ROM.
具体地,本发明实施例提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器运行时,执行:Specifically, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is run by a processor, executes:
通过虚拟交换机对VM的传输数据进行统计得到所述VM的流量参数;Statistics are performed on the transmission data of the VM through the virtual switch to obtain the traffic parameters of the VM;
根据所述流量参数和所述VM的通讯标识生成流量状态通知,并发送所述流量状态通知至EVB交换机。Generate a traffic state notification according to the traffic parameter and the communication identifier of the VM, and send the traffic state notification to the EVB switch.
在一些实施例中,所述计算机程序被处理器运行时,还执行:In some embodiments, the computer program, when executed by the processor, also executes:
判断所述传输数据的源地址和目的地址是否属于同一EVB服务器;确定所述传输数据的源地址和目的地址属于同一EVB服务器时,通过第一路径传输所述传输数据,所述第一路径为所述EVB服务器的内部路径;确定所述传输数据的源地址和目的地址不属于同一EVB服务器时,通过第二路径传输所述传输数据,所述第二路径为所述EVB服务器和所述EVB交换机之间的路径。Determine whether the source address and destination address of the transmission data belong to the same EVB server; when it is determined that the source address and destination address of the transmission data belong to the same EVB server, the transmission data is transmitted through a first path, and the first path is The internal path of the EVB server; when it is determined that the source address and destination address of the transmission data do not belong to the same EVB server, the transmission data is transmitted through a second path, where the second path is the EVB server and the EVB server path between switches.
在一些实施例中,所述计算机程序被处理器运行时,在发送所述流量状态通知至EVB交换机之前,还执行:确定所述虚拟交换机对应的虚拟服务商通道;为所述流量状态通知添加所述虚拟服务商通道的通道标识。In some embodiments, when the computer program is run by the processor, before sending the traffic state notification to the EVB switch, the computer program further executes: determining a virtual service provider channel corresponding to the virtual switch; adding an addition to the traffic state notification The channel identifier of the virtual service provider channel.
在一些实施例中,所述计算机程序被处理器运行时,还执行:基于CDCP在状态通知中设置流量统计标识生成所述流量状态通知。In some embodiments, when the computer program is executed by the processor, the computer program further executes: generating the traffic status notification based on setting a traffic statistics flag in the status notification based on the CDCP.
实施例十一Embodiment 11
在示例性实施例中,本发明实施例还提供了一种计算机可读存储介质,例如包括计算机程序的存储器1202,上述计算机程序可由流量统计装置的处理器1201执行,以完成前述方法所述步骤。计算机可读存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、FlashMemory、磁表面存储器、光盘、或CD-ROM等存储器。In an exemplary embodiment, the embodiment of the present invention further provides a computer-readable storage medium, such as a memory 1202 including a computer program, and the computer program can be executed by the processor 1201 of the traffic statistics apparatus to complete the steps of the foregoing method. . The computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, FlashMemory, magnetic surface memory, optical disk, or CD-ROM.
具体地,本发明实施例提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器运行时,执行:Specifically, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is run by a processor, executes:
接收EVB服务器发送的流量状态通知,对所述流量状态通知进行解析得到流量参数和VM的通讯标识,所述流量参数通过所述EVB服务器的虚拟交换机对所述VM的传输数据进行统计得到;利用所述流量参数对所述VM进行流量统计。Receive the traffic status notification sent by the EVB server, parse the traffic status notification to obtain traffic parameters and the communication identifier of the VM, and the traffic parameters are obtained by performing statistics on the transmission data of the VM through the virtual switch of the EVB server; using The traffic parameter performs traffic statistics on the VM.
在一些实施例中,所述计算机程序被处理器运行时,在对所述流量状态通知进行解析得到流量参数和VM的通讯标识之前,还执行:对所述流量状态通知进行解析得到虚拟服务商通道的通道标识;根据所述虚拟服务商通道的通道标识确定所述流量参数所属的虚拟交换机。In some embodiments, when the computer program is run by the processor, before parsing the traffic state notification to obtain the traffic parameters and the communication identifier of the VM, the computer program further executes: parsing the traffic state notification to obtain a virtual service provider The channel identifier of the channel; the virtual switch to which the traffic parameter belongs is determined according to the channel identifier of the virtual service provider channel.
在一些实施例中,所述计算机程序被处理器运行时,还执行:基于CDCP对接收的状态通知进行解析,检测到解析结果中包括流量统计标识,确定所述状态通知为流量状态通知。In some embodiments, when the computer program is executed by the processor, the computer program further executes: parsing the received status notification based on CDCP, detecting that the parsing result includes a traffic statistics identifier, and determining that the status notification is a traffic status notification.
需要说明的是:本发明实施例所记载的技术方案之间,在不冲突的情况下,可以任意组合。It should be noted that the technical solutions described in the embodiments of the present invention may be combined arbitrarily unless there is a conflict.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention.
Claims (16)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711285748.0A CN109905283A (en) | 2017-12-07 | 2017-12-07 | A traffic statistics method, device and computer-readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711285748.0A CN109905283A (en) | 2017-12-07 | 2017-12-07 | A traffic statistics method, device and computer-readable storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN109905283A true CN109905283A (en) | 2019-06-18 |
Family
ID=66939238
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201711285748.0A Pending CN109905283A (en) | 2017-12-07 | 2017-12-07 | A traffic statistics method, device and computer-readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109905283A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113765826A (en) * | 2020-06-01 | 2021-12-07 | 中移(苏州)软件技术有限公司 | Network monitoring method, platform, device and computer readable storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102334112A (en) * | 2009-02-27 | 2012-01-25 | 美国博通公司 | Method and system for virtual machine networking |
| CN102739505A (en) * | 2011-04-06 | 2012-10-17 | 中兴通讯股份有限公司 | Method and system for controlling virtual channel flow in data center network |
| CN102801729A (en) * | 2012-08-13 | 2012-11-28 | 福建星网锐捷网络有限公司 | Virtual machine message forwarding method, network switching equipment and communication system |
| US9503278B2 (en) * | 2013-08-20 | 2016-11-22 | Lenovo Enterprise Solutions (Singapore) Pte. Ltd. | Reflective relay processing on logical ports for channelized links in edge virtual bridging systems |
| CN106330585A (en) * | 2015-06-29 | 2017-01-11 | 中兴通讯股份有限公司 | Flow monitoring method, device and system |
-
2017
- 2017-12-07 CN CN201711285748.0A patent/CN109905283A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102334112A (en) * | 2009-02-27 | 2012-01-25 | 美国博通公司 | Method and system for virtual machine networking |
| CN102739505A (en) * | 2011-04-06 | 2012-10-17 | 中兴通讯股份有限公司 | Method and system for controlling virtual channel flow in data center network |
| CN102801729A (en) * | 2012-08-13 | 2012-11-28 | 福建星网锐捷网络有限公司 | Virtual machine message forwarding method, network switching equipment and communication system |
| US9503278B2 (en) * | 2013-08-20 | 2016-11-22 | Lenovo Enterprise Solutions (Singapore) Pte. Ltd. | Reflective relay processing on logical ports for channelized links in edge virtual bridging systems |
| CN106330585A (en) * | 2015-06-29 | 2017-01-11 | 中兴通讯股份有限公司 | Flow monitoring method, device and system |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113765826A (en) * | 2020-06-01 | 2021-12-07 | 中移(苏州)软件技术有限公司 | Network monitoring method, platform, device and computer readable storage medium |
| CN113765826B (en) * | 2020-06-01 | 2024-05-28 | 中移(苏州)软件技术有限公司 | Network monitoring method, platform, device and computer readable storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103814554B (en) | A kind of communication means of virtual easily extensible local area network (LAN), device and system | |
| US11245631B2 (en) | Bum traffic control method, related apparatus, and system | |
| US11050586B2 (en) | Inter-cloud communication method and related device, and inter-cloud communication configuration method and related device | |
| CN104022953B (en) | Message forwarding method and device based on open flows Openflow | |
| CN103546451B (en) | System and method for managing the flow in overlay network | |
| US20170264496A1 (en) | Method and device for information processing | |
| CN108206753B (en) | A method, device and system for detecting time delay | |
| CN103873301A (en) | System and method for automatically finding and adding devices | |
| CN102870377A (en) | Monitoring method and device for virtual port | |
| WO2013170652A1 (en) | Overlay tunnel information exchange protocol | |
| CN103997414A (en) | Method and network control unit for generating configuration information | |
| CN105577540B (en) | A kind of method for building up of service link, apparatus and system | |
| US8675658B2 (en) | Using multiple IGMP queriers in a layer 2 network | |
| WO2018068588A1 (en) | Method and software-defined networking (sdn) controller for providing multicast service | |
| US20250202936A1 (en) | Srv6 packet processing method, apparatus, communication device and storage medium | |
| CN118590470A (en) | A non-intrusive multicast forwarding method and system for cloud platform | |
| CN105591967B (en) | A kind of data transmission method and device | |
| US9372708B2 (en) | Synchronizing multicast groups | |
| CN104113513B (en) | A kind of detecting host method, apparatus and system | |
| CN114710805A (en) | Interaction method and device for slicing service data, electronic equipment and readable medium | |
| CN109905283A (en) | A traffic statistics method, device and computer-readable storage medium | |
| CN115348202A (en) | Data transmission method, device, device and storage medium based on network slicing | |
| EP2908476A1 (en) | Method and apparatus for sending multi-link transparent interconnected data frame | |
| CN108881015B (en) | Message broadcasting method and device | |
| WO2017000745A1 (en) | Traffic monitoring method, apparatus, and system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190618 |