CN110875896A - Message processing method and device and electronic equipment - Google Patents

Message processing method and device and electronic equipment Download PDF

Info

Publication number
CN110875896A
CN110875896A CN201810997115.0A CN201810997115A CN110875896A CN 110875896 A CN110875896 A CN 110875896A CN 201810997115 A CN201810997115 A CN 201810997115A CN 110875896 A CN110875896 A CN 110875896A
Authority
CN
China
Prior art keywords
message
network
network type
destination port
packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810997115.0A
Other languages
Chinese (zh)
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201810997115.0A priority Critical patent/CN110875896A/en
Publication of CN110875896A publication Critical patent/CN110875896A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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

Abstract

The embodiment of the invention provides a message processing method, a message processing device and electronic equipment, wherein the method comprises the following steps: acquiring a message to be sent; when the message is determined to be suitable for the first network type, a transmission protocol corresponding to the first network type is adopted to package the message, and the packaged message is sent to the first network; acquiring a message sent by a network; and when the message is determined to be suitable for the first network type, a first network transmission protocol corresponding to the first network type is adopted to perform de-encapsulation processing on the message, and the de-encapsulated message is sent to a destination port. The scheme of the embodiment of the invention can flexibly and rapidly realize the message transmission among different transmission networks, and the cost for realizing the scheme is lower.

Description

