Packet forwarding method, electronic device, storage medium, and program product
By pre-configuring the association between service flows and network tunnels on the server-side device, the problem of low efficiency in packet forwarding path configuration is solved, enabling efficient and flexible packet forwarding and differentiated services.
Patent Information
- Application Number
- PCT/CN2025/078806
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-31
- Filing Date
- 2025-02-24
- Publication Date
- 2025-12-04
AI Technical Summary
The configuration efficiency and flexibility of message forwarding paths in existing technologies are low, which can easily lead to operational errors and delays, especially when the network topology changes or is changed in batches.
By pre-configuring the identification information of service flows and the preset association between network tunnels on the server-side device, the service flow is determined based on the target address information and the corresponding network tunnel is selected for packet forwarding, reducing manual configuration and management.
It improves the configuration efficiency and flexibility of message forwarding paths, enables differentiated services for different business flows, and reduces operational errors and path management processes.
Smart Images

Figure CN2025078806_04122025_PF_FP_ABST
Abstract
Description
Message forwarding methods, electronic devices, storage media and software products
[0001] Cross-referencing
[0002] This application claims priority to Chinese Patent Application No. 202410701032.8, filed on May 31, 2024, entitled "Message Forwarding Method, Electronic Device, Storage Medium and Program Product", the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of communication technology, and in particular to a message forwarding method, electronic device, storage medium, and program product. Background Technology
[0004] In 2G, 3G, or 4G services, networks encounter various complex situations, such as spanning multiple operators, geographical locations, complex topologies, and different service levels or protocols. For different services, different forwarding paths can be specified to optimize traffic forwarding based on service requirements, quality of service requirements, or network topology. In practice, manually configuring and managing forwarding paths is commonly used, which is not only inefficient but also inflexible in the face of network changes and expansions. Especially when the topology changes or the specified paths for a particular service are changed in batches, a large number of forwarding paths need to be manually updated and adjusted, which can easily lead to operational errors or delays. Therefore, improving the efficiency and flexibility of packet forwarding path configuration has become one of the urgent problems to be solved. Summary of the Invention
[0005] The purpose of this application is to provide a message forwarding method, electronic device, storage medium, and program product.
[0006] On one hand, embodiments of this application provide a packet forwarding method, including: receiving a virtual routing forwarding packet sent by a private network device; the virtual routing forwarding packet carrying first target address information; determining a first service flow corresponding to the virtual routing forwarding packet based on the first target address information; determining a first network tunnel corresponding to the virtual routing forwarding packet based on the first service flow and a preset association relationship; the preset association relationship being a correspondence between the identification information of the service flow and the network tunnel; the identification information of the service flow including the first identification information of the first service flow; and forwarding the virtual routing forwarding packet to the target network device corresponding to the first target address information through the first network tunnel.
[0007] On the other hand, embodiments of this application provide an electronic device, including a processor and a memory electrically connected to the processor, the memory storing a computer program, and the processor being used to call and execute the computer program from the memory to implement the above-described message forwarding method.
[0008] In another aspect, embodiments of this application provide a computer-readable storage medium for storing a computer program that can be executed by a processor to implement the above-described message forwarding method.
[0009] In another aspect, embodiments of this application provide a computer program product, which includes a computer program that is executed by a processor to implement the above-described message forwarding method. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in one or more embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in one or more embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 is a schematic diagram of an application scenario of a message forwarding method according to an embodiment of this application;
[0012] Figure 2 is a schematic flowchart of a message forwarding method according to an embodiment of this application;
[0013] Figure 3 is a schematic diagram of an application scenario of a message forwarding method according to another embodiment of this application;
[0014] Figure 4 is a schematic diagram of an application scenario of a message forwarding method according to another embodiment of this application;
[0015] Figure 5 is a schematic block diagram of a message forwarding device according to an embodiment of this application;
[0016] Figure 6 is a schematic block diagram of an electronic device according to an embodiment of the present application. Detailed Implementation
[0017] This application provides a message forwarding method, electronic device, storage medium, and program product to solve the problems of low efficiency and poor flexibility in configuring message forwarding paths in related technologies.
[0018] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0019] The message forwarding method provided in this application can be executed by an electronic device or by software installed in an electronic device. Specifically, the electronic device can be a terminal device or a server device. The terminal device can include smartphones, laptops, smart wearable devices, vehicle terminals, etc., and the server device can include an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of cloud computing.
[0020] Figure 1 is a schematic diagram of an application scenario of a packet forwarding method according to an embodiment of this application. As shown in Figure 1, the application scenario of the packet forwarding method includes a private network device and a server device. The private network device can be a CE (Customer Edge Router), and the server device can be a PE (Provider Edge Router). In actual application scenarios, the CE and PE can also be connected to other neighboring nodes, which are not shown in Figure 1 due to space limitations.
[0021] In the application scenario shown in Figure 1, a BGP (Border Gateway Protocol) neighbor relationship is configured between the private network device and the server device. The private network device sends the VRF (Virtual Routing Forwarding) packets that need to be forwarded and the destination address information to the server device, which then forwards the VRF packets to the target network device corresponding to the destination address information. In related technologies, the association between the color attribute of the private network device and the VRF is typically configured in the VRF on the private network device, linking the color attribute to the network tunnel. When the VRF needs to change the network tunnel for forwarding packets, the association between the color attribute and the network tunnel needs to be modified in the corresponding VRF. In practical applications, the number of VRFs and the number of advertised routes within them are large. Each change requires modifying the configuration information in the private network device, leading to cumbersome operations and a high risk of errors. Therefore, this method reduces packet forwarding efficiency and makes configuration information difficult to manage.
[0022] Figure 2 is a schematic flowchart of a message forwarding method according to an embodiment of this application. As shown in Figure 2, the method is applied to the server device in the scenario shown in Figure 1, and includes the following steps S202-S208:
[0023] Step S202: Receive a VRF message sent by a private network device. The VRF message carries the first destination address information.
[0024] The first destination address information is the destination to which the VRF message will be forwarded, i.e., the address information of the target network device. The first destination address information can be the IP address (Internet Protocol Address) of the target network device.
[0025] Step S204: Determine the first service flow corresponding to the VRF message based on the first target address information.
[0026] In one embodiment, when determining the first service flow, the first service flow corresponding to the VRF packet can be determined based on the first destination address information and the routing table of the private network device.
[0027] The routing table of a private network device can be created in advance within the private network device and advertised to the server device by the private network device. In one embodiment, the private network device can send the routing table to the server device via BGP, and the server device receives the routing table sent by the private network device via BGP. The routing table includes routing information for each service flow of the private network device, and the routing information for each service flow includes the destination address information corresponding to the service flow. For example, the routing table includes routing information for service flows VRF1 and VRF2. The routing information for VRF1 includes: VRF1—10.30.1.1, indicating that the destination address information for service flow VRF1 is "10.30.1.1".
[0028] After obtaining the first destination address information, the server device queries the routing table pre-announced by the private network device to determine the first service flow corresponding to the first destination address information. If the routing information of the first service flow carries the first identifier information, the first identifier information of the first service flow can be further determined.
[0029] Step S206: Determine the first network tunnel corresponding to the VRF message based on the first service flow and the preset association relationship.
[0030] The preset association relationship is the correspondence between the identification information of service flows and network tunnels. The identification information of service flows includes the first identification information of the first service flow. The preset association relationship can be pre-configured on the server-side device. When configuring the preset association relationship, the correspondence between each identification information and each network tunnel can be obtained first, and then the preset association relationship can be generated based on the correspondence. One network tunnel corresponds to one identification information.
[0031] In one embodiment, the identification information includes at least one of the following: community attribute information, path attribute information, local priority attribute information, and multiple exit distinction attribute information (MED) in the Border Network Protocol (BGP).
[0032] When determining the first network tunnel corresponding to a VRF packet, the routing information of the first service flow can be determined first based on the first service flow and the routing table. Then, the first network tunnel corresponding to the VRF packet can be determined based on the first identification information and a preset association relationship. The routing information of the first service flow carries the first identification information. Since the routing table includes the routing information of each service flow of the private network device, the routing information of the first service flow can be determined by querying the routing table after the first service flow is identified. Based on the first identification information carried in the routing information of the first service flow, and the correspondence between the identification information and network tunnels in the preset association relationship, the first network tunnel corresponding to the first identification information can be determined.
[0033] The following are some examples illustrating the correspondence between identification information and network tunnels:
[0034] Identifier A – Network Tunnel A; Identifier B – Network Tunnel B; Identifier C – Network Tunnel C.
[0035] In the above-mentioned preset association relationship, Identifier A, Identifier B and Identifier C are identification information. It can be seen that as long as the identification information of the service flow corresponding to the virtual route forwarding message is determined, the network tunnel used to forward VRF messages can be determined.
[0036] In some embodiments, there may be multiple network tunnels associated with the same identification information. If there are multiple network tunnels associated with the same identification information, one network tunnel can be selected from these multiple network tunnels to forward VRF messages, or VRF messages can be forwarded through multiple network tunnels in a load-sharing manner.
[0037] Step S208: The VRF message is forwarded to the target network device corresponding to the first target address information through the first network tunnel.
[0038] The technical solution of this application embodiment, upon receiving a virtual routing forwarding message sent by a private network device, determines the first service flow corresponding to the virtual routing forwarding message based on the first destination address information carried in the virtual routing forwarding message. Based on the first service flow and a preset association relationship (i.e., the correspondence between the service flow's identification information and the network tunnel), the first network tunnel corresponding to the virtual routing forwarding message is determined. Then, the virtual routing forwarding message is forwarded to the target network device corresponding to the first destination address information through the first network tunnel. It is evident that by pre-configuring the preset association relationship (i.e., the correspondence between the service flow's identification information and the network tunnel), when a virtual routing forwarding message needs to be forwarded, the network tunnel for forwarding the message can be determined based on the service flow corresponding to the virtual routing forwarding message and the preset association relationship, without requiring manual configuration and management of the message forwarding path by the user, greatly improving the configuration efficiency of the message forwarding path. Furthermore, in the case of multiple service flows, by configuring corresponding identification information for each service flow, message forwarding can be performed for different service flows through their respective network tunnels, achieving flexibility in configuring the message forwarding path and providing differentiated services to different service flows.
[0039] In one embodiment, before receiving VRF messages sent by a private network device, a preset association relationship is configured on the server device in advance; and, first identification information is configured in the routing information of the first service flow so that the routing information of the first service flow carries the first identification information.
[0040] When configuring the first identification information in the routing information, it can be configured according to the packet forwarding requirements. For example, if the packet forwarding requirement is to forward the VRF packets of the first service flow through network tunnel A, then the first identification information associated with network tunnel A can be configured in the routing information. In this way, after the server device receives the routing table sent by the private network device via BGP, it can determine the network tunnel A associated with the first identification information based on the first identification information carried in the routing information of the first service flow in the routing table, and thus use network tunnel A to forward the VRF packets of the first service flow.
[0041] In this embodiment, only a preset association relationship (i.e., the correspondence between identification information and network tunnel) needs to be configured in advance, and the identification information needs to be configured in the routing information of the service flow. This enables the server device to quickly and accurately determine the network tunnel used to forward VRF packets without the need for the user to manually configure and manage the forwarding path, which greatly improves the configuration efficiency and flexibility of VRF packet forwarding path.
[0042] In one embodiment, in response to a request to forward VRF messages through a second network tunnel, a second identification information associated with the second network tunnel is determined according to a preset association relationship, and then the first identification information carried in the routing information of the first service flow is modified to the second identification information.
[0043] Following the preset association relationships in the above embodiments, assume the first identification information is identifier A and the second identification information is identifier B. Identifier A is pre-configured in the routing table of the private network device, so that the routing information of the first service flow carries identifier A. Based on the association relationship corresponding to identifier A, the network tunnel for forwarding VRF packets for the first service flow can be determined as network tunnel A. When the network topology changes and it is necessary to use network tunnel B to forward VRF packets for the first service flow, simply modify the identifier A carried in the routing information of the first service flow to identifier B.
[0044] After modifying the identification information carried in the routing information of the first service flow, the private network device resends its routing table to the server device, or resends the routing information of the first service flow to the server device. This allows the private network device to announce the new identification information (i.e., identifier B) carried in the routing information of the first service flow to the server device. This enables the server device to update the identifier corresponding to the first service flow in its local routing table from identifier A to identifier B. Upon receiving the packet corresponding to the first service flow, the server device can determine the associated network tunnel B based on identifier B and forward the VRF packet for the first service flow through network tunnel B. The private network device can resend the routing table or the routing information of the first service flow to the server device via BGP.
[0045] In this embodiment, when it is necessary to use the second network tunnel to forward VRF packets of the first service flow, it is only necessary to modify the first identification information carried in the routing information of the first service flow to the second identification information associated with the second network tunnel. This eliminates the need for users to manually modify the forwarding path of the VRF packets on each network node, and also eliminates the need to modify the correspondence between the identification information and the network tunnel, thus saving a lot of unnecessary path management processes.
[0046] In one embodiment, within the preset association relationship, the same identifier information can be associated with multiple network tunnels. When there are multiple network tunnels corresponding to the first identifier information, when determining the first network tunnel corresponding to the VRF packet based on the first identifier information and the preset association relationship, firstly, multiple candidate network tunnels corresponding to the first identifier information are determined based on the first identifier information and the preset association relationship. Then, according to a preset filtering method, at least one network tunnel is selected as the first network tunnel from the multiple candidate network tunnels. When there are multiple first network tunnels, the multiple first network tunnels forward the VRF packet in a load-sharing manner. For example, one network tunnel may be selected as the first network tunnel from the multiple candidate network tunnels, or some network tunnels may be selected as the first network tunnel, or all candidate network tunnels may be selected as the first network tunnel.
[0047] The preset filtering method can be any of the following: random filtering, filtering in a predetermined order, selecting the tunnel with the largest bandwidth, selecting all network tunnels, etc.
[0048] If there are multiple first network tunnels, VRF packets can be forwarded through these tunnels in a load-sharing manner. For example, firstly, load balancing is performed on the multiple first network tunnels based on packet forwarding information. Then, based on the result of the load balancing, VRF packets are forwarded to the target network device through the multiple first network tunnels. The packet forwarding information includes at least one of the following: the tunnel bandwidth of each first network tunnel and the number of VRF packets.
[0049] For example, if there are 5 first network tunnels associated with the first identification information, and the number of VRF messages is also 5, then a VRF message can be allocated to each first network tunnel, so that the 5 VRF messages can be forwarded to the target network device through the 5 first network tunnels.
[0050] For example, if there are 5 first network tunnels associated with the first identification information and the number of VRF messages is 9, then VRF messages can be allocated to each first network tunnel according to the tunnel bandwidth of each first network tunnel. For example, according to the tunnel bandwidth, 1, 2, 3, 2, and 1 VRF messages can be allocated to the 5 first network tunnels for forwarding in sequence.
[0051] In this embodiment, within the preset association relationships, one or more network tunnels can be associated with the same identifier information. In this case, it is possible to simultaneously forward VRF packets for private network devices through multiple network tunnels, which not only achieves flexibility in configuring VRF packet forwarding paths but also reduces the forwarding pressure on each network tunnel and improves the forwarding efficiency of VRF packets.
[0052] In one embodiment, after determining the first network tunnel corresponding to the VRF message based on the first service flow and the preset association relationship, the first network tunnel for forwarding the VRF message is determined based on the server device's IGP (Interior Gateway Protocol) in any of the following cases: the tunnel status of the first network tunnel is unreachable, or there is no network tunnel associated with the first identification information in the preset association relationship, or there is no associated first identification information in the first service flow.
[0053] In this embodiment, determining the network tunnel for forwarding VRF packets based on the IGP means using the routing calculation method agreed upon in the server device's IGP to determine the network tunnel for forwarding VRF packets. The routing calculation method can be agreed upon in the IGP according to actual business needs; this is existing technology and will not be elaborated upon here.
[0054] In one embodiment, if the first service flow does not have associated first identification information, after determining the first network tunnel for forwarding VRF packets according to the IGP, the first identification information can be added to the routing information of the first service flow so that the routing information of the first service flow carries the first identification information. In this way, when the server device needs to determine the network tunnel for forwarding VRF packets again, it no longer needs to perform the calculation according to the routing calculation method agreed in the IGP. Instead, it only needs to use the first identification information carried in the routing information of the first service flow to quickly determine the first network tunnel for forwarding VRF packets, greatly improving the efficiency of determining the forwarding path of VRF packets.
[0055] The message forwarding method provided in this application will be described in detail below through specific embodiments.
[0056] Figure 3 is a schematic diagram of an application scenario for a packet forwarding method according to another embodiment of this application. In this embodiment, a BGP neighbor relationship is configured between private network device CE1 and server device PE1, and a BGP neighbor relationship is configured between private network device CE2 and server device PE2. L3VPN (Virtual Private Network) service flows VRF1 and VRF2 are created between PE1 and PE2, which can cover IPv4 and / or IPv6. The IP address of PE2 is "10.30.1.1". P1 is a network node configured between PE1 and PE2, and the path of network tunnel A is "PE1-P1-PE2".
[0057] The following preset associations are pre-configured on PE1: Identifier A - Network Tunnel A.
[0058] Here, identifier A represents the identification information.
[0059] In the routing table of CE1, routing information for service flows VRF1 and VRF2 is configured respectively. Based on service requirements, the corresponding identifier A is configured in the routing information of VRF1, but no identifier information is configured in the routing information of VRF2. The routing information of VRF1 and VRF2 can be represented in the following form, where IPv4 and IPv6 are the destination address information.
[0060] (1) VRF1:
[0061] IPv4: 10.30.1.1
[0062] IPv6: 10:30:1:1
[0063] Identification information: Identifier A.
[0064] (2) VRF2:
[0065] IPv4: 10.30.1.1
[0066] IPv6: 10:30:1:1.
[0067] After configuring the above information, as shown in Figure 3, CE1 sends a routing table to PE1 via BGP, including routing information for VRF1 and VRF2. After receiving the routing table, PE1 obtains the identifier A carried in the routing information of VRF1.
[0068] CE1 sends a VRF1 message to PE1, which carries the destination address information, namely the IP address of PE2, "10.30.1.1". After receiving the VRF1 message, PE1 determines the unique network tunnel A based on the identifier A and the preset association relationship, and then forwards the VRF1 message to PE2 through network tunnel A.
[0069] CE1 sends a VRF2 packet to PE1, which carries destination address information, namely PE2's IP address "10.30.1.1". Since the identification information carried in the routing information of the service flow VRF2 is not pre-configured, PE2 can calculate the network tunnel for forwarding the VRF2 packet according to the routing calculation method agreed upon by the IGP protocol.
[0070] It should be noted that CE1 can send routing tables and VRF messages (including VRF1 messages and / or VRF2 messages) to PE1 at the same time, or it can send routing tables to PE1 first so that PE1 knows the identification information corresponding to the VRF messages in advance, and then send the VRF messages to PE1 when it is necessary to forward the VRF messages through PE1.
[0071] Furthermore, if the network tunnel associated with identifier A "10.30.1.1" in the pre-configured preset association relationship includes multiple tunnels, such as network tunnel A and network tunnel D, then the load balancing process can be performed on network tunnel A and network tunnel D based on their tunnel bandwidth. Then, based on the result of the load balancing process, the VRF1 message can be forwarded to PE1 through network tunnel A and network tunnel D.
[0072] In another embodiment, based on the network scenario shown in Figure 3, a new network tunnel B is added, with the path of network tunnel B being "PE1-P2-PE2". P2 is a network node configured between PE1 and PE2, and the new network scenario is shown in Figure 4. Simultaneously, the following preset association is configured in PE1: Identifier B – Network Tunnel B. Here, Identifier B is identification information.
[0073] According to business requirements, VRF1 and VRF2 packets need to be forwarded through network tunnel B. Since the routing information of VRF1 carries identifier A in the routing table sent by CE1 to PE1 via BGP, it is necessary to modify identifier A to identifier B so that the identifier information carried by the routing information of VRF1 is updated to identifier B. Then, CE1 can send the updated routing table to PE1 via BGP, or CE1 can send the updated routing information to PE1 via BGP.
[0074] Since the routing information of VRF2 in the routing table sent by CE1 to PE1 via BGP does not carry identification information, it is only necessary to configure the identifier B in the routing information of VRF2, and then CE1 can send the updated routing table to PE1 via BGP, or CE1 can send the updated routing information to PE1 via BGP.
[0075] After receiving the updated routing table or routing information from CE1, PE1 obtains the identifier B carried in the routing information of VRF1 and the identifier B carried in the routing information of VRF2 based on the updated routing table or routing information. According to the pre-configured preset association relationship, it determines that the network tunnels corresponding to VRF1 packets and VRF2 packets are both network tunnels B. Therefore, it forwards VRF1 packets and VRF2 packets to CE1 through network tunnel B.
[0076] As can be seen, in this embodiment, by pre-configuring a preset association (i.e., the correspondence between identification information and network tunnels), the network tunnel used for forwarding packets can be determined based on the identification information and the preset association when VRF packets need to be forwarded, without requiring users to manually configure and manage packet forwarding paths, greatly improving the configuration efficiency of packet forwarding paths. Furthermore, when the network tunnel for forwarding packets needs to be changed according to business requirements, only the identification information carried in the routing information of the business flow needs to be modified, without requiring users to manually modify the forwarding path of VRF packets at each network node, nor to modify the preset association, saving a significant amount of unnecessary path management processes. In addition, when multiple business flows exist, by configuring corresponding identification information for each business flow, packets can be forwarded for different business flows through their respective network tunnels, achieving flexibility in configuring packet forwarding paths and providing differentiated services to different business flows.
[0077] In summary, specific embodiments of this subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing can be advantageous.
[0078] The above are the message forwarding methods provided in the embodiments of this application. Based on the same idea, the embodiments of this application also provide a message forwarding device.
[0079] Figure 5 is a schematic block diagram of a packet forwarding device according to an embodiment of this application. As shown in Figure 5, the device includes: a receiving module 51, configured to receive a virtual routing forwarding packet sent by a private network device; the virtual routing forwarding packet carries first target address information; a first determining module 52, configured to determine a first service flow corresponding to the virtual routing forwarding packet based on the first target address information; a second determining module 53, configured to determine a first network tunnel corresponding to the VRF packet based on the first service flow and a preset association relationship; the preset association relationship is a correspondence between the identification information of the service flow and the network tunnel; the identification information of the service flow includes the first identification information of the first service flow; and a forwarding module 54, configured to forward the virtual routing forwarding packet to the target network device corresponding to the first target address information through the first network tunnel.
[0080] In one embodiment, when the first determining module 52 determines the first service flow corresponding to the virtual route forwarding packet based on the first target address information, it performs the following steps: determining the first service flow corresponding to the virtual route forwarding packet based on the first target address information and the routing table of the private network device.
[0081] In one embodiment, when the second determining module 53 determines the first network tunnel corresponding to the virtual route forwarding message based on the first service flow and the preset association relationship, it performs the following steps: determining the routing information of the first service flow based on the first service flow and the routing table; wherein the routing information of the first service flow carries the first identification information; and determining the first network tunnel corresponding to the virtual route forwarding message based on the first identification information and the preset association relationship.
[0082] In one embodiment, when the second determining module 53 determines the first network tunnel corresponding to the virtual route forwarding packet based on the first identification information and the preset association relationship, it performs the following steps: when there are multiple network tunnels corresponding to the first identification information, it determines multiple candidate network tunnels corresponding to the first identification information based on the first identification information and the preset association relationship; it selects at least one network tunnel as the first network tunnel from the multiple candidate network tunnels according to a preset filtering method; wherein, when there are multiple first network tunnels, the multiple first network tunnels forward the virtual route forwarding packet in a load-sharing manner.
[0083] In one embodiment, the apparatus further includes: a second receiving module, configured to receive a routing table sent by the private network device via a border network protocol before determining the first service flow corresponding to the virtual route forwarding message based on the first target address information; the routing table includes routing information for each service flow.
[0084] In one embodiment, the apparatus further includes: a third determining module, configured to determine second identification information associated with the second network tunnel based on the preset association relationship in response to a request to forward the virtual route forwarding message through the second network tunnel; and a modifying module, configured to modify the first identification information carried in the routing information of the first service flow to the second identification information.
[0085] In one embodiment, the apparatus further includes: an acquisition module, configured to acquire the correspondence between each of the identification information and each network tunnel before receiving the VRF message sent by the private network device; wherein one network tunnel corresponds to one identification information; and a generation module, configured to generate the preset association relationship based on the correspondence relationship.
[0086] In one embodiment, when the second determining module 53 determines the first network tunnel corresponding to the VRF packet based on the first service flow and the preset association relationship, it performs the following steps:
[0087] If the tunnel status of the first network tunnel is unreachable, or if there is no network tunnel associated with the first identification information in the preset association relationship, or if there is no associated first identification information for the first service flow, the first network tunnel is determined according to the internal gateway protocol.
[0088] In one embodiment, the apparatus further includes: an adding module, configured to add the first identification information to the routing information of the first service flow after determining the first network tunnel according to an internal gateway protocol, when the first service flow does not have associated first identification information.
[0089] In one embodiment, the identification information includes at least one of the following: community attribute information, path attribute information, local priority attribute information, and multiple exit differentiation attribute information in the border network protocol.
[0090] The apparatus according to this application embodiment, upon receiving a virtual routing forwarding message sent by a private network device, determines the first service flow corresponding to the virtual routing forwarding message based on the first destination address information carried in the virtual routing forwarding message. Based on the first service flow and a preset association relationship (i.e., the correspondence between the service flow's identification information and the network tunnel), it determines the first network tunnel corresponding to the virtual routing forwarding message. Then, through the first network tunnel, the virtual routing forwarding message is forwarded to the target network device corresponding to the first destination address information. It is evident that by pre-configuring the preset association relationship (i.e., the correspondence between the service flow's identification information and the network tunnel), when a virtual routing forwarding message needs to be forwarded, the network tunnel for forwarding the message can be determined based on the service flow corresponding to the virtual routing forwarding message and the preset association relationship, without requiring manual configuration and management of the message forwarding path by the user, greatly improving the configuration efficiency of the message forwarding path. Furthermore, when multiple service flows exist, by configuring corresponding identification information for each service flow, message forwarding can be performed for different service flows through their respective network tunnels, achieving flexibility in configuring the message forwarding path and providing differentiated services to different service flows.
[0091] Those skilled in the art will understand that the message forwarding device in Figure 5 can be used to implement the message forwarding method described above. The detailed description therein should be similar to the method description above, and will not be repeated here to avoid being cumbersome.
[0092] Based on the same idea, this application also provides an electronic device, as shown in FIG6. The electronic device can vary considerably due to differences in configuration or performance, and may include one or more processors 601 and memories 602. The memories 602 may store one or more application programs or data. The memories 602 may be temporary or persistent storage. The application programs stored in the memories 602 may include one or more modules (not shown), each module including a series of computer-executable instructions for the electronic device. In one embodiment, the processor 601 may be configured to communicate with the memories 602 and execute the series of computer-executable instructions in the memories 602 on the electronic device. The electronic device may also include one or more power supplies 603, one or more wired or wireless network interfaces 604, one or more input / output interfaces 605, and one or more keyboards 606.
[0093] Specifically, in this embodiment, the electronic device includes a memory and one or more programs, wherein one or more programs are stored in the memory, and one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the electronic device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following: receiving a virtual routing forwarding message sent by a private network device; the virtual routing forwarding message carrying first destination address information; determining a first service flow corresponding to the virtual routing forwarding message based on the first destination address information; determining a first network tunnel corresponding to the virtual routing forwarding message based on the first service flow and a preset association relationship; the preset association relationship being a correspondence between the identification information of the service flow and the network tunnel; the identification information of the service flow including the first identification information of the first service flow; and forwarding the virtual routing forwarding message to the target network device corresponding to the first destination address information through the first network tunnel.
[0094] The technical solution of this application embodiment, upon receiving a virtual routing forwarding message sent by a private network device, determines the first service flow corresponding to the virtual routing forwarding message based on the first destination address information carried in the virtual routing forwarding message. Based on the first service flow and a preset association relationship (i.e., the correspondence between the service flow's identification information and the network tunnel), the first network tunnel corresponding to the virtual routing forwarding message is determined. Then, the virtual routing forwarding message is forwarded to the target network device corresponding to the first destination address information through the first network tunnel. It is evident that by pre-configuring the preset association relationship (i.e., the correspondence between the service flow's identification information and the network tunnel), when a virtual routing forwarding message needs to be forwarded, the network tunnel for forwarding the message can be determined based on the service flow corresponding to the virtual routing forwarding message and the preset association relationship, without requiring manual configuration and management of the message forwarding path by the user, greatly improving the configuration efficiency of the message forwarding path. Furthermore, in the case of multiple service flows, by configuring corresponding identification information for each service flow, message forwarding can be performed for different service flows through their respective network tunnels, achieving flexibility in configuring the message forwarding path and providing differentiated services to different service flows.
[0095] This application also proposes a computer-readable storage medium storing one or more computer programs, each including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform various processes of the above-described message forwarding method embodiments, specifically for performing: receiving a virtual routing forwarding message sent by a private network device; the virtual routing forwarding message carrying first destination address information; determining a first service flow corresponding to the virtual routing forwarding message based on the first destination address information; determining a first network tunnel corresponding to the virtual routing forwarding message based on the first service flow and a preset association relationship; the preset association relationship being a correspondence between the identification information of the service flow and the network tunnel; the identification information of the service flow including the first identification information of the first service flow; and forwarding the virtual routing forwarding message to the target network device corresponding to the first destination address information through the first network tunnel.
[0096] The technical solution of this application embodiment, upon receiving a virtual routing forwarding message sent by a private network device, determines the first service flow corresponding to the virtual routing forwarding message based on the first destination address information carried in the virtual routing forwarding message. Based on the first service flow and a preset association relationship (i.e., the correspondence between the service flow's identification information and the network tunnel), the first network tunnel corresponding to the virtual routing forwarding message is determined. Then, the virtual routing forwarding message is forwarded to the target network device corresponding to the first destination address information through the first network tunnel. It is evident that by pre-configuring the preset association relationship (i.e., the correspondence between the service flow's identification information and the network tunnel), when a virtual routing forwarding message needs to be forwarded, the network tunnel for forwarding the message can be determined based on the service flow corresponding to the virtual routing forwarding message and the preset association relationship, without requiring manual configuration and management of the message forwarding path by the user, greatly improving the configuration efficiency of the message forwarding path. Furthermore, in the case of multiple service flows, by configuring corresponding identification information for each service flow, message forwarding can be performed for different service flows through their respective network tunnels, achieving flexibility in configuring the message forwarding path and providing differentiated services to different service flows.
[0097] This application provides a computer program product, including a computer program, which is executed by a processor to implement the various processes of the above-described message forwarding method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here.
[0098] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0099] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0100] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0101] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more flowchart illustrations and / or one or more block diagrams.
[0102] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0103] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0104] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0105] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0106] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0107] It should also be noted that 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 limitation, 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.
[0108] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0109] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0110] The above description is merely an embodiment of this application and is not intended to limit the scope 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 the claims of this application.
Claims
1. A method of packet forwarding, wherein, The method comprises the following steps: receiving a virtual route forwarding message sent by a private network device; the virtual route forwarding message carries first target address information; determining a first service flow corresponding to the virtual route forwarding message according to the first target address information; determining a first network tunnel corresponding to the virtual route forwarding message according to the first service flow and a preset association relationship; the preset association relationship is a corresponding relationship between identification information of a service flow and a network tunnel; the identification information of the service flow comprises first identification information of the first service flow; forwarding the virtual route forwarding message to a target network device corresponding to the first target address information through the first network tunnel. The step of determining the first service flow corresponding to the virtual route forwarding message according to the first target address information comprises the following steps:
2. The method of claim 1, wherein, determining the first service flow corresponding to the virtual route forwarding message according to the first target address information and a routing table of the private network device. The step of determining the first network tunnel corresponding to the virtual route forwarding message according to the first service flow and the preset association relationship comprises the following steps:
3. The method of claim 2, wherein, determining routing information of the first service flow according to the first service flow and the routing table; wherein the routing information of the first service flow carries the first identification information; determining the first network tunnel corresponding to the virtual route forwarding message according to the first identification information and the preset association relationship. In the case that the first network tunnel corresponding to the first identification information is multiple, the step of determining the first network tunnel corresponding to the virtual route forwarding message according to the first identification information and the preset association relationship comprises the following steps:
4. The method of claim 3, wherein, determining multiple candidate network tunnels corresponding to the first identification information according to the first identification information and the preset association relationship; selecting at least one network tunnel from the multiple candidate network tunnels as the first network tunnel according to a preset screening mode; wherein in the case that the first network tunnel comprises multiple, the multiple first network tunnels forward the virtual route forwarding message in a load sharing manner. Before the step of determining the first service flow corresponding to the virtual route forwarding message according to the first target address information, the method further comprises the following steps:
5. The method according to any one of claims 2-4, wherein, receiving the routing table sent by the private network device through a border network protocol; the routing table comprises routing information of each service flow. The method further comprises the following steps:
6. The method of claim 3 or 4, wherein, in response to a request of forwarding the virtual route forwarding message through a second network tunnel, determining second identification information associated with the second network tunnel according to the preset association relationship; modifying the first identification information carried by the routing information of the first service flow into the second identification information. Before the step of receiving the virtual route forwarding message sent by the private network device, the method further comprises the following steps:
7. The method of claim 1, wherein, obtaining a corresponding relationship between each identification information and each network tunnel; wherein one network tunnel corresponds to one identification information; generating the preset association relationship according to the corresponding relationship. The step of determining the first network tunnel corresponding to the virtual route forwarding message according to the first service flow and the preset association relationship comprises the following steps:
8. The method of claim 1, wherein, In a case that the tunnel state of the first network tunnel is an unreachable state, or the preset association relationship does not exist the network tunnel associated with the first identification information, or the first service flow does not exist the associated first identification information, the first network tunnel is determined according to an interior gateway protocol.
9. The method of claim 8, wherein, After the first network tunnel is determined according to the interior gateway protocol in the case that the first service flow does not exist the associated first identification information, the method further comprises: adding the first identification information in the routing information of the first service flow.
10. The method according to claim 1, wherein, The identification information comprises at least one of the following: group attribute information, path attribute information, local priority attribute information, and multi-outlet distinguishing attribute information in the border network protocol.
11. An electronic device, comprising: The apparatus comprises a processor and a memory electrically connected with the processor, the memory stores a computer program, and the processor is configured to call and execute the computer program from the memory to implement the packet forwarding method according to any one of claims 1-10.
12. A computer readable storage medium, wherein, The storage medium is configured to store a computer program, and the computer program can be executed by the processor to implement the packet forwarding method according to any one of claims 1-10.
13. A computer program product, wherein, The computer program is configured to be executed by the processor to implement the packet forwarding method according to any one of claims 1-10.
Citation Information
Patent Citations
Data forwarding method and device, router and storage medium
CN115766560A
Traffic control method and related device
US20240007400A1
Traffic forwarding method, packet sending method, message sending method, and apparatus
WO2023138351A1
Communication method for sd-wan, message processing method, and network device
WO2024109042A1