[go: up one dir, main page]

CN115664773A - Message processing method, device, storage medium and program product - Google Patents

Message processing method, device, storage medium and program product Download PDF

Info

Publication number
CN115664773A
CN115664773A CN202211289296.4A CN202211289296A CN115664773A CN 115664773 A CN115664773 A CN 115664773A CN 202211289296 A CN202211289296 A CN 202211289296A CN 115664773 A CN115664773 A CN 115664773A
Authority
CN
China
Prior art keywords
data packet
encrypted
information
encrypted data
sent
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
CN202211289296.4A
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.)
Beijing Volcano Engine Technology Co Ltd
Original Assignee
Beijing Volcano Engine Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Volcano Engine Technology Co Ltd filed Critical Beijing Volcano Engine Technology Co Ltd
Priority to CN202211289296.4A priority Critical patent/CN115664773A/en
Publication of CN115664773A publication Critical patent/CN115664773A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the disclosure provides a message processing method, a message processing device, a message processing storage medium and a program product, wherein a virtual switch of a cloud computing node encrypts a data packet according to security association information sent by a virtual private network gateway in advance and sends the encrypted data packet to the virtual private network gateway, the virtual private network gateway fills message information into the encrypted data packet, the encrypted data packet is packaged into a complete target message, and the target message is sent to a target client gateway. The computing resources of each computing node are fully utilized, so that the virtual private network gateway does not need to execute encryption processing, the problem of performance bottleneck of the virtual private network gateway under the condition of excessive virtual switches is solved, and the transmission of messages is ensured.

Description

报文处理方法、设备、存储介质及程序产品Message processing method, device, storage medium and program product

技术领域technical field

本公开实施例涉及计算机与网络通信技术领域以及云计算技术领域,尤其涉及一种报文处理方法、设备、存储介质及程序产品。Embodiments of the present disclosure relate to the technical field of computer and network communication and the technical field of cloud computing, and in particular, to a message processing method, device, storage medium, and program product.

背景技术Background technique

虚拟专用网络(Virtual Private Network,VPN)是在公用网络上建立专用网络,进行加密通讯,采用VPN网关对数据包的加密和数据包目标地址的转换或者使用隧道技术实现远程访问。VPN可通过服务器、硬件、软件等多种方式实现。IPSec VPN是指采用IPSec(Internet Protocol Security,互联网安全协议)实现远程接入的一种VPN技术。A virtual private network (Virtual Private Network, VPN) is to establish a private network on a public network for encrypted communication, use VPN gateways to encrypt data packets and convert data packet destination addresses, or use tunneling technology to achieve remote access. VPN can be realized by server, hardware, software and other ways. IPSec VPN refers to a VPN technology that uses IPSec (Internet Protocol Security, Internet Security Protocol) to realize remote access.

在云端实现IPsec VPN时,计算节点通过虚拟交换机与IPSec VPN网关连接,计算节点中各虚拟机(Virtual Machine,VM)对外传输的数据包由虚拟交换机发送到IPSecVPN网关,由IPSec VPN网关加密生成报文,再发送给目标网关。When implementing IPsec VPN on the cloud, the computing nodes are connected to the IPSec VPN gateway through the virtual switch, and the data packets transmitted by each virtual machine (Virtual Machine, VM) in the computing node are sent to the IPSec VPN gateway by the virtual switch, and the IPSec VPN gateway encrypts and generates a packet. text, and then send it to the target gateway.

现有技术中在云化场景中,计算节点中各虚拟机数量多、流量大、分布散,IPSecVPN网关处理大量加密报文时压力加大,对性能要求较高。In the cloudification scenario in the prior art, the number of virtual machines in the computing nodes is large, the traffic is large, and the distribution is scattered. The pressure on the IPSecVPN gateway to process a large number of encrypted messages increases, and the performance requirements are high.

发明内容Contents of the invention

本公开实施例提供一种报文处理方法、设备、存储介质及程序产品,以降低IPSecVPN网关的压力,避免IPSec VPN网关的性能瓶颈问题。Embodiments of the present disclosure provide a message processing method, device, storage medium and program product, so as to reduce the pressure on the IPSec VPN gateway and avoid the performance bottleneck problem of the IPSec VPN gateway.

第一方面,本公开实施例提供一种报文处理方法,所述方法包括:In a first aspect, an embodiment of the present disclosure provides a message processing method, the method including:

接收云端计算节点的虚拟交换机发送的加密数据包,其中,所述加密数据包由所述虚拟交换机根据互联网安全协议的安全关联信息进行加密;所述安全关联信息是预先发送给所述虚拟交换机的;receiving the encrypted data packet sent by the virtual switch of the cloud computing node, wherein the encrypted data packet is encrypted by the virtual switch according to the security association information of the Internet security protocol; the security association information is sent to the virtual switch in advance ;

对所述加密数据包填充报文信息,封装为完整的目标报文;Filling the encrypted data packet with message information and encapsulating it into a complete target message;

将所述目标报文发送给目标客户网关。Send the target message to the target customer gateway.

第二方面,本公开实施例提供一种报文处理方法,所述方法包括:In a second aspect, an embodiment of the present disclosure provides a message processing method, the method including:

接收云端计算节点的虚拟机发送的待发送数据包;Receive the data packet to be sent sent by the virtual machine of the cloud computing node;

根据互联网安全协议的安全关联信息中的加密策略,判断所述待发送数据包是否需要加密,若确定需要加密,则根据所述安全关联信息中的密钥对所述待发送数据包进行加密,得到加密数据包;其中,所述安全关联信息是由云端基于互联网安全协议的虚拟专用网络网关预先发送的;According to the encryption strategy in the security-related information of the Internet security protocol, it is judged whether the data packet to be sent needs to be encrypted, and if it is determined that encryption is required, the data packet to be sent is encrypted according to the key in the security-related information, An encrypted data packet is obtained; wherein, the security association information is pre-sent by the virtual private network gateway based on the Internet security protocol in the cloud;

将加密数据包发送给所述虚拟专用网络网关,以使所述虚拟专用网络网关对所述加密数据包填充报文信息,封装为完整的目标报文,并发送给目标客户网关。Sending the encrypted data packet to the virtual private network gateway, so that the virtual private network gateway fills the encrypted data packet with message information, encapsulates it into a complete target message, and sends it to the target customer gateway.

第三方面,本公开实施例提供一种报文处理设备,包括:In a third aspect, an embodiment of the present disclosure provides a packet processing device, including:

接收单元,用于接收云端计算节点的虚拟交换机发送的加密数据包,其中,所述加密数据包由所述虚拟交换机根据互联网安全协议的安全关联信息进行加密;所述安全关联信息是预先发送给所述虚拟交换机的;The receiving unit is used to receive the encrypted data packet sent by the virtual switch of the cloud computing node, wherein the encrypted data packet is encrypted by the virtual switch according to the security association information of the Internet security protocol; the security association information is pre-sent to of the virtual switch;

处理单元,用于对所述加密数据包填充报文信息,封装为完整的目标报文;A processing unit, configured to fill the encrypted data packet with message information and encapsulate it into a complete target message;

发送单元,用于将所述目标报文发送给目标客户网关。A sending unit, configured to send the target message to the target customer gateway.

第四方面,本公开实施例提供一种报文处理设备,包括:In a fourth aspect, an embodiment of the present disclosure provides a packet processing device, including:

接收单元,用于接收云端计算节点的虚拟机发送的待发送数据包;The receiving unit is used to receive the data packet to be sent sent by the virtual machine of the cloud computing node;

处理单元,用于根据互联网安全协议的安全关联信息中的加密策略,判断所述待发送数据包是否需要加密,若确定需要加密,则根据所述安全关联信息中的密钥对所述待发送数据包进行加密,得到加密数据包;其中,所述安全关联信息是由云端基于互联网安全协议的虚拟专用网络网关预先发送的;The processing unit is configured to judge whether the data packet to be sent needs to be encrypted according to the encryption strategy in the security-related information of the Internet security protocol, and if it is determined that encryption is required, then encrypt the data packet to be sent according to the key in the security-related information The data packet is encrypted to obtain an encrypted data packet; wherein, the security-related information is sent in advance by the virtual private network gateway based on the Internet security protocol in the cloud;

发送单元,用于将加密数据包发送给所述虚拟专用网络网关,以使所述虚拟专用网络网关对所述加密数据包填充报文信息,封装为完整的目标报文,并发送给目标客户网关。A sending unit, configured to send the encrypted data packet to the virtual private network gateway, so that the virtual private network gateway fills the encrypted data packet with message information, encapsulates it into a complete target message, and sends it to the target customer gateway.

第五方面,本公开实施例提供一种电子设备,包括:至少一个处理器和存储器;In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;

所述存储器存储计算机执行指令;the memory stores computer-executable instructions;

所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如上第一方面以及第一方面各种可能的设计所述的报文处理方法,或者第二方面以及第二方面各种可能的设计所述的报文处理方法。The at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the message processing method described in the above first aspect and various possible designs of the first aspect, or the second aspect and Various possible designs of the message processing method in the second aspect.

第六方面,本公开实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的报文处理方法,或者第二方面以及第二方面各种可能的设计所述的报文处理方法。In the sixth aspect, the embodiments of the present disclosure provide a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the above first aspect and the first Various possible designs of the packet processing method in the first aspect, or the packet processing method in the second aspect and various possible designs of the second aspect.

第七方面,本公开实施例提供一种计算机程序产品,包括计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的报文处理方法,或者第二方面以及第二方面各种可能的设计所述的报文处理方法。In the seventh aspect, the embodiments of the present disclosure provide a computer program product, including computer-executable instructions. When the processor executes the computer-executable instructions, the message described in the above first aspect and various possible designs of the first aspect is realized. The processing method, or the second aspect and the message processing method described in various possible designs of the second aspect.

本公开实施例提供的报文处理方法、设备、存储介质及程序产品,通过云端计算节点的虚拟交换机根据虚拟专用网络网关预先发送安全关联信息对数据包加密,并发送给虚拟专用网络网关,由虚拟专用网络网关对加密数据包填充报文信息,封装为完整的目标报文,并将目标报文发送给目标客户网关。充分利用了各计算节点的算力资源,使得虚拟专用网络网关无需执行加密处理,解决了虚拟交换机过多的场景下虚拟专用网络网关的性能瓶颈问题,保证了报文的传输。In the message processing method, device, storage medium and program product provided by the embodiments of the present disclosure, the virtual switch of the cloud computing node encrypts the data packet according to the security association information sent by the virtual private network gateway in advance, and sends it to the virtual private network gateway. The virtual private network gateway fills the encrypted data packet with message information, encapsulates it into a complete target message, and sends the target message to the target customer gateway. The computing resources of each computing node are fully utilized, so that the virtual private network gateway does not need to perform encryption processing, which solves the performance bottleneck problem of the virtual private network gateway in the scenario of too many virtual switches, and ensures the transmission of messages.

附图说明Description of drawings

为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present disclosure. Those skilled in the art can also obtain other drawings based on these drawings without any creative effort.

图1a为现有技术中一种在云端实现IPsec VPN的架构示例图;Figure 1a is an example diagram of an architecture for implementing IPsec VPN in the cloud in the prior art;

图1b为现有技术中IPsec VPN网关进行数据加密和封装的示意图;Figure 1b is a schematic diagram of data encryption and encapsulation performed by an IPsec VPN gateway in the prior art;

图2为本公开一实施例提供的报文处理方法流程示意图;FIG. 2 is a schematic flowchart of a message processing method provided by an embodiment of the present disclosure;

图3为本公开另一实施例提供的报文处理方法流程示意图;FIG. 3 is a schematic flowchart of a message processing method provided by another embodiment of the present disclosure;

图4为本公开另一实施例提供的报文处理方法流程示意图;FIG. 4 is a schematic flowchart of a message processing method provided by another embodiment of the present disclosure;

图5为本公开一实施例提供的报文处理方法的信令图;FIG. 5 is a signaling diagram of a message processing method provided by an embodiment of the present disclosure;

图6为本公开一实施例提供的报文处理设备的结构框图;FIG. 6 is a structural block diagram of a packet processing device provided by an embodiment of the present disclosure;

图7为本公开另一实施例提供的报文处理设备的结构框图;FIG. 7 is a structural block diagram of a packet processing device provided by another embodiment of the present disclosure;

图8为本公开一实施例提供的电子设备的硬件结构示意图。FIG. 8 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present disclosure.

具体实施方式Detailed ways

为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments It is a part of the embodiments of the present disclosure, but not all of them. Based on the embodiments in the present disclosure, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present disclosure.

