Search

CN-122027598-A - Message transmission method, device, computer equipment and storage medium

CN122027598ACN 122027598 ACN122027598 ACN 122027598ACN-122027598-A

Abstract

The embodiment of the application provides a message transmission method, a message transmission device, computer equipment and a storage medium. The method includes the steps that a cloud gateway converts an original source address of a user message into a first source address, generates the first user message and sends the first user message to network equipment, the conversion relation between the original source address and the first source address is stored in NAT session information, the first network message returned by the network equipment for the first user message is received, decapsulation and DNAT processing are carried out on the first network message according to a pre-configured SRv NAT instruction and NAT session information, and the processed network message is sent to target user equipment. According to the method, by introducing SRv NAT instructions, efficient forwarding and address conversion of the message under the cloud gateway scene are realized.

Inventors

  • WU HUANZHENG
  • LIU WENBIN
  • YIN BIN

Assignees

  • 中移(杭州)信息技术有限公司
  • 中国移动通信集团有限公司

Dates

Publication Date
20260512
Application Date
20241112

Claims (14)

  1. 1. The message transmission method is applied to the cloud gateway and is characterized by comprising the following steps: obtaining a user message sent by target user equipment, converting an original source address of the user message into a first source address, generating a first user message, and storing the conversion relation between the original source address and the first source address into NAT session information; the first user message is sent to network equipment, and a first network message returned by the network equipment aiming at the first user message is received; And according to a pre-configured SRv NAT instruction and the NAT session information, performing decapsulation and DNAT processing on the first network message, and sending the processed network message to the target user equipment.
  2. 2. The method of claim 1, wherein the performing decapsulation and DNAT processing on the first network message according to the preconfigured SRv NAT instruction and the NAT session information, and sending the processed network message to the target user device, comprises: Decapsulating the first network message to obtain the network message; Converting a first destination address in the network message into a second destination address based on the NAT session information, and generating a second network message, wherein the first destination address corresponds to the first source address, and the second destination address corresponds to the original source address; and sending the second network message to the target user equipment based on the second destination address.
  3. 3. The method of claim 2, wherein when the target user device is a two-tier network device, the preconfigured SRv NAT instruction is a first SRv NAT instruction, the sending the second network message to the target user device based on the second destination address comprising: and searching the NAT session information to determine a target two-layer outbound interface, and sending the second network message to the target user equipment through the target two-layer outbound interface.
  4. 4. The method of claim 2, wherein when the target user device is an IPv4 three-layer network device, the preconfigured SRv NAT instruction is a second SRv6 NAT instruction, the sending the second network message to the target user device based on the second destination address comprising: and sending the second network message to the target user equipment by searching a target IPv4 routing table configured by the second SRv NAT instruction.
  5. 5. The method of claim 2, wherein when the target user device is an IPv6 three-layer network device, the preconfigured SRv NAT instruction is a third SRv NAT instruction, the sending the second network message to the target user device based on the second destination address comprising: And sending the second network message to the target user equipment by searching a target IPv6 routing table configured by the third SRv NAT instruction.
  6. 6. The method according to any one of claims 1 to 5, wherein the sending the first user message to a network device and receiving a first network message returned by the network device for the first user message include: And packaging an upper-segment routing header for the first user message, updating the first user message, and sending the updated first user message to the network equipment.
  7. 7. A message transmission method applied to a network device, comprising: receiving a first user message sent by a cloud gateway, wherein the first user message is generated by converting an original source address of the user message into a first source address, and the user message is sent to the cloud gateway by target user equipment; and returning a first network message to the cloud gateway aiming at the first user message, so that the cloud gateway performs decapsulation and DNAT processing on the first network message according to a pre-configured SRv NAT instruction and NAT session information, and sends the processed network message to the target user equipment, wherein the NAT session information is used for storing the conversion relation between the original source address and the first source address.
  8. 8. The method of claim 7, wherein the returning the first network message to the cloud gateway for the first user message comprises: After receiving the first user message, executing the following operations according to a pre-configured SRv < 6 > NAT instruction: Unpacking the first user message, converting the first source address in the unpacked first user message into a second source address, updating the first user message, and storing the conversion relation between the first source address and the second source address into NAT session information; and returning the first network message to the cloud gateway aiming at the updated first user message.
  9. 9. The method of claim 8, wherein returning the first network message to the cloud gateway for the updated first user message comprises: The updated first user message is sent to cloud equipment, and a network message returned by the cloud equipment aiming at the updated first user message is received; And packaging an upper-segment routing header for the network message, generating the first network message, and sending the first network message to the cloud gateway.
  10. 10. The method of claim 9, wherein encapsulating the upper segment routing header for the network message, generating the first network message, and sending the first network message to the cloud gateway comprises: converting an original destination address in the network message into a first destination address based on the NAT session information, updating the network message, wherein the original destination address corresponds to the second source address, and the first destination address corresponds to the first source address; And packaging the updated network message, generating the first network message, and sending the first network message to the cloud gateway.
  11. 11. A message transmission apparatus, comprising: The system comprises an acquisition module, a first source address generation module and a first source address generation module, wherein the acquisition module is used for acquiring a user message sent by target user equipment, converting an original source address of the user message into the first source address, generating a first user message, and storing the conversion relation between the original source address and the first source address into NAT session information; the receiving and sending module is used for sending the first user message to network equipment and receiving a first network message returned by the network equipment aiming at the first user message; And the processing module is used for performing decapsulation and DNAT processing on the first network message according to a pre-configured SRv NAT instruction and the NAT session information, and sending the processed network message to the target user equipment.
  12. 12. A message transmission apparatus, comprising: The receiving module is used for receiving a first user message sent by the cloud gateway, wherein the first user message is generated by converting an original source address of the user message into a first source address, and the user message is sent to the cloud gateway by target user equipment; And the sending module is used for returning a first network message to the cloud gateway aiming at the first user message, so that the cloud gateway can execute decapsulation and DNAT processing on the first network message according to a pre-configured SRv NAT instruction and NAT session information, and send the processed network message to the target user equipment, wherein the NAT session information is used for storing the conversion relation between the original source address and the first source address.
  13. 13. A computer device comprising a processor and a memory storing computer program instructions, the processor reading and executing the computer program instructions to implement the message transmission method of any of claims 1-6 or 7-10.
  14. 14. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon computer program instructions, which when executed by a processor, implement the message transmission method according to any of claims 1-6 or 7-10.