Message processing method and device and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a packet, and an electronic device.
Background
Generally, a cloud host or a container accesses an underlay network using a general bridge and accesses an overlay network using a virtual switch having an overlay network function.
However, in conventional network deployments, the underlay network and overlay network are completely isolated. In many cases, services of the same user are deployed in an underlay network and an overlay network at the same time, and mutual access is needed between the services, but a direct, efficient and flexible interworking method between the underlay network and the overlay network is absent in the actual situation. Although some existing schemes adopt specific physical machine devices to perform conversion between the underlay network and the overlay network, only one network conversion direction can be fixedly executed, and the conversion process is still inflexible. In addition, this particular physical machine equipment adds to the latency of the network and the complexity and cost of deployment, which in turn adds to the complexity of service deployment and additional equipment cost overhead.
Disclosure of Invention
The invention provides a message processing method, a message processing device and electronic equipment, which can flexibly and quickly realize message mutual transmission among different transmission networks, and the scheme implementation cost is lower.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, a method for processing a packet is provided, including:
acquiring a message to be sent;
determining the network type suitable for the message from at least two prefabricated network types for transmitting the message according to the destination end IP address carried in the message;
and when determining that the message is suitable for a first network type, encapsulating the message by adopting a transmission protocol corresponding to the first network type, and sending the encapsulated message to the first network.
In a second aspect, another packet processing method is provided, including:
acquiring a message sent by a network, wherein the message carries destination port information;
determining a network type suitable for the message from at least two prefabricated network types according to a transmission protocol adopted by the message or the destination port information;
and when determining that the message is suitable for the first network type, performing decapsulation processing on the message by using a first network transmission protocol corresponding to the first network type, and sending the decapsulated message to the destination port.
In a third aspect, a packet processing apparatus is provided, including:
a message sending acquisition module for acquiring a message to be sent;
the transmission network matching module is used for determining the network type suitable for the message from at least two prefabricated network types for transmitting the message according to the destination end IP address carried in the message;
and the first message processing module is used for packaging the message by adopting a transmission protocol corresponding to the first network type and sending the packaged message to the first network when the message is determined to be suitable for the first network type.
In a fourth aspect, there is provided another packet processing apparatus, including:
the access message acquisition module is used for acquiring a message sent by a network, wherein the message carries destination port information;
a network type identification module, configured to determine, according to a transmission protocol used by the packet or the destination port information, a network type applicable to the packet from at least two network types that are prefabricated;
and the third message processing module is used for performing decapsulation processing on the message by adopting a first network transmission protocol corresponding to the first network type and sending the decapsulated message to the destination port when determining that the message is suitable for the first network type.
In a fifth aspect, an electronic device is provided, comprising:
a memory for storing a program;
a processor, coupled to the memory, for executing the program for:
acquiring a message to be sent;
determining the network type suitable for the message from at least two prefabricated network types for transmitting the message according to the destination end IP address carried in the message;
and when determining that the message is suitable for a first network type, encapsulating the message by adopting a transmission protocol corresponding to the first network type, and sending the encapsulated message to the first network.
In a sixth aspect, another electronic device is provided, including:
a memory for storing a program;
a processor, coupled to the memory, for executing the program for:
acquiring a message sent by a network, wherein the message carries destination port information;
determining a network type suitable for the message from at least two prefabricated network types according to a transmission protocol adopted by the message or the destination port information;
and when determining that the message is suitable for the first network type, performing decapsulation processing on the message by using a first network transmission protocol corresponding to the first network type, and sending the decapsulated message to the destination port.
The invention provides a message processing method and device and electronic equipment. Aiming at a message to be sent, determining a network type suitable for the message from at least two prefabricated network types for transmitting the message according to a destination end IP address carried in the message; then, when the message is determined to be suitable for the first network type, a transmission protocol corresponding to the first network type is adopted to package the message, and the packaged message is sent to the first network; so that locally generated messages can be sent to any specified target network. Aiming at a message sent by a network, the network type suitable for the message can be determined from at least two prefabricated network types according to a transmission protocol adopted by the message or target port information carried in the message; then, when the message is determined to be suitable for the first network type, a first network transmission protocol corresponding to the first network type is adopted to perform de-encapsulation processing on the message, and the de-encapsulated message is sent to a destination port; therefore, any network type message sent from the network to the local can be sent to the local destination port. The message transmission between different networks can be realized by selectively carrying out the related processing of the message and the network type suitable for the message.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a diagram of a prior art architecture for implementing two network deployments on a physical machine;
fig. 2a is a first schematic diagram of a message processing logic according to an embodiment of the present invention;
FIG. 2b is a second schematic diagram of a message processing logic according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a message processing system according to an embodiment of the present invention;
fig. 4a is a first flowchart of a message processing method according to an embodiment of the present invention;
FIG. 4b is a flowchart of a message processing method according to an embodiment of the present invention;
fig. 5a is a flow chart of a message processing method according to the embodiment of the present invention;
FIG. 5b is a fourth flowchart of a message processing method according to the embodiment of the present invention;
fig. 6 is a flow chart of a message processing method according to an embodiment of the present invention;
fig. 7 is a sixth flowchart of a message processing method according to an embodiment of the present invention;
FIG. 8a is a first block diagram of a message processing apparatus according to an embodiment of the present invention;
FIG. 8b is a diagram of a second embodiment of a message processing apparatus;
fig. 9a is a third structural diagram of a message processing apparatus according to an embodiment of the present invention;
fig. 9b is a fourth structural diagram of a message processing apparatus according to an embodiment of the present invention;
FIG. 10 is a first schematic structural diagram of an electronic device according to an embodiment of the invention;
fig. 11 is a second structural schematic of the electronic device according to the embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, it is a structural diagram of implementing two network deployments on a physical machine in the prior art, where the two networks may be an underlay network and an overlay network. Among them, the underlay container 1 may be a container deployed in an underlay network, which is accessed to the underlay network by using a common bridge; the overlay container 2 may be a container deployed in an overlay network, which accesses the overlay network using a virtual switch having an overlay network function. Both the underlay network and the overlay network need to realize the transmission of messages in corresponding network types based on a physical network (the transmission protocols corresponding to different network types are different, or the messages can be directly transmitted without being encapsulated by the transmission protocols).
However, in the prior art, the underlay network and the overlay network are completely isolated, for example, a message sent by the underlay container 1 cannot be transmitted to the overlay container 2 or an overlay container deployed on another physical machine. The reason is that both the bridge and the virtual switch perform symmetric operations of encapsulation and decapsulation (or do not encapsulate or decapsulate) on the packet transmitted over the fixed-type network, and once the deployed network type is determined, the container deployed under the corresponding network type cannot select the transmission network type of the packet at will.
The invention improves the defect that containers in different types of networks can not send messages mutually in the prior art, such as the defect of complete isolation between an underlay network and an overlay network, and has the core idea that a virtual switch is arranged on each physical machine, and the virtual switch is different from a conventional virtual switch, and can simultaneously support the processing operation of multiple types of networks, such as the message processing operation of the underlay network and the overlay network. After the virtual switch receives the message to be sent or acquires the message sent from the network, the virtual switch may first identify the network type suitable for the next message processing, and then process the current message by using the message processing operation flow corresponding to the network type. Therefore, the improved virtual switch can flexibly process the messages of different types of networks, and further realize interconnection among different types of networks.
Fig. 2a is a schematic diagram of a message processing logic according to an embodiment of the present invention. The service scene corresponding to the message processing logic is to send the message from the local to the network. Firstly, after a virtual switch acquires a message to be sent to a network from a local place (such as a locally deployed container or a virtual machine), a routing table is matched according to a destination end IP address of the message, and a network type of a transmission network to which the destination end IP address belongs is determined from at least two prefabricated network types of transmission messages. Then, the message is further encapsulated by adopting a transmission protocol corresponding to the network type suitable for the message and then is sent to the corresponding network, or the message is sent to the corresponding network without further encapsulation of any transmission protocol, and the execution process can be referred to as an 'output processing' process. For example, if the network type suitable for the current message is determined to be an underlay network, an underlay processing flow is executed on the message; and if the network type suitable for the current message is determined to be an overlay network, executing an overlay processing flow on the message. And finally, sending the processed message to a physical network to be transmitted to a destination IP address.
Fig. 2b is a schematic diagram of a message processing logic according to an embodiment of the present invention. The service scene corresponding to the message processing logic is to receive a message sent from a network to a local. Firstly, after acquiring a message sent from a network to a local, a virtual switch determines a network type of a transmission network adopted by the message in a network transmission process from at least two network types of prefabricated transmission messages according to a transmission protocol or destination port information of the message. Then, the packet is decapsulated by using a transmission protocol corresponding to the network type suitable for the packet and then sent to the destination port, or the received packet is sent to the destination port without decapsulation by using any transmission protocol, and this execution process may be referred to as an "in-process" flow. For example, if the network type suitable for the current message is determined to be an underlay network, an underlay input processing flow is executed on the message; and if the network type suitable for the current message is determined to be an overlay network, executing an overlay input processing flow on the message. And finally, sending the processed message to a destination port to forward the message to a container or a virtual machine pointed by the destination port.
Based on the above concept of the message processing scheme provided in the embodiment of the present invention, fig. 3 is a structural diagram of a message processing system provided in the embodiment of the present invention. As shown in fig. 3, the system includes routing tables (such as an underlay routing table and an overlay routing table) under multiple network types, a message outgoing processing device 310, and a message incoming processing device 320, where:
the message outgoing processing device 310 is configured to send a message to a corresponding network after performing outgoing processing on the message to be sent, and specifically includes:
a message sending acquisition module for acquiring a message to be sent;
the transmission network matching module is used for determining the network type suitable for the message from at least two prefabricated network types for transmitting the message according to the destination end IP address carried in the message;
and the first message processing module is used for packaging the message by adopting a transmission protocol corresponding to the first network type when the message is determined to be suitable for the first network type, and sending the packaged message to the first network.
Further, the message processing apparatus 310 may further include:
and the second message processing module is used for sending the message to the second network when the message is determined to be suitable for the second network type.
The message incoming processing device 320 is configured to send a message to a local destination port after performing incoming processing on a message sent by a network, and specifically includes:
the access message acquisition module is used for acquiring a message sent by a network, and the message carries destination port information;
the network type identification module is used for determining the network type suitable for the message from at least two prefabricated network types according to the transmission protocol or the destination port information adopted by the message;
and the third message processing module is used for performing decapsulation processing on the message by adopting a first network transmission protocol corresponding to the first network type when the message is determined to be suitable for the first network type, and sending the decapsulated message to the destination port.
Further, the message processing apparatus 320 may further include:
and the fourth message processing module is used for sending the message to the destination port when the message is determined to be suitable for the second network type.
The technical solution of the present application is further illustrated by the following examples.
Example one
Based on the above message processing scheme, as shown in fig. 4a, which is a flowchart of a message processing method according to an embodiment of the present invention, an execution main body of the method may be the message output processing apparatus 310 shown in fig. 3. In an actual application scenario, the message processing apparatus 310 may be disposed in a local virtual switch. As shown in fig. 4a, the message processing method includes the following steps:
s410, obtaining a message to be sent.
For example, after a container or a virtual machine deployed on a physical machine generates a message, the message needs to be sent to a destination end through a specified network, such as an underlay network or an overlay network. The virtual switch may acquire the packet according to a communication port that is docked with the containers or the virtual machine.
And S420, determining the network type suitable for the message from the prefabricated at least two network types for transmitting the message according to the destination IP address carried in the message.
According to the destination IP address carried in the message, the network type of the network where the destination device (such as a container or a virtual machine) is located can be determined from at least two network types configured in advance for transmitting the message, and then the network type of the transmission network suitable for the destination device to receive the message is determined. The network type is the network type to which the currently acquired message is applicable.
Specifically, the network type of the transport network to which the destination IP address belongs may be looked up in a routing table of a plurality of preset transport networks, and the network type may include an underlay network and/or an overlay network. Then, the network type is determined as the network type to which the current message is applicable.
S430, when the message is determined to be suitable for the first network type, the message is packaged by adopting a transmission protocol corresponding to the first network type, and the packaged message is sent to the first network.
Generally, in order to be isolated from other transmission networks, each transmission network uses a proprietary transmission protocol to encapsulate a message to be transmitted and then perform network transmission. The first network type in the present solution generally refers to a network type that requires further encapsulation of a packet based on a specific transmission protocol. Before being transmitted on the networks, the messages need to be packaged by corresponding transmission protocols and then sent to the corresponding networks for transmission.
For example, the first network type may include: an overlay network; correspondingly, the step can be specifically as follows:
and when determining that the message is suitable for the overlay network, encapsulating the message by adopting a transmission protocol corresponding to the overlay network, and sending the encapsulated message to the overlay network.
Further, as shown in fig. 4b, after step S420, step S440 may also be performed.
And S440, when the message is determined to be suitable for the second network type, sending the message to the second network.
In practical application scenarios, some network types do not need to further encapsulate the message, but send the message to a corresponding network after performing routine processing such as routing, flow control, security processing, and the like on the message. The second network type in the present solution generally refers to a network type that does not require further encapsulation of the packet to be sent.
For example, the second network type may include: an underlay network; correspondingly, the step can be specifically as follows:
and when determining that the message is suitable for the underlay network, sending the message to the underlay network.
The message processing method provided by the embodiment of the invention is characterized in that for a message to be sent to a network from a local place, the network type suitable for the message is determined from at least two prefabricated network types for transmitting the message according to the destination end IP address carried in the message; then, when the message is determined to be suitable for the first network type, a transmission protocol corresponding to the first network type is adopted to package the message, and the packaged message is sent to the first network; when the message is determined to be suitable for the second network type, the message is sent to the second network; so that locally generated messages can be sent to any specified target network.
Example two
Based on the above message processing scheme, as shown in fig. 5a, it is a flow chart of a message processing method shown in the embodiment of the present invention, and an execution main body of the method may be the message input processing device 320 shown in fig. 3. In a practical application scenario, the message input processing device 320 may be disposed in a local virtual switch. As shown in fig. 5a, the message processing method includes the following steps:
s510, obtaining a message sent by the network, wherein the message carries destination port information.
The message is transmitted to the physical machine of the destination end through the transmission network. The virtual switch on the physical machine can acquire the message according to the communication port in butt joint with the transmission network. The message carries information of a destination port. This destination port is the port where the virtual switch communicates with the destination device (container or virtual machine).
S520, according to the transmission protocol or the destination port information adopted by the message, the network type suitable for the message is determined from at least two prefabricated network types.
Specifically, according to a transmission protocol adopted by a message, a transmission network type corresponding to the transmission protocol and a message encapsulation operation corresponding to the transmission protocol can be obtained; according to the destination port information carried in the message, the network type corresponding to the destination port can be obtained by inquiring the routing table, and then whether the network type corresponds to a transmission protocol is obtained, and on the basis of determining that the transmission protocol exists, the message encapsulation operation corresponding to the transmission protocol can be further determined. In short, after the network type suitable for the packet is obtained, the next operation can be performed according to whether the network type corresponds to the transmission protocol or not and what the encapsulation operation corresponding to the transmission protocol is.
For example, a transmission network used by a message in a network transmission process may be determined from a plurality of network types that are pre-established according to a transmission protocol or destination port information used by the message; and then, taking the determined network type of the transmission network as the network type suitable for the message.
S530, when the message is determined to be suitable for the first network type, the message is decapsulated by adopting a first network transmission protocol corresponding to the first network type, and the decapsulated message is sent to a destination port.
Generally, in order to be isolated from other transmission networks, the transmission network usually adopts a proprietary transmission protocol to encapsulate a message to be transmitted and then performs network transmission. The virtual switch receives the message sent from the network to the local, wherein the message comprises a message which is further packaged by a transmission protocol. After receiving the messages further encapsulated by the transmission protocol of the transmission network, the messages need to be decapsulated by the corresponding transmission protocol before being sent to the corresponding destination port.
For example, the first network type may include: an overlay network; correspondingly, the step can be specifically as follows:
and when determining that the message is suitable for the overlay network, decapsulating the message by using an overlay network transmission protocol corresponding to the overlay network, and sending the decapsulated message to a destination port.
Further, as shown in fig. 5b, after step S520, step S540 may also be performed.
And S540, when the message is determined to be suitable for the second network type, sending the message to a destination port.
In practical application scenarios, some network types do not need to further encapsulate the message, but send the message to a corresponding network after performing routine processing such as routing, flow control, security processing, and the like on the message. The second network type in the present solution generally refers to a network type that does not require further encapsulation of the packet to be sent. After receiving the messages sent to the local from the networks, the messages can be sent to the corresponding destination ports without decapsulating the messages through any transmission protocol.
For example, the second network type may include: an underlay network; correspondingly, the step can be specifically as follows:
and when determining that the message is suitable for the underlay network, sending the message to a destination port.
The message method provided by the embodiment of the invention can determine the network type suitable for the message from at least two prefabricated network types according to the transmission protocol adopted by the message or the destination port information carried in the message aiming at the message sent from the network to the local; then, when the message is determined to be suitable for the first network type, a first network transmission protocol corresponding to the first network type is adopted to perform de-encapsulation processing on the message, and the de-encapsulated message is sent to a destination port; when the message is determined to be suitable for the second network type, the message is sent to a destination port; therefore, any network type message sent from the network to the local can be sent to the local destination port.
EXAMPLE III
Based on the message processing methods described in the first and second embodiments, this embodiment shows a specific execution process for transmitting a message between different network types.
First, as shown in fig. 6, it is an execution flowchart of transmitting a message from an underlay network to an overlay network, for example, when an underlay container 1 needs to send a message to an overlay container 4, the following steps may be executed:
step 1: in the message sending direction of the underlay container 1, firstly, a routing judgment device of a virtual switch of the physical machine A is used for judging that an access destination end is a container in an overlay network, and the network type suitable for the current message is the overlay network.
Step 2: the virtual switch uses overlay output processing logic to encapsulate and forward the message to the overlay network.
And step 3: after receiving the message, the virtual switch of the physical machine B determines the network type to which the message is applicable according to the transmission protocol adopted by the message or the carried destination port information, and determines that the network type to which the current message is applicable is an overlay network.
And 4, step 4: and performing decapsulation operation on the message by using the determined transmission protocol corresponding to the overlay network, and sending the decapsulated message to the overlay container 4.
Thus, the overlay container 4 receives the message of the underlay container 1.
Secondly, as shown in fig. 7, it is an execution flowchart of transmitting a message from an overlay network to an underlay network, for example, when an overlay container 4 needs to send a message to an underlay container 1, the following steps may be executed:
step 1: in the message sending direction of the overlay container 4, firstly, the routing judgment device of the virtual switch of the physical machine B judges that the destination end of the access is a container in the underlay network, and the network type suitable for the current message is the underlay network.
Step 2: the virtual switch sends the message to the underlay network using underlay egress processing logic.
And step 3: after receiving the message, the virtual switch of the physical machine a judges the network type applicable to the message according to the destination port information carried by the message, and judges that the network type applicable to the current message is an underlay network.
And 4, step 4: and sending the message to the underlay container 1.
Thus, the underlay container 1 receives the message of the overlay container 4.
Example four
As shown in fig. 8a, a first structure of a message processing apparatus according to an embodiment of the present invention is shown, where the message processing apparatus may specifically be the message output processing apparatus shown in fig. 3, and is configured to execute the method steps shown in the first embodiment, where the method steps include:
a sent message acquiring module 810, configured to acquire a message to be sent;
a transmission network matching module 820, configured to determine, according to a destination IP address carried in a packet, a network type applicable to the packet from at least two network types of the prefabricated transmission packets;
the first packet processing module 830 is configured to, when it is determined that the packet is suitable for the first network type, perform encapsulation processing on the packet by using a transmission protocol corresponding to the first network type, and send the encapsulated packet to the first network.
Further, as shown in fig. 8b, the message processing apparatus may further include:
the second message processing module 840 is configured to send the message to the second network when it is determined that the message is applicable to the second network type.
Further, the transport network matching module 820 described above may be specifically adapted,
and searching the network type of the transmission network to which the IP address of the destination end belongs in the routing table, and determining the network type as the network type suitable for the message.
Further, the first network type may include: an overlay network;
correspondingly, the first message processing module 830 may be specifically configured to, when it is determined that the message is suitable for the overlay network, perform encapsulation processing on the message by using a transmission protocol corresponding to the overlay network, and send the encapsulated message to the overlay network.
Further, the second network type may include: an underlay network;
correspondingly, the second message processing module 840 may be specifically configured to send the message to the underlay network when it is determined that the message is suitable for the underlay network.
Further, the message comprises a message to be sent from local to a network, and the message processing device can be applied to a local virtual switch.
Further, the message may include a message sent by a local overlay container or an underlay container.
The message processing device provided by the embodiment of the invention firstly determines the network type suitable for the message from at least two prefabricated network types for transmitting the message according to the destination end IP address carried in the message aiming at the message to be sent to the network from the local; then, when the message is determined to be suitable for the first network type, a transmission protocol corresponding to the first network type is adopted to package the message, and the packaged message is sent to the first network; when the message is determined to be suitable for the second network type, the message is sent to the second network; so that locally generated messages can be sent to any specified target network.
EXAMPLE five
As shown in fig. 9a, a third structural diagram of a message processing apparatus according to an embodiment of the present invention is shown, where the message processing apparatus may be specifically the message input processing apparatus shown in fig. 3, and is configured to execute the method steps shown in the second embodiment, where the method steps include:
an access message obtaining module 910, configured to obtain a message sent by a network, where the message carries destination port information;
a network type identification module 920, configured to determine, according to a transmission protocol or destination port information used by the packet, a network type applicable to the packet from at least two prefabricated network types;
the third message processing module 930 is configured to, when it is determined that the message is suitable for the first network type, perform decapsulation processing on the message by using the first network transmission protocol corresponding to the first network type, and send the decapsulated message to the destination port.
Further, as shown in fig. 9b, the message processing apparatus may further include:
and a fourth message processing module 940, configured to send the message to the destination port when it is determined that the message is applicable to the second network type.
Further, the network type identification module 920 may be specifically configured to,
and determining the network type of a transmission network adopted by the message in the network transmission process according to the transmission protocol or the destination port information adopted by the message, and determining the network type as the network type suitable for the message.
Further, the first network type may include: an overlay network;
correspondingly, the third message processing module 930 may be specifically configured to, when it is determined that the message is suitable for an overlay network, perform decapsulation processing on the message by using an overlay network transmission protocol corresponding to the overlay network, and send the decapsulated message to the destination port.
Further, the second network type may include: an underlay network;
correspondingly, the fourth message processing module 940 is specifically configured to send the message to the destination port when it is determined that the message is applicable to the underlay network.
Further, the message may include a message sent from a network to a local, and the message processing apparatus may be applied to a local virtual switch.
Further, the destination port may include a destination port corresponding to an underlay container or a destination port corresponding to an overlay container.
The message device provided by the embodiment of the invention can determine the network type suitable for the message from at least two prefabricated network types according to the transmission protocol adopted by the message or the destination port information carried in the message aiming at the message sent from the network to the local; then, when the message is determined to be suitable for the first network type, a first network transmission protocol corresponding to the first network type is adopted to perform de-encapsulation processing on the message, and the de-encapsulated message is sent to a destination port; when the message is determined to be suitable for the second network type, the message is sent to a destination port; therefore, any network type message sent from the network to the local can be sent to the local destination port.
EXAMPLE six
The fourth embodiment describes an overall architecture of a message processing apparatus, and the functions of the apparatus can be implemented by an electronic device, as shown in fig. 10, which is a schematic structural diagram of the electronic device according to the embodiment of the present invention, and specifically includes: a memory 101 and a processor 102.
A memory 101 for storing programs.
In addition to the above-described programs, the memory 101 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 101 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A processor 102, coupled to the memory 101, for executing the program in the memory 101 to:
acquiring a message to be sent;
determining the network type suitable for the message from at least two prefabricated network types for transmitting the message according to the destination IP address carried in the message;
and when the message is determined to be suitable for the first network type, encapsulating the message by adopting a transmission protocol corresponding to the first network type, and sending the encapsulated message to the first network.
The above specific processing operations have been described in detail in the foregoing embodiments, and are not described again here.
Further, as shown in fig. 10, the electronic device may further include: communication components 103, power components 104, audio components 105, display 106, and other components. Only some of the components are schematically shown in fig. 10, and the electronic device is not meant to include only the components shown in fig. 10.
The communication component 103 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 103 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 103 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
The power supply component 104 provides power to various components of the electronic device. The power components 104 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for an electronic device.
The audio component 105 is configured to output and/or input audio signals. For example, the audio component 105 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 101 or transmitted via the communication component 103. In some embodiments, audio component 105 also includes a speaker for outputting audio signals.
The display 106 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
EXAMPLE seven
The fifth embodiment describes an overall architecture of a message processing apparatus, and the functions of the apparatus can be implemented by an electronic device, as shown in fig. 11, which is a schematic structural diagram of the electronic device according to the embodiment of the present invention, and specifically includes: a memory 111 and a processor 112.
The memory 111 stores programs.
In addition to the above-described programs, the memory 111 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 111 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A processor 112, coupled to the memory 111, for executing the program in the memory 111 to:
acquiring a message sent by a network, wherein the message carries destination port information;
determining the network type suitable for the message from at least two prefabricated network types according to the transmission protocol or the destination port information adopted by the message;
and when the message is determined to be suitable for the first network type, a first network transmission protocol corresponding to the first network type is adopted to perform de-encapsulation processing on the message, and the de-encapsulated message is sent to a destination port.
The above specific processing operations have been described in detail in the foregoing embodiments, and are not described again here.
Further, as shown in fig. 11, the electronic device may further include: communication components 113, power components 114, audio components 115, display 116, and other components. Only some of the components are schematically shown in fig. 11, and it is not meant that the electronic device includes only the components shown in fig. 11.
The communication component 113 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 113 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 113 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
A power supply component 114 that provides power to the various components of the electronic device. The power components 114 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for an electronic device.
Audio component 115 is configured to output and/or input audio signals. For example, audio component 115 may include a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 111 or transmitted via the communication component 113. In some embodiments, audio component 115 also includes a speaker for outputting audio signals.
The display 116 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (30)

1. A message processing method comprises the following steps:
acquiring a message to be sent;
determining the network type suitable for the message from at least two prefabricated network types for transmitting the message according to the destination end IP address carried in the message;
and when determining that the message is suitable for a first network type, encapsulating the message by adopting a transmission protocol corresponding to the first network type, and sending the encapsulated message to the first network.
2. The method of claim 1, further comprising:
and when the message is determined to be suitable for the second network type, sending the message to the second network.
3. The method according to claim 1, wherein the determining, according to the destination IP address carried in the packet, a network type applicable to the packet from at least two network types of pre-established transmission packets includes:
and searching the network type of the transmission network to which the IP address of the destination end belongs in a routing table, and determining the network type as the network type suitable for the message.
4. The method of claim 1, wherein the first network type comprises: an overlay network;
when determining that the packet is suitable for the first network type, encapsulating the packet by using a transmission protocol corresponding to the first network type, and sending the encapsulated packet to the first network includes:
and when determining that the message is suitable for the overlay network, encapsulating the message by adopting a transmission protocol corresponding to the overlay network, and sending the encapsulated message to the overlay network.
5. The method of claim 2, wherein the second network type comprises: an underlay network;
the sending the packet to the second network when determining that the packet is applicable to the second network type includes:
and when determining that the message is suitable for the underlay network, sending the message to the underlay network.
6. The method according to any of claims 1-5, wherein the messages comprise messages to be sent from local to a network, the method being applied in a local virtual switch.
7. The method according to any one of claims 1-5, wherein the packet comprises a packet sent by a local overlay container or an underlay container.
8. A message processing method comprises the following steps:
acquiring a message sent by a network, wherein the message carries destination port information;
determining a network type suitable for the message from at least two prefabricated network types according to a transmission protocol adopted by the message or the destination port information;
and when determining that the message is suitable for the first network type, performing decapsulation processing on the message by using a first network transmission protocol corresponding to the first network type, and sending the decapsulated message to the destination port.
9. The method of claim 8, further comprising:
and when the message is determined to be suitable for the second network type, sending the message to the destination port.
10. The method according to claim 8, wherein the determining, according to the transmission protocol used by the packet or the destination port information, a network type applicable to the packet from at least two network types that are pre-established includes:
and determining the network type of a transmission network adopted by the message in the network transmission process according to the transmission protocol adopted by the message or the destination port information, and determining the network type as the network type suitable for the message.
11. The method of claim 8, wherein the first network type comprises: an overlay network;
when it is determined that the packet is suitable for the first network type, decapsulating the packet using a first network transmission protocol corresponding to the first network type, and sending the decapsulated packet to the destination port includes:
and when determining that the message is suitable for an overlay network, decapsulating the message by using an overlay network transmission protocol corresponding to the overlay network, and sending the decapsulated message to the destination port.
12. The method of claim 9, wherein the second network type comprises: an underlay network;
when it is determined that the packet is applicable to the second network type, sending the packet to the destination port includes:
and when determining that the message is suitable for an underlay network, sending the message to the destination port.
13. The method according to any of claims 8-12, wherein the messages comprise messages sent from a network to a local, the method being applied in a local virtual switch.
14. The method of any of claims 8-12, wherein the destination port comprises a destination port corresponding to an underlay container or a destination port corresponding to an overlay container.
15. A message processing apparatus comprising:
a message sending acquisition module for acquiring a message to be sent;
the transmission network matching module is used for determining the network type suitable for the message from at least two prefabricated network types for transmitting the message according to the destination end IP address carried in the message;
and the first message processing module is used for packaging the message by adopting a transmission protocol corresponding to the first network type and sending the packaged message to the first network when the message is determined to be suitable for the first network type.
16. The apparatus of claim 15, further comprising:
and the second message processing module is used for sending the message to the second network when the message is determined to be suitable for the second network type.
17. The apparatus of claim 15, wherein the transport network matching module is specifically configured to,
and searching the network type of the transmission network to which the IP address of the destination end belongs in a routing table, and determining the network type as the network type suitable for the message.
18. The apparatus of claim 15, wherein the first network type comprises: an overlay network;
the first message processing module is specifically configured to, when it is determined that the message is suitable for an overlay network, perform encapsulation processing on the message by using a transmission protocol corresponding to the overlay network, and send the encapsulated message to the overlay network.
19. The apparatus of claim 16, wherein the second network type comprises: an underlay network;
the second message processing module is specifically configured to send the message to an underlay network when it is determined that the message is suitable for the underlay network.
20. The apparatus according to any of claims 15-19, wherein the message comprises a message to be sent from local to a network, the apparatus being applied in a local virtual switch.
21. The apparatus according to any one of claims 15-19, wherein the packet comprises a packet sent by a local overlay container or an underlay container.
22. A message processing apparatus comprising:
the access message acquisition module is used for acquiring a message sent by a network, wherein the message carries destination port information;
a network type identification module, configured to determine, according to a transmission protocol used by the packet or the destination port information, a network type applicable to the packet from at least two network types that are prefabricated;
and the third message processing module is used for performing decapsulation processing on the message by adopting a first network transmission protocol corresponding to the first network type and sending the decapsulated message to the destination port when determining that the message is suitable for the first network type.
23. The apparatus of claim 22, further comprising:
and the fourth message processing module is used for sending the message to the destination port when the message is determined to be suitable for the second network type.
24. The apparatus of claim 22, wherein the network type identification module is specifically configured to,
and determining the network type of a transmission network adopted by the message in the network transmission process according to the transmission protocol adopted by the message or the destination port information, and determining the network type as the network type suitable for the message.
25. The apparatus of claim 22, wherein the first network type comprises: an overlay network;
the third message processing module is specifically configured to, when it is determined that the message is suitable for an overlay network, perform decapsulation processing on the message by using an overlay network transmission protocol corresponding to the overlay network, and send the decapsulated message to the destination port.
26. The apparatus of claim 23, wherein the second network type comprises: an underlay network;
the fourth packet processing module is specifically configured to send the packet to the destination port when it is determined that the packet is suitable for an underlay network.
27. The apparatus according to any of claims 22-26, wherein the message comprises a message sent from a network to a local, and the method is applied in a local virtual switch.
28. The apparatus of any of claims 22-26, wherein the destination port comprises a destination port corresponding to an underlay container or a destination port corresponding to an overlay container.
29. An electronic device, comprising:
a memory for storing a program;
a processor, coupled to the memory, for executing the program for:
acquiring a message to be sent;
determining the network type suitable for the message from at least two prefabricated network types for transmitting the message according to the destination end IP address carried in the message;
and when determining that the message is suitable for a first network type, encapsulating the message by adopting a transmission protocol corresponding to the first network type, and sending the encapsulated message to the first network.
30. An electronic device, comprising:
a memory for storing a program;
a processor, coupled to the memory, for executing the program for:
acquiring a message sent by a network, wherein the message carries destination port information;
determining a network type suitable for the message from at least two prefabricated network types according to a transmission protocol adopted by the message or the destination port information;
and when determining that the message is suitable for the first network type, performing decapsulation processing on the message by using a first network transmission protocol corresponding to the first network type, and sending the decapsulated message to the destination port.
CN201810997115.0A 2018-08-29 2018-08-29 Message processing method and device and electronic equipment Pending CN110875896A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810997115.0A CN110875896A (en) 2018-08-29 2018-08-29 Message processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810997115.0A CN110875896A (en) 2018-08-29 2018-08-29 Message processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN110875896A true CN110875896A (en) 2020-03-10