虚拟专用网络(Virtual Private Network,VPN)是在公用网络上建立专用网络,进行加密通讯,采用VPN网关对数据包的加密和数据包目标地址的转换或者使用隧道技术实现远程访问。VPN可通过服务器、硬件、软件等多种方式实现。IPSec VPN是指采用IPSec(Internet Protocol Security,互联网安全协议)实现远程接入的一种VPN技术,其中IPSec是一个协议包,透过对IP协议的分组进行加密和认证来保护IP协议的网络传输协议族(一些相互关联的协议的集合)。A virtual private network (Virtual Private Network, VPN) is to establish a private network on a public network for encrypted communication, use VPN gateways to encrypt data packets and convert data packet destination addresses, or use tunneling technology to achieve remote access. VPN can be realized by server, hardware, software and other ways. IPSec VPN refers to a VPN technology that uses IPSec (Internet Protocol Security, Internet Security Protocol) to achieve remote access. IPSec is a protocol package that protects IP protocol network transmission by encrypting and authenticating IP protocol packets. A protocol family (a collection of interrelated protocols).

IPSec主要由以下协议组成:IPSec mainly consists of the following protocols:

1.认证头(Authentication Header,AH),为IP数据报提供无连接数据完整性、消息认证以及防重放攻击保护;1. Authentication Header (Authentication Header, AH), which provides connectionless data integrity, message authentication and anti-replay attack protection for IP datagrams;

2.封装安全载荷(Encapsulating Security Payload,ESP),提供机密性、数据源认证、无连接完整性、防重放和有限的传输流(traffic-flow)机密性;2. Encapsulating Security Payload (ESP), providing confidentiality, data source authentication, connectionless integrity, anti-replay and limited traffic-flow confidentiality;

3.因特网密钥交换(Internet Key Exchange,简称IKE或IKEv2),为AH、ESP操作所需的安全关联(Security Association,SA)提供算法、数据包和密钥参数。3. Internet Key Exchange (IKE or IKEv2 for short), which provides algorithms, data packets and key parameters for the security association (Security Association, SA) required for AH and ESP operations.

在云端实现IPsec VPN时,架构如图1a所示,每个计算节点(例如计算节点1、计算节点2)可包括虚拟交换机以及多个VPC(Virtual Private Cloud,虚拟私有云)的虚拟机(VM),各VPC(例如VPC1、VPC2)之间可相互隔离,各VPC的虚拟机与虚拟交换机连接,而虚拟交换机与云上IPSec VPN网关连接。When implementing IPsec VPN in the cloud, the architecture is shown in Figure 1a, each computing node (such as computing node 1, computing node 2) can include a virtual switch and a plurality of virtual machines (VMs) of VPC (Virtual Private Cloud, virtual private cloud). ), each VPC (such as VPC1, VPC2) can be isolated from each other, the virtual machine of each VPC is connected to the virtual switch, and the virtual switch is connected to the IPSec VPN gateway on the cloud.

计算节点中任意虚拟机(Virtual Machine,VM)对外传输的数据包,由虚拟交换机发送到IPSec VPN网关,由IPSec VPN网关根据与目标客户网关协商的IPSec SA信息加密、封装生成报文,再发送给目标客户网关(也为IPSec VPN网关)。The data packets transmitted externally by any virtual machine (Virtual Machine, VM) in the computing node are sent by the virtual switch to the IPSec VPN gateway, and the IPSec VPN gateway encrypts and encapsulates the packet according to the IPSec SA information negotiated with the target customer gateway, and then sends it to the target customer gateway (also IPSec VPN gateway).

云上IPSec VPN通常使用ESP协议,使用隧道模式,IPSec VPN网关对数据包加密和封装如图1b所示,其中左侧为未加密的报文,右侧为ESP加密报文,也即IPSec VPN网关对数据包进行了加密(灰色部分)、以及添加ESP头部信息(尤其是ESP序列号Sequence Number)和尾部信息。IPSec VPN on the cloud usually uses the ESP protocol and tunnel mode. The IPSec VPN gateway encrypts and encapsulates data packets as shown in Figure 1b, where the unencrypted packets are on the left and the ESP encrypted packets are on the right, that is, IPSec VPN The gateway encrypts the data packet (gray part), and adds ESP header information (especially the ESP sequence number Sequence Number) and tail information.

现有技术中在云化场景中,由于计算节点中VPC内虚拟机数量多、流量大、分布散,IPSec VPN网关处理大量加密报文时压力加大,对性能要求较高。In the cloudification scenario in the prior art, due to the large number of virtual machines in the VPC of the computing nodes, large traffic, and scattered distribution, the pressure on the IPSec VPN gateway to process a large number of encrypted messages increases, and the performance requirements are high.

为了解决上述技术问题,本公开提供一种报文处理方法,通过云端计算节点的虚拟交换机根据IPSec VPN网关预先发送IPSec SA信息对数据包加密,并发送给IPSec VPN网关,由IPSec VPN网关对加密数据包填充报文信息,封装为完整的目标报文,并将目标报文发送给目标客户网关。充分利用了各计算节点的算力资源,使得IPSec VPN网关无需执行加密处理,解决了虚拟交换机过多的场景下IPSec VPN网关的性能瓶颈问题,保证了报文的传输。In order to solve the above-mentioned technical problems, the present disclosure provides a message processing method, through which the virtual switch of the cloud computing node sends IPSec SA information to encrypt the data packet in advance according to the IPSec VPN gateway, and sends it to the IPSec VPN gateway, and the IPSec VPN gateway encrypts the packet The data packet is filled with message information, encapsulated into a complete target message, and the target message is sent to the target customer gateway. The computing resources of each computing node are fully utilized, so that the IPSec VPN gateway does not need to perform encryption processing, which solves the performance bottleneck problem of the IPSec VPN gateway in the scenario of too many virtual switches, and ensures the transmission of packets.

下面将结合具体实施例对本公开的报文处理方法进行详细介绍。The message processing method of the present disclosure will be described in detail below in combination with specific embodiments.

参考图2,图2为本公开一实施例提供的报文处理方法流程示意图。本实施例的方法可以应用在云端基于互联网安全协议的虚拟专用网络IPSec VPN网关中,该报文处理方法包括:Referring to FIG. 2 , FIG. 2 is a schematic flowchart of a packet processing method provided by an embodiment of the present disclosure. The method of this embodiment can be applied in the virtual private network IPSec VPN gateway based on the Internet security protocol in the cloud, and the message processing method includes:

S201、接收云端计算节点的虚拟交换机发送的加密数据包,其中,所述加密数据包由所述虚拟交换机根据IPSec SA信息进行加密;IPSec SA信息是由所述IPSec VPN网关预先发送给所述虚拟交换机的。S201. Receive an encrypted data packet sent by a virtual switch of a cloud computing node, wherein the encrypted data packet is encrypted by the virtual switch according to IPSec SA information; the IPSec SA information is sent to the virtual switch in advance by the IPSec VPN gateway switch.

在本实施例中,IPSec VPN网关预先与目标客户网关(也是VPN网关)进行协商,确定IPSec SA信息,具体的,可通过IPSec的因特网密钥交换(IKE或IKEv2)去确定IPSec SA信息,其中包括加密策略、密钥等,加密策略用于判断哪些数据需要根据IPSec SA信息进行加密,例如192.168.1.0/24→172.16.1.0/24的数据需要使用密钥K1加密。进一步的,IPSecVPN网关可将IPSec SA信息发送给与IPSec VPN网关连接的云端计算节点的虚拟交换机,可选的,为了保证信息安全,可先与虚拟交换机建立加密连接,例如SSH(Secure Shell,安全外壳)连接,通过加密连接将IPSec SA信息发送给虚拟交换机。In this embodiment, the IPSec VPN gateway negotiates with the target customer gateway (also the VPN gateway) in advance to determine the IPSec SA information. Specifically, the IPSec SA information can be determined through IPSec Internet Key Exchange (IKE or IKEv2), where Including encryption policy, key, etc. The encryption policy is used to determine which data needs to be encrypted according to IPSec SA information. For example, the data of 192.168.1.0/24→172.16.1.0/24 needs to be encrypted with key K1. Further, the IPSec VPN gateway can send the IPSec SA information to the virtual switch of the cloud computing node connected to the IPSec VPN gateway. Optionally, in order to ensure information security, an encrypted connection can be established with the virtual switch, such as SSH (Secure Shell, secure shell) to send IPSec SA information to the virtual switch through an encrypted connection.

在虚拟交换机需要向目标客户网关发送数据包时,可根据IPSec SA信息中的加密策略进行检查,判断待发送数据包是否需要加密,若确定需要加密,则根据所述IPSec SA信息中的密钥对所述待发送数据包进行加密,得到加密数据包,具体的,根据IPSec SA信息中的密钥对待发送数据包进行ESP加密,进一步的,虚拟交换机将加密数据包发送给IPSecVPN网关,这样,IPSec VPN网关收到已根据IPSec SA信息加密的加密数据包后,就不需要执行根据IPSec SA信息加密过程,也即可跳过加密处理过程。When the virtual switch needs to send a data packet to the target customer gateway, it can check according to the encryption policy in the IPSec SA information to determine whether the data packet to be sent needs to be encrypted. If it is determined that encryption is required, then according to the key in the IPSec SA information Encrypt the data packet to be sent to obtain the encrypted data packet, specifically, perform ESP encryption on the data packet to be sent according to the key in the IPSec SA information, further, the virtual switch sends the encrypted data packet to the IPSecVPN gateway, like this, After the IPSec VPN gateway receives the encrypted data packet that has been encrypted according to the IPSec SA information, it does not need to perform the encryption process according to the IPSec SA information, that is, the encryption process can be skipped.

其中,可选的,并不是所有的数据包都符合IPSec SA信息中的加密策略,因此,IPSec VPN网关收到数据包可能是已根据IPSec SA信息加密的加密数据包,也可能是未经过加密的数据包,为了便于区别,虚拟交换机可对于已根据IPSec SA信息加密的加密数据包添加标识,用于表示该数据包已根据IPSec SA信息加密,而IPSec VPN网关收到数据包后,若识别到数据包携带有标识,则可确定该数据包已根据IPSec SA信息加密,可跳过加密处理过程。Among them, optional, not all data packets conform to the encryption policy in the IPSec SA information, therefore, the data packet received by the IPSec VPN gateway may be an encrypted data packet that has been encrypted according to the IPSec SA information, or it may be an unencrypted In order to facilitate the distinction, the virtual switch can add an identifier to the encrypted data packet that has been encrypted according to the IPSec SA information to indicate that the data packet has been encrypted according to the IPSec SA information. After the IPSec VPN gateway receives the data packet, if it identifies If the data packet carries an identifier, it can be determined that the data packet has been encrypted according to the IPSec SA information, and the encryption process can be skipped.

S202、对所述加密数据包填充报文信息,封装为完整的目标报文。S202. Fill the encrypted data packet with message information, and encapsulate it into a complete target message.

在本实施例中,IPSec VPN网关可在已根据IPSec SA信息加密的加密数据包的基础上,填充其余的报文信息,包括但不限于报文头部信息和尾部信息,将加密数据包封装为完整的目标报文。In this embodiment, the IPSec VPN gateway can fill the rest of the message information on the basis of the encrypted data packet encrypted according to the IPSec SA information, including but not limited to the message header information and tail information, and encapsulate the encrypted data packet For the complete target message.

可选的,可对加密数据包填充ESP头部信息(尤其是ESP序列号)和尾部信息,使用VPN公网IP做隧道封装。Optionally, the encrypted data packet can be filled with ESP header information (especially the ESP serial number) and tail information, and the VPN public network IP is used for tunnel encapsulation.

S203、将所述目标报文发送给目标客户网关。S203. Send the target message to the target customer gateway.

在本实施例中,IPSec VPN网关在封装完整的目标报文后,将目标报文发送给目标客户网关,即完成了由云端计算节点向目标客户网关的数据传输。In this embodiment, after the IPSec VPN gateway encapsulates the complete target message, it sends the target message to the target customer gateway, that is, the data transmission from the cloud computing node to the target customer gateway is completed.

本实施例的报文处理方法,通过云端计算节点的虚拟交换机根据IPSec VPN网关预先发送IPSec SA信息对数据包加密,并发送给IPSec VPN网关,由IPSec VPN网关对加密数据包填充报文信息,封装为完整的目标报文,并将目标报文发送给目标客户网关。充分利用了各计算节点的算力资源,使得IPSec VPN网关无需执行加密处理,解决了虚拟交换机过多的场景下IPSec VPN网关的性能瓶颈问题,保证了报文的传输。In the message processing method of this embodiment, the virtual switch of the cloud computing node sends the IPSec SA information to encrypt the data packet according to the IPSec VPN gateway in advance, and sends it to the IPSec VPN gateway, and the encrypted data packet is filled with message information by the IPSec VPN gateway, Encapsulate into a complete target message, and send the target message to the target customer gateway. The computing resources of each computing node are fully utilized, so that the IPSec VPN gateway does not need to perform encryption processing, which solves the performance bottleneck problem of the IPSec VPN gateway in the scenario of too many virtual switches, and ensures the transmission of packets.