Description

Message transmission method, device, computer equipment and storage medium Technical Field The present application belongs to the field of communications technologies, and in particular, to a method and apparatus for transmitting a message, a computer device, and a storage medium. Background With the development of cloud computing technology, the demand for fast and reliable connection by users is increasing, and means for realizing network acceleration by utilizing SRv technology is generated. In an application scenario where SRv (Segment Routing over IPv, segment routing based on IPv6 forwarding plane) is used in a cloud gateway environment to accelerate the network, there are typically multiple tenants, and multiple tenants may share the same private IPv4 (Internet Protocol version, internet protocol version 4) address, thus requiring efficient NAT (Network Address Translation ) techniques to achieve identification of user identities and translation of public and private IP addresses (Internet Protocol Address, internet protocol addresses). However, due to the imperfect NAT mechanism of the current SRv, efficient address translation cannot be achieved in the SRv6 transmission process, thereby affecting the accurate transmission of the broadband data packet and the access experience of the user. Therefore, how to design a solution for improving the message transmission effect in the acceleration scenario of the cloud gateway SRv becomes a current urgent problem to be solved. Disclosure of Invention The embodiment of the application provides a message transmission method, a message transmission device, computer equipment and a storage medium, which can solve the technical problem that NAT cannot be effectively performed when SRv is used for realizing network acceleration in a cloud gateway scene. In a first aspect, an embodiment of the present application provides a method for transmitting a message, which is applied to a cloud gateway, where the method includes: Obtaining a user message sent by target user equipment, converting an original source address of the user message into a first source address, generating a first user message, and storing the conversion relation between the original source address and the first source address into NAT session information; The method comprises the steps of sending a first user message to network equipment and receiving a first network message returned by the network equipment aiming at the first user message; And according to the pre-configured SRv NAT instruction and NAT session information, performing decapsulation and DNAT processing on the first network message, and sending the processed network message to the target user equipment. In a possible implementation manner of the first aspect, according to a preconfigured SRv NAT instruction and NAT session information, the decapsulating and DNAT processing are performed on the first network packet, and the processed network packet is sent to the target user equipment, including: decapsulating the first network message to obtain a network message; converting a first destination address in the network message into a second destination address based on NAT session information, and generating a second network message, wherein the first destination address corresponds to a first source address, and the second destination address corresponds to an original source address; and sending the second network message to the target user equipment based on the second destination address. In a possible implementation manner of the first aspect, when the target ue is a two-layer network device, the preconfigured SRv NAT instruction is a first SRv NAT instruction, and the sending the second network packet to the target ue based on the second destination address includes: and searching NAT session information to determine a target two-layer out interface, and sending the second network message to target user equipment through the target two-layer out interface. In a possible implementation manner of the first aspect, when the target ue is an IPv4 three-layer network device, the preconfigured SRv NAT instruction is a second SRv NAT instruction, and the sending the second network packet to the target ue based on the second destination address includes: and sending the second network message to the target user equipment by searching a target IPv4 routing table configured by the second SRv NAT instruction. In a possible implementation manner of the first aspect, when the target ue is an IPv6 (Internet Protocol version, internet protocol version 6) three-layer network device, the pre-configured SRv NAT instruction is a third instruction, and the sending the second network packet to the target ue based on the second destination address includes: And sending the second network message to the target user equipment by searching a target IPv6 routing table configured by the third SRv NAT instruction. In one possible implementation manner of th