Method, system, electronic device and storage medium for service communication based on ipsec manual tunnel
By creating a mapping table at the central node to record branch node information and using IPsec manual tunneling for encryption and decryption, the inefficiency of IPsec manual tunneling in point-to-multipoint communication is solved, enabling efficient communication between multiple branch nodes and the central node and simplifying configuration.
Patent Information
- Application Number
- CN202311872670.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-12-29
AI Technical Summary
Existing manual IPsec tunnels are inefficient in point-to-multipoint communication and cannot efficiently enable communication between multiple branch nodes and the central node.
A mapping table is created at the central node to record the communication information of the branch nodes, and encryption and decryption are performed through a manual IPsec tunnel to achieve efficient communication between multiple branch nodes and the central node.
It improves the communication efficiency of IPsec manual tunnels, enables multiple branch nodes to access intranet services simultaneously with the central node, and simplifies the configuration process.
Smart Images

Figure CN117834264B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data communication technology, and more specifically, to a service communication method, system, electronic device, and storage medium based on IPsec manual tunneling. Background Technology
[0002] IPsec (Internet Protocol Security) is a protocol suite (a collection of interrelated protocols) that protects network transport protocols by encrypting and authenticating IP protocol packets. Currently, there is an increasing demand for point-to-multipoint IPsec, which refers to multiple branches establishing IPsec tunnels with the same headquarters and then conducting business access.
[0003] Generally, point-to-multipoint requirements can be applied to both ordinary static tunnels and manual tunnels. Among them, IPsec manual tunnels are tunnels that do not require negotiation. Both ends of the device are configured with the basic IPsec key and key information such as SPI (Serial Peripheral Interface), and then each sends the key data structure to the kernel according to the configuration information to carry out IPsec service communication. However, for IPsec manual tunnels, point-to-multipoint service access needs to be implemented, which can currently only be achieved by configuring tunnels from the headquarters device to different branch devices, resulting in low communication efficiency. Summary of the Invention
[0004] The purpose of this application is to provide a service communication method, system, electronic device and storage medium based on IPsec manual tunnel, which can achieve the technical effect of improving communication efficiency.
[0005] Firstly, this application provides a service communication method based on a manual IPsec tunnel, applied to the central node of an IPsec network, the method comprising:
[0006] Configure the IPsec manual tunnel of the central node, wherein the central node of the IPsec network is connected to at least one branch node;
[0007] The service packets sent by the branch node are obtained based on the IPsec manual tunnel;
[0008] Generate mapping information based on the service message, and update the mapping information to the mapping table;
[0009] Obtain the return packet to be sent;
[0010] The mapping table is queried according to the return packet service message to obtain the return packet mapping information corresponding to the return packet service message;
[0011] Based on the IPsec manual tunnel and the return packet mapping information, the return packet service message is sent to the branch node.
[0012] In the above implementation process, the central node of the IPsec network can connect to multiple branch nodes in the service communication method based on IPsec manual tunnels. During the process of receiving and sending packets at the central node, mapping information is created and updated to the mapping table. Thus, the mapping table can include the communication node data of each branch node. Based on the communication node data in the mapping table, multiple branch nodes can simultaneously establish IPsec manual tunnels with the central node and access intranet services through the IPsec manual tunnels, which is more efficient and easier to use, and achieves the technical effect of effectively improving communication efficiency.
[0013] Furthermore, after the step of obtaining the service packets sent by the branch node based on the IPsec manual tunnel, the method further includes:
[0014] Based on the business message, the key data structure is obtained by querying through SPI, wherein the key data structure is the data structure used for encryption and decryption in the IPsec manual tunnel.
[0015] In the above implementation process, the key data structure is the data structure for encryption and decryption in the IPsec manual tunnel, which stores the encryption and decryption key materials and algorithms.
[0016] Further, the step of generating mapping information based on the service message includes:
[0017] Mapping information is generated through the key data structure. The mapping information includes SPI information, protection subnet information, and peer IP information. The protection subnet information corresponds to the user information of the central node and the user information of the branch node, respectively, and the peer IP information corresponds to the IP information of the branch node.
[0018] In the above implementation process, after obtaining the SPI information and protection subnet information from the return packet, the corresponding peer IP information can be queried through the mapping table, and then the return packet is sent to the corresponding branch node.
[0019] Furthermore, before the step of querying the mapping table based on the return packet service message to obtain the return packet mapping information corresponding to the return packet service message, the method further includes:
[0020] Obtain the destination address information based on the return packet;
[0021] A routing query is performed based on the destination address information, and the route is routed to the IPsec port of the manual IPsec tunnel.
[0022] Further, the return packet mapping information includes the IP information of the branch node. The step of querying the mapping table according to the return packet service message to obtain the return packet mapping information corresponding to the return packet service message includes:
[0023] Based on the IPsec interface of the IPsec manual tunnel, the mapping table is queried to obtain the IP information of the branch node corresponding to the return packet service message.
[0024] Further, the step of sending the return packet service message to the branch node based on the IPsec manual tunnel and the return packet mapping information includes:
[0025] The return packet service message is encrypted and encapsulated to obtain the return packet encapsulated message;
[0026] Based on the IPsec manual tunnel and the return packet mapping information, the encapsulated return packet is sent to the branch node.
[0027] Secondly, this application provides a service communication system based on a manual IPsec tunnel, applied to the central node of an IPsec network. The service communication system based on a manual IPsec tunnel includes:
[0028] A configuration module is used to configure the IPsec manual tunnel of the central node, wherein the central node of the IPsec network is connected to at least one branch node;
[0029] The packet acquisition module is used to acquire the service packets sent by the branch node based on the IPsec manual tunnel;
[0030] The mapping module is used to generate mapping information based on the service message and update the mapping information to the mapping table;
[0031] The response module is used to acquire the response service messages to be sent.
[0032] The query module is used to query the mapping table based on the return packet service message to obtain the return packet mapping information corresponding to the return packet service message;
[0033] The message sending module is used to send the return packet service message to the branch node based on the IPsec manual tunnel and the return packet mapping information.
[0034] Furthermore, the mapping module is also used to: query and obtain a key data structure through SPI based on the service message, wherein the key data structure is the data structure for encryption and decryption of the IPsec manual tunnel.
[0035] Furthermore, the mapping module is also used to: generate mapping information through the key data structure, the mapping information including SPI information, protection subnet information and peer IP information, wherein the protection subnet information corresponds to the user information of the central node and the user information of the branch node, respectively, and the peer IP information corresponds to the IP information of the branch node.
[0036] Furthermore, the query module is also used to: obtain destination address information based on the return packet service message; perform a routing query based on the destination address information, and route to the IPsec port of the IPsec manual tunnel.
[0037] Furthermore, the return packet mapping information includes the IP information of the branch node, and the query module is also used to: query the mapping table based on the IPsec port of the IPsec manual tunnel to obtain the IP information of the branch node corresponding to the return packet service message.
[0038] Furthermore, the sending module is also used to: encrypt and encapsulate the return packet service message to obtain a return packet encapsulated message; and send the return packet encapsulated message to the branch node based on the IPsec manual tunnel and the return packet mapping information.
[0039] Thirdly, this application provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the method described in any of the first aspects.
[0040] Fourthly, this application provides a storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described in any of the first aspects.
[0041] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to perform the method described in any of the first aspects.
[0042] Other features and advantages disclosed in this application will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the above-described technology disclosed in this application.
[0043] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0044] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a schematic diagram of the IPsec network structure provided in the embodiments of this application;
[0046] Figure 2 A flowchart illustrating a service communication method based on a manual IPsec tunnel, provided as an embodiment of this application;
[0047] Figure 3 A flowchart illustrating another service communication method based on a manual IPsec tunnel provided in this application embodiment;
[0048] Figure 4 A structural block diagram of a service communication system based on a manual IPsec tunnel provided in this application embodiment;
[0049] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0050] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0051] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0052] This application provides a service communication method, system, electronic device, and storage medium based on IPsec manual tunnels. It can be applied to the IPsec point-to-multipoint manual tunnel service matching process. In this IPsec manual tunnel service communication method, the central node of the IPsec network can connect to multiple branch nodes. During the process of receiving and sending packets at the central node, mapping information is created and updated to a mapping table. Therefore, the mapping table can include communication node data of each branch node. Based on the communication node data in the mapping table, multiple branch nodes can simultaneously establish IPsec manual tunnels with the central node and simultaneously access intranet services through the IPsec manual tunnels, making it more efficient and easier to use, and effectively improving communication efficiency.
[0053] Please see Figure 1 , Figure 1 This is a schematic diagram of the IPsec network structure provided in an embodiment of this application. The IPsec network includes multiple devices (device A, device B, device C) and users corresponding to the devices (user A, user B, user C).
[0054] For example, device B acts as the central node, and devices A and C act as branch nodes. Device B is connected to devices A and C respectively. Examples of the IP addresses of users A, B, and C are: 1.1.1.1, 2.2.2.2, and 3.3.3.3. Examples of the IP addresses of devices A, B, and C are: 10.10.0.1, 20.10.0.1, and 30.10.0.1.
[0055] For example, combined Figure 1 The service communication method based on IPsec manual tunnel provided in this application embodiment has the following specific process:
[0056] First, configure a manual IPsec tunnel on both device A and device B, with device B configured with the peer IP address set to 0.0.0.0.
[0057] After the traffic 1.1.1.1->2.2.2.2 sent by user A reaches device A, it is first encrypted into an ESP message and then sent to device B.
[0058] After receiving the message, device B queries the corresponding sa (key data structure), decrypts it, and records the correspondence between the business intranet IP (user B's IP address, 2.2.2.2) and the business external IP (user A's IP address: 1.1.1.1). User B will then look up sa in the subsequent reply packets (i.e. reply packet business messages).
[0059] When device B receives the reply packet 2.2.2.2->1.1.1.1 from user B to user A, it will first look up 'sa' based on 'eroute', encrypt it, and then query the outer IP (device A's IP address: 10.10.0.1) stored in the previously recorded table of correspondence between business intranet IP and business external IP. After that, it will encapsulate the packet and send it to device A. Device A will receive the packet, decrypt it, and then send it to user A.
[0060] It should be noted that user C communicates with user B in the same way, which will not be elaborated here.
[0061] Please see Figure 2 , Figure 2 This application provides a flowchart illustrating a service communication method based on a manual IPsec tunnel, which is applied to the central node of an IPsec network and includes the following steps:
[0062] S100: Configure the IPsec manual tunnel of the central node, wherein the central node of the IPsec network is connected to at least one branch node;
[0063] For example, during the process of configuring a manual IPsec tunnel for the central node:
[0064] Each branch node is configured with a manual IPsec tunnel to the central node;
[0065] Configure a manual tunnel on the central node with the peer IP address set to a preset IP address. This preset IP address is a virtual address that does not point to any actual device, for example: 0.0.0.0.
[0066] S200: Obtaining service packets sent by branch nodes based on a manual IPsec tunnel;
[0067] For example, a branch node sends service packets to the central node through a pre-configured IPsec manual tunnel.
[0068] S300: Generate mapping information based on the service message and update the mapping information to the mapping table;
[0069] For example, based on the service messages sent by the branch nodes, the mapping information corresponding to the branch nodes is obtained by parsing and processing the service messages. This mapping information represents the communication channel between the branch node and the central node. Then, the mapping information is updated to the mapping table, which may include the communication channel information between each branch node and the central node.
[0070] S400: Obtain the return packet service message to be sent;
[0071] For example, the central node sends the received service message to the corresponding user for processing; the corresponding user (such as...) Figure 1 After receiving the service message, user B) generates a response message, sends the response service message to the central node.
[0072] S500: Query the mapping table based on the return packet service message to obtain the return packet mapping information corresponding to the return packet service message;
[0073] For example, by querying the mapping table based on the return packet service message, the return packet service message can be sent to the corresponding branch node.
[0074] S600: Sends return packet service messages to branch nodes based on IPsec manual tunnel and return packet mapping information.
[0075] For example, during the forwarding process of the central node, a mapping table is created based on different service flow addresses, which enables multiple branch nodes and the central node to access IPsec services simultaneously without adding tunnel configuration to the central node (i.e., without configuring a corresponding manual IPsec tunnel for each branch node in the central node).
[0076] In some implementations, the central node of the IPsec network can connect to multiple branch nodes in this service communication method based on IPsec manual tunnels. During the process of receiving and sending packets at the central node, mapping information is created and updated to the mapping table. Thus, the mapping table can include the communication node data of each branch node. Based on the communication node data in the mapping table, multiple branch nodes can simultaneously establish IPsec manual tunnels with the central node and access intranet services through the IPsec manual tunnels, making it more efficient and easier to use, and achieving the technical effect of effectively improving communication efficiency.
[0077] Please see Figure 3 , Figure 3 This is a flowchart illustrating another service communication method based on a manual IPsec tunnel provided in an embodiment of this application.
[0078] For example, after step S200: Obtaining service packets sent by branch nodes based on IPsec manual tunneling, the method further includes:
[0079] S210: Based on the business message, query and obtain the key data structure through SPI, where the key data structure is the data structure for encryption and decryption in the IPsec manual tunnel.
[0080] For example, the key data structure is the data structure used for encryption and decryption in a manual IPsec tunnel, which stores encryption and decryption key materials and algorithms.
[0081] For example, S300: The step of generating mapping information based on the service message and updating the mapping information to the mapping table includes:
[0082] S310: Generate mapping information through key data structures and update the mapping information to the mapping table. The mapping information includes SPI information, protection subnet information and peer IP information. The protection subnet information corresponds to the user information of the central node and the user information of the branch node, respectively, and the peer IP information corresponds to the IP information of the branch node.
[0083] For example, after obtaining the SPI information and protection subnet information from the return packet, the corresponding peer IP information can be queried through the mapping table, and then the return packet can be sent to the corresponding branch node.
[0084] For example, before step S500: querying the mapping table based on the return packet service message to obtain the return packet mapping information corresponding to the return packet service message, the method further includes:
[0085] S410: Obtain destination address information based on the return packet service message;
[0086] S420: Performs a route lookup based on the destination address information and routes to the IPsec interface of the manual IPsec tunnel.
[0087] For example, the return packet mapping information includes the IP information of the branch node. S500: The step of querying the mapping table according to the return packet service message to obtain the return packet mapping information corresponding to the return packet service message includes:
[0088] S510: Based on the IPsec manual tunnel, query the IPsec interface mapping table to obtain the IP information of the branch node corresponding to the return packet service message.
[0089] For example, S600: The step of sending return packet service messages to the branch node based on IPsec manual tunnel and return packet mapping information includes:
[0090] S610: Encrypt and encapsulate the return packet service message to obtain the encapsulated return packet message;
[0091] S620: Based on IPsec manual tunneling and return packet mapping information, encapsulate the return packet and send it to the branch node.
[0092] In some implementation scenarios, combined with Figures 1 to 3 The service communication method based on IPsec manual tunnel provided in this application has the following specific business process:
[0093] Step 1: Configure manual tunnels from devices A and C to device B, and configure a manual tunnel on device B with the peer IP address 0.0.0.0;
[0094] Step 2: User A sends plaintext service 1.1.1.1->2.2.2.2. After receiving it, device A looks up the route through the destination address, routes it to the IPsec interface, then queries the eroute function to find the associated sa, encrypts and encapsulates it, and then sends the ESP packet to device B.
[0095] Step 3: Device B receives the ESP message sent by Device A, queries the corresponding SA via SPI, and after finding the SA, creates a mapping table on Device B. The structure of this table is as follows:
[0096] SPI Protect subnet peer IP 490610 1.1.1.1→2.2.2.2 10.10.0.1
[0097] Table 1 - First Mapping Table
[0098] Step 4: After the mapping table is successfully established, continue the decryption and decapsulation process and send a message to user B;
[0099] Step 5: User B sends a plaintext service response packet to device B. After receiving it, device B looks up the route through the destination address, routes it to the IPsec interface, then queries the eroute function to find the associated sa, obtains the SPI value, and then queries the peer IP through the SPI and the protection subnet (490610, 1.1.1.1->2.2.2.2). Then it encrypts and encapsulates the packet and sends out the successfully encapsulated ESP packet.
[0100] Step 6: User C sends a plaintext service 3.3.3.3->2.2.2.2. After receiving it, device C looks up the route through the destination address, routes it to the IPsec interface, then queries the eroute function to find the associated SA, encrypts and encapsulates it, and sends the ESP message to device B. Device B receives the ESP message sent by device C, queries the corresponding SA through SPI, and after finding the SA, creates a mapping table on device B. The structure of this table is as follows:
[0101] SPI Protect subnet peer IP 490610 3.3.3.3→2.2.2.2 30.10.0.1
[0102] After the creation of the second mapping table, Table 2 is updated as follows:
[0103] SPI Protect subnet peer IP 490610 1.1.1.1→2.2.2.2 10.10.0.1 490610 3.3.3.3→2.2.2.2 30.10.0.1
[0104] Table 3 - Third Mapping Table
[0105] Step 7: User B sends a plaintext service response packet to device B. After receiving it, device B looks up the route through the destination address, routes it to the IPsec interface, then queries the eroute function to find the associated sa, obtains the SPI value, and then queries the peer IP through the SPI and the protection subnet (490610, 3.3.3.3->2.2.2.2). Then it encrypts and encapsulates the packet and sends out the successfully encapsulated ESP packet.
[0106] Step 8: Following the above process, multiple branches can simultaneously communicate with headquarters B via IPsec manual tunneling.
[0107] It is important to note that sa is a key data structure for IPsec encryption and decryption, storing encryption and decryption key materials and algorithms; eroute is a route automatically added after successful IPsec negotiation, with the destination address being the tunnel peer protection subnet and the outgoing interface being the IPsec port. It is used to send the packet to the IPsec port for encryption after receiving a plaintext packet.
[0108] For example, the service communication method based on a manual IPsec tunnel provided in this application creates a mapping table of SPI, protection subnet, and negotiated IP address based on different service flow addresses during the forwarding process. This enables multiple branches and the headquarters to access IPsec services simultaneously without increasing tunnel configuration on the headquarters equipment. This service communication method based on a manual IPsec tunnel has at least the following beneficial effects:
[0109] 1) It can enable multiple branches to establish a manual IPsec tunnel with the headquarters simultaneously, and can also access intranet services through the IPsec tunnel at the same time;
[0110] 2) The headquarters can connect to the business of different branches without creating a tunnel, making it more efficient and easier to use.
[0111] Please see Figure 4 , Figure 4 This is a structural block diagram of a service communication system based on a manual IPsec tunnel, provided in an embodiment of this application. This system is applied to the central node of an IPsec network and includes:
[0112] Configuration module 100 is used to configure the IPsec manual tunnel of the central node, wherein the central node of the IPsec network is connected to at least one branch node;
[0113] The message acquisition module 200 is used to acquire service messages sent by branch nodes based on the IPsec manual tunnel.
[0114] The mapping module 300 is used to generate mapping information based on the business message and update the mapping information to the mapping table;
[0115] The return packet module 400 is used to acquire the return packet service message to be sent;
[0116] The query module 500 is used to query the mapping table based on the return packet service message to obtain the return packet mapping information corresponding to the return packet service message;
[0117] The message sending module 600 is used to send return packet service messages to branch nodes based on IPsec manual tunnel and return packet mapping information.
[0118] For example, the mapping module 300 is also used to: query and obtain a key data structure through SPI based on the service message, wherein the key data structure is a data structure that is encrypted and decrypted by the IPsec manual tunnel.
[0119] For example, the mapping module 300 is further configured to: generate mapping information through key data structures, the mapping information including SPI information, protection subnet information and peer IP information, wherein the protection subnet information corresponds to the user information of the central node and the user information of the branch node, respectively, and the peer IP information corresponds to the IP information of the branch node.
[0120] For example, the query module 500 is also used to: obtain destination address information based on the return packet service message; perform a routing query based on the destination address information, and route to the IPsec interface of the IPsec manual tunnel.
[0121] For example, the return packet mapping information includes the IP information of the branch node, and the query module 500 is also used to: query the mapping table of the IPsec interface based on the IPsec manual tunnel to obtain the IP information of the branch node corresponding to the return packet service message.
[0122] For example, the sending module 600 is further configured to: encrypt and encapsulate the return packet service message to obtain the encapsulated return packet message; and send the encapsulated return packet message to the branch node based on the IPsec manual tunnel and return packet mapping information.
[0123] It should be noted that the service communication system based on IPsec manual tunnels provided in this application embodiment is different from... Figures 1 to 3 The method embodiments shown correspond to each other, and will not be described again here to avoid repetition.
[0124] This application also provides an electronic device, please refer to [link to application]. Figure 5 , Figure 5This is a structural block diagram of an electronic device provided in an embodiment of this application. The electronic device may include a processor 510, a communication interface 520, a memory 530, and at least one communication bus 540. The communication bus 540 is used to enable direct communication between these components. In this embodiment, the communication interface 520 of the electronic device is used for signaling or data communication with other node devices. The processor 510 may be an integrated circuit chip with signal processing capabilities.
[0125] The processor 510 described above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor, or the processor 510 can be any conventional processor.
[0126] The memory 530 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc. The memory 530 stores computer-readable instructions. When these computer-readable instructions are executed by the processor 510, the electronic device can perform the aforementioned operations. Figures 1 to 3 The various steps involved in the method implementation examples.
[0127] Alternatively, the electronic device may also include a storage controller and an input / output unit.
[0128] The memory 530, storage controller, processor 510, peripheral interface, and input / output unit are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses 540. The processor 510 is used to execute executable modules stored in the memory 530, such as software function modules or computer programs included in electronic devices.
[0129] The input / output unit is used to provide users with the ability to create tasks and to set optional start periods or preset execution times for those tasks, thereby enabling user-server interaction. The input / output unit may be, but is not limited to, a mouse and keyboard.
[0130] Understandable. Figure 5 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 5 The more or fewer components shown, or having the same Figure 5 The different configurations shown. Figure 5 The components shown can be implemented using hardware, software, or a combination thereof.
[0131] This application also provides a storage medium storing instructions. When the instructions are run on a computer, the computer program is executed by a processor to implement the method described in the method embodiment. To avoid repetition, the method will not be described again here.
[0132] This application also provides a computer program product that, when run on a computer, causes the computer to perform the method described in the method embodiment.
[0133] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0134] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0135] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0136] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0137] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0138] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A service communication method based on IPsec manual tunneling, characterized in that, The method, applied to the central node of an IPsec network, includes: Configure the IPsec manual tunnel of the central node, wherein the central node of the IPsec network is connected to at least one branch node, each branch node is configured to the IPsec manual tunnel of the central node, and a manual tunnel with a preset IP address is configured on the central node. The service packets sent by the branch node are obtained based on the IPsec manual tunnel; Generate mapping information based on the service message, and update the mapping information to the mapping table; Obtain the return packet to be sent; The mapping table is queried according to the return packet service message to obtain the return packet mapping information corresponding to the return packet service message; Based on the IPsec manual tunnel and the return packet mapping information, the return packet service message is sent to the branch node; Before the step of querying the mapping table based on the return packet service message to obtain the return packet mapping information corresponding to the return packet service message, the method further includes: Obtain the destination address information based on the return packet; A routing query is performed based on the destination address information, and the route is routed to the IPsec interface of the manual IPsec tunnel; The return packet mapping information includes the IP information of the branch node. The step of querying the mapping table according to the return packet service message to obtain the return packet mapping information corresponding to the return packet service message includes: Based on the IPsec interface of the IPsec manual tunnel, the mapping table is queried to obtain the IP information of the branch node corresponding to the return packet service message.
2. The service communication method based on IPsec manual tunnel according to claim 1, characterized in that, After the step of obtaining the service packets sent by the branch node based on the IPsec manual tunnel, the method further includes: Based on the business message, the key data structure is obtained by querying through SPI, wherein the key data structure is the data structure used for encryption and decryption in the IPsec manual tunnel.
3. The service communication method based on IPsec manual tunnel according to claim 2, characterized in that, The step of generating mapping information based on the service message includes: Mapping information is generated through the key data structure. The mapping information includes SPI information, protection subnet information, and peer IP information. The protection subnet information corresponds to the user information of the central node and the user information of the branch node, respectively, and the peer IP information corresponds to the IP information of the branch node.
4. The service communication method based on IPsec manual tunnel according to claim 1, characterized in that, The step of sending the return packet service message to the branch node based on the IPsec manual tunnel and the return packet mapping information includes: The return packet service message is encrypted and encapsulated to obtain the return packet encapsulated message; Based on the IPsec manual tunnel and the return packet mapping information, the encapsulated return packet is sent to the branch node.
5. A service communication system based on IPsec manual tunneling, characterized in that, A central node applied to an IPsec network, executing the service communication method based on a manual IPsec tunnel as described in any one of claims 1 to 4, wherein the service communication system based on a manual IPsec tunnel comprises: A configuration module is used to configure the IPsec manual tunnel of the central node, wherein the central node of the IPsec network is connected to at least one branch node; The packet acquisition module is used to acquire the service packets sent by the branch node based on the IPsec manual tunnel; The mapping module is used to generate mapping information based on the service message and update the mapping information to the mapping table; The response module is used to acquire the response service messages to be sent. The query module is used to query the mapping table based on the return packet service message to obtain the return packet mapping information corresponding to the return packet service message; The message sending module is used to send the return packet service message to the branch node based on the IPsec manual tunnel and the return packet mapping information.
6. The service communication system based on IPsec manual tunneling according to claim 5, characterized in that, The mapping module is also used for: Based on the business message, the key data structure is obtained by querying through SPI, wherein the key data structure is the data structure used for encryption and decryption in the IPsec manual tunnel.
7. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the service communication method based on an IPsec manual tunnel as described in any one of claims 1 to 4.
8. A storage medium, characterized in that, The storage medium stores instructions that, when executed on a computer, cause the computer to perform the service communication method based on an IPsec manual tunnel as described in any one of claims 1 to 4.
Citation Information
Patent Citations
IPSec VPN system control method
CN104883287A
Service interaction method and device, service system, electronic equipment and medium
CN116346769A