在上述实施例的基础上,在IPSec VPN网关与虚拟交换机建立加密连接,并通过加密连接将IPSec SA信息发送给虚拟交换机时,由于与IPSec VPN网关连接的云端计算节点可能有多个,因此与IPSec VPN网关连接的云端计算节点的虚拟交换机可能有多个,本实施例中IPSec VPN网关可以将IPSec SA信息发送给所有与IPSec VPN网关连接的云端计算节点的虚拟交换机;或者,也可以仅发送给其中存在向目标客户网关传输数据包需求的云端计算节点的虚拟交换机,具体的,如图3所示,所述与所述虚拟交换机建立加密连接,并通过加密连接将所述IPSec SA信息发送给所述虚拟交换机,可包括:On the basis of the above-mentioned embodiments, when an encrypted connection is established between the IPSec VPN gateway and the virtual switch, and the IPSec SA information is sent to the virtual switch through the encrypted connection, since there may be multiple cloud computing nodes connected to the IPSec VPN gateway, it is related to There may be multiple virtual switches of the cloud computing nodes connected to the IPSec VPN gateway. In this embodiment, the IPSec VPN gateway can send the IPSec SA information to all the virtual switches of the cloud computing nodes connected to the IPSec VPN gateway; or, it can only send For the virtual switch of the cloud computing node that needs to transmit data packets to the target customer gateway, specifically, as shown in Figure 3, the encrypted connection is established with the virtual switch, and the IPSec SA information is sent through the encrypted connection For the virtual switch, may include:

S301、接收所述虚拟交换机发送的待加密数据包,根据所述IPSec SA信息对所述待加密数据包进行加密以及封装为完整的目标报文,并发送给所述目标客户网关。S301. Receive a to-be-encrypted data packet sent by the virtual switch, encrypt and encapsulate the to-be-encrypted data packet according to the IPSec SA information into a complete target message, and send it to the target customer gateway.

在本实施例中,在IPSec VPN网关获取到IPSec SA信息后,可根据传输需求来向虚拟交换机发送IPSec SA信息,因此IPSec VPN网关需要先确定哪些虚拟交换机存在向目标客户网关传输数据包的需求,本实施例中,在IPSec VPN网关接收到任一虚拟交换机发送的需要发送给目标客户网关的待加密数据包后,可先根据IPSec SA信息中的加密策略,判断待发送数据包是否需要加密,若确定需要加密,则确定该虚拟交换机存在向目标客户网关传输数据包的需求,此时,IPSec VPN网关可先承担加密处理的职责,根据IPSec SA信息对待加密数据包进行加密、以及封装为完整的目标报文,并发送给目标客户网关(参见上述实施例)。In this embodiment, after the IPSec VPN gateway obtains the IPSec SA information, it can send the IPSec SA information to the virtual switch according to the transmission requirements, so the IPSec VPN gateway needs to first determine which virtual switches have the need to transmit data packets to the target customer gateway , in this embodiment, after the IPSec VPN gateway receives the data packet to be encrypted sent by any virtual switch and needs to be sent to the target customer gateway, it can first judge whether the data packet to be sent needs to be encrypted according to the encryption policy in the IPSec SA information , if it is determined that encryption is required, it is determined that the virtual switch has the need to transmit data packets to the target customer gateway. At this time, the IPSec VPN gateway can first undertake the responsibility of encryption processing, encrypt the data packets to be encrypted according to the IPSec SA information, and encapsulate them as The complete target message is sent to the target client gateway (refer to the above-mentioned embodiment).

可选的,虚拟交换机可对待加密数据包进行VXLAN(Virtual Extensible LocalArea Network,虚拟扩展局域网)封装,再发送给IPSec VPN网关,而IPSec VPN网关在接收到待加密数据包后,先解VXLAN封装,再根据IPSec SA信息对待加密数据包进行加密以及封装为完整的目标报文,并发送给目标客户网关。Optionally, the virtual switch can perform VXLAN (Virtual Extensible Local Area Network, Virtual Extended Local Area Network) encapsulation on the data packet to be encrypted, and then send it to the IPSec VPN gateway, and the IPSec VPN gateway will first decompose the VXLAN encapsulation after receiving the data packet to be encrypted, According to the IPSec SA information, the data packet to be encrypted is encrypted and encapsulated into a complete target message, and sent to the target customer gateway.

S302、基于所述待加密数据包,查询所述虚拟交换机信息。S302. Query the information of the virtual switch based on the data packet to be encrypted.

在本实施例中,虚拟交换机信息可包括虚拟交换机所在的计算节点信息,IPSecVPN网关可向VPC控制器查询发送该待加密数据包的虚拟交换机所在的计算节点信息,其中VPC控制器存储有各计算节点以及其所包括的虚拟交换机的信息。In this embodiment, the virtual switch information may include information about the computing node where the virtual switch is located, and the IPSecVPN gateway may query the VPC controller for information about the computing node where the virtual switch that sends the data packet to be encrypted is located, wherein the VPC controller stores information about each computing node. Information about the node and its virtual switches.

S303、根据所述虚拟交换机信息与所述虚拟交换机建立加密连接,并通过加密连接将所述IPSec SA信息发送给所述虚拟交换机。S303. Establish an encrypted connection with the virtual switch according to the virtual switch information, and send the IPSec SA information to the virtual switch through the encrypted connection.

在本实施例中,IPSec VPN网关可根据虚拟交换机信息与该虚拟交换机建立加密连接,通过加密连接将IPSec SA信息发送给该虚拟交换机,后续则由该虚拟交换机承担根据IPSec SA信息加密处理的职责,IPSec VPN网关只需要填充报文信息,封装为完整的目标报文,减轻IPSec VPN网关的压力。In this embodiment, the IPSec VPN gateway can establish an encrypted connection with the virtual switch according to the virtual switch information, and send the IPSec SA information to the virtual switch through the encrypted connection, and then the virtual switch will assume the responsibility of encrypting and processing the IPSec SA information , the IPSec VPN gateway only needs to fill in the message information and encapsulate it into a complete target message, reducing the pressure on the IPSec VPN gateway.

在上述任一实施例的基础上,虚拟交换机在加密后可对加密数据包进行封装,可选的,可进行VXLAN封装,查询VPC路由表后发送给IPSec VPN网关,而IPSec VPN网关在接收到加密数据包后,先解VXLAN封装,再对加密数据包填充报文信息。此外,上述实施例中,虚拟交换机对加密数据包添加标识,可将标识添加在VXLAN封装格式中。On the basis of any of the above embodiments, the virtual switch can encapsulate the encrypted data packet after encryption. Optionally, it can perform VXLAN encapsulation, query the VPC routing table and send it to the IPSec VPN gateway, and the IPSec VPN gateway receives the After encrypting the data packet, decapsulate the VXLAN first, and then fill the encrypted data packet with message information. In addition, in the above embodiment, the virtual switch adds an identifier to the encrypted data packet, and the identifier can be added in the VXLAN encapsulation format.

在上述任一实施例的基础上,根据IPSec协议的一种机制,使用IPSec SA信息加密一定长度的数据量(预设加密长度阈值)后IPSec SA信息就会过期失效,由于IPSec SA信息可能被不同的虚拟交换机使用去加密数据,而IPSec VPN网关接收到虚拟交换机发送的加密数据包时并不能直接从加密数据包中获知虚拟交换机采用IPSec SA信息加密了多少长度的数据量,因此,在本实施例中,虚拟交换机在采用IPSec SA信息对待发送数据包进行加密后,可对加密数据包添加待发送数据包的长度(也即被加密数据的长度),同时也可对加密数据包添加IPSec SA信息的标识信息(不同的IPSec SA信息的预设加密长度阈值可能不同,IPSec SA信息的标识信息可以为IPSec SA信息编号或名称等),进而在IPSec VPN网关接收到虚拟交换机发送的加密数据包后,可对采用IPSec SA信息加密的加密数据包中所携带的被加密数据的长度进行累加,得到被加密数据的累计长度,并将被加密数据的累计长度与IPSec SA信息对应的预设加密长度阈值进行比较,若被加密数据的累计长度超过预设加密长度阈值,则此时IPSec SA信息过期失效,IPSec VPN网关重新与目标客户网关进行协商过程,确定更新后的安全关联信息。On the basis of any of the above embodiments, according to a mechanism of the IPSec protocol, the IPSec SA information will expire after the IPSec SA information is used to encrypt a certain length of data (preset encryption length threshold), because the IPSec SA information may be Different virtual switches use de-encrypted data, and when the IPSec VPN gateway receives the encrypted data packet sent by the virtual switch, it cannot directly know the length of data encrypted by the virtual switch using IPSec SA information from the encrypted data packet. Therefore, in this In the embodiment, after the virtual switch uses IPSec SA information to encrypt the data packet to be sent, it can add the length of the data packet to be sent (that is, the length of the encrypted data) to the encrypted data packet, and can also add IPSec to the encrypted data packet at the same time. The identification information of the SA information (the preset encryption length threshold of different IPSec SA information may be different, and the identification information of the IPSec SA information can be the number or name of the IPSec SA information, etc.), and then the encrypted data sent by the virtual switch is received at the IPSec VPN gateway After the package is completed, the length of the encrypted data carried in the encrypted data packet encrypted with IPSec SA information can be accumulated to obtain the accumulated length of the encrypted data, and the accumulated length of the encrypted data can be compared with the preset value corresponding to the IPSec SA information. If the accumulated length of the encrypted data exceeds the preset encryption length threshold, the IPSec SA information will expire at this time, and the IPSec VPN gateway will re-negotiate with the target customer gateway to determine the updated security association information.

可选的,加密数据包中携带的被加密数据的长度以及所述安全关联信息的标识信息也可添加在VXLAN封装格式中。Optionally, the length of the encrypted data carried in the encrypted data packet and the identification information of the security association information may also be added in the VXLAN encapsulation format.

在上述任一实施例的基础上,根据IPSec协议的另一种机制,IPSec SA信息尤其是其中的密钥存在一定的生命期,超过生命期时间后就会过期失效,需要IPSec VPN网关重新与目标客户网关进行协商确定,对IPSec SA信息进行更新。IPSec VPN网关若确定IPSec SA信息更新,则通过加密连接将更新后的IPSec SA信息发送给虚拟交换机。此外,也可对IPSec SA信息进行销毁,例如IPSec VPN网关与目标客户网关之间断开连接,IPSec VPN网关若确定IPSec SA信息被销毁,则通过加密连接向虚拟交换机发送删除IPSec SA信息的指令,以使虚拟交换机删除所存储的IPSec SA信息。On the basis of any of the above-mentioned embodiments, according to another mechanism of the IPSec protocol, the IPSec SA information, especially the key therein, has a certain life period, and will expire after exceeding the life period, requiring the IPSec VPN gateway to reconnect with The target client gateway is determined through negotiation, and the IPSec SA information is updated. If the IPSec VPN gateway determines that the IPSec SA information is updated, it sends the updated IPSec SA information to the virtual switch through an encrypted connection. In addition, the IPSec SA information can also be destroyed, such as disconnecting the connection between the IPSec VPN gateway and the target customer gateway. If the IPSec VPN gateway determines that the IPSec SA information is destroyed, it will send an instruction to delete the IPSec SA information to the virtual switch through an encrypted connection. In order to make the virtual switch delete the stored IPSec SA information.

参考图4,图4为本公开一实施例提供的报文处理方法流程示意图。本实施例的方法可以应用在云端计算节点的虚拟交换机中,该报文处理方法包括:Referring to FIG. 4 , FIG. 4 is a schematic flowchart of a packet processing method provided by an embodiment of the present disclosure. The method of this embodiment can be applied in a virtual switch of a cloud computing node, and the message processing method includes:

S401、接收所述云端计算节点的虚拟机发送的待发送数据包。S401. Receive a data packet to be sent sent by a virtual machine of the cloud computing node.

在本实施例中,在云端计算节点的某一VPC的虚拟机在需要向目标客户网关发送数据包时,会将待发送数据包发送至该云端的计算节点的虚拟交换机。In this embodiment, when a virtual machine of a certain VPC of a cloud computing node needs to send a data packet to a target customer gateway, it will send the data packet to be sent to the virtual switch of the cloud computing node.

S402、根据IPSec SA信息中的加密策略,判断所述待发送数据包是否需要加密,若确定需要加密,则根据所述IPSec SA信息中的密钥对所述待发送数据包进行加密,得到加密数据包;其中,所述IPSec SA信息是由所述IPSec VPN网关预先发送给所述虚拟交换机的。S402. According to the encryption policy in the IPSec SA information, judge whether the data packet to be sent needs to be encrypted, and if it is determined that encryption is required, then encrypt the data packet to be sent according to the key in the IPSec SA information to obtain encrypted A data packet; wherein, the IPSec SA information is sent to the virtual switch in advance by the IPSec VPN gateway.

在本实施例中,IPSec VPN网关预先与目标客户网关进行协商,确定IPSec SA信息,并将IPSec SA信息发送给与IPSec VPN网关连接的云端计算节点的虚拟交换机。可选的,虚拟交换机与IPSec VPN网关之间可建立加密连接,并通过加密连接接收VPN网关发送的IPSec SA信息。In this embodiment, the IPSec VPN gateway negotiates with the target customer gateway in advance, determines the IPSec SA information, and sends the IPSec SA information to the virtual switch of the cloud computing node connected to the IPSec VPN gateway. Optionally, an encrypted connection can be established between the virtual switch and the IPSec VPN gateway, and the IPSec SA information sent by the VPN gateway can be received through the encrypted connection.

在虚拟交换机需要向目标客户网关发送数据包时,可根据IPSec SA信息中的加密策略进行检查,判断待发送数据包是否需要加密,若确定需要加密,则根据所述IPSec SA信息中的密钥对所述待发送数据包进行加密,得到加密数据包,具体的,根据IPSec SA信息中的密钥对待发送数据包进行ESP加密。When the virtual switch needs to send a data packet to the target customer gateway, it can check according to the encryption policy in the IPSec SA information to determine whether the data packet to be sent needs to be encrypted. If it is determined that encryption is required, then according to the key in the IPSec SA information Encrypt the data packet to be sent to obtain the encrypted data packet, specifically, perform ESP encryption on the data packet to be sent according to the key in the IPSec SA information.

S403、将加密数据包发送给所述IPSec VPN网关,以使所述IPSec VPN网关对所述加密数据包填充报文信息,封装为完整的目标报文,并发送给目标客户网关。S403. Send the encrypted data packet to the IPSec VPN gateway, so that the IPSec VPN gateway fills the encrypted data packet with message information, encapsulates it into a complete target message, and sends it to the target customer gateway.

在本实施例中,虚拟交换机将加密数据包发送给IPSec VPN网关,IPSec VPN网关可执行上述IPSec VPN网关侧的方法实施例,此处不再赘述。In this embodiment, the virtual switch sends the encrypted data packet to the IPSec VPN gateway, and the IPSec VPN gateway can execute the above-mentioned method embodiment on the side of the IPSec VPN gateway, which will not be repeated here.

在上述实施例的基础上,可选的,虚拟交换机可对于已根据IPSec SA信息加密的加密数据包添加标识,用于表示该数据包已根据IPSec SA信息加密,而IPSec VPN网关收到数据包后,若识别到数据包携带有标识,则可确定该数据包已根据IPSec SA信息加密,可跳过加密处理过程。On the basis of the above embodiments, optionally, the virtual switch can add an identifier to the encrypted data packet that has been encrypted according to the IPSec SA information, which is used to indicate that the data packet has been encrypted according to the IPSec SA information, and the IPSec VPN gateway receives the data packet Finally, if it is recognized that the data packet carries an identifier, it can be determined that the data packet has been encrypted according to the IPSec SA information, and the encryption process can be skipped.

在上述任一实施例的基础上,虚拟交换机在采用IPSec SA信息对待发送数据包进行加密后,可对加密数据包添加待发送数据包的长度(也即被加密数据的长度),同时也可对加密数据包添加IPSec SA信息的标识信息(IPSec SA信息的标识信息可以为IPSec SA信息编号或名称等),以便于IPSec VPN网关接收到虚拟交换机发送的加密数据包后,可对采用IPSec SA信息加密的加密数据包中所携带的被加密数据的长度进行累加,得到被加密数据的累计长度,并将被加密数据的累计长度与IPSec SA信息对应的预设加密长度阈值进行比较,若被加密数据的累计长度超过预设加密长度阈值,则此时IPSec SA信息过期失效,IPSec VPN网关重新与目标客户网关进行协商过程,确定更新后的安全关联信息。On the basis of any of the above embodiments, after the virtual switch uses IPSec SA information to encrypt the data packet to be sent, it can add the length of the data packet to be sent (that is, the length of the encrypted data) to the encrypted data packet, and can also Add the identification information of the IPSec SA information to the encrypted data packet (the identification information of the IPSec SA information can be the number or name of the IPSec SA information, etc.), so that after the IPSec VPN gateway receives the encrypted data packet sent by the virtual switch, it can use the IPSec SA information The length of the encrypted data carried in the encrypted data packet of the information encryption is accumulated to obtain the accumulated length of the encrypted data, and the accumulated length of the encrypted data is compared with the preset encrypted length threshold corresponding to the IPSec SA information. If the accumulated length of encrypted data exceeds the preset encrypted length threshold, the IPSec SA information will expire and become invalid at this time, and the IPSec VPN gateway will re-negotiate with the target customer gateway to determine the updated security association information.

可选的,虚拟交换机在加密后可对加密数据包进行封装,可选的,可进行VXLAN封装,再发送给IPSec VPN网关,而IPSec VPN网关在接收到加密数据包后,先解VXLAN封装,再对加密数据包填充报文信息。此外,上述实施例中,虚拟交换机对加密数据包添加标识,可将标识添加在VXLAN封装格式中。Optionally, the virtual switch can encapsulate the encrypted data packet after encryption. Optionally, it can perform VXLAN encapsulation and then send it to the IPSec VPN gateway. After the IPSec VPN gateway receives the encrypted data packet, it first decomposes the VXLAN encapsulation. Then fill the encrypted data packet with message information. In addition, in the above embodiment, the virtual switch adds an identifier to the encrypted data packet, and the identifier can be added in the VXLAN encapsulation format.

可选的,虚拟交换机还可进行IPSec SA信息的更新或删除,具体过程如下:Optionally, the virtual switch can also update or delete IPSec SA information, and the specific process is as follows:

通过加密连接接收所述IPSec VPN网关发送的更新后的IPSec SA信息,将当前的IPSec SA信息更新为所述更新后的IPSec SA信息;或者receiving the updated IPSec SA information sent by the IPSec VPN gateway through an encrypted connection, and updating the current IPSec SA information to the updated IPSec SA information; or

通过加密连接接收所述IPSec VPN网关发送的删除所述IPSec SA信息的指令,将当前的IPSec SA信息删除。receiving an instruction to delete the IPSec SA information sent by the IPSec VPN gateway through the encrypted connection, and delete the current IPSec SA information.

本实施例的报文处理方法,通过云端计算节点的虚拟交换机根据IPSec VPN网关预先发送IPSec SA信息对数据包加密,并发送给IPSec VPN网关,由IPSec VPN网关对加密数据包填充报文信息,封装为完整的目标报文,并将目标报文发送给目标客户网关。充分利用了各计算节点的算力资源,使得IPSec VPN网关无需执行加密处理,解决了虚拟交换机过多的场景下IPSec VPN网关的性能瓶颈问题,保证了报文的传输。In the message processing method of this embodiment, the virtual switch of the cloud computing node sends the IPSec SA information to encrypt the data packet according to the IPSec VPN gateway in advance, and sends it to the IPSec VPN gateway, and the encrypted data packet is filled with message information by the IPSec VPN gateway, Encapsulate into a complete target message, and send the target message to the target customer gateway. The computing resources of each computing node are fully utilized, so that the IPSec VPN gateway does not need to perform encryption processing, which solves the performance bottleneck problem of the IPSec VPN gateway in the scenario of too many virtual switches, and ensures the transmission of packets.

参考图5,图5为本公开一实施例提供的报文处理方法的信令图。在上述是实施例的基础上,该报文处理方法包括:Referring to FIG. 5 , FIG. 5 is a signaling diagram of a packet processing method provided by an embodiment of the present disclosure. On the basis of the above-mentioned embodiments, the message processing method includes:

S501、IPSec VPN网关与目标客户网关进行协商确定IPSec SA信息;S501. The IPSec VPN gateway negotiates with the target customer gateway to determine IPSec SA information;

S502、云端计算节点的VPC的虚拟机将第一待发送数据包发送至该云端的计算节点的虚拟交换机;S502. The virtual machine of the VPC of the cloud computing node sends the first data packet to be sent to the virtual switch of the cloud computing node;

S503、虚拟交换机对第一待发送数据包封装后发送给IPSec VPN网关;S503. The virtual switch encapsulates the first data packet to be sent and sends it to the IPSec VPN gateway;

可选的,虚拟交换机对第一待发送数据包(未进行加密)进行VXLAN封装,查询VPC路由表后发送给IPSec VPN网关;Optionally, the virtual switch performs VXLAN encapsulation on the first data packet to be sent (not encrypted), and sends it to the IPSec VPN gateway after querying the VPC routing table;

S504、IPSec VPN网关根据IPSec SA信息对第一待发送数据包进行加密以及封装为完整的第一目标报文;S504. The IPSec VPN gateway encrypts and encapsulates the first data packet to be sent into a complete first target packet according to the IPSec SA information;

可选的,若虚拟交换机对第一待发送数据包进行VXLAN封装,IPSec VPN网关在接收到第一待发送数据包后,先解VXLAN封装,再根据IPSec SA信息对第一待发送数据包进行加密以及封装为完整的目标报文;Optionally, if the virtual switch performs VXLAN encapsulation on the first data packet to be sent, after receiving the first data packet to be sent, the IPSec VPN gateway first decapsulates the VXLAN encapsulation, and then performs VXLAN encapsulation on the first data packet to be sent according to the IPSec SA information. Encrypted and encapsulated into a complete target message;

S505、IPSec VPN网关向VPC控制器查询发送该待发送数据包的虚拟交换机所在的计算节点信息;S505. The IPSec VPN gateway queries the VPC controller for information about the computing node where the virtual switch that sends the data packet to be sent is located;

S506、VPC控制器向IPSec VPN网关发送计算节点信息;S506. The VPC controller sends computing node information to the IPSec VPN gateway;

S507、IPSec VPN网关与虚拟交换机建立加密连接,并通过加密连接将IPSec SA信息发送给虚拟交换机;S507, the IPSec VPN gateway establishes an encrypted connection with the virtual switch, and sends the IPSec SA information to the virtual switch through the encrypted connection;

S508、云端计算节点的VPC的虚拟机向该虚拟交换机发送第二待发送数据包;S508. The virtual machine of the VPC of the cloud computing node sends a second data packet to be sent to the virtual switch;

其中,此处的第二待发送数据包为S502步骤第一待发送数据包后续的待发送数据包;Wherein, the second data packet to be sent here is the data packet to be sent subsequent to the first data packet to be sent in step S502;

S509、虚拟交换机根据IPSec SA信息对第二待发送数据包进行加密,得到加密数据包,并发送给IPSec VPN网关;S509. The virtual switch encrypts the second data packet to be sent according to the IPSec SA information, obtains the encrypted data packet, and sends it to the IPSec VPN gateway;

可选的,虚拟交换机对加密数据包进行VXLAN封装,再发送给IPSec VPN网关;Optionally, the virtual switch performs VXLAN encapsulation on the encrypted data packet, and then sends it to the IPSec VPN gateway;

S510、IPSec VPN网关对加密数据包填充报文信息,封装为完整的目标报文;S510, the IPSec VPN gateway fills the encrypted data packet with message information and encapsulates it into a complete target message;

S511、IPSec VPN网关将所述目标报文发送给目标客户网关;S511. The IPSec VPN gateway sends the target packet to the target customer gateway;

可选的,S512、IPSec VPN网关与目标客户网关之间进行IPSec SA信息更新或销毁;Optionally, update or destroy IPSec SA information between S512, the IPSec VPN gateway and the target customer gateway;

S513、IPSec VPN网关向VPC控制器查询虚拟交换机所在的计算节点信息;S513. The IPSec VPN gateway queries the VPC controller for the computing node information where the virtual switch is located;

S514、VPC控制器向IPSec VPN网关发送计算节点信息;S514. The VPC controller sends computing node information to the IPSec VPN gateway;

S515、IPSec VPN网关与虚拟交换机建立加密连接,并更新或销毁虚拟交换机中的IPSec SA信息。S515. The IPSec VPN gateway establishes an encrypted connection with the virtual switch, and updates or destroys the IPSec SA information in the virtual switch.

对应于上文实施例的IPSec VPN网关侧的报文处理方法,图6为本公开实施例提供的报文处理设备的结构框图,应用于云端IPSec VPN网关。为了便于说明,仅示出了与本公开实施例相关的部分。参照图6,所述报文处理设备600包括:接收单元601、处理单元602和发送单元603。Corresponding to the packet processing method at the IPSec VPN gateway side of the above embodiment, FIG. 6 is a structural block diagram of a packet processing device provided by an embodiment of the present disclosure, which is applied to a cloud IPSec VPN gateway. For ease of description, only the parts related to the embodiments of the present disclosure are shown. Referring to FIG. 6 , the packet processing device 600 includes: a receiving unit 601 , a processing unit 602 and a sending unit 603 .

其中,接收单元601,用于接收云端计算节点的虚拟交换机发送的加密数据包,其中,所述加密数据包由所述虚拟交换机根据互联网安全协议的安全关联信息进行加密;所述安全关联信息是由所述虚拟专用网络网关预先发送的;Wherein, the receiving unit 601 is configured to receive the encrypted data packet sent by the virtual switch of the cloud computing node, wherein the encrypted data packet is encrypted by the virtual switch according to the security association information of the Internet security protocol; the security association information is sent in advance by the virtual private network gateway;

处理单元602,用于对所述加密数据包填充报文信息,封装为完整的目标报文;A processing unit 602, configured to fill the encrypted data packet with message information and encapsulate it into a complete target message;

发送单元603,用于将所述目标报文发送给目标客户网关。A sending unit 603, configured to send the target message to the target customer gateway.

在本公开的一个或多个实施例中,在接收云端计算节点的虚拟交换机发送的加密数据包前,所述处理单元602还用于与所述目标客户网关进行协商过程,确定所述安全关联信息;In one or more embodiments of the present disclosure, before receiving the encrypted data packet sent by the virtual switch of the cloud computing node, the processing unit 602 is further configured to perform a negotiation process with the target customer gateway to determine the security association information;

发送单元603还用于,与所述虚拟交换机建立加密连接,并通过加密连接将所述安全关联信息发送给所述虚拟交换机。The sending unit 603 is further configured to establish an encrypted connection with the virtual switch, and send the security association information to the virtual switch through the encrypted connection.

在本公开的一个或多个实施例中,所述发送单元603还用于,接收所述虚拟交换机发送的待加密数据包;In one or more embodiments of the present disclosure, the sending unit 603 is further configured to receive the data packet to be encrypted sent by the virtual switch;

所述处理单元602还用于,根据所述安全关联信息对所述待加密数据包进行加密以及封装为完整的目标报文;所述发送单元603还用于,将该目标报文发送给所述目标客户网关;The processing unit 602 is further configured to encrypt and encapsulate the data packet to be encrypted into a complete target message according to the security association information; the sending unit 603 is also configured to send the target message to the the target customer gateway;

所述处理单元602还用于,基于所述待加密数据包,查询所述虚拟交换机信息;The processing unit 602 is further configured to, based on the data packet to be encrypted, query the information of the virtual switch;

所述发送单元603还用于,根据所述虚拟交换机信息与所述虚拟交换机建立加密连接,并通过加密连接将所述安全关联信息发送给所述虚拟交换机。The sending unit 603 is further configured to establish an encrypted connection with the virtual switch according to the virtual switch information, and send the security association information to the virtual switch through the encrypted connection.

在本公开的一个或多个实施例中,所述加密数据包中携带有标识,所述标识由所述虚拟交换机添加,用于表示该数据包已根据所述安全关联信息加密;In one or more embodiments of the present disclosure, the encrypted data packet carries an identifier, and the identifier is added by the virtual switch to indicate that the data packet has been encrypted according to the security association information;

所述处理单元602在对所述加密数据包填充报文信息,封装为完整的目标报文时,用于:When the processing unit 602 fills the encrypted data packet with message information and encapsulates it into a complete target message, it is used to:

若识别到所述加密数据包携带有所述标识,则跳过加密处理,对所述加密数据包添加封装安全载荷的头部信息和尾部信息,并封装为完整的目标报文。If it is identified that the encrypted data packet carries the identifier, the encryption process is skipped, header information and trailer information encapsulating a security payload are added to the encrypted data packet, and encapsulated into a complete target message.

在本公开的一个或多个实施例中,所述加密数据包中携带有被加密数据的长度以及所述安全关联信息的标识信息;In one or more embodiments of the present disclosure, the encrypted data packet carries the length of the encrypted data and identification information of the security association information;

所述处理单元602对所述加密数据包填充报文信息,封装为完整的目标报文前,还用于:The processing unit 602 fills the encrypted data packet with message information, and before encapsulating it into a complete target message, it is also used for:

对采用所述安全关联信息加密的加密数据包中所携带的被加密数据的长度进行累加,得到被加密数据的累计长度;Accumulate the length of the encrypted data carried in the encrypted data packet encrypted by using the security association information to obtain the accumulated length of the encrypted data;

将所述被加密数据的累计长度与所述安全关联信息对应的预设加密长度阈值进行比较;Comparing the cumulative length of the encrypted data with a preset encryption length threshold corresponding to the security association information;

若所述被加密数据的累计长度超过所述安全关联信息对应的预设加密长度阈值,则重新与所述目标客户网关进行协商过程,确定更新后的安全关联信息。If the accumulated length of the encrypted data exceeds the preset encryption length threshold corresponding to the security association information, re-negotiate with the target customer gateway to determine the updated security association information.

在本公开的一个或多个实施例中,所述加密数据包由所述虚拟交换机在加密后进行封装;In one or more embodiments of the present disclosure, the encrypted data packet is encapsulated by the virtual switch after being encrypted;

所述处理单元602在对所述加密数据包填充报文信息前,还用于:Before filling the encrypted data packet with message information, the processing unit 602 is further configured to:

对所述加密数据包进行解封装。Decapsulate the encrypted data packet.

在本公开的一个或多个实施例中,所述发送单元603还用于:In one or more embodiments of the present disclosure, the sending unit 603 is further configured to:

若确定所述安全关联信息更新,则通过加密连接将更新后的安全关联信息发送给所述虚拟交换机;或者If it is determined that the security association information is updated, sending the updated security association information to the virtual switch through an encrypted connection; or

若确定所述安全关联信息被销毁,则通过加密连接向所述虚拟交换机发送删除所述安全关联信息的指令。If it is determined that the security association information is destroyed, an instruction to delete the security association information is sent to the virtual switch through an encrypted connection.

本实施例提供的设备,可用于执行上述IPSec VPN网关侧的报文处理方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。The device provided in this embodiment can be used to implement the technical solution of the above-mentioned embodiment of the packet processing method on the IPSec VPN gateway side, and its implementation principle and technical effect are similar, so this embodiment will not repeat them here.

对应于上文实施例的云端计算节点的虚拟交换机侧的报文处理方法,图7为本公开实施例提供的报文处理设备的结构框图,应用于云端计算节点的虚拟交换机。为了便于说明,仅示出了与本公开实施例相关的部分。参照图7,所述报文处理设备700包括:接收单元701、处理单元702和发送单元703。Corresponding to the packet processing method on the virtual switch side of the cloud computing node in the above embodiment, FIG. 7 is a structural block diagram of a packet processing device provided by an embodiment of the present disclosure, which is applied to the virtual switch of the cloud computing node. For ease of description, only the parts related to the embodiments of the present disclosure are shown. Referring to FIG. 7 , the packet processing device 700 includes: a receiving unit 701 , a processing unit 702 and a sending unit 703 .

其中,接收单元701,用于接收云端计算节点的虚拟机发送的待发送数据包;Wherein, the receiving unit 701 is configured to receive the data packet to be sent sent by the virtual machine of the cloud computing node;

处理单元702,用于根据互联网安全协议的安全关联信息中的加密策略,判断所述待发送数据包是否需要加密,若确定需要加密,则根据所述安全关联信息中的密钥对所述待发送数据包进行加密,得到加密数据包;其中,所述安全关联信息是由云端基于互联网安全协议的虚拟专用网络网关预先发送的;The processing unit 702 is configured to judge whether the data packet to be sent needs to be encrypted according to the encryption strategy in the security-related information of the Internet security protocol, and if it is determined that encryption is required, perform encryption on the to-be-sent data packet according to the key in the security-related information. Sending data packets for encryption to obtain encrypted data packets; wherein, the security association information is pre-sent by the virtual private network gateway based on the Internet security protocol in the cloud;

发送单元703,用于将加密数据包发送给所述虚拟专用网络网关,以使所述虚拟专用网络网关对所述加密数据包填充报文信息,封装为完整的目标报文,并发送给目标客户网关。The sending unit 703 is configured to send the encrypted data packet to the virtual private network gateway, so that the virtual private network gateway fills the encrypted data packet with message information, encapsulates it into a complete target message, and sends it to the target customer gateway.

在本公开的一个或多个实施例中,所述接收单元701还用于:In one or more embodiments of the present disclosure, the receiving unit 701 is further configured to:

与所述虚拟专用网络网关建立加密连接,并通过加密连接接收所述虚拟专用网络网关发送的所述安全关联信息。An encrypted connection is established with the virtual private network gateway, and the security association information sent by the virtual private network gateway is received through the encrypted connection.

在本公开的一个或多个实施例中,所述处理单元702在根据所述安全关联信息中的密钥对所述待发送数据包进行加密,得到加密数据包后,还用于:In one or more embodiments of the present disclosure, after the processing unit 702 encrypts the data packet to be sent according to the key in the security association information to obtain the encrypted data packet, it is further configured to:

对所述加密数据包添加标识,所述标识用于表示该数据包已根据所述安全关联信息加密;和/或Adding an identifier to the encrypted data packet, where the identifier is used to indicate that the data packet has been encrypted according to the security association information; and/or

对所述加密数据包添加被加密数据的长度以及所述安全关联信息的标识信息;和/或Adding the length of the encrypted data and the identification information of the security association information to the encrypted data packet; and/or

对所述加密数据包进行封装。Encapsulate the encrypted data packet.

在本公开的一个或多个实施例中,所述接收单元701还用于,通过加密连接接收所述虚拟专用网络网关发送的更新后的安全关联信息;In one or more embodiments of the present disclosure, the receiving unit 701 is further configured to receive the updated security association information sent by the virtual private network gateway through an encrypted connection;

所述处理单元702还用于,将当前的安全关联信息更新为所述更新后的安全关联信息;或者The processing unit 702 is further configured to update the current security association information to the updated security association information; or

所述接收单元701还用于,通过加密连接接收所述虚拟专用网络网关发送的删除所述安全关联信息的指令;The receiving unit 701 is further configured to receive an instruction to delete the security association information sent by the virtual private network gateway through an encrypted connection;

所述处理单元702还用于,将当前的安全关联信息删除。The processing unit 702 is further configured to delete current security association information.

本实施例提供的设备,可用于执行上述虚拟交换机侧的报文处理方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。The device provided in this embodiment can be used to implement the technical solution of the above-mentioned embodiment of the packet processing method on the virtual switch side, and its implementation principle and technical effect are similar, so this embodiment will not repeat them here.

