CN108173696A - Data package processing method, device, computer equipment and storage medium - Google Patents

Data package processing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN108173696A
CN108173696A CN201810002734.1A CN201810002734A CN108173696A CN 108173696 A CN108173696 A CN 108173696A CN 201810002734 A CN201810002734 A CN 201810002734A CN 108173696 A CN108173696 A CN 108173696A
Authority
CN
China
Prior art keywords
virtual
data packet
port
user
subnet
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.)
Granted
Application number
CN201810002734.1A
Other languages
Chinese (zh)
Other versions
CN108173696B (en
Inventor
任苗健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weikun Shanghai Technology Service Co Ltd
Original Assignee
Lujiazui Shanghai International Financial Assets Market Ltd By Share Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lujiazui Shanghai International Financial Assets Market Ltd By Share Ltd filed Critical Lujiazui Shanghai International Financial Assets Market Ltd By Share Ltd
Priority to CN201810002734.1A priority Critical patent/CN108173696B/en
Publication of CN108173696A publication Critical patent/CN108173696A/en
Application granted granted Critical
Publication of CN108173696B publication Critical patent/CN108173696B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability

Abstract

This application involves a kind of data package processing method, device, computer equipment and storage mediums.Method includes:Upstream data packet for second user virtual machine is sent out by the first user virtual machine;The first virtual switch corresponding with first user virtual machine is created, upstream data packet is received by the first port of the first virtual switch;By the first virtual switch, virtual subnet corresponding with first port mark is added in upstream data packet, obtains newer upstream data packet, and send newer upstream data packet;The second virtual switch being connect with first virtual switch is configured, newer upstream data packet is received by the second port of the second virtual switch;The corresponding virtual subnet mark range of second port is identified including virtual subnet;First user virtual machine, the first virtual switch and the second virtual switch are deployed in identical host;By the physical network card of host where the first user virtual machine, newer upstream data packet is forwarded to physical switches.It can simplify the corresponding virtual subnet to user virtual machine using this method to be configured.

Description

Data package processing method, device, computer equipment and storage medium
Technical field
This application involves field of computer technology, more particularly to a kind of data package processing method, device, computer equipment And storage medium.
Background technology
With the development of virtual networking, occur software defined network (Software Defined Network, SDN) technology, SDN are a kind of realization methods of network virtualization, can realize the flexible control to network flow.At present, SDN Each node is typically to be accessed using physical node in network system, in order to economize on resources, can replace physics using virtual machine Node.
However, when building SDN network in linux system, bridge primary Linux only supports one virtual subnet of forwarding Data packet, the data packet of the user virtual machine to being in different virtual subnets is not supported to be forwarded, this just needs to be each Corresponding virtual subnet port is configured in user virtual machine, to receive, send corresponding data packet.Obviously, if in SDN network system In when belonging to the user virtual machines of different virtual subnets and being more than certain amount, respective virtual is configured for each user virtual machine This mode of port not only very waste of resource is netted, it is also sufficiently complex.
Invention content
Based on this, it is necessary to which, for above-mentioned technical problem, the corresponding virtual subnet of user virtual machine can be simplified by providing one kind Net data package processing method, device, computer equipment and the storage medium of configuration.
A kind of data package processing method, the method includes:
Upstream data packet for second user virtual machine is sent out by the first user virtual machine;First user is virtual Machine is deployed in different hosts respectively from the second user virtual machine, and first user virtual machine is used with described second Family virtual machine corresponds to identical virtual subnet mark;
The first virtual switch corresponding with first user virtual machine is created, passes through the first of the first virtual switch Port receives the upstream data packet;The first port is corresponded with first user virtual machine;
By first virtual switch, virtual subnet corresponding with first port mark is added on described In row data packet, newer upstream data packet is obtained, and sends the newer upstream data packet;
The second virtual switch being connect with the first virtual switch is configured, passes through the second port of the second virtual switch Receive the newer upstream data packet;The corresponding virtual subnet mark range of the second port includes the virtual subnet network mark Know;First user virtual machine, first virtual switch and second virtual switch are deployed in identical host Machine;
By the physical network card of host where first user virtual machine, newer upstream data packet is forwarded to object Manage interchanger;The newer upstream data packet, is used to indicate the physical switches and is identified according to the virtual subnet, will more New upstream data packet is forwarded to the host where the second user virtual machine.
Above-mentioned data package processing method, device, computer equipment and storage medium are sent out by the first user virtual machine After the upstream data packet of second user virtual machine, just received by the first port of the first virtual switch being configured The upstream data packet, and pass through the first virtual switch, virtual subnet corresponding with first port mark is added to upper line number According to newer upstream data packet in packet, is obtained, newer upper line number is then received by the second port of the second virtual switch According to packet, finally by the physical network card of host where the first user virtual machine, the update of the second virtual switch will be pooled to Upstream data packet be forwarded to physical switches, since second port corresponding virtual subnet mark range includes first port pair The virtual subnet mark answered, therefore completely without being configured the corresponding port of corresponding virtual subnet for the first user virtual machine, The network configuration inside user virtual machine is simplified, especially when user virtual machine quantity reaches certain amount, money can be saved Source.
A kind of data packet processing, described device include:
Upstream data packet sending module sends out uplink for second user virtual machine for passing through the first user virtual machine Data packet;First user virtual machine is deployed in different hosts, and described respectively from the second user virtual machine One user virtual machine is identified with the corresponding identical virtual subnet of the second user virtual machine;
Upstream data packet receiving module, for creating the first virtual switch corresponding with first user virtual machine, The upstream data packet is received by the first port of the first virtual switch;The first port and first user are virtual Machine corresponds;
Upstream data packet update module, will be corresponding with the first port for passing through first virtual switch Virtual subnet mark is added in the upstream data packet, obtains newer upstream data packet, and send the newer uplink Data packet;
Newer upstream data packet receiving module, for the second virtual switch being connect with the first virtual switch to be configured Machine receives the newer upstream data packet by the second port of the second virtual switch;The corresponding void of the second port Intend Subnet Identification range to identify including the virtual subnet;First user virtual machine, first virtual switch and institute It states the second virtual switch and is deployed in identical host;
Newer upstream data packet sending module, for passing through the Physical Network of host where first user virtual machine Card, physical switches are forwarded to by newer upstream data packet;The newer upstream data packet is used to indicate the physics and hands over It changes planes and is identified according to the virtual subnet, the host newer upstream data packet being forwarded to where the second user virtual machine Machine.
A kind of data package processing method, the method includes:
The downlink data packet for the first user virtual machine of physical switches forwarding is received by the second virtual switch; The downlink data packet is initiated by second user virtual machine;First user virtual machine is distinguished with the second user virtual machine It is deployed in different hosts, and first user virtual machine and the corresponding identical virtual subnet of the second user virtual machine Mark;
It is identified according to the virtual subnet in the downlink data packet, by the second port of second virtual switch, The downlink data packet is sent to the first virtual switch;The corresponding virtual subnet mark range of the second port includes institute State virtual subnet mark;First user virtual machine, first virtual switch and second virtual switch deployment In identical host;
The virtual subnet is rejected from the downlink data packet by first virtual switch to identify;
By first virtual switch, with the one-to-one first port of the first user virtual machine, will The downlink data packet for rejecting the virtual subnet mark is sent to first user virtual machine.
Above-mentioned data package processing method, device, computer equipment and computer readable storage medium pass through the second virtual friendship It changes planes and receives the downlink data packet for the first user virtual machine of physical switches forwarding, and according to the void in downlink data packet Intend Subnet Identification, by the second port of the second virtual switch, downlink data packet is sent to the first virtual switch, then Virtual subnet mark is rejected from downlink data packet by the first virtual switch, it is possible to virtual subnet mark will have been rejected Downlink data packet by the first virtual switch, with the one-to-one first port of the first user virtual machine be sent to the first use Family virtual machine, since the data packet for finally reaching the first user virtual machine does not have virtual subnet mark, there is no need to be the first use Family virtual machine is identified corresponding virtual subnet is configured with reading corresponding virtual subnet inside the first user virtual machine, is simplified Network configuration inside user virtual machine.
A kind of data packet processing, described device include:
Downlink data packet receiving module, for pass through the second virtual switch receive physical switches forwarding for first The downlink data packet of user virtual machine;The downlink data packet is initiated by second user virtual machine;First user virtual machine It is deployed in different hosts, and first user virtual machine and the second user respectively from the second user virtual machine Virtual machine corresponds to identical virtual subnet mark.
The first sending module of downlink data packet for being identified according to the virtual subnet in the downlink data packet, passes through institute The second port of the second virtual switch is stated, the downlink data packet is sent to the first virtual switch;The second port Corresponding virtual subnet mark range is identified including the virtual subnet;First user virtual machine, the first virtual friendship It changes planes and is deployed in identical host with second virtual switch.
Module is rejected, for rejecting the virtual subnet from the downlink data packet by first virtual switch Mark.
The second sending module of downlink data packet, for pass through first virtual switch, it is empty with first user The downlink data packet for having rejected the virtual subnet mark is sent to first user by the one-to-one first port of plan machine Virtual machine.
A kind of computer equipment can be run on a memory and on a processor including memory, processor and storage Computer program, the processor realize above-mentioned data package processing method when performing the computer program.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor Above-mentioned data package processing method is realized during row.
Description of the drawings
Fig. 1 is the application scenario diagram of data package processing method in one embodiment;
Fig. 2 is the flow diagram of data package processing method in one embodiment;
Fig. 3 is the flow diagram of data package processing method in another embodiment;
Fig. 4 is the flow diagram of data package processing method in a specific embodiment;
Fig. 5 is at the data packet sent in a specific embodiment to the first user virtual machine to second user virtual machine The block schematic illustration of reason;
Fig. 6 is the structure diagram of data packet processing in one embodiment;
Fig. 7 is the structure diagram of data packet processing in another embodiment;
Fig. 8 is the structure diagram of data packet processing in one embodiment;
Fig. 9 is the internal structure chart of one embodiment Computer equipment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the object, technical solution and advantage for making the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not For limiting the application.
The data package processing method that the application provides, can be applied in application environment as shown in Figure 1.Wherein, first 102 and first virtual switch 104 of user virtual machine establishes connection;First virtual switch 104 and the second virtual switch 106 Establish connection;First user virtual machine 102, the first virtual switch 104 and the second virtual switch 106 are deployed in the first host On machine 100;First host 100 is connect by network with physical switches 200, virtual to send data packets to second user The second host 300 where machine 302;First user virtual machine 102 belongs to same virtual subnet with second user virtual machine 302 Net (Virtual Local Area Network, VLAN).First host 100 and the second host 300 can be with independent The server cluster of server either multiple servers composition is realized.
In one embodiment, as shown in Fig. 2, a kind of data package processing method is provided, in this way applied in Fig. 1 The first host 100 for illustrate, include the following steps:
S202 sends out the upstream data packet for second user virtual machine by the first user virtual machine;First user is empty Plan machine is deployed in different hosts, and the first user virtual machine and second user virtual machine pair respectively from second user virtual machine Identical virtual subnet is answered to identify.
Wherein, upstream data packet is the data packet sent by the host where user virtual machine to network.First uses Family virtual machine and second user virtual machine be respectively created on different hosts for provide to the user computing resource and The virtual machine of Service Source.First user virtual machine and second user virtual machine are configured as belonging to same virtual subnet and portion Administration is on different hosts.
Specifically, it after the first user virtual machine is created on host, is configured for the first user virtual machine corresponding Microsoft Loopback Adapter, and the virtual subnet that the Microsoft Loopback Adapter is supported is configured, it is sent out by the Microsoft Loopback Adapter of the first user for second The upstream data packet of user virtual machine.
S204 creates corresponding with the first user virtual machine the first virtual switch, passes through the of the first virtual switch Single port receives upstream data packet;First port is corresponded with the first user virtual machine.
Wherein, the first virtual switch is used to be forwarded the data packet inside the virtual subnet supported.For example, the The virtual subnet that one virtual switch is supported ranging from VLAN1000~VLAN2000, then the first virtual switch just can be right The data packet in the range of the virtual subnet received is forwarded.
Specifically, by creating the corresponding virtual switch of the first user virtual machine, and the first virtual switch is configured First port is corresponding with the Microsoft Loopback Adapter of the first user virtual machine, and first is received by the first port of the first virtual switch The upstream data packet that user virtual machine is sent, and pass through the uplink and downlink data packet of first user virtual machine of first port take over. Virtual switch corresponding with the first user virtual machine can be created by performing ovs-vsctl add-br ovs-switch orders Machine.
In one embodiment, by the way that port corresponding with each user virtual machine is configured for the first virtual switch, respectively The Microsoft Loopback Adapter of a port and each user virtual machine corresponds, can thus be taken over by the first virtual switch with respectively A relevant data packet of user virtual machine.
Virtual subnet corresponding with first port mark by the first virtual switch, is added to upstream data by S206 Bao Zhong obtains newer upstream data packet, and sends newer upstream data packet.
Wherein, virtual subnet mark is for unique information for reflecting the virtual subnet corresponding to data packet.With identical The data packet of virtual subnet mark can transmit in same virtual subnet, and the data identified with different virtual subnets Packet usually requires to realize transmission by virtual machine interchanger.
Specifically, the upstream data packet sent by the first user virtual machine does not carry Subnet Identification, virtual first After interchanger receives the upstream data packet that the first user virtual machine is sent by corresponding Microsoft Loopback Adapter by first port, Since the Microsoft Loopback Adapter of first port and the first user virtual machine corresponds, it is possible to will be corresponding with the first port virtual Subnet Identification is added in upstream data packet, is obtained newer upstream data packet, is then sent to newer upstream data packet Second virtual switch.
The second virtual switch for being connect with the first virtual switch is configured in S208, passes through the of the second virtual switch Two-port netwerk receives newer upstream data packet;The corresponding virtual subnet mark range of second port is identified including virtual subnet;The One user virtual machine, the first virtual switch and the second virtual switch are deployed in identical host.
Wherein, the data packet that the second virtual switch is used to transmit between the first virtual switch is forwarded.Second The virtual subnet that the second port of virtual switch the is supported virtual subnet that ranging from several first virtual switches are supported The consolidation scope of net range.
Specifically, the virtual subnet range supported by the way that the second port of the second virtual switch is configured, the range packet The virtual subnet for including addition identifies corresponding virtual subnet.The upstream data packet of virtual subnet mark is added in the first virtual machine Later, the first virtual switch checks the data packet and can continue to issue, and is just sent to the second virtual switch, and second is empty Newer upstream data packet can be received by second port by intending interchanger.
It is appreciated that the upstream data packet that all user virtual machines on host are sent can be collected to second virtually Interchanger is forwarded to physical network card by the second virtual switch or is forwarded to the corresponding other ports of the second virtual switch.
For example, the virtual subnet that the exit port of the first virtual switch is supported is ranging from:
VLAN1000-VLAN2000, then on the second virtual switch just having support receive the first virtual switch from The port for the upstream data packet that the exit port of first virtual switch is sent.
By the physical network card of host where the first user virtual machine, newer upstream data packet is forwarded to by S210 Physical switches;Newer upstream data packet, is used to indicate physical switches and is identified according to virtual subnet, by newer upper line number The host being forwarded to according to packet where second user virtual machine.
Specifically, the second virtual switch receive be added to virtual subnet mark newer upstream data packet it Afterwards, checking the upstream data packet can continue to be issued, just by the physical network card of host by newer upstream data packet It sends, after being received by physical switches, identifies, forward it to according to the virtual subnet in newer upstream data packet Host where second user virtual machine.
It in one embodiment, can be by performing brctl addif br1A instructions the place where the first user virtual machine The physical network card A of host is added in the second virtual switch, so that the newer uplink that second user virtual machine will receive Data packet is sent is forwarded to network by the physical network card of host.
In above-mentioned data package processing method, the uplink for second user virtual machine is being sent out by the first user virtual machine After data packet, upstream data packet is just received by the first port of the first virtual switch being configured, and passes through the first void Intend interchanger, virtual subnet corresponding with first port mark is added in upstream data packet, obtains newer upstream data Then packet receives newer upstream data packet by the second port of the second virtual switch, virtual finally by the first user The physical network card of host, physical exchange is forwarded to by the newer upstream data packet for being pooled to the second virtual switch where machine Machine since the corresponding virtual subnet mark range of second port is identified including virtual subnet, is used completely without for first Family virtual machine is configured the corresponding port of corresponding virtual subnet, simplifies the network configuration inside user virtual machine, especially with When family virtual machine quantity reaches certain amount, it can economize on resources.
In one embodiment, the step of sending newer upstream data packet specifically includes:Pass through the first virtual switch Inquire corresponding first network configuration file;According to first network configuration file, each port for inquiring the first virtual switch is each Self-corresponding virtual subnet mark;When inquiring the port with the corresponding identical virtual subnet mark of first port, pass through inquiry The port arrived sends newer upstream data packet.
Wherein, first network configuration file is the file for storing network configuration corresponding with the first virtual switch.The The virtual subnet mark corresponding to each port on the first virtual switch is stored in one network profile.
Specifically, the upper of the first user virtual machine transmission is being received by the corresponding first port of the first virtual switch After row data packet, the corresponding virtual subnet mark of first port is added for upstream data packet, corresponding first network is inquired and matches File is put, the corresponding virtual subnet mark in each port is inquired, by inquiring and the corresponding identical void of first port When intending the port of Subnet Identification, newer upstream data packet is just sent by the port inquired.
For example, the first virtual switch inquired tetra- ports of A, B, C, D corresponded to it is corresponding with first port virtual Subnet Identification, wherein D ports can also be the port for supporting a virtual subnet range, which includes the virtual subnet network mark Know, then newer upstream data packet can be forwarded to this four ports by the first virtual switch.
In one embodiment, the first virtual switch, can't be by the data when forwarding newer upstream data packet Packet is forwarded to the first port of the first virtual switch.
In one embodiment, at least there are two physical network cards for the host where the first user virtual machine.One of them For physical network card for being forwarded to the uplink and downlink data packet of reception, another physical network card is used to receive the network configuration of push File, network profile are used to change virtual switch and the corresponding network configuration of user virtual machine.First virtual switch Corresponding network profile can be received by being used for the physical network card for the network profile for receiving push.
In the present embodiment, the first virtual switch is identified by inquiring the corresponding virtual subnet in each port, according to looking into It askes virtual subnet corresponding with first port and identifies the newer upstream data packet of corresponding port forwarding, used with realizing by first The upstream data packet that family virtual machine is sent is issued to the second virtual switch.
In one embodiment, newer upstream data packet is received by the second port of the second virtual switch, specifically Including:Inquire the corresponding virtual subnet mark range in each port of the second virtual switch;Determine newer upstream data Virtual subnet mark range where virtual subnet mark in packet;The corresponding to range is identified by determining virtual subnet Two-port netwerk receives newer upstream data packet.
Wherein, each port of the second virtual switch has all corresponded to a virtual subnet mark range.For example, second is virtual The port tap0 of interchanger is used to receive the upper line number that all user virtual machines are sent in the calculate node in OpenStack environment According to packet, the corresponding virtual subnet mark range of the calculate node is VLAN100~VLAN200;The port of second virtual switch Tap1 is used to receive the upstream data packet that all Virtual Controllers are sent in the control node in OpenStack environment, the control The corresponding virtual subnet mark range of node is VLAN300~VLAN500.
Specifically, range is identified by the way that corresponding virtual subnet is configured for each port of the second virtual switch, the After as soon as virtual switch has sent newer upstream data packet, inquire each port respectively first of the second virtual switch Virtual subnet mark range, determine the virtual subnet added in newer upstream data packet mark where virtual subnet mark Range finds the determining corresponding second port of virtual subnet mark range, it is possible to receive this by second port Data packet.
In one embodiment, each port of the second virtual switch receive each newer upstream data packet it Afterwards, newer upstream data packet is forwarded in the order received.For example, the update first received for same port Data packet just first forward;For the newer data packet that different port receives simultaneously according to each port pre-set priority into Row forwarding.
In the present embodiment, range is identified by inquiring the corresponding virtual subnet in each port of the second virtual switch, and Determine the virtual subnet mark range where virtual subnet mark in newer upstream data packet, it is possible to determine the second virtual friendship For receiving the port of newer upstream data packet on changing planes, having corresponded to the port of a virtual subnet mark range can realize The communication for belonging to same virtual subnet and being deployed between the user virtual machine of different hosts machine.
As shown in figure 3, in one embodiment, data package processing method is further comprising the steps of:
S302 receives the lower line number for the first user virtual machine of physical switches forwarding by the second virtual switch According to packet;Downlink data packet is initiated by second user virtual machine.
Wherein, downlink data packet is as the data packet of the host where network is sent to the first user virtual machine.For The downlink data packet of first user virtual machine is to carry the data packet of the virtual subnet mark corresponding to the first user virtual machine. Specifically, by the way that the physical network card of the host where the first user virtual machine is added the second virtual switch, so as to reach The data packet of the physical network card of host can be received, and be forwarded to the first virtual switch by the second virtual switch.
S304 is identified according to the virtual subnet in downlink data packet, by the second port of the second virtual switch, by under Row data packet is sent to the first virtual switch.
Wherein, the corresponding virtual subnet mark of downlink data packet belongs to corresponding to the second port of the second virtual switch Virtual subnet identifies range.Specifically, the second virtual switch receive carry virtual subnet mark downlink data packet Later, corresponding virtual subnet mark is extracted from downlink data packet, is identified according to the virtual subnet of extraction from second port Downlink data packet is forwarded to the first virtual switch.
S306 rejects virtual subnet mark by the first virtual switch from downlink data packet.
Since the upstream data packet sent out from the first user virtual machine is no virtual subnet mark, similarly, to reach Downlink data packet to the port of the first user virtual machine does not carry virtual subnet mark yet, therefore reaches the in downlink data packet Need to reject the virtual subnet mark in data packet before the port of one user virtual machine.So there is no need to be user virtual machine Whether how configuration identifies the mark of virtual subnet, it is not required that be received or converting downlink number in user virtual machine internal judgment According to packet so that network configuration significantly simplifies in user virtual machine.
Specifically, after the first virtual switch receives downlink data packet, corresponding void is extracted from downlink data packet Intend Subnet Identification, virtual subnet mark is rejected from downlink data packet.
By the first port of the first virtual switch, the downlink data packet for having rejected virtual subnet mark is sent out by S308 It send to the first user virtual machine.
Specifically, the first virtual switch is after the corresponding virtual subnet mark of downlink data packet is identified, inquiry first The corresponding virtual subnet mark in each port of virtual switch, determines that virtual subnet mark corresponding with downlink data packet is identical The downlink data packet for having rejected virtual subnet mark is sent to the first user virtual machine by first port by first port.
In the present embodiment, by the first virtual switch in the downlink data packet for receiving the second virtual switch and reporting Later, the virtual subnet mark in downlink data packet is rejected, so that reached the downlink data packet of the first user virtual machine Through not carrying virtual subnet mark.
In one embodiment, it is identified according to the virtual subnet in downlink data packet, passes through the of the second virtual switch Two-port netwerk, the step of downlink data packet is sent to the first virtual switch, specifically include:Inquire each of the second virtual switch The corresponding virtual subnet mark range in port;Determine the virtual subnet network mark where the virtual subnet mark in downlink data packet Know range;Second port corresponding to range is identified by determining virtual subnet, it is virtual that downlink data packet is sent to first Interchanger.
Wherein, it since each port of the second virtual switch is configured to correspond to a virtual subnet mark range, needs Downlink data packet is forwarded to by the first virtual switch by the port identified comprising the virtual subnet in downlink data packet.
Specifically, after the second virtual switch receives downlink data packet, each port of the second virtual switch is inquired Corresponding virtual subnet identifies range, determines the virtual subnet mark where the corresponding virtual subnet mark of downlink data packet Downlink data packet is sent to the first virtual switch by the corresponding second port of range by the second port.
In one embodiment, if the port for only inquiring the second virtual switch reception downlink data packet is corresponding virtual The virtual subnet that Subnet Identification range includes downlink data packet identifies, then makees discard processing to downlink data packet.
In the above-described embodiments, the second virtual switch is virtually handed over after downlink data packet is received by inquiry second Corresponding virtual subnet of changing planes identifies range, determines the virtual subnet mark model where the virtual subnet mark in downlink data packet It encloses, it is possible to the corresponding second port of range be identified by the virtual subnet, downlink data packet is forwarded to the first virtual switch Machine.
In one embodiment, first port is the port of ACCESS types;Second port is the port of TRUNK types; First user virtual machine and second user virtual machine are operated in the calculate node in OpenStack.
Wherein, the port of ACCESS (accessing connection) type only corresponds to a VLAN.For example, with the first user virtual machine The first port of corresponding first virtual switch of Microsoft Loopback Adapter is the port of ACCESS types.TRUNK (convergence connection) type Port correspond to multiple VLAN, that is, corresponded to virtual subnet mark range, the data of multiple VLAN can be sended and received Packet.For example, the second port of the second virtual switch is the port of TRUNK types.First user virtual machine and second user are empty Plan machine is the virtual switch operated in the calculate node in OpenStack.Multiple categories can have been run in the calculate node In the user virtual machine of multiple VLAN.First virtual switch and the second virtual switch can be in OpenStack environment OVS interchangers.
In one embodiment, there are multiple calculate nodes on the host where the first user virtual machine, it is each to calculate section Point has corresponded to different virtual subnet mark ranges, and virtual subnet mark range is that each user virtual machine corresponds in calculate node Virtual subnet mark consolidation scope.
As shown in figure 4, the flow diagram of data package processing method in a specific embodiment.The processing data packets Method specifically comprises the following steps:
S401 sends out the upstream data packet for second user virtual machine by the first user virtual machine.
S402 creates corresponding with the first user virtual machine the first virtual switch, passes through the of the first virtual switch Single port receives upstream data packet.
Virtual subnet corresponding with first port mark by the first virtual switch, is added to upstream data by S403 Bao Zhong obtains newer upstream data packet.
S404 inquires corresponding first network configuration file by the first virtual switch.
S405 by the first virtual switch, according to first network configuration file, inquires each end of the first virtual switch The corresponding virtual subnet mark of mouth.
S406, when inquiring the port identified with the corresponding identical virtual subnet of first port by the first virtual switch When, newer upstream data packet is sent by the port inquired.
The second virtual switch being connect with the first virtual switch is configured in S407, is inquired by the second virtual switch The corresponding virtual subnet mark range in each port of second virtual switch.
S408 determines that the virtual subnet in newer upstream data packet identifies the virtual of place by the second virtual switch Subnet Identification range.
S409 identifies the second port corresponding to range by determining virtual subnet, receives newer upstream data packet.
By the physical network card of host where the first user virtual machine, newer upstream data packet is forwarded to by S410 Physical switches.
S411 receives the lower line number for the first user virtual machine of physical switches forwarding by the second virtual switch According to packet.
S412 is identified according to the virtual subnet in downlink data packet, by the second port of the second virtual switch, by under Row data packet is sent to the first virtual switch.
S413 rejects virtual subnet mark by the first virtual switch from downlink data packet.
By the first port of the first virtual switch, the downlink data packet for having rejected virtual subnet mark is sent out by S414 It send to the first user virtual machine.
Above-mentioned data package processing method is sending out the upper line number for second user virtual machine by the first user virtual machine After packet, upstream data packet is just received by the first port of the first virtual switch being configured, and it is virtual to pass through first Virtual subnet corresponding with first port mark is added in upstream data packet, obtains newer upstream data packet by interchanger, Then newer upstream data packet is received by the second port of the second virtual switch, finally by the first user virtual machine institute In the physical network card of host, the newer upstream data packet for being pooled to the second virtual switch is forwarded to physical switches, Since the corresponding virtual subnet mark range of second port is identified including virtual subnet, completely without empty for the first user Plan machine is configured the corresponding port of corresponding virtual subnet, simplifies the network configuration inside user virtual machine, especially in user's void When plan machine quantity reaches certain amount, it can economize on resources.
In one embodiment, a kind of data package processing method is provided, in this way applied to the second host in Fig. 1 It illustrates, includes the following steps for machine 300:First is directed to by what the second virtual switch reception physical switches forwarded The downlink data packet of user virtual machine;Downlink data packet is initiated by second user virtual machine;First user virtual machine is used with second Family virtual machine is deployed in different hosts respectively, and the first user virtual machine and second user virtual machine are corresponding identical virtual Subnet Identification;It is identified according to the virtual subnet in downlink data packet, by the second port of the second virtual switch, by lower line number The first virtual switch is sent to according to packet;The corresponding virtual subnet mark range of second port is identified including virtual subnet;First User virtual machine, the first virtual switch and the second virtual switch are deployed in identical host;Pass through the first virtual switch Machine rejects virtual subnet mark from downlink data packet;By the first virtual switch, a pair of with the first user virtual machine one The downlink data packet for having rejected virtual subnet mark is sent to the first user virtual machine by the first port answered.
In the present embodiment, data package processing method receives the needle of physical switches forwarding by the second virtual switch It is identified to the downlink data packet of the first user virtual machine, and according to the virtual subnet in downlink data packet, passes through the second virtual friendship Downlink data packet is sent to the first virtual switch by the second port changed planes, then by the first virtual switch from downlink Virtual subnet mark is rejected in data packet, it is possible to which the downlink data packet for having rejected virtual subnet mark is passed through into the first virtual friendship It is changing planes, be sent to the first user virtual machine with the one-to-one first port of the first user virtual machine, due to finally reaching the The data packet of one user virtual machine does not have virtual subnet mark, and there is no need to corresponding virtual subnet is configured for the first user virtual machine Net is identified with reading corresponding virtual subnet inside the first user virtual machine, is simplified the network inside user virtual machine and is matched It puts.
As shown in figure 5, in one embodiment, to the number for second user virtual machine of the first user virtual machine transmission The schematic diagram handled according to packet.Virtual subnet mark corresponding to first user virtual machine 102 and second user virtual machine 302 For VLAN1000, specifically, the first user virtual machine 102 leads to Microsoft Loopback Adapter 102a and sends data packets to the first virtual switch 104, due to the corresponding virtual subnet mark of port 104a on the first virtual switch 104 be configured as it is virtual with the first user 102 corresponding virtual subnet of machine is identical, and therefore, the first virtual switch 104 receives the data packet by port 104a;First After virtual switch 104 receives the data packet, check the data packet and received by port 104a, just for data packet addition with The corresponding virtual subnet mark VLAN1000 of port 104a, the first virtual switch 104 check the void corresponding to the 104b of port Intend Subnet Identification range and include VLAN1000, the second virtual switch 106 is just forwarded to by port 104b;Due to second virtually The corresponding virtual subnet marks of port 106a of interchanger 106 are configured as including the corresponding virtual subnet mark ranges of 104b, The data packet for being added to virtual subnet mark, the physical network card 100a quilts of the first host 100 can be received by 106a It has been added on the second virtual switch 106, therefore data packet can be transmitted to the first host by the second virtual switch 100 corresponding physical network card 100a.It is appreciated that the first virtual switch 104 and the second virtual switch 106 can be realized pair The data flow of different virtual subnet marks is converged and is forwarded.
From this figure it can be seen that multiple calculate nodes, each calculate node pair can be configured on the first host 100 Different virtual subnets has been answered to identify range, has finally all been converged on the second virtual machine interchanger 106 of the first host 100.
Data packet is forwarded to by the physical network card 100a of the first host 100 in physical switches 200, then there is physics Interchanger is being received by forwarded to the second host 300,300 corresponding second virtual switch 306 of the second host To after the data packet for carrying virtual subnet mark, search the virtual subnet mark range comprising virtual subnet mark and correspond to Port 306a, from port, 306a forwards the packet to 300 corresponding first virtual switch 304 of the second host, by The virtual subnet that one virtual switch 304 identification data packet carries identifies VLAN1000 and the virtual subnet is rejected from data packet Mark, since 304 corresponding port 304a of the first virtual switch is configured as having corresponded to virtual subnet mark VLAN1000, because The data packet for eliminating virtual subnet mark can be sent to user virtual machine 302 by this by the port, just complete number According to the entire processing procedure of packet.
It should be understood that although each step in the flow chart of Fig. 2-4 is shown successively according to the instruction of arrow, These steps are not that the inevitable sequence indicated according to arrow performs successively.Unless it expressly states otherwise herein, these steps Execution there is no stringent sequences to limit, these steps can perform in other order.Moreover, at least one in Fig. 2-4 Part steps can include multiple sub-steps, and either these sub-steps of multiple stages or stage are not necessarily in synchronization Completion is performed, but can be performed at different times, the execution sequence in these sub-steps or stage is also not necessarily successively It carries out, but can either the sub-step of other steps or at least part in stage be in turn or alternately with other steps It performs.
In one embodiment, as shown in fig. 6, providing a kind of data packet processing 600, including:Upstream data packet Sending module 602, upstream data packet receiving module 604, upstream data packet update module 606, newer upstream data packet receive Module 608 and newer upstream data packet sending module 610, wherein:
Upstream data packet sending module 602 is sent out for passing through the first user virtual machine for second user virtual machine Upstream data packet;First user virtual machine is deployed in different hosts respectively from second user virtual machine, and the first user is empty Plan machine is identified with the corresponding identical virtual subnet of second user virtual machine;
Upstream data packet receiving module 604 for creating the first virtual switch corresponding with the first user virtual machine, leads to The first port for crossing the first virtual switch receives upstream data packet;First port is corresponded with the first user virtual machine;
Upstream data packet update module 606, will virtual subnet corresponding with first port for passing through the first virtual switch Network mark knowledge is added in upstream data packet, obtains newer upstream data packet, and send newer upstream data packet;
Newer upstream data packet receiving module 608, for the connect with the first virtual switch second virtual friendship to be configured It changes planes, newer upstream data packet is received by the second port of the second virtual switch;The corresponding virtual subnet of second port Range is identified to identify including virtual subnet;First user virtual machine, the first virtual switch and the second virtual switch are deployed in Identical host;
Newer upstream data packet sending module 610, for passing through the Physical Network of the first user virtual machine place host Card, physical switches are forwarded to by newer upstream data packet;Newer upstream data packet, be used to indicate physical switches according to Virtual subnet identifies, the host newer upstream data packet being forwarded to where second user virtual machine.
In one embodiment, as shown in fig. 7, data packet processing 600 further includes:
Downlink data packet receiving module 702 receives being directed to for physical switches forwarding for passing through the second virtual switch The downlink data packet of first user virtual machine;Downlink data packet is initiated by second user virtual machine;
Downlink data packet forward module 704, it is virtual by second for being identified according to the virtual subnet in downlink data packet Downlink data packet is sent to the first virtual switch by the second port of interchanger;
Virtual subnet mark rejects module 706, is rejected virtually for passing through the first virtual switch from downlink data packet Subnet Identification;
Newer downlink data packet sending module 708 for passing through the first port of the first virtual switch, will reject The downlink data packet of virtual subnet mark is sent to the first user virtual machine.
In one embodiment, downlink data packet forward module 704 is additionally operable to each port of the second virtual switch of inquiry Corresponding virtual subnet identifies range;Determine the virtual subnet mark model where the virtual subnet mark in downlink data packet It encloses;Second port corresponding to range is identified by determining virtual subnet, downlink data packet is sent to the first virtual switch Machine.
In one embodiment, first port is the port of ACCESS types;Second port is the port of TRUNK types; First user virtual machine and second user virtual machine are operated in the calculate node in OpenStack.
Above-mentioned data packet processing 600, sends out by the first user virtual machine for the upper of second user virtual machine After row data packet, upstream data packet is just received, and pass through first by the first port of the first virtual switch being configured Virtual subnet corresponding with first port mark is added in upstream data packet, obtains newer upper line number by virtual switch According to packet, newer upstream data packet is then received by the second port of the second virtual switch, finally by the first user void The newer upstream data packet for being pooled to the second virtual switch is forwarded to physics and handed over by the physical network card of host where plan machine It changes planes, since second port corresponding virtual subnet mark range includes virtual subnet mark, completely without being first User virtual machine is configured the corresponding port of corresponding virtual subnet, simplifies the network configuration inside user virtual machine, especially exists When user virtual machine quantity reaches certain amount, it can economize on resources.
In one embodiment, as shown in figure 8, providing a kind of data packet processing 800, including:Downlink data packet Receiving module 802, rejects module 806 and the second sending module of downlink data packet 808 at the first sending module of downlink data packet 804, Wherein:
Downlink data packet receiving module 802 receives being directed to for physical switches forwarding for passing through the second virtual switch The downlink data packet of first user virtual machine;Downlink data packet is initiated by second user virtual machine;First user virtual machine and the Two user virtual machines are deployed in different hosts respectively, and the first user virtual machine is corresponding identical with second user virtual machine Virtual subnet identifies.
The first sending module of downlink data packet 804 for being identified according to the virtual subnet in downlink data packet, passes through second Downlink data packet is sent to the first virtual switch by the second port of virtual switch;The corresponding virtual subnet of second port Range is identified to identify including virtual subnet;First user virtual machine, the first virtual switch and the second virtual switch are deployed in Identical host.
Module 806 is rejected, virtual subnet mark is rejected for passing through the first virtual switch from downlink data packet.
The second sending module of downlink data packet 808, for pass through the first virtual switch, with the first user virtual machine one The downlink data packet for having rejected virtual subnet mark is sent to the first user virtual machine by one corresponding first port.
Above-mentioned data packet processing 800 is directed to first by what the second virtual switch reception physical switches forwarded The downlink data packet of user virtual machine, and identified according to the virtual subnet in downlink data packet, pass through the second virtual switch Downlink data packet is sent to the first virtual switch by second port, then by the first virtual switch from downlink data packet Middle rejecting virtual subnet mark, it is possible to which the downlink data packet for having rejected virtual subnet mark is passed through into the first virtual switch , with the one-to-one first port of the first user virtual machine be sent to the first user virtual machine, due to finally reaching the first use The data packet of family virtual machine does not have virtual subnet mark, there is no need to be configured for the first user virtual machine corresponding virtual subnet with Corresponding virtual subnet mark is read inside the first user virtual machine, simplifies the network configuration inside user virtual machine.
Specific restriction about data packet processing may refer to the restriction above for data package processing method, This is repeated no more.Modules in above-mentioned data packet processing can come fully or partially through software, hardware and combinations thereof It realizes.Above-mentioned each module can be embedded in or in the form of hardware independently of in the processor in computer equipment, can also be with software Form is stored in the memory in computer equipment, and the corresponding operation of more than modules is performed in order to which processor calls.
In one embodiment, provide a kind of computer equipment, the computer equipment can be the first host 100 or Second host 300, internal structure chart can be as shown in Figure 9.The computer equipment includes the place connected by system bus Manage device, memory and network interface.Wherein, the processor of the computer equipment is for offer calculating and control ability.The calculating The memory of machine equipment includes non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system And computer program.The built-in storage provides ring for the operating system in non-volatile memory medium and the operation of computer program Border.The network interface of the computer equipment is used to communicate by network connection with external host.The computer program is located It manages when device performs to realize a kind of data package processing method.
It will be understood by those skilled in the art that the structure shown in Fig. 9, only part knot relevant with application scheme The block diagram of structure does not form the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment It can include either combining certain components than components more or fewer shown in figure or be arranged with different components.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage on a memory And the computer program that can be run on a processor, processor realize following steps when performing computer program:It is used by first Family virtual machine sends out the upstream data packet for second user virtual machine;First user virtual machine is distinguished with second user virtual machine Different hosts is deployed in, and the first user virtual machine is identified with the corresponding identical virtual subnet of second user virtual machine;Wound The first virtual switch corresponding with the first user virtual machine is built, upper line number is received by the first port of the first virtual switch According to packet;First port is corresponded with the first user virtual machine;It, will void corresponding with first port by the first virtual switch Intend Subnet Identification to be added in upstream data packet, obtain newer upstream data packet, and send newer upstream data packet;Configuration The second virtual switch being connect with the first virtual switch is received by the second port of the second virtual switch on newer Row data packet;The corresponding virtual subnet mark range of second port is identified including virtual subnet;First user virtual machine, the first void Intend interchanger and the second virtual switch is deployed in identical host;Pass through the physics of host where the first user virtual machine Newer upstream data packet is forwarded to physical switches by network interface card;Newer upstream data packet, be used to indicate physical switches by It is identified according to virtual subnet, the host newer upstream data packet being forwarded to where second user virtual machine.
In one embodiment, a kind of computer readable storage medium is provided, is stored thereon with computer program, is calculated Machine program realizes following steps when being executed by processor:It is sent out by the first user virtual machine for the upper of second user virtual machine Row data packet;First user virtual machine is deployed in different hosts respectively from second user virtual machine, and the first user is virtual Machine is identified with the corresponding identical virtual subnet of second user virtual machine;Create the corresponding with the first user virtual machine first virtual friendship It changes planes, upstream data packet is received by the first port of the first virtual switch;First port and the first user virtual machine are one by one It is corresponding;By the first virtual switch, virtual subnet corresponding with first port mark is added in upstream data packet, is obtained Newer upstream data packet, and send newer upstream data packet;The virtual friendship of second connect with the first virtual switch is configured It changes planes, newer upstream data packet is received by the second port of the second virtual switch;The corresponding virtual subnet of second port Range is identified to identify including virtual subnet;First user virtual machine, the first virtual switch and the second virtual switch are deployed in Identical host;By the physical network card of host where the first user virtual machine, newer upstream data packet is forwarded to Physical switches;Newer upstream data packet, is used to indicate physical switches and is identified according to virtual subnet, by newer upper line number The host being forwarded to according to packet where second user virtual machine.
Above computer equipment and computer readable storage medium are used being sent out by the first user virtual machine for second After the upstream data packet of family virtual machine, upstream data is just received by the first port of the first virtual switch being configured Packet, and pass through the first virtual switch, virtual subnet corresponding with first port mark is added in upstream data packet, is obtained Then newer upstream data packet receives newer upstream data packet by the second port of the second virtual switch, finally leads to The physical network card of host, will be pooled to the newer upstream data packet of the second virtual switch where crossing the first user virtual machine Physical switches are forwarded to, since the corresponding virtual subnet mark range of second port is identified including virtual subnet, completely It does not need to that the corresponding port of corresponding virtual subnet is configured for the first user virtual machine, simplifies the network inside user virtual machine Configuration, especially when user virtual machine quantity reaches certain amount, can economize on resources.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage on a memory And the computer program that can be run on a processor, processor realize following steps when performing computer program:Pass through the second void Intend the downlink data packet for the first user virtual machine that interchanger receives physical switches forwarding;Downlink data packet is used by second Family virtual machine is initiated;First user virtual machine is deployed in different hosts, and the first user respectively from second user virtual machine Virtual machine is identified with the corresponding identical virtual subnet of second user virtual machine;It is identified according to the virtual subnet in downlink data packet, By the second port of the second virtual switch, downlink data packet is sent to the first virtual switch;Second port is corresponding Virtual subnet identifies range and is identified including virtual subnet;First user virtual machine, the first virtual switch and the second virtual switch Machine is deployed in identical host;Virtual subnet mark is rejected from downlink data packet by the first virtual switch;Pass through One virtual switch, with the one-to-one first port of the first user virtual machine, will reject virtual subnet mark downlink Data packet is sent to the first user virtual machine.
In one embodiment, a kind of computer readable storage medium is provided, is stored thereon with computer program, is calculated Machine program realizes following steps when being executed by processor:By the second virtual switch receive that physical switches forward for the The downlink data packet of one user virtual machine;Downlink data packet is initiated by second user virtual machine;First user virtual machine and second User virtual machine is deployed in different hosts, and the first user virtual machine and the corresponding identical void of second user virtual machine respectively Intend Subnet Identification;It is identified according to the virtual subnet in downlink data packet, by the second port of the second virtual switch, by downlink Data packet is sent to the first virtual switch;The corresponding virtual subnet mark range of second port is identified including virtual subnet;The One user virtual machine, the first virtual switch and the second virtual switch are deployed in identical host;Pass through the first virtual friendship It changes planes and virtual subnet mark is rejected from downlink data packet;By the first virtual switch, with the first user virtual machine one by one The downlink data packet for having rejected virtual subnet mark is sent to the first user virtual machine by corresponding first port.
Above computer equipment and computer readable storage medium receive physical switches by the second virtual switch and turn The downlink data packet for the first user virtual machine of hair, and identified according to the virtual subnet in downlink data packet, pass through second Downlink data packet is sent to the first virtual switch, then passes through the first virtual switch by the second port of virtual switch Virtual subnet mark is rejected from downlink data packet, it is possible to the downlink data packet of virtual subnet mark will have been rejected by first Virtual switch, with the one-to-one first port of the first user virtual machine be sent to the first user virtual machine, due to last Reaching the data packet of the first user virtual machine does not have virtual subnet mark, and there is no need to correspondence is configured for the first user virtual machine Virtual subnet is identified with reading corresponding virtual subnet inside the first user virtual machine, is simplified inside user virtual machine Network configuration.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, computer program can be stored in a non-volatile computer readable It takes in storage medium, the computer program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, this Shen Any reference to memory, storage, database or other media used in each embodiment please provided, may each comprise Non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above example can be combined arbitrarily, to make description succinct, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield is all considered to be the range of this specification record.
Above example only expresses the several embodiments of the application, and description is more specific and detailed, but can not Therefore it is construed as limiting the scope of the patent.It should be pointed out that for those of ordinary skill in the art, Under the premise of not departing from the application design, various modifications and improvements can be made, these belong to the protection domain of the application. Therefore, the protection domain of the application patent should be determined by the appended claims.

Claims (10)

1. a kind of data package processing method, the method includes:
Upstream data packet for second user virtual machine is sent out by the first user virtual machine;First user virtual machine with The second user virtual machine is deployed in different hosts respectively, and first user virtual machine and the second user are empty Plan machine corresponds to identical virtual subnet mark;
The first virtual switch corresponding with first user virtual machine is created, passes through the first port of the first virtual switch Receive the upstream data packet;The first port is corresponded with first user virtual machine;
By first virtual switch, virtual subnet corresponding with first port mark is added to the upper line number According in packet, obtaining newer upstream data packet, and send the newer upstream data packet;
The second virtual switch being connect with first virtual switch is configured, passes through the second port of the second virtual switch Receive the newer upstream data packet;The corresponding virtual subnet mark range of the second port includes the virtual subnet network mark Know;First user virtual machine, first virtual switch and second virtual switch are deployed in identical host Machine;
By the physical network card of host where first user virtual machine, newer upstream data packet is forwarded to physics and is handed over It changes planes;The newer upstream data packet, is used to indicate the physical switches and is identified according to the virtual subnet, will be newer Upstream data packet is forwarded to the host where the second user virtual machine.
2. according to the method described in claim 1, it is characterized in that, described send the newer upstream data packet, including:
Corresponding first network configuration file is inquired by first virtual switch;
According to the first network configuration file, the corresponding virtual subnet in each port of first virtual switch is inquired Mark;
When inquiring the port with the corresponding identical virtual subnet mark of the first port, institute is sent by the port inquired State newer upstream data packet.
3. according to the method described in claim 1, it is characterized in that, the second port by the second virtual switch receives The newer upstream data packet, including:
Inquire the corresponding virtual subnet mark range in each port of second virtual switch;
Determine the virtual subnet mark range where the virtual subnet mark in newer upstream data packet;
Second port corresponding to range is identified by the determining virtual subnet, receives the newer upstream data packet.
4. according to the method described in claim 1, it is characterized in that, the method further includes:
The lower line number for first user virtual machine of the physical switches forwarding is received by the second virtual switch According to packet;The downlink data packet is initiated by the second user virtual machine;
It is identified according to the virtual subnet in the downlink data packet, by the second port of second virtual switch, The downlink data packet is sent to first virtual switch;
The virtual subnet is rejected from the downlink data packet by first virtual switch to identify;
By the first port of first virtual switch, the downlink data packet of the virtual subnet mark will be rejected It is sent to first user virtual machine.
5. the according to the method described in claim 4, it is characterized in that, virtual subnet network mark according in the downlink data packet Know, by the second port of second virtual switch, the downlink data packet is sent to the described first virtual friendship It changes planes, including:
Inquire the corresponding virtual subnet mark range in each port of second virtual switch;
Determine the virtual subnet mark range where the virtual subnet mark in the downlink data packet;
Second port corresponding to range is identified by the determining virtual subnet, the downlink data packet is sent to described First virtual switch.
6. method according to any one of claims 1 to 5, which is characterized in that the first port is ACCESS types Port;The second port is the port of TRUNK types;First user virtual machine and second user virtual machine operation In calculate node in OpenStack.
7. a kind of data package processing method, the method includes:
The downlink data packet for the first user virtual machine of physical switches forwarding is received by the second virtual switch;It is described Downlink data packet is initiated by second user virtual machine;First user virtual machine is disposed respectively with the second user virtual machine In different hosts, and first user virtual machine and the corresponding identical virtual subnet network mark of the second user virtual machine Know;
It is identified according to the virtual subnet in the downlink data packet, by the second port of second virtual switch, by institute It states downlink data packet and is sent to the first virtual switch;The corresponding virtual subnet mark range of the second port includes the void Intend Subnet Identification;First user virtual machine, first virtual switch and second virtual switch are deployed in phase Same host;
The virtual subnet is rejected from the downlink data packet by first virtual switch to identify;
By first virtual switch, with the one-to-one first port of the first user virtual machine, will reject The downlink data packet of the virtual subnet mark is sent to first user virtual machine.
8. a kind of data packet processing, described device include:
Upstream data packet sending module sends out upstream data for second user virtual machine for passing through the first user virtual machine Packet;First user virtual machine is deployed in different hosts respectively from the second user virtual machine, and described first uses Family virtual machine is identified with the corresponding identical virtual subnet of the second user virtual machine;
Upstream data packet receiving module for creating the first virtual switch corresponding with first user virtual machine, passes through The first port of first virtual switch receives the upstream data packet;The first port and first user virtual machine one One corresponds to;
Upstream data packet update module, will be corresponding with the first port virtual for passing through first virtual switch Subnet Identification is added in the upstream data packet, obtains newer upstream data packet, and sends the newer upstream data Packet;
Newer upstream data packet receiving module, for the second virtual switch being connect with first virtual switch to be configured Machine receives the newer upstream data packet by the second port of the second virtual switch;The corresponding void of the second port Intend Subnet Identification range to identify including the virtual subnet;First user virtual machine, first virtual switch and institute It states the second virtual switch and is deployed in identical host;
Newer upstream data packet sending module, for by the physical network card of host where first user virtual machine, Newer upstream data packet is forwarded to physical switches;The newer upstream data packet, is used to indicate the physical exchange Machine is identified according to the virtual subnet, the host newer upstream data packet being forwarded to where the second user virtual machine Machine.
9. a kind of computer equipment including memory, processor and stores the meter that can be run on a memory and on a processor Calculation machine program, which is characterized in that the processor realizes any one of claim 1 to 7 institute when performing the computer program The step of stating method.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method described in any one of claim 1 to 7 is realized when being executed by processor.
CN201810002734.1A 2018-01-02 2018-01-02 Data packet processing method and device, computer equipment and storage medium Active CN108173696B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810002734.1A CN108173696B (en) 2018-01-02 2018-01-02 Data packet processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810002734.1A CN108173696B (en) 2018-01-02 2018-01-02 Data packet processing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108173696A true CN108173696A (en) 2018-06-15
CN108173696B CN108173696B (en) 2020-11-24

Family

ID=62517284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810002734.1A Active CN108173696B (en) 2018-01-02 2018-01-02 Data packet processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108173696B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636036A (en) * 2018-06-22 2019-12-31 复旦大学 OpenStack cloud host network access control method based on SDN
CN110912825A (en) * 2018-09-18 2020-03-24 阿里巴巴集团控股有限公司 Message forwarding method, device, equipment and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103607430A (en) * 2013-10-30 2014-02-26 中兴通讯股份有限公司 Network processing method and system, and network control center
CN103703724A (en) * 2013-08-15 2014-04-02 华为技术有限公司 Resource payment method
EP2843906A1 (en) * 2013-09-03 2015-03-04 Huawei Technologies Co., Ltd. Method, apparatus, and system for data transmission

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103703724A (en) * 2013-08-15 2014-04-02 华为技术有限公司 Resource payment method
EP2843906A1 (en) * 2013-09-03 2015-03-04 Huawei Technologies Co., Ltd. Method, apparatus, and system for data transmission
CN103607430A (en) * 2013-10-30 2014-02-26 中兴通讯股份有限公司 Network processing method and system, and network control center

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636036A (en) * 2018-06-22 2019-12-31 复旦大学 OpenStack cloud host network access control method based on SDN
CN110912825A (en) * 2018-09-18 2020-03-24 阿里巴巴集团控股有限公司 Message forwarding method, device, equipment and system
WO2020057411A1 (en) * 2018-09-18 2020-03-26 阿里巴巴集团控股有限公司 Packet forwarding method, device, equipment, and system
CN110912825B (en) * 2018-09-18 2022-08-02 阿里巴巴集团控股有限公司 Message forwarding method, device, equipment and system
US11677686B2 (en) 2018-09-18 2023-06-13 Alibaba Group Holding Limited Packet forwarding method, apparatus, device, and system

Also Published As

Publication number Publication date
CN108173696B (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN107342895B (en) Multi-tenant network optimization method, system, computing device and storage medium
CN104601592B (en) A kind of method and access device for accessing cloud service
CN103339887B (en) For the method for optimized network prefix list search
CN108243106A (en) Control method, forwarding unit, control device and the communication system of network slice
US20040240440A1 (en) Virtual network addresses
CN106254256B (en) Data message forwarding method and equipment based on three layers of VXLAN gateway
CN107809367A (en) The equipment loading method and SDN controllers, the network equipment of a kind of SDN
US6430182B1 (en) Fabric system and method for assigning identifier for fabric apparatus therefor
CN108062482A (en) Virtual secure device architecture is provided to virtual cloud foundation structure
CN106878199B (en) Configuration method and device of access information
CN108259642A (en) Public service virtual machine access method and device based on private clound
CN106484327B (en) A kind of data processing method and associated storage device
CN107257291A (en) A kind of network equipment data interactive method and system
CN105704033B (en) A kind of implementation method of PON equipment route forwarding table management
CN107066340B (en) LINUX-based uninterrupted line speed packet receiving and transmitting method and equipment
CN102792651A (en) Packet node for applying service path routing at the MAC layer
CN108173696A (en) Data package processing method, device, computer equipment and storage medium
CN106161603B (en) A kind of method of networking, equipment and framework
CN105743687B (en) Method and device for judging node fault
CN103312424A (en) Control method and system for multiple switches in automatic testing system
CN106878052B (en) User migration method and device
CN110661629B (en) Network topology discovery method and device
CN103888435B (en) For the methods, devices and systems of business admission control
CN112333098B (en) Message forwarding method and device between service board cards
CN111654559B (en) Container data transmission method and device

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200201

Address after: 200120 floor 15, 1333 Lujiazui Ring Road, free trade Experimental Zone, Pudong New Area, Shanghai

Applicant after: Weikun (Shanghai) Technology Service Co., Ltd

Address before: 200120 13 floor, 1333 Lujiazui Road, Pudong New Area free trade pilot area, Shanghai.

Applicant before: Lujiazui Shanghai international financial assets market Limited by Share Ltd

GR01 Patent grant
GR01 Patent grant