Family

ID=69714857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810997115.0A Pending CN110875896A (en) 2018-08-29 2018-08-29 Message processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110875896A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111464341A (en) * 2020-03-19 2020-07-28 烽火通信科技股份有限公司 Overlay service configuration method and device
CN113068206A (en) * 2021-03-31 2021-07-02 联想(北京)有限公司 Information processing method and device
CN114338259A (en) * 2021-12-31 2022-04-12 宁波和利时信息安全研究院有限公司 Network shunting method and device, industrial control system, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102480462A (en) * 2010-11-23 2012-05-30 中国电信股份有限公司 Universal protocol adapting method and device
CN103269300A (en) * 2013-05-21 2013-08-28 杭州华三通信技术有限公司 Method and equipment for achieving heterogeneous network interconnection
CN103595648A (en) * 2012-08-17 2014-02-19 国际商业机器公司 Method and system for balancing load at receiving side of server
CN104486217A (en) * 2014-12-08 2015-04-01 杭州华三通信技术有限公司 Cross network message transmitting method and equipment
CN104869058A (en) * 2015-06-04 2015-08-26 北京京东尚科信息技术有限公司 Method and device for transmitting data message
CN105610672A (en) * 2016-01-14 2016-05-25 中国联合网络通信集团有限公司 Information transmission method and device
US20170134534A1 (en) * 2009-09-18 2017-05-11 At&T Intellectual Property I, L.P. Multicast-Unicast Protocol Converter
CN106789667A (en) * 2016-11-21 2017-05-31 华为技术有限公司 A kind of data forwarding method, relevant device and system
CN111934970A (en) * 2020-08-06 2020-11-13 北京字节跳动网络技术有限公司 Data transmission method, device and system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170134534A1 (en) * 2009-09-18 2017-05-11 At&T Intellectual Property I, L.P. Multicast-Unicast Protocol Converter
CN102480462A (en) * 2010-11-23 2012-05-30 中国电信股份有限公司 Universal protocol adapting method and device
CN103595648A (en) * 2012-08-17 2014-02-19 国际商业机器公司 Method and system for balancing load at receiving side of server
CN103269300A (en) * 2013-05-21 2013-08-28 杭州华三通信技术有限公司 Method and equipment for achieving heterogeneous network interconnection
CN104486217A (en) * 2014-12-08 2015-04-01 杭州华三通信技术有限公司 Cross network message transmitting method and equipment
CN104869058A (en) * 2015-06-04 2015-08-26 北京京东尚科信息技术有限公司 Method and device for transmitting data message
CN105610672A (en) * 2016-01-14 2016-05-25 中国联合网络通信集团有限公司 Information transmission method and device
CN106789667A (en) * 2016-11-21 2017-05-31 华为技术有限公司 A kind of data forwarding method, relevant device and system
CN111934970A (en) * 2020-08-06 2020-11-13 北京字节跳动网络技术有限公司 Data transmission method, device and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111464341A (en) * 2020-03-19 2020-07-28 烽火通信科技股份有限公司 Overlay service configuration method and device
CN111464341B (en) * 2020-03-19 2022-11-18 烽火通信科技股份有限公司 Overlay service configuration method and device
CN113068206A (en) * 2021-03-31 2021-07-02 联想(北京)有限公司 Information processing method and device
CN114338259A (en) * 2021-12-31 2022-04-12 宁波和利时信息安全研究院有限公司 Network shunting method and device, industrial control system, equipment and storage medium