参考图8,其示出了适于用来实现本公开实施例的电子设备800的结构示意图,该电子设备800可以为终端设备或服务器。其中,终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,简称PDA)、平板电脑(Portable Android Device,简称PAD)、便携式多媒体播放器(Portable MediaPlayer,简称PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图8示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring to FIG. 8 , it shows a schematic structural diagram of an electronic device 800 suitable for implementing the embodiments of the present disclosure. The electronic device 800 may be a terminal device or a server. Wherein, the terminal equipment may include but not limited to mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA for short), tablet computers (Portable Android Device, PAD for short), portable multimedia players (Portable MediaPlayer (PMP for short), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG. 8 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.

如图8所示,电子设备800可以包括处理装置(例如中央处理器、图形处理器等)801,其可以根据存储在只读存储器(Read Only Memory,简称ROM)802中的程序或者从存储装置808加载到随机访问存储器(Random Access Memory,简称RAM)803中的程序而执行各种适当的动作和处理。在RAM 803中,还存储有电子设备800操作所需的各种程序和数据。处理装置801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。As shown in FIG. 8, an electronic device 800 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 801, which may be stored in a program in a read-only memory (Read Only Memory, ROM for short) 802 or from a storage device. 808 programs loaded into the Random Access Memory (RAM for short) 803 to execute various appropriate actions and processes. In the RAM 803, various programs and data necessary for the operation of the electronic device 800 are also stored. The processing device 801 , ROM 802 , and RAM 803 are connected to each other through a bus 804 . An input/output (I/O) interface 805 is also connected to the bus 804 .

通常,以下装置可以连接至I/O接口805:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置806;包括例如液晶显示器(Liquid CrystalDisplay,简称LCD)、扬声器、振动器等的输出装置807;包括例如磁带、硬盘等的存储装置808;以及通信装置809。通信装置809可以允许电子设备800与其他设备进行无线或有线通信以交换数据。虽然图8示出了具有各种装置的电子设备800,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Generally, the following devices can be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (Liquid Crystal Display, LCD for short) , an output device 807 such as a speaker, a vibrator, etc.; a storage device 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809. The communication means 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. While FIG. 8 shows electronic device 800 having various means, it is to be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.

特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置809从网络上被下载和安装,或者从存储装置808被安装,或者从ROM802被安装。在该计算机程序被处理装置801执行时,执行本公开实施例的IPSec VPN网关侧或虚拟交换机侧的报文处理方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 809 , or from storage means 808 , or from ROM 802 . When the computer program is executed by the processing device 801, the above-mentioned functions defined in the packet processing method at the IPSec VPN gateway side or the virtual switch side of the embodiment of the present disclosure are executed.

需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.

上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述实施例所示的方法。The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to execute the methods shown in the above-mentioned embodiments.

可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LocalArea Network,简称LAN)或广域网(Wide Area Network,简称WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out the operations of the present disclosure can be written in one or more programming languages, or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, and conventional Procedural Programming Language - such as "C" or a similar programming language. 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 cases involving a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external computer (e.g. using an Internet Service Provider to connect via the Internet).

附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.

描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the unit does not constitute a limitation of the unit itself under certain circumstances, for example, the first obtaining unit may also be described as "a unit for obtaining at least two Internet Protocol addresses".

本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described herein above may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), System on Chips (SOCs), Complex Programmable Logical device (CPLD) and so on.

在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may 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 one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.

第一方面,根据本公开的一个或多个实施例,提供了一种报文处理方法,所述方法包括:In a first aspect, according to one or more embodiments of the present disclosure, a packet processing method is provided, the method including:

接收云端计算节点的虚拟交换机发送的加密数据包,其中,所述加密数据包由所述虚拟交换机根据互联网安全协议的安全关联信息进行加密;所述安全关联信息是预先发送给所述虚拟交换机的;receiving the encrypted data packet sent by the virtual switch of the cloud computing node, wherein the encrypted data packet is encrypted by the virtual switch according to the security association information of the Internet security protocol; the security association information is sent to the virtual switch in advance ;

对所述加密数据包填充报文信息,封装为完整的目标报文;Filling the encrypted data packet with message information and encapsulating it into a complete target message;

将所述目标报文发送给目标客户网关。Send the target message to the target customer gateway.

根据本公开的一个或多个实施例,所述接收云端计算节点的虚拟交换机发送的加密数据包前,还包括:According to one or more embodiments of the present disclosure, before receiving the encrypted data packet sent by the virtual switch of the cloud computing node, it also includes:

与所述目标客户网关进行协商过程,确定所述安全关联信息;Carrying out a negotiation process with the target customer gateway to determine the security association information;

与所述虚拟交换机建立加密连接,并通过加密连接将所述安全关联信息发送给所述虚拟交换机。An encrypted connection is established with the virtual switch, and the security association information is sent to the virtual switch through the encrypted connection.

根据本公开的一个或多个实施例,所述与所述虚拟交换机建立加密连接,并通过加密连接将所述安全关联信息发送给所述虚拟交换机,包括:According to one or more embodiments of the present disclosure, the establishing an encrypted connection with the virtual switch, and sending the security association information to the virtual switch through the encrypted connection includes:

接收所述虚拟交换机发送的待加密数据包,根据所述安全关联信息对所述待加密数据包进行加密以及封装为完整的目标报文,并发送给所述目标客户网关;Receiving the data packet to be encrypted sent by the virtual switch, encrypting the data packet to be encrypted according to the security association information and encapsulating it into a complete target message, and sending it to the target customer gateway;

基于所述待加密数据包,查询所述虚拟交换机信息;Querying the information of the virtual switch based on the data packet to be encrypted;

根据所述虚拟交换机信息与所述虚拟交换机建立加密连接,并通过加密连接将所述安全关联信息发送给所述虚拟交换机。An encrypted connection is established with the virtual switch according to the virtual switch information, and the security association information is sent to the virtual switch through the encrypted connection.

根据本公开的一个或多个实施例,所述加密数据包中携带有标识,所述标识由所述虚拟交换机添加,用于表示该数据包已根据所述安全关联信息加密;According to one or more embodiments of the present disclosure, the encrypted data packet carries an identifier, and the identifier is added by the virtual switch to indicate that the data packet has been encrypted according to the security association information;

所述对所述加密数据包填充报文信息,封装为完整的目标报文,包括:Filling the encrypted data packet with message information and encapsulating it into a complete target message includes:

若识别到所述加密数据包携带有所述标识,则跳过加密处理,对所述加密数据包添加封装安全载荷的头部信息和尾部信息,并封装为完整的目标报文。If it is identified that the encrypted data packet carries the identifier, the encryption process is skipped, header information and trailer information encapsulating a security payload are added to the encrypted data packet, and encapsulated into a complete target message.

根据本公开的一个或多个实施例,所述加密数据包中携带有被加密数据的长度以及所述安全关联信息的标识信息;According to one or more embodiments of the present disclosure, the encrypted data packet carries the length of the encrypted data and identification information of the security association information;

所述对所述加密数据包填充报文信息,封装为完整的目标报文前,还包括:Before the filling message information of the encrypted data packet is encapsulated into a complete target message, it also includes:

对采用所述安全关联信息加密的加密数据包中所携带的被加密数据的长度进行累加,得到被加密数据的累计长度;Accumulate the length of the encrypted data carried in the encrypted data packet encrypted by using the security association information to obtain the accumulated length of the encrypted data;

将所述被加密数据的累计长度与所述安全关联信息对应的预设加密长度阈值进行比较;Comparing the cumulative length of the encrypted data with a preset encryption length threshold corresponding to the security association information;

若所述被加密数据的累计长度超过所述安全关联信息对应的预设加密长度阈值,则重新与所述目标客户网关进行协商过程,确定更新后的安全关联信息。If the accumulated length of the encrypted data exceeds the preset encryption length threshold corresponding to the security association information, re-negotiate with the target customer gateway to determine the updated security association information.

根据本公开的一个或多个实施例,所述加密数据包由所述虚拟交换机在加密后进行封装;According to one or more embodiments of the present disclosure, the encrypted data packet is encapsulated by the virtual switch after being encrypted;

所述对所述加密数据包填充报文信息前,还包括:Before the said encrypted data packet is filled with message information, it also includes:

对所述加密数据包进行解封装。Decapsulate the encrypted data packet.

根据本公开的一个或多个实施例,所述方法还包括:According to one or more embodiments of the present disclosure, the method further includes:

若确定所述安全关联信息更新,则通过加密连接将更新后的安全关联信息发送给所述虚拟交换机;或者If it is determined that the security association information is updated, sending the updated security association information to the virtual switch through an encrypted connection; or

若确定所述安全关联信息被销毁,则通过加密连接向所述虚拟交换机发送删除所述安全关联信息的指令。If it is determined that the security association information is destroyed, an instruction to delete the security association information is sent to the virtual switch through an encrypted connection.

第二方面,根据本公开的一个或多个实施例,提供了一种报文处理方法,所述方法包括:In a second aspect, according to one or more embodiments of the present disclosure, a packet processing method is provided, the method including:

根据互联网安全协议的安全关联信息中的加密策略,判断所述待发送数据包是否需要加密,若确定需要加密,则根据所述安全关联信息中的密钥对所述待发送数据包进行加密,得到加密数据包;其中,所述安全关联信息是由云端基于互联网安全协议的虚拟专用网络网关预先发送的;According to the encryption strategy in the security-related information of the Internet security protocol, it is judged whether the data packet to be sent needs to be encrypted, and if it is determined that encryption is required, the data packet to be sent is encrypted according to the key in the security-related information, An encrypted data packet is obtained; wherein, the security association information is pre-sent by the virtual private network gateway based on the Internet security protocol in the cloud;

将加密数据包发送给所述虚拟专用网络网关,以使所述虚拟专用网络网关对所述加密数据包填充报文信息,封装为完整的目标报文,并发送给目标客户网关。Sending the encrypted data packet to the virtual private network gateway, so that the virtual private network gateway fills the encrypted data packet with message information, encapsulates it into a complete target message, and sends it to the target customer gateway.

根据本公开的一个或多个实施例,所述方法还包括:According to one or more embodiments of the present disclosure, the method further includes:

与所述虚拟专用网络网关建立加密连接,并通过加密连接接收所述虚拟专用网络网关发送的所述安全关联信息。An encrypted connection is established with the virtual private network gateway, and the security association information sent by the virtual private network gateway is received through the encrypted connection.

根据本公开的一个或多个实施例,所述根据所述安全关联信息中的密钥对所述待发送数据包进行加密,得到加密数据包后,还包括:According to one or more embodiments of the present disclosure, encrypting the data packet to be sent according to the key in the security association information, and after obtaining the encrypted data packet, further includes:

对所述加密数据包添加标识,所述标识用于表示该数据包已根据所述安全关联信息加密;和/或Adding an identifier to the encrypted data packet, where the identifier is used to indicate that the data packet has been encrypted according to the security association information; and/or

对所述加密数据包添加被加密数据的长度以及所述安全关联信息的标识信息;和/或Adding the length of the encrypted data and the identification information of the security association information to the encrypted data packet; and/or

对所述加密数据包进行封装。Encapsulate the encrypted data packet.

根据本公开的一个或多个实施例,所述方法还包括:According to one or more embodiments of the present disclosure, the method further includes:

通过加密连接接收所述虚拟专用网络网关发送的更新后的安全关联信息,将当前的安全关联信息更新为所述更新后的安全关联信息;或者receiving the updated security association information sent by the virtual private network gateway through an encrypted connection, and updating the current security association information to the updated security association information; or

通过加密连接接收所述虚拟专用网络网关发送的删除所述安全关联信息的指令,将当前的安全关联信息删除。An instruction to delete the security association information sent by the virtual private network gateway is received through an encrypted connection, and the current security association information is deleted.

第三方面,根据本公开的一个或多个实施例,提供了一种报文处理设备,包括:In a third aspect, according to one or more embodiments of the present disclosure, a packet processing device is provided, including:

接收单元,用于接收云端计算节点的虚拟交换机发送的加密数据包,其中,所述加密数据包由所述虚拟交换机根据互联网安全协议的安全关联信息进行加密;所述安全关联信息是预先发送给所述虚拟交换机的;The receiving unit is used to receive the encrypted data packet sent by the virtual switch of the cloud computing node, wherein the encrypted data packet is encrypted by the virtual switch according to the security association information of the Internet security protocol; the security association information is pre-sent to of the virtual switch;

处理单元,用于对所述加密数据包填充报文信息,封装为完整的目标报文;A processing unit, configured to fill the encrypted data packet with message information and encapsulate it into a complete target message;

发送单元,用于将所述目标报文发送给目标客户网关。A sending unit, configured to send the target message to the target customer gateway.

根据本公开的一个或多个实施例,在接收云端计算节点的虚拟交换机发送的加密数据包前,所述处理单元还用于与所述目标客户网关进行协商过程,确定所述安全关联信息;According to one or more embodiments of the present disclosure, before receiving the encrypted data packet sent by the virtual switch of the cloud computing node, the processing unit is further configured to perform a negotiation process with the target customer gateway to determine the security association information;

发送单元还用于,与所述虚拟交换机建立加密连接,并通过加密连接将所述安全关联信息发送给所述虚拟交换机。The sending unit is further configured to establish an encrypted connection with the virtual switch, and send the security association information to the virtual switch through the encrypted connection.

根据本公开的一个或多个实施例,所述发送单元还用于,接收所述虚拟交换机发送的待加密数据包;According to one or more embodiments of the present disclosure, the sending unit is further configured to receive the data packet to be encrypted sent by the virtual switch;

所述处理单元还用于,根据所述安全关联信息对所述待加密数据包进行加密以及封装为完整的目标报文;所述发送单元还用于,将该目标报文发送给所述目标客户网关;The processing unit is further configured to encrypt and encapsulate the data packet to be encrypted into a complete target message according to the security association information; the sending unit is also configured to send the target message to the target customer gateway;

所述处理单元还用于,基于所述待加密数据包,查询所述虚拟交换机信息;The processing unit is further configured to, based on the data packet to be encrypted, query the information of the virtual switch;

