Message transmission method, electronic device and storage medium
By determining the target virtual node when the target IP address is unreachable and forwarding it to the egress next hop address, the problem of policy routing being unable to point to the remote egress is solved, and effective pointing and packet transmission of the remote IP address are achieved.
Patent Information
- Application Number
- CN202211531201.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-12-01
AI Technical Summary
Policy routing in the existing technology cannot match and search for remote IP addresses that cannot be found locally and need to be reachable through tunnels. As a result, the destination address can only point to the local egress and cannot point to the remote egress.
By determining the target virtual node corresponding to the target IP address when the target IP address is unreachable, and based on the correspondence between the node and the reachable path information of the target IP address, the packet to be transmitted is forwarded to the egress next hop address. , thereby achieving pointing to the remote IP address.
When the target IP address is unreachable by local routes, policy routing can be directed to the remote IP address to ensure that packets can be transmitted to the target IP address, which expands the scope of policy routing.
Smart Images

Figure CN115865801B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to a message transmission method, an electronic device and a storage medium. Background Art
[0002] Policy routing is to configure a series of access control lists (ACLs) to match routing rules and forwarding actions, and bind them to ports or virtual local area networks (VLANs) so that the packets that hit this matching action can modify the forwarding path of the original packets according to the forwarding actions of policy routing.
[0003] The policy routing in the related technology can only configure and match local IP addresses, but cannot match and search for remote IP addresses that cannot be found locally and need to be reached through a tunnel. That is, the destination address of the policy routing in the related technology is only the local exit, and cannot point to the remote exit. Summary of the invention
[0004] The embodiments of the present application provide a message transmission method, an electronic device, and a storage medium to solve the problem in the related art that the destination address of the policy routing is only a local exit and cannot point to a remote exit.
[0005] In a first aspect, an embodiment of the present application provides a message transmission method, including:
[0006] In the case where a target Internet Protocol IP address of the message to be transmitted is unreachable through a local route, determining a target virtual node corresponding to the target IP address, wherein a first corresponding relationship is preset between the target virtual node and the reachable path information of the target IP address, and the reachable path information includes an exit next hop address of the reachable path of the target IP address;
[0007] Based on the first corresponding relationship, the message to be transmitted is forwarded to the egress next hop address through the target virtual node.
[0008] In a second aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the message transmission method described in the first aspect.
[0009] In a third aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the message transmission method described in the first aspect are implemented.
[0010] The technical solution provided by the present application is that, when the target IP address of the message to be transmitted is unreachable through the local route, by determining the target virtual node corresponding to the target IP address, wherein a first corresponding relationship is preset between the target virtual node and the reachable path information of the target IP address, and the reachable path information includes the exit next hop address of the reachable path of the target IP address, and based on the first corresponding relationship, the message to be transmitted is forwarded to the exit next hop address through the target virtual node; in this way, since the target virtual node corresponds to the target IP address, and the target virtual node corresponds to the reachable path information of the target IP address, the message to be transmitted can be forwarded to the exit next hop address of the reachable path through the target virtual node. At this time, since the target IP address can be reached through the reachable path, that is, the message to be transmitted can be transmitted to the target IP address through the exit next hop address of the reachable path, thereby achieving that when the target IP address is a remote IP address that is unreachable through the local route, the policy routing can be set to point to the remote IP address, and the message to be transmitted can be transmitted to the target IP address, thereby solving the problem that the destination address of the policy routing in the related art is only the local exit and cannot point to the remote exit. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is a schematic diagram of the step flow of the message transmission method in an embodiment of the present application;
[0012] Figure 2 This is a schematic diagram of information search when the target virtual node is a virtual port in an embodiment of the present application;
[0013] Figure 3 This is a schematic diagram of information search when the target virtual node is a loopback port in an embodiment of the present application;
[0014] Figure 4 It is a structural diagram of a message transmission device provided in an embodiment of the present application;
[0015] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0016] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0017] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.
[0018] Specifically, in the related art, the operation mode of policy routing under normal circumstances is: configure ACL matching items and configure the redirected forwarding path, which is generally the local forwarding outlet Internet Protocol (IP) address; generate ACL rules from ACL matching items and bind ports or VLANs, and the messages received by the ports or VLANs will match the ACL rules. If the matching items are hit, the messages will be forwarded according to the redirected forwarding path of the matching items. The operation mode of this policy routing can only configure and match local IP addresses, but cannot match and search for remote IP addresses that cannot be found locally and need to be reached through tunnels.
[0019] In view of the above-mentioned defects, in this embodiment, when the target IP address of the message to be transmitted is unreachable through the local route, by determining the target virtual node corresponding to the target IP address, wherein a first corresponding relationship is preset between the target virtual node and the reachable path information of the target IP address, and the reachable path information includes the exit next hop address of the reachable path of the target IP address, and based on the first corresponding relationship, the message to be transmitted is forwarded to the exit next hop address through the target virtual node; in this way, since the target virtual node corresponds to the target IP address, and the target virtual node corresponds to the reachable path information of the target IP address, the message to be transmitted can be forwarded to the exit next hop address of the reachable path through the target virtual node. At this time, since the target IP address can be reached through the reachable path, that is, the message to be transmitted can be transmitted to the target IP address through the exit next hop address of the reachable path, thereby achieving that when the target IP address is a remote IP address that is unreachable through the local route, the policy routing can be set to point to the remote IP address, and the message to be transmitted can be transmitted to the target IP address, and the destination address of the policy routing can be pointed to the remote exit.
[0020] The message transmission method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0021] Figure 1The process steps of a message transmission method provided by an embodiment of the present invention are shown. The method can be executed by an electronic device, and the electronic device may include: a server and / or a terminal device. In other words, the method can be executed by software or hardware installed in the electronic device, and the method includes the following steps:
[0022] Step 101: When the target IP address of the message to be transmitted is unreachable through the local route, determine the target virtual node corresponding to the target IP address.
[0023] There is a preset first corresponding relationship between the target virtual node and the reachable path information of the target IP address, and the reachable path information includes the exit next hop address of the reachable path of the target IP address.
[0024] Specifically, in this embodiment, when the target IP address of the message to be transmitted is not reachable through the local route, the reachable path of the target IP address can be determined first, and a first corresponding relationship between the target virtual node and the reachable path information of the target IP address can be established to achieve binding between the target virtual node and the reachable path information of the target IP address; in addition, the target virtual node and the target IP address also have a corresponding relationship.
[0025] In this way, when it is determined that the IP address of the message to be transmitted is the target IP address, the target virtual node corresponding to the target IP address can be determined. At this time, since there is a first corresponding relationship between the target virtual node and the reachable path information of the target IP address, the reachable path information includes the exit next-hop address of the reachable path of the target IP address, so that when the message to be transmitted points to the target virtual node, the message to be transmitted can be forwarded to the exit next-hop address through the target virtual node, thereby realizing the accurate forwarding process of the message to be transmitted through the target virtual node.
[0026] Step 102: Based on the first corresponding relationship, forward the message to be transmitted to the egress next hop address through the target virtual node.
[0027] A first correspondence is preset between the target virtual node and the reachable path information of the target IP address, so that based on the first correspondence, the message to be transmitted can be forwarded to the exit next-hop address of the reachable path of the target IP address through the target virtual node. At this time, since the reachable path can reach the target IP address, the message to be transmitted can continue to be transmitted to the target IP address after being forwarded to the exit next-hop address of the reachable path, thereby achieving the goal of pointing to the target IP address when the target IP address of the message to be transmitted is unreachable through the local route.
[0028] Specifically, in one embodiment, before determining the target virtual node corresponding to the target IP address, the following steps are also included:
[0029] Determine a reachable path to the IP address based on the IP address and a preset routing table, wherein the routing table stores a reachable path to the IP address;
[0030] A second corresponding relationship between the IP address and the reachable path information of the reachable path is established, wherein the IP address includes the target IP address.
[0031] Specifically, the routing table stores a reachable path pointing to the IP address. Therefore, based on the IP address, the reachable path to the IP address can be determined by querying the routing table, and a second correspondence between the IP address and the reachable path information of the reachable path can be established. At this time, since the IP address includes the target IP address, the reachable path information corresponding to the target IP address can be obtained through the second correspondence.
[0032] Furthermore, in one embodiment, before determining the target virtual node corresponding to the target IP address, the exit of the reachable path may be set as the virtual node, and a corresponding relationship between the reachable path information of the IP address and the virtual node may be established.
[0033] Specifically, by setting the exit of the reachable path as a virtual node, and because the IP address includes the target IP address, that is, the exit of the reachable path of the target IP address is the target virtual node, it is possible to determine the target virtual node corresponding to the target IP address based on the target IP address and the reachable path information corresponding to the target IP address, so that when configuring policy routing, if it is found that the configured local route of the IP address is unreachable, the policy routing can point to the virtual node corresponding to the IP address, thereby completing the setting of the policy routing to point to the IP address. In addition, by establishing a correspondence between the reachable path information of the IP address and the virtual node, since the IP address includes the target IP address, that is, the correspondence includes the first correspondence between the reachable path information of the target IP address and the target virtual node corresponding to the target IP address, it is possible to obtain the first correspondence between the reachable path information of the target IP address and the target virtual node corresponding to the target IP address through the correspondence, so that the message to be transmitted can be forwarded to the exit next hop address of the reachable path of the target IP address.
[0034] In addition, the reachable path of the IP address may change. In this case, in one embodiment, when the reachable path of the target IP address changes, the first correspondence can be updated to a third correspondence between the target virtual node and the reachable path information of the changed reachable path.
[0035] It should be noted that changes in the reachable path may include deletion, addition, reconstruction, etc. of the path. In this way, when the reachable path of the target IP address changes, the first correspondence is updated to a third correspondence between the target virtual node and the reachable path information of the changed reachable path, thereby achieving a real-time update process of the reachable path information corresponding to the target virtual node, thereby ensuring that the path pointing to the target virtual node is correct.
[0036] In addition, the exit next-hop address of the reachable path of the IP address may change. In this case, in one embodiment, when the exit next-hop address of the reachable path changes, the exit next-hop address included in the reachable path information in the first corresponding relationship can be modified to the changed exit next-hop address.
[0037] Specifically, if the reachable path has not changed, but the exit next-hop address of the reachable path has changed, the exit next-hop address included in the reachable path information in the first correspondence can be modified to the changed exit next-hop address, so that the target virtual node does not need to take any action, and its exit information will be changed directly as the exit information of the reachable path changes.
[0038] In addition, the target virtual node may be a virtual port or a loopback port, the reachable path may be a tunnel, and the reachable path information also includes tunnel information. For different target virtual nodes, the message to be transmitted may be forwarded to the egress next hop address through the target virtual node based on the first corresponding relationship in different ways. This is described below.
[0039] In one embodiment, when the target virtual node is a virtual port and the reachable path is a tunnel, the reachable path information further includes tunnel information, and forwarding the to-be-transmitted message to the egress next-hop address through the target virtual node based on the first correspondence may include the following steps:
[0040] Based on the first corresponding relationship, the tunnel information and the message to be transmitted are encapsulated, and the encapsulated message is transmitted to the tunnel through the virtual port and directly reaches the exit next hop address corresponding to the tunnel.
[0041] Specifically, if the device chip supports the virtual port function, the virtual port can be directly used as the target virtual node, that is, the virtual port is bound to the reachable path information of the target IP address. When the exit issued by the policy route is the target IP address, a virtual port is first assigned to it, and the policy route is directly pointed to this virtual port, and the relationship between this virtual port and the target IP address is recorded. At the same time, the reachable path is searched in the device. After the reachable path is found, the next hop address of the reachable path is directly written into the virtual port table of the virtual port, so that the virtual port directly points to the exit that can reach the target IP address. In this way, after the message to be transmitted hits the policy route, it will be pointed to the virtual port for forwarding, and the virtual port will directly point the message to be transmitted to the real next hop exit that can deliver the target IP address.
[0042] In addition, since the virtual port supports direct encapsulation of tunnel information, when the message to be transmitted is forwarded to the exit next hop address through the target virtual node, the tunnel information and the message to be transmitted can be encapsulated, and the encapsulated message can be transmitted to the tunnel through the virtual port and directly reach the exit next hop address corresponding to the tunnel.
[0043] In one embodiment, when determining the exit next hop address of the tunnel, the exit next hop address of the tunnel may be determined based on a pre-set tunnel table, wherein the exit next hop address of the tunnel is stored in the tunnel table.
[0044] The following is a specific example to illustrate this situation. Figure 2 As shown in the information query diagram, in one embodiment, it is assumed that 10.10.10.1 is redirected to 1.1.1.1, the target IP address is 1.1.1.1, and the target IP address 1.1.1.1 needs to be reachable through Multi-Protocol Label Switching (MPLS) tunnel tunnel1.
[0045] Assuming that the target virtual node is a virtual port, the message forwarding can be performed through the following process:
[0046] Step 21, the policy routing sends 10.10.10.1 to redirect to the target IP address 1.1.1.1.
[0047] Step 22: The device searches for 1.1.1.1 in the routing table and finds it is unreachable, so it enters the iterative search process.
[0048] Step 23: The device searches for a reachable path to 1.1.1.1 through the routing table iteration and finds that the MPLS tunnel tunnel1 is reachable.
[0049] Step 24: Allocate a virtual port (VP1) for the target IP address 1.1.1.1 and redirect the policy route 10.10.10.1 to VP1.
[0050] Step 25: Look up the exit next hop address of the MPLS tunnel tunnel1 through the tunnel table, and find that the exit in its chip is the next hop nexthop1001.
[0051] Step 26, point the egress of VP1 to the egress nexthop1001 of the MPLS tunnel tunnel1, that is, establish a correspondence between the virtual port and the reachable path information, which can also be called a virtual port table; in addition, a next hop table can also be established, which contains the specific egress information and tunnel information of the tunnel.
[0052] Step 27: Record the corresponding relationship between VP1 and 1.1.1.1. If the tunnel to 1.1.1.1 is deleted, added, or rebuilt, refresh the pointing relationship of the new nexthop of VP1.
[0053] Through the above steps, all actions of the entire policy routing pointing to the target IP address 1.1.1.1 are completed. From the above operations, it can be seen that the exit of the MPLS tunnel tunnel1 is the chip exit nexthop1001, and at the same time, the exit of VP1 also points to this nexthop1001. Therefore, if the exit information of the MPLS tunnel changes (not the deletion or addition of the tunnel itself), there is no need to process VP1, and the exit information of VP1 will automatically change with the change of nexthop1001. If the tunnel to the target IP address 1.1.1.1 changes (addition, deletion, reconstruction), it is necessary to refresh the tunnel pointing information of VP1 according to the corresponding relationship between 1.1.1.1 and VP1.
[0054] In another embodiment, when the target virtual node is a loopback port and the reachable path is a tunnel, the reachable path information further includes tunnel information, and forwarding the to-be-transmitted message to the egress next-hop address through the target virtual node based on the first corresponding relationship includes:
[0055] Based on the first corresponding relationship, the message to be transmitted is transmitted to the tunnel through the loopback port; the tunnel information and the message to be transmitted are encapsulated and sent to the exit next hop address.
[0056] Specifically, if the device chip does not support one-time processing of policy routing forwarding and tunnel encapsulation, that is, it cannot support the iteration of tunnel encapsulation (some chips will consider policy routing forwarding as one forwarding behavior, and tunnel encapsulation as another forwarding behavior, and the chip cannot perform two behaviors in one forwarding), then the loopback port can be used as the target virtual node. If the tunnel information corresponding to the target IP address is found, it can be processed separately, that is, the policy routing exit with the destination address as the target IP can be pointed to a loopback port first, and the relevant information of the tunnel can be configured on this loopback port, so that after the message to be transmitted is matched to the policy routing with the destination address as the target IP for the first time, the message to be transmitted is sent to the loopback port to complete the first policy routing forwarding behavior, and then the message to be transmitted loops back from the loopback port to enter the tunnel, and then encapsulates the tunnel information, and is sent from the real exit of the tunnel found by the target IP address to complete the second tunnel encapsulation forwarding behavior.
[0057] The following is a specific example to illustrate this situation. Figure 3 As shown in the information query schematic diagram, in one embodiment, it is assumed that 10.10.10.1 is redirected to 1.1.1.1, the target IP address is 1.1.1.1, and the target IP address 1.1.1.1 needs to be reachable through the MPLS tunnel tunnel1.
[0058] Assuming that the target virtual node is a loopback port, the message forwarding can be performed through the following process:
[0059] Step 31, the policy routing sends 10.10.10.1 to redirect to the target IP address 1.1.1.1.
[0060] Step 32: The device searches for 1.1.1.1 in the routing table and finds it is unreachable, so it enters the iterative search process.
[0061] Step 33: The device searches for a reachable path to 1.1.1.1 through the routing table iteration and finds that the MPLS tunnel tunnel1 is reachable.
[0062] Step 34. Assign a loopback port loopback1 to 1.1.1.1 and redirect the policy route 10.10.10.1 to loopback1.
[0063] Step 35: Look up the next hop address of the exit of MPLS tunnel tunnel1, and find that the exit in its chip is the next hop nexthop1001.
[0064] Step 36: Set the loopback1 port to access the MPLS tunnel tunnel1. At this time, an access table can be established, that is, as long as the message enters from the loopback port loopback1, it will directly enter the MPLS tunne1 for tunnel encapsulation and be sent out from the exit nexthop1001 of tunnel1.
[0065] Step 37: Record the corresponding relationship between loopback1 and 1.1.1.1. If the tunnel to 1.1.1.1 is deleted, added, or rebuilt, refresh the port access relationship of the new MPLS tunnel of loopback1.
[0066] The above completes all actions of the entire policy routing pointing to the target IP address 1.1.1.1. From the above operations, it can be seen that when the chip does not support one-time completion of policy routing forwarding and tunnel encapsulation, the policy routing pointing can be completed with the help of loopback1 loopback, and loopback1 is used to access the MPLS tunnel tunnel1 to complete the process of pointing the message to the MPLS tunnel tunnel1 exit nexthop1001. Since loopback1 points to the MPLS tunnel tunnel1 itself, the exit change of tunnel1 will directly reflect the policy routing pointing. If the tunnel to the target IP address 1.1.1.1 changes (addition, deletion, reconstruction), it is necessary to refresh the tunnel pointing information of loopback1 according to the corresponding relationship between 1.1.1.1 and loopback1.
[0067] In this way, in the present embodiment and related technologies, the exits pointed to by the policy routing are all locally reachable IP addresses, but cannot point to the remote IP address. The reachable tunnel information of the target IP address can be directly searched iteratively, and this information is bound to the virtual node. Then the policy routing is pointed to this virtual node, and the setting of the policy routing pointing to the remote target IP address can be completed. At the same time, the relationship between the virtual node and the remote target IP address is maintained, so that when the tunnel pointing to the remote target IP changes, the policy routing does not need to adjust the configuration (always pointing to the remote target IP address), and its pointing will automatically change. This embodiment expands the scope of use of policy routing.
[0068] Figure 4 FIG. 2 is a schematic diagram showing the structure of a message transmission device provided by an embodiment of the present invention. Figure 4 As shown, the device comprises:
[0069] A determination module 401 is used to determine a target virtual node corresponding to the target Internet Protocol IP address when the target Internet Protocol IP address of the message to be transmitted is unreachable through the local route, wherein a first corresponding relationship is preset between the target virtual node and the reachable path information of the target IP address, and the reachable path information includes an exit next hop address of the reachable path of the target IP address;
[0070] The forwarding module 402 is used to forward the message to be transmitted to the egress next hop address through the target virtual node based on the first corresponding relationship.
[0071] In one embodiment, the determination module 401 is used to determine a reachable path to the IP address based on the IP address and a pre-set routing table, wherein the routing table stores a reachable path pointing to the IP address; and establish a second correspondence between the IP address and the reachable path information of the reachable path, wherein the IP address includes the target IP address.
[0072] In one embodiment, the determination module 401 is used to set the exit of the reachable path as the virtual node, and establish a corresponding relationship between the reachable path information of the IP address and the virtual node.
[0073] In one embodiment, when the target virtual node is a virtual port and the reachable path is a tunnel, the reachable path information also includes tunnel information, and the forwarding module 402 is used to encapsulate the tunnel information and the message to be transmitted based on the first correspondence, and transmit the encapsulated message to the tunnel through the virtual port and directly reach the exit next hop address corresponding to the tunnel.
[0074] In one embodiment, when the target virtual node is a loopback port and the reachable path is a tunnel, the reachable path information also includes tunnel information. The forwarding module 402 is used to transmit the message to be transmitted to the tunnel through the loopback port based on the first corresponding relationship; encapsulate the tunnel information and the message to be transmitted, and send them to the exit next hop address.
[0075] The device provided in the embodiment of the present application can achieve Figure 1-3 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0076] It should be noted that the embodiments of the message transmission device in this specification and the embodiments of the message transmission method in this specification are based on the same inventive concept. Therefore, the specific implementation of the embodiments of the message transmission device can refer to the aforementioned corresponding implementation of the embodiments of the message transmission method, and the repeated parts will not be repeated.
[0077] The message transmission device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0078] The message transmission device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0079] Based on the same technical concept, an embodiment of the present application further provides an electronic device, which is used to execute the above-mentioned message transmission method. Figure 5 A schematic diagram of the structure of an electronic device for implementing various embodiments of the present application. The electronic device may have relatively large differences due to different configurations or performances, and may include a processor (processor) 510, a communication interface (Communications Interface) 520, a memory (memory) 530 and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call a computer program stored in the memory 530 and executable on the processor 510 to perform the following steps:
[0080] In the case where a target Internet Protocol IP address of the message to be transmitted is unreachable through a local route, determining a target virtual node corresponding to the target IP address, wherein a first corresponding relationship is preset between the target virtual node and the reachable path information of the target IP address, and the reachable path information includes an exit next hop address of the reachable path of the target IP address;
[0081] Based on the first corresponding relationship, the message to be transmitted is forwarded to the egress next hop address through the target virtual node.
[0082] In one embodiment, before determining the target virtual node corresponding to the target IP address, it also includes: determining a reachable path to the IP address based on the IP address and a pre-set routing table, wherein the routing table stores a reachable path pointing to the IP address; establishing a second corresponding relationship between the IP address and the reachable path information of the reachable path, wherein the IP address includes the target IP address.
[0083] In one embodiment, before determining the target virtual node corresponding to the target IP address, the method further includes: setting the exit of the reachable path to the virtual node, and establishing a corresponding relationship between the reachable path information of the IP address and the virtual node.
[0084] In one embodiment, when the target virtual node is a virtual port and the reachable path is a tunnel, the reachable path information also includes tunnel information, and forwarding the message to be transmitted to the exit next-hop address through the target virtual node based on the first correspondence includes: based on the first correspondence, encapsulating the tunnel information and the message to be transmitted, and transmitting the encapsulated message to the tunnel through the virtual port and directly reaching the exit next-hop address corresponding to the tunnel.
[0085] In one embodiment, when the target virtual node is a loopback port and the reachable path is a tunnel, the reachable path information also includes tunnel information, and forwarding the message to be transmitted to the exit next-hop address through the target virtual node based on the first correspondence includes: based on the first correspondence, transmitting the message to be transmitted to the tunnel through the loopback port; encapsulating the tunnel information and the message to be transmitted, and sending them to the exit next-hop address.
[0086] In one embodiment, the message transmission method further includes: determining the exit next hop address of the tunnel based on a pre-set tunnel table, wherein the exit next hop address of the tunnel is stored in the tunnel table.
[0087] In one embodiment, when the reachable path of the target IP address changes, the first correspondence is updated to a third correspondence between the target virtual node and the reachable path information of the changed reachable path.
[0088] In one embodiment, when the egress next hop address of the reachable path changes, the egress next hop address included in the reachable path information in the first corresponding relationship is modified to the changed egress next hop address.
[0089] The specific execution steps can refer to the various steps of the above-mentioned message transmission method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.
[0090] It should be noted that the electronic devices in the embodiments of the present application include: servers, terminals, or other devices except terminals.
[0091] The above electronic device structure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the input unit may include a graphics processing unit (GPU) and a microphone, and the display unit may be configured with a display panel in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit includes a touch panel and at least one of other input devices. The touch panel is also called a touch screen. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0092] The memory can be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM).
[0093] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.
[0094] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned message transmission method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0095] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0096] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0097] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0098] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0100] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A message transmission method, characterized in that: include: When the result of searching the routing table for the target Internet Protocol IP address of the message to be transmitted is unreachable, determining a target virtual node corresponding to the target IP address, wherein a first corresponding relationship is preset between the target virtual node and the reachable path information of the target IP address, and the reachable path information includes the exit next hop address of the reachable path of the target IP address; Based on the first corresponding relationship, the message to be transmitted is forwarded to the egress next hop address through the target virtual node.
2. The message transmission method according to claim 1, characterized in that: Before determining the target virtual node corresponding to the target IP address, the method further includes: Determine a reachable path to the IP address based on the IP address and a preset routing table, wherein the routing table stores a reachable path to the IP address; A second corresponding relationship between the IP address and the reachable path information of the reachable path is established, wherein the IP address includes the target IP address.
3. The message transmission method according to claim 2, characterized in that: Before determining the target virtual node corresponding to the target IP address, the method further includes: The exit of the reachable path is set as the virtual node, and a corresponding relationship between the reachable path information of the IP address and the virtual node is established.
4. The message transmission method according to claim 1, characterized in that: In the case where the target virtual node is a virtual port and the reachable path is a tunnel, the reachable path information further includes tunnel information, and the forwarding of the to-be-transmitted message to the egress next-hop address through the target virtual node based on the first corresponding relationship includes: Based on the first corresponding relationship, the tunnel information and the message to be transmitted are encapsulated, and the encapsulated message is transmitted to the tunnel through the virtual port and directly reaches the exit next hop address corresponding to the tunnel.
5. The message transmission method according to claim 1, characterized in that: In the case where the target virtual node is a loopback port and the reachable path is a tunnel, the reachable path information further includes tunnel information, and forwarding the to-be-transmitted message to the egress next-hop address through the target virtual node based on the first corresponding relationship includes: Based on the first corresponding relationship, transmitting the message to be transmitted to the tunnel through the loopback port; The tunnel information and the message to be transmitted are encapsulated and sent to the egress next hop address.
6. The message transmission method according to claim 4 or 5, characterized in that: It is characterized in that The message transmission method also includes: Based on a preset tunnel table, an exit next hop address of the tunnel is determined, wherein the exit next hop address of the tunnel is stored in the tunnel table.
7. The message transmission method according to claim 1 or 2, characterized in that: The message transmission method also includes: In the case where the reachable path of the target IP address changes, the first correspondence is updated to a third correspondence between the target virtual node and the reachable path information of the changed reachable path.
8. The message transmission method according to claim 1 or 2, characterized in that: The message transmission method also includes: In the case where the egress next hop address of the reachable path changes, the egress next hop address included in the reachable path information in the first corresponding relationship is modified to the changed egress next hop address.
9. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the message transmission method according to any one of claims 1 to 8.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the message transmission method according to any one of claims 1 to 8 are implemented.
