CN105915427B - Message sending and receiving method and device - Google Patents

Message sending and receiving method and device Download PDF

Info

Publication number
CN105915427B
CN105915427B CN201610200333.8A CN201610200333A CN105915427B CN 105915427 B CN105915427 B CN 105915427B CN 201610200333 A CN201610200333 A CN 201610200333A CN 105915427 B CN105915427 B CN 105915427B
Authority
CN
China
Prior art keywords
vlan
message
identification information
header
identification
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.)
Active
Application number
CN201610200333.8A
Other languages
Chinese (zh)
Other versions
CN105915427A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201610200333.8A priority Critical patent/CN105915427B/en
Publication of CN105915427A publication Critical patent/CN105915427A/en
Application granted granted Critical
Publication of CN105915427B publication Critical patent/CN105915427B/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
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/66Layer 2 routing, e.g. in Ethernet based MAN's
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

a message sending and receiving method and equipment are used for solving the technical problem that bandwidth is wasted when a message is sent in a data center network. The message sending method comprises the following steps: a first device in a data center network which communicates through a VLAN acquires a first message to be sent; the first equipment adds a VLAN (virtual local area network) head to the first message to obtain a second message with a double-layer VLAN head, and the first equipment carries first identification information in an outer-layer VLAN head of the second message; the identification information carried by the outer VLAN header and the identification information carried by the inner VLAN header of the second message are used for jointly indicating a pre-configured VLAN identification; and the first equipment sends the second message to second equipment in the data center network.

Description

Message sending and receiving method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for sending and receiving a message.
Background
A Data Center Network (DCN) is a network that connects a large number of servers inside a data center via high-speed links and switches. The DCN is mainly implemented in a hierarchical structure, mainly in a client/server mode.
In DCN, a Virtual Extensible local area network (VXLAN) technology is generally adopted to solve the problem of insufficient Virtual Local Area Network (VLAN) during multi-tenant communication and isolation inside a data center. VXLAN is an overlay network technology that can be used to improve the scalability problem of large cloud computing deployments. VXLAN technology encapsulates a two-layer ethernet frame based on Media Access Control (MAC) with a specific destination UDP port number in an Open Systems Interconnection (OSI) 4-layer User Datagram Protocol (UDP) message using a VLAN-like encapsulation technique.
VXLAN introduces a user identifier (VXLAN Network identifier, VNI) similar to a VLAN Identifier (ID), which is called VXLAN Network identifier (VXLAN Network ID, VNI), and consists of 24 bits, and when a packet is encapsulated, the VNI needs to be encapsulated in each packet, so that the VNI alone needs to occupy a large amount of bandwidth, which causes a waste of bandwidth to a certain extent, and especially for a Network such as DCN which may need frequent communication, if the bandwidth is occupied too much, congestion may be caused.
Disclosure of Invention
The embodiment of the invention provides a message sending and receiving method and device, which are used for solving the technical problem that bandwidth is wasted when a message is sent in a data center network.
In a first aspect, a method for sending a message is provided, where the method may include: a first device in a data center network which communicates through a VLAN acquires a first message to be sent, the first device adds a VLAN head to the first message to obtain a second message with a double-layer VLAN head, the first device carries first identification information in an outer layer VLAN head of the second message, and the first device sends the second message to a second device in the data center network. The identification information carried by the outer VLAN header and the identification information carried by the inner VLAN header of the second message are used for jointly indicating the pre-configured VLAN identification.
in the embodiment of the invention, a packaging mode of VXLAN can be not adopted, but a packaging mode of double-layer VLAN is adopted, the double-layer VLAN occupies 24 bits in total, the VLAN identification is formed by the double-layer VLAN, the range of the VLAN identification is expanded, and the problem of insufficient VLAN is solved. And an extra outer layer VLAN head is added to the message, only 12 bits are needed to be added, the bandwidth is greatly saved compared with the encapsulation mode in VXLAN, the bandwidth is saved for a network which possibly needs frequent communication, such as DCN, the possibility of congestion is reduced to a certain extent, and the quality of network communication is improved.
With reference to the first aspect, in a first possible implementation manner of the first aspect, after the first device adds a VLAN header to the first packet, if the inner layer VLAN header carries priority information of the second packet, the first device may copy the priority information to the outer layer VLAN header.
When the message carrying the double-layer VLAN is transmitted in the network, for nodes along the way, the outer-layer VLAN head of the message is visible, the priority information of the message is carried in the outer-layer VLAN head, the nodes along the way can acquire the priority information of the message, and therefore the message can be transmitted according to the priority information of the message, and the priority information plays a due role.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the method may further include: if the inner VLAN header carries the priority information of the second packet, the first device may reset the identification information carried by the inner VLAN to the second identification information according to the VLAN identifier.
Generally, if priority information needs to be set for a packet, the part of the inner VLAN header of the packet used for indicating the VLAN id may be set to VLAN 0, and the packet is to be sent, it is necessary that the inner VLAN header and the outer VLAN header of the packet collectively indicate the VLAN id, so that the inner VLAN header of the packet may be reset so that the inner VLAN header and the outer VLAN header of the packet collectively indicate the VLAN id.
With reference to the first aspect or the first possible implementation manner or the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, if the first device is a server, before the first device in the data center that performs communication through the VLAN acquires the first packet to be sent, the configuration function supported by the network card driver of the first device may be further invoked to configure VLAN setting information of the first device, so that the first device can support a packet carrying a double-layer VLAN header.
generally, modifying the code of the protocol stack is cumbersome and difficult to implement. Therefore, in the embodiment of the present invention, when configuring the VLAN setting information of the server, the configuration may be performed without using a protocol stack, and the configuration function provided by the driver of the network card of the server may be directly invoked for configuration. Therefore, the configuration of the setting information of the VLAN of the server can be completed on the premise of not modifying the protocol stack code, and the method is easy to popularize and apply.
With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the first device may carry the second identification information in the inner VLAN header according to a preconfigured VLAN identification of the first device, and then the first device carries the first identification information in the outer VLAN header of the second packet, which may be implemented in the following manner: the first device carries first identification information in an outer layer VLAN header according to a preset VLAN identification of the first device. Wherein the first identification information and the second identification information may be used to jointly indicate the VLAN identification of the first device.
That is, the first device may add a double-layer VLAN header to the packet, so that the work of adding the double-layer VLAN header is completed by the first device, and is not required to be completed by different devices, so that the work of adding the double-layer VLAN header is more efficient.
With reference to the first aspect or the first possible implementation manner or the second possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, if the first device is a switch, before the first device acquires the first packet to be sent in a data center that performs communication through a VLAN, the first device may be further configured, so that the first device can encapsulate a double-layer VLAN header for the packet, and an entry provided by the first device and related to the forwarded packet can support the double-layer VLAN header.
If the first device is a switch, generally, the existing switch may support 12-bit VLAN id, so the switch needs to be configured first, so that the switch can support 24-bit VLAN id, thereby completing normal operations of packet forwarding and encapsulation.
With reference to the fifth possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the first device carries the first identification information in the outer VLAN header of the second packet, and the implementation may be implemented in different manners, for example, by introducing several manners:
The first mode is as follows: the first equipment carries first identification information in an outer layer VLAN header according to a preset VLAN identification of equipment for sending a first message; the first identification information and the identification information carried by the inner VLAN header are used for jointly indicating the VLAN identification of the equipment for sending the first message;
The second mode is as follows: the first equipment carries first identification information in an outer layer VLAN header according to a VLAN identification which is pre-configured for a port of the first equipment for receiving the first message; the first identification information and the identification information carried by the inner VLAN header are used for jointly indicating a VLAN identification which is configured in advance for a port of the first equipment for receiving the first message; or
The third mode is as follows: the first equipment carries first identification information in an outer layer VLAN header according to a VLAN identification which is pre-configured for a communication protocol to which the first message belongs; the first identification information and the identification information carried by the inner-layer VLAN header are used for jointly indicating a VLAN identification which is pre-configured for a communication protocol to which the first message belongs.
If the first identification information is determined in the first mode, each VLAN identification is specific to a VM, granularity is fine, and errors are not easy to occur. If the second or third method is used to determine the first identifier information, the VLAN identifier that the first device needs to know in advance is less, which saves the storage space of the first device.
With reference to the sixth possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the sending, by the first device, the second packet to the second device in the data center may be implemented by: and the first equipment inquires the forwarding table according to the VLAN identifier, and if the forwarding table recorded with the VLAN identifier is inquired, the first equipment forwards the second message according to the destination address recorded by the forwarding table.
Because the switch is configured in advance, the switch can support 24-bit VLAN identifications, and the forwarding table entry stored by the switch also supports 24-bit VLAN identifications, the forwarding work of the message can be completed by normally searching the forwarding table entry.
In a second aspect, a message receiving method is provided, and the method may include: and a second device in the data center network which communicates through the VLAN receives a second message sent by a first device in the data center network, wherein the second message has a double-layer VLAN header, and the second device can remove an outer-layer VLAN header of the second message.
In the embodiment of the invention, a data center network does not adopt a VXLAN packaging mode, but adopts a double-layer VLAN packaging mode, the double-layer VLAN occupies 24 bits in total, the VLAN identification is formed by the double-layer VLAN, the range of the VLAN identification is expanded, and the problem of insufficient VLAN is solved. And an extra outer layer VLAN head is added to the message, only 12 bits are needed to be added, the bandwidth is greatly saved compared with the encapsulation mode in VXLAN, the bandwidth is saved for a network which possibly needs frequent communication, such as DCN, the possibility of congestion is reduced to a certain extent, and the quality of network communication is improved.
With reference to the second aspect, in a first possible implementation manner of the second aspect, before the second device removes the outer VLAN header of the second packet, if the outer VLAN header of the second packet carries priority information of the second packet, the second device copies the priority information to the inner VLAN header of the second packet.
Because the priority information of the second packet may not be carried in the inner VLAN header of the second packet if the priority information is carried in the outer VLAN header, and the priority information is needed when the packet is parsed, the priority information can be copied to the inner VLAN header and then the outer VLAN header is removed, so that useful information can be retained even if the outer VLAN header is removed, and the packet can be correctly parsed.
with reference to the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, after the second device removes the outer VLAN header of the second packet, if the outer VLAN header of the second packet carries priority information of the second packet, the second device resets information carried by the inner VLAN header of the second packet and used for indicating a VLAN identifier to preset information, where the preset information is used for indicating that the second packet is a packet with priority information.
Generally, when a packet is encapsulated, if priority information needs to be set for the packet, a part of an inner VLAN header of the packet used for indicating a VLAN identifier may be set to be VLAN 0, and after the packet is received, the inner VLAN header and an outer VLAN header of the packet indicate the VLAN identifier together, so that, in order to enable a device that parses the second packet to correctly recognize and parse the second packet, the part of the inner VLAN header of the second packet used for indicating the VLAN identifier may be reset to preset information that the packet with the priority information should have.
in a third aspect, a first messaging device in a data center network communicating via a VLAN is provided, which may include a memory, a processor, and a transmitter. The memory may be configured to store an instruction, the processor may be configured to execute the instruction stored in the memory, obtain a first packet to be sent, add a VLAN header to the first packet, obtain a second packet with a double-layer VLAN header, where the first device carries the first identification information in an outer-layer VLAN header of the second packet, and the transmitter may be configured to send the second packet to a second device in the data center network. The identification information carried by the outer VLAN header and the identification information carried by the inner VLAN header of the second packet may be used to jointly indicate a preconfigured VLAN identifier.
with reference to the third aspect, in a first possible implementation manner of the third aspect, the processor may be further configured to: after the VLAN header is added to the first message, if the inner layer VLAN header carries the priority information of the second message, the priority information is copied to the outer layer VLAN header.
With reference to the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the processor may be further configured to, if the inner VLAN header carries priority information of the second packet, re-set the identification information carried by the inner VLAN to be the second identification information according to the VLAN identifier.
With reference to the third aspect or the first possible implementation manner or the second possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect, the processor may further be configured to: before the first message to be sent is acquired, a configuration function supported by a drive of a network card of the device is called to configure VLAN setting information of the device, so that the device can support the message carrying a double-layer VLAN header.
with reference to the third possible implementation manner of the third aspect, in a fourth possible implementation manner of the third aspect, the processor may further be configured to: and carrying second identification information in the inner layer VLAN header according to the preset VLAN identification of the equipment, and carrying first identification information in the outer layer VLAN header according to the preset VLAN identification of the equipment. The first identification information and the second identification information are used for jointly indicating the VLAN identification of the equipment.
In a fourth aspect, a second message sending device in a data center network communicating via a VLAN is provided, where the device may include a VLAN module and a forwarding module. The VLAN module may be configured to obtain a first packet to be sent, add a VLAN header to the first packet, obtain a second packet with a double-layer VLAN header, where the first device carries the first identification information in an outer-layer VLAN header of the second packet, and the forwarding module may be configured to send the second packet to a second device in the data center network. The identification information carried by the outer VLAN header and the identification information carried by the inner VLAN header of the second message are used for jointly indicating the pre-configured VLAN identification.
With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the VLAN module may be further configured to: after the VLAN header is added to the first message, if the inner layer VLAN header carries the priority information of the second message, the priority information is copied to the outer layer VLAN header.
With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the VLAN module may further be configured to: if the inner VLAN head carries the priority information of the second message, the identification information carried by the inner VLAN is set as the second identification information again according to the VLAN identification.
With reference to the fourth aspect or the first possible implementation manner or the second possible implementation manner of the fourth aspect, in a third possible implementation manner of the fourth aspect, the apparatus may further include a processing module, configured to: before the VLAN module obtains a first message to be sent, the equipment is configured, so that the equipment can package a double-layer VLAN head for the message, and a table item related to the forwarded message provided by the equipment can support the double-layer VLAN head.
with reference to the third possible implementation manner of the fourth aspect, in a fourth possible implementation manner of the fourth aspect, the VLAN module may be configured to: according to a pre-configured VLAN identification of equipment for sending a first message, first identification information is carried in an outer layer VLAN head, wherein the first identification information and the identification information carried by the inner layer VLAN head are used for jointly indicating the VLAN identification of the equipment for sending the first message; or, carrying first identification information in the outer layer VLAN header according to a VLAN identification pre-configured for a port of the first device for receiving the first message, wherein the first identification information and the identification information carried by the inner layer VLAN header are used for jointly indicating the VLAN identification pre-configured for the port of the device for receiving the first message; or, carrying first identification information in the outer layer VLAN header according to a VLAN identification pre-configured for the communication protocol to which the first message belongs, wherein the first identification information and the identification information carried by the inner layer VLAN header are used for jointly indicating the VLAN identification pre-configured for the communication protocol to which the first message belongs.
With reference to the fourth possible implementation manner of the fourth aspect, in a fifth possible implementation manner of the fourth aspect, the forwarding module may be configured to: and inquiring the forwarding table entry according to the VLAN identification, and if the forwarding table entry recorded with the VLAN identification is inquired, forwarding the second message according to the destination address recorded by the forwarding table entry.
In a fifth aspect, a message receiving device in a data center network communicating via a VLAN is provided, which may include a memory, a receiver, and a processor. The memory may be configured to store an instruction, the receiver may be configured to receive a second packet sent by a first device in the data center network, the second packet may have a double-layer VLAN header, and the processor may be configured to execute the instruction stored in the memory and remove an outer VLAN header of the second packet.
With reference to the fifth aspect, in a first possible implementation manner of the fifth aspect, the processor may be further configured to: before the outer-layer VLAN header of the second message is removed, if the outer-layer VLAN header of the second message carries the priority information of the second message, the priority information is copied to the inner-layer VLAN header of the second message.
With reference to the first possible implementation manner of the fifth aspect, in a second possible implementation manner of the fifth aspect, the processor may be further configured to: after the outer-layer VLAN header of the second message is removed, if the outer-layer VLAN header of the second message carries the priority information of the second message, the information carried by the inner-layer VLAN header of the second message and used for indicating the VLAN identification is reset to be preset information. The preset information is used for indicating that the second message is a message with priority information.
In a sixth aspect, a second message receiving device in a data center network communicating via a VLAN is provided, where the device may include a forwarding module and a VLAN module. The forwarding module may be configured to receive a second packet sent by a first device in the data center network, where the second packet has a double-layer VLAN header, and the VLAN module may be configured to remove an outer-layer VLAN header of the second packet.
With reference to the sixth aspect, in a first possible implementation manner of the sixth aspect, the VLAN module may be further configured to: before the outer-layer VLAN header of the second message is removed, if the outer-layer VLAN header of the second message carries the priority information of the second message, the priority information is copied to the inner-layer VLAN header of the second message.
With reference to the first possible implementation manner of the sixth aspect, in a second possible implementation manner of the sixth aspect, the VLAN module may further be configured to: after the outer-layer VLAN header of the second message is removed, if the outer-layer VLAN header of the second message carries the priority information of the second message, the information carried by the inner-layer VLAN header of the second message and used for indicating the VLAN identification is reset to be preset information. The preset information is used for indicating that the second message is a message with priority information.
in a seventh aspect, a third messaging device in a data center network communicating via a VLAN is provided, which may include means for performing the method of the first aspect.
in an eighth aspect, a message receiving device in a third data center network communicating via a VLAN is provided, which may include means for performing the method of the second aspect.
drawings
in order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments of the present invention will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1A is a format of a message with a single layer VLAN;
Fig. 1B is a format of a double-layer VLAN packet according to an embodiment of the present invention;
FIG. 2 is a diagram of one possible architecture for a data center network;
FIG. 3 is a diagram of the software architecture inside a server after running a virtual machine in the server;
Fig. 4 is a flowchart of a message sending method according to an embodiment of the present invention;
fig. 5 is a flowchart of a message receiving method according to an embodiment of the present invention;
Fig. 6 is a flowchart of a possible method for sending a message by a VM according to an embodiment of the present invention;
Fig. 7 is a flowchart of a possible method for encapsulating and forwarding a packet by a switch according to an embodiment of the present invention;
Fig. 8 is a flowchart of a possible processing method after a virtual machine receives a message according to an embodiment of the present invention;
fig. 9 is a flowchart of a possible processing method after a switch receives a message according to an embodiment of the present invention;
Fig. 10 is a schematic structural diagram of a first message sending device according to an embodiment of the present invention;
Fig. 11A and fig. 11B are schematic diagrams of two possible structures of a second message sending device according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a first message receiving device according to an embodiment of the present invention;
Fig. 13 is a schematic structural diagram of a second possible message receiving device according to an embodiment of the present invention;
Fig. 14 is a block diagram of a possible structure of a third message sending device according to an embodiment of the present invention;
fig. 15 is a block diagram of a possible structure of a third message receiving apparatus according to an embodiment of the present invention.
Detailed Description
in order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be described below in conjunction with the drawings in the embodiments of the present invention.
hereinafter, some terms in the present invention will be explained.
1) The first device may be, for example, a physical device such as a switch (switch) or a router (router), or may be a physical device such as a server, or may also be a virtual device such as a virtual machine running in the server, where the virtual machine may include different types of virtual machines such as a virtual terminal and a virtual server.
The second device may be, for example, a physical device such as a switch or a router, or may be a physical device such as a server, or may also be a virtual device such as a virtual machine running in the server, where the virtual machine may include different types of virtual machines such as a virtual terminal and a virtual server.
The third device may be, for example, a physical device such as a switch or a router, or may be a physical device such as a server, or may also be a virtual device such as a virtual machine running in the server, where the virtual machine may include different types of virtual machines such as a virtual terminal and a virtual server.
2) The outer VLAN header is a layer of VLAN header additionally added to the packet in the embodiment of the present invention, and the format of the outer VLAN header is the same as the format of the VLAN header carried by the packet itself, and all occupies 12 bits (bit). The inner layer VLAN head is a VLAN head carried by the message in VLAN communication.
The inner layer VLAN head is the single layer VLAN head of the message.
For example, please refer to fig. 1A and fig. 1B, where fig. 1A is an original format of a message in a VLAN, and fig. 1B is a format of the message after an outer VLAN header is added to the message in the embodiment of the present invention. Wherein, the Destination Address (DA) field in fig. 1A and 1B is used to carry an Address of a device to which a message is to be sent, that is, a destination Address of the message, the Source Address (SA) field is used to carry an Address of the device sending the message, the Tag Protocol Identifier (TPID) field is a set of 16-bit fields, the value of which is generally set to 0x8100, so as to distinguish the frame as a frame of IEEE 802.1Q Type, the Priority Code Point (PCP) field is a set of 3-bit fields, which is used as a Priority of the frame, the standard Format indicates that the CFI field is a 1-bit field, if the CFI carries a value of 1, the MAC Address of the message is in the non-standard Format, if the CFI carries a value of 0, the MAC Address of the message is in the standard Format, the Type field is used to indicate a DATA message (DATA) field belonging to the DATA message Type, i.e., the message body, and a Frame Check Sequence (FCS) field as a Check field for storing a CRC Check value. Fig. 1B adds several fields of TPID, PCP, CFI, and SVLAN, in which a Service provider virtual local area network (SVLAN) field occupies 12 bits, a Customer virtual local area network (Customer VLAN, CVLAN) field also occupies 12 bits, and the SVLAN field and the CVLAN field are used to collectively carry a VLAN ID, for example, the upper 12 bits of the VLAN ID may be carried in the SVLAN, and the lower 12 bits of the VLAN ID may be carried in the CVLAN.
3) "plurality" means two or more.
Please refer to fig. 2, which is a diagram illustrating a possible architecture of DCN. The devices 1 and 2 in fig. 2 may be core switches, for example, and the core switches may communicate with each other through an Internal Border Gateway Protocol (IBGP), and the core switches may communicate with the Internet through an External Border Gateway Protocol (EBGP), for example.
The core switches may be respectively connected to the aggregation switches, and the aggregation switches may also be respectively connected to the access layer devices, where the access layer devices may include, for example, a common switch, and the common switch may be respectively connected to some terminal devices, for example, the terminal devices may include Customer Edge (CE) devices, and the like, and for example, the common switch may be connected to the CE through a cable, such as a 10G cable. Therefore, inside the DCN, the core switch can communicate with the terminal equipment, and the bottom layer terminal equipment can also communicate with the Internet through the data center. For the sake of convenience, the terminal devices inside the data center network are collectively referred to as a Server (Server), and the terminal devices outside the data center network are collectively referred to as a Client (Client).
The locations of various devices, the number of devices, the communication protocol, and the names of the devices shown in fig. 2 are only examples, and are not limiting to the embodiments of the present invention, and any data center network is within the scope of the embodiments of the present invention.
Now, in order to meet the requirement of cloud computing, many physical devices in a data center network are virtualized, for example, a plurality of Virtual Machines (VMs) may be installed and run on a plurality of servers, please refer to fig. 3, which is a schematic diagram of a software Architecture after installing VMs in a server, and fig. 3 takes a server of an X86 Architecture (Architecture) as an example. In fig. 3, it is assumed that VM1 and VM2 are installed in the server, an Operating System (OS) 1 is run in VM1, an Operating System 2 is run in VM2, an application 1 is installed in VM1, and an application 2 is installed in VM 2. Also shown in fig. 3 is a Hypervisor (Hypervisor) installed in the server, or may be referred to as a Virtual Machine Monitor (VMM), which is a software platform for managing VMs. In host virtualization, Hypervisor may be an application running on the operating system of the server, which is represented in FIG. 3 as operating system 3.
Currently, in a data center network, a VM is divided into a plurality of user groups, and each user group may be labeled with a VLAN ID to distinguish different user groups. However, the existing VLAN ID has only 12 bits, and at most 4K partitions are supported, which far fails to satisfy the requirement of the existing data center network for user group differentiation. In the embodiment of the invention, double-layer VLANs can be adopted to represent the VLAN IDs, so that the number of the VLAN IDs supported by the data center network can reach 4095 by 4095, the value range of the VLAN IDs is greatly expanded, more user groups can be conveniently identified, and the development of the data center network towards the cloud computing direction is facilitated. In addition, if the packet is encapsulated based on VXLAN, more bandwidth is wasted, and the time required for encapsulation is longer, which results in poorer time delay performance.
The embodiments of the present invention are described below with reference to the drawings of the specification.
Referring to fig. 4, a message sending method is provided, where the method may be performed by a first device, and the first device may be, for example, a server in a data center network, for example, a physical server or a virtual machine in the physical server, or may be a switch or a router in the data center network. The flow of the method is described below.
Step 401: a first device in a data center network which communicates through a VLAN acquires a first message to be sent;
step 402: the first equipment adds a VLAN (virtual local area network) head to the first message to obtain a second message with a double-layer VLAN head, and the first equipment carries first identification information in an outer-layer VLAN head of the second message; the identification information carried by the outer VLAN head and the identification information carried by the inner VLAN head are used for jointly indicating a pre-configured VLAN identification;
Step 403: and the first equipment sends the second message to second equipment in the data center network.
Referring to fig. 5, a message receiving method is provided, where the method may be performed by a second device, and the second device may be, for example, a server in a data center network, for example, a physical server or a virtual machine in the physical server, or a switch or a router in the data center network. The flow of the method is described below.
Step 501: receiving a second message sent by first equipment in the data center network by second equipment in the data center network which communicates through the VLAN; the second message has a double-layer VLAN header;
Step 502: and the second equipment removes the outer VLAN header of the second message.
Fig. 4 and 5 illustrate corresponding methods, which are described below by way of a few examples. In view of the fact that the first device may be a server or may also be a switch or a router, it will be separately described in the following examples.
Example 1
The case where the first device is a server, and example 1 exemplifies that the first device is a VM in the server. Since the existing VMs support the common VLAN header, example 1 first describes how to reconfigure the VM so that the VM can support the dual-layer VLAN header.
Determining whether priority information needs to be configured on the VM, if the priority information does not need to be configured on the VM, the VM can directly cross a protocol stack, and a function provided by a drive of a virtual network card of the VM (if the first device is a server, a drive of a physical network card of the server) is called to configure the VM, that is, new VLAN setting information is configured for the VM, so that the VM can adopt a double-layer VLAN format to encapsulate a message under the new VLAN setting information. In the data center network, a VLAN ID is generally configured for a VM, and the VLAN ID in the embodiment of the present invention includes 24 bits, that is, the VLAN ID configured for the VM is identified by using 24 bits, and the VLAN ID is configured for the VM, and may also be configured by a function provided by a driver, or may also be configured by another method. For example, by driving the provided function, the VM may be further instructed to encapsulate the upper 12 bits of the VLAN ID in the SVLAN and the lower 12 bits of the VLAN ID in the CVLAN when encapsulating the packet.
if priority information does not need to be configured on the VM, the function provided by the drive of the virtual network card can be directly called to configure the VLAN by crossing a protocol stack, namely, new VLAN setting information is configured for the VM, so that the VM can adopt a double-layer VLAN format to package messages, and similarly, the function provided by the drive can also indicate the VM to package the high 12 bits of the VLAN ID in the SVLAN and package the low 12 bits of the VLAN ID in the CVLAN when the messages are packaged.
If the VM needs to configure the priority information, a protocol stack running on an operating system of the VM may be called to configure a value of the VLAN ID portion carried by the CVLAN carrying the priority packet, that is, how much the VLAN ID carried by the CVLAN carrying the priority packet should be set by the protocol stack. For example, a VLAN configuration (Vconfig) command provided by the protocol stack may be invoked for configuration, such as a VLAN ID carried by a CVLAN of a packet carrying priority information may be configured to be VLAN 0. Generally, when a VM encapsulates a message, the message needs to pass through a protocol stack first, and if priority information needs to be configured for the message, the protocol stack may add a single-layer VLAN to the message, that is, add a CVLAN, set a VLAN ID carried by the CVLAN of the message to VLAN 0, and configure the priority information on the CVLAN. Optionally, the VM may also call the Vconfig command provided by the protocol stack to configure the required priority information, so that when the packet passes through the protocol stack, the protocol stack may add corresponding priority information to the packet. After the protocol stack is configured, the protocol stack can be passed over, and a function provided by a driver of a virtual network card of the VM is called to configure the VLAN, that is, new VLAN setting information is configured for the VM, so that the VM can package a message in a double-layer VLAN format, and similarly, through the function provided by the driver, the VM can also be instructed to package the high 12 bits of the VLAN ID in the SVLAN and package the low 12 bits of the VLAN ID in the CVLAN when the message is packaged.
optionally, the VM may configure the priority information or not, and if the priority information is configured, the VM may select to add the priority information to all or part of the messages to be sent when sending the messages. Optionally, a VM may also be configured with a plurality of different priority information, so that if the VM is to add priority information to a packet, one priority information may be selected from the plurality of priority information to add, and the priority information that the VM adds to different packets may also be different, which may facilitate distinguishing priorities of different packets, so that packets with different priorities may be better transmitted in a network.
Alternatively, if the first device is a server, then the second device may be a switch or a router. Since the present switch or router may not be able to support 24-bit VLAN ID, although it may also support a dual-layer VLAN header, example 1 also describes how to reconfigure the switch or router so that the switch or router can support 24-bit VLAN ID.
Alternatively, the switch or the router may be configured to provide entries related to forwarding packets that can support 24-bit VLAN IDs. For example, the effective fields of the VLANs in the table entries related to the forwarding VLAN packet provided by the switch or the router may be all extended to 24 bits, so that the table entries related to the forwarding packet can both support the VLAN ID of 24 bits, and thus, the switch or the router can identify the second packet after receiving the second packet, thereby implementing correct forwarding of the second packet.
Optionally, a flow of the switch or the router analyzing the VLAN packet may be configured, so that the flow of the switch or the router analyzing the VLAN packet can support the analysis of the double-layer VLAN, for example, the switch or the router may analyze not only an outer-layer VLAN header of the packet but also an inner-layer VLAN header of the packet.
Example 2
Example 1 describes how to configure a VM first in the case where the first device is a VM, and example 2 next describes how to send a message after the VM is successfully configured according to the method of example 1 in the case where the first device is a VM. Optionally, the VM sends the message, which may be sent by an application running in the VM. Referring to fig. 6, a possible method for an application running in a VM to send a message is described.
1. The VM calls an interface of a protocol stack running in the operating system of the VM to send data. This data may be referred to as a first packet, for example.
2. when a first message passes through a protocol stack, determining that priority information does not need to be carried for the first message.
If the VM determines that the first packet needs to carry priority information, the VM may punch a single-layer VLAN header for the first packet through a protocol stack, set a part of a VLAN ID carried by the single-layer VLAN header to VLAN 0, that is, set all bits in the single-layer VLAN header, which are used to indicate the VLAN ID of the VM, to 0, and carry the priority information selected for the first packet in the single-layer VLAN header. If the VM determines that the first packet does not need to carry priority information, the protocol stack has two possible ways, one is to print a single-layer VLAN header on the first packet as usual, the single-layer VLAN header may not need to carry priority information, and a value of a VLAN ID portion carried by the single-layer VLAN header may be set according to the VLAN ID of the VM, for example, the lower 12 bits of the VLAN ID of the VM may be carried in the CVLAN of the first packet. Alternatively, the protocol stack may not print a single-layer VLAN header for the first message, and may directly perform step 3, that is, transmit the first message to a driver of the virtual network card, and add the VLAN header to the first message by the driver of the virtual network card, for example, the driver of the virtual network card may add the single-layer VLAN header to the first message, or may add the double-layer VLAN header.
3. And transmitting the first message to a drive of a virtual network card of the VM.
4. The drive of the virtual network card marks a VLAN head on a first message transmitted by the protocol stack according to the configured VLAN, and a second message with a double-layer VLAN head is obtained.
Optionally, if the protocol stack marks a single-layer VLAN header for the first message, the driving of the virtual network card marks a VLAN header for the first message, which may mean that an outer-layer VLAN header is marked for the first message, and if the protocol stack does not mark a single-layer VLAN header for the first message, the driving of the virtual network card marks a VLAN header for the first message, which may mean that an inner-layer VLAN header and an outer-layer VLAN header are marked for the first message.
The drive of the virtual network card may add the upper 12 bits of the VLAN ID to the SVLAN of the second message, for example, the information formed by the upper 12 bits of the VLAN ID is referred to as first identification information, and then the drive of the virtual network card may be that the first identification information is carried in the outer layer VLAN header of the second message. Or, if the driver of the virtual network card needs to print an inner layer VLAN header on the first message, the driver of the virtual network card may add the lower 12 bits of the VLAN ID to the CVLAN of the second message, for example, the information formed by the lower 12 bits of the VLAN ID is referred to as second identification information, and the driver of the virtual network card may carry the second identification information in the inner layer VLAN header of the second message.
5. And the drive of the virtual network card determines whether the second message is a priority message according to the inner layer VLAN header of the second message, namely, whether the inner layer VLAN header of the second message carries priority information is judged. If the inner layer VLAN head of the second message carries the priority information, executing the steps 6 and 7, otherwise executing the step 8.
Optionally, if the second packet carries the priority information, the inner VLAN header of the second packet is added by the protocol stack, and if the second packet does not carry the priority information, the inner VLAN header of the second packet may be added by the protocol stack or may be added by a driver of the virtual network card. Preferably, if the second packet does not carry priority information, the inner layer VLAN header of the second packet may be added by a driver of the virtual network card.
6. If the inner layer VLAN header of the second packet carries the priority information, the driver of the virtual network card copies the priority information carried in the inner layer VLAN header of the second packet to the outer layer VLAN header of the second packet, for example, the priority information carried in the CVLAN of the second packet may be copied to the SVLAN of the second packet.
Because the SVLAN is visible to nodes passing by during the transmission of the second message, the priority information is carried in the SVLAN, so that nodes along the way can better transmit the second message, for example, the second message can be transmitted preferentially according to the priority information of the second message.
Optionally, if the priority information carried in the CVLAN of the second message is copied to the SVLAN of the second message, the driver of the virtual network card may also delete the priority information carried in the CVLAN of the second message, so that the same information may be prevented from being repeatedly carried in one message as much as possible.
7. if the inner layer VLAN header of the second message carries priority information, the driver of the virtual network card may also reconfigure a value of the VLAN ID portion carried by the CVLAN for the second message according to the configured VLAN and the VLAN ID. Where the information formed by the bits in the CVLAN for indicating the VLAN ID may be identification information carried by the CVLAN, the identification information carried by the CVLAN may be set as the second identification information, for example. Step 8 is performed.
Because, if the first packet carries priority information, the protocol stack may set the VLAN ID carried by the CVLAN of the first packet to VLAN 0, and the second packet is to be transmitted, it is necessary that the identification information carried by the SVLAN and the identification information carried by the CVLAN together indicate the VLAN ID, so the driver of the virtual network card may reset the value of the VLAN ID part carried by the CVLAN of the second packet, i.e., reset the identification information carried by the CVLAN, e.g., set the identification information carried by the CVLAN to the second identification information, e.g., may put the lower 12 bits of the VLAN ID of the VM into the CVLAN, where the information constituted by the lower 12 bits of the VLAN ID is referred to as the second identification information.
8. and the drive of the virtual network card sends the second message to the virtual network card of the VM.
9. and the virtual network card of the VM sends a second message. For example, the virtual network card of the VM may send the second message through the physical network card of the server where the VM is located.
in addition, in example 2, since the work of encapsulating the packet is already completed by the VM, if the second device receiving the second packet is the switch or the router configured according to the configuration method described in example 1, the switch or the router may forward the second packet in a normal manner.
Example 3
In both examples 1 and 2, the first device is a VM, that is, the work of encapsulating the dual-layer VLAN header in the packet is all completed by the VM, in example 3, the process of pre-configuring the switch or the router and encapsulating the packet by the switch or the router is described by taking the first device as the switch or the router, and in example 3, the work of encapsulating the dual-layer VLAN header in the packet can be completed by the switch or the router.
optionally, the packet encapsulated by the switch or the router may be a packet sent by the VM and required to be forwarded, or may also be a packet generated by the switch or the router itself, for example, some possible applications may also be run in the switch or the router, and these applications may also generate a packet, so that the switch or the router may also need to send the packet.
Optionally, generally, if an outer VLAN is added to the message by the VM, the outer VLAN may also be resolved by the VM, if an outer VLAN is added to the message by the switch or the router, the outer VLAN may continue to be resolved by the switch or the router, or the outer VLAN may also be resolved by a Controller (Controller) for controlling the switch or the router.
For example, a new packet encapsulation format may be configured for the switch or the router in advance, so that the switch or the router can encapsulate the received packet in the format of the dual-layer VLAN.
Optionally, when the switch or the router adds the outer VLAN header to the packet, different bases may be provided, for example, the switch or the router may be added based on the VM, or may be added based on the port, or may be added based on the communication protocol, so that the switch or the router may have different configuration modes. This is exemplified below.
The first mode is as follows: the switch or router encapsulates a double-layer VLAN header for the packet based on the VM. In this case, the switch or the router receives the message sent by the VM, encapsulates the double-layer VLAN header for the message, and may add an outer-layer VLAN header to the message, and may also set the inner-layer VLAN header for the message if the inner-layer VLAN header of the message is not set, or encapsulates the double-layer VLAN header for the message, or adds the inner-layer VLAN header and the outer-layer VLAN header to the message.
Since one switch or router can be connected to multiple servers, that is, multiple VMs, the VLAN ID carried in the packet may be the VLAN ID of the VM sending the packet. Optionally, after the switch or the router receives the first message, if the VM has marked a single-layer VLAN for the first message, and the VLAN ID portion carried in the single-layer VLAN of the first packet has filled the lower 12 bits of the VLAN ID of the VM, that is, the first message is a message sent by a VM received by the switch or the router, and the VM has completed setting the CVLAN of the message, the switch or the router may add an outer VLAN header to the first message to obtain a second message, and fills the upper 12 bits of the VLAN ID of the VM that transmitted the first message in the SVLAN of the second message, namely, the outer layer VLAN head of the second message carries the first identification information, so that the first identification information carried by the SVLAN and the identification information carried by the CVLAN of the second message can jointly indicate the VLAN ID of the VM sending the first message, optionally, the switch or the router may determine the VM sending the message according to the source address of the first message. Or, after the switch or the router receives the first message, if the first message already carries a single-layer VLAN, but the VLAN ID portion carried by the single-layer VLAN is empty, or VLAN 0, that is, the first message may be a message sent by a VM received by a switch or a router, and the VM does not set the CVLAN of the first message, or the VLAN ID of the first packet is set to VLAN 0, the switch or the router may add an outer VLAN header to the first packet to obtain a second packet, and fills the VLAN ID of the VM that transmitted the first message in the SVLAN and CVLAN of the second message, wherein the upper 12 bits of the VLAN ID are filled in the SVLAN, the lower 12 bits of the VLAN ID are filled in the CVLAN, so that the SVLAN and CVLAN of the second message may collectively indicate the VLAN ID of the VM that sent the first message, optionally, the switch or the router may determine the VM sending the first message according to the source address of the first message. Or, after the switch or the router receives the first message, if the first message does not carry a single-layer VLAN, the switch or the router may add an inner-layer VLAN header and an outer-layer VLAN header to the first message to obtain a second message, and fill the VLAN ID of the VM sending the first message in the SVLAN and the CVLAN of the second message, where the upper 12 bits of the VLAN ID are filled in the SVLAN and the lower 12 bits of the VLAN ID are filled in the CVLAN, so that the SVLAN and the CVLAN of the second message may jointly indicate the VLAN ID of the VM sending the first message, and optionally, the switch or the router may determine the VM sending the first message according to the source address of the first message.
Optionally, when configuring the switch or the router, the VLAN IDs of multiple VMs may be configured for the switch or the router in advance, for example, a data table may be maintained in the switch or the router, where the data table includes at least one entry, and each entry may record the VLAN ID of one VM, so that the switch or the router can correctly encapsulate the packet.
Alternatively, when configuring the switch or router, the switch or router may be instructed to encapsulate the upper 12 bits of the VLAN ID in the SVLAN when encapsulating the message, or the switch or router may be instructed to encapsulate the upper 12 bits of the VLAN ID in the SVLAN and the lower 12 bits of the VLAN ID in the CVLAN when encapsulating the message. Thus, by configuration, the switch or router knows not only the VLAN ID of each VM, but also how the packet should be encapsulated.
The second mode is as follows: the switch or router encapsulates the packet with a double-layer VLAN header based on the port. In this case, the switch or the router receives the message sent by the VM, encapsulates the double-layer VLAN header for the message, and may add an outer-layer VLAN header to the message, and may also set an inner-layer VLAN header for the message if the inner-layer VLAN header of the message is not set, or encapsulates the double-layer VLAN header for the message, and may add an inner-layer VLAN header and an outer-layer VLAN header to the message.
A switch or router may include a plurality of ports, and then each port of the switch or router may be configured with a VLAN ID in advance, for example, the VLAN ID configured for port 1 is VLAN ID1, the VLAN ID configured for port 2 is VLAN ID2, and so on, and then the switch or router is a message received through which port, and the VLAN ID configured for the port may be encapsulated for the message. Thus, because the number of ports of the switch or router may be smaller than the number of VMs, the number of VLAN IDs to be preconfigured in the switch or router is greatly reduced, saving storage space.
In this case, the VM communicating with the switch or router may configure the VLAN ID of the port corresponding to the VM, for example, the lower 12 bits of the VLAN ID may be configured, so that when the VM sends a packet to be forwarded to the switch or router, the lower 12 bits of the VLAN ID may be filled in the single-layer VLAN header of the packet, after the switch or router receives the packet, only the outer VLAN header needs to be added to the packet, and the upper 12 bits of the VLAN ID are filled in the outer VLAN header according to the VLAN ID configured for the port receiving the packet, that is, the outer VLAN header of the packet carries the first identification information, and the switch or router needs to do less work and has a lighter load, so that the first identification information carried by the outer VLAN and the identification information carried by the inner VLAN of the packet may be used to jointly indicate the VLAN ID preconfigured for the port receiving the packet. Or, in this case, the VM communicating with the switch or router may not be configured with the VLAN ID of its corresponding port, so that when the VM sends a packet to be forwarded to the switch or router, the VM may fill corresponding information in the single-layer VLAN header of the packet, for example, fill the VLAN ID of the VM, or if the VLAN ID of the VM is also a 24-bit VLAN ID indicated by a dual-layer VLAN, the VM may fill the lower 12 bits of the VLAN ID of the VM in the inner-layer VLAN header of the packet, and after the switch or router receives the packet, because the value filled in the inner-layer VLAN header of the packet is likely not the value of the corresponding bit of the VLAN ID configured in advance for the port receiving the packet, the switch or router may modify the value of the bit indicating the VLAN ID in the inner-layer header of the packet, that the lower 12 bits of the VLAN ID configured in advance for the port receiving the packet may be filled in the inner-layer VLAN header of the packet, and the switch or the router can add an outer-layer VLAN header to the message, and fill the upper 12 bits of the VLAN ID into the outer-layer VLAN header according to the VLAN ID configured for the port receiving the message. Or, in this case, the VM communicating with the switch or the router may not be configured with the VLAN ID of the port corresponding to the VM, so that when the VM sends a message to be forwarded to the switch or the router, the VM may not fill information indicating the VLAN ID in the single-layer VLAN header of the message, that is, the value of the bit indicating the VLAN ID of the message in the inner-layer VLAN header of the message may be 0, after the switch or the router receives the message, the switch or the router may fill the lower 12 bits of the VLAN ID configured in advance for the port receiving the message in the inner-layer VLAN header of the message, and the switch or the router may add the outer VLAN header to the message, and fill the upper 12 bits of the VLAN ID in the outer-layer VLAN header according to the port configured for receiving the VLAN ID. Or, in this case, when the VM sends the message to be forwarded to the switch or the router, the VM may not add a single-layer VLAN header to the message, and after the switch or the router receives the message, the switch or the router may add an inner-layer VLAN header and an outer-layer VLAN header to the message, and according to the VLAN ID configured for the port receiving the message, fill the outer-layer VLAN header with the upper 12 bits of the VLAN ID, and fill the inner-layer VLAN header with the lower 12 bits of the VLAN ID.
alternatively, when configuring the switch or router, the switch or router may be instructed to encapsulate the upper 12 bits of the VLAN ID in the SVLAN when encapsulating the message, or the switch or router may be instructed to encapsulate the upper 12 bits of the VLAN ID in the SVLAN and the lower 12 bits of the VLAN ID in the CVLAN when encapsulating the message. Thus, by configuration, the switch or router knows not only the VLAN ID of each port, but also how the packet should be encapsulated.
The third mode is as follows: the switch or router encapsulates the packet with a double-layer VLAN header based on the communication protocol. In this case, the switch or the router may receive the message sent by the VM, encapsulate a double-layer VLAN header for the message, may add an outer VLAN header to the message, and if the inner VLAN header of the message is not set, may also set an inner VLAN header of the message, or encapsulate a double-layer VLAN header for the message, may add an inner VLAN header and an outer VLAN header to the message, or in this case, the switch or the router may generate the message by itself, for example, some applications may be installed in the switch or the router, and the switch or the router may need to send the message, and then encapsulate a double-layer VLAN header for the message, may add an inner VLAN header and an outer VLAN header to the message.
the data center network may support a plurality of different communication protocols, and then a VLAN ID may be configured in advance for each communication protocol supported by the switch or the router, for example, the VLAN ID configured for communication protocol 1 is VLAN ID1, the VLAN ID configured for communication protocol 2 is VLAN ID2, and so on, and then what is to be encapsulated by the switch or the router is a packet under which communication protocol, the VLAN ID configured for the communication protocol may be encapsulated for the packet. Thus, because the number of communication protocols may be smaller than the number of VMs, the number of VLAN IDs to be preconfigured in the switch or router is greatly reduced, saving storage space.
Two situations of a message sent by a switch or router encapsulation VM and a message generated by the switch or router encapsulation itself are described below.
If a switch or a router encapsulates a message sent by a VM, the VM communicating with the switch or the router may be configured with a VLAN ID configured by each communication protocol, for example, the VM may be configured with the lower 12 bits of the VLAN ID configured by each communication protocol, when the VM sends the message to be forwarded to the switch or the router, the VM may fill the lower 12 bits of the VLAN ID of the corresponding communication protocol in the single-layer VLAN header of the message, after receiving the message, the switch or the router only needs to add an outer-layer VLAN header to the message, and fill the upper 12 bits of the VLAN ID in the outer-layer VLAN header according to the VLAN ID configured by the communication protocol to which the message belongs, so that the switch or the router needs to do less work and has a lighter load. Or, if the switch or the router encapsulates the packet sent by the VM, or does not configure the VM communicating with the switch or the router with a VLAN ID configured for each communication protocol, when the VM sends the packet to be forwarded to the switch or the router, the VM may fill corresponding information in the single-layer VLAN header of the packet, for example, fill the VLAN ID of the VM, or if the VLAN ID of the VM is also a 24-bit VLAN ID indicated by a dual-layer VLAN, the VM may fill the lower 12 bits of the VLAN ID of the VM in the inner-layer VLAN header of the packet, after the switch or the router receives the packet, because the value of the corresponding bit of the VLAN ID filled in the inner-layer VLAN header of the packet is not likely to be previously configured for the communication protocol to which the packet belongs, the switch or the router may modify the value of the bit indicating the VLAN ID in the inner-layer VLAN header of the packet, that the lower 12 bits of the VLAN ID previously configured for the communication protocol to which the packet belongs may be filled in the inner-layer VLAN header of the packet, and the switch or the router can add an outer-layer VLAN header to the message, and fill the upper 12 bits of the VLAN ID into the outer-layer VLAN header according to the VLAN ID configured for the communication protocol of the message. Or, if the switch or the router encapsulates the packet sent by the VM, or does not configure the VM communicating with the switch or the router with a VLAN ID configured for each communication protocol, then when the VM sends the packet to be forwarded to the switch or the router, the VM may not fill information for indicating the VLAN ID in the single-layer VLAN header of the packet, that is, the value of the bit for indicating the VLAN ID of the packet in the inner-layer VLAN header of the packet may be 0, after the switch or the router receives the packet, the switch or the router may fill the lower 12 bits of the VLAN ID configured for the communication protocol to which the packet belongs in advance in the inner-layer VLAN header of the packet, and the switch or the router may add the outer VLAN header to the packet, and fill the upper 12 bits of the VLAN ID in the outer-layer header according to the VLAN ID configured for the communication protocol to which the packet belongs. Or, if the switch or the router encapsulates the message sent by the VM, when the VM sends the message to be forwarded to the switch or the router, the VM may not add a single-layer VLAN header to the message, and after the switch or the router receives the message, the switch or the router may add an inner-layer VLAN header and an outer-layer VLAN header to the message, and fill the upper 12 bits of the VLAN ID into the outer-layer VLAN header and the lower 12 bits of the VLAN ID into the inner-layer VLAN header according to the VLAN ID configured for the communication protocol to which the message belongs.
if the switch or the router encapsulates the message generated by itself, the switch or the router may add an inner VLAN header and an outer VLAN header to the message, and the switch or the router fills a VLAN ID pre-configured for a communication protocol to which the message belongs in the SVLAN and the CVLAN of the message, so that the SVLAN and the CVLAN of the message may indicate the VLAN ID together.
Alternatively, when configuring the switch or router, the switch or router may be instructed to encapsulate the upper 12 bits of the VLAN ID in the SVLAN when encapsulating the message, or the switch or router may be instructed to encapsulate the upper 12 bits of the VLAN ID in the SVLAN and the lower 12 bits of the VLAN ID in the CVLAN when encapsulating the message. Thus, by configuration, the switch or router knows not only the VLAN ID of each communication protocol, but also how the packet should be encapsulated.
Optionally, in addition to the above three manners, if a packet is a packet generated by the switch or the router itself, the switch or the router may add an inner-layer VLAN header and an outer-layer VLAN header to the packet, and the switch or the router may also fill the upper 12 bits and the lower 12 bits of the VLAN ID of the switch or the router in the SVLAN and the CVLAN of the packet, respectively, so that the identification information carried by the SVLAN and the identification information carried by the CVLAN of the packet may jointly indicate the VLAN ID of the switch or the router.
Optionally, the switch or the router is to forward the packet encapsulated with the dual-layer VLAN header, so that the entry provided by the switch or the router and related to forwarding the VLAN packet can support a VLAN ID of 24 bits by configuration. For example, the effective fields of the VLANs in the table entries related to the forwarded packet provided by the switch or the router may be all extended to 24 bits, so that the table entries related to the forwarded packet can both support the VLAN ID of 24 bits, and thus, the switch or the router can correctly forward the second packet after obtaining the second packet.
Optionally, the table entry provided by the switch or the router and related to forwarding the VLAN packet may be of various types, for example, the table entry may include at least one of a VLAN configuration table of a port, a two-layer forwarding table, and an Access Control List (ACL) configuration table, and may further include other possible tables.
optionally, a flow of the switch or the router analyzing the VLAN packet may also be configured, so that the flow of the switch or the router analyzing the VLAN packet can support the analysis of the double-layer VLAN.
Example 4
Example 3 describes how to pre-configure a switch or a router when the switch or the router encapsulates a message, and how to encapsulate the message, example 4 describes a process of encapsulating the message and sending the message by the switch or the router, example 4 takes the switch as an example. And the switch or the router in example 4 encapsulates the message sent by the VM, the encapsulation manner in example 4 is only one possible manner described in example 3, and only to make the process of sending the message more complete, an encapsulation manner is optionally selected for example. Please refer to fig. 7.
1. VM1 sends the first message to the switch, and the switch receives the first message.
The first packet carries priority information, so the VM1 puts a single-layer VLAN header on the first packet. The first message is to be sent to a second device in the data center network, for example, the second device is VM 2.
Optionally, if the first packet does not carry the priority information, the VM1 may not print a single-layer VLAN header on the first packet.
2. The switch marks an outer-layer VLAN header on the first message according to the VLAN configuration rule (namely the pre-configured VLAN setting information) to obtain a second message.
Example 4 takes a switch encapsulating a message based on a VM as an example. Since the first packet carries priority information, and thus the VLAN ID carried by the single-layer VLAN header of the first packet may be configured as VLAN 0 by the VM, then, for example, the switch may determine the preconfigured VLAN ID of the VM1 that sent the first packet, the switch may add the upper 12 bits of the VLAN ID of the VM1 to the SVLAN of the second packet and the lower 12 bits of the VLAN ID of the VM1 to the CVLAN of the second packet, i.e., carry the first identification information in the SVLAN, and carry the second identification information in the CVLAN in the reconfiguration.
Optionally, the switch may further determine whether the second packet is a priority packet according to an inner VLAN header of the second packet (i.e., a single-layer VLAN header of the first packet), that is, determine whether the inner VLAN header of the second packet carries priority information. And (3) if the inner layer VLAN header of the second message carries the priority information, executing the step (3), otherwise, executing the step (4).
3. if the inner VLAN header of the second packet carries the priority information, the switch copies the priority information carried in the inner VLAN header of the second packet to the outer VLAN header of the second packet, for example, the priority information carried in the CVLAN of the second packet may be copied to the SVLAN of the second packet.
Because the SVLAN is visible to nodes passing by during the transmission of the second message, the priority information is carried in the SVLAN, so that nodes along the way can better transmit the second message, for example, the second message can be transmitted preferentially according to the priority information of the second message.
Optionally, if the priority information carried in the CVLAN of the second packet is copied to the SVLAN of the second packet, the switch may also delete the priority information carried in the CVLAN of the second packet, so that the same information may be prevented from being repeatedly carried in one packet as much as possible.
4. The switch checks whether ingress filtering is turned on. If it is on, step 5 is executed, and if it is not on, step 7 is executed.
5. If the ingress filtering is started, the switch determines whether the extended VLAN of the second packet is already set in the port table, that is, whether the port table of the switch supports a VLAN ID of 24 bits. Step 6 is performed if the port table of the switch does not support a 24-bit VLAN ID, and step 7 is performed if the port table of the switch supports a 24-bit VLAN ID.
6. And if the port table of the switch does not support the 24-bit VLAN ID, discarding the second message. The flow ends.
7. If the port table of the switch supports 24-bit VLAN ID, the switch searches the two-layer forwarding table by using the Source MAC (SMAC) of the second message and the VLAN ID of the second message. And if the two-layer forwarding table is not found, executing the step 8, and if the two-layer forwarding table is found, executing the step 9.
8. If the second-layer forwarding table is not found according to the SMAC + the VLAN ID of the second message, the switch adds a new record in the second-layer forwarding table, and adds the SMAC of the second message, the VLAN ID carried by the second message and the port entry information of the second message into the new record. Step 9 is performed.
9. The switch continues to look up the second layer forwarding table with the VLAN ID of the destination mac (dmac) + second packet. If not, step 10 is performed, if found, step 11 is performed.
10. If the second layer forwarding table is not found according to the DMAC + VLAN ID of the second packet, the second packet may be flooded on all ports of the switch configured with VLANs having the same VLAN ID as the VLAN ID of the second packet.
11. And if the second-layer forwarding table is found according to the DMAC and the VLAN ID of the second message, forwarding according to the searched record in the second-layer forwarding table.
Optionally, the first device may be a VM, or may also be a switch or a router, and similarly, the second device may also be a VM, or may also be a switch or a router, that is, if the VM adds an outer VLAN header to the packet, the work of removing the outer VLAN header of the packet may be performed by the VM, and if the switch or the router adds an outer VLAN header to the packet, the work of removing the outer VLAN header of the packet may be performed by the switch or the router, or may also be performed by a controller for controlling the switch or the router. Described separately below.
example 5
In example 5, the case where the VM removes the outer VLAN header of the packet is described. In example 5, it is possible to add an outer VLAN header to the packet in other VMs. Please refer to fig. 8.
1. And the virtual network card of the VM receives the second message.
The second packet carries a double-layer VLAN header, and the second packet added with the outer-layer VLAN header may be another VM, and the second packet may be directly sent by another VM or may be forwarded through a switch or a router.
2. And the virtual network card transmits the second message to a drive of the virtual network card.
3. the driver of the virtual network card may first determine whether the SVLAN field of the second packet carries priority information. If the priority information is carried, executing the step 4, otherwise executing the step 5.
4. and if the second message carries the priority information, the drive of the virtual network card copies the priority information carried in the SVLAN of the second message to the CVLAN of the second message for indicating the position of the priority information.
Optionally, if, when encapsulating the second packet, the priority information in the CVLAN of the second packet is not deleted after copying the priority information carried in the CVLAN of the second packet to the SVLAN of the second packet, step 4 may not be performed.
5. And the drive of the virtual network card removes the outer VLAN header of the second message.
Optionally, when the protocol stack confirms the packet carrying the priority information, it may be necessary to set a VLAN ID portion carried by the CVLAN of the packet to a preset value, and set information, which is carried by the CVLAN of the packet and used for indicating an identifier of a VLAN ID of a device that sends the packet, to preset information, for example, to VLAN 0, so that if the second packet carries the priority information, the driver of the virtual network card may set the VLAN ID carried by the CVLAN of the first packet to VLAN 0.
6. And the drive of the virtual network card sends the second message with the outer VLAN header removed to a protocol stack of the VM for processing.
For example, the protocol stack may analyze the second packet from which the outer VLAN header is removed, so as to obtain the content carried by the second packet, and transmit the content of the second packet to an application waiting for receiving the second packet in the VM.
optionally, the driver of the virtual network card may also remove the inner VLAN header of the second message, and then send the second message after removing the inner VLAN header and the outer VLAN header to the protocol stack for processing. The second packet with the outer VLAN header removed may be referred to as a first packet, or the second packet with the inner VLAN header and the outer VLAN header removed may be referred to as a first packet.
Example 6
In example 6, the case where the outer VLAN header of the packet is removed by the switch or the router is described, and the switch is taken as an example. In example 6, it is possible to add an outer VLAN header to the packet to be another switch or router. Please refer to fig. 9.
1. The switch receives the second message.
The second packet carries a double-layer VLAN header, and the second packet added with the outer VLAN header may be from another VM or may be forwarded through another switch or router.
2. The switch may first determine whether the SVLAN field of the second packet carries priority information. If the priority information is carried, executing the step 3, otherwise executing the step 4.
3. And if the second message carries the priority information, the switch copies the priority information carried in the SVLAN of the second message to the CVLAN of the second message to indicate the position of the priority information.
Optionally, if, when encapsulating the second packet, the priority information in the CVLAN of the second packet is not deleted after copying the priority information carried in the CVLAN of the second packet to the SVLAN of the second packet, step 3 may not be performed.
4. The switch removes the outer VLAN header of the second message.
5. And the switch forwards the second message without the outer VLAN header.
For example, the switch may forward the second packet by looking up the forwarding table according to the destination address carried in the second packet, and refer to the prior art for how the switch forwards the packet carrying the single-layer VLAN, which is not described herein repeatedly.
Optionally, the switch may also remove the inner VLAN header of the second packet, and then forward the second packet after removing the inner VLAN header and the outer VLAN header. The second packet with the outer VLAN header removed may be referred to as a first packet, or the second packet with the inner VLAN header and the outer VLAN header removed may be referred to as a first packet.
Generally, modifying the code of the protocol stack is cumbersome and difficult to implement. Therefore, in the embodiment of the present invention, when configuring the VM, the configuration function configuration provided by the driver of the virtual network card of the VM may be directly invoked without performing configuration through a protocol stack. Therefore, the configuration of the VM can be completed on the premise of not modifying the protocol stack code, and the method is easy to popularize and apply.
In the embodiment of the invention, the priority information can be preset on the VM, and the VM can select the priority information for the message when sending the message, so that different messages can have proper sending modes.
in the embodiment of the invention, the work of encapsulating the outer VLAN header for the message can be realized by the VM or can also be realized by equipment such as a switch or a router, and the mode is more flexible.
Referring to fig. 10, a first messaging device is provided, which may be located in a data center network communicating via a VLAN, and which may include a memory 1001, a processor 1002, and a sender 1003.
The processor 1002 may be a Central Processing Unit (CPU) or an Application Specific Integrated Circuit (ASIC), one or more Integrated circuits for controlling program execution, or a hardware Circuit developed by using a Field Programmable Gate Array (FPGA).
The number of the memories 1001 may be one or more. The Memory 1001 may include a Read Only Memory (ROM), a Random Access Memory (RAM), and a disk Memory.
The transmitter 1003 may be used for network communication with an external device.
The memory 1001 and the transmitter 1003 may be connected to the processor 1002 via the bus 1000 (fig. 10 is taken as an example), or may be connected to the processor 1002 via a dedicated connection line.
The processor 1002 is programmed to solidify the code corresponding to the method shown in the foregoing description into the chip, so that the chip can execute the method shown in fig. 4 or fig. 6 when running. How to program the processor 1002 is well known to those skilled in the art and will not be described herein.
The message sending device in this embodiment may be the same device as the first device described in the foregoing embodiments, for example, the message sending device in this embodiment may be the physical server serving as the first device as described above, or a VM running in the physical server serving as the first device. Therefore, the steps executed by each functional module of the message sending device in this embodiment are not described in detail, and reference may be made to the description in the foregoing embodiments.
Referring to fig. 11A, a second message sending device is provided, where the message sending device may be located in a data center network communicating through a VLAN, and the message sending device may include a VLAN module 1101 and a forwarding module 1102.
For example, the VLAN module 1101 and the forwarding module 1102 may be implemented by software, or may also be implemented by hardware, for example, the VLAN module 1101 and the forwarding module 1102 may be both independent hardware modules, or the VLAN module 1101 and the forwarding module 1102 may be two hardware functional modules or software functional modules included in one hardware module, for example, two functions that can be performed by the hardware module may be two functions that can be performed by the hardware module, for example, the hardware module may be a forwarding chip.
optionally, referring to fig. 11B, the message sending device may further include a processing module 1103, and the processing module 1103 may also be implemented in a hardware manner or implemented in a software manner. For example, if the VLAN module 1101 and the forwarding module 1102 are both independent hardware modules, the processing module 1103 may be, for example, a processor, and may be connected to the VLAN module 1101 and the forwarding module 1102 respectively, for example, through a bus, or may also be connected through separate connecting lines, fig. 11B takes the connection through separate connecting lines as an example, and if the VLAN module 1101 and the forwarding module 1102 are two functions that can be performed by a forwarding chip, that is, two function modules inside the forwarding chip, the processing module 1103 may be connected to the forwarding chip.
The processing module 1103 may complete the related configuration of the VLAN module 1101 and the forwarding module 1102, the VLAN module 1101 may complete the functions of encapsulating and analyzing a message, and the forwarding module 1102 may receive and transmit the message, and if the processing module 1103 is a processor, the processing module 1103 and the VLAN module 1101 are designed and programmed to solidify the code corresponding to the foregoing method into a chip, so that the chip can execute the method illustrated in fig. 4 or fig. 7 when running. How to design and program the processing module 1103 and the VLAN module 1101 is well known to those skilled in the art, and will not be described herein.
The message sending device in this embodiment may be the same device as the first device described in the foregoing embodiments, for example, the message sending device in this embodiment may be a switch or a router as the first device described above, for example, the forwarding module 1102 may be referred to as a layer 2(L2) processing module in the switch, that is, configured to complete a layer two forwarding function. Therefore, the steps executed by each functional module of the message sending device in this embodiment are not described in detail, and reference may be made to the description in the foregoing embodiments.
Referring to fig. 12, a first message receiving device is provided, which may be located in a data center network communicating via a VLAN, and may include a memory 1201, a processor 1202, and a receiver 1203.
The processor 1202 may be specifically a CPU or an ASIC, may be one or more integrated circuits for controlling program execution, and may be a hardware circuit developed by using an FPGA.
the number of the memory 1201 may be one or more. Memory 1201 may include ROM, RAM, and disk storage.
The receiver 1203 may be used for network communication with external devices.
The memory 1201 and the receiver 1203 may be connected to the processor 1202 through the bus 1200 (fig. 10 is taken as an example), or may be connected to the processor 1202 through dedicated connection lines.
the processor 1202 is programmed to solidify the code corresponding to the method shown in the foregoing description into the chip, so that the chip can execute the method shown in fig. 5 or fig. 8 when running. How to program the processor 1202 is well known to those skilled in the art and will not be described in detail herein.
The message receiving device in this embodiment may be the same device as the second device described in the foregoing embodiments, for example, the message receiving device in this embodiment may be a physical server serving as the second device as described above, or a VM running in a physical server serving as the first device. Therefore, the steps executed by each functional module of the message receiving apparatus in this embodiment are not described in detail, and reference may be made to the description in the foregoing embodiments.
Alternatively, the message receiving device shown in fig. 12 and the message sending device shown in fig. 10 may be the same device, or may be different devices.
Referring to fig. 13, a second message receiving device is provided, where the message receiving device may be located in a data center network communicating through a VLAN, and the message receiving device may include a VLAN module 1301 and a forwarding module 1302.
for example, the VLAN module 1301 and the forwarding module 1302 may be implemented in a software manner, or may also be implemented in a hardware manner, for example, the VLAN module 1301 and the forwarding module 1302 may both be independent hardware modules, or the VLAN module 1301 and the forwarding module 1302 may be two hardware functional modules or two software functional modules included in one hardware module, for example, two functions that the hardware module can perform may be implemented, for example, the hardware module may be a forwarding chip.
The VLAN module 1301 may complete functions such as encapsulation and parsing of a message, the forwarding module 1302 may receive and transmit a message, and the VLAN module 1101 is programmed to solidify a code corresponding to the method into a chip, so that the chip can execute the method shown in fig. 5 or 9 when running. How to program the VLAN module 1301 is well known to those skilled in the art and will not be described in detail here.
the message receiving device in this embodiment may be the same device as the second device described in the foregoing embodiments, for example, the message receiving device in this embodiment may be a switch or a router as described above as the second device, for example, the forwarding module 1302 may be referred to as a layer 2 processing module in the switch, that is, may be used to complete a layer 2 forwarding function. Therefore, the steps executed by each functional module of the message receiving apparatus in this embodiment are not described in detail, and reference may be made to the description in the foregoing embodiments.
optionally, the message receiving device shown in fig. 13 and the message sending device shown in fig. 11A or fig. 11B may be the same device, or may be different devices.
Referring to fig. 14, based on the same inventive concept, a third message sending device is provided, where the message sending device may be located in a data center network that performs communication through a VLAN, and the message sending device may include an obtaining module 1401, an adding module 1402, and a sending module 1403. Optionally, the messaging device may further include a configuration module 1404, which is also shown in fig. 14. For example, the configuration module 1404 may be configured to configure the message sending apparatus before the obtaining module 1401 obtains the first message.
In practical applications, the entity device corresponding to the obtaining module 1401, the adding module 1402 and the configuring module 1404 may be the processor 1002 in fig. 10, and the entity device corresponding to the sending module 1403 may be the sender 1003 in fig. 10.
The message sending device may be configured to execute the method described in fig. 4 or fig. 6, for example, the message sending device may be the first device as described above, for example, the message sending device in this embodiment may be a physical server as the first device as described above, or a VM running in the physical server as the first device. Therefore, for the functions and the like implemented by each unit in the message sending device, reference may be made to the description of the foregoing method, which is not repeated herein.
Referring to fig. 15, based on the same inventive concept, a third message receiving device is provided, which may be located in a data center network communicating via a VLAN, and may include a receiving module 1501 and a removing module 1502. Optionally, the message receiving apparatus may further include a copy module 1503 and a setting module 1504, which are also shown in fig. 15. For example, the copying module 1503 may be configured to copy, before the removing module 1502 removes the outer VLAN header of the second packet, the priority information to the inner VLAN header of the second packet if the outer VLAN header of the second packet carries the priority information of the second packet, and for example, the setting module 1504 may be configured to reset, after the removing module 1502 removes the outer VLAN header of the second packet, the information that is carried by the outer VLAN header of the second packet and used for indicating the VLAN identifier, to preset information if the outer VLAN header of the second packet carries the priority information of the second packet.
In practical applications, the physical device corresponding to the receiving module 1501 may be the receiver 1203 in fig. 12, and the physical devices corresponding to the removing module 1502, the copying module 1503, and the setting module 1504 may be the processor 1202 in fig. 12.
The message receiving device may be configured to execute the method described in fig. 5 or fig. 8, for example, may be the second device described above, and for example, the message receiving device in this embodiment may be the physical server serving as the second device described above, or a VM running in the physical server serving as the second device. Therefore, for the functions and the like implemented by each unit in the message receiving device, reference may be made to the description of the foregoing method, which is not repeated herein.
In the embodiment of the invention, a packaging mode of VXLAN can be not adopted, but a packaging mode of double-layer VLAN is adopted, the double-layer VLAN occupies 24 bits in total, the VLAN ID is formed by the double-layer VLAN, the range of the VLAN ID is expanded, and the problem of insufficient VLAN is solved. And an extra outer layer VLAN head is added to the message, only 12 bits are needed to be added, the bandwidth is greatly saved compared with the encapsulation mode in VXLAN, the bandwidth is saved for a network which possibly needs frequent communication, such as DCN, the possibility of congestion is reduced to a certain extent, and the quality of network communication is improved.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the described units or division of units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
in addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a Universal Serial Bus flash drive (usb flash drive), a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
the above embodiments are only used to describe the technical solutions of the present invention in detail, but the above embodiments are only used to help understanding the method of the embodiments of the present invention, and should not be construed as limiting the embodiments of the present invention. Those skilled in the art can easily conceive of changes or substitutions within the technical scope of the embodiments of the present invention, and all such changes or substitutions are intended to be included within the scope of the embodiments of the present invention.

Claims (28)

1. A method for sending a message, comprising:
A first device in a data center network which communicates through a Virtual Local Area Network (VLAN) acquires a first message to be sent;
The first equipment adds a VLAN (virtual local area network) head to the first message to obtain a second message with a double-layer VLAN head, and the first equipment carries first identification information in an outer-layer VLAN head of the second message; the identification information carried by the outer VLAN head and the identification information carried by the inner VLAN head of the second message are used for jointly indicating a pre-configured VLAN identification, and the bit number occupied by the pre-configured VLAN identification is equal to the sum of the bit number occupied by the identification information carried by the outer VLAN head and the bit number occupied by the identification information carried by the inner VLAN head;
And the first equipment sends the second message to second equipment in the data center network.
2. The method of claim 1, wherein after the first device adds the VLAN header to the first packet, further comprising:
If the inner layer VLAN header carries the priority information of the second message, the first device copies the priority information to the outer layer VLAN header.
3. The method of claim 2, wherein the method further comprises:
if the inner-layer VLAN header carries the priority information of the second message, the first device sets the identification information carried by the inner-layer VLAN as second identification information again according to the VLAN identification, and the second identification information is used for indicating the pre-configured VLAN identification in a combined mode with the first identification information.
4. The method according to any one of claims 1 to 3, wherein if the first device is a server, before the first device in a data center that communicates via a VLAN acquires the first packet to be sent, the method further includes:
And calling a configuration function supported by the drive of the network card of the first device to configure the VLAN setting information of the first device, so that the first device can support a message carrying a double-layer VLAN header.
5. The method of claim 4,
The method further comprises the following steps:
the first equipment carries second identification information in the inner layer VLAN header according to the preset VLAN identification of the first equipment;
The first device carries first identification information in an outer VLAN header of the second packet, including:
the first equipment carries first identification information in the outer layer VLAN header according to a preset VLAN identification of the first equipment;
Wherein the first identification information and the second identification information are used for jointly indicating the VLAN identification of the first device.
6. the method according to any one of claims 1 to 3, wherein if the first device is a switch, before the first device in a data center that communicates via a VLAN acquires the first packet to be transmitted, the method further includes:
Configuring the first device, so that the first device can package a double-layer VLAN header for a message, and an entry provided by the first device and related to a forwarded message can support the double-layer VLAN header.
7. The method of claim 6, wherein the first device carrying first identification information in an outer VLAN header of the second packet comprises:
The first equipment carries the first identification information in the outer layer VLAN header according to a preset VLAN identification of equipment for sending the first message; the first identification information and the identification information carried by the inner VLAN header are used for jointly indicating the VLAN identification of the device sending the first message; or
the first equipment carries the first identification information in the outer layer VLAN header according to a VLAN identification which is pre-configured for a port of the first equipment for receiving the first message; the first identification information and the identification information carried by the inner-layer VLAN header are used for jointly indicating a VLAN identification which is configured in advance for a port of the first equipment for receiving the first message; or
The first equipment carries the first identification information in the outer layer VLAN header according to a VLAN identification which is pre-configured for a communication protocol to which the first message belongs; the first identification information and the identification information carried by the inner-layer VLAN header are used for jointly indicating a VLAN identification which is pre-configured for a communication protocol to which the first message belongs.
8. The method of claim 7, wherein the first device sending the second message to a second device in the data center, comprising:
The first equipment inquires a forwarding table item according to the VLAN identification;
And if the forwarding table entry recorded with the VLAN identifier is inquired, the first equipment forwards the second message according to the destination address recorded by the forwarding table entry.
9. A method for receiving a message, comprising:
Receiving a second message sent by first equipment in a data center network by second equipment in the data center network which communicates through a Virtual Local Area Network (VLAN); the second message is provided with a double-layer VLAN (virtual local area network) head, identification information carried by an outer-layer VLAN head of the second message and identification information carried by an inner-layer VLAN head of the second message are used for jointly indicating a pre-configured VLAN identification, and the occupied bit number of the pre-configured VLAN identification is equal to the sum of the occupied bit number of the identification information carried by the outer-layer VLAN head and the occupied bit number of the identification information carried by the inner-layer VLAN head;
And the second equipment removes the outer VLAN header of the second message.
10. The method of claim 9, wherein before the second device tears down the outer VLAN header of the second packet, further comprising:
And if the outer layer VLAN header of the second message carries the priority information of the second message, the second equipment copies the priority information into the inner layer VLAN header of the second message.
11. The method of claim 10, wherein after the second device tears down an outer VLAN header of the second packet, further comprising:
If the outer layer VLAN header of the second message carries the priority information of the second message, the second equipment resets the information which is carried by the inner layer VLAN header of the second message and used for indicating the VLAN identification to preset information; the preset information is used for indicating that the second message is a message with priority information.
12. a message sending device in a data center network communicating via a virtual local area network, VLAN, comprising:
A memory to store instructions;
A processor to execute the instructions to: acquiring a first message to be sent; adding a VLAN (virtual local area network) head to the first message to obtain a second message with a double-layer VLAN head, wherein the outer layer VLAN head of the second message carries first identification information; the identification information carried by the outer VLAN head and the identification information carried by the inner VLAN head of the second message are used for jointly indicating a pre-configured VLAN identification, and the bit number occupied by the pre-configured VLAN identification is equal to the sum of the bit number occupied by the identification information carried by the outer VLAN head and the bit number occupied by the identification information carried by the inner VLAN head;
And the transmitter is used for transmitting the second message to second equipment in the data center network.
13. The device of claim 12, wherein the processor is further configured to:
After adding the VLAN header to the first message, if the inner layer VLAN header carries the priority information of the second message, the priority information is copied to the outer layer VLAN header.
14. The device of claim 13, wherein the processor is further configured to:
if the inner VLAN header carries the priority information of the second message, the identification information carried by the inner VLAN is set as second identification information again according to the VLAN identification, and the second identification information is used for indicating the pre-configured VLAN identification in a combined mode with the first identification information.
15. The device of any of claims 12-14, wherein the processor is further configured to:
Before a first message to be sent is acquired, a configuration function supported by a drive of a network card of the equipment is called to configure VLAN setting information of the equipment, so that the equipment can support a message carrying a double-layer VLAN header.
16. the device of claim 15, wherein the processor is further configured to:
carrying second identification information in the inner VLAN header according to the preset VLAN identification of the equipment;
Carrying first identification information in the outer VLAN header according to a preset VLAN identification of the equipment;
Wherein the first identification information and the second identification information are used for jointly indicating the VLAN identification of the device.
17. a message sending device in a data center network communicating via a virtual local area network, VLAN, comprising:
The VLAN module is used for acquiring a first message to be sent; adding a VLAN (virtual local area network) head to the first message to obtain a second message with a double-layer VLAN head, wherein the outer layer VLAN head of the second message carries first identification information; the identification information carried by the outer VLAN head and the identification information carried by the inner VLAN head of the second message are used for jointly indicating a pre-configured VLAN identification, and the bit number occupied by the pre-configured VLAN identification is equal to the sum of the bit number occupied by the identification information carried by the outer VLAN head and the bit number occupied by the identification information carried by the inner VLAN head;
And the forwarding module is used for sending the second message to second equipment in the data center network.
18. The device of claim 17, wherein the VLAN module is further to:
After adding the VLAN header to the first message, if the inner layer VLAN header carries the priority information of the second message, the priority information is copied to the outer layer VLAN header.
19. The device of claim 18, wherein the VLAN module is further to:
If the inner VLAN header carries the priority information of the second message, the identification information carried by the inner VLAN is set as second identification information again according to the VLAN identification, and the second identification information is used for indicating the pre-configured VLAN identification in a combined mode with the first identification information.
20. The apparatus of any of claims 17-19, wherein the apparatus further comprises a processing module to:
before the VLAN module acquires a first message to be sent, the equipment is configured, so that the equipment can package a double-layer VLAN head for the message, and a table item related to the forwarded message provided by the equipment can support the double-layer VLAN head.
21. The device of claim 20, wherein the VLAN module is to:
Carrying the first identification information in the outer layer VLAN header according to a preset VLAN identification of the device sending the first message; the first identification information and the identification information carried by the inner VLAN header are used for jointly indicating the VLAN identification of the device sending the first message; or
Carrying the first identification information in the outer layer VLAN header according to a VLAN identification which is pre-configured for a port of the equipment for receiving the first message; the first identification information and the identification information carried by the inner-layer VLAN header are used for jointly indicating a VLAN identification which is configured in advance for a port of the equipment for receiving the first message; or
Carrying the first identification information in the outer layer VLAN header according to a VLAN identification which is pre-configured for a communication protocol to which the first message belongs; the first identification information and the identification information carried by the inner-layer VLAN header are used for jointly indicating a VLAN identification which is pre-configured for a communication protocol to which the first message belongs.
22. The device of claim 21, wherein the forwarding module is to:
inquiring a forwarding table item according to the VLAN identification;
And if the forwarding table entry recording the VLAN identifier is inquired, forwarding the second message according to the destination address recorded by the forwarding table entry.
23. A message receiving device in a data center network that communicates via a virtual local area network, VLAN, comprising:
a memory to store instructions;
The receiver is used for receiving a second message sent by first equipment in the data center network; the second message is provided with a double-layer VLAN (virtual local area network) head, identification information carried by an outer-layer VLAN head of the second message and identification information carried by an inner-layer VLAN head of the second message are used for jointly indicating a pre-configured VLAN identification, and the occupied bit number of the pre-configured VLAN identification is equal to the sum of the occupied bit number of the identification information carried by the outer-layer VLAN head and the occupied bit number of the identification information carried by the inner-layer VLAN head;
And the processor is used for executing the instruction and removing the outer VLAN header of the second message.
24. the device of claim 23, wherein the processor is further configured to:
Before the outer-layer VLAN header of the second message is removed, if the outer-layer VLAN header of the second message carries the priority information of the second message, the priority information is copied to the inner-layer VLAN header of the second message.
25. The device of claim 24, wherein the processor is further configured to:
After the outer-layer VLAN header of the second message is removed, if the outer-layer VLAN header of the second message carries the priority information of the second message, the information which is carried by the inner-layer VLAN header of the second message and used for indicating the VLAN identification is reset to be preset information; the preset information is used for indicating that the second message is a message with priority information.
26. A message receiving device in a data center network that communicates via a virtual local area network, VLAN, comprising:
the forwarding module is used for receiving a second message sent by first equipment in the data center network; the second message is provided with a double-layer VLAN (virtual local area network) head, identification information carried by an outer-layer VLAN head of the second message and identification information carried by an inner-layer VLAN head of the second message are used for jointly indicating a pre-configured VLAN identification, and the occupied bit number of the pre-configured VLAN identification is equal to the sum of the occupied bit number of the identification information carried by the outer-layer VLAN head and the occupied bit number of the identification information carried by the inner-layer VLAN head;
And the VLAN module is used for removing the outer layer VLAN header of the second message.
27. The device of claim 26, wherein the VLAN module is further to:
Before the outer-layer VLAN header of the second message is removed, if the outer-layer VLAN header of the second message carries the priority information of the second message, the priority information is copied to the inner-layer VLAN header of the second message.
28. The device of claim 27, wherein the VLAN module is further to:
After the outer-layer VLAN header of the second message is removed, if the outer-layer VLAN header of the second message carries the priority information of the second message, the information which is carried by the inner-layer VLAN header of the second message and used for indicating the VLAN identification is reset to be preset information; the preset information is used for indicating that the second message is a message with priority information.
CN201610200333.8A 2016-03-31 2016-03-31 Message sending and receiving method and device Active CN105915427B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610200333.8A CN105915427B (en) 2016-03-31 2016-03-31 Message sending and receiving method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610200333.8A CN105915427B (en) 2016-03-31 2016-03-31 Message sending and receiving method and device

Publications (2)

Publication Number Publication Date
CN105915427A CN105915427A (en) 2016-08-31
CN105915427B true CN105915427B (en) 2019-12-17

Family

ID=56744668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610200333.8A Active CN105915427B (en) 2016-03-31 2016-03-31 Message sending and receiving method and device

Country Status (1)

Country Link
CN (1) CN105915427B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106789529B (en) * 2016-12-16 2020-04-14 平安科技(深圳)有限公司 Method and terminal for implementing OVERLAY network
CN109412922B (en) * 2017-08-15 2021-07-20 华为技术有限公司 Method, forwarding device, controller and system for transmitting message
CN108512758B (en) * 2018-03-07 2021-09-14 华为技术有限公司 Message processing method, controller and forwarding equipment
CN110768884B (en) * 2018-07-25 2021-10-15 华为技术有限公司 VXLAN message encapsulation and policy execution method, equipment and system
CN109302466B (en) * 2018-09-18 2021-10-26 华为技术有限公司 Data processing method, related device and computer storage medium
CN113382370A (en) * 2018-10-08 2021-09-10 华为技术有限公司 Communication method and device
CN111800326B (en) * 2019-04-08 2021-08-24 中移(苏州)软件技术有限公司 Message transmission method and device, processing node and storage medium
CN111865884B (en) * 2019-04-30 2023-01-06 华为技术有限公司 Message processing method, device and equipment
CN112565045B (en) * 2019-09-26 2024-05-07 中兴通讯股份有限公司 Method, device, equipment and storage medium for forwarding message in EVPN
CN112702252B (en) * 2019-10-23 2024-02-02 华为云计算技术有限公司 Message processing method, system and related equipment
CN110891325B (en) * 2019-12-10 2021-11-23 新华三大数据技术有限公司 Tunnel establishment method and device
CN110971499B (en) * 2019-12-10 2021-11-12 上海市共进通信技术有限公司 Method for realizing uniform analysis and processing of VLAN service
CN110913025B (en) 2019-12-31 2022-06-24 ***股份有限公司 Service calling method, device, equipment and medium
CN117675258A (en) * 2022-09-06 2024-03-08 华为技术有限公司 Network isolation method, system and related equipment
CN115776441B (en) * 2023-02-13 2023-04-28 北京天弛网络有限公司 SDN-based virtual private line service issuing method and device, medium and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101895427A (en) * 2010-07-23 2010-11-24 中兴通讯股份有限公司 Stream-based virtual local area network processing method and system
CN104601427A (en) * 2013-10-31 2015-05-06 杭州华三通信技术有限公司 Message forwarding method and device in data center network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9071629B2 (en) * 2011-01-07 2015-06-30 Jeda Networks, Inc. Methods for the interconnection of fibre channel over ethernet devices using shortest path bridging

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101895427A (en) * 2010-07-23 2010-11-24 中兴通讯股份有限公司 Stream-based virtual local area network processing method and system
CN104601427A (en) * 2013-10-31 2015-05-06 杭州华三通信技术有限公司 Message forwarding method and device in data center network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于双层标签的VLAN交换技术的研究;薛文莲;《中国优秀硕士学位论文全文数据库(电子期刊)·信息科技辑》;20131115;第2.2节-4.3节 *

Also Published As

Publication number Publication date
CN105915427A (en) 2016-08-31

Similar Documents

Publication Publication Date Title
CN105915427B (en) Message sending and receiving method and device
CN112422393B (en) Method for transmitting message of extensible virtual local area network, computer equipment and readable medium
US11941423B2 (en) Data processing method and related device
CN105612719B (en) Advanced network virtualization using metadata in encapsulation headers
US10476699B2 (en) VLAN to VXLAN translation using VLAN-aware virtual machines
US10063470B2 (en) Data center network system based on software-defined network and packet forwarding method, address resolution method, routing controller thereof
CN106713103B (en) Method and system for virtual and physical network integration
US11831551B2 (en) Cloud computing data center system, gateway, server, and packet processing method
US9871720B1 (en) Using packet duplication with encapsulation in a packet-switched network to increase reliability
WO2018032910A1 (en) Cross-network communication method and apparatus
CN109302466B (en) Data processing method, related device and computer storage medium
CN112702252A (en) Message processing method, system and related equipment
WO2017113300A1 (en) Route determining method, network configuration method and related device
WO2017173142A1 (en) Interworking between physical network and virtual network
CN110311860B (en) Multilink load balancing method and device under VXLAN
CN109412922B (en) Method, forwarding device, controller and system for transmitting message
WO2021083332A1 (en) Method, apparatus and system for sending message
CN111404797B (en) Control method, SDN controller, SDN access point, SDN gateway and CE
CN111771190B (en) Method and equipment for detecting state of virtual machine
WO2020029928A1 (en) Method for establishing bgp session and sending interface address and alias, and network device
KR101621717B1 (en) Method, apparatus and computer program for virtualizing network resource of software defined data center
CN111865801B (en) Virtio port-based data transmission method and system
CN111447131B (en) Message de-encapsulation method and device and message encapsulation method and device
EP4366267A1 (en) Data transmission method, system and apparatus
EP4075750A1 (en) Message transmission method, apparatus, and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant