CN105471827A - Message transmission method and device - Google Patents
Message transmission method and device Download PDFInfo
- Publication number
- CN105471827A CN105471827A CN201410449119.7A CN201410449119A CN105471827A CN 105471827 A CN105471827 A CN 105471827A CN 201410449119 A CN201410449119 A CN 201410449119A CN 105471827 A CN105471827 A CN 105471827A
- Authority
- CN
- China
- Prior art keywords
- message
- cpe
- virtual router
- address
- encapsulation
- 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.)
- Granted
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例提供一种报文传输方法及装置,所述方法包括:第一CPE接收第一设备发送的第一报文,第一报文包括:第一源地址、第一目的地址和第一载荷;第一源地址为第一设备的地址,第一目的地址为第二设备的地址,第二设备与第二CPE相通信,第一CPE与第二CPE保存有相同的VPN协商参数,VPN协商参数包括:指定加密算法和共享密钥;第一CPE利用指定加密算法和共享密钥对第一载荷进行加密处理,获得第一加密载荷;第一CPE进行封装处理,获得封装后的报文,封装后的报文包括:第一源地址、第一目的地址、第一封装报头和第一加密载荷;第一CPE将封装后的报文发送至第一VR。如此方案,有助于提高分支网络之间的通信安全性。
Embodiments of the present invention provide a message transmission method and device. The method includes: the first CPE receives the first message sent by the first device, and the first message includes: a first source address, a first destination address, and a first A load; the first source address is the address of the first device, the first destination address is the address of the second device, the second device communicates with the second CPE, the first CPE and the second CPE store the same VPN negotiation parameters, The VPN negotiation parameters include: specifying an encryption algorithm and a shared key; the first CPE uses the specified encryption algorithm and a shared key to encrypt the first payload to obtain the first encrypted payload; the first CPE performs encapsulation processing to obtain the encapsulated packet The encapsulated message includes: a first source address, a first destination address, a first encapsulated header, and a first encrypted payload; the first CPE sends the encapsulated message to the first VR. Such a solution helps to improve communication security between branch networks.
Description
技术领域technical field
本发明涉及通信技术领域,具体涉及一种报文传输方法及装置。The invention relates to the field of communication technology, in particular to a message transmission method and device.
背景技术Background technique
随着虚拟技术的不断发展,虚拟路由技术应运而生,例如,通过虚拟路由技术可以将企业网络侧的一个物理路由器虚拟为多个相互隔离的虚拟路由器(英文:VirtualRouter,简称:VR),并将物理路由器中的三层功能上移到运营商网络侧维护的虚拟路由器中,对应地,企业网络侧只需要保留并维护具有简单交换功能的客户终端设备(英文:CustomerPremiseEquipment,简称:CPE)。在具体应用时,可通过VR与CPE相互配合实现诸如路由转发、虚拟专用网络(英文:VirtualPrivateNetwork,简称:VPN)、深度包检测(英文:DeepPacketInspection,简称:DPI)等业务。With the continuous development of virtual technology, virtual routing technology emerges as the times require. For example, a physical router on the enterprise network side can be virtualized into multiple isolated virtual routers (English: VirtualRouter, VR for short) through virtual routing technology, and The Layer 3 functions in the physical router are moved up to the virtual router maintained by the operator's network side. Correspondingly, the enterprise network side only needs to retain and maintain the customer terminal equipment (English: Customer Premise Equipment, CPE for short) with simple switching functions. In specific applications, services such as routing and forwarding, virtual private network (English: Virtual Private Network, abbreviated: VPN), and deep packet inspection (English: Deep Packet Inspection, abbreviated: DPI) can be realized through the mutual cooperation of VR and CPE.
以VR与CPE相互配合,实现两个企业分支网络之间的VPN业务为例,参见图1所示网络示意图,可体现为:分支网络1中的CPE1与运营商网络中的VR1建立通信,分支网络2中的CPE2与运营商网络中的VR2建立通信,且在VR1与VR2之间建立VPN隧道,如此,就实现了分支网络1与分支网络2之间的VPN业务。Taking VR and CPE to cooperate with each other to implement VPN services between two enterprise branch networks as an example, refer to the network diagram shown in Figure 1, which can be embodied as follows: CPE1 in branch network 1 establishes communication with VR1 in the carrier network, and the branch CPE2 in network 2 establishes communication with VR2 in the carrier network, and establishes a VPN tunnel between VR1 and VR2. In this way, the VPN service between branch network 1 and branch network 2 is realized.
但是,如此实现的VPN业务却存在如下问题:CPE与VR之间的链路无法对报文进行加密保护,致使二者之间的通信存在极大的安全隐患,特别是在VR以广播方式进行下行报文转发时,这一问题就越发凸显出来。However, the VPN service implemented in this way has the following problems: the link between the CPE and the VR cannot encrypt and protect the message, resulting in a great security risk in the communication between the two, especially when the VR is broadcast. This problem becomes more prominent when downlink packets are forwarded.
发明内容Contents of the invention
本发明实施例的报文传输方法及装置,有助于提高分支网络之间的通信安全性。The message transmission method and device of the embodiments of the present invention help to improve communication security between branch networks.
为此,本发明实施例提供如下技术方案:For this reason, the embodiment of the present invention provides following technical scheme:
第一方面,提供了一种报文传输方法,所述方法包括:In a first aspect, a message transmission method is provided, the method comprising:
第一客户终端设备CPE接收第一设备发送的第一报文,所述第一报文包括:第一源地址、第一目的地址和第一载荷;所述第一源地址为所述第一设备的地址,所述第一目的地址为第二设备的地址,所述第一CPE和所述第一设备位于第一分支网络,所述第二设备与第二CPE相通信,且所述第二设备和所述第二CPE位于第二分支网络,所述第一CPE与所述第二CPE保存有相同的虚拟专用网络VPN协商参数,所述VPN协商参数包括:指定加密算法和共享密钥;The first client terminal equipment CPE receives the first packet sent by the first device, and the first packet includes: a first source address, a first destination address, and a first payload; the first source address is the first address of the device, the first destination address is the address of the second device, the first CPE and the first device are located in the first branch network, the second device communicates with the second CPE, and the first The second device and the second CPE are located in the second branch network, and the first CPE and the second CPE store the same virtual private network VPN negotiation parameters, and the VPN negotiation parameters include: a specified encryption algorithm and a shared key ;
所述第一CPE利用所述指定加密算法和所述共享密钥对所述第一载荷进行加密处理,获得第一加密载荷;The first CPE encrypts the first payload by using the specified encryption algorithm and the shared key to obtain a first encrypted payload;
所述第一CPE进行封装处理,获得封装后的报文,所述封装后的报文包括:所述第一源地址、所述第一目的地址、第一封装报头和所述第一加密载荷;The first CPE performs encapsulation processing to obtain an encapsulated message, and the encapsulated message includes: the first source address, the first destination address, a first encapsulation header, and the first encrypted payload ;
所述第一CPE将所述封装后的报文发送至第一虚拟路由器。The first CPE sends the encapsulated packet to the first virtual router.
在第一方面的第一种可能的实现方式中,所述第一CPE获取所述VPN协商参数的方式,包括:In a first possible implementation manner of the first aspect, the manner for the first CPE to obtain the VPN negotiation parameters includes:
所述第一CPE向所述第一虚拟路由器发送所述第一CPE支持的加密算法;The first CPE sends the encryption algorithm supported by the first CPE to the first virtual router;
所述第一CPE接收所述第一虚拟路由器发送的所述VPN协商参数,所述VPN协商参数由所述第一虚拟路由器与第二虚拟路由器协商获得,所述第二虚拟路由器与所述第二CPE相通信,所述第二虚拟路由器能获取所述第二CPE支持的加密算法,所述指定加密算法从所述第一CPE与所述第二CPE共同支持的加密算法中选取。The first CPE receives the VPN negotiation parameter sent by the first virtual router, the VPN negotiation parameter is obtained through negotiation between the first virtual router and a second virtual router, and the second virtual router and the second virtual router The two CPEs communicate with each other, the second virtual router can obtain the encryption algorithm supported by the second CPE, and the specified encryption algorithm is selected from the encryption algorithms supported by both the first CPE and the second CPE.
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述方法还包括:With reference to the first aspect or the first possible implementation manner of the first aspect, in the second possible implementation manner of the first aspect, the method further includes:
所述第一CPE接收所述第一虚拟路由器发送的第二报文,所述第二报文包括:第二源地址、第二目的地址、第二封装报头和第二加密载荷;The first CPE receives the second packet sent by the first virtual router, and the second packet includes: a second source address, a second destination address, a second encapsulation header, and a second encrypted payload;
所述第一CPE进行拆封装处理,获得拆封装后的报文,所述拆封装后的报文包括:所述第二源地址、所述第二目的地址和所述第二加密载荷;The first CPE performs decapsulation processing to obtain a decapsulated message, and the decapsulated message includes: the second source address, the second destination address, and the second encrypted payload;
所述第一CPE对所述拆封装后的报文进行解密处理,获得解密后的报文,所述解密后的报文包括:所述第二源地址、所述第二目的地址和载荷;The first CPE decrypts the decapsulated message to obtain a decrypted message, and the decrypted message includes: the second source address, the second destination address, and a payload;
所述第一CPE将所述解密后的报文发送至所述第二目的地址对应的设备。The first CPE sends the decrypted packet to the device corresponding to the second destination address.
第二方面,提供了一种报文传输方法,所述方法包括:In a second aspect, a message transmission method is provided, the method comprising:
第一虚拟路由器接收第一客户终端设备CPE发送的第一报文,所述第一报文包括:第一源地址、第一目的地址、第一封装报头和第一加密载荷;The first virtual router receives the first message sent by the first customer terminal equipment CPE, the first message includes: a first source address, a first destination address, a first encapsulation header, and a first encrypted payload;
所述第一虚拟路由器查找所述第一目的地址对应的第二虚拟路由器,所述第一虚拟路由器与所述第二虚拟路由器之间建立有第一虚拟专用网络VPN隧道;The first virtual router searches for a second virtual router corresponding to the first destination address, and a first virtual private network (VPN) tunnel is established between the first virtual router and the second virtual router;
所述第一虚拟路由器对所述第一报文进行封装处理,获得封装后的报文,所述封装后的报文包括:所述第一虚拟路由器的公网地址、所述第二虚拟路由器的公网地址、所述第一VPN隧道的封装报头、所述第一源地址、所述第一目的地址、所述第一封装报头和所述第一加密载荷;The first virtual router encapsulates the first message to obtain an encapsulated message, and the encapsulated message includes: the public network address of the first virtual router, the second virtual router public network address, the encapsulation header of the first VPN tunnel, the first source address, the first destination address, the first encapsulation header and the first encrypted payload;
所述第一虚拟路由器将所述封装后的报文发送至所述第二虚拟路由器。The first virtual router sends the encapsulated packet to the second virtual router.
在第二方面的第一种可能的实现方式中,所述方法还包括:In a first possible implementation manner of the second aspect, the method further includes:
所述第一虚拟路由器接收第三虚拟路由器发送的第二报文,所述第一虚拟路由器与所述第三虚拟路由器之间建立有第二VPN隧道,所述第二报文包括:所述第三虚拟路由器的公网地址、所述第一虚拟路由器的公网地址、所述第二VPN隧道的封装报头、第二源地址、第二目的地址、第二封装报头和第二加密载荷;The first virtual router receives a second packet sent by a third virtual router, a second VPN tunnel is established between the first virtual router and the third virtual router, and the second packet includes: the The public network address of the third virtual router, the public network address of the first virtual router, the encapsulation header of the second VPN tunnel, the second source address, the second destination address, the second encapsulation header, and the second encrypted payload;
所述第一虚拟路由器进行拆封装处理,获得拆封装后的报文,所述拆封装后的报文包括:所述第二源地址、所述第二目的地址、所述第二封装报头和所述第二加密载荷;The first virtual router performs decapsulation processing to obtain a decapsulated message, and the decapsulated message includes: the second source address, the second destination address, the second encapsulation header, and the second encrypted payload;
所述第一虚拟路由器将所述拆封装后的报文发送至所述第一CPE。The first virtual router sends the decapsulated packet to the first CPE.
第三方面,提供了一种报文传输装置,所述装置包括:In a third aspect, a message transmission device is provided, and the device includes:
第一接收单元,用于接收第一设备发送的第一报文,所述第一报文包括:第一源地址、第一目的地址和第一载荷;所述第一源地址为所述第一设备的地址,所述第一目的地址为第二设备的地址,所述第一设备与第一客户终端设备CPE相通信,所述第一CPE和所述第一设备位于第一分支网络,所述第二设备与第二CPE相通信,且所述第二设备和所述第二CPE位于第二分支网络,所述第一CPE与所述第二CPE保存有相同的虚拟专用网络VPN协商参数,所述VPN协商参数包括:指定加密算法和共享密钥;The first receiving unit is configured to receive a first packet sent by a first device, where the first packet includes: a first source address, a first destination address, and a first payload; the first source address is the first packet. an address of a device, the first destination address is the address of a second device, the first device communicates with a first customer terminal equipment CPE, and the first CPE and the first device are located in a first branch network, The second device communicates with the second CPE, and the second device and the second CPE are located in a second branch network, and the first CPE and the second CPE maintain the same virtual private network (VPN) negotiation Parameters, the VPN negotiation parameters include: specifying an encryption algorithm and a shared key;
加密处理单元,用于利用所述指定加密算法和所述共享密钥对所述第一载荷进行加密处理,获得第一加密载荷;An encryption processing unit, configured to encrypt the first payload by using the designated encryption algorithm and the shared key to obtain a first encrypted payload;
封装处理单元,用于进行封装处理,获得封装后的报文,所述封装后的报文包括:所述第一源地址、所述第一目的地址、第一封装报头和所述第一加密载荷;An encapsulation processing unit, configured to perform encapsulation processing to obtain an encapsulated message, the encapsulated message including: the first source address, the first destination address, the first encapsulation header, and the first encrypted load;
第一发送单元,用于将所述封装后的报文发送至第一虚拟路由器。The first sending unit is configured to send the encapsulated packet to the first virtual router.
在第三方面的第一种可能的实现方式中,所述装置还包括:In a first possible implementation manner of the third aspect, the device further includes:
第二发送单元,用于向所述第一虚拟路由器发送所述第一CPE支持的加密算法;a second sending unit, configured to send the encryption algorithm supported by the first CPE to the first virtual router;
第二接收单元,用于接收所述第一虚拟路由器发送的所述VPN协商参数,所述VPN协商参数由所述第一虚拟路由器与第二虚拟路由器协商获得,所述第二虚拟路由器与所述第二CPE相通信,所述第二虚拟路由器能获取所述第二CPE支持的加密算法,所述指定加密算法从所述第一CPE与所述第二CPE共同支持的加密算法中选取。The second receiving unit is configured to receive the VPN negotiation parameter sent by the first virtual router, the VPN negotiation parameter is obtained through negotiation between the first virtual router and a second virtual router, and the second virtual router and the The second CPE communicates with each other, the second virtual router can obtain the encryption algorithm supported by the second CPE, and the specified encryption algorithm is selected from the encryption algorithms supported by both the first CPE and the second CPE.
结合第三方面或第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,所述装置还包括:With reference to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the device further includes:
第三接收单元,用于接收所述第一虚拟路由器发送的第二报文,所述第二报文包括:第二源地址、第二目的地址、第二封装报头和第二加密载荷;A third receiving unit, configured to receive a second packet sent by the first virtual router, where the second packet includes: a second source address, a second destination address, a second encapsulation header, and a second encrypted payload;
拆封装处理单元,用于进行拆封装处理,获得拆封装后的报文,所述拆封装后的报文包括:所述第二源地址、所述第二目的地址和所述第二加密载荷;A decapsulation processing unit, configured to perform decapsulation processing to obtain a decapsulated message, where the decapsulated message includes: the second source address, the second destination address, and the second encrypted payload ;
解密处理单元,用于对所述拆封装后的报文进行解密处理,获得解密后的报文,所述解密后的报文包括:所述第二源地址、所述第二目的地址和载荷;A decryption processing unit, configured to decrypt the decapsulated message to obtain a decrypted message, where the decrypted message includes: the second source address, the second destination address, and the payload ;
第三发送单元,用于将所述解密后的报文发送至所述第二目的地址对应的设备。A third sending unit, configured to send the decrypted message to the device corresponding to the second destination address.
第四方面,提供了一种报文传输装置,所述装置包括:In a fourth aspect, a message transmission device is provided, and the device includes:
第一接收单元,用于接收第一客户终端设备CPE发送的第一报文,所述第一报文包括:第一源地址、第一目的地址、第一封装报头和第一加密载荷;The first receiving unit is configured to receive a first message sent by a first client terminal equipment CPE, where the first message includes: a first source address, a first destination address, a first encapsulation header, and a first encrypted payload;
查找单元,用于查找所述第一目的地址对应的第二虚拟路由器,第一虚拟路由器与所述第二虚拟路由器之间建立有第一虚拟专用网络VPN隧道;A search unit, configured to search for a second virtual router corresponding to the first destination address, and a first virtual private network VPN tunnel is established between the first virtual router and the second virtual router;
封装处理单元,用于对所述第一报文进行封装处理,获得封装后的报文,所述封装后的报文包括:所述第一虚拟路由器的公网地址、所述第二虚拟路由器的公网地址、所述第一VPN隧道的封装报头、所述第一源地址、所述第一目的地址、所述第一封装报头和所述第一加密载荷;An encapsulation processing unit, configured to perform encapsulation processing on the first message to obtain an encapsulated message, the encapsulated message including: the public network address of the first virtual router, the second virtual router public network address, the encapsulation header of the first VPN tunnel, the first source address, the first destination address, the first encapsulation header and the first encrypted payload;
第一发送单元,用于将所述封装后的报文发送至所述第二虚拟路由器。A first sending unit, configured to send the encapsulated packet to the second virtual router.
在第四方面的第一种可能的实现方式中,所述装置还包括:In a first possible implementation manner of the fourth aspect, the device further includes:
第二接收单元,用于接收第三虚拟路由器发送的第二报文,所述第一虚拟路由器与所述第三虚拟路由器之间建立有第二VPN隧道,所述第二报文包括:所述第三虚拟路由器的公网地址、所述第一虚拟路由器的公网地址、所述第二VPN隧道的封装报头、第二源地址、第二目的地址、第二封装报头和第二加密载荷;The second receiving unit is configured to receive a second message sent by a third virtual router, a second VPN tunnel is established between the first virtual router and the third virtual router, and the second message includes: the The public network address of the third virtual router, the public network address of the first virtual router, the encapsulation header of the second VPN tunnel, the second source address, the second destination address, the second encapsulation header, and the second encrypted payload ;
拆封装处理单元,用于进行拆封装处理,获得拆封装后的报文,所述拆封装后的报文包括:所述第二源地址、所述第二目的地址、所述第二封装报头和所述第二加密载荷;A decapsulation processing unit, configured to perform decapsulation processing to obtain a decapsulated message, where the decapsulated message includes: the second source address, the second destination address, and the second encapsulated header and said second encrypted payload;
第二发送单元,用于将所述拆封装后的报文发送至所述第一CPE。A second sending unit, configured to send the decapsulated message to the first CPE.
本发明实施例的报文传输方法及装置,在分支网络1与分支网络2之间进行报文传输时,可使分支网络1侧的CPE1与分支网络2侧的CPE2保存相同的VPN协商参数,这样,CPE1与CPE2便可利用相同的VPN协商参数对报文进行加解密处理,有助于提高报文传输的安全性。The message transmission method and device according to the embodiment of the present invention can enable the CPE1 on the branch network 1 side and the CPE2 on the branch network 2 side to store the same VPN negotiation parameters when performing message transmission between the branch network 1 and the branch network 2, In this way, CPE1 and CPE2 can use the same VPN negotiation parameters to encrypt and decrypt packets, which helps to improve the security of packet transmission.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application 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 are only These are some embodiments described in this application, and those skilled in the art can also obtain other drawings based on these drawings.
图1是现有技术实现分支网络1与分支网络2之间VPN业务的示意图;FIG. 1 is a schematic diagram of implementing a VPN service between a branch network 1 and a branch network 2 in the prior art;
图2是本发明实施例CPE侧的报文传输方法实施例1的流程图;FIG. 2 is a flow chart of Embodiment 1 of the message transmission method on the CPE side of the embodiment of the present invention;
图3是本发明实施例中建立CPE1与CPE2之间VPN隧道的流程图;FIG. 3 is a flow chart of establishing a VPN tunnel between CPE1 and CPE2 in an embodiment of the present invention;
图4为本发明实施例CPE侧的报文传输方法实施例2的流程图;4 is a flowchart of Embodiment 2 of the message transmission method on the CPE side of the embodiment of the present invention;
图5为本发明实施例VR侧的报文传输方法实施例1的流程图;5 is a flow chart of Embodiment 1 of the message transmission method on the VR side of the embodiment of the present invention;
图6为本发明实施例VR侧的报文传输方法实施例2的流程图;6 is a flow chart of Embodiment 2 of the message transmission method on the VR side of the embodiment of the present invention;
图7是本发明实施例中报文处理过程的示意图;FIG. 7 is a schematic diagram of a message processing process in an embodiment of the present invention;
图8是本发明实施例CPE侧的报文传输装置实施例1的示意图;FIG. 8 is a schematic diagram of Embodiment 1 of the message transmission device on the CPE side of the embodiment of the present invention;
图9为本发明实施例CPE侧的报文传输装置实施例2的示意图;FIG. 9 is a schematic diagram of Embodiment 2 of the message transmission device on the CPE side of the embodiment of the present invention;
图10为本发明实施例VR侧的报文传输装置实施例1的示意图;FIG. 10 is a schematic diagram of Embodiment 1 of the message transmission device on the VR side of the embodiment of the present invention;
图11是本发明实施例VR侧的报文传输装置实施例2的示意图;FIG. 11 is a schematic diagram of Embodiment 2 of the message transmission device on the VR side of the embodiment of the present invention;
图12是本发明实施例报文传输设备的构成示意图。Fig. 12 is a schematic diagram of the structure of a message transmission device according to an embodiment of the present invention.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和实施方式对本发明实施例作进一步的详细说明。In order to enable those skilled in the art to better understand the solution of the present invention, the embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings and implementation manners.
参见图1所示示意图可知,在分支网络1与分支网络2之间建立VPN业务时,虚拟路由器VR1(与分支网络1中的客户终端设备CPE1相通信)与VR2(与分支网络2中的客户终端设备CPE2相通信)之间,进行VPN协商,在VR1与VR2之间建立VPN隧道。如此,虽可保证VR1与VR2之间的通信安全性,但却无法保证CPE1与VR1、CPE2与VR2之间的通信安全性,致使分支网络之间的通信存在极大的安全隐患。Referring to the schematic diagram shown in FIG. 1, it can be seen that when a VPN service is established between branch network 1 and branch network 2, virtual router VR1 (communicating with customer terminal equipment CPE1 in branch network 1) and VR2 (communicating with customer terminal equipment CPE1 in branch network 2) The terminal equipment CPE2 communicates with each other) to perform VPN negotiation, and establish a VPN tunnel between VR1 and VR2. In this way, although the communication security between VR1 and VR2 can be guaranteed, the communication security between CPE1 and VR1, CPE2 and VR2 cannot be guaranteed, resulting in great security risks in the communication between branch networks.
发明人经不断研究发现,可使CPE1与CPE2保存相同的VPN协商参数,在CPE1与CPE2之间建立VPN隧道,以此保证CPE1与VR1、VR1与VR2、VR2与CPE2之间的通信安全性。After continuous research, the inventor found that CPE1 and CPE2 can save the same VPN negotiation parameters, and establish a VPN tunnel between CPE1 and CPE2, thereby ensuring communication security between CPE1 and VR1, VR1 and VR2, and VR2 and CPE2.
参见图2,示出了本发明实施例CPE侧的报文传输方法实施例1的流程图,可包括如下步骤:Referring to FIG. 2, it shows a flow chart of Embodiment 1 of the message transmission method on the CPE side of the embodiment of the present invention, which may include the following steps:
步骤101,第一客户终端设备CPE接收第一设备发送的第一报文,所述第一报文包括:第一源地址、第一目的地址和第一载荷;所述第一源地址为所述第一设备的地址,所述第一目的地址为第二设备的地址,所述第一CPE和所述第一设备位于第一分支网络,所述第二设备与第二CPE相通信,且所述第二设备和所述第二CPE位于第二分支网络,所述第一CPE与所述第二CPE保存有相同的虚拟专用网络VPN协商参数,所述VPN协商参数包括:指定加密算法和共享密钥。Step 101, the first client terminal equipment CPE receives the first message sent by the first device, the first message includes: a first source address, a first destination address and a first payload; the first source address is the the address of the first device, the first destination address is the address of the second device, the first CPE and the first device are located in the first branch network, the second device communicates with the second CPE, and The second device and the second CPE are located in the second branch network, and the first CPE and the second CPE store the same virtual private network VPN negotiation parameters, and the VPN negotiation parameters include: a specified encryption algorithm and shared secret.
步骤102,所述第一CPE利用所述指定加密算法和所述共享密钥对所述第一载荷进行加密处理,获得第一加密载荷。Step 102, the first CPE encrypts the first payload by using the specified encryption algorithm and the shared key to obtain a first encrypted payload.
步骤103,所述第一CPE进行封装处理,获得封装后的报文,所述封装后的报文包括:所述第一源地址、所述第一目的地址、第一封装报头和所述第一加密载荷。Step 103, the first CPE performs encapsulation processing to obtain an encapsulated message, and the encapsulated message includes: the first source address, the first destination address, the first encapsulation header, and the first An encrypted payload.
步骤104,所述第一CPE将所述封装后的报文发送至第一虚拟路由器VR。Step 104, the first CPE sends the encapsulated message to the first virtual router VR.
第一CPE与第二CPE利用二者共存的VPN协商参数建立VPN隧道后,第一CPE可接收第一分支网络中的第一设备发送的第一报文,并利用本发明实施例提供的方案处理第一报文,提高第一CPE与第一VR之间的通信安全性,使第一报文在第一分支网络和第二分支网络之间安全传输成为可能。具体地,第一CPE可对第一报文进行以下两方面处理:After the first CPE and the second CPE establish a VPN tunnel using the VPN negotiation parameters coexisting between the two, the first CPE can receive the first message sent by the first device in the first branch network, and use the solution provided by the embodiment of the present invention The first message is processed to improve communication security between the first CPE and the first VR, making it possible for the first message to be safely transmitted between the first branch network and the second branch network. Specifically, the first CPE may perform the following two processing on the first packet:
1.加密处理1. Encryption processing
为了提高第一报文在第一分支网络和第二分支网络之间的传输安全性,第一CPE接收到第一报文后,可利用VPN协商参数中的指定加密算法和共享密钥,对第一报文中的第一载荷进行加密处理,得到第一加密载荷。In order to improve the transmission security of the first packet between the first branch network and the second branch network, after receiving the first packet, the first CPE can use the specified encryption algorithm and shared key in the VPN negotiation parameters to The first payload in the first message is encrypted to obtain the first encrypted payload.
第一CPE利用指定加密算法、共享密钥得到第一加密载荷的具体过程,可参照现有的实现方式,此处不进行详述,本发明实施例对此也不做具体限定。需要说明的是,加密处理前的第一报文可包括:第一源地址、第一目的地址和第一载荷,加密处理后的第一报文可包括:第一源地址、第一目的地址和第一加密载荷。其中,第一源地址为第一设备的地址,作为一种示例,可具体体现为第一设备的IP地址;第一目的地址为第二设备的地址,亦可体现为第二设备的IP地址。The specific process for the first CPE to obtain the first encrypted payload by using the specified encryption algorithm and the shared key can refer to the existing implementation manner, which is not described in detail here, and is not specifically limited in the embodiment of the present invention. It should be noted that the first packet before encryption processing may include: the first source address, the first destination address and the first payload, and the first packet after encryption processing may include: the first source address, the first destination address and the first encrypted payload. Wherein, the first source address is the address of the first device, as an example, it can be embodied as the IP address of the first device; the first destination address is the address of the second device, and can also be embodied as the IP address of the second device .
另外,需要说明的是,如果第一CPE保存的VPN协商参数中还包括控制参数,则第一CPE在加密第一载荷之前,还可结合控制参数和第一目的地址,判断是否需要执行加密处理动作。如控制参数表示:经第一CPE去往公网的报文不需要加密,经第一CPE去往第二分支网络的报文需要加密,则第一CPE通过第一目的地址可以明确第一报文要被传输至第二分支网络,得出需要加密处理的判断结果,如此情况下,第一CPE再对第一载荷进行加密处理。In addition, it should be noted that if the VPN negotiation parameters saved by the first CPE also include control parameters, the first CPE may also combine the control parameters and the first destination address to determine whether encryption processing is required before encrypting the first payload. action. For example, if the control parameter indicates: the packets going to the public network through the first CPE do not need to be encrypted, and the packets going to the second branch network through the first CPE need to be encrypted, then the first CPE can specify the first packet through the first destination address. The text is to be transmitted to the second branch network, and it is determined that encryption processing is required. In this case, the first CPE performs encryption processing on the first payload.
2.封装处理2. Package processing
考虑到第一报文传输过程中,跨越公网的传输动作是由第一VR实现的,故第一CPE可采用较为简单的传输模式进行报文封装,如此封装后的报文可包括:第一源地址、第一目的地址、第一封装报头和第一加密载荷。其中,第一封装报头是利用第一载荷计算得到,作为一种示例,第一封装报头可体现为认证头(英文:AuthenticationHeader,简称:AH)或封装安全负载头(英文:EncapsulatedSecurityPayload,简称:ESP),对应的,利用第一载荷计算AH头或ESP头的具体过程,可参照现有的实现方式,此处不进行详述,本发明实施例对此也不做具体限定。Considering that during the transmission of the first packet, the transmission action across the public network is implemented by the first VR, so the first CPE can use a relatively simple transmission mode for packet encapsulation, so that the encapsulated packet can include: A source address, a first destination address, a first encapsulation header and a first encrypted payload. Wherein, the first encapsulation header is calculated by using the first payload. As an example, the first encapsulation header may be embodied as an authentication header (English: AuthenticationHeader, abbreviated: AH) or an encapsulated security payload header (English: EncapsulatedSecurityPayload, abbreviated: ESP ), correspondingly, the specific process of using the first payload to calculate the AH header or ESP header can refer to the existing implementation manner, which is not described in detail here, and is not specifically limited in the embodiment of the present invention.
完成上述两个处理动作后,第一CPE即可将封装后的报文发送至第一VR,由第一VR进一步处理后,跨越公网传输至第二VR,进而再由第二VR转发至第二CPE,实现第一分支网络到第二分支网络方向的报文传输。基于上述方案形成的封装后的报文,除非知晓第一CPE采用的封装方式、加密方式,才有可能从中解析得到第一载荷,如此就提高了第一CPE与第一VR之间的通信安全性。After completing the above two processing actions, the first CPE can send the encapsulated message to the first VR, and after further processing by the first VR, it will be transmitted across the public network to the second VR, and then forwarded by the second VR to the The second CPE implements packet transmission from the first branch network to the second branch network. Based on the packaged message formed by the above scheme, unless the encapsulation method and encryption method adopted by the first CPE are known, it is possible to parse the first payload from it, which improves the communication security between the first CPE and the first VR. sex.
需要说明的是,在第二分支网络作为发送方、第一分支网络作为接收方的场景下,第二分支网络中的第二CPE亦可按照上文介绍的过程,对发往第一分支网络的报文进行加密封装处理。另,第一分支网络和第二分支网络可以属于同一企业网络,也可属于不同企业网络,本发明实施例对此可不做具体限定。It should be noted that, in the scenario where the second branch network is the sender and the first branch network is the receiver, the second CPE in the second branch network can also follow the process described above to The packets are encrypted and encapsulated. In addition, the first branch network and the second branch network may belong to the same enterprise network, or may belong to different enterprise networks, which is not specifically limited in this embodiment of the present invention.
可选地,本发明实施例提供了一种在第一CPE与第二CPE之间建立VPN隧道的优选方案,参见图3,可包括:Optionally, this embodiment of the present invention provides a preferred solution for establishing a VPN tunnel between the first CPE and the second CPE, referring to FIG. 3 , which may include:
步骤201,第一CPE与第一VR通信,将第一CPE支持的加密算法发送至第一VR;同样地,第二CPE也可与第二VR通信,将第二CPE支持的加密算法发送至第二VR。Step 201, the first CPE communicates with the first VR, and sends the encryption algorithm supported by the first CPE to the first VR; similarly, the second CPE can also communicate with the second VR, and sends the encryption algorithm supported by the second CPE to the Second VR.
步骤202,第一VR与第二VR之间进行VPN协商,获得VPN协商参数。具体地,VPN协商参数可包括:指定加密算法、共享密钥、控制参数、等等。In step 202, VPN negotiation is performed between the first VR and the second VR to obtain VPN negotiation parameters. Specifically, the VPN negotiation parameters may include: specifying an encryption algorithm, a shared key, control parameters, and so on.
其中,指定加密算法是从第一CPE与第二CPE共同支持的加密算法中选取出的,主要用于对隧道中传输的报文进行加解密处理。共享密钥是由第一VR、第二VR分别计算获得,可与指定加密算法相配合,对隧道中传输的报文进行加解密处理,需要说明的是,应保证第一VR、第二VR分别计算得到的共享密钥的一致性。控制参数用于识别经CPE传输的报文是否需要进行加密处理,例如,控制参数可为:经CPE传输至公网的报文无需进行加密处理,经CPE传输至隧道对端的报文则需要进行加密处理。Wherein, the designated encryption algorithm is selected from the encryption algorithms jointly supported by the first CPE and the second CPE, and is mainly used for encrypting and decrypting the packets transmitted in the tunnel. The shared key is calculated by the first VR and the second VR respectively, and can cooperate with the specified encryption algorithm to encrypt and decrypt the packets transmitted in the tunnel. It should be noted that the first VR and the second VR should be ensured Consistency of the shared keys calculated separately. The control parameters are used to identify whether the packets transmitted through the CPE need to be encrypted. For example, the control parameters can be: packets transmitted through the CPE to the public network do not need to be encrypted, and packets transmitted through the CPE to the peer end of the tunnel need to be encrypted. Encryption processing.
作为一种示例,第一VR与第二VR之间可通过Internet密钥交换(英文:InternetKeyExchange,简称:IKE)协议进行VPN协商,得到VPN协商参数,本发明实施例对协商协议可不做具体限定。As an example, VPN negotiation can be performed between the first VR and the second VR through the Internet Key Exchange (English: InternetKeyExchange, IKE for short) protocol to obtain VPN negotiation parameters. The embodiment of the present invention does not specifically limit the negotiation protocol .
步骤203,第一VR将VPN协商参数发送至第一CPE,同样地,第二VR可将VPN协商参数发送至第二CPE,如此,第一CPE与第二CPE就可利用相同的VPN协商参数建立VPN隧道。Step 203, the first VR sends the VPN negotiation parameters to the first CPE, similarly, the second VR can send the VPN negotiation parameters to the second CPE, so that the first CPE and the second CPE can use the same VPN negotiation parameters Establish a VPN tunnel.
步骤204,考虑到第一CPE与第二CPE进行通信时,需要跨越公网进行报文传输,为了隐藏分支网络之间通信的私网地址,还可在第一VR与第二VR之间建立VPN公网隧道。具体地,VPN公网隧道可体现为通用路由封装(英文:GenericRoutingEncapsulation,简称:GRE)隧道、多协议标签交换(英文:Multi-ProtocolLabelSwitching,简称:MPLS)隧道、互联网安全协定(英文:InternetProtocolSecurity,简称:IPSec)隧道、等等,本发明实施例对VPN公网隧道的类型可不做具体限定。需要说明的是,建立VPN公网隧道的步骤,可如图3所示示例在步骤203之后执行,或者,还可在步骤202获得VPN协商参数之后即执行,再者,还可在第一CPE与第二CPE进行报文传输之前执行,本发明实施例对此亦不做具体限定。Step 204, considering that when the first CPE communicates with the second CPE, the message needs to be transmitted across the public network, in order to hide the private network address of the communication between the branch networks, an IP address can also be established between the first VR and the second VR. VPN public network tunnel. Specifically, VPN public network tunnels can be embodied as Generic Routing Encapsulation (English: Generic Routing Encapsulation, GRE for short) tunnels, Multi-Protocol Label Switching (English: Multi-Protocol Label Switching, short: MPLS) tunnels, Internet Security Protocol (English: Internet Protocol Security, short for : IPSec) tunnel, etc., the embodiment of the present invention may not specifically limit the type of the VPN public network tunnel. It should be noted that the step of establishing a VPN public network tunnel can be performed after step 203 as shown in Figure 3, or it can also be performed after the VPN negotiation parameters are obtained in step 202. It is executed before message transmission with the second CPE, which is not specifically limited in this embodiment of the present invention.
经上述步骤之后,第一CPE与第二CPE就保存了相同的VPN协商参数,二者可基于此建立VPN隧道,使分支网络1、2之间报文的安全传输成为可能。After the above steps, the first CPE and the second CPE have saved the same VPN negotiation parameters, based on which they can establish a VPN tunnel, making it possible to securely transmit messages between branch networks 1 and 2.
需要说明的是,作为一种优选方案,参见图3所示,在步骤201之前,还可包括步骤200,第一CPE使用公开密钥密码算法生成公私钥对,并将其中的公钥1发送至第一VR;同样地,第二CPE亦可生成公私钥对并将公钥2发送至第二VR。对应于此,在步骤203之前,还可包括步骤205,第一VR利用公钥1对VPN协商参数进行加密处理;同样地,第二VR也可利用公钥2对VPN协商参数进行加密处理,如此,步骤203中第一VR发送至第一CPE的即为加密后的VPN协商参数,第二VR发送至第二CPE的亦为加密后的VPN协商参数。针对于此,第一CPE可通过公钥1对应的私钥1解密获得VPN协商参数,第二CPE可通过公钥2对应的私钥2解密获得VPN协商参数,提高协商参数的传输安全性。It should be noted that, as a preferred solution, as shown in FIG. 3, before step 201, step 200 may also be included, in which the first CPE generates a public-private key pair using a public-key cryptographic algorithm, and sends the public key 1 therein to to the first VR; similarly, the second CPE can also generate a public-private key pair and send the public key 2 to the second VR. Correspondingly, before step 203, step 205 may also be included, where the first VR uses public key 1 to encrypt the VPN negotiation parameters; similarly, the second VR may also use public key 2 to encrypt the VPN negotiation parameters, In this way, in step 203, what the first VR sends to the first CPE is the encrypted VPN negotiation parameter, and what the second VR sends to the second CPE is also the encrypted VPN negotiation parameter. For this, the first CPE can decrypt the private key 1 corresponding to the public key 1 to obtain the VPN negotiation parameters, and the second CPE can decrypt the private key 2 corresponding to the public key 2 to obtain the VPN negotiation parameters, thereby improving the transmission security of the negotiation parameters.
另外,需要说明的是,基于图3所示优选方案进行报文传输时,VPN协商参数是由第一VR发送至第一CPE,也即,第一CPE无需具备VPN协商能力,只要具备加密封装处理能力即可,如此将协商、加密封装相分离的方案,既可简化CPE设计,又可避免协商协议更替、升级等原因导致的CPE维护难、成本高等问题。另外,这种经由第一VR与第二VR进行一次协商即建立起第一CPE与第二CPE之间VPN隧道的方式,还可有效降低隧道建立过程中对第一VR、第二VR、第一CPE、第二CPE的资源消耗。In addition, it should be noted that when the packet is transmitted based on the preferred scheme shown in Figure 3, the VPN negotiation parameters are sent from the first VR to the first CPE, that is, the first CPE does not need to have the VPN negotiation capability, as long as it has encryption encapsulation The processing capability is enough, so the scheme of separating negotiation and encryption encapsulation can not only simplify the CPE design, but also avoid the problems of difficult maintenance and high cost of CPE caused by negotiation protocol replacement and upgrade. In addition, this method of establishing a VPN tunnel between the first CPE and the second CPE through one negotiation between the first VR and the second VR can also effectively reduce the burden on the first VR, the second VR, and the second CPE during the tunnel establishment process. Resource consumption of the first CPE and the second CPE.
上文图2所示示例中,介绍的是第一分支网络作为发送方时第一CPE的报文传输方案,下面再对第一分支网络作为接收方时第一CPE的报文传输方案进行解释说明,具体可参见图4,示出了本发明实施例CPE侧的报文传输方法实施例2的流程图,可包括如下步骤:In the example shown in Figure 2 above, the message transmission scheme of the first CPE when the first branch network is the sender is introduced, and the message transmission scheme of the first CPE when the first branch network is the receiver is explained below For illustration, refer to FIG. 4 for details, which shows a flow chart of Embodiment 2 of the message transmission method on the CPE side of the embodiment of the present invention, which may include the following steps:
步骤301,所述第一CPE接收所述第一虚拟路由器发送的第二报文,所述第二报文包括:第二源地址、第二目的地址、第二封装报头和第二加密载荷。Step 301, the first CPE receives a second packet sent by the first virtual router, and the second packet includes: a second source address, a second destination address, a second encapsulation header, and a second encrypted payload.
步骤302,所述第一CPE进行拆封装处理,获得拆封装后的报文,所述拆封装后的报文包括:所述第二源地址、所述第二目的地址和所述第二加密载荷。Step 302, the first CPE performs decapsulation processing to obtain the decapsulated message, the decapsulated message includes: the second source address, the second destination address and the second encrypted load.
步骤303,所述第一CPE对所述拆封装后的报文进行解密处理,获得解密后的报文,所述解密后的报文包括:所述第二源地址、所述第二目的地址和载荷。Step 303, the first CPE decrypts the decapsulated message to obtain a decrypted message, and the decrypted message includes: the second source address, the second destination address and load.
步骤304,所述第一CPE将所述解密后的报文发送至所述第二目的地址对应的设备。Step 304, the first CPE sends the decrypted packet to the device corresponding to the second destination address.
第一分支网络作为接收方时,第一CPE可接收第一VR发送的第二报文,并利用本发明实施例提供的方案处理第二报文,提高第一VR与第一CPE之间的通信安全性。具体地,第一CPE可对第一报文进行以下两方面处理:When the first branch network is the receiver, the first CPE can receive the second packet sent by the first VR, and use the solution provided by the embodiment of the present invention to process the second packet to improve the communication between the first VR and the first CPE. communication security. Specifically, the first CPE may perform the following two processing on the first message:
1.拆封装处理1. Unpacking process
第一CPE接收到第二报文后,可先对第二报文进行拆封装处理,获得其中的第二加密载荷,进而再对第二加密载荷进行解密处理,还原出第二分支网络发送来的第二载荷。After the first CPE receives the second message, it can first decapsulate the second message to obtain the second encrypted payload, and then decrypt the second encrypted payload to restore the information sent by the second branch network. the second load.
第一CPE拆封装处理的过程,可参照现有的实现方式,此处不进行详述,本发明实施例对此也不做具体限定。需要说明的是,拆封装处理之前的第二报文可包括:第二源地址、第二目的地址、第二封装报头和第二加密载荷,拆封装处理后的第二报文可包括:第二源地址、第二目的地址和第二加密载荷。其中,第二源地址为第二分支网络中的设备的地址,第二目的地址为第一分支网络中的设备的地址,根据具体应用场景的不同,第二源地址和第二目的地址所标识的设备也会有所不同。例如,第二报文是图2所示示例中第一报文对应的响应报文,对应这种场景,第二源地址即为上文第二设备的地址,第二目的地址即为上文第一设备的地址。For the process of unpacking the first CPE, reference may be made to existing implementations, which will not be described in detail here, nor specifically limited in this embodiment of the present invention. It should be noted that the second message before decapsulation processing may include: a second source address, a second destination address, a second encapsulation header and a second encrypted payload, and the second message after decapsulation processing may include: Two source addresses, a second destination address and a second encrypted payload. Wherein, the second source address is the address of the device in the second branch network, and the second destination address is the address of the device in the first branch network. According to different specific application scenarios, the second source address and the second destination address identify equipment will also vary. For example, the second message is the response message corresponding to the first message in the example shown in Figure 2. Corresponding to this scenario, the second source address is the address of the second device above, and the second destination address is the above The address of the first device.
2.解密处理2. Decryption processing
因为第二加密载荷是第二CPE利用预存的VPN协商参数加密得到,而第一CPE与第二CPE保存有相同的VPN协商参数,故第一CPE可对第二加密载荷进行解密处理,获得第二载荷。Because the second encrypted payload is encrypted by the second CPE using pre-stored VPN negotiation parameters, and the first CPE and the second CPE store the same VPN negotiation parameters, the first CPE can decrypt the second encrypted payload to obtain the second encrypted payload. Two loads.
完成上述两个处理动作后,第一CPE即可将还原出的第二载荷发送至第二目的地址标识的设备,实现第二分支网络到第一分支网络方向的报文传输。且基于本发明实施例方案,即使在第一VR以广播方式进行下行报文传输时,因为其它分支网络的CPE不知晓第二CPE使用的VPN协商参数,故不能正确解密还原出第二载荷,提高了第一VR与第一CPE之间的通信安全性。After the above two processing actions are completed, the first CPE can send the restored second payload to the device identified by the second destination address, so as to realize message transmission from the second branch network to the first branch network. And based on the solution of the embodiment of the present invention, even when the first VR transmits downlink packets in broadcast mode, because the CPEs of other branch networks do not know the VPN negotiation parameters used by the second CPE, they cannot correctly decrypt and restore the second payload. The communication security between the first VR and the first CPE is improved.
需要说明的是,上文仅是以第二分支网络作为发送方为例,介绍第一CPE的报文处理过程,除此之外,本示例中的第二报文还可能是由其它分支网络发送至第一分支网络,即,第一CPE还与其它分支网络的CPE之间建立VPN隧道,例如,第一CPE还与第三分支网络中的第三CPE之间建立VPN隧道。对应这种场景,本示例中的第二报文则是由第三CPE发送至第一CPE,第二源地址为第三分支网络中的设备的地址,第一CPE采用与第三CPE共同保存的VPN协商参数进行解密处理,具体过程可参照上文所做介绍,此处不再赘述。It should be noted that the above only uses the second branch network as the sender as an example to introduce the message processing process of the first CPE. In addition, the second message in this example may also be transmitted by other branch networks. It is sent to the first branch network, that is, the first CPE also establishes a VPN tunnel with CPEs in other branch networks, for example, the first CPE also establishes a VPN tunnel with a third CPE in the third branch network. Corresponding to this scenario, the second packet in this example is sent from the third CPE to the first CPE, the second source address is the address of the device in the third branch network, and the first CPE uses the The VPN negotiation parameters are decrypted. The specific process can refer to the introduction above, and will not be repeated here.
上文结合图2、4所示示意图,对CPE在报文传输过程中的处理过程进行了解释说明,下面再从VR角度出发,对VR的处理过程进行解释说明。Combining with the schematic diagrams shown in Figures 2 and 4 above, the processing process of the CPE in the message transmission process is explained. Next, the VR processing process is explained from the perspective of VR.
参见图5,示出了本发明实施例VR侧的报文传输方法实施例1的流程图,可包括如下步骤:Referring to FIG. 5, it shows a flow chart of Embodiment 1 of the message transmission method on the VR side of the embodiment of the present invention, which may include the following steps:
步骤401,第一虚拟路由器接收第一客户终端设备CPE发送的第一报文,所述第一报文包括:第一源地址、第一目的地址、第一封装报头和第一加密载荷。Step 401, the first virtual router receives a first packet sent by a first customer terminal equipment CPE, the first packet includes: a first source address, a first destination address, a first encapsulation header and a first encrypted payload.
步骤402,所述第一虚拟路由器查找所述第一目的地址对应的第二虚拟路由器,所述第一虚拟路由器与所述第二虚拟路由器之间建立有第一虚拟专用网络VPN隧道。Step 402, the first virtual router searches for a second virtual router corresponding to the first destination address, and a first virtual private network (VPN) tunnel is established between the first virtual router and the second virtual router.
步骤403,所述第一虚拟路由器对所述第一报文进行封装处理,获得封装后的报文,所述封装后的报文包括:所述第一虚拟路由器的公网地址、所述第二虚拟路由器的公网地址、所述第一VPN隧道的封装报头、所述第一源地址、所述第一目的地址、所述第一封装报头和所述第一加密载荷。Step 403, the first virtual router encapsulates the first packet to obtain an encapsulated packet, and the encapsulated packet includes: the public network address of the first virtual router, the second Two, the public network address of the virtual router, the encapsulation header of the first VPN tunnel, the first source address, the first destination address, the first encapsulation header, and the first encrypted payload.
步骤404,所述第一虚拟路由器将所述封装后的报文发送至所述第二虚拟路由器。Step 404, the first virtual router sends the encapsulated message to the second virtual router.
除上文图3所做介绍,第一VR可接收第一CPE发送的第一CPE支持的加密算法,并与第二VR协商获得VPN协商参数之外,第一VR还可在接收到第一CPE发送的第一报文(若对应图2所示示例,此处的第一报文即为步骤104中的封装后的报文)后,执行以下两个处理动作:In addition to the introduction in Figure 3 above, the first VR can receive the encryption algorithm supported by the first CPE sent by the first CPE, and negotiate with the second VR to obtain VPN negotiation parameters. After the first message sent by the CPE (if corresponding to the example shown in Figure 2, the first message here is the encapsulated message in step 104), the following two processing actions are performed:
1.查找第二VR1. Find the second VR
为了对公网隐藏企业网络的私网地址,可在第一VR与第二VR之间建立第一VPN隧道,且考虑到第一VR可能会与不同VR建立有不同隧道,故,第一VR在接收到第一CPE发送的第一报文后,可先根据第一目的地址查找第二VR,明确出报文转发对象,进而在封装处理后,将得到封装后的报文通过第一VPN隧道传输至第二VR。In order to hide the private network address of the enterprise network from the public network, a first VPN tunnel can be established between the first VR and the second VR, and considering that the first VR may establish different tunnels with different VRs, the first VR After receiving the first packet sent by the first CPE, the second VR can be searched according to the first destination address to determine the packet forwarding object, and then after the encapsulation process, the encapsulated packet can be passed through the first VPN Tunneled to the second VR.
2.封装处理2. Package processing
在跨越公网进行报文传输时,可将第一VR视为公网传输的源节点、第二VR视为公网传输的目的节点,故封装后的报文中可包括第一VR的公网地址和第二VR的公网地址,作为一种示例,公网地址可具体体现为VR的IP地址。When transmitting packets across the public network, the first VR can be regarded as the source node of public network transmission, and the second VR can be regarded as the destination node of public network transmission, so the encapsulated packet can include the public The network address and the public network address of the second VR. As an example, the public network address may be embodied as the IP address of the VR.
另外,如上文图3处所做介绍,第一VPN隧道可以体现为GRE隧道、MPLS隧道、IPSec隧道等类型,对应不同隧道类型,第一VR封装得到的第一VPN隧道的封装报头亦有所不同,可对应体现为GRE头、MPLS头、IPSec头等,具体封装过程可参见现有实现方式,此处不作详述,本发明实施例对此也不做具体限定。作为一种优选方案,为了降低封装处理对第一VR的资源消耗,第一VR与第二VR之间可优选建立GRE隧道。In addition, as introduced in Figure 3 above, the first VPN tunnel can be embodied as GRE tunnel, MPLS tunnel, IPSec tunnel and other types, corresponding to different tunnel types, the encapsulation header of the first VPN tunnel obtained by the first VR encapsulation also has different Different, it can be embodied as GRE header, MPLS header, IPSec header, etc. For the specific encapsulation process, please refer to the existing implementation mode, which will not be described in detail here, nor specifically limited in the embodiment of the present invention. As a preferred solution, in order to reduce resource consumption of the first VR by encapsulation processing, a GRE tunnel may preferably be established between the first VR and the second VR.
需要说明的是,在具体实现时,第一VR可按照图5所示方案,先查找第二VR再进行封装处理,或者,还可先进行封装处理再查找第二VR,再者,还可同时执行上述两个动作,本发明实施例对此可不做具体限定。It should be noted that, in actual implementation, the first VR may first search for the second VR and then perform encapsulation processing according to the solution shown in FIG. The above two actions are performed at the same time, which is not specifically limited in this embodiment of the present invention.
另外,需要说明的是,在第二分支网络作为发送方、第一分支网络作为接收方的场景下,与第二分支网络通信的第二VR亦可按照上文介绍的过程,对发往第一分支网络的报文进行封装处理。In addition, it should be noted that, in the scenario where the second branch network is the sender and the first branch network is the receiver, the second VR communicating with the second branch network can also follow the process described above to send messages to the first branch network. Packets of a branch network are encapsulated.
上文图5所示示例中,介绍的是第一分支网络作为发送方时第一VR的报文传输方案,下面再对第一分支网络作为接收方时第一VR的报文传输方案进行解释说明,具体可参见图6,示出了本发明实施例VR侧的报文传输方法实施例2的流程图,可包括如下步骤:In the example shown in Figure 5 above, the message transmission scheme of the first VR when the first branch network is used as the sender is introduced, and the message transmission scheme of the first VR when the first branch network is used as the receiver is explained below For illustration, refer to FIG. 6 for details, which shows a flow chart of Embodiment 2 of the message transmission method on the VR side of the embodiment of the present invention, which may include the following steps:
步骤501,所述第一虚拟路由器接收第三虚拟路由器发送的第二报文,所述第一虚拟路由器与所述第三虚拟路由器之间建立有第二VPN隧道,所述第二报文包括:所述第三虚拟路由器的公网地址、所述第一虚拟路由器的公网地址、所述第二VPN隧道的封装报头、第二源地址、第二目的地址、第二封装报头和第二加密载荷。Step 501, the first virtual router receives a second packet sent by a third virtual router, a second VPN tunnel is established between the first virtual router and the third virtual router, and the second packet includes : the public network address of the third virtual router, the public network address of the first virtual router, the encapsulation header of the second VPN tunnel, the second source address, the second destination address, the second encapsulation header, and the second Encrypted payload.
步骤502,所述第一虚拟路由器进行拆封装处理,获得拆封装后的报文,所述拆封装后的报文包括:所述第二源地址、所述第二目的地址、所述第二封装报头和所述第二加密载荷。Step 502, the first virtual router performs decapsulation processing to obtain the decapsulated message, and the decapsulated message includes: the second source address, the second destination address, the second Encapsulating a header and the second encrypted payload.
步骤503,所述第一虚拟路由器将所述拆封装后的报文发送至所述第一CPE。Step 503, the first virtual router sends the decapsulated packet to the first CPE.
第一分支网络作为接收方时,第一VR可接收第三VR发送的第二报文,并利用本发明实施例提供的方案对第二报文进行拆封装处理,去掉跨越公网传输时使用的公网地址和封装报头,还原出企业网络的私网地址,如此,第一VR将拆封装后的报文发送至第一CPE后,第一CPE即可根据第二源地址将报文转发至对应的设备。本示例方案,基于第二VPN隧道就可实现报文在第三VR与第一VR之间的安全传输,且传输过程中不会将企业网络的私网地址暴露在公网中,可提高第三VR与第一VR之间的通信安全性。When the first branch network is the receiver, the first VR can receive the second packet sent by the third VR, and use the solution provided by the embodiment of the present invention to decapsulate the second packet, and remove the The public network address and the encapsulation header are used to restore the private network address of the enterprise network. In this way, after the first VR sends the decapsulated packet to the first CPE, the first CPE can forward the packet according to the second source address to the corresponding device. In this example solution, the secure transmission of packets between the third VR and the first VR can be realized based on the second VPN tunnel, and the private network address of the enterprise network will not be exposed to the public network during the transmission process, which can improve the security of the second VR. Communication security between the third VR and the first VR.
需要说明的是,在不同应用场景中,第三VR也会有所不同,下面对此进行举例说明。例如,第三VR可以是图5所示示例中的第二VR,对应于此,第二VPN隧道即为图5所示示例中的第一VPN隧道,第二源地址为第二分支网络中的设备的地址。或者,第三VR还可以是除图5所示示例中的第一VR、第二VR之外的其它VR,即,第一VR还与其它VR之间建立有隧道,对应于此,第二VPN隧道为第一VR与该其它VR之间的隧道,第二源地址为与该其它VR相通信的分支网络中的设备的地址。另外,需要说明的是,步骤502中,第一VR可结合其与第二VR、其它VR所建隧道的类型,对第二报文进行拆封装处理。It should be noted that in different application scenarios, the third VR will be different, and an example will be given below. For example, the third VR may be the second VR in the example shown in Figure 5, and correspondingly, the second VPN tunnel is the first VPN tunnel in the example shown in Figure 5, and the second source address is the The address of the device. Alternatively, the third VR may also be other VRs than the first VR and the second VR in the example shown in FIG. The VPN tunnel is a tunnel between the first VR and the other VR, and the second source address is the address of the device in the branch network communicating with the other VR. In addition, it should be noted that in step 502, the first VR may decapsulate the second packet in combination with the type of tunnel established between it and the second VR and other VRs.
下面以第一分支网络向第二分支网络发送报文为例,结合图7所示示意图,对本发明实施例中的处理过程进行解释说明。Taking the sending of a message from the first branch network to the second branch network as an example, the processing process in the embodiment of the present invention will be explained in combination with the schematic diagram shown in FIG. 7 .
1.按照图3所示方案建立CPE1与CPE2之间的IPSecVPN隧道后,若分支网络1中的终端PC1有向分支网络2中的PC2传输报文的需求时,PC1可先将报文发送至分支网络1中的CPE1,由CPE1对报文进行处理,以提高报文传输安全性。此时,报文可包括:源IP地址(PC1的IP地址)、目的IP地址(PC2的IP地址)、载荷。1. After establishing the IPSecVPN tunnel between CPE1 and CPE2 according to the scheme shown in Figure 3, if terminal PC1 in branch network 1 needs to transmit a message to PC2 in branch network 2, PC1 can first send the message to CPE1 in branch network 1 processes packets to improve packet transmission security. At this time, the packet may include: a source IP address (the IP address of PC1), a destination IP address (the IP address of PC2), and a payload.
2.CPE1接收到PC1发送的报文后,判定该报文要跨越公网传输至PC2,故利用VR1预先发送的指定加密算法和共享密钥对载荷进行加密处理,同时采用传输模式重新封装报文,并将加密封装后的报文发送至VR1。此时,报文可包括:源IP地址、目的IP地址、IPSec头、加密载荷。2. After receiving the packet sent by PC1, CPE1 determines that the packet will be transmitted across the public network to PC2, so it encrypts the payload with the specified encryption algorithm and shared key sent by VR1 in advance, and repackages the packet in transmission mode. and send the encrypted and encapsulated message to VR1. At this time, the message may include: a source IP address, a destination IP address, an IPSec header, and an encrypted payload.
3.VR1接收到CPE1发送的报文后,判定该报文要跨越公网传输至PC2,故查找与第二分支网络相通信的VR2,并明确VR1与VR2之间的隧道类型,如隧道类型为GRE隧道,VR1则对报文进行GRE封装,并将封装后的报文发送至VR2。此时,报文可包括:VR1IP(公网传输的源地址)、VR2IP(公网传输的目的地址)、GRE头、源IP地址、目的IP地址、IPSec头、加密载荷。3. After VR1 receives the message sent by CPE1, it determines that the message will be transmitted across the public network to PC2, so it searches for VR2 that communicates with the second branch network, and specifies the tunnel type between VR1 and VR2, such as the tunnel type It is a GRE tunnel. VR1 encapsulates packets with GRE and sends the encapsulated packets to VR2. At this time, the message may include: VR1IP (source address for public network transmission), VR2IP (destination address for public network transmission), GRE header, source IP address, destination IP address, IPSec header, and encrypted payload.
4.VR2接收到VR1发送的报文后,根据二者之间建立的隧道类型,对报文进行拆封装处理,剥离掉公网传输地址和GRE头,还原为私网传输地址,并将拆封装后的报文发送至CPE2。此时,报文可包括:源IP地址、目的IP地址、IPSec头、加密载荷。4. After VR2 receives the packet sent by VR1, it decapsulates the packet according to the tunnel type established between the two, strips off the public network transmission address and GRE header, restores it to the private network transmission address, and decapsulates the packet. The encapsulated packet is sent to CPE2. At this time, the message may include: a source IP address, a destination IP address, an IPSec header, and an encrypted payload.
5.CPE2接收到VR2发送的报文后,对报文进行拆封装处理,剥离掉IPSec头,并利用VR2预先发送的指定加密算法和共享密钥对加密载荷进行解密处理,还原出原始的报文发送至PC2。此时,报文可包括:源IP地址、目的IP地址、载荷。5. After receiving the packet sent by VR2, CPE2 decapsulates the packet, strips off the IPSec header, and uses the specified encryption algorithm and shared key sent by VR2 to decrypt the encrypted payload to restore the original packet. The file is sent to PC2. At this time, the packet may include: a source IP address, a destination IP address, and a payload.
如此方案,以VR1与VR2进行VPN协商建立CPE1与CPE2之间的VPN隧道为技术基础,提高分支网络1与分支网络2之间的通信安全性。CPE1、CPE2分别保存VR1、VR2发送的相同VPN协商参数,且无需参与到VPN协商过程中,简化了CPE的设计。在进行报文传输时,CPE1利用VPN协商参数对报文进行加密封装处理,然后再传输至VR1,提高了CPE1与VR1之间的通信安全性;VR1与VR2之间则可通过GRE封装隐藏私网传输地址,并通过GRE隧道进行报文传输,提高了VR1与VR2之间的通信安全性;VR2传输至CPE2的报文是经CPE1处理过的,且只有CPE2才可利用相同的VPN协商参数从报文中解析出载荷,提高了VR2与CPE2之间的通信安全性。Such a solution is based on the VPN negotiation between VR1 and VR2 to establish a VPN tunnel between CPE1 and CPE2 to improve the communication security between branch network 1 and branch network 2 . CPE1 and CPE2 store the same VPN negotiation parameters sent by VR1 and VR2 respectively, and do not need to participate in the VPN negotiation process, which simplifies the design of the CPEs. When transmitting packets, CPE1 uses VPN negotiation parameters to encrypt and encapsulate the packets, and then transmits them to VR1, which improves the communication security between CPE1 and VR1; between VR1 and VR2, GRE encapsulation can be used to hide private network transmission address, and transmit packets through the GRE tunnel, which improves the communication security between VR1 and VR2; the packets transmitted from VR2 to CPE2 are processed by CPE1, and only CPE2 can use the same VPN negotiation parameters The payload is parsed from the message, which improves the communication security between VR2 and CPE2.
与图2所示方法相对应地,本发明实施例还提供了一种CPE侧的报文传输装置,参见图8所示装置实施例1的示意图,所述装置可包括:Corresponding to the method shown in FIG. 2, the embodiment of the present invention also provides a message transmission device on the CPE side. Referring to the schematic diagram of the device embodiment 1 shown in FIG. 8, the device may include:
第一接收单元601,用于接收第一设备发送的第一报文,所述第一报文包括:第一源地址、第一目的地址和第一载荷;所述第一源地址为所述第一设备的地址,所述第一目的地址为第二设备的地址,所述第一设备与第一客户终端设备CPE相通信,所述第一CPE和所述第一设备位于第一分支网络,所述第二设备与第二CPE相通信,且所述第二设备和所述第二CPE位于第二分支网络,所述第一CPE与所述第二CPE保存有相同的虚拟专用网络VPN协商参数,所述VPN协商参数包括:指定加密算法和共享密钥;The first receiving unit 601 is configured to receive the first message sent by the first device, the first message includes: a first source address, a first destination address, and a first payload; the first source address is the The address of the first device, the first destination address is the address of the second device, the first device communicates with the first customer terminal equipment CPE, and the first CPE and the first device are located in the first branch network , the second device communicates with the second CPE, and the second device and the second CPE are located in a second branch network, and the first CPE and the second CPE maintain the same virtual private network (VPN) Negotiation parameters, the VPN negotiation parameters include: specifying an encryption algorithm and a shared key;
加密处理单元602,用于利用所述指定加密算法和所述共享密钥对所述第一载荷进行加密处理,获得第一加密载荷;An encryption processing unit 602, configured to encrypt the first payload by using the specified encryption algorithm and the shared key to obtain a first encrypted payload;
封装处理单元603,用于进行封装处理,获得封装后的报文,所述封装后的报文包括:所述第一源地址、所述第一目的地址、第一封装报头和所述第一加密载荷;An encapsulation processing unit 603, configured to perform encapsulation processing to obtain an encapsulated message, where the encapsulated message includes: the first source address, the first destination address, the first encapsulation header, and the first encrypted payload;
第一发送单元604,用于将所述封装后的报文发送至第一虚拟路由器。The first sending unit 604 is configured to send the encapsulated packet to the first virtual router.
可选地,所述装置还包括:Optionally, the device also includes:
第二发送单元,用于向所述第一虚拟路由器发送所述第一CPE支持的加密算法;a second sending unit, configured to send the encryption algorithm supported by the first CPE to the first virtual router;
第二接收单元,用于接收所述第一虚拟路由器发送的所述VPN协商参数,所述VPN协商参数由所述第一虚拟路由器与第二虚拟路由器协商获得,所述第二虚拟路由器与所述第二CPE相通信,所述第二虚拟路由器能获取所述第二CPE支持的加密算法,所述指定加密算法从所述第一CPE与所述第二CPE共同支持的加密算法中选取。The second receiving unit is configured to receive the VPN negotiation parameter sent by the first virtual router, the VPN negotiation parameter is obtained through negotiation between the first virtual router and a second virtual router, and the second virtual router and the The second CPE communicates with each other, the second virtual router can obtain the encryption algorithm supported by the second CPE, and the specified encryption algorithm is selected from the encryption algorithms supported by both the first CPE and the second CPE.
与图4所示方法相对应地,本发明实施例还提供了CPE侧的报文传输装置实施例2的示意图,参见图9所示示意图,所述装置还可包括:Corresponding to the method shown in FIG. 4, the embodiment of the present invention also provides a schematic diagram of Embodiment 2 of the message transmission device on the CPE side. Referring to the schematic diagram shown in FIG. 9, the device may further include:
第三接收单元701,用于接收所述第一虚拟路由器发送的第二报文,所述第二报文包括:第二源地址、第二目的地址、第二封装报头和第二加密载荷;The third receiving unit 701 is configured to receive the second message sent by the first virtual router, where the second message includes: a second source address, a second destination address, a second encapsulation header, and a second encrypted payload;
拆封装处理单元702,用于进行拆封装处理,获得拆封装后的报文,所述拆封装后的报文包括:所述第二源地址、所述第二目的地址和所述第二加密载荷;The decapsulation processing unit 702 is configured to perform decapsulation processing to obtain a decapsulated message, the decapsulated message including: the second source address, the second destination address and the second encrypted load;
解密处理单元703,用于对所述拆封装后的报文进行解密处理,获得解密后的报文,所述解密后的报文包括:所述第二源地址、所述第二目的地址和载荷;A decryption processing unit 703, configured to decrypt the decapsulated message to obtain a decrypted message, where the decrypted message includes: the second source address, the second destination address and load;
第三发送单元704,用于将所述解密后的报文发送至所述第二目的地址对应的设备。The third sending unit 704 is configured to send the decrypted message to the device corresponding to the second destination address.
需要说明的是,本装置实施例中提供的报文传输装置,可以集成在CPE中,应用上文附图2、4所示的方法实施例,实现其中第一CPE的功能,具体过程请参照方法实施例的描述,此处不再赘述。It should be noted that the message transmission device provided in this device embodiment can be integrated in the CPE, and the method embodiments shown in Figures 2 and 4 above can be used to realize the function of the first CPE. For the specific process, please refer to The description of the method embodiment will not be repeated here.
另外,图8、9所示装置在进行报文传输时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。In addition, when the devices shown in Figures 8 and 9 transmit messages, they only use the division of the above-mentioned functional modules as an example for illustration. The structure is divided into different functional modules to complete all or part of the functions described above.
与图5所示方法相对应地,本发明实施例还提供了VR侧的报文传输装置实施例1的示意图,参见图10所示示意图,所述装置还可包括:Corresponding to the method shown in FIG. 5, the embodiment of the present invention also provides a schematic diagram of embodiment 1 of a message transmission device on the VR side. Referring to the schematic diagram shown in FIG. 10, the device may further include:
第一接收单元801,用于接收第一客户终端设备CPE发送的第一报文,所述第一报文包括:第一源地址、第一目的地址、第一封装报头和第一加密载荷;The first receiving unit 801 is configured to receive a first packet sent by a first client terminal equipment CPE, where the first packet includes: a first source address, a first destination address, a first encapsulation header, and a first encrypted payload;
查找单元802,用于查找所述第一目的地址对应的第二虚拟路由器,第一虚拟路由器与所述第二虚拟路由器之间建立有第一虚拟专用网络VPN隧道;A search unit 802, configured to search for a second virtual router corresponding to the first destination address, and a first virtual private network VPN tunnel is established between the first virtual router and the second virtual router;
封装处理单元803,用于对所述第一报文进行封装处理,获得封装后的报文,所述封装后的报文包括:所述第一虚拟路由器的公网地址、所述第二虚拟路由器的公网地址、所述第一VPN隧道的封装报头、所述第一源地址、所述第一目的地址、所述第一封装报头和所述第一加密载荷;An encapsulation processing unit 803, configured to perform encapsulation processing on the first message to obtain an encapsulated message, the encapsulated message including: the public network address of the first virtual router, the second virtual The public network address of the router, the encapsulation header of the first VPN tunnel, the first source address, the first destination address, the first encapsulation header, and the first encrypted payload;
第一发送单元804,用于将所述封装后的报文发送至所述第二虚拟路由器。The first sending unit 804 is configured to send the encapsulated packet to the second virtual router.
与图6所示方法相对应地,本发明实施例还提供了VR侧的报文传输装置实施例2的示意图,参见图11所示示意图,所述装置还可包括:Corresponding to the method shown in FIG. 6, the embodiment of the present invention also provides a schematic diagram of Embodiment 2 of a message transmission device on the VR side. Referring to the schematic diagram shown in FIG. 11, the device may further include:
第二接收单元901,用于接收第三虚拟路由器发送的第二报文,所述第一虚拟路由器与所述第三虚拟路由器之间建立有第二VPN隧道,所述第二报文包括:所述第三虚拟路由器的公网地址、所述第一虚拟路由器的公网地址、所述第二VPN隧道的封装报头、第二源地址、第二目的地址、第二封装报头和第二加密载荷;The second receiving unit 901 is configured to receive a second message sent by a third virtual router, a second VPN tunnel is established between the first virtual router and the third virtual router, and the second message includes: The public network address of the third virtual router, the public network address of the first virtual router, the encapsulation header of the second VPN tunnel, the second source address, the second destination address, the second encapsulation header, and the second encryption load;
拆封装处理单元902,用于进行拆封装处理,获得拆封装后的报文,所述拆封装后的报文包括:所述第二源地址、所述第二目的地址、所述第二封装报头和所述第二加密载荷;The decapsulation processing unit 902 is configured to perform decapsulation processing to obtain a decapsulated message, where the decapsulated message includes: the second source address, the second destination address, the second encapsulated a header and said second encrypted payload;
第二发送单元903,用于将所述拆封装后的报文发送至所述第一CPE。The second sending unit 903 is configured to send the decapsulated message to the first CPE.
需要说明的是,本装置实施例中提供的报文传输装置,可以集成在VR中,应用上文附图5、6所示的方法实施例,实现其中第一VR的功能,具体过程请参照方法实施例的描述,此处不再赘述。It should be noted that the message transmission device provided in this device embodiment can be integrated in VR, and the method embodiment shown in Figures 5 and 6 above can be used to realize the function of the first VR. For the specific process, please refer to The description of the method embodiment will not be repeated here.
同样地,图10、11所示装置在进行报文传输时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Similarly, when the devices shown in Figures 10 and 11 transmit messages, they only use the division of the above-mentioned functional modules as an example for illustration. The internal structure is divided into different functional modules to complete all or part of the functions described above.
本发明实施例还提供了报文传输设备。参见图12所示示意图,报文传输设备可包括:处理器1001、存储器1002、网络接口1003、总线系统1004。The embodiment of the invention also provides a message transmission device. Referring to the schematic diagram shown in FIG. 12 , the packet transmission device may include: a processor 1001 , a memory 1002 , a network interface 1003 , and a bus system 1004 .
所述总线系统1004,用于将报文传输设备的各个硬件组件耦合在一起。The bus system 1004 is used to couple various hardware components of the message transmission device together.
所述网络接口1003,用于实现报文传输设备与至少一个其它网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等方式。The network interface 1003 is used to realize the communication connection between the packet transmission device and at least one other network element, and may use the Internet, a wide area network, a local network, a metropolitan area network, and the like.
所述存储器1002,用于存储程序指令和数据。The memory 1002 is used for storing program instructions and data.
所述处理器1001,用于读取存储器1002中存储的指令和数据,并执行响应操作。The processor 1001 is configured to read instructions and data stored in the memory 1002 and execute corresponding operations.
具体地,当图12所示报文传输设备体现为图2、4所示示例中的第一CPE时,所述处理器可根据存储器存储的指令和数据,执行以下操作:Specifically, when the packet transmission device shown in FIG. 12 is embodied as the first CPE in the examples shown in FIGS. 2 and 4, the processor may perform the following operations according to the instructions and data stored in the memory:
所述处理器通过所述网络接口接收第一设备发送的第一报文,所述第一报文包括:第一源地址、第一目的地址和第一载荷;所述第一源地址为所述第一设备的地址,所述第一目的地址为第二设备的地址,所述第一CPE和所述第一设备位于第一分支网络,所述第二设备与第二CPE相通信,且所述第二设备和所述第二CPE位于第二分支网络,所述第一CPE与所述第二CPE保存有相同的虚拟专用网络VPN协商参数,所述VPN协商参数包括:指定加密算法和共享密钥;The processor receives a first packet sent by a first device through the network interface, where the first packet includes: a first source address, a first destination address, and a first payload; the first source address is the the address of the first device, the first destination address is the address of the second device, the first CPE and the first device are located in the first branch network, the second device communicates with the second CPE, and The second device and the second CPE are located in the second branch network, and the first CPE and the second CPE store the same virtual private network VPN negotiation parameters, and the VPN negotiation parameters include: a specified encryption algorithm and shared key;
所述处理器利用所述指定加密算法和所述共享密钥对所述第一载荷进行加密处理,获得第一加密载荷;The processor encrypts the first payload by using the designated encryption algorithm and the shared key to obtain a first encrypted payload;
所述处理器进行封装处理,获得封装后的报文,所述封装后的报文包括:所述第一源地址、所述第一目的地址、第一封装报头和所述第一加密载荷;The processor performs encapsulation processing to obtain an encapsulated message, where the encapsulated message includes: the first source address, the first destination address, a first encapsulation header, and the first encrypted payload;
所述处理器通过所述网络接口将所述封装后的报文发送至第一虚拟路由器。The processor sends the encapsulated packet to the first virtual router through the network interface.
可选地,所述处理器可执行以下操作获取所述VPN协商参数的方式:Optionally, the processor may perform the following operations to acquire the manner of the VPN negotiation parameter:
所述处理器通过所述网络接口向所述第一虚拟路由器发送所述第一CPE支持的加密算法;The processor sends the encryption algorithm supported by the first CPE to the first virtual router through the network interface;
所述处理器通过所述网络接口接收所述第一虚拟路由器发送的所述VPN协商参数,所述VPN协商参数由所述第一虚拟路由器与第二虚拟路由器协商获得,所述第二虚拟路由器与所述第二CPE相通信,所述第二虚拟路由器能获取所述第二CPE支持的加密算法,所述指定加密算法从所述第一CPE与所述第二CPE共同支持的加密算法中选取。The processor receives the VPN negotiation parameter sent by the first virtual router through the network interface, the VPN negotiation parameter is obtained through negotiation between the first virtual router and a second virtual router, and the second virtual router Communicating with the second CPE, the second virtual router can obtain the encryption algorithm supported by the second CPE, and the specified encryption algorithm is selected from the encryption algorithms supported by the first CPE and the second CPE select.
可选地,所述处理器还可执行以下操作:Optionally, the processor may also perform the following operations:
所述处理器通过所述网络接口接收所述第一虚拟路由器发送的第二报文,所述第二报文包括:第二源地址、第二目的地址、第二封装报头和第二加密载荷;The processor receives a second packet sent by the first virtual router through the network interface, and the second packet includes: a second source address, a second destination address, a second encapsulation header, and a second encrypted payload ;
所述处理器进行拆封装处理,获得拆封装后的报文,所述拆封装后的报文包括:所述第二源地址、所述第二目的地址和所述第二加密载荷;The processor performs decapsulation processing to obtain a decapsulated message, where the decapsulated message includes: the second source address, the second destination address, and the second encrypted payload;
所述处理器对所述拆封装后的报文进行解密处理,获得解密后的报文,所述解密后的报文包括:所述第二源地址、所述第二目的地址和载荷;The processor decrypts the decapsulated message to obtain a decrypted message, where the decrypted message includes: the second source address, the second destination address, and a payload;
所述处理器通过所述网络接口将所述解密后的报文发送至所述第二目的地址对应的设备。The processor sends the decrypted message to the device corresponding to the second destination address through the network interface.
具体地,当图12所示报文传输设备体现为图5、6所示示例中的第一VR时,所述处理器可根据存储器存储的指令和数据,执行以下操作:Specifically, when the packet transmission device shown in FIG. 12 is embodied as the first VR in the examples shown in FIGS. 5 and 6, the processor may perform the following operations according to the instructions and data stored in the memory:
所述处理器通过所述网络接口接收第一客户终端设备CPE发送的第一报文,所述第一报文包括:第一源地址、第一目的地址、第一封装报头和第一加密载荷;The processor receives the first message sent by the first customer terminal equipment CPE through the network interface, and the first message includes: a first source address, a first destination address, a first encapsulation header, and a first encrypted payload ;
所述处理器查找所述第一目的地址对应的第二虚拟路由器,所述第一虚拟路由器与所述第二虚拟路由器之间建立有第一虚拟专用网络VPN隧道;The processor searches for a second virtual router corresponding to the first destination address, and a first virtual private network VPN tunnel is established between the first virtual router and the second virtual router;
所述处理器对所述第一报文进行封装处理,获得封装后的报文,所述封装后的报文包括:所述第一虚拟路由器的公网地址、所述第二虚拟路由器的公网地址、所述第一VPN隧道的封装报头、所述第一源地址、所述第一目的地址、所述第一封装报头和所述第一加密载荷;The processor performs encapsulation processing on the first message to obtain an encapsulated message, and the encapsulated message includes: the public network address of the first virtual router, the public network address of the second virtual router A network address, an encapsulation header of the first VPN tunnel, the first source address, the first destination address, the first encapsulation header, and the first encrypted payload;
所述处理器通过所述网络接口将所述封装后的报文发送至所述第二虚拟路由器。The processor sends the encapsulated packet to the second virtual router through the network interface.
可选地,所述处理器还可执行以下操作:Optionally, the processor may also perform the following operations:
所述处理器通过所述网络接口接收第三虚拟路由器发送的第二报文,所述第一虚拟路由器与所述第三虚拟路由器之间建立有第二VPN隧道,所述第二报文包括:所述第三虚拟路由器的公网地址、所述第一虚拟路由器的公网地址、所述第二VPN隧道的封装报头、第二源地址、第二目的地址、第二封装报头和第二加密载荷;The processor receives a second packet sent by a third virtual router through the network interface, a second VPN tunnel is established between the first virtual router and the third virtual router, and the second packet includes : the public network address of the third virtual router, the public network address of the first virtual router, the encapsulation header of the second VPN tunnel, the second source address, the second destination address, the second encapsulation header, and the second encrypted payload;
所述处理器进行拆封装处理,获得拆封装后的报文,所述拆封装后的报文包括:所述第二源地址、所述第二目的地址、所述第二封装报头和所述第二加密载荷;The processor performs decapsulation processing to obtain a decapsulated message, and the decapsulated message includes: the second source address, the second destination address, the second encapsulation header, and the the second encrypted payload;
所述处理器通过所述网络接口将所述拆封装后的报文发送至所述第一CPE。The processor sends the decapsulated packet to the first CPE through the network interface.
其中,所述处理器1001可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。这些指令可以通过其中的处理器以配合实现及控制,用于执行本发明实施例揭示的方法。上述处理器还可以是通用处理器、数字信号处理器(DigitalSignalProcessing,DSP)、专用集成电路(applicationspecificintegratedcircuit)、现成可编程门阵列(FieldProgrammableGateArray,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。Wherein, the processor 1001 may be an integrated circuit chip, which has a signal processing capability. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. These instructions can be realized and controlled by the cooperation of the processor therein, so as to execute the methods disclosed in the embodiments of the present invention. The above-mentioned processor can also be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), an application specific integrated circuit (application specific integrated circuit), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices , Discrete hardware components.
其中,上述通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器,解码器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。Wherein, the above general processor may be a microprocessor or the processor may be any conventional processor, decoder and the like. The steps of the methods disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register.
其中,总线系统1004除了包括数据总线之外,还可包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图12中将各种总线都标为总线系统1004。Wherein, besides the data bus, the bus system 1004 may also include a power bus, a control bus and a status signal bus. However, the various buses are labeled as bus system 1004 in FIG. 12 for clarity of illustration.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到上述实施例方法中的全部或部分步骤可借助软件加通用硬件平台的方式来实现。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者诸如媒体网关等网络通信设备)执行本发明各个实施例或者实施例的某些部分所述的方法。From the above description of the implementation manners, it can be seen that those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus a general hardware platform. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM, disk , optical disk, etc., including several instructions to make a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway) execute the methods described in various embodiments or some parts of the embodiments of the present invention.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于设备及系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。It should be noted that each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. place. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for relevant parts, please refer to part of the description of the method embodiments. The device and system embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.
以上所述仅是本发明的可选实施方式,并非用于限定本发明的保护范围。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above descriptions are only optional implementations of the present invention, and are not intended to limit the protection scope of the present invention. It should be pointed out that those skilled in the art can make some improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410449119.7A CN105471827B (en) | 2014-09-04 | 2014-09-04 | A message transmission method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410449119.7A CN105471827B (en) | 2014-09-04 | 2014-09-04 | A message transmission method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105471827A true CN105471827A (en) | 2016-04-06 |
CN105471827B CN105471827B (en) | 2019-02-26 |
Family
ID=55609100
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410449119.7A Active CN105471827B (en) | 2014-09-04 | 2014-09-04 | A message transmission method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105471827B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106027387A (en) * | 2016-07-05 | 2016-10-12 | 瑞斯康达科技发展股份有限公司 | Voice service processing method, gateway equipment and system |
CN108769292A (en) * | 2018-06-29 | 2018-11-06 | 北京百悟科技有限公司 | Message data processing method and processing device |
CN110233827A (en) * | 2019-05-10 | 2019-09-13 | 匿名科技(重庆)集团有限公司 | A kind of single layer and layered defense system of server |
CN111787032A (en) * | 2020-08-05 | 2020-10-16 | 北京北斗弘鹏科技有限公司 | Data transmitting and receiving method and device for resisting network communication monitoring |
CN112152985A (en) * | 2019-06-28 | 2020-12-29 | 瞻博网络公司 | GRE Tunneling with Reduced Packet Encryption at Intermediate Routers |
CN113726795A (en) * | 2021-09-01 | 2021-11-30 | 北京天融信网络安全技术有限公司 | Message forwarding method and device, electronic equipment and readable storage medium |
CN115102768A (en) * | 2022-06-24 | 2022-09-23 | 平安银行股份有限公司 | Data processing method and device and computer equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101262409A (en) * | 2008-04-23 | 2008-09-10 | 华为技术有限公司 | Virtual private network VPN access method and device |
CN101741552A (en) * | 2009-12-28 | 2010-06-16 | 华为技术有限公司 | Message forwarding method, device and system |
CN102025591A (en) * | 2009-09-18 | 2011-04-20 | 中兴通讯股份有限公司 | Method and system for implementing virtual private network |
CN102025589A (en) * | 2009-09-18 | 2011-04-20 | 中兴通讯股份有限公司 | Method and system for realizing virtual private network |
-
2014
- 2014-09-04 CN CN201410449119.7A patent/CN105471827B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101262409A (en) * | 2008-04-23 | 2008-09-10 | 华为技术有限公司 | Virtual private network VPN access method and device |
CN102025591A (en) * | 2009-09-18 | 2011-04-20 | 中兴通讯股份有限公司 | Method and system for implementing virtual private network |
CN102025589A (en) * | 2009-09-18 | 2011-04-20 | 中兴通讯股份有限公司 | Method and system for realizing virtual private network |
CN101741552A (en) * | 2009-12-28 | 2010-06-16 | 华为技术有限公司 | Message forwarding method, device and system |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106027387B (en) * | 2016-07-05 | 2019-06-04 | 瑞斯康达科技发展股份有限公司 | A kind of processing method of voice service, gateway and system |
CN106027387A (en) * | 2016-07-05 | 2016-10-12 | 瑞斯康达科技发展股份有限公司 | Voice service processing method, gateway equipment and system |
CN108769292B (en) * | 2018-06-29 | 2021-04-13 | 北京百悟科技有限公司 | Message data processing method and device |
CN108769292A (en) * | 2018-06-29 | 2018-11-06 | 北京百悟科技有限公司 | Message data processing method and processing device |
CN110233827A (en) * | 2019-05-10 | 2019-09-13 | 匿名科技(重庆)集团有限公司 | A kind of single layer and layered defense system of server |
CN112152985A (en) * | 2019-06-28 | 2020-12-29 | 瞻博网络公司 | GRE Tunneling with Reduced Packet Encryption at Intermediate Routers |
US11032107B2 (en) | 2019-06-28 | 2021-06-08 | Juniper Networks, Inc. | GRE tunneling with reduced packet encryption at intermediate routers |
CN112152985B (en) * | 2019-06-28 | 2022-02-25 | 瞻博网络公司 | GRE tunneling with reduced packet encryption at intermediate routers |
CN111787032A (en) * | 2020-08-05 | 2020-10-16 | 北京北斗弘鹏科技有限公司 | Data transmitting and receiving method and device for resisting network communication monitoring |
US12095750B2 (en) | 2020-08-05 | 2024-09-17 | Beijing Beidou Hongpeng Techology Co. Ltd. | Data sending method and apparatus and data receiving method and apparatus for resisting network communication monitoring |
CN113726795A (en) * | 2021-09-01 | 2021-11-30 | 北京天融信网络安全技术有限公司 | Message forwarding method and device, electronic equipment and readable storage medium |
CN113726795B (en) * | 2021-09-01 | 2023-06-09 | 北京天融信网络安全技术有限公司 | Message forwarding method and device, electronic equipment and readable storage medium |
CN115102768A (en) * | 2022-06-24 | 2022-09-23 | 平安银行股份有限公司 | Data processing method and device and computer equipment |
CN115102768B (en) * | 2022-06-24 | 2024-03-19 | 平安银行股份有限公司 | Data processing method and device and computer equipment |
Also Published As
Publication number | Publication date |
---|---|
CN105471827B (en) | 2019-02-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105471827A (en) | Message transmission method and device | |
CN102882789B (en) | A kind of data message processing method, system and equipment | |
EP2777217B1 (en) | Protocol for layer two multiple network links tunnelling | |
US10044841B2 (en) | Methods and systems for creating protocol header for embedded layer two packets | |
CN103259724B (en) | A kind of MPLS VPN implementation method, system and customer edge devices | |
CN111385259B (en) | Data transmission method, device, related equipment and storage medium | |
CN106797335B (en) | Data transmission method, data transmission device, electronic equipment and computer program product | |
CN101572644B (en) | Data encapsulation method and equipment thereof | |
US9473466B2 (en) | System and method for internet protocol security processing | |
EP3996325A1 (en) | Forwarding device, key management server device, communication system, forwarding method, and computer-readable medium | |
CN106878278B (en) | Message processing method and device | |
KR20140122335A (en) | Method for constructing virtual private network, method for packet forwarding and gateway apparatus using the methods | |
CN105337954A (en) | Method and device for encryption and decryption of IP message in satellite communication | |
CN106161386B (en) | Method and device for realizing IPsec (Internet protocol Security) shunt | |
CN101741552A (en) | Message forwarding method, device and system | |
US11006346B2 (en) | X2 service transmission method and network device | |
CN114338116A (en) | Encryption transmission method and device and SD-WAN (secure digital-Wide area network) network system | |
CN108924157B (en) | Message forwarding method and device based on IPSec VPN | |
CN103001844A (en) | IPv6 network system and its data transmission method | |
CN117254976B (en) | National standard IPsec VPN realization method, device and system based on VPP and electronic equipment | |
CN116527405B (en) | SRV6 message encryption transmission method and device and electronic equipment | |
CN111416791B (en) | Data transmission method, equipment and system | |
CN105471832A (en) | Processing method and device of IP packet in satellite communication | |
KR101837064B1 (en) | Apparatus and method for secure communication | |
CN115766063B (en) | Data transmission method, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |