A data forwarding method and device, computer device and storage medium
By obtaining the policy identifier and effective bandwidth of the link in the firewall data forwarding, and dynamically allocating forwarding traffic, the problem of uneven distribution of firewall link resources is solved, achieving efficient data forwarding and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-23
- Publication Date
- 2026-03-24
AI Technical Summary
When existing firewalls perform policy-based routing, they may cause uneven distribution of link resources, resulting in some links being congested while others are idle, which affects transmission quality and user experience.
By obtaining the policy identifier of the data to be forwarded, the effective bandwidth of each link is determined, and forwarding traffic is allocated according to the effective bandwidth and actual traffic. Data packets are divided for forwarding to avoid resource waste and link idleness.
It achieves balanced allocation of link resources, improves data forwarding efficiency, avoids link congestion and idleness issues, and enhances transmission quality and user experience.
Smart Images

Figure CN115883468B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of firewall data forwarding technology, and in particular to a data forwarding method and device, computer equipment and storage medium. BACKGROUND
[0002] When the firewall forwards data, the routing table is searched, and the packet is forwarded according to the destination address. Under this mechanism, the forwarding service is provided for users only according to the destination address of the packet.
[0003] On the basis of the routing table, the policy-based routing does not forward according to the existing routing table, but selects the routing according to the user-specified policy, determines how the packet is forwarded from more dimensions, and increases the flexibility in the packet forwarding control. The policy-based routing does not replace the routing table mechanism, but takes effect in priority to the routing table, formulates the forwarding for certain special services, and when the firewall needs to have many links for traffic load sharing for the special services, the traffic is often forwarded by randomly selecting a link, which may cause problems such as congestion of a part of the link and idling of another part of the link. SUMMARY
[0004] Therefore, to solve the problems in the prior art, the embodiments of the present application provide a data forwarding method, device, computer equipment and storage medium.
[0005] According to a first aspect, the embodiments of the present application disclose a data forwarding method, obtaining the data to be forwarded at the current time, the data to be forwarded carrying a policy identifier;
[0006] When it is determined that the forwarding policy corresponding to the policy identifier includes the first type of link, the effective bandwidth of each link in the first type of link at the current time is determined, and the first type of link includes a plurality of links;
[0007] According to the effective bandwidth of each link in the first type of link and the actual traffic of the data to be forwarded, the forwarding traffic of the first link is determined, and the first link is any one of the plurality of links in the first type of link;
[0008] According to the forwarding traffic of each link in the first type of link, the data to be forwarded is divided to obtain the data packet to be forwarded corresponding to each link;
[0009] The data packet corresponding to the first link is forwarded through the forwarding traffic of the first link.
[0010] Optionally, the effective bandwidth of each link at the current time is determined, specifically including:
[0011] The occupied bandwidth of the data being forwarded by the first link at the current time is determined, and the rated bandwidth of the first link is determined;
[0012] According to the occupied bandwidth and the rated bandwidth, the effective bandwidth of the first link at the current time is determined.
[0013] Optionally, according to the effective bandwidth of each link in the first type of link and the actual flow of the data to be forwarded, the forwarding flow of the first link is determined, and specifically includes:
[0014] According to the effective bandwidth corresponding to each link, the effective bandwidth ratio between each link is determined.
[0015] According to the effective bandwidth ratio, the actual flow is divided to determine the forwarding flow of the first link, and the forwarding flow of the first link is the passable flow of the data to be forwarded that can pass through the first link.
[0016] Optionally, the data to be forwarded further includes a target address, and when the obtained data to be forwarded does not have a corresponding forwarding strategy, the method further includes:
[0017] According to the target address, the mapping relationship between the target address and the link, the second type of link corresponding to the target address is determined.
[0018] The data to be forwarded is forwarded from the second type of link corresponding to the target address.
[0019] Optionally, when the link corresponding to the target address includes multiple links, the method further includes:
[0020] The effective bandwidth of each link in the second type of link at the current time is determined, so that the data to be forwarded is subsequently forwarded according to the effective bandwidth of the link in the second type of link and the actual flow of the data to be forwarded.
[0021] According to a second aspect, the present application discloses a data forwarding device, and the device includes:
[0022] An acquisition module is configured to acquire data to be forwarded at a current time, and the data to be forwarded carries a policy identifier.
[0023] A determination link module is configured to determine the effective bandwidth of each link in the first type of link at the current time when it is determined that the forwarding strategy corresponding to the policy identifier includes the first type of link, and the first type of link includes multiple links.
[0024] A determination flow module is configured to determine the forwarding flow of the first link according to the effective bandwidth of each link in the first type of link and the actual flow of the data to be forwarded, and the first link is any one of the multiple links in the first type of link.
[0025] A division module is configured to divide the data to be forwarded according to the forwarding flow of each link in the first type of link, and obtain the data packet corresponding to each link.
[0026] The forwarding module is configured to forward the forwarding data packet corresponding to the first link by forwarding traffic corresponding to the first link.
[0027] Optionally, the determining link module specifically comprises:
[0028] The determining nominal bandwidth module is configured to determine the occupied bandwidth of the data being forwarded by the first link at the current time and the nominal bandwidth of the first link.
[0029] The determining effective bandwidth module is configured to determine the effective bandwidth of the first link at the current time according to the occupied bandwidth and the nominal bandwidth.
[0030] Optionally, the determining traffic module is specifically configured to:
[0031] The effective bandwidth ratio between each link is determined according to the effective bandwidth corresponding to each link.
[0032] The forwarding traffic of the first link is determined according to the effective bandwidth ratio and the actual traffic, and the forwarding traffic of the first link is the passable traffic of the to-be-forwarded data that can be passed through by the first link.
[0033] According to a third aspect, the embodiments of the present application further disclose a computer device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the data forwarding method according to the first aspect or any optional implementation manner of the first aspect.
[0034] According to a fourth aspect, the embodiments of the present application further disclose a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the data forwarding method according to the first aspect or any optional implementation manner of the first aspect.
[0035] The technical scheme of the present application has the following advantages:
[0036] The data forwarding method provided by the application comprises the following steps: obtaining to-be-forwarded data at a current time, wherein the to-be-forwarded data carries a policy identifier; when it is determined that a first type of link is included in a forwarding policy corresponding to the policy identifier, determining the effective bandwidth of each link in the first type of link at the current time, and determining the forwarding traffic of each link according to the effective bandwidth of each link and the actual traffic of the to-be-forwarded data, thereby avoiding the problem of resource waste caused by uneven resource allocation when a plurality of links are used to forward the to-be-forwarded data; further, after the forwarding traffic of each link is determined, the to-be-forwarded data is divided according to the corresponding forwarding traffic to obtain corresponding forwarding data packets, and the corresponding forwarding data packets are forwarded through each link, thereby avoiding the problem of congestion of a part of links and idling of another part of links, and when some links are congested, the transmission quality is poor, which may cause access failure and affect the experience of users. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without any creative effort.
[0038] Figure 1 a flow chart of a specific example of the data forwarding method in the embodiments of the present application;
[0039] Figure 2 a schematic diagram of a specific example of the data forwarding method in the embodiments of the present application;
[0040] Figure 3 a schematic diagram of a specific example of the data forwarding method in the embodiments of the present application;
[0041] Figure 4 a principle block diagram of a specific example of the data forwarding in the embodiments of the present application;
[0042] Figure 5 a specific example diagram of the computer device in the embodiments of the present application. DETAILED DESCRIPTION
[0043] The technical solutions of the present application will be described clearly and completely below with reference to the drawings. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort fall within the protection scope of the present application.
[0044] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicate the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first", "second", "third" are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0045] In the description of the present application, it should be noted that unless otherwise explicitly specified and limited, the terms "mounting", "connecting", "connecting" should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or integrally connected; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium; it can be the communication between two elements, it can be wireless connection, or it can be wired connection. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0046] In addition, the technical features involved in the different embodiments of the application described below can be combined with each other as long as there is no conflict between them.
[0047] For the technical problems mentioned in the background art, the present application provides a data forwarding method, which is specifically described in Figure 1 As shown in the figure, the present application provides a data forwarding method flow diagram, the data forwarding method includes the following steps:
[0048] Step 101, obtaining the to-be-forwarded data at the current time, the to-be-forwarded data carrying a policy identifier.
[0049] Illustratively, when the firewall receives the data to be forwarded, the firewall will determine the corresponding forwarding mode according to the to-be-forwarded data obtained, and finally send the to-be-forwarded data to the corresponding address. In order to determine the forwarding address corresponding to the to-be-forwarded data, the firewall needs to identify the policy identifier carried in the to-be-forwarded data. The policy identifier is used to indicate the forwarding mode of forwarding the to-be-forwarded data to the corresponding forwarding address. The specific policy identifier can be one or more of the following: entry, source security area, source / destination IP address, user, service and reference.
[0050] Step 102, when it is determined that the first type of link is included in the forwarding policy corresponding to the policy identifier, determining the effective bandwidth of each link in the first type of link at the current time.
[0051] Wherein the first type of link includes a plurality of links.
[0052] Exemplarily, after determining the policy identifier in the data to be forwarded, the corresponding forwarding policy of the firewall can be determined according to the policy identifier, and the corresponding forwarding policy can be which several links to complete the forwarding of the data to be forwarded.
[0053] When the forwarding policy includes a plurality of links, it indicates that the data to be forwarded can be forwarded through any one of the plurality of links, and at this time, problems such as congestion of a part of the links and idling of another part of the links can occur, or it is possible that a part of the plurality of links are transmitting other data, so that when the data to be forwarded is transmitted, the corresponding link is also crowded, thereby causing the problem of failure of forwarding.
[0054] Therefore, before forwarding the data through the plurality of links, the effective bandwidth of each link at the current time can be determined, and the specific determination method can be obtained according to the actual use of the link. The effective bandwidth here is the actual available bandwidth of the link at the current time, and after the effective bandwidth is determined, congestion of a certain link can be avoided, thereby improving the efficiency of data forwarding.
[0055] In a preferred embodiment, the effective bandwidth of each link at the current time is determined, and specifically includes:
[0056] The occupied bandwidth of the data being forwarded by the first link at the current time is determined, and the rated bandwidth of the first link is determined; and the effective bandwidth of the first link at the current time is determined according to the occupied bandwidth and the rated bandwidth.
[0057] Exemplarily, the occupied bandwidth of each link in the first type of link being used is determined, and the rated bandwidth of the corresponding link is determined, and the rated bandwidth can be directly read, and the difference between the two is the effective bandwidth.
[0058] Step 103, determining the forwarding flow of the first link according to the effective bandwidth of each link in the first type of link and the actual flow of the data to be forwarded.
[0059] The first link is any one of the plurality of links in the first type of link.
[0060] Exemplarily, after determining the effective bandwidth of each link, in order to effectively and quickly forward the data to be forwarded to the corresponding address, the forwarding flow that each link in the first type of link can transmit needs to be determined according to the effective bandwidth of each link and the actual flow of the data to be forwarded, so that the situation of congestion of a link and idling of another link can be avoided, and the efficiency of data forwarding is improved.
[0061] Specifically, determining the forwarding traffic can be, according to the actual traffic of the data to be forwarded, sequentially allocating the actual traffic of the data to be forwarded according to the effective bandwidth of each link in the first type of link until the actual traffic of the data to be forwarded is allocated, and the actual allocation method is not limited, and a person skilled in the art can determine it according to the actual situation.
[0062] In a preferred embodiment, the forwarding traffic of the first link is determined according to the effective bandwidth of each link in the first type of link and the actual traffic of the data to be forwarded, and specifically includes:
[0063] According to the effective bandwidth corresponding to each link, the effective bandwidth ratio between each link is determined; the actual traffic is divided according to the effective bandwidth ratio, and the forwarding traffic of the first link is determined. The forwarding traffic of the first link is the passable traffic of the data to be forwarded that can pass through the first link.
[0064] For example, when allocating the actual traffic of the data to be forwarded, the actual traffic of the data to be forwarded can be divided according to the proportion of the effective bandwidth of all links in the first type of link according to the proportion of the effective bandwidth, and finally the forwarding traffic corresponding to each link that needs to be transmitted is determined. In this way, the effective bandwidth of each link can be used as a basis to evenly complete the transmission of the data to be forwarded, and the efficiency of data forwarding is improved.
[0065] Step 104, according to the forwarding traffic of each link in the first type of link, the data to be forwarded is divided to obtain the data packet corresponding to each link.
[0066] Step 105, forwarding the forwarding data packet corresponding to the first link through the forwarding traffic corresponding to the first link.
[0067] For example, after determining the forwarding traffic of each link, the data to be forwarded needs to be divided according to the forwarding traffic to obtain the data packet corresponding to the forwarding traffic, and the data to be forwarded is transmitted through each link through the data packet.
[0068] On the basis of the above embodiment, the embodiment of the application further provides another data forwarding method. In this embodiment, the content introduced in the above embodiment will not be repeated. In this embodiment, the data to be forwarded further includes a target address. When the data to be forwarded obtained does not have a corresponding forwarding strategy, the method further includes:
[0069] According to the target address, the mapping relationship between the target address and the link, the second type of link corresponding to the target address is determined; and the data to be forwarded is forwarded from the second type of link corresponding to the target address.
[0070] Exemplarily, when the target address is included in the acquired data to be forwarded, the data forwarding in the form of policy identification is not needed, and the data can be directly forwarded according to the target address. In the process of forwarding, the data also needs to be forwarded through a link, which is referred to as a second type of link in the embodiments of the present application. The method for determining the second type of link can also be determined according to the preset relationship between the target address and the link.
[0071] In a specific embodiment, when the link corresponding to the target address includes multiple links, the method further includes determining the effective bandwidth of each link in the second type of link at the current time, so as to subsequently forward the data to be forwarded according to the effective bandwidth of the link in the second type of link and the actual traffic of the data to be forwarded.
[0072] Exemplarily, when the second type of link includes multiple links, the problem in the above embodiment also exists, and therefore when the data to be forwarded is forwarded through the second type of link, the effective bandwidth of each link in the second type of link needs to be determined, and the data to be forwarded is forwarded according to the effective bandwidth and the actual traffic of the data to be forwarded.
[0073] Next, the implementation method of the above method is further explained and described with a specific example.
[0074] First, the firewall administrator specifies the bandwidth (that is, the rated bandwidth) for each outgoing interface on the firewall. Generally, the administrator needs to set a reasonable bandwidth value according to the actual link bandwidth. Then, the administrator configures a policy route on the firewall and specifies multiple traffic sharing outgoing interfaces. When data that hits the policy arrives, the data packets are forwarded in a flow manner according to the effective bandwidth ratio of each outgoing interface of the policy. In the entire forwarding process, if some data packets that do not hit the policy go out from the corresponding outgoing interface, this part of data is temporarily referred to as a miscellaneous packet. The bandwidth minus the miscellaneous packet bandwidth is the effective bandwidth, which is shown in the following formula:
[0075] Effective bandwidth / second = (specified bandwidth-miscellaneous packet bandwidth) / second
[0076] The data that hits the policy can be dynamically adjusted in real time according to the effective bandwidth ratio, thereby reducing the congestion of special services that meet the policy route due to too many miscellaneous packets of a certain outgoing interface, and thereby reducing packet loss.
[0077] When all the data traffic in the entire network is the data that hits the policy route, it means that there is no miscellaneous packet. The user can configure the actual bandwidth value that needs to be balanced to each outgoing interface according to the actual situation, and the entire process is as follows: Figure 2, the user assigns the real bandwidth of 200M to the link ISP1, the real of 100M to the link ISP2, and the real bandwidth of 100M to the link ISP3 according to the actual situation, at this time, all the flows hitting the policy routing are divided into ISP1, ISP2 and ISP3 according to the bandwidth value, and the division ratio is 50%, 25% and 25% respectively.
[0078] As shown in Figure 3 , when there is data that does not hit the policy routing, the miscellaneous packet bandwidth of the corresponding out interface is counted, and if the miscellaneous packet occupies the bandwidth value of 100M through ISP1, at this time, the data flow hitting the policy routing will be divided into ISP1, ISP2 and ISP3 according to the bandwidth value, and the division ratio is 33%, 33% and 33% respectively. The effective bandwidth of the policy routing is calculated by real-time detection of the miscellaneous packet bandwidth and the out interface bandwidth (rated bandwidth) of all the links of the policy routing. According to the real-time policy routing effective bandwidth of each interface, each interface is allocated a real-time weight. According to the real-time weight value of each interface, the data flow hitting the policy routing is dynamically allocated, and the load balancing of the policy routing is realized.
[0079] The data forwarding method provided by the application comprises the following steps: acquiring the to-be-forwarded data at the current time, wherein the to-be-forwarded data carries a policy identifier; when it is determined that the forwarding policy corresponding to the policy identifier comprises a first type of link, determining the effective bandwidth of each link in the first type of link at the current time, and determining the forwarding flow of each link according to the effective bandwidth of each link and the actual flow of the to-be-forwarded data, thereby avoiding the problem of resource waste caused by uneven resource allocation when multiple links are used to forward the to-be-forwarded data; further, after the forwarding flow of each link is determined, the to-be-forwarded data is divided according to the corresponding forwarding flow, the corresponding forwarding data packet is obtained, and the corresponding forwarding data packet is forwarded through each link, thereby avoiding the problem of congestion of a part of links and idling of another part of links, and when some links are congested, the transmission quality is poor, which may cause access failure and affect the experience of users.
[0080] The above is a few method embodiments of the data forwarding provided by the application, and the following describes other embodiments of the data forwarding provided by the application, which are specifically described as follows.
[0081] The application also discloses a data forwarding device, as shown in Figure 4 , the device comprises:
[0082] The acquisition module 401 is configured to acquire the to-be-forwarded data at the current time, and the to-be-forwarded data carries a policy identifier.
[0083] The determining link module 402 is configured to determine the effective bandwidth of each link in the first type of link at the current time when it is determined that the first type of link is included in the forwarding policy corresponding to the policy identifier, and the first type of link includes a plurality of links;
[0084] The determining flow module 403 is configured to determine the forwarding flow of the first link according to the effective bandwidth of each link in the first type of link and the actual flow of the data to be forwarded, and the first link is any one of the plurality of links in the first type of link.
[0085] The dividing module 404 is configured to divide the data to be forwarded according to the forwarding flow of each link in the first type of link, and obtain the data packet corresponding to each link.
[0086] The forwarding module 405 is configured to forward the data packet corresponding to the first link through the forwarding flow corresponding to the first link.
[0087] As an optional embodiment of the present application, the determining link module specifically includes:
[0088] The determining rated bandwidth module is configured to determine the occupied bandwidth of the data being forwarded by the first link at the current time and the rated bandwidth of the first link.
[0089] The determining effective bandwidth module is configured to determine the effective bandwidth of the first link at the current time according to the occupied bandwidth and the rated bandwidth.
[0090] As an optional embodiment of the present application, the determining flow module is specifically configured to:
[0091] Determine the effective bandwidth ratio between each link according to the effective bandwidth corresponding to each link.
[0092] Determine the forwarding flow of the first link according to the effective bandwidth ratio, and the forwarding flow of the first link is the passable flow of the data to be forwarded that can pass through the first link.
[0093] As an optional embodiment of the present application, the data to be forwarded further includes a target address, and when the obtained data to be forwarded has no corresponding forwarding policy, the device is further configured to:
[0094] Determine the second type of link corresponding to the target address according to the target address and the mapping relationship between the target address and the link.
[0095] Forward the data to be forwarded from the second type of link corresponding to the target address.
[0096] As an optional embodiment of the present application, when the link corresponding to the target address includes a plurality of links, the device is further configured to:
[0097] determine the effective bandwidth of each link in the second type of link at the current time, so as to subsequently forward the data to be forwarded according to the effective bandwidth of the link in the second type of link and the actual traffic of the data to be forwarded.
[0098] The functions performed by each component in the data forwarding provided by the embodiments of the present application have been described in detail in any of the above method embodiments, and thus will not be described again here.
[0099] By executing the apparatus, the data to be forwarded at the current time is obtained, wherein the data to be forwarded carries a policy identifier. When it is determined that the forwarding policy corresponding to the policy identifier includes the first type of link, the effective bandwidth of each link in the first type of link at the current time is determined, and the forwarding traffic required to be forwarded by each link is determined according to the effective bandwidth of each link and the actual traffic of the data to be forwarded, thereby avoiding the problem of resource waste caused by uneven resource allocation when the data to be forwarded is forwarded by using multiple links. Further, after the forwarding traffic of each link is determined, the data to be forwarded is divided according to the corresponding forwarding traffic to obtain corresponding forwarding data packets, and the corresponding forwarding data packets are forwarded by each link, thereby avoiding the problem of congestion of a part of links and idling of another part of links, and the problem that when some links are congested, the transmission quality is poor, which may cause access failure and affect the experience of users.
[0100] The embodiments of the present application also provide a computer device, as shown in the accompanying drawings, the computer device can include a processor 501 and a memory 502, wherein the processor 501 and the memory 502 can be connected by a bus or other means, Figure 5 for example, the connection by the bus is taken as an example. Figure 5
[0101] The processor 501 can be a central processing unit (CPU). The processor 501 can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. chips, or a combination of the above-mentioned various chips.
[0102] The memory 502, as a non-transitory computer readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the program instructions / modules corresponding to the data forwarding method in the embodiments of the present application. The processor 501 executes various functions and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory 502, that is, implements the data forwarding method in the above-mentioned method embodiments.
[0103] The memory 502 can include a program storage area and a data storage area, wherein the program storage area can store an operating system and application programs required by at least one function; and the data storage area can store data created by the processor 501 and the like. In addition, the memory 502 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory 502 can optionally include a memory disposed remotely with respect to the processor 501, and these remote memories can be connected to the processor 501 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0104] One or more modules are stored in the memory 502, and when executed by the processor 501, perform the data forwarding method in the embodiments as shown. Figure 1
[0105] The above-mentioned computer device specific details can be understood by referring to the corresponding related descriptions and effects in the embodiments as shown, which will not be described here again. Figure 1
[0106] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the program can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc. The storage medium can also include a combination of the above-mentioned types of memories.
[0107] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.
Claims
1. A data forwarding method, characterized in that, The method includes: Obtain the data to be forwarded at the current moment, wherein the data to be forwarded carries a policy identifier; When it is determined that the forwarding policy corresponding to the policy identifier includes a first type of link, the effective bandwidth of each link in the first type of link at the current time is determined, and the first type of link includes multiple links; The forwarding traffic of the first link is determined based on the effective bandwidth of each link in the first type of link and the actual traffic of the data to be forwarded. The first link is any one of the multiple links in the first type of link. Based on the forwarding traffic of each link in the first type of link, the data to be forwarded is divided, and the data packets to be forwarded corresponding to each link are obtained. The forwarding traffic corresponding to the first link is used to forward the forwarding data packets corresponding to the first link; The data to be forwarded also includes a target address. When the acquired data to be forwarded has no corresponding forwarding strategy, the method further includes: determining a second type of link corresponding to the target address based on the target address and the mapping relationship between the target address and the link; and forwarding the data to be forwarded from the second type of link corresponding to the target address.
2. The method according to claim 1, characterized in that, Determining the effective bandwidth of each link at the current moment specifically includes: Determine the bandwidth occupied by the data being forwarded by the first link at the current moment, and the rated bandwidth of the first link; The effective bandwidth of the first link at the current moment is determined based on the occupied bandwidth and the rated bandwidth.
3. The method according to claim 2, characterized in that, The step of determining the forwarding traffic of the first link based on the effective bandwidth of each link in the first type of link and the actual traffic of the data to be forwarded specifically includes: Based on the effective bandwidth corresponding to each of the links, determine the effective bandwidth ratio between each of the links; The actual traffic is divided according to the effective bandwidth ratio, and the forwarding traffic of the first link is determined. The forwarding traffic of the first link is the passable traffic of the data to be forwarded that can be passed through the first link.
4. The method according to claim 1, characterized in that, When the link corresponding to the target address includes multiple links, the method further includes: Determine the effective bandwidth of each link in the second type of link at the current time so that the data to be forwarded can be forwarded subsequently based on the effective bandwidth of the links in the second type of link and the actual traffic of the data to be forwarded.
5. A data forwarding device, characterized in that, The device includes: The acquisition module is used to acquire the data to be forwarded at the current time, wherein the data to be forwarded carries a policy identifier; The link determination module is used to determine the effective bandwidth of each link in the first type of links at the current time when it is determined that the forwarding policy corresponding to the policy identifier includes a first type of link. The first type of links includes multiple links. The traffic determination module determines the forwarding traffic of the first link based on the effective bandwidth of each link in the first type of link and the actual traffic of the data to be forwarded. The first link is any one of the multiple links in the first type of link. The segmentation module is used to segment the data to be forwarded according to the forwarding traffic of each link in the first type of link, and obtain the data packet to be forwarded corresponding to each link; The forwarding module is used to forward the forwarding data packets corresponding to the first link through the forwarding traffic corresponding to the first link; The data to be forwarded also includes a target address. When the acquired data to be forwarded has no corresponding forwarding strategy, the device is further configured to: determine a second type of link corresponding to the target address based on the target address and the mapping relationship between the target address and the link; and forward the data to be forwarded from the second type of link corresponding to the target address.
6. The apparatus according to claim 5, characterized in that, The link module is determined, specifically including: The rated bandwidth determination module is used to determine the bandwidth occupied by the data being forwarded by the first link at the current moment, as well as the rated bandwidth of the first link; The effective bandwidth determination module is used to determine the effective bandwidth of the first link at the current moment based on the occupied bandwidth and the rated bandwidth.
7. The apparatus according to claim 6, characterized in that, The flow determination module is specifically used for: Based on the effective bandwidth corresponding to each of the links, determine the effective bandwidth ratio between each of the links; The actual traffic is divided according to the effective bandwidth ratio, and the forwarding traffic of the first link is determined. The forwarding traffic of the first link is the passable traffic of the data to be forwarded that can be passed through the first link.
8. A computer device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the data forwarding method as described in any one of claims 1-4.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the node, it implements the data forwarding method as described in any one of claims 1-4.
Citation Information
Patent Citations
Load sharing method and system, and related equipment
CN106470165A
Load sharing calculation method based on policy routing
CN115022229A