WO2016107379A1 - 一种发送报文的方法和装置 - Google Patents
一种发送报文的方法和装置 Download PDFInfo
- Publication number
- WO2016107379A1 WO2016107379A1 PCT/CN2015/096687 CN2015096687W WO2016107379A1 WO 2016107379 A1 WO2016107379 A1 WO 2016107379A1 CN 2015096687 W CN2015096687 W CN 2015096687W WO 2016107379 A1 WO2016107379 A1 WO 2016107379A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- packet
- service flow
- service
- processing policy
- identifier
- Prior art date
Links
Images
Definitions
- the present invention relates to the field of communications technologies, and in particular, to a method and apparatus for transmitting a message.
- the first virtual machine deployed on the first host performs a service interaction with the second virtual machine deployed on the second host
- the first virtual machine may send a message to the second virtual machine to implement the first virtual Communication between the machine and the second virtual machine.
- the first virtual machine When the first virtual machine sends a packet to the second virtual machine, the first virtual machine sends a http (Hypertext Transfer Protocol) request to the first host where the first virtual machine is located, where the http request carries the second virtual Address of the machine; the first host encapsulates the http request into a UDP (User Datagram Protocol) packet, and sends the UDP packet to the switch; the switch calculates the UDP packet according to the address of the second virtual machine.
- the forwarding path sends the packet to the second virtual machine according to the forwarding path of the UDP packet.
- the switch cannot detect the UDP packet service and cannot perform bandwidth monitoring and path control on the UDP packet.
- the present invention provides a method and apparatus for transmitting a message.
- the technical solutions are as follows:
- the present invention provides a method for transmitting a message, the method comprising:
- the packet is sent to the second virtual machine according to the processing policy.
- the processing policy of acquiring the packet according to the service identifier of the service flow includes:
- the determining, according to the processing policy, whether to send the packet includes:
- processing policy is used to perform operations other than discarding the message, it is determined to send the message.
- the sending, by the processing policy, the packet to the second virtual machine includes:
- the present invention provides a method for sending a message, the method comprising:
- the obtaining, by the destination address of the service flow, the service identifier of the service flow includes:
- the present invention provides an apparatus for transmitting a message, the apparatus comprising:
- the first receiving module is configured to receive a packet sent by the first host where the first virtual machine is located, where the packet carries a service identifier of the service flow, and the service identifier of the service flow is the first host according to the service
- the destination address of the stream is set and encapsulated into the message
- a first acquiring module configured to acquire a processing policy of the packet according to the service identifier of the service flow
- a determining module configured to determine, according to the processing policy, whether to send the message
- the first sending module is configured to send the packet to the second virtual machine according to the processing policy if the packet is sent.
- the first acquiring module is configured to obtain the report from a correspondence between a service identifier and a processing policy according to the service identifier of the service flow.
- the processing strategy of the text is configured to obtain the report from a correspondence between a service identifier and a processing policy according to the service identifier of the service flow.
- the determining module includes:
- a first determining unit configured to determine not to send the message if the processing policy is used to discard the message
- a second determining unit configured to determine to send the message if the processing policy is used to perform operations other than discarding the message.
- the first sending module includes:
- a third determining unit configured to determine, according to the identifier of the first virtual machine and the identifier of the second virtual machine, at least one forwarding path used to send the packet;
- a selecting unit configured to select a forwarding path from the at least one forwarding path according to the processing policy
- An obtaining unit configured to acquire, according to the processing policy, a bandwidth of the selected forwarding path
- a setting unit configured to set a bandwidth size of the selected forwarding path according to the acquired bandwidth
- a sending unit configured to send the packet to the second according to the set forwarding path virtual machine.
- the present invention provides an apparatus for transmitting a message, the apparatus comprising:
- a second receiving module configured to receive a service flow sent by the first virtual machine, where the service flow carries a destination address of the service flow
- a second obtaining module configured to acquire a service identifier of the service flow according to a destination address of the service flow
- a second sending module configured to encapsulate the service identifier of the service flow into the packet, and send the packet to the switch, so that the switch obtains the processing policy of the packet according to the service identifier of the service flow, And determining, according to the processing policy, whether to send the packet, and if the packet is sent, sending the packet to the second virtual machine according to the processing policy.
- the second acquiring module is configured to obtain, according to a destination address of the service flow, a correspondence between a destination address and a service identifier. Business identity of the business flow.
- the present invention provides an apparatus for transmitting a message, the apparatus comprising: a first memory and a first processor, configured to perform the method of transmitting a message as described in the first aspect.
- the present invention provides an apparatus for transmitting a message, the apparatus comprising: a second memory and a second processor, configured to perform the method of transmitting a message as described in the second aspect.
- the packet sent by the first host where the first virtual machine is located is received, and the packet carries the service identifier of the service flow, and the service identifier of the service flow is set and encapsulated by the first host according to the destination address of the service flow. If the packet is sent, the packet is sent to the second virtual machine according to the processing policy. The packet carries the service identifier of the service flow, so that the packet can be controlled according to the service identifier of the service flow.
- FIG. 1-1 is a flowchart of a method for sending a message according to Embodiment 1 of the present invention
- 1-2 is a flowchart of another method for sending a message according to Embodiment 1 of the present invention.
- FIG. 2 is a flowchart of a method for sending a message according to Embodiment 2 of the present invention
- FIG. 3 is a schematic structural diagram of an apparatus for transmitting a message according to Embodiment 3 of the present invention.
- FIG. 4 is a schematic structural diagram of an apparatus for transmitting a message according to Embodiment 4 of the present invention.
- FIG. 5 is a schematic structural diagram of an apparatus for transmitting a message according to Embodiment 5 of the present invention.
- FIG. 6 is a schematic structural diagram of an apparatus for transmitting a message according to Embodiment 6 of the present invention.
- An embodiment of the present invention provides a method for sending a packet. Referring to FIG. 1-1, the method includes:
- Step 101a Receive a packet sent by the first host where the first virtual machine is located, where the packet carries the service identifier of the service flow, and the service identifier of the service flow is set by the first host according to the destination address of the service flow and encapsulated into the packet. of;
- Step 102a Obtain a processing policy of the packet according to the service identifier of the service flow.
- Step 103a Determine, according to the processing policy, whether to send a message
- Step 104a If the packet is sent, the packet is sent to the second virtual machine according to the processing policy.
- An embodiment of the present invention provides a method for sending a packet. Referring to Figure 1-2, the method includes:
- Step 101b Receive a service flow sent by the first virtual machine, where the service flow carries a destination address of the service flow.
- Step 102b Obtain a service identifier of the service flow according to the destination address of the service flow.
- the service identifier of the service flow is encapsulated into the packet, and the packet is sent to the switch, so that the switch obtains the packet processing policy according to the service identifier of the service flow, and determines whether to send the packet according to the processing policy, if the packet is sent. Send the packet to the second virtual machine according to the processing policy.
- the packet sent by the first host where the first virtual machine is located is received, and the packet carries the service identifier of the service flow, and the service identifier of the service flow is set and encapsulated by the first host according to the destination address of the service flow.
- the packet processing policy is obtained; according to the processing policy, it is determined whether to send the packet; if the packet is sent, the packet is sent to the second according to the processing policy. virtual machine.
- the packet carries the service identifier of the service flow, so that the packet can be controlled according to the service identifier of the service flow.
- An embodiment of the present invention provides a method for sending a packet. Referring to FIG. 2, the method includes:
- Step 201 The first host receives a service flow sent by the first virtual machine, where the service flow carries a destination address of the service flow.
- the first virtual machine is deployed on the first host, and the second virtual machine is deployed on the second host.
- the first virtual machine sends the service flow to the second virtual machine
- the first virtual machine firstly goes to the first virtual machine.
- a host sends a service flow, where the service flow carries at least the destination address of the service flow, and may also carry the identifier of the first virtual machine and the identifier of the second virtual machine; the first host receives the service flow sent by the first virtual machine, and step 202 is performed. .
- the destination address can be the destination IP address (Internet Protocol), the destination port, or the destination MAC address (Media Access Control) address.
- the identifier of the first virtual machine may be the IP address of the first virtual machine, the name of the first virtual machine, or the number of the first virtual machine.
- the identifier of the second virtual machine may be the IP address of the second virtual machine, The name of the second virtual machine or the number of the second virtual machine.
- the destination address is the destination port 80
- the identifier of the first virtual machine is 192.231.31.252
- the identifier of the second virtual machine is 192.231.31.251.
- the first virtual machine sends a service flow to the first host.
- the flow carries the destination port 80
- the identifier of the first virtual machine is 192.231.31.252
- the identifier of the second virtual machine is 192.23%.
- the first host receives the service flow sent by the first virtual machine.
- Step 202 The first host acquires a service identifier of the service flow according to the destination address of the service flow.
- the user inputs the destination address and the service identifier to the first controller; the first controller receives the destination address and the service identifier input by the user, and stores the destination address and the service identifier entered by the user in the correspondence between the destination address and the service identifier. In the relationship.
- the first controller sends a correspondence between the destination address and the service identifier to the first host, and the first host receives the correspondence between the destination address and the service identifier sent by the first controller, and stores the correspondence between the destination address and the service identifier.
- the step 202 may be: the first host obtains the service identifier of the service flow from the correspondence between the destination address and the service identifier according to the destination address of the service flow.
- the first controller may be an SDN (Software Defined Network) controller or a VxLAN (Virtual eXtension xLAN) controller.
- SDN Software Defined Network
- VxLAN Virtual eXtension xLAN
- the user inputs the destination address 80 and the service identifier 1025, the destination address 443 and the service identifier 2049, the destination address 5000 and the service identifier 4097, and the destination address 5001 and the service identifier 4098 to the first controller.
- the first controller receives the purpose of the user input.
- the address 80 and the service identifier 1025, the destination address 443 and the service identifier 2049, the destination address 5000 and the service identifier 4097, and the destination address 5001 and the service identifier 4098 store the destination address and service identifier entered by the user in Table 1 as follows:
- the first host obtains the service identifier of the service flow as 1025 from the correspondence between the destination address and the service identifier stored in Table 1 according to the destination address 80 of the service flow.
- the service identifier field ranges from 65535, and 50 virtual machines can be deployed on one host.
- the service identifier field corresponding to each virtual machine ranges from 1 to 1024, that is, each virtual machine can define up to 1024 service identifiers for policy control of different services.
- Step 203 The first host encapsulates the service identifier of the service flow into the packet, and sends a packet to the switch.
- the packet includes an inner packet and an outer packet.
- the first host encapsulates the service identifier of the service flow into the outer packet.
- the outer packet includes the source MAC address, the destination MAC address, the VLAN, the source IP address, the destination IP address, the VxLAN port, and the VxLAN header.
- the first host obtains the source MAC address, destination MAC address, VLAN, source IP address, and destination IP address of the service flow.
- the VxLAN port and the VxLAN header encapsulate the service ID of the source MAC address, destination MAC address, VLAN, source IP address, destination IP address, VxLAN port, VxLAN header, and packet of the service flow into the outer packet.
- the inner layer packet includes the source MAC address, the destination MAC address, and the service flow, and the first host obtains the source MAC address, the destination MAC address, and the service flow of the service flow, and encapsulates the source MAC address, the destination MAC address, and the service flow of the service flow into the inner layer. In the message.
- Step 204 The switch receives the packet sent by the first host, where the packet carries the service identifier of the service flow.
- the switch receives the packet sent by the first host, and parses the outer packet of the packet to obtain the service identifier of the service flow. Step 205 is performed.
- the switch can only parse the outer packet of the packet and cannot parse the inner packet of the packet.
- Step 205 The switch acquires a processing policy of the packet according to the service identifier of the service flow.
- the user inputs the service identifier and the processing policy to the second controller.
- the second controller receives the service identifier and the processing policy input by the user, and stores the service identifier and the processing policy input by the user in the correspondence between the service identifier and the processing policy. In the relationship.
- the second controller sends a correspondence between the service identifier and the processing policy to the switch, and the switch receives the correspondence between the service identifier and the processing policy sent by the second controller, and stores the correspondence between the service identifier and the processing policy.
- the switch obtains the processing policy of the packet from the correspondence between the service identifier and the processing policy according to the service identifier of the service flow.
- the processing policy can be any policy for processing packets, including a processing policy for discarding packets and a processing policy for performing operations other than discarding packets.
- the processing policy can be a discarding policy or a forwarding policy. , redirection policies, or bandwidth-based path control policies.
- the second controller may be an SDN controller or an OF (open flow table protocol) controller.
- the user enters the service identity 1025 and the processing policy to the second controller: normal forwarding, service identity 2049 and processing policy: drop, service identity 4097, and processing policy: redirect to low-weight path, service identity 4098, and processing policy: setting The bandwidth of the forwarding path is 100M, etc.;
- the second controller receives the service identifier 1025 input by the user and the processing policy: normal forwarding, service identifier 2049, and processing policy: discard, service identifier 4097, and processing policy: redirect to the low-weight path, Service ID 4098 and processing policy: set the bandwidth of the forwarding path to 100M, etc., and store the service identifier and processing policy input by the user in Table 2 as follows:
- the switch stores the pair of service identifiers and processing policies from Table 2 according to the service identifier 1025.
- the forwarding policy for obtaining packets in the relationship is normal forwarding.
- Step 206 The switch determines whether to send the packet according to the processing policy of the packet, if the packet is sent, step 207 is performed; if the packet is not sent, step 212 is performed;
- the processing policy of the packet is used to discard the packet, it is determined that the packet is not sent; if the processing policy of the packet is used to perform operations other than discarding the packet, it is determined to send the packet. Text.
- the processing policy of the packet may be a drop policy, a forwarding policy, a redirect policy, or a bandwidth-based path control policy. If the processing policy is a discarding policy, it is determined that the packet is not sent; if the processing policy is a forwarding policy, a redirection policy, or a bandwidth-based path control policy, it is determined to send the packet.
- Step 207 If the packet is sent, the switch determines at least one forwarding path for sending the packet according to the identifier of the first virtual machine and the identifier of the second virtual machine.
- the second controller acquires the topology of the physical network where the switch is located, and sends the topology of the physical network to the switch.
- the switch receives the topology of the physical network sent by the second controller and stores the topology of the physical network.
- the step 207 may be: if the packet is sent, the switch determines at least one forwarding path for sending the packet according to the identifier of the first virtual machine, the identifier of the second virtual machine, and the topology of the physical network.
- the at least one forwarding path for sending the packet is determined according to the identifier of the first virtual machine, the identifier of the second virtual machine, and the topology of the physical network.
- the forwarding path is not described in detail.
- the switch obtains the path weight of each forwarding path according to the path identifier of each forwarding path in the at least one forwarding path.
- the user inputs a weighting rule to the second controller, and the weighting rule may be set according to the number of forwarding entities included in the forwarding path.
- the second controller receives the weighting rule input by the user, and generates a path weight of each forwarding path in the physical network according to the weighting rule, and stores the path identifier of each forwarding path and the path weight corresponding to each forwarding path in the path identifier and In the correspondence of path weights.
- the second controller sends a correspondence between the path identifier and the path weight to the switch; the switch receives the correspondence between the path identifier and the path weight sent by the second controller, and stores the correspondence between the path identifier and the path weight.
- each piece is obtained according to the path identifier of each forwarding path in at least one forwarding path.
- the path weight of the forwarding path can be:
- the path weight of each forwarding path is obtained from the correspondence between the path identifier and the path weight according to the path identifier of each forwarding path in the at least one forwarding path.
- the weighting rule input by the user to the second controller is: the path weight of the forwarding path including the forwarding entity between 1-5 is 500, and the path weight of the forwarding path including the forwarding entity between 6-10 is 400.
- the path weight of the forwarding path including the forwarding entity between 11 and 15 is 300, and the path weight of the forwarding path including the forwarding entity between 16 and 20 is 200, and the path weight of the forwarding path including the forwarding entity is 100.
- the second controller receives the weighting rule input by the user, and the path weight corresponding to the path 1 is 100 according to the weight rule, the path weight corresponding to the path 2 is 500, the path weight corresponding to the path 3 is 200, and the path weight corresponding to the path 4 is 300.
- Etc the second controller stores path 1, path 2, path 3, and path 4 and their corresponding path weights in Table 3 below:
- the switch determines, according to the identifier of the first virtual machine and the identifier of the second virtual machine, that the three paths for sending the packet are path 1, path 2, and path 3, respectively, and according to path 1, path 2, and
- the path identifier of path 3 the path weights corresponding to path 1, path 2, and path 3 from Table 3 are 100, 500, and 200, respectively.
- Step 208 The switch selects a forwarding path from at least one forwarding path according to the processing policy of the packet.
- one forwarding path is randomly selected from at least one forwarding path.
- the redirection condition included in the processing policy of the packet is obtained, and one forwarding path that satisfies the redirection condition is selected from the at least one forwarding path. For example, if the condition of the redirection is to select the forwarding path with the highest weight, then according to the path weight of each forwarding path, select one forwarding path with the highest path weight from at least one forwarding path; if the redirection condition is to select the forwarding with the lowest weight The path selects a forwarding path with the lowest path weight from at least one forwarding path according to the path weight of each forwarding path.
- path 1 For example, if the processing strategy of the packet is to redirect to the lowest weight forwarding path, then the path with the lowest path weight selected from path 1, path 2, and path 3 is path 1.
- Step 209 The switch acquires the bandwidth of the selected forwarding path according to the processing policy of the packet.
- Each processing policy corresponds to the bandwidth of a forwarding path, and the bandwidth of the selected forwarding path is obtained according to the processing policy of the packet.
- the bandwidth corresponding to the forwarding policy and the redirection policy is the default bandwidth.
- the bandwidth corresponding to the bandwidth-based path control policy is the bandwidth included in the processing policy.
- the bandwidth corresponding to the forwarding policy and the redirection policy is 50M
- the bandwidth-based path control policy includes the bandwidth corresponding to the forwarding path being 100M.
- Step 210 The switch sets a bandwidth size of the selected forwarding path according to the acquired bandwidth.
- the switch sets the bandwidth size of the selected forwarding path to the acquired bandwidth.
- the bandwidth size of path 1 is set to 100M.
- Step 211 The switch sends the packet to the second virtual machine according to the set forwarding path.
- the switch forwards the packet to the second host where the second virtual machine is located according to the set forwarding path, and the second host receives the packet sent by the switch, decapsulates the packet, and obtains the second virtual machine.
- the identifier and the service flow are sent to the second virtual machine according to the identifier of the second virtual machine.
- Step 212 If the packet is not sent, the switch discards the packet.
- the switch does not send the packet and discards the packet.
- the packet sent by the first host where the first virtual machine is located is received, and the packet carries the service identifier of the service flow, and the service identifier of the service flow is set and encapsulated by the first host according to the destination address of the service flow. If the packet is sent, the packet is sent to the second virtual machine according to the processing policy. The packet carries the service identifier of the service flow, so that the packet can be controlled according to the service identifier of the service flow.
- An embodiment of the present invention provides an apparatus for transmitting a message.
- the apparatus includes:
- the first receiving module 301 is configured to receive a packet sent by the first host where the first virtual machine is located, where the packet carries the service identifier of the service flow, and the service identifier of the service flow is the destination of the first host according to the service flow. Address is set and encapsulated in the message;
- the first obtaining module 302 is configured to obtain a processing policy of the packet according to the service identifier of the service flow.
- a determining module 303 configured to determine whether to send a message according to the processing policy
- the first sending module 304 is configured to send the packet to the second virtual machine according to the processing policy if the packet is sent.
- the first obtaining module 302 is configured to obtain a processing policy of the packet from the correspondence between the service identifier and the processing policy according to the service identifier of the service flow.
- the determining module 303 includes:
- a first determining unit configured to determine that the packet is not sent if the processing policy is used to discard the packet
- a second determining unit configured to determine to send the message if the processing policy is used to perform operations other than discarding the message.
- the first sending module 304 includes:
- a third determining unit configured to determine, according to the identifier of the first virtual machine and the identifier of the second virtual machine, at least one forwarding path for sending the packet
- a selecting unit configured to select a forwarding path from the at least one forwarding path according to the processing policy
- An obtaining unit configured to obtain a bandwidth of the selected forwarding path according to the processing policy
- a setting unit configured to set a bandwidth size of the selected forwarding path according to the acquired bandwidth
- the sending unit is configured to send the packet to the second virtual machine according to the set forwarding path.
- the packet sent by the first host where the first virtual machine is located is received, and the packet carries the service identifier of the service flow, and the service identifier of the service flow is set and encapsulated by the first host according to the destination address of the service flow. If the packet is sent, the packet is sent to the second virtual machine according to the processing policy. The packet carries the service identifier of the service flow, so that the packet can be controlled according to the service identifier of the service flow.
- An embodiment of the present invention provides an apparatus for transmitting a message.
- the apparatus includes:
- the second receiving module 401 is configured to receive a service flow sent by the first virtual machine, where the service flow carries a destination address of the service flow;
- the second obtaining module 402 is configured to obtain a service identifier of the service flow according to the destination address of the service flow.
- the second sending module 403 is configured to encapsulate the service identifier of the service flow into the packet, and send the packet to the switch.
- the packet is sent, so that the switch obtains the packet processing policy according to the service identifier of the service flow, and determines whether to send the packet according to the processing policy. If the packet is sent, the packet is sent to the second virtual machine according to the processing policy.
- the second obtaining module 402 is configured to obtain the service identifier of the service flow from the correspondence between the destination address and the service identifier according to the destination address of the service flow.
- the packet sent by the first host where the first virtual machine is located is received, and the packet carries the service identifier of the service flow, and the service identifier of the service flow is set and encapsulated by the first host according to the destination address of the service flow. If the packet is sent, the packet is sent to the second virtual machine according to the processing policy. The packet carries the service identifier of the service flow, so that the packet can be controlled according to the service identifier of the service flow.
- An embodiment of the present invention provides an apparatus for transmitting a message.
- the apparatus includes: a first memory 501 and a first processor 502, configured to perform the following method of sending a message:
- the packet is sent to the second virtual machine according to the processing policy.
- the processing policy for obtaining the packet according to the service identifier of the service flow includes:
- the determining, according to the processing policy, whether to send the packet includes:
- processing policy is used to perform operations other than discarding the message, it is determined to send the message.
- the sending the packet to the second virtual machine according to the processing policy includes:
- the packet sent by the first host where the first virtual machine is located is received, and the packet carries the service identifier of the service flow, and the service identifier of the service flow is set and encapsulated by the first host according to the destination address of the service flow. If the packet is sent, the packet is sent to the second virtual machine according to the processing policy. The packet carries the service identifier of the service flow, so that the packet can be controlled according to the service identifier of the service flow.
- An embodiment of the present invention provides an apparatus for transmitting a message.
- the apparatus includes: a second memory 601 and a second processor 602, configured to perform the following method of sending a message:
- the obtaining the service identifier of the service flow according to the destination address of the service flow includes:
- the packet sent by the first host where the first virtual machine is located is received, and the packet carries the service identifier of the service flow, and the service identifier of the service flow is set and encapsulated by the first host according to the destination address of the service flow. If the packet is sent, the packet is sent to the second virtual machine according to the processing policy. The packet carries the service identifier of the service flow, so that the packet can be controlled according to the service identifier of the service flow.
- the device that sends the packet is sent by the foregoing embodiment, only the division of each functional module is used as an example. In an actual application, the function may be allocated by different functional modules according to requirements. Upon completion, the internal structure of the device is divided into different functional modules to perform all or part of the functions described above.
- the apparatus for sending a message and the method for sending a message provided by the foregoing embodiment are in the same concept, and the specific implementation process is described in the method embodiment, and details are not described herein again.
- a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
- the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明公开了一种发送报文的方法和装置,属于通信技术领域。该方法包括:接收第一虚拟机所在的第一主机发送的报文,所述报文携带业务流的业务标识,所述业务流的业务标识为所述第一主机根据所述业务流的目的地址设置并封装到所述报文中的;根据所述业务流的业务标识,获取所述报文的处理策略;根据所述处理策略,确定是否发送所述报文;如果发送所述报文,则根据所述处理策略,将所述报文发送给第二虚拟机。该装置包括:第一接收模块,第一获取模块,确定模块和第一发送模块。本发明中由于报文中携带业务流的业务标识,从而能够根据业务流的业务标识对报文进行策略控制。
Description
本申请要求于2014年12月31日提交中国专利局、申请号为201410855294.6、发明名称为“一种发送报文的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及通信技术领域,特别涉及一种发送报文的方法和装置。
随着虚拟机化技术和云处理技术的快速发展,云存储中的每个主机上都会部署多台虚拟机,并且部署在不同主机上的两个虚拟机之间可以进行业务交互。当部署在第一主机上的第一虚拟机与部署在第二主机上的第二虚拟机之间进行业务交互时,第一虚拟机可以向第二虚拟机发送报文,以实现第一虚拟机和第二虚拟机之间的通信。
当第一虚拟机向第二虚拟机发送报文时,第一虚拟机向第一虚拟机所在的第一主机发送http(Hypertext transfer protocol,超文本传送协议)请求,该http请求携带第二虚拟机的地址;第一主机将该http请求封装为UDP(User Datagram Protocol,用户数据包协议)报文,并将该UDP报文发送给交换机;交换机根据第二虚拟机的地址计算该UDP报文的转发路径,根据该UDP报文的转发路径向第二虚拟机发送该报文。
在实现本发明的过程中,发明人发现现有技术至少存在以下问题:
由于交换机无法感知UDP报文的业务,无法对该UDP报文进行带宽监控和路径控制。
发明内容
为了使解决现有技术的问题,本发明提供了一种发送报文的方法和装置。技术方案如下:
第一方面,本发明提供了一种发送报文的方法,所述方法包括:
接收第一虚拟机所在的第一主机发送的报文,所述报文携带业务流的业务标识,所述业务流的业务标识为所述第一主机根据所述业务流的目的地址设置
并封装到所述报文中的;
根据所述业务流的业务标识,获取所述报文的处理策略;
根据所述处理策略,确定是否发送所述报文;
如果发送所述报文,则根据所述处理策略,将所述报文发送给第二虚拟机。
结合第一方面,在第一方面的第一种可能的实现方式中,所述根据所述业务流的业务标识,获取所述报文的处理策略,包括:
根据所述业务流的业务标识,从业务标识和处理策略的对应关系中获取所述报文的处理策略。
结合第一方面,在第一方面的第二种可能的实现方式中,所述根据所述处理策略,确定是否发送所述报文,包括:
如果所述处理策略用于丢弃所述报文,则确定不发送所述报文;
如果所述处理策略用于对所述报文执行除丢弃以外的其他操作,则确定发送所述报文。
结合第一方面,在第一方面的第三种可能的实现方式中,所述根据所述处理策略,将所述报文发送给第二虚拟机,包括:
根据第一虚拟机的标识和第二虚拟机的标识,确定用于发送所述报文的至少一条转发路径;
根据所述处理策略,从所述至少一条转发路径中选择转发路径;
根据所述处理策略,获取所述选择的转发路径的带宽;
根据所述获取的带宽,设置所述选择的转发路径的带宽大小;
根据所述设置后的转发路径,将所述报文发送给所述第二虚拟机。
第二方面,本发明提供了一种发送报文的方法,所述方法包括:
接收第一虚拟机发送的业务流,所述业务流携带所述业务流的目的地址;
根据所述业务流的目的地址,获取所述业务流的业务标识;
将所述业务流的业务标识封装到报文中,向交换机发送所述报文,使所述交换机根据所述业务流的业务标识获取所述报文的处理策略,并根据所述处理策略确定是否发送所述报文,如果发送所述报文,根据所述处理策略将所述报文发送给第二虚拟机。
结合第二方面,在第二方面的第一种可能的实现方式中,所述根据所述业务流的目的地址,获取所述业务流的业务标识,包括:
根据所述业务流的目的地址,从目的地址和业务标识的对应关系中获取所述业务流的业务标识。
第三方面,本发明提供了一种发送报文的装置,所述装置包括:
第一接收模块,用于接收第一虚拟机所在的第一主机发送的报文,所述报文携带业务流的业务标识,所述业务流的业务标识为所述第一主机根据所述业务流的目的地址设置并封装到所述报文中的;
第一获取模块,用于根据所述业务流的业务标识,获取所述报文的处理策略;
确定模块,用于根据所述处理策略,确定是否发送所述报文;
第一发送模块,用于如果发送所述报文,则根据所述处理策略,将所述报文发送给第二虚拟机。
结合第三方面,在第三方面第一种可能的实现方式中,所述第一获取模块,用于根据所述业务流的业务标识,从业务标识和处理策略的对应关系中获取所述报文的处理策略。
结合第三方面,在第三方面第二种可能的实现方式中,所述确定模块,包括:
第一确定单元,用于如果所述处理策略用于丢弃所述报文,则确定不发送所述报文;
第二确定单元,用于如果所述处理策略用于对所述报文执行除丢弃以外的其他操作,则确定发送所述报文。
结合第三方面,在第三方面第三种可能的实现方式中,第一发送模块,包括:
第三确定单元,用于根据第一虚拟机的标识和第二虚拟机的标识,确定用于发送所述报文的至少一条转发路径;
选择单元,用于根据所述处理策略,从所述至少一条转发路径中选择转发路径;
获取单元,用于根据所述处理策略,获取所述选择的转发路径的带宽;
设置单元,用于根据所述获取的带宽,设置所述选择的转发路径的带宽大小;
发送单元,用于根据所述设置后的转发路径,将所述报文发送给所述第二
虚拟机。
第四方面,本发明提供了一种发送报文的装置,所述装置包括:
第二接收模块,用于接收第一虚拟机发送的业务流,所述业务流携带所述业务流的目的地址;
第二获取模块,用于根据所述业务流的目的地址,获取所述业务流的业务标识;
第二发送模块,用于将所述业务流的业务标识封装到报文中,向交换机发送所述报文,使所述交换机根据所述业务流的业务标识获取所述报文的处理策略,并根据所述处理策略确定是否发送所述报文,如果发送所述报文,根据所述处理策略将所述报文发送给第二虚拟机。
结合第四方面,在第四方面的第一种可能的实现方式中,所述第二获取模块,用于根据所述业务流的目的地址,从目的地址和业务标识的对应关系中获取所述业务流的业务标识。
第五方面,本发明提供了一种发送报文的装置,所述装置包括:第一存储器和第一处理器,用于执行如第一方面所述的发送报文的方法。
第六方面,本发明提供了一种发送报文的装置,所述装置包括:第二存储器和第二处理器,用于执行如第二方面所述的发送报文的方法。
在本发明中,接收第一虚拟机所在的第一主机发送的报文,该报文携带业务流的业务标识,业务流的业务标识为第一主机根据业务流的目的地址设置并封装到报文中的;根据业务流的业务标识,获取报文的处理策略;根据处理策略,确定是否发送报文;如果发送报文,则根据处理策略,将报文发送给第二虚拟机。由于报文中携带业务流的业务标识,从而能够根据业务流的业务标识对报文进行策略控制。
图1-1是本发明实施例1提供的一种发送报文的方法流程图;
图1-2是本发明实施例1提供的另一种发送报文的方法流程图;
图2是本发明实施例2提供的一种发送报文的方法流程图;
图3是本发明实施例3提供的一种发送报文的装置结构示意图;
图4是本发明实施例4提供的一种发送报文的装置结构示意图;
图5是本发明实施例5提供的一种发送报文的装置结构示意图;
图6是本发明实施例6提供的一种发送报文的装置结构示意图。
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。
实施例1
本发明实施例提供了一种发送报文的方法,参见图1-1,其中,该方法包括:
步骤101a:接收第一虚拟机所在的第一主机发送的报文,该报文携带业务流的业务标识,业务流的业务标识为第一主机根据业务流的目的地址设置并封装到报文中的;
步骤102a:根据业务流的业务标识,获取报文的处理策略;
步骤103a:根据处理策略,确定是否发送报文;
步骤104a:如果发送报文,则根据处理策略,将报文发送给第二虚拟机。
本发明实施例提供了一种发送报文的方法,参见图1-2,其中,该方法包括:
步骤101b:接收第一虚拟机发送的业务流,该业务流携带业务流的目的地址;
步骤102b:根据业务流的目的地址,获取业务流的业务标识;
步骤103b:将业务流的业务标识封装到报文中,向交换机发送报文,使交换机根据业务流的业务标识获取报文的处理策略,并根据处理策略确定是否发送报文,如果发送报文,根据处理策略将报文发送给第二虚拟机。
在本发明中,接收第一虚拟机所在的第一主机发送的报文,该报文携带业务流的业务标识,业务流的业务标识为第一主机根据业务流的目的地址设置并封装到报文中的;根据业务流的业务标识,获取报文的处理策略;根据处理策略,确定是否发送报文;如果发送报文,则根据处理策略,将报文发送给第二
虚拟机。由于报文中携带业务流的业务标识,从而能够根据业务流的业务标识对报文进行策略控制。
实施例2
本发明实施例提供了一种发送报文的方法,参见图2,其中,该方法包括:
步骤201:第一主机接收第一虚拟机发送的业务流,该业务流携带业务流的目的地址;
第一虚拟机部署在第一主机上,第二虚拟机部署在第二主机上;当第一虚拟机向第二虚拟机发送业务流时,第一虚拟机首先向第一虚拟机所在的第一主机发送业务流,该业务流至少携带业务流的目的地址,还可以携带第一虚拟机的标识和第二虚拟机的标识;第一主机接收第一虚拟机发送的业务流,执行步骤202。
目的地址可以为目的IP(Internet Protocol, 网络之间互连的协议)地址、目的端口或者目的MAC(Media Access Control,介质访问控制)地址等。第一虚拟机的标识可以为第一虚拟机的IP地址、第一虚拟机的名称或者第一虚拟机的编号等;同样,第二虚拟机的标识可以为第二虚拟机的IP地址、第二虚拟机的名称或者第二虚拟机的编号等。
例如,以目的地址为目的端口80,第一虚拟机的标识为192.231.31.252,第二虚拟机的标识为192.231.31.251为例进行说明,第一虚拟机向第一主机发送业务流,该业务流携带目的端口80,第一虚拟机的标识192.231.31.252和第二虚拟机的标识192.231.31.251。第一主机接收第一虚拟机发送的该业务流。
步骤202:第一主机根据业务流的目的地址,获取业务流的业务标识;
在本步骤之前,用户向第一控制器输入目的地址和业务标识;第一控制器接收用户输入的目的地址和业务标识,将用户输入的目的地址和业务标识存储在目的地址和业务标识的对应关系中。
第一控制器向第一主机发送目的地址和业务标识的对应关系,第一主机接收第一控制器发送的目的地址和业务标识的对应关系,并存储目的地址和业务标识的对应关系。
相应的,步骤202可以为:第一主机根据业务流的目的地址,从目的地址和业务标识的对应关系中获取业务流的业务标识。
第一控制器可以为SDN(Software Defined Network,软件定义网络)控制器或者VxLAN(Virtual eXtension xLAN,虚拟扩展VLAN协议)控制器等。
例如,用户向第一控制器输入目的地址80和业务标识1025,目的地址443和业务标识2049,目的地址5000和业务标识4097以及目的地址5001和业务标识4098;第一控制器接收用户输入的目的地址80和业务标识1025,目的地址443和业务标识2049,目的地址5000和业务标识4097以及目的地址5001和业务标识4098,将用户输入的目的地址和业务标识存储在如下表1中:
表1
目的地址 | 业务标识 |
80 | 1025 |
443 | 2049 |
5000 | 4097 |
5001 | 4098 |
例如,第一主机根据业务流的目的地址80,从表1存储的目的地址和业务标识的对应关系中获取业务流的业务标识为1025。
其中,业务标识字段范围是65535,一台主机上可以部署50台虚拟机。对于每个虚拟机对应的业务标识字段范围为1-1024,也即每台虚拟机最多可以定义1024个业务标识,用于对不同的业务进行策略控制。
步骤203:第一主机将业务流的业务标识封装到报文中,向交换机发送报文;
其中,报文包括内层报文和外层报文,本步骤中第一主机将业务流的业务标识封装到外层报文中。
其中,外层报文中还包括源MAC、目的MAC、VLAN、源IP、目的IP、VxLAN端口、VxLAN头等,第一主机获取该业务流的源MAC、目的MAC、VLAN、源IP、目的IP、VxLAN端口、VxLAN头,将该业务流的源MAC、目的MAC、VLAN、源IP、目的IP、VxLAN端口、VxLAN头和报文的业务标识同时封装到外层报文中。
其中,内层报文包括源MAC、目的MAC和业务流,第一主机获取该业务流的源MAC、目的MAC和业务流,将该业务流的源MAC、目的MAC和业务流封装到内层报文中。
步骤204:交换机接收第一主机发送的报文,该报文携带该业务流的业务标识;
交换机接收第一主机发送的报文,解析该报文的外层报文得到该业务流的业务标识,执行步骤205。
需要说明的是,交换机只能解析报文的外层报文,并不能解析报文的内层报文。
步骤205:交换机根据业务流的业务标识,获取该报文的处理策略;
在本步骤之前,用户向第二控制器输入业务标识和处理策略;第二控制器接收用户输入的业务标识和处理策略,将用户输入的业务标识和处理策略存储在业务标识和处理策略的对应关系中。
第二控制器向交换机发送业务标识和处理策略的对应关系,交换机接收第二控制器发送的业务标识和处理策略的对应关系,并存储业务标识和处理策略的对应关系。
相应的,步骤205可以为:交换机根据业务流的业务标识,从业务标识和处理策略的对应关系中获取该报文的处理策略。
处理策略可以为任一对报文进行处理的策略,包括用于丢弃报文的处理策略和用于对报文执行除丢弃以外的其他操作的处理策略;例如处理策略可以为丢弃策略、转发策略、重定向策略或者基于带宽的路径控制策略等。
第二控制器可以为SDN控制器或者OF(openflow,开放流表协议)控制器。
例如,用户向第二控制器输入业务标识1025和处理策略:正常转发,业务标识2049和处理策略:丢弃,业务标识4097和处理策略:重定向到低权重路径,业务标识4098和处理策略:设置转发路径的带宽大小为100M等;第二控制器接收用户输入的业务标识1025和处理策略:正常转发,业务标识2049和处理策略:丢弃,业务标识4097和处理策略:重定向到低权重路径,业务标识4098和处理策略:设置转发路径的带宽大小为100M等,将用户输入的业务标识和处理策略存储在如下表2中:
表2
业务标识 | 处理策略 |
1025 | 正常转发 |
2049 | 丢弃 |
4097 | 重定向到低权重路径 |
4098 | 设置转发路径的带宽大小为100M |
例如,交换机根据业务标识1025,从表2存储的业务标识和处理策略的对
应关系中获取报文的转发策略为正常转发。
步骤206:交换机根据该报文的处理策略,确定是否发送该报文,如果发送该报文,执行步骤207;如果不发送该报文,执行步骤212;
具体地,如果该报文的处理策略用于丢弃该报文,则确定不发送该报文;如果该报文的处理策略用于对报文执行除丢弃以外的其他操作,则确定发送该报文。
例如,该报文的处理策略可以为丢弃策略、转发策略、重定向策略或者基于带宽的路径控制策略等。则如果处理策略为丢弃策略,则确定不发送该报文;如果处理策略为转发策略、重定向策略或者基于带宽的路径控制策略,则确定发送该报文。
步骤207:如果发送该报文,则交换机根据第一虚拟机的标识和第二虚拟机的标识,确定用于发送该报文的至少一条转发路径;
在本步骤之前,第二控制器获取交换机所在的物理网络的拓扑结构,向交换机发送物理网络的拓扑结构,交换机接收第二控制器发送的物理网络的拓扑结构,并存储物理网络的拓扑结构。
相应的,步骤207可以为:如果发送该报文,则交换机根据第一虚拟机的标识、第二虚拟机的标识以及物理网络的拓扑结构,确定用于发送该报文的至少一条转发路径。
根据第一虚拟机的标识、第二虚拟机的标识以及物理网络的拓扑结构,确定用于发送该报文的至少一条转发路径为现有技术,在此不再详细说明。
进一步地,交换机根据至少一条转发路径中的每条转发路径的路径标识,获取每条转发路径的路径权重。
在本步骤之前,用户向第二控制器输入权重规则,该权重规则可以为根据转发路径包括的转发实体的数量进行设置。第二控制器接收用户输入的权重规则,并根据权重规则生成物理网络中的每条转发路径的路径权重,将每条转发路径的路径标识和每条转发路径对应的路径权重存储在路径标识和路径权重的对应关系中。
第二控制器向交换机发送路径标识和路径权重的对应关系;交换机接收第二控制器发送的路径标识和路径权重的对应关系,并存储路径标识和路径权重的对应关系。
相应的,根据至少一条转发路径中的每条转发路径的路径标识,获取每条
转发路径的路径权重,可以为:
根据至少一条转发路径中的每条转发路径的路径标识,从路径标识和路径权重的对应关系中获取每条转发路径的路径权重。
例如,用户向第二控制器输入的权重规则为:包括转发实体在1-5之间的转发路径的路径权重为500,包括转发实体在6-10之间的转发路径的路径权重为400,包括转发实体在11-15之间的转发路径的路径权重为300,包括转发实体在16-20之间的转发路径的路径权重为200,包括转发实体大于的转发路径的路径权重为100。第二控制器接收用户输入的权重规则,根据权重规则生成路径1对应的路径权重为100,路径2对应的路径权重为500,路径3对应的路径权重为200,路径4对应的路径权重为300等;第二控制器将路径1、路径2、路径3和路径4及其对应的路径权重存储在如下表3中:
表3
路径标识 | 路径权重 |
1 | 100 |
2 | 500 |
3 | 200 |
4 | 300 |
例如,交换机根据第一虚拟机的标识和第二虚拟机的标识,确定出用于发送该报文的3条路径分别为路径1,路径2和路径3;并且,根据路径1、路径2和路径3的路径标识,从表3中获取路径1、路径2和路径3对应的路径权重分别为100、500和200。
步骤208:交换机根据该报文的处理策略,从至少一条转发路径中选择转发路径;
如果该报文的处理策略为转发策略或者基于带宽的路径控制策略,则从至少一条转发路径中随机选择一条转发路径。
如果该报文的处理策略为重定向,则获取该报文的处理策略中包括的重定向条件,从至少一条转发路径中选择一个满足重定向条件的一条转发路径。例如,重定向的条件为选择最高权重的转发路径,则根据每条转发路径的路径权重,从至少一条转发路径中选择一个路径权重最高的转发路径;如果重定向的条件为选择最低权重的转发路径,则根据每条转发路径的路径权重,从至少一条转发路径中选择一个路径权重最低的转发路径。
例如,报文的处理策略为重定向到最低权重的转发路径上,则从路径1、路径2和路径3中选择一个路径权重最低的转发路径为路径1。
步骤209:交换机根据该报文的处理策略,获取选择的转发路径的带宽;
每种处理策略对应一个转发路径的带宽大小,根据该报文的处理策略,获取选择的转发路径的带宽大小。
其中,转发策略和重定向策略对应的带宽大小为默认的带宽大小;基于带宽的路径控制策略对应的带宽大小为处理策略中包括的带宽大小。
例如,默认的带宽大小为50M,则转发策略和重定向策略对应的带宽大小为50M,;基于带宽的路径控制策略中包括转发路径对应的带宽为100M。
步骤210:交换机根据获取的带宽,设置选择的转发路径的带宽大小;
具体地,交换机将选择的转发路径的带宽大小设置为获取的带宽。
例如,选择的转发路径为路径1,获取的带宽为100M,则将路径1的带宽大小设置为100M。
步骤211:交换机根据设置后的转发路径,将报文发送给第二虚拟机。
具体地,交换机根据设置后的转发路径,将报文转发给第二虚拟机所在的第二主机,第二主机接收交换机发送的该报文,将该报文进行解封装,得到第二虚拟机的标识和业务流,根据第二虚拟机的标识,将该业务流发送给第二虚拟机。
步骤212:如果不发送该报文,则交换机将该报文丢弃。
如果处理策略为丢弃策略,则交换机不发送给报文,直接将该报文丢弃。
在本发明中,接收第一虚拟机所在的第一主机发送的报文,该报文携带业务流的业务标识,业务流的业务标识为第一主机根据业务流的目的地址设置并封装到报文中的;根据业务流的业务标识,获取报文的处理策略;根据处理策略,确定是否发送报文;如果发送报文,则根据处理策略,将报文发送给第二虚拟机。由于报文中携带业务流的业务标识,从而能够根据业务流的业务标识对报文进行策略控制。
实施例3
本发明实施例提供了一种发送报文的装置,参见图3,该装置包括:
第一接收模块301,用于接收第一虚拟机所在的第一主机发送的报文,报文携带业务流的业务标识,业务流的业务标识为第一主机根据业务流的目的地
址设置并封装到报文中的;
第一获取模块302,用于根据业务流的业务标识,获取报文的处理策略;
确定模块303,用于根据处理策略,确定是否发送报文;
第一发送模块304,用于如果发送报文,则根据处理策略,将报文发送给第二虚拟机。
优选的,第一获取模块302,用于根据业务流的业务标识,从业务标识和处理策略的对应关系中获取报文的处理策略。
优选的,确定模块303,包括:
第一确定单元,用于如果处理策略用于丢弃报文,则确定不发送报文;
第二确定单元,用于如果处理策略用于对报文执行除丢弃以外的其他操作,则确定发送报文。
优选的,第一发送模块304,包括:
第三确定单元,用于根据第一虚拟机的标识和第二虚拟机的标识,确定用于发送报文的至少一条转发路径;
选择单元,用于根据处理策略,从至少一条转发路径中选择转发路径;
获取单元,用于根据处理策略,获取选择的转发路径的带宽;
设置单元,用于根据获取的带宽,设置选择的转发路径的带宽大小;
发送单元,用于根据设置后的转发路径,将报文发送给第二虚拟机。
在本发明中,接收第一虚拟机所在的第一主机发送的报文,该报文携带业务流的业务标识,业务流的业务标识为第一主机根据业务流的目的地址设置并封装到报文中的;根据业务流的业务标识,获取报文的处理策略;根据处理策略,确定是否发送报文;如果发送报文,则根据处理策略,将报文发送给第二虚拟机。由于报文中携带业务流的业务标识,从而能够根据业务流的业务标识对报文进行策略控制。
实施例4
本发明实施例提供了一种发送报文的装置,参见图4,该装置包括:
第二接收模块401,用于接收第一虚拟机发送的业务流,业务流携带业务流的目的地址;
第二获取模块402,用于根据业务流的目的地址,获取业务流的业务标识;
第二发送模块403,用于将业务流的业务标识封装到报文中,向交换机发
送报文,使交换机根据业务流的业务标识获取报文的处理策略,并根据处理策略确定是否发送报文,如果发送报文,根据处理策略将报文发送给第二虚拟机。
优选的,第二获取模块402,用于根据业务流的目的地址,从目的地址和业务标识的对应关系中获取业务流的业务标识。
在本发明中,接收第一虚拟机所在的第一主机发送的报文,该报文携带业务流的业务标识,业务流的业务标识为第一主机根据业务流的目的地址设置并封装到报文中的;根据业务流的业务标识,获取报文的处理策略;根据处理策略,确定是否发送报文;如果发送报文,则根据处理策略,将报文发送给第二虚拟机。由于报文中携带业务流的业务标识,从而能够根据业务流的业务标识对报文进行策略控制。
实施例5
本发明实施例提供了一种发送报文的装置,参见图5,该装置包括:第一存储器501和第一处理器502,用于执行如下发送报文的方法:
接收第一虚拟机所在的第一主机发送的报文,所述报文携带业务流的业务标识,所述业务流的业务标识为所述第一主机根据所述业务流的目的地址设置并封装到所述报文中的;
根据所述业务流的业务标识,获取所述报文的处理策略;
根据所述处理策略,确定是否发送所述报文;
如果发送所述报文,则根据所述处理策略,将所述报文发送给第二虚拟机。
优选的,所述根据所述业务流的业务标识,获取所述报文的处理策略,包括:
根据所述业务流的业务标识,从业务标识和处理策略的对应关系中获取所述报文的处理策略。
优选的,所述根据所述处理策略,确定是否发送所述报文,包括:
如果所述处理策略用于丢弃所述报文,则确定不发送所述报文;
如果所述处理策略用于对所述报文执行除丢弃以外的其他操作,则确定发送所述报文。
优选的,所述根据所述处理策略,将所述报文发送给第二虚拟机,包括:
根据第一虚拟机的标识和第二虚拟机的标识,确定用于发送所述报文的至少一条转发路径;
根据所述处理策略,从所述至少一条转发路径中选择转发路径;
根据所述处理策略,获取所述选择的转发路径的带宽;
根据所述获取的带宽,设置所述选择的转发路径的带宽大小;
根据所述设置后的转发路径,将所述报文发送给所述第二虚拟机。
在本发明中,接收第一虚拟机所在的第一主机发送的报文,该报文携带业务流的业务标识,业务流的业务标识为第一主机根据业务流的目的地址设置并封装到报文中的;根据业务流的业务标识,获取报文的处理策略;根据处理策略,确定是否发送报文;如果发送报文,则根据处理策略,将报文发送给第二虚拟机。由于报文中携带业务流的业务标识,从而能够根据业务流的业务标识对报文进行策略控制。
实施例6
本发明实施例提供了一种发送报文的装置,参见图6,该装置包括:第二存储器601和第二处理器602,用于执行如下发送报文的方法:
接收第一虚拟机发送的业务流,所述业务流携带所述业务流的目的地址;
根据所述业务流的目的地址,获取所述业务流的业务标识;
将所述业务流的业务标识封装到报文中,向交换机发送所述报文,使所述交换机根据所述业务流的业务标识获取所述报文的处理策略,并根据所述处理策略确定是否发送所述报文,如果发送所述报文,根据所述处理策略将所述报文发送给第二虚拟机。
优选的,所述根据所述业务流的目的地址,获取所述业务流的业务标识,包括:
根据所述业务流的目的地址,从目的地址和业务标识的对应关系中获取所述业务流的业务标识。
在本发明中,接收第一虚拟机所在的第一主机发送的报文,该报文携带业务流的业务标识,业务流的业务标识为第一主机根据业务流的目的地址设置并封装到报文中的;根据业务流的业务标识,获取报文的处理策略;根据处理策略,确定是否发送报文;如果发送报文,则根据处理策略,将报文发送给第二虚拟机。由于报文中携带业务流的业务标识,从而能够根据业务流的业务标识对报文进行策略控制。
需要说明的是:上述实施例提供的发送报文的装置在发送报文时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的发送报文的装置与发送报文的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
Claims (14)
- 一种发送报文的方法,其特征在于,所述方法包括:接收第一虚拟机所在的第一主机发送的报文,所述报文携带业务流的业务标识,所述业务流的业务标识为所述第一主机根据所述业务流的目的地址设置并封装到所述报文中的;根据所述业务流的业务标识,获取所述报文的处理策略;根据所述处理策略,确定是否发送所述报文;如果发送所述报文,则根据所述处理策略,将所述报文发送给第二虚拟机。
- 如权利要求1所述的方法,其特征在于,所述根据所述业务流的业务标识,获取所述报文的处理策略,包括:根据所述业务流的业务标识,从业务标识和处理策略的对应关系中获取所述报文的处理策略。
- 如权利要求1所述的方法,其特征在于,所述根据所述处理策略,确定是否发送所述报文,包括:如果所述处理策略用于丢弃所述报文,则确定不发送所述报文;如果所述处理策略用于对所述报文执行除丢弃以外的其他操作,则确定发送所述报文。
- 如权利要求1所述的方法,其特征在于,所述根据所述处理策略,将所述报文发送给第二虚拟机,包括:根据第一虚拟机的标识和第二虚拟机的标识,确定用于发送所述报文的至少一条转发路径;根据所述处理策略,从所述至少一条转发路径中选择转发路径;根据所述处理策略,获取所述选择的转发路径的带宽;根据所述获取的带宽,设置所述选择的转发路径的带宽大小;根据所述设置后的转发路径,将所述报文发送给所述第二虚拟机。
- 一种发送报文的方法,其特征在于,所述方法包括:接收第一虚拟机发送的业务流,所述业务流携带所述业务流的目的地址;根据所述业务流的目的地址,获取所述业务流的业务标识;将所述业务流的业务标识封装到报文中,向交换机发送所述报文,使所述交换机根据所述业务流的业务标识获取所述报文的处理策略,并根据所述处理策略确定是否发送所述报文,如果发送所述报文,根据所述处理策略将所述报文发送给第二虚拟机。
- 如权利要求5所述的方法,其特征在于,所述根据所述业务流的目的地址,获取所述业务流的业务标识,包括:根据所述业务流的目的地址,从目的地址和业务标识的对应关系中获取所述业务流的业务标识。
- 一种发送报文的装置,其特征在于,所述装置包括:第一接收模块,用于接收第一虚拟机所在的第一主机发送的报文,所述报文携带业务流的业务标识,所述业务流的业务标识为所述第一主机根据所述业务流的目的地址设置并封装到所述报文中的;第一获取模块,用于根据所述业务流的业务标识,获取所述报文的处理策略;确定模块,用于根据所述处理策略,确定是否发送所述报文;第一发送模块,用于如果发送所述报文,则根据所述处理策略,将所述报文发送给第二虚拟机。
- 如权利要求7所述的装置,其特征在于,所述第一获取模块,用于根据所述业务流的业务标识,从业务标识和处理策略的对应关系中获取所述报文的处理策略。
- 如权利要求7所述的装置,其特征在于,所述确定模块,包括:第一确定单元,用于如果所述处理策略用于丢弃所述报文,则确定不发送所述报文;第二确定单元,用于如果所述处理策略用于对所述报文执行除丢弃以外的其他操作,则确定发送所述报文。
- 如权利要求7所述的装置,其特征在于,第一发送模块,包括:第三确定单元,用于根据第一虚拟机的标识和第二虚拟机的标识,确定用于发送所述报文的至少一条转发路径;选择单元,用于根据所述处理策略,从所述至少一条转发路径中选择转发路径;获取单元,用于根据所述处理策略,获取所述选择的转发路径的带宽;设置单元,用于根据所述获取的带宽,设置所述选择的转发路径的带宽大小;发送单元,用于根据所述设置后的转发路径,将所述报文发送给所述第二虚拟机。
- 一种发送报文的装置,其特征在于,所述装置包括:第二接收模块,用于接收第一虚拟机发送的业务流,所述业务流携带所述业务流的目的地址;第二获取模块,用于根据所述业务流的目的地址,获取所述业务流的业务标识;第二发送模块,用于将所述业务流的业务标识封装到报文中,向交换机发送所述报文,使所述交换机根据所述业务流的业务标识获取所述报文的处理策略,并根据所述处理策略确定是否发送所述报文,如果发送所述报文,根据所述处理策略将所述报文发送给第二虚拟机。
- 如权利要求11所述的装置,其特征在于,所述第二获取模块,用于根据所述业务流的目的地址,从目的地址和业务标识的对应关系中获取所述业务流的业务标识。
- 一种发送报文的装置,其特征在于,所述装置包括:第一存储器和第一处理器,用于执行如权利要求1-4任一权利要求所述的发送报文的方法。
- 一种发送报文的装置,其特征在于,所述装置包括:第二存储器和第二处理器,用于执行如权利要求5或6所述的发送报文的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410855294.6 | 2014-12-31 | ||
CN201410855294.6A CN104601467B (zh) | 2014-12-31 | 2014-12-31 | 一种发送报文的方法和装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016107379A1 true WO2016107379A1 (zh) | 2016-07-07 |
Family
ID=53126985
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2015/096687 WO2016107379A1 (zh) | 2014-12-31 | 2015-12-08 | 一种发送报文的方法和装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN104601467B (zh) |
WO (1) | WO2016107379A1 (zh) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220329527A1 (en) * | 2021-04-09 | 2022-10-13 | Microsoft Technology Licensing, Llc | Architectures for disaggregating sdn from the host |
US11588740B2 (en) | 2021-04-09 | 2023-02-21 | Microsoft Technology Licensing, Llc | Scaling host policy via distribution |
CN116055423A (zh) * | 2022-12-26 | 2023-05-02 | 南京中孚信息技术有限公司 | 一种基于策略控制的流量并行分发装置 |
US11799785B2 (en) | 2021-04-09 | 2023-10-24 | Microsoft Technology Licensing, Llc | Hardware-based packet flow processing |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3799355B1 (en) | 2015-10-22 | 2025-04-23 | Huawei Technologies Co., Ltd. | Service processing method, apparatus, and system |
CN106789757B (zh) * | 2016-03-29 | 2020-10-13 | 新华三技术有限公司 | 一种访问控制方法及装置 |
CN105791304B (zh) * | 2016-03-31 | 2019-08-27 | 联想(北京)有限公司 | 一种报文处理方法及设备 |
CN107395786B (zh) * | 2017-08-09 | 2020-12-04 | 杭州迪普科技股份有限公司 | 一种arp表项的索引方法及装置 |
CN110768884B (zh) | 2018-07-25 | 2021-10-15 | 华为技术有限公司 | Vxlan报文封装及策略执行方法、设备、系统 |
CN112437009B (zh) * | 2020-11-27 | 2022-07-01 | 网络通信与安全紫金山实验室 | SRv6端到端流策略的方法、路由器、路由系统和存储介质 |
CN114020970A (zh) * | 2021-11-04 | 2022-02-08 | 北京天融信网络安全技术有限公司 | 一种查询方法、装置、存储介质及电子设备 |
CN115834472B (zh) * | 2022-10-17 | 2024-07-19 | 北京奇艺世纪科技有限公司 | 一种报文处理方法、转发策略获取方法及装置 |
CN115842792B (zh) * | 2023-02-20 | 2023-05-12 | 之江实验室 | 一种数据处理方法、装置、存储介质及电子设备 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102299929A (zh) * | 2011-09-15 | 2011-12-28 | 北京天地云箱科技有限公司 | 虚拟机的访问控制方法、系统和装置 |
CN102549977A (zh) * | 2009-09-24 | 2012-07-04 | 日本电气株式会社 | 虚拟服务器间通信识别系统和虚拟服务器间通信识别方法 |
CN102801729A (zh) * | 2012-08-13 | 2012-11-28 | 福建星网锐捷网络有限公司 | 虚拟机报文转发方法、网络交换设备及通信系统 |
CN103905383A (zh) * | 2012-12-26 | 2014-07-02 | 华为技术有限公司 | 一种数据报文转发方法、装置和系统 |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB0517304D0 (en) * | 2005-08-23 | 2005-10-05 | Netronome Systems Inc | A system and method for processing and forwarding transmitted information |
CN101127691A (zh) * | 2006-08-17 | 2008-02-20 | 王玉鹏 | 一种在网络处理器上实现的基于流的策略路由的方法 |
US8407366B2 (en) * | 2010-05-14 | 2013-03-26 | Microsoft Corporation | Interconnecting members of a virtual network |
JP5585219B2 (ja) * | 2010-06-03 | 2014-09-10 | 富士通株式会社 | スイッチング装置および仮想lan構築方法 |
CN103905309A (zh) * | 2012-12-28 | 2014-07-02 | 中国电信股份有限公司 | 虚拟机之间的数据交换方法和系统 |
CN104184676B (zh) * | 2013-05-27 | 2017-08-11 | 华为技术有限公司 | 一种数据中心网络及其流量均衡方法和控制器 |
CN103618679A (zh) * | 2013-11-25 | 2014-03-05 | 上海华为技术有限公司 | 服务质量控制方法、装置和系统 |
CN103795622B (zh) * | 2014-01-22 | 2017-02-15 | 杭州华三通信技术有限公司 | 一种报文转发方法及其装置 |
CN104158753B (zh) * | 2014-06-12 | 2017-10-24 | 南京工程学院 | 基于软件定义网络的动态流调度方法及系统 |
-
2014
- 2014-12-31 CN CN201410855294.6A patent/CN104601467B/zh active Active
-
2015
- 2015-12-08 WO PCT/CN2015/096687 patent/WO2016107379A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102549977A (zh) * | 2009-09-24 | 2012-07-04 | 日本电气株式会社 | 虚拟服务器间通信识别系统和虚拟服务器间通信识别方法 |
CN102299929A (zh) * | 2011-09-15 | 2011-12-28 | 北京天地云箱科技有限公司 | 虚拟机的访问控制方法、系统和装置 |
CN102801729A (zh) * | 2012-08-13 | 2012-11-28 | 福建星网锐捷网络有限公司 | 虚拟机报文转发方法、网络交换设备及通信系统 |
CN103905383A (zh) * | 2012-12-26 | 2014-07-02 | 华为技术有限公司 | 一种数据报文转发方法、装置和系统 |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220329527A1 (en) * | 2021-04-09 | 2022-10-13 | Microsoft Technology Licensing, Llc | Architectures for disaggregating sdn from the host |
US11588740B2 (en) | 2021-04-09 | 2023-02-21 | Microsoft Technology Licensing, Llc | Scaling host policy via distribution |
US11652749B2 (en) | 2021-04-09 | 2023-05-16 | Microsoft Technology Licensing, Llc | High availability for hardware-based packet flow processing |
US11757782B2 (en) * | 2021-04-09 | 2023-09-12 | Microsoft Technology Licensing, Llc | Architectures for disaggregating SDN from the host |
US11799785B2 (en) | 2021-04-09 | 2023-10-24 | Microsoft Technology Licensing, Llc | Hardware-based packet flow processing |
CN116055423A (zh) * | 2022-12-26 | 2023-05-02 | 南京中孚信息技术有限公司 | 一种基于策略控制的流量并行分发装置 |
Also Published As
Publication number | Publication date |
---|---|
CN104601467A (zh) | 2015-05-06 |
CN104601467B (zh) | 2018-03-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2016107379A1 (zh) | 一种发送报文的方法和装置 | |
US20220078114A1 (en) | Method and Apparatus for Providing Service for Traffic Flow | |
CN113676361B (zh) | 针对体验质量度量的按需探测 | |
EP3213480B1 (en) | Content filtering for information centric networks | |
US9167501B2 (en) | Implementing a 3G packet core in a cloud computer with openflow data and control planes | |
EP3213489B1 (en) | Content classification and content marking for information centric networks | |
CN103685009B (zh) | 数据包的处理方法、控制器及系统 | |
US8867361B2 (en) | Implementing EPC in a cloud computer with OpenFlow data plane | |
CN106559325B (zh) | 路径检测方法和装置 | |
US10148573B2 (en) | Packet processing method, node, and system | |
EP3140964B1 (en) | Implementing a 3g packet core in a cloud computer with openflow data and control planes | |
US9712649B2 (en) | CCN fragmentation gateway | |
US9509631B2 (en) | Quality of service (QoS) for information centric networks | |
US20150103827A1 (en) | Configurable Service Proxy Mapping | |
US20150334057A1 (en) | Packet forwarding | |
US10361954B2 (en) | Method and apparatus for processing modified packet | |
US10084702B2 (en) | Packet processing method and system, and device | |
CN107306215B (zh) | 一种数据处理方法、系统及节点 | |
EP3834365A1 (en) | Multicast distribution tree versioning for minimizing multicast group traffic disruption | |
WO2017021891A1 (en) | Method and system for memory allocation in a software-defined networking (sdn) system | |
JP6472876B2 (ja) | コンピュータ・プログラム、装置及び記憶媒体 | |
WO2015039616A1 (zh) | 一种报文处理方法及设备 | |
WO2019196914A1 (zh) | 一种发现转发路径的方法及其相关设备 | |
CN105812272B (zh) | 业务链的处理方法、装置与系统 | |
WO2015188682A1 (zh) | 业务链的处理方法、装置与系统 |
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: 15875057 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: 15875057 Country of ref document: EP Kind code of ref document: A1 |