所述发送单元还用于,根据所述虚拟交换机信息与所述虚拟交换机建立加密连接,并通过加密连接将所述安全关联信息发送给所述虚拟交换机。The sending unit is further configured to establish an encrypted connection with the virtual switch according to the virtual switch information, and send the security association information to the virtual switch through the encrypted connection.

根据本公开的一个或多个实施例,所述加密数据包中携带有标识,所述标识由所述虚拟交换机添加,用于表示该数据包已根据所述安全关联信息加密;According to one or more embodiments of the present disclosure, the encrypted data packet carries an identifier, and the identifier is added by the virtual switch to indicate that the data packet has been encrypted according to the security association information;

所述处理单元在对所述加密数据包填充报文信息,封装为完整的目标报文时,用于:When the processing unit fills the encrypted data packet with message information and encapsulates it into a complete target message, it is used for:

若识别到所述加密数据包携带有所述标识,则跳过加密处理,对所述加密数据包添加封装安全载荷的头部信息和尾部信息,并封装为完整的目标报文。If it is identified that the encrypted data packet carries the identifier, the encryption process is skipped, header information and trailer information encapsulating a security payload are added to the encrypted data packet, and encapsulated into a complete target message.

根据本公开的一个或多个实施例,所述加密数据包中携带有被加密数据的长度以及所述安全关联信息的标识信息;According to one or more embodiments of the present disclosure, the encrypted data packet carries the length of the encrypted data and identification information of the security association information;

所述处理单元在对所述加密数据包填充报文信息,封装为完整的目标报文前,还用于:Before the processing unit fills the encrypted data packet with message information and encapsulates it into a complete target message, it is also used for:

对采用所述安全关联信息加密的加密数据包中所携带的被加密数据的长度进行累加,得到被加密数据的累计长度;Accumulate the length of the encrypted data carried in the encrypted data packet encrypted by using the security association information to obtain the accumulated length of the encrypted data;

将所述被加密数据的累计长度与所述安全关联信息对应的预设加密长度阈值进行比较;Comparing the cumulative length of the encrypted data with a preset encryption length threshold corresponding to the security association information;

若所述被加密数据的累计长度超过所述安全关联信息对应的预设加密长度阈值,则重新与所述目标客户网关进行协商过程,确定更新后的安全关联信息。If the accumulated length of the encrypted data exceeds the preset encryption length threshold corresponding to the security association information, re-negotiate with the target customer gateway to determine the updated security association information.

根据本公开的一个或多个实施例,所述加密数据包由所述虚拟交换机在加密后进行封装;According to one or more embodiments of the present disclosure, the encrypted data packet is encapsulated by the virtual switch after being encrypted;

所述处理单元在对所述加密数据包填充报文信息前,还用于:Before filling the encrypted data packet with message information, the processing unit is further configured to:

对所述加密数据包进行解封装。Decapsulate the encrypted data packet.

根据本公开的一个或多个实施例,所述发送单元还用于:According to one or more embodiments of the present disclosure, the sending unit is further configured to:

若确定所述安全关联信息更新,则通过加密连接将更新后的安全关联信息发送给所述虚拟交换机;或者If it is determined that the security association information is updated, sending the updated security association information to the virtual switch through an encrypted connection; or

若确定所述安全关联信息被销毁,则通过加密连接向所述虚拟交换机发送删除所述安全关联信息的指令。If it is determined that the security association information is destroyed, an instruction to delete the security association information is sent to the virtual switch through an encrypted connection.

第四方面,根据本公开的一个或多个实施例,提供了一种报文处理设备,包括:In a fourth aspect, according to one or more embodiments of the present disclosure, a packet processing device is provided, including:

接收单元,用于接收所述云端计算节点的虚拟机发送的待发送数据包;A receiving unit, configured to receive the data packet to be sent sent by the virtual machine of the cloud computing node;

处理单元,用于根据互联网安全协议的安全关联信息中的加密策略,判断所述待发送数据包是否需要加密,若确定需要加密,则根据所述安全关联信息中的密钥对所述待发送数据包进行加密,得到加密数据包;其中,所述安全关联信息是由云端基于互联网安全协议的虚拟专用网络网关预先发送的;The processing unit is configured to judge whether the data packet to be sent needs to be encrypted according to the encryption strategy in the security-related information of the Internet security protocol, and if it is determined that encryption is required, then encrypt the data packet to be sent according to the key in the security-related information The data packet is encrypted to obtain an encrypted data packet; wherein, the security-related information is sent in advance by the virtual private network gateway based on the Internet security protocol in the cloud;

发送单元,用于将加密数据包发送给所述虚拟专用网络网关,以使所述虚拟专用网络网关对所述加密数据包填充报文信息,封装为完整的目标报文,并发送给目标客户网关。A sending unit, configured to send the encrypted data packet to the virtual private network gateway, so that the virtual private network gateway fills the encrypted data packet with message information, encapsulates it into a complete target message, and sends it to the target customer gateway.

根据本公开的一个或多个实施例,所述接收单元还用于:According to one or more embodiments of the present disclosure, the receiving unit is further configured to:

与所述虚拟专用网络网关建立加密连接,并通过加密连接接收所述虚拟专用网络网关发送的所述安全关联信息。An encrypted connection is established with the virtual private network gateway, and the security association information sent by the virtual private network gateway is received through the encrypted connection.

根据本公开的一个或多个实施例,所述处理单元在根据所述安全关联信息中的密钥对所述待发送数据包进行加密,得到加密数据包后,还用于:According to one or more embodiments of the present disclosure, after the processing unit encrypts the data packet to be sent according to the key in the security association information, and obtains the encrypted data packet, it is further configured to:

对所述加密数据包添加标识,所述标识用于表示该数据包已根据所述安全关联信息加密;和/或Adding an identifier to the encrypted data packet, where the identifier is used to indicate that the data packet has been encrypted according to the security association information; and/or

对所述加密数据包添加被加密数据的长度以及所述安全关联信息的标识信息;和/或Adding the length of the encrypted data and the identification information of the security association information to the encrypted data packet; and/or

对所述加密数据包进行封装。Encapsulate the encrypted data packet.

根据本公开的一个或多个实施例,所述接收单元还用于,通过加密连接接收所述虚拟专用网络网关发送的更新后的安全关联信息;According to one or more embodiments of the present disclosure, the receiving unit is further configured to receive the updated security association information sent by the virtual private network gateway through an encrypted connection;

所述处理单元还用于,将当前的安全关联信息更新为所述更新后的安全关联信息;或者The processing unit is further configured to update the current security association information to the updated security association information; or

所述接收单元还用于,通过加密连接接收所述虚拟专用网络网关发送的删除所述安全关联信息的指令;The receiving unit is further configured to receive an instruction to delete the security association information sent by the virtual private network gateway through an encrypted connection;

所述处理单元还用于,将当前的安全关联信息删除。The processing unit is further configured to delete the current security association information.

第五方面,根据本公开的一个或多个实施例,提供了一种电子设备,包括:至少一个处理器和存储器;According to a fifth aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, including: at least one processor and a memory;

所述存储器存储计算机执行指令;the memory stores computer-executable instructions;

所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如上第一方面以及第一方面各种可能的设计所述的报文处理方法,或第二方面以及第二方面各种可能的设计所述的报文处理方法。The at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the message processing method described in the above first aspect and various possible designs of the first aspect, or the second aspect and Various possible designs of the message processing method in the second aspect.

第六方面,根据本公开的一个或多个实施例,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的报文处理方法,或第二方面以及第二方面各种可能的设计所述的报文处理方法。In a sixth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, Realize the packet processing method described in the first aspect and various possible designs of the first aspect, or the packet processing method described in the second aspect and various possible designs of the second aspect.

第七方面,根据本公开的一个或多个实施例,提供了一种计算机程序产品,包括计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的报文处理方法,或第二方面以及第二方面各种可能的设计所述的报文处理方法。In the seventh aspect, according to one or more embodiments of the present disclosure, there is provided a computer program product, including computer-executable instructions, when the processor executes the computer-executable instructions, the above first aspect and various aspects of the first aspect can be realized. A possible design of the packet processing method, or the second aspect and various possible designs of the packet processing method of the second aspect.

以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an illustration of the applied technical principles. Those skilled in the art should understand that the disclosure scope involved in this disclosure is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, but also covers the technical solutions formed by the above-mentioned technical features or Other technical solutions formed by any combination of equivalent features. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。In addition, while operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or performed in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while the above discussion contains several specific implementation details, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.

尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims (16)

1.一种报文处理方法,其特征在于,包括:1. A message processing method, characterized in that, comprising: 接收云端计算节点的虚拟交换机发送的加密数据包,其中,所述加密数据包由所述虚拟交换机根据互联网安全协议的安全关联信息进行加密;所述安全关联信息是预先发送给所述虚拟交换机的;receiving the encrypted data packet sent by the virtual switch of the cloud computing node, wherein the encrypted data packet is encrypted by the virtual switch according to the security association information of the Internet security protocol; the security association information is sent to the virtual switch in advance ; 对所述加密数据包填充报文信息,封装为完整的目标报文;Filling the encrypted data packet with message information and encapsulating it into a complete target message; 将所述目标报文发送给目标客户网关。Send the target message to the target customer gateway. 2.根据权利要求1所述的方法,其特征在于,所述接收云端计算节点的虚拟交换机发送的加密数据包前,还包括:2. The method according to claim 1, wherein before receiving the encrypted data packet sent by the virtual switch of the cloud computing node, further comprising: 与所述目标客户网关进行协商过程,确定所述安全关联信息;Carrying out a negotiation process with the target customer gateway to determine the security association information; 与所述虚拟交换机建立加密连接,并通过加密连接将所述安全关联信息发送给所述虚拟交换机。An encrypted connection is established with the virtual switch, and the security association information is sent to the virtual switch through the encrypted connection. 3.根据权利要求2所述的方法,其特征在于,所述与所述虚拟交换机建立加密连接,并通过加密连接将所述安全关联信息发送给所述虚拟交换机,包括:3. The method according to claim 2, wherein the establishing an encrypted connection with the virtual switch, and sending the security association information to the virtual switch through the encrypted connection comprises: 接收所述虚拟交换机发送的待加密数据包,根据所述安全关联信息对所述待加密数据包进行加密以及封装为完整的目标报文,并发送给所述目标客户网关;Receiving the data packet to be encrypted sent by the virtual switch, encrypting the data packet to be encrypted according to the security association information and encapsulating it into a complete target message, and sending it to the target customer gateway; 基于所述待加密数据包,查询所述虚拟交换机信息;Querying the information of the virtual switch based on the data packet to be encrypted; 根据所述虚拟交换机信息与所述虚拟交换机建立加密连接,并通过加密连接将所述安全关联信息发送给所述虚拟交换机。An encrypted connection is established with the virtual switch according to the virtual switch information, and the security association information is sent to the virtual switch through the encrypted connection. 4.根据权利要求1-3任一项所述的方法,其特征在于,所述加密数据包中携带有标识,所述标识由所述虚拟交换机添加,用于表示该数据包已根据所述安全关联信息加密;4. The method according to any one of claims 1-3, wherein the encrypted data packet carries an identifier, and the identifier is added by the virtual switch to indicate that the data packet has been encrypted according to the Security association information encryption; 所述对所述加密数据包填充报文信息,封装为完整的目标报文,包括:Filling the encrypted data packet with message information and encapsulating it into a complete target message includes: 若识别到所述加密数据包携带有所述标识,则跳过加密处理,对所述加密数据包添加封装安全载荷的头部信息和尾部信息,并封装为完整的目标报文。If it is identified that the encrypted data packet carries the identifier, the encryption process is skipped, header information and trailer information encapsulating a security payload are added to the encrypted data packet, and encapsulated into a complete target message. 5.根据权利要求2或3所述的方法,其特征在于,所述加密数据包中携带有被加密数据的长度以及所述安全关联信息的标识信息;5. The method according to claim 2 or 3, wherein the encrypted data packet carries the length of the encrypted data and identification information of the security-related information; 所述对所述加密数据包填充报文信息,封装为完整的目标报文前,还包括:Before the filling message information of the encrypted data packet is encapsulated into a complete target message, it also includes: 对采用所述安全关联信息加密的加密数据包中所携带的被加密数据的长度进行累加,得到被加密数据的累计长度;Accumulate the length of the encrypted data carried in the encrypted data packet encrypted by using the security association information to obtain the accumulated length of the encrypted data; 将所述被加密数据的累计长度与所述安全关联信息对应的预设加密长度阈值进行比较;Comparing the cumulative length of the encrypted data with a preset encryption length threshold corresponding to the security association information; 若所述被加密数据的累计长度超过所述安全关联信息对应的预设加密长度阈值,则重新与所述目标客户网关进行协商过程,确定更新后的安全关联信息。If the accumulated length of the encrypted data exceeds the preset encryption length threshold corresponding to the security association information, re-negotiate with the target customer gateway to determine the updated security association information. 6.根据权利要求1-3任一项所述的方法,其特征在于,所述加密数据包由所述虚拟交换机在加密后进行封装;6. The method according to any one of claims 1-3, wherein the encrypted data packet is encapsulated by the virtual switch after being encrypted; 所述对所述加密数据包填充报文信息前,还包括:Before the said encrypted data packet is filled with message information, it also includes: 对所述加密数据包进行解封装。Decapsulate the encrypted data packet. 7.根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:7. The method according to any one of claims 1-3, characterized in that the method further comprises: 若确定所述安全关联信息更新,则通过加密连接将更新后的安全关联信息发送给所述虚拟交换机;或者If it is determined that the security association information is updated, sending the updated security association information to the virtual switch through an encrypted connection; or 若确定所述安全关联信息被销毁,则通过加密连接向所述虚拟交换机发送删除所述安全关联信息的指令。If it is determined that the security association information is destroyed, an instruction to delete the security association information is sent to the virtual switch through an encrypted connection. 8.一种报文处理方法,其特征在于,包括:8. A message processing method, characterized in that, comprising: 接收云端计算节点的虚拟机发送的待发送数据包;Receive the data packet to be sent sent by the virtual machine of the cloud computing node; 根据互联网安全协议的安全关联信息中的加密策略,判断所述待发送数据包是否需要加密,若确定需要加密,则根据所述安全关联信息中的密钥对所述待发送数据包进行加密,得到加密数据包;其中,所述安全关联信息是由云端基于互联网安全协议的虚拟专用网络网关预先发送的;According to the encryption strategy in the security-related information of the Internet security protocol, it is judged whether the data packet to be sent needs to be encrypted, and if it is determined that encryption is required, the data packet to be sent is encrypted according to the key in the security-related information, An encrypted data packet is obtained; wherein, the security association information is pre-sent by the virtual private network gateway based on the Internet security protocol in the cloud; 将加密数据包发送给所述虚拟专用网络网关,以使所述虚拟专用网络网关对所述加密数据包填充报文信息,封装为完整的目标报文,并发送给目标客户网关。Sending the encrypted data packet to the virtual private network gateway, so that the virtual private network gateway fills the encrypted data packet with message information, encapsulates it into a complete target message, and sends it to the target customer gateway. 9.根据权利要求8所述的方法,其特征在于,所述方法还包括:9. The method of claim 8, further comprising: 与所述虚拟专用网络网关建立加密连接,并通过加密连接接收所述虚拟专用网络网关发送的所述安全关联信息。An encrypted connection is established with the virtual private network gateway, and the security association information sent by the virtual private network gateway is received through the encrypted connection. 10.根据权利要求8或9所述的方法,其特征在于,所述根据所述安全关联信息中的密钥对所述待发送数据包进行加密,得到加密数据包后,还包括:10. The method according to claim 8 or 9, characterized in that, encrypting the data packet to be sent according to the key in the security association information, and after obtaining the encrypted data packet, further comprising: 对所述加密数据包添加标识,所述标识用于表示该数据包已根据所述安全关联信息加密;和/或Adding an identifier to the encrypted data packet, where the identifier is used to indicate that the data packet has been encrypted according to the security association information; and/or 对所述加密数据包添加被加密数据的长度以及所述安全关联信息的标识信息;和/或Adding the length of the encrypted data and the identification information of the security association information to the encrypted data packet; and/or 对所述加密数据包进行封装。Encapsulate the encrypted data packet. 11.根据权利要求8或9所述的方法,其特征在于,所述方法还包括:11. The method according to claim 8 or 9, further comprising: 通过加密连接接收所述虚拟专用网络网关发送的更新后的安全关联信息,将当前的安全关联信息更新为所述更新后的安全关联信息;或者receiving the updated security association information sent by the virtual private network gateway through an encrypted connection, and updating the current security association information to the updated security association information; or 通过加密连接接收所述虚拟专用网络网关发送的删除所述安全关联信息的指令,将当前的安全关联信息删除。An instruction to delete the security association information sent by the virtual private network gateway is received through an encrypted connection, and the current security association information is deleted. 12.一种报文处理设备,其特征在于,包括:12. A packet processing device, comprising: 接收单元,用于接收云端计算节点的虚拟交换机发送的加密数据包,其中,所述加密数据包由所述虚拟交换机根据互联网安全协议的安全关联信息进行加密;所述安全关联信息是预先发送给所述虚拟交换机的;The receiving unit is used to receive the encrypted data packet sent by the virtual switch of the cloud computing node, wherein the encrypted data packet is encrypted by the virtual switch according to the security association information of the Internet security protocol; the security association information is sent to of the virtual switch; 处理单元,用于对所述加密数据包填充报文信息,封装为完整的目标报文;A processing unit, configured to fill the encrypted data packet with message information and encapsulate it into a complete target message; 发送单元,用于将所述目标报文发送给目标客户网关。A sending unit, configured to send the target message to the target customer gateway. 13.一种报文处理设备,其特征在于,包括:13. A packet processing device, comprising: 接收单元,用于接收云端计算节点的虚拟机发送的待发送数据包;The receiving unit is used to receive the data packet to be sent sent by the virtual machine of the cloud computing node; 处理单元,用于根据互联网安全协议的安全关联信息中的加密策略,判断所述待发送数据包是否需要加密,若确定需要加密,则根据所述安全关联信息中的密钥对所述待发送数据包进行加密,得到加密数据包;其中,所述安全关联信息是由云端基于互联网安全协议的虚拟专用网络网关预先发送的;The processing unit is configured to judge whether the data packet to be sent needs to be encrypted according to the encryption strategy in the security-related information of the Internet security protocol, and if it is determined that encryption is required, then encrypt the data packet to be sent according to the key in the security-related information The data packet is encrypted to obtain an encrypted data packet; wherein, the security-associated information is sent in advance by the virtual private network gateway based on the Internet security protocol in the cloud; 发送单元,用于将加密数据包发送给所述虚拟专用网络网关,以使所述虚拟专用网络网关对所述加密数据包填充报文信息,封装为完整的目标报文,并发送给目标客户网关。A sending unit, configured to send the encrypted data packet to the virtual private network gateway, so that the virtual private network gateway fills the encrypted data packet with message information, encapsulates it into a complete target message, and sends it to the target customer gateway. 14.一种电子设备,其特征在于,包括:至少一个处理器和存储器;14. An electronic device, comprising: at least one processor and a memory; 所述存储器存储计算机执行指令;the memory stores computer-executable instructions; 所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如权利要求1-7或8-11任一项所述的方法。The at least one processor executes the computer-implemented instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1-7 or 8-11. 15.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如权利要求1-7或8-11任一项所述的方法。15. A computer-readable storage medium, wherein computer-readable instructions are stored in the computer-readable storage medium, and when the processor executes the computer-executable instructions, claims 1-7 or 8-11 are realized any one of the methods described. 16.一种计算机程序产品,其特征在于,包括计算机执行指令,当处理器执行所述计算机执行指令时,实现如权利要求1-7或8-11任一项所述的方法。16. A computer program product, characterized by comprising computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1-7 or 8-11 is realized.
CN202211289296.4A 2022-10-20 2022-10-20 Message processing method, device, storage medium and program product Pending CN115664773A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211289296.4A CN115664773A (en) 2022-10-20 2022-10-20 Message processing method, device, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211289296.4A CN115664773A (en) 2022-10-20 2022-10-20 Message processing method, device, storage medium and program product

Publications (1)

Publication Number Publication Date
CN115664773A true CN115664773A (en) 2023-01-31

Family

ID=84989229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211289296.4A Pending CN115664773A (en) 2022-10-20 2022-10-20 Message processing method, device, storage medium and program product

Country Status (1)

Country Link
CN (1) CN115664773A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040205245A1 (en) * 2003-03-28 2004-10-14 Jean-Francois Le Pennec Data transmission system with a mechanism enabling any application to run transparently over a network address translation device
US20100217971A1 (en) * 2009-02-25 2010-08-26 Cisco Technology, Inc. Aggregation of cryptography engines
US20130133057A1 (en) * 2011-11-22 2013-05-23 Electronics And Telecommunications Research Institute System for managing virtual private network and method thereof
US20160315920A1 (en) * 2015-04-22 2016-10-27 Aruba Networks, Inc. Method and apparatus for avoiding double-encryption in site-to-site ipsec vpn connections
US20170331794A1 (en) * 2016-05-11 2017-11-16 Argela Yazilim Ve Bilisim Teknolojileri San. Ve Ti C. A.S. System and method for programmable network based encryption in software defined networks
CN110519259A (en) * 2019-08-23 2019-11-29 北京浪潮数据技术有限公司 Communication encryption configuration method, device and readable storage medium storing program for executing between cloud platform object

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040205245A1 (en) * 2003-03-28 2004-10-14 Jean-Francois Le Pennec Data transmission system with a mechanism enabling any application to run transparently over a network address translation device
US20100217971A1 (en) * 2009-02-25 2010-08-26 Cisco Technology, Inc. Aggregation of cryptography engines
US20130133057A1 (en) * 2011-11-22 2013-05-23 Electronics And Telecommunications Research Institute System for managing virtual private network and method thereof
US20160315920A1 (en) * 2015-04-22 2016-10-27 Aruba Networks, Inc. Method and apparatus for avoiding double-encryption in site-to-site ipsec vpn connections
US20170331794A1 (en) * 2016-05-11 2017-11-16 Argela Yazilim Ve Bilisim Teknolojileri San. Ve Ti C. A.S. System and method for programmable network based encryption in software defined networks
CN110519259A (en) * 2019-08-23 2019-11-29 北京浪潮数据技术有限公司 Communication encryption configuration method, device and readable storage medium storing program for executing between cloud platform object

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
MICHAEL PFEIFFER、MICHAEL ROSSBERG、FRANZ GIRLICH、GUENTER SCHAEFER: "Vector Packet Encapsulation: The Case for a Scalable IPsec Encryption Protocol", 《ACM DIGITAL LIBRARY》, 25 August 2020 (2020-08-25) *
孙为清, 赵轶群: "一种基于LINUX的VPN服务器(VS)的设计和实现", 计算机工程与应用, no. 01, 1 January 2002 (2002-01-01) *
汪海航, 师成江, 谭成翔: "安全VPN服务器中IKE协议的设计与实现", 计算机应用研究, no. 03, 28 March 2002 (2002-03-28), pages 51 - 55 *

Similar Documents

Publication Publication Date Title
EP3632057B1 (en) Distributed ipsec gateway
CN109150688B (en) IPSec VPN data transmission method and device
US10250578B2 (en) Internet key exchange (IKE) for secure association between devices
JP5746446B2 (en) Network node with network-attached stateless security offload device
US11729042B2 (en) IPSec acceleration method, apparatus, and system
US9992223B2 (en) Flow-based anti-replay checking
CN111756751B (en) Message transmission method and device and electronic equipment
CN116647425B (en) An IPSec-VPN implementation method, device, electronic device and storage medium of OVN architecture
CN115442063A (en) Charging data sending and receiving method and device, charging pile and vehicle terminal
US20180176230A1 (en) Data packet transmission method, apparatus, and system, and node device
CN113542431B (en) Information processing method, information processing device, electronic equipment and storage medium
WO2020140842A1 (en) Data transmission method, device and system
CN115664773A (en) Message processing method, device, storage medium and program product
CN113542156A (en) Message transmission method, device, terminal equipment and storage medium
CN115085949A (en) Data communication method and device based on national secret SSL transparent proxy
CN116738472B (en) Task data encryption method, device and equipment applied to task data interaction
CN117424739B (en) Message forwarding method and system based on DPU, user mode protocol stack and IP core
CN119583375A (en) Virtual private network communication method, device, equipment and readable storage medium
CN114553633B (en) Tunnel negotiation method and device
US20240106647A1 (en) Methods and systems of a packet orchestration to provide data encryption at the ip layer, utilizing a data link layer encryption scheme
CN116319165A (en) VPN flow forwarding method and device for distributed equipment
CN117675354A (en) Secure communication method, system, electronic equipment and computer storage medium
WO2024255483A1 (en) Data transmission method and related apparatus
CN116781248A (en) Encryption method, encryption device and key management system
CN119449438A (en) A transmission mode global quantum security encryption device and data processing method

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