Routing calculation method, electronic device and storage medium
By obtaining the link degradation degree as the calculation factor, determining the routing metric value, and selecting the link with the best transmission quality as the service link, it solves the problem of transmission quality degradation caused by link degradation failure in the intelligent metropolitan area network in the 5G era, and achieving the best transmission quality of the service link.
Patent Information
- Application Number
- CN202311247796.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2025-04-01
AI Technical Summary
In the intelligent metropolitan area network in the 5G era, when the main and backup links fail over, the backup link may have link deterioration failure, resulting in a decrease in link transmission quality after switching, and the prior art fails to effectively consider the differences in link transmission quality when calculating routing.
By obtaining data of the calculation factor of the link, including the link degradation degree representing the link transmission quality, the routing metric value of the link is determined, and thus the link with the best transmission quality is selected as the service link.
It realizes the selection of the optimal service link based on the link transmission quality, ensures the optimal transmission quality of the service link, and solves the problem of transmission quality degradation caused by link deterioration failure.
Smart Images

Figure CN119743811A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a routing calculation method, electronic device and storage medium. Background Art
[0002] With the advent of the 5G era, operators have launched various intelligent metropolitan area networks, which have three characteristics: intelligent ultra-broadband, intelligent connection, and intelligent operation and maintenance; this increases the quality and reliability of services. When the current primary and backup links switch due to link failure, the backup link may have a link degradation failure, resulting in a decrease in link transmission quality after switching to the backup link; or when calculating IGP neighbors, only whether the interface status is UP is considered. When all interfaces are UP, the cost value of the route is the same. When the link transmission quality has not changed the interface status, the cost value of the calculated route will not be affected. In fact, the transmission quality of the links corresponding to the interfaces with an interface status of UP may be different. The transmission quality of the links corresponding to some interfaces with an interface status of UP may be worse than the transmission quality of the links corresponding to other interfaces with an interface status of UP. Summary of the invention
[0003] Based on this, an embodiment of the present application provides a routing calculation method, an electronic device and a storage medium, which can obtain a routing metric value representing the link transmission quality.
[0004] In a first aspect, the present application provides a method for calculating a route, the method comprising:
[0005] Acquire data of a path calculation factor of a link, wherein the path calculation factor includes a link degradation degree indicating a link transmission quality;
[0006] The routing metric value of the link is determined according to the data of the routing factor of the link.
[0007] In a second aspect, the present application provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a computer program; the processor is used to execute the computer program and implement the routing calculation method as described in the first aspect when executing the computer program.
[0008] In a third aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the routing calculation method as described in the first aspect.
[0009] The embodiment of the present application provides a routing calculation method, electronic device and storage medium, which obtains data of the link calculation factor, wherein the calculation factor includes the link degradation degree indicating the link transmission quality; and determines the routing metric value of the link according to the data of the link calculation factor. Since the link degradation degree indicating the link transmission quality is used as the calculation factor to determine the routing metric value, the obtained routing metric value can indicate the link transmission quality; when the routing metric values of multiple links are obtained accordingly, the link with the smallest routing metric value can be selected as the service link, so as to ensure the optimal transmission quality of the service link. Therefore, the above method of determining the routing metric value can provide technical support for ensuring the optimal transmission quality of the service link. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a flowchart of an embodiment of a method for calculating a route in the present application;
[0011] Figure 2 It is a flowchart of another embodiment of the routing calculation method of the present application;
[0012] Figure 3 It is a flowchart of another embodiment of the routing calculation method of the present application;
[0013] Figure 4 It is a flowchart of another embodiment of the routing calculation method of the present application;
[0014] Figure 5 It is a flowchart of another embodiment of the routing calculation method of the present application;
[0015] Figure 6 It is a flowchart of another embodiment of the routing calculation method of the present application;
[0016] Figure 7 It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0017] Figure 8 It is a schematic diagram of the basic networking of an embodiment of the routing calculation method of the present application. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0019] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0020] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application, and have no special meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0021] With the advent of the 5G era, operators have launched various intelligent metropolitan area networks, which have three characteristics: intelligent ultra-broadband, intelligent connection, and intelligent operation and maintenance; this increases the quality and reliability of services. When the current primary and backup links switch due to link failure, the backup link may have a link degradation failure, resulting in a decrease in link transmission quality after switching to the backup link; or when calculating IGP neighbors, only whether the interface status is UP is considered. When all interfaces are UP, the cost value of the route is the same. When the link transmission quality has not changed the interface status, the cost value of the calculated route will not be affected. In fact, the transmission quality of the links corresponding to the interfaces with an interface status of UP may be different. The transmission quality of the links corresponding to some interfaces with an interface status of UP may be worse than the transmission quality of the links corresponding to other interfaces with an interface status of UP.
[0022] The embodiment of the present application provides a routing calculation method, electronic device and storage medium, which obtains data of the link calculation factor, wherein the calculation factor includes the link degradation degree indicating the link transmission quality; and determines the routing metric value of the link according to the data of the link calculation factor. Since the link degradation degree indicating the link transmission quality is used as the calculation factor to determine the routing metric value, the obtained routing metric value can indicate the link transmission quality; when the routing metric values of multiple links are obtained accordingly, the link with the smallest routing metric value can be selected as the service link, so as to ensure the optimal transmission quality of the service link. Therefore, the above method of determining the routing metric value can provide technical support for ensuring the optimal transmission quality of the service link.
[0023] The method of the embodiment of the present application is described in detail below.
[0024] See also Figure 1 , Figure 1 It is a flow chart of an embodiment of the routing calculation method of the present application. It should be noted that the executor of the embodiment of the present application is an electronic device, which can be the head node on the link (also called the path), or a controller, or other nodes on the link.
[0025] The method includes: step S101 and step S102.
[0026] Step S101: Acquire data of a path calculation factor of a link, where the path calculation factor includes a link degradation degree representing link transmission quality.
[0027] Step S102: Determine the routing metric value of the link according to the data of the path calculation factor of the link.
[0028] In the embodiment of the present application, the path calculation factor includes the link degradation degree, and the link degradation degree is used to indicate the link transmission quality. The path calculation factor may also include other path calculation factors, such as bandwidth, delay, jitter, etc. The method of obtaining the data of the path calculation factor of the link may include: obtaining it through active detection, or obtaining it by the node on the link actively reporting its own working status.
[0029] In some embodiments, the data of the link degradation degree includes data related to the link packet loss. The data related to the link packet loss can simply and conveniently reflect the link transmission quality.
[0030] In some embodiments, the data of link degradation may include a cyclic redundancy check (CRC) count, may include an interface converted to an SD state, and may also include a CRC count and an interface converted to an SD state.
[0031] CRC is the most commonly used error checking code in the field of data communication. It is mainly used to detect or verify possible errors in data transmission. Therefore, the CRC count can reflect the link packet loss situation. Normally, the CRC error count is counted. Once a data transmission error is detected, the CRC error count will be increased; if the CRC error count is too high, it will seriously affect the efficiency and stability of data transmission.
[0032] Interface SD status (STP instance discarding) indicates that the interface traffic is blocked due to a loop disconnection in STP (Spanning Tree Protocol) protocol calculation. Therefore, if the interface changes to SD status, it means that the interface traffic is blocked and packet loss is very serious. For example, a node has three outbound interfaces: outbound interface 1, outbound interface 2, and outbound interface 3. Outbound interface 1 changes to SD status. The route metric calculated for the link corresponding to outbound interface 2 is smaller than the route metric calculated for the link corresponding to outbound interface 3. In route selection, the link corresponding to outbound interface 2 can be selected.
[0033] The routing metric of a link can represent the cost of reaching the destination address from the source address of the link. There can be multiple links from the source address to the destination address. Generally, the smaller the routing metric, the more preferred it is. The routing metric of the link can be determined based on the data of the path calculation factor of the link.
[0034] In the embodiment of the present application, since the link degradation degree representing the link transmission quality is used as a routing factor to determine the routing metric value, the obtained routing metric value can represent the link transmission quality. When the routing metric values of multiple links are obtained accordingly, the link with the smallest routing metric value can be selected as the service link, thereby ensuring the optimal transmission quality of the service link. Therefore, the above-mentioned method of determining the routing metric value can provide technical support for ensuring the optimal transmission quality of the service link.
[0035] See also Figure 2 In some embodiments, the method may further include: step S103.
[0036] Step S103: converting the routing metric value of the link into a cost value, and adding the cost value to the cost field corresponding to the link in the routing table.
[0037] The routing metric value of the link is converted into a cost value, and the cost value is added to the cost field corresponding to the link in the routing table, which is convenient for storage and routing selection.
[0038] In some embodiments, step S101, the obtaining of data on path calculation factors of links may include: obtaining data on path calculation factors of multiple links during the first path calculation.
[0039] In the embodiment of the present application, when calculating a path for the first time, route selection needs to be performed, so data of the path calculation factors of the multiple links are obtained to facilitate determining the routing metric values of the multiple links.
[0040] See also Figure 3 In some embodiments, the method may further include: step S104 and step S105.
[0041] Step S104: According to the routing metrics of the multiple links, determine the link with the smallest routing metric and the link with the second smallest routing metric.
[0042] Step S105: the link with the smallest routing metric value is used as the main link, and the link with the second smallest routing metric value is used as the backup link.
[0043] In an embodiment of the present application, after obtaining the routing metric values of the plurality of links, the link with the smallest routing metric value and the link with the second smallest routing metric value can be determined, the link with the smallest routing metric value serves as the main link, and the link with the second smallest routing metric value serves as the backup link. Since the calculation factor for determining the routing metric value includes the link degradation degree representing the link transmission quality, the routing metric value can reflect the link transmission quality. At this time, the link with the smallest routing metric value has the best link transmission quality, and the link with the second smallest routing metric value has the second best link transmission quality. Both the main and backup links can ensure service quality.
[0044] For example, in a path with the same number of hops and the same IGP (Internet Gateway Protocol) configuration, if there are multiple outbound interfaces in the path, the routing metric (or cost value) of the outbound interface with better link transmission quality is smaller than the routing metric (or cost value) of the outbound interface with worse link transmission quality; the offset range of the routing metric (or cost value) of the same path is configurable.
[0045] It should be noted that the primary and backup links are not fixed links, but can be re-determined based on whether the link fails, the routing metric, etc. For example, in time period T1, the primary link is link 1 and the backup link is link 2. In time period T2, the primary link becomes link 2 and the backup link becomes link 3. In time period T3, the primary link becomes link 3 and the backup link becomes link 1, and so on.
[0046] See also Figure 4 In some embodiments, before step S101, the step of obtaining the data of the path calculation factor of the link may further include: step S106.
[0047] Step S106: Switch the current main link to the backup link, and use the backup link as the current service link.
[0048] In an embodiment of the present application, the primary and backup links are switched first, from the current primary link to the backup link, and then the routing metrics of other links except the primary and backup links are determined using the routing factors including the link degradation degree. In this way, preparations can be made for the subsequent switch to a link with better link transmission quality.
[0049] In some embodiments, step S101, the data of obtaining the path calculation factor of the link may include: after the switch, obtaining the data of the path calculation factor of the third link, the third link being a link other than the main link and the backup link. At this time, step S102, determining the routing metric value of the link according to the data of the path calculation factor of the link may include: determining the routing metric value of the third link according to the data of the path calculation factor of the third link.
[0050] In an embodiment of the present application, after the above-mentioned primary-backup link switching, data of the path calculation factor of the third link other than the primary link and the backup link is obtained to facilitate the calculation of the routing metric value of the third link. On the one hand, it can be detected whether the link transmission quality of the current service link is the best compared with the third link. On the other hand, if the link transmission quality of the current service link is not the best compared with the third link, it can be prepared for the subsequent switching to the third link with better link transmission quality.
[0051] See also Figure 5 In some embodiments, the method may further include: step S107.
[0052] Step S107: when the routing metric value of the third link is greater than the routing metric value of the current service link, the current service link is used as the primary link, and the third link is used as the backup link.
[0053] In an embodiment of the present application, if the routing metric value of the third link is greater than the routing metric value of the current service link, the current service link is used as the main link and the third link is used as the backup link. In this way, on the one hand, it is detected that the link transmission quality of the current service link is the best compared to the third link. On the other hand, when the main link fails, it can be directly switched to the backup link.
[0054] See also Figure 6 In some embodiments, the method may further include: step S108.
[0055] Step S108: When the routing metric value of the third link is smaller than the routing metric value of the current service link, the current service link is switched to the third link, the third link is used as the main link, and the current service link is used as the backup link.
[0056] In an embodiment of the present application, if the routing metric value of the third link is less than the routing metric value of the current service link, the current service link is switched to the third link, and the third link is used as the main link, and the current service link is used as the backup link. In this way, on the one hand, it is detected that the link transmission quality of the current service link is not the best compared with the third link. On the other hand, when the link transmission quality of the current service link is not the best compared with the third link, switching to the third link with better link transmission quality can ensure better link transmission quality and better service quality.
[0057] See also Figure 7 , Figure 7This is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device can be a head node on a link, a controller, or other nodes on a link. It should be noted that the electronic device of the embodiment of the present application can implement the above-mentioned routing calculation method. For detailed description of the relevant content, please refer to the above-mentioned method part, which will not be repeated here.
[0058] The electronic device 100 includes a memory 10 and a processor 20, wherein the memory 10 is used to store a computer program; the processor 20 is used to execute the computer program and implement any of the above-mentioned routing calculation methods when executing the computer program. The memory 10 is connected to the processor 20 via a bus.
[0059] The processor 20 may be a microcontroller unit, a central processing unit or a digital signal processor, etc. The memory 10 may be a Flash chip, a read-only memory, a magnetic disk, an optical disk, a USB disk or a mobile hard disk, etc.
[0060] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements any of the routing calculation methods described above.
[0061] The computer-readable storage medium may be an internal storage unit of the electronic device, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, etc.
[0062] The method of the embodiment of the present application is described in detail below with a specific embodiment.
[0063] The basic networking of the technical solution 1 of the embodiment of the present application is as follows Figure 8 As shown, it is applied to the IGP routing calculation scenario. The network includes: node PE1 (address 1.1.1.1), node PE2 (address 2.2.2.2), node PE3, node PE4, node PE5, node PE1 includes 3 interfaces A, A', A", node PE2 includes 2 interfaces I, F, node PE3 includes 3 interfaces B, B', C, node PE4 includes 2 interfaces D, E, node PE5 includes 2 interfaces G, H. The technical solution of the embodiment of the present application supports the following scenarios:
[0064] 1) During the initial route calculation, the IGP route from address 1.1.1.1 to address 2.2.2.2 is calculated on node PE1, and the link degradation is used as the route calculation factor of the IGP route. Since the transmission quality of the link A'->B'->C->D->E->F is better than that of A->B->C->D->E->F, the main link of the route is calculated as: PE1->PE5->PE2, and the route calculation path of the main link is: A"->G->H->I; the backup link is: PE1->PE3->PE4->PE2, and the route calculation path of the backup link is: A'->B'->C->D->E->F;
[0065] 2) When the above-mentioned primary and backup links switch, the path of the primary link is switched to the path of the backup link A'->B'->C->D->E->F; at the same time, the route of the new backup link is calculated. If the transmission quality of the link A->B->C->D->E->F is better than that of A'->B'->C->D->E->F, then the calculated cost value of the link A->B->C->D->E->F is less than that of A'->B'->C->D->E->F, and the link A'->B'->C->D->E->F will be switched to A->B->C->D->E->F; otherwise, the path of the primary link is A'->B'->C->D->E->F, and the path of the backup link is A->B->C->D->E->F. Since a new link is recalculated each time the route is recalculated, and the priority of the previous primary and backup links is compared, the service link quality is ensured to be optimal.
[0066] To explain the effectiveness process and steps of the above mechanism in detail, IS-IS (Intermediate system to intermediate system) routing is taken as an example for further explanation.
[0067] 1) During the initial path calculation, the IS-IS route from address 1.1.1.1 to address 2.2.2.2 is calculated on node PE1, and the link degradation is used as the path calculation factor of the IS-IS route. Since the transmission quality of the link A'->B'->C->D->E->F is better than that of A->B->C->D->E->F, the cost value of the link A"->G->H->I is calculated to be 10; the cost value of the link A'->B'->C->D->E->F is 34, and the cost value of the link A->B->C->D->E->F is 38. Therefore, the primary link of the IS-IS route from address 1.1.1.1 to address 2.2.2.2 is: PE1->PE5->PE2; the backup link is: PE1->PE3->PE4->PE2.
[0068] 2) When the primary and backup links switch from address 1.1.1.1 to address 2.2.2.2, the original primary link path is: A”->G->H->I, and the original backup link path is: A'->B'->C->D->E->F; after the switch, the primary link path is A'->B'->C->D->E->F, and the cost value is 34; at the same time, the cost value of the new link is calculated. Since the transmission quality of the link A->B->C->D->E->F has improved at this time, the cost value of the route A->B->C->D->E->F is calculated to be 32; the cost value of the link A->B->C->D->E->F is less than that of the link A'->B'->C->D->E ->F, the IS-IS routing primary link A'->B'->C->D->E->F is switched to A->B->C->D->E->F, and the backup link is A'->B'->C->D->E->F; if the calculated cost of the link A'->B'->C->D->E->F is greater than the cost of the link A->B->C->D->E->F, the primary link is A'->B'->C->D->E->F, and the backup link is A->B->C->D->E->F; because the cost of a new link is recalculated each time the route is recalculated, and the priority of the previous primary and backup links is compared; thereby ensuring the optimal service link quality.
[0069] In the related art, when calculating IGP neighbors, only the interface status, that is, whether the interface status is UP, is considered. When the interface status is UP, the cost value of the route is the same. When the link transmission quality does not change the interface status, the cost value of the calculated route will not be affected. The embodiment of the present application proposes to use the link degradation degree as a routing factor in the routing calculation, and the route with poor link transmission quality will be reflected by the cost value. It can be seen from the above technical solutions that the embodiment of the present application can ensure that the link quality of the calculated route is optimal and the quality of the bearer service can be guaranteed.
[0070] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0071] In hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0072] The preferred embodiments of the present application are described above with reference to the accompanying drawings, but the scope of the present application is not limited thereby. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present application shall be within the scope of the present application.
Claims
1. A routing calculation method, characterized in that: The method comprises: Acquire data of a path calculation factor of a link, wherein the path calculation factor includes a link degradation degree indicating a link transmission quality; The routing metric value of the link is determined according to the data of the routing factor of the link.
2. The method according to claim 1, characterized in that The method further comprises: The routing metric value of the link is converted into a cost value, and the cost value is added to a cost field corresponding to the link in the routing table.
3. The method according to claim 1, characterized in that The data of obtaining the path calculation factor of the link includes: When calculating a path for the first time, data of path calculation factors of the plurality of links are obtained.
4. The method according to claim 3, characterized in that The method further comprises: According to the routing metrics of the plurality of links, determining a link with a minimum routing metric and a link with a second minimum routing metric; The link with the smallest routing metric value is used as the main link, and the link with the second smallest routing metric value is used as the backup link.
5. The method according to claim 1, characterized in that Before obtaining the data of the path calculation factor of the link, the method includes: The current main link is switched to the backup link, and the backup link is used as the current service link.
6. The method according to claim 5, characterized in that The data of obtaining the path calculation factor of the link includes: After the switching, data of the path calculation factor of the third link is obtained, where the third link is a link other than the main link and the backup link.
7. The method according to claim 6, characterized in that The method further comprises: In a case where the routing metric value of the third link is greater than the routing metric value of the current service link, the current service link is used as the main link, and the third link is used as the backup link.
8. The method according to claim 6, characterized in that The method further comprises: When the routing metric value of the third link is smaller than the routing metric value of the current service link, the current service link is switched to the third link, the third link is used as the main link, and the current service link is used as the backup link.
9. The method according to claim 1, characterized in that: The data of the link degradation degree includes data related to the link packet loss.
10. The method according to claim 9, characterized in that The link degradation data includes a CRC count and / or an interface that is converted to an SD state.
11. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory is used to store a computer program; the processor is used to execute the computer program and implement the routing calculation method according to any one of claims 1 to 10 when executing the computer program.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the routing calculation method according to any one of claims 1 to 10.