Message Transmission Control Method, Device, Medium and Equipment
By analyzing the MPTCP type and determining the outgoing port before packet encapsulation, the problem that packets are difficult to distinguish MPTCP paths in virtualized scenarios is solved, efficient data transmission and port dispersed forwarding are achieved, and the utilization rate and user experience of MPTCP sessions are improved.
Patent Information
- Application Number
- CN202211328824.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-10-27
AI Technical Summary
In virtualization scenarios, it is difficult to distinguish multiple paths of MPTCP based on encapsulated messages, resulting in message congestion and reducing MPTCP transmission performance.
By receiving the target message and analyzing its communication connection type, determining the corresponding outbound port of the MPTCP type packet, and encapsulating the port number into the message as extended information, the control message forwarder forwards based on the port number.
Improves the data transmission efficiency of MPTCP sessions, avoids port congestion, and improves user experience.
Smart Images

Figure CN115665047B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a method, apparatus, medium, and device for controlling message transmission. Background Art
[0002] The Multi-Path Transmission Control Protocol (MPTCP) defines a way to establish multiple connections between two hosts, with the aim of allowing Transmission Control Protocol (TCP) connections to use multiple paths to maximize the use of channel resources. In standard TCP, a connection should be established between two IP addresses, while in MPTCP, a connection is allowed to use multiple paths simultaneously. To this end, an MPTCP session creates a TCP connection called a subflow on each path that needs to be used.
[0003] With the development of random virtualization technology, message transmission between virtual machines in a virtualization scenario generally uses tunneling technology. Based on tunneling technology, the received messages are encapsulated and then forwarded after encapsulation. However, when forwarding the encapsulated messages, it is difficult to distinguish the messages of multiple connections of MPTCP based on the encapsulated messages, resulting in message congestion on multiple paths under MPTCP and reducing the MPTCP transmission performance. Summary of the Invention
[0004] This Summary of the Invention section is provided to introduce concepts in a brief form, which will be described in detail in the subsequent Detailed Description section. This Summary of the Invention section is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] In a first aspect, the present disclosure provides a method for controlling message transmission, the method including:
[0006] Receiving a target message and parsing a corresponding communication connection type from the target message;
[0007] If the communication connection type corresponding to the target message is the Multi-Path Transmission Control Protocol (MPTCP) type, determining an outgoing port corresponding to the target message;
[0008] Encapsulating the target message and encapsulating the port number of the outgoing port as extended information to obtain an encapsulated message corresponding to the target message;
[0009] Controlling a message forwarder to forward the encapsulated message based on the port corresponding to the port number in the encapsulation information.
[0010] Second aspect, the present disclosure provides a message transmission control device, the device comprising:
[0011] A receiving module, configured to receive a target message and parse a corresponding communication connection type from the target message;
[0012] A determining module, configured to determine an egress port corresponding to the target message if the communication connection type corresponding to the target message is a Multipath Transmission Control Protocol (MPTCP) type;
[0013] An encapsulation module, configured to encapsulate the target message and encapsulate the port number of the egress port as extended information to obtain an encapsulated message corresponding to the target message;
[0014] A sending module, configured to control a message forwarder to forward the encapsulated message based on the port corresponding to the port number in the encapsulation information.
[0015] Third aspect, the present disclosure provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in the first aspect are implemented.
[0016] Fourth aspect, the present disclosure provides an electronic device, comprising:
[0017] A storage device, on which a computer program is stored;
[0018] A processing device, configured to execute the computer program in the storage device to implement the steps of the method described in the first aspect.
[0019] In the above technical solution, by parsing the received target message, its corresponding communication connection type can be determined. Then, for the MPTCP type message received, the egress port can be pre-distributed according to the message information before message encapsulation, so as to ensure to a certain extent that the messages of multiple sub-connections belonging to the same MPTCP session can be forwarded with port dispersion, and the port number of the determined egress port is stored in the encapsulated message, so that the message forwarder can directly forward the message based on the egress port indicated in the encapsulated message, thereby avoiding the data forwarding congestion phenomenon caused by the inability to identify multiple MPTCP sub-connections belonging to the same MPTCP session and scheduling the messages of the same MPTCP session to the same egress port for forwarding in the prior art, improving the utilization rate of the MPTCP session, and at the same time improving the data transmission efficiency of the MPTCP session, realizing high-efficiency data transmission under the MPTCP session and link aggregation, and enhancing the user experience.
[0020] Other features and advantages of the present disclosure will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In conjunction with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the original elements and components are not necessarily drawn to scale. In the drawings:
[0022] Figure 1A is a signaling interaction diagram for creating multiple connections in an MPTCP session between two hosts according to an embodiment of the present disclosure;
[0023] Figure 1B As shown, it is a schematic diagram of packet transmission between virtual machines in a virtualization scenario;
[0024] Figure 2 is a flowchart of a packet transmission control method according to an embodiment of the present disclosure;
[0025] Figure 3 As shown, it is a signaling interaction diagram corresponding to the embodiment provided based on the present disclosure;
[0026] Figure 4 is a block diagram of a packet transmission control device according to an embodiment of the present disclosure;
[0027] Figure 5 shows a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present disclosure. SPECIFIC EMBODIMENTS
[0028] The embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.
[0029] It should be understood that the various steps recited in the method embodiments of the present disclosure can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0030] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0031] It should be noted that the concepts such as "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0032] It should be noted that the modification of "one" and "multiple" mentioned in this disclosure is illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".
[0033] The names of the messages or information exchanged between multiple devices in the embodiments of this disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0034] It can be understood that before using the technical solutions disclosed in the embodiments of this disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in this disclosure should be informed to users and user authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0035] For example, when responding to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the technical solutions of this disclosure according to the prompt message.
[0036] As an optional but non-limiting implementation manner, when responding to receiving an active request from a user, the manner of sending a prompt message to the user can be, for example, in the form of a pop-up window, and the prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry selection controls for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0037] It can be understood that the above process of notifying and obtaining user authorization is only illustrative and does not constitute a limitation on the implementation manners of this disclosure. Other manners that meet relevant laws and regulations can also be applied to the implementation manners of this disclosure.
[0038] Meanwhile, it can be understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of data) should comply with the requirements of corresponding laws, regulations and related provisions.
[0039] The following first describes the method of establishing an MPTCP session connection between hosts. Assume that host A has two addresses, namely address A1 and address A2, and the address of host B is address B1. When initially establishing the MPTCP primary connection between host A and host B, it is similar to the method of establishing a standard TCP connection. Among them, there is an option in the TCP header for indicating the data offset. This option is used when establishing an MPTCP connection, and all MPTCP signals will be included in this option field. As Figure 1A shown, the method of establishing the MPTCP primary connection between host A and host B is as follows:
[0040] S1. Host A sends a SYN message to the address B1 of host B through address A1. The MPTCP field includes the MPTCP identification information MP_CAPABLE. At the same time, the SYN message may also include a key A generated by host A. The key A is used for verification when establishing subsequent sub-connections of this MPTCP. Therefore, the keys generated by host A for establishing different MPTCP primary connections are different.
[0041] S2. Host B sends a SYN+ACK message to the address A1 of host A through address B1. Similarly, the MPTCP field of this message contains the MPTCP identification information MP_CAPABLE, and the message includes a key B generated by host B.
[0042] S3. Host A sends an ACK message to the address B1 of host B through address A1, which contains the MPTCP identification information MP_CAPABLE, key A and key B. At this time, host A and host B have established a primary connection.
[0043] Thus, the handshake process of TCP and MPTCP can be completed using the ACK and MP_CAPABLE signals to ensure that both host A and host B have obtained the MPTCP session data of the other party.
[0044] After that, if host A needs to establish a connection with the address B1 of host B through address A2 (which can be called a sub-connection), the steps can be as follows:
[0045] S4. Host A sends a SYN message to the address B1 of host B through address A2. The MPTCP field of this message includes the sub-connection identification information MP_JOIN, the verification information Token and the random number A. Among them, Token is the hash value of the key B when the MPTCP primary connection is established, and the random number A can be generated by host A.
[0046] S5. Host B sends a SYN+ACK message to the address A2 of Host A through address B1. The MPTCP field of this message includes sub-connection identification information MP_JOIN, verification information HMAC-B, and random number B. Among them, HMAC-B is obtained by performing a hash operation on key A, key B, random number A, and random number B, and random number B is generated by Host B.
[0047] S6. Host A sends an ACK message to the address B1 of Host B through address A2. The MPTCP field of this message includes sub-connection identification information MP_JOIN and verification information HMAC-A. Among them, HMAC-A is obtained by performing a hash operation on key A, key B, random number A, and random number B.
[0048] S7. Host B sends an ACK message to the address A2 of Host A through address B1. At this time, the sub-connection is established. Thus, multiple MPTCP connections under the same MPTCP session can be created.
[0049] In a virtualization scenario, for the packet transmission between virtual machines, tunneling technology is generally used, that is, the packets are encapsulated and then sent. For example, they can be encapsulated through the VXLAN technology. As Figure 1B shown, virtual machine A and virtual machine B can be installed in a physical machine, and both virtual machine A and virtual machine B are respectively configured with multiple ports. If the MPTCP technology is adopted, after the virtual switch vSwitch receives the virtual machine packets, it can perform VXLAN encapsulation and send the encapsulated packets to the packet forwarder. The packet forwarder determines the out-port based on the encapsulated VXLAN packet and sends the encapsulated VXLAN packet to the switch based on the determined out-port.
[0050] Figure 2 shown is a flowchart of a packet transmission control method provided according to an embodiment of the present disclosure. As Figure 2 shown, the method may include:
[0051] In step 11, receive a target packet and parse the corresponding communication connection type from the target packet. Among them, the target packet is the currently received packet to be forwarded, which may include packets of the MPTCP type or packets of the TCP type. Exemplarily, the method can be applied to a virtual switch to implement packet forwarding.
[0052] As described above, the communication connection type corresponding to the target packet can be determined by obtaining the value in the MPTCP field of the target packet. If the MPTCP field of the target packet is MP_CAPABLE or MP_JOIN, it can be determined that the communication connection type corresponding to the target packet is the MPTCP type. If the MPTCP field of the target packet is not MP_CAPABLE or the MPTCP field is not MP_JOIN, it is determined that the communication connection type of the target packet is not the MPTCP type.
[0053] In step 12, if the communication connection type corresponding to the target packet is the Multipath Transmission Control Protocol (MPTCP) type, the outgoing port corresponding to the target packet is determined.
[0054] Among them, when forwarding packets in this field, the Link Aggregation method is usually adopted to increase the link bandwidth and achieve link transmission elasticity. Link Aggregation refers to aggregating multiple physical ports together to form a logical port to achieve load sharing of the incoming / outgoing traffic throughput among the member ports. When forwarding packets, the packet can be sent from which member port to the peer device according to a pre-set algorithm.
[0055] Correspondingly, in this embodiment, when it is determined that the communication connection type corresponding to the target packet is the MPTCP type, the target packet can be pre-distributed, that is, the outgoing port corresponding to the target packet is determined in advance. The outgoing port is used to indicate from which port of the terminal device the target packet is sent, so as to ensure the distinction of each MPTCP sub-connection when determining the outgoing port and ensure the data transmission efficiency of the MPTCP connection.
[0056] In step 13, the target packet is encapsulated and the port number of the outgoing port is encapsulated as extended information to obtain the encapsulated packet corresponding to the target packet.
[0057] Exemplarily, the target packet can be encapsulated based on the commonly used encapsulation methods in this field, such as encapsulation in the VXLAN manner. The applicant found that in the related art, when multiple ports are configured in a virtual machine and packets are transmitted through MPTCP, since the target packet needs to be encapsulated, if the encapsulated packet is directly sent to the packet forwarder, the packet forwarder cannot perceive the existence of the MPTCP sub-connections. When the packet forwarder forwards the encapsulated packet, the packets under multiple MPTCP sub-connections may be scheduled to the same outgoing port, resulting in port congestion. In the embodiment of the present disclosure, the port number of the outgoing port corresponding to the packet determined in step 12 can be added to the encapsulated packet as extended information. For example, an available field in the header field of the encapsulated packet can be selected as the storage field for the extended information, so that the encapsulated packet obtained after encapsulation can carry its corresponding port number.
[0058] In step 14, the control message forwarder forwards the encapsulated message based on the port corresponding to the port number in the encapsulation information, and the message forwarder can be a Bond driver.
[0059] In the above technical solution, by parsing the received target message, its corresponding communication connection type can be determined. Then, for the MPTCP type message received, before message encapsulation, the outbound port can be pre-distributed according to the information of the message to a certain extent, so as to ensure that the messages of multiple sub-connections under the same MPTCP session can be forwarded with port dispersion, and the port number of the determined outbound port is stored in the encapsulated message, so that the message forwarder can directly forward the message based on the outbound port indicated in the encapsulated message, thus avoiding the data forwarding congestion phenomenon caused by the inability to identify multiple MPTCP sub-connections under the same MPTCP session and scheduling the messages under the same MPTCP session to the same outbound port for forwarding in the prior art, improving the utilization rate of the MPTCP session, while improving the data transmission efficiency of the MPTCP session, realizing the high-efficiency data transmission under the MPTCP session and link aggregation, and enhancing the user experience.
[0060] In a possible embodiment, the message forwarder is used to determine the forwarding port corresponding to the encapsulated message according to the extension information, and forward the forwarding message obtained by deleting the extension information in the encapsulated message based on the forwarding port.
[0061] In this embodiment, when the message forwarder receives the encapsulated message, it can first obtain the extension information in the encapsulated message, so that it can directly determine the forwarding path of the encapsulated message based on the port indicated in the extension information, that is, forward from the forwarding port indicated in the extension information. In this process, the extension information is used to notify the message forwarder of the port for message forwarding, so the extension information in the encapsulated message can be deleted when the message forwarder forwards the encapsulated message, so as to ensure the consistency of the encapsulated message forwarded by the method of the present disclosure and the encapsulated message in the related art. At the same time, there is no need for the message forwarder to perform port routing, which improves the accuracy and rationality of port routing in the message forwarding process and can reduce the performance requirements for the message forwarder.
[0062] In a possible embodiment, an exemplary implementation manner of determining the outbound port corresponding to the target message is as follows, and this step may include:
[0063] Determine the MPTCP connection corresponding to each message in the target message.
[0064] Among them, the MPTCP fields in the target packet can be obtained, so that the connection identifier of the corresponding MPTCP connection can be determined based on the value of the MPTCP field. For example, MP_CAPABLE is used to represent the MPTCP main connection corresponding to the packet, MP_JOIN is used to represent the MPTCP sub-connection corresponding to the packet, and different sub-connections corresponding to the packet can be further determined. Among them, the MPTCP connection in this step may include each connection belonging to the same MPTCP session, that is, the main connection and each sub-connection among them.
[0065] For each of the MPTCP connections, determine the outgoing port for forwarding the packets of the MPTCP connection.
[0066] In this embodiment, when determining the outgoing port corresponding to the packet, based on the MPTCP connection corresponding to the packet, the corresponding relationship between the MPTCP connection and the corresponding outgoing port is determined, and there is no need to determine the outgoing port for each packet, which matches the packet forwarding process under the MPTCP connection and improves the packet forwarding efficiency to a certain extent.
[0067] In a possible embodiment, an exemplary implementation manner for determining the outgoing port for forwarding the packets of the MPTCP connection is as follows. This step may include:
[0068] Query the forwarding correspondence table according to the connection identifier of the MPTCP connection, where the forwarding correspondence table includes the correspondence between the connection identifier and the port.
[0069] Among them, as Figure 1A shown in, through S1 - S3, a session corresponding to the MPTCP main connection between host A and host B can be created. Then, for host A, the port used by host A to send the SYN message can be determined as the outgoing port corresponding to the MPTCP main connection, and the correspondence between the connection identifier of the MPTCP main connection and this port is created and added to the forwarding correspondence table. Exemplarily, the correspondence between connection identifier ID1 and port 1111 is generated.
[0070] If the port corresponding to the connection identifier of the MPTCP connection is queried, the port is determined as the outgoing port corresponding to the MPTCP connection.
[0071] Correspondingly, when a packet is received later, query the forwarding correspondence table according to the connection identifier of the corresponding MPTCP connection. If the connection identifier is ID1, the port corresponding to this connection identifier can be queried from the forwarding correspondence table as 1111, then the port 1111 can be determined as the outgoing port corresponding to the MPTCP connection, that is, the packets received based on the MPTCP connection corresponding to ID1 are all sent out through port 1111.
[0072] If the port corresponding to the connection identifier of the MPTCP connection is not queried, the outgoing port corresponding to the MPTCP connection is determined according to the port information corresponding to the packet forwarder.
[0073] If, for a received packet, the connection identifier of the corresponding MPTCP connection is ID2, and the forwarding correspondence table is queried based on the connection identifier ID2, and the port number corresponding to the connection identifier ID2 is not queried, then automatic allocation can be performed based on the port information at this time.
[0074] Among them, in this embodiment, the packet forwarder can be used to monitor each port in real time, and the port information can be used to indicate the availability of each port. Then, the port information of each port is synchronized to the virtual switch so that the virtual switch can determine the availability of each port in real time. For example, if the packet forwarder detects that port 1122 fails, the virtual switch can be used to ensure that the virtual switch does not use port 1122 as the outgoing port when determining the outgoing port based on the port information, thus ensuring the accurate and effective forwarding of packets.
[0075] Therefore, through the above technical solution, when determining the outgoing port corresponding to the MPTCP connection, the forwarding correspondence table can be queried first to enable the forwarding of packets based on the allocated outgoing port, avoiding the forwarding conflict of packets of each connection under the same MPTCP session, and ensuring the order and integrity of packet forwarding under the same MPTCP connection.
[0076] In a possible embodiment, the determining the outgoing port corresponding to the MPTCP connection according to the port information corresponding to the packet forwarder includes any one of the following:
[0077] First, determine the available ports according to the port information, and determine the outgoing port corresponding to the MPTCP connection by polling the available ports.
[0078] Among them, in the port information, the availability of the corresponding port can be marked by a flag bit. For example, if the flag bit is 1, it means the port is available, and if the flag bit is 0, it means the port is unavailable. Then, the packet forwarder can modify the flag bits of each port based on the monitored situation during the port monitoring process. Correspondingly, in this step, the ports with the flag bit 1 in the port information can be used as available ports. For example, for ports port1 - port8, the outgoing port corresponding to the MPTCP connection can be further determined by polling the available ports.
[0079] For example, if no corresponding ports are found for connection identifier ID2 and connection identifier ID3, then based on the polling mechanism, port1 can be used as the egress port corresponding to the MPTCP connection corresponding to connection identifier ID2, and port2 can be used as the egress port corresponding to the MPTCP connection corresponding to connection identifier ID3. Thus, the load balancing of multiple MPTCP connections in the MPTCP session can be ensured to a certain extent, so as to reduce the transmission pressure of packet forwarding.
[0080] Second, determine the available ports according to the port information and the load information corresponding to the available ports, and determine the available port corresponding to the load information indicating the minimum load as the egress port corresponding to the MPTCP connection.
[0081] Among them, the method of determining the available ports according to the port information is the same as above and will not be elaborated here. Correspondingly, when the packet forwarder monitors each port, it can monitor the load information of each port. This load information can be the used bandwidth information corresponding to the current port. Then the packet forwarder can send the identifier bits and load information corresponding to each port to the virtual switch. When determining the egress port corresponding to the MPTCP connection, it can be determined that ports port1 - port8 are available ports based on the identifier bits. Among them, the load information of port4 corresponds to the minimum load, so this port can be used as the egress port corresponding to this MPTCP connection. Thus, the load balancing in the packet forwarding process can be improved, the packet forwarding efficiency can be increased, and the risk of packet loss during packet transmission can be reduced.
[0082] Third, determine the available ports according to the port information, and use any one of the available ports other than the allocated ports as the egress port corresponding to the MPTCP connection, where the allocated ports are the egress ports corresponding to each MPTCP connection in the session to which the MPTCP connection belongs.
[0083] Among them, the method of determining the available ports according to the port information is the same as above and will not be elaborated here. If the session to which the current MPTCP connection belongs includes MPTCP connections L1 - L4, the determined available ports are port1 - port8, and the egress port corresponding to L1 is port1, and the egress port corresponding to L2 is port2, that is, port1 and port2 are allocated ports. Then when determining the corresponding egress ports for L3 and L4, ports can be selected from port3 - port8 as the egress ports corresponding to L3 and L4. For example, determine port3 as the egress port corresponding to L3 and determine port5 as the egress port corresponding to L4. Thus, it can be determined that the packets of different MPTCP connections in the same MPTCP session can be scheduled to different egress ports for forwarding, improving the data transmission efficiency of the MPTCP session.
[0084] In a possible embodiment, after the step of determining the egress port corresponding to the MPTCP connection according to the port information corresponding to the packet forwarder, the method may further include:
[0085] Generate a correspondence between the connection identifier of the MPTCP connection and the determined egress port, and store the correspondence in the forwarding correspondence table.
[0086] As in the above example, based on the polling mechanism, port1 can be used as the egress port corresponding to the MPTCP connection with connection identifier ID2, and port2 can be used as the egress port corresponding to the MPTCP connection with connection identifier ID3. Then, the correspondence can be generated according to the allocated egress ports, such as generating correspondence 1: <ID2, port1>, correspondence 2: <ID3, port2>.
[0087] Thus, the update of the forwarding correspondence table can be realized, thereby further improving the efficiency of determining the egress ports of each MPTCP connection based on the forwarding correspondence table. At the same time, it can also ensure that the packets of the same MPTCP connection are forwarded through the same egress port, guaranteeing the order and security of packet forwarding.
[0088] In a possible embodiment, the method may further include:
[0089] If the communication connection corresponding to the MPTCP connection ends, delete the correspondence with the connection identifier of the MPTCP connection in the forwarding correspondence table.
[0090] Among them, in this embodiment, a single MPTCP session may include multiple MPTCP connections. When a certain MPTCP sub-connection terminates, it does not affect the communication of the MPTCP session. It is possible to end the communication connection corresponding to the MPTCP connection through a FIN message in a manner similar to standard TCP. At this time, the channel corresponding to the MPTCP connection can be deleted in the MPTCP session. Correspondingly, in this embodiment, when the communication connection corresponding to the MPTCP connection ends, the correspondence with the connection identifier of the MPTCP connection can be further deleted, ensuring the accuracy and real-time nature of the forwarding correspondence, and to a certain extent avoiding conflicts in egress port allocation, guaranteeing the security and efficiency of packet forwarding based on the MPTCP session.
[0091] In a possible embodiment, the method may further include:
[0092] If the communication connection type corresponding to the target packet is not the MPTCP type, encapsulate the target packet and send the encapsulated packet to the packet forwarder, so that the packet forwarder determines the out-port corresponding to the encapsulated packet and forwards the encapsulated packet based on the determined out-port.
[0093] Thus, for packets of non-MPTCP type, the packets of each session are transmitted through the same connection, and their corresponding packets are forwarded through the same out-port. Then, they can be directly encapsulated so that the packet forwarder determines the corresponding out-port for forwarding, ensuring the security and efficiency of packet forwarding.
[0094] Figure 3 As shown, it is a signaling interaction diagram corresponding to the embodiment provided by the present disclosure. The packet forwarder can monitor each port in real time, synchronize the port information of each port to the virtual switch, and the virtual switch updates the out-port according to the port information corresponding to the packet forwarder. This process can be synchronized at preset intervals, which is not limited here. For example, there are two addresses in the client VM1, which are 192.168.1.10 and 192.168.1.20 respectively. First, initiate an MPTCP main connection based on 192.168.1.10. After the virtual switch receives the packet from VM1 with the MP_CAPABLE flag, according to the current available ports, it determines that the out-port corresponding to this packet is X, generates the corresponding relationship between the connection identifier of this connection and this out-port, and stores it in the forwarding correspondence table. Then, it can encapsulate the packet and send it to the packet forwarder, controlling the packet forwarder to delete the extended information and forward it based on the physical interface X.
[0095] After that, receive the reply packet from the client VM2, such as Figure 3 the packet sent by the physical interface X to the packet forwarder and further sent to the virtual switch. After the virtual switch receives the packet from VM2 with the MP_CAPABLE flag, it calculates the token of VM2, saves the session information, and establishes an association with the corresponding relationship generated by VM1 before, that is, saves the session information for communication between VM1 and VM2 in the virtual switch.
[0096] Furthermore, initiate an MPTCP sub-connection based on the address 192.168.1.10 of VM1. After the virtual switch receives the sub-connection packet with the MP_JOIN flag sent to VM2, it identifies the MPTCP main connection information corresponding to the sub-connection according to the token, determines the out-port as Y, and takes the port information as the extended information. Then, it can encapsulate the packet and send it to the packet forwarder, controlling the packet forwarder to delete the extended information and forward it based on the physical interface Y.
[0097] Among them, the methods for creating the MPTCP main connection and the MPTCP sub - connections in the above process have been described in detail above and will not be elaborated here. If you want to end the session of the sub - connection, you can achieve this by sending a TCP FIN packet, thereby deleting the session information corresponding to the sub - connection. The deletion of the session information can be processed by common methods in this field, and the present disclosure does not limit this.
[0098] The present disclosure also provides a packet transmission control device, as Figure 4 shown, the device 10 includes:
[0099] A receiving module 100, configured to receive a target packet and parse the corresponding communication connection type from the target packet;
[0100] A determining module 200, configured to determine the outgoing port corresponding to the target packet if the communication connection type corresponding to the target packet is the Multipath Transmission Control Protocol (MPTCP) type;
[0101] An encapsulation module 300, configured to encapsulate the target packet and encapsulate the port number of the outgoing port as extended information to obtain the encapsulated packet corresponding to the target packet;
[0102] A sending module 400, configured to control a packet forwarder to forward the encapsulated packet based on the port corresponding to the port number in the encapsulation information.
[0103] Optionally, the determining module 200 includes:
[0104] A first determining sub - module, configured to determine the MPTCP connection corresponding to each packet in the target packet;
[0105] A second determining sub - module, configured to, for each MPTCP connection, determine the outgoing port for forwarding the packets of the MPTCP connection.
[0106] Optionally, the second determining sub - module includes:
[0107] A querying sub - module, configured to query a forwarding correspondence table according to the connection identifier of the MPTCP connection, where the forwarding correspondence table includes the correspondence between the connection identifier and the port;
[0108] A third determining sub - module, configured to, if the port corresponding to the connection identifier of the MPTCP connection is queried, determine the port as the outgoing port corresponding to the MPTCP connection;
[0109] A fourth determining sub - module, configured to, if the port corresponding to the connection identifier of the MPTCP connection is not queried, determine the outgoing port corresponding to the MPTCP connection according to the port information corresponding to the packet forwarder.
[0110] Optionally, the fourth determination sub-module includes any one of the following:
[0111] A fifth determination sub-module, configured to determine available ports according to the port information, and determine an outgoing port corresponding to the MPTCP connection by polling the available ports;
[0112] A sixth determination sub-module, configured to determine available ports and load information corresponding to the available ports according to the port information, and determine the available port corresponding to the load information indicating the minimum load as the outgoing port corresponding to the MPTCP connection;
[0113] A seventh determination sub-module, configured to determine available ports according to the port information, and use any one of the available ports other than the allocated ports as the outgoing port corresponding to the MPTCP connection, where the allocated ports are the outgoing ports corresponding to each MPTCP connection in the session to which the MPTCP connection belongs.
[0114] Optionally, the apparatus further includes:
[0115] A generation module, configured to generate a correspondence between the connection identifier of the MPTCP connection and the determined outgoing port after the fourth determination sub-module determines the outgoing port corresponding to the MPTCP connection according to the port information corresponding to the packet forwarder, and store the correspondence in the forwarding correspondence table.
[0116] Optionally, the apparatus further includes:
[0117] A deletion module, configured to delete the correspondence with the connection identifier of the MPTCP connection in the forwarding correspondence table if the communication connection corresponding to the MPTCP connection ends.
[0118] Optionally, the packet forwarder is configured to determine a forwarding port corresponding to the encapsulated packet according to the extended information, and forward the forwarded packet obtained by deleting the extended information in the encapsulated packet based on the forwarding port.
[0119] Next, refer to Figure 5 , which shows a schematic structural diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5The electronic device shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0120] As Figure 5 shown, the electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in the read-only memory (ROM) 602 or a program loaded from the storage device 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.
[0121] Generally, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 can allow the electronic device 600 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 5 the electronic device 600 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.
[0122] Specifically, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
[0123] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0124] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed network.
[0125] The above-mentioned computer-readable medium can be included in the above-mentioned electronic device; it can also exist separately and not be assembled into the electronic device.
[0126] The above computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: receive a target message, and parse the corresponding communication connection type from the target message; if the communication connection type corresponding to the target message is the Multipath Transmission Control Protocol (MPTCP) type, determine the outgoing port corresponding to the target message; encapsulate the target message and encapsulate the port number of the outgoing port as extended information to obtain an encapsulated message corresponding to the target message; control the message forwarder to forward the encapsulated message based on the port corresponding to the port number in the encapsulation information.
[0127] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0128] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that, in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0129] The modules involved in the embodiments of the present disclosure can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the module itself in some cases. For example, the receiving module can also be described as "a module that receives a target message and parses the corresponding communication connection type from the target message".
[0130] The functions described above herein can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Product (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), and so on.
[0131] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or Flash Memory), optical fiber, portable compact disc read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0132] According to one or more embodiments of the present disclosure, Example 1 provides a method for controlling message transmission, wherein the method includes:
[0133] Receiving a target message and parsing the corresponding communication connection type from the target message;
[0134] If the communication connection type corresponding to the target message is the Multipath Transmission Control Protocol (MPTCP) type, determining the outgoing port corresponding to the target message;
[0135] Encapsulating the target message and encapsulating the port number of the outgoing port as extended information to obtain an encapsulated message corresponding to the target message;
[0136] Controlling a message forwarder to forward the encapsulated message based on the port corresponding to the port number in the encapsulated information.
[0137] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein determining the egress port corresponding to the target packet includes:
[0138] Determine the MPTCP connections corresponding to the packets in the target packet;
[0139] For each of the MPTCP connections, determine the egress port for forwarding the packets of the MPTCP connection.
[0140] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein determining the egress port for forwarding the packets of the MPTCP connection includes:
[0141] Query the forwarding correspondence table according to the connection identifier of the MPTCP connection, wherein the forwarding correspondence table includes the correspondence between the connection identifier and the port;
[0142] If the port corresponding to the connection identifier of the MPTCP connection is queried, determine the port as the egress port corresponding to the MPTCP connection;
[0143] If the port corresponding to the connection identifier of the MPTCP connection is not queried, determine the egress port corresponding to the MPTCP connection according to the port information corresponding to the packet forwarder.
[0144] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3, wherein determining the egress port corresponding to the MPTCP connection according to the port information corresponding to the packet forwarder includes any one of the following:
[0145] Determine available ports according to the port information, and determine the egress port corresponding to the MPTCP connection by polling the available ports;
[0146] Determine available ports according to the port information and the load information corresponding to the available ports, and determine the available port corresponding to the load information indicating the minimum load as the egress port corresponding to the MPTCP connection;
[0147] Determine available ports according to the port information, and use any one of the available ports other than the allocated ports as the egress port corresponding to the MPTCP connection, wherein the allocated ports are the egress ports corresponding to the MPTCP connections in the session to which the MPTCP connection belongs.
[0148] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 3, wherein after the step of determining the egress port corresponding to the MPTCP connection according to the port information corresponding to the packet forwarder, the method further includes:
[0149] Generate a correspondence between the connection identifier of the MPTCP connection and the determined outgoing port, and store the correspondence in the forwarding correspondence table.
[0150] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 3, wherein the method further includes:
[0151] If the communication connection corresponding to the MPTCP connection ends, delete the correspondence with the connection identifier of the MPTCP connection in the forwarding correspondence table.
[0152] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 1, wherein the packet forwarder is used to determine the forwarding port corresponding to the encapsulated packet according to the extended information, and forward the forwarding packet obtained by deleting the extended information in the encapsulated packet based on the forwarding port.
[0153] According to one or more embodiments of the present disclosure, Example 8 provides a packet transmission control device, wherein the device includes:
[0154] A receiving module, configured to receive a target packet and parse the corresponding communication connection type from the target packet;
[0155] A determining module, configured to determine the outgoing port corresponding to the target packet if the communication connection type corresponding to the target packet is a Multipath Transmission Control Protocol (MPTCP) type;
[0156] An encapsulation module, configured to encapsulate the target packet and encapsulate the port number of the outgoing port as extended information to obtain an encapsulated packet corresponding to the target packet;
[0157] A sending module, configured to control the packet forwarder to forward the encapsulated packet based on the port corresponding to the port number in the encapsulation information.
[0158] According to one or more embodiments of the present disclosure, Example 9 provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in any one of Examples 1-7 are implemented.
[0159] According to one or more embodiments of the present disclosure, Example 10 provides an electronic device, including:
[0160] A storage device, on which a computer program is stored;
[0161] A processing device, configured to execute the computer program in the storage device to implement the steps of the method described in any one of Examples 1-7.
[0162] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0163] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented combinatorially in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0164] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.
Claims
1. A message transmission control method, characterized in that, The method includes: Receiving a target packet to be forwarded, and parsing a corresponding communication connection type from the MPTCP field in the target packet; If the communication connection type corresponding to the target packet is the Multipath Transmission Control Protocol (MPTCP) type, determining an output port corresponding to the target packet; Encapsulating the target packet and encapsulating the port number of the output port as extended information to obtain an encapsulated packet corresponding to the target packet; Controlling a packet forwarder to forward the encapsulated packet based on the port corresponding to the port number in the encapsulation information; The determining of the output port corresponding to the target packet includes: Determining an MPTCP connection corresponding to each packet in the target packet according to the MPTCP field in the target packet; the MPTCP connection includes a primary connection and each sub-connection belonging to the same MPTCP session; For each of the MPTCP connections, querying a forwarding correspondence table according to the connection identifier of the MPTCP connection to determine an output port for forwarding the packets of the MPTCP connection, so as to forward the packets based on the allocated output ports; wherein, the forwarding correspondence table includes the correspondence between the connection identifier of the MPTCP primary connection and the output port recorded when creating the MPTCP primary connection session; packets of different MPTCP connections in the same MPTCP session are scheduled to be forwarded to different output ports.
2. The method according to claim 1, characterized in that The determining of the output port for forwarding the packets of the MPTCP connection includes: If a port corresponding to the connection identifier of the MPTCP connection is queried, determining the port as the output port corresponding to the MPTCP connection; If a port corresponding to the connection identifier of the MPTCP connection is not queried, determining the output port corresponding to the MPTCP connection according to the port information corresponding to the packet forwarder.
3. The method according to claim 2, wherein The determining of the output port corresponding to the MPTCP connection according to the port information corresponding to the packet forwarder includes any one of the following: Determining available ports according to the port information, and determining the output port corresponding to the MPTCP connection by polling the available ports; Determining available ports according to the port information and load information corresponding to the available ports, and determining the available port corresponding to the load information indicating the minimum load as the output port corresponding to the MPTCP connection; Determining available ports according to the port information, and taking any one of the available ports except the allocated ports as the output port corresponding to the MPTCP connection, wherein the allocated ports are the output ports corresponding to each MPTCP connection in the session to which the MPTCP connection belongs.
4. The method according to claim 2, wherein After the step of determining the output port corresponding to the MPTCP connection according to the port information corresponding to the packet forwarder, the method further includes: Generating a correspondence between the connection identifier of the MPTCP connection and the determined output port, and storing the correspondence in the forwarding correspondence table.
5. The method according to claim 2, wherein The method further includes: If the communication connection corresponding to the MPTCP connection ends, delete the corresponding relationship in the forwarding correspondence table with the connection identifier of the MPTCP connection.
6. The method according to claim 1, wherein The packet forwarder is used to determine the forwarding port corresponding to the encapsulated packet according to the extended information, and forward the forwarded packet obtained by deleting the extended information in the encapsulated packet based on the forwarding port.
7. A message transmission control device, characterized in that The device includes: A receiving module, configured to receive a target packet to be forwarded, and parse the corresponding communication connection type from the MPTCP field in the target packet; A determining module, configured to determine the outgoing port corresponding to the target packet if the communication connection type corresponding to the target packet is the Multipath Transmission Control Protocol (MPTCP) type; An encapsulation module, configured to encapsulate the target packet and encapsulate the port number of the outgoing port as extended information to obtain the encapsulated packet corresponding to the target packet; A sending module, configured to control the packet forwarder to forward the encapsulated packet based on the port corresponding to the port number in the encapsulation information; The determining module includes: A first determining sub-module, configured to determine the MPTCP connection corresponding to each packet in the target packet according to the MPTCP field in the target packet; the MPTCP connection includes a main connection and each sub-connection belonging to the same MPTCP session; A second determining sub-module, configured to, for each MPTCP connection, query the forwarding correspondence table according to the connection identifier of the MPTCP connection, and determine the outgoing port for forwarding the packets of the MPTCP connection, so as to forward the packets based on the allocated outgoing port; wherein, the forwarding correspondence table includes the corresponding relationship between the connection identifier of the MPTCP main connection recorded when creating the MPTCP main connection session and the outgoing port; packets of different MPTCP connections in the same MPTCP session are scheduled to different outgoing ports for forwarding.
8. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processing device, the steps of the method according to any one of claims 1-6 are implemented.
9. An electronic device, characterized in that, Including: A storage device, on which a computer program is stored; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1-6.
Citation Information
Patent Citations
Method, device and network system for multi-port load sharing
CN101605091A
Network load balancing method and device, electronic equipment, medium and program product
CN114285802A