Similar Documents

Publication Publication Date Title
US10028078B2 (en) Application routing configuration for NFC controller supporting multiple NFCEEs
CN104506360B (en) Networking collocation method, system and the relevant device of a kind of smart machine
US9485342B2 (en) Wireless device system-architecture
CN106789526B (en) method and device for connecting multiple system networks
CN110121902B (en) Communication establishment method and terminal
US11452156B2 (en) Configuration system, client device, embedded device configuration method, and storage medium
CN110875896A (en) Message processing method and device and electronic equipment
CN110166414B (en) Communication method, device and system
CN106797335B (en) Data transmission method, data transmission device, electronic equipment and computer program product
EP3091713A1 (en) Method, switch, and controller for implementing arp
CN105430761A (en) Method, device and system used for establishing wireless network connection
US11949579B2 (en) Method and device for network path probe
CN107302528A (en) A kind of transmission method of multi-protocol data and a kind of gateway apparatus
US20150181499A1 (en) Communication apparatus, communication method, and communication system
CN104539454A (en) Equipment management method, device and system
CN107547932A (en) Sharing method and device, the terminal of data message
WO2009021424A1 (en) A device and method for handling messages
KR102164903B1 (en) Device, system and method for providing additional functionality to an apparatus
CN109787900B (en) Transmission method, device, equipment and machine readable medium
CN108259297B (en) Message processing method and device
CN107483369A (en) A kind of message processing method and virtual switch
JP2004229265A5 (en)
US20220131797A1 (en) Method and device for data packet forwarding
US9008083B2 (en) Network intermediate apparatus and method for ubiquitous network and ubiquitous network system using the intermediary apparatus
CN112969199B (en) Data acquisition method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination