Link switching method and device, equipment and medium
By acquiring the number of faulty links and calculating bandwidth utilization, stable switching of aggregation groups in the ERPS ring network was achieved, solving the link instability problem caused by bandwidth reduction in existing technologies and ensuring reliable forwarding of service traffic.
Patent Information
- Application Number
- CN202511223379.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-10-31
AI Technical Summary
The existing ERPS ring network solution based on aggregation group connections suffers from reduced actual available bandwidth when some physical links experience connectivity failures. This leads to packet loss and service interruption when service traffic exceeds the actual available bandwidth, resulting in link instability.
By obtaining the number of faulty links in the connection links, the bandwidth utilization of the aggregation group is calculated, and when the utilization reaches a preset threshold, the connection link is switched from the first aggregation group to the ring protection link, and the status flag is updated to achieve stable switching.
It enables timely switching to the ring-protected link when the bandwidth utilization of the aggregation group exceeds the threshold, ensuring the stability of the link and avoiding packet loss and service interruption.
Smart Images

Figure CN120880834A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a link switching method, apparatus, device and medium. Background Technology
[0002] In Ethernet communication networks, stable forwarding of service data is a core requirement for ensuring the reliable operation of various applications. As network scale expands and service traffic increases, the bandwidth and reliability of a single physical link can no longer meet high availability requirements, leading to the development of Ethernet Ring Protection Switching (ERPS). As a standardized ring network protection mechanism, ERPS can quickly switch service traffic to a preset ring protection link (RPL) when a connectivity failure occurs at a ring network port or link. This ensures that service forwarding resumes within tens of milliseconds, effectively solving the problems of broadcast storms and service interruptions caused by link failures that may occur in traditional Ethernet ring networks.
[0003] Currently, to further enhance the transmission bandwidth and link redundancy capabilities between ERPS ring networks, the industry commonly employs Link Aggregation Groups (RAGs) to achieve inter-ring network connectivity. These ARGs can be either manually configured static groups or dynamically negotiated groups established via the Link Aggregation Control Protocol (LACP). Each ARG is composed of multiple independent physical links. When a small number of physical links in an ARG fail, the remaining links can maintain the connectivity of the ARG, theoretically ensuring basic service traffic transmission. Under this architecture, ERPS still follows traditional fault detection logic, triggering a link switching mechanism only when the entire ARG experiences a connectivity failure, switching service traffic to RPL links.
[0004] However, existing ERPS ring network solutions based on aggregation group connections can lead to packet loss events on the aggregation group links, causing some services to be directly interrupted and ultimately resulting in link instability. Summary of the Invention
[0005] This application provides a link switching method, apparatus, device, and medium that can ensure link stability.
[0006] To achieve the above objectives, this application adopts the following technical solution: Firstly, this application provides a link switching method, including: Get the first number of faulty links in the first aggregation group of the connected links; Based on the first quantity, the total number of links in the first aggregation group, the bandwidth occupied by traffic, and the first bandwidth of each physical link in the first aggregation group, the first bandwidth utilization rate corresponding to the first aggregation group is determined. If the first bandwidth utilization rate is greater than or equal to the preset switching threshold, update the status flag of the first aggregation group and switch the connection link from the first aggregation group to the second aggregation group; wherein, the second aggregation group is a ring-protected link.
[0007] In one embodiment, determining the first bandwidth utilization rate corresponding to the first aggregation group based on the first quantity, the total number of links in the first aggregation group, the bandwidth occupied by traffic, and the first bandwidth of each physical link in the first aggregation group includes: Based on the first quantity, the total number of links in the first aggregation group, and the first bandwidth of each physical link in the first aggregation group, the third bandwidth corresponding to the first aggregation group is determined; the third bandwidth is the total transmission capacity provided by all normal physical links in the first aggregation group; based on the bandwidth occupied by traffic and the third bandwidth, the first bandwidth utilization rate corresponding to the first aggregation group is determined.
[0008] In one embodiment, determining the third bandwidth corresponding to the first aggregation group based on the first quantity, the total number of links in the first aggregation group, and the first bandwidth of each physical link in the first aggregation group includes: The difference between the total number of links in the first aggregation group and the first quantity is determined as the number of available links corresponding to the first aggregation group; the product of the number of available links and the first bandwidth of each physical link in the first aggregation group is determined as the third bandwidth corresponding to the first aggregation group.
[0009] In one embodiment, when the first bandwidth utilization rate is greater than or equal to a preset switching threshold, updating the status flag of the first aggregation group includes: If the first bandwidth utilization rate is greater than or equal to the preset switching threshold, the status flag of the first aggregation group will be updated from the first flag to the second flag; wherein the first flag indicates the connection status; and the second flag indicates the fault status.
[0010] In one embodiment, it includes: When switching a connection link from the first aggregation group to the second aggregation group, the first aggregation group is monitored and the first bandwidth utilization rate corresponding to the first aggregation group is updated. If the updated first bandwidth utilization rate is less than the preset switching threshold, the status flag of the first aggregation group is updated from the second flag to the first flag, and the connection link is switched from the second aggregation group to the first aggregation group.
[0011] In one embodiment, it includes: An alarm message is generated when the first bandwidth utilization rate is greater than or equal to the alarm threshold and less than the preset switching threshold; the alarm message includes the number of faulty links and the bandwidth utilization rate.
[0012] In one embodiment, the first aggregation group is a static aggregation group or a dynamic aggregation group established through a link aggregation control protocol; the link status of the first aggregation group is determined based on the status flag bits of the first aggregation group.
[0013] Secondly, this application provides a link switching device, comprising: The monitoring module is used to obtain the first number of faulty links in the first aggregation group of the connection links; The first determining module is used to determine the first bandwidth utilization rate corresponding to the first aggregation group based on the first quantity, the total number of links in the first aggregation group, the bandwidth occupied by traffic, and the first bandwidth of each physical link in the first aggregation group. The switching module is used to update the status flag of the first aggregation group and switch the connection link from the first aggregation group to the second aggregation group when the first bandwidth utilization rate is greater than or equal to the preset switching threshold; wherein the second aggregation group is a ring-protected link.
[0014] Thirdly, this application provides a computing device, including a memory and a processor; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the computing device performs the method as described in any one of the first aspects.
[0015] Fourthly, this application provides a computer-readable storage medium for storing a computer program for performing the method as described in any one of the first aspects.
[0016] Fifthly, this application provides a computer program product comprising one or more computer instructions, wherein when the computer instructions are executed by a computer, the computer performs the method as described in any one of the first aspects.
[0017] As can be seen from the above technical solution, this application has at least the following beneficial effects: In this application, by obtaining the first number of faulty links in the first aggregation group of the connection links, computational data is provided to determine the actual available bandwidth of the first aggregation group. Furthermore, based on the first number, the total number of links in the first aggregation group, the bandwidth occupied by traffic, and the first bandwidth of each physical link in the first aggregation group, the first bandwidth utilization rate corresponding to the first aggregation group can be determined, providing a basis for judging the link status of the first aggregation group. Furthermore, if the first bandwidth utilization rate is greater than or equal to a preset switching threshold, the status flag of the first aggregation group is updated, and the connection link is switched from the first aggregation group to a ring-protected link, i.e., the second aggregation group, laying the foundation for link stability. This scheme, by introducing the first bandwidth utilization rate, provides a method for evaluating the status of physical links in the first aggregation group; furthermore, by introducing a switching threshold, it provides a basis for determining the node for link switching, ultimately achieving link stability.
[0018] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description
[0019] Figure 1 This is an application environment diagram of a link switching method provided in the embodiments of this application; Figure 2 This is a flowchart illustrating a link switching method provided in an embodiment of this application; Figure 3 This is a schematic diagram of a process for determining a first bandwidth utilization rate provided in an embodiment of this application; Figure 4 This is a structural block diagram of a link switching device provided in the embodiments of this application; Figure 5 This is an internal structural diagram of a computer device provided in the embodiments of the application. Detailed Implementation
[0020] The terms "first," "second," and "third," etc., used in this application specification and accompanying drawings are used to distinguish different objects, not to limit a specific order.
[0021] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0022] To ensure clarity and conciseness in the description of the following embodiments, a brief introduction to the related technologies is given first: In Ethernet communication networks, stable forwarding of service data is a core requirement for ensuring the reliable operation of various applications. As network scale expands and service traffic increases, the bandwidth and reliability of a single physical link can no longer meet high availability requirements, leading to the development of Ethernet Ring Protection Switching (ERPS). As a standardized ring network protection mechanism, ERPS can quickly switch service traffic to a preset ring protection link (RPL) when a connectivity failure occurs at a ring network port or link. This ensures that service forwarding resumes within tens of milliseconds, effectively solving the problems of broadcast storms and service interruptions caused by link failures that may occur in traditional Ethernet ring networks.
[0023] Currently, to further enhance the transmission bandwidth and link redundancy capabilities between ERPS ring networks, the industry commonly employs Link Aggregation Groups (RAGs) to achieve inter-ring network connectivity. These ARGs can be either manually configured static groups or dynamically negotiated groups established via the Link Aggregation Control Protocol (LACP). Each ARG is composed of multiple independent physical links. When a small number of physical links in an ARG fail, the remaining links can maintain the connectivity of the ARG, theoretically ensuring basic service traffic transmission. Under this architecture, ERPS still follows traditional fault detection logic, triggering a link switching mechanism only when the entire ARG experiences a connectivity failure, switching service traffic to RPL links.
[0024] However, existing ERPS ring network solutions based on aggregation group connections have drawbacks: when some physical links in the aggregation group experience connectivity failures, although the aggregation group as a whole remains operational and ERPS does not trigger failover, the actual available bandwidth of the aggregation group is reduced from the initial bandwidth achievable by all operational physical links to the bandwidth achievable by the remaining available physical links. If the actual service traffic exceeds the actual available bandwidth of the aggregation group at this time, packet loss will occur on the aggregation group links, some services will be directly interrupted, and ultimately, the links will become unstable.
[0025] To make the technical solution of this application clearer and easier to understand, the application scenarios of the technical solution of this application are described below with reference to the accompanying drawings. Figure 1 As shown in the figure, this figure is a schematic diagram of an application scenario provided by an embodiment of this application.
[0026] In this application scenario, server 104 analyzes and processes the monitoring data of the aggregated link to determine the link status, and sends the link status to terminal 102 so that relevant technical personnel can manage and adjust the link.
[0027] To make the technical solution of this application clearer and easier to understand, the following describes a link switching method provided by an embodiment of this application, in conjunction with the above application scenarios. For example... Figure 2 As shown, this figure is a flowchart of a link switching method provided in an embodiment of this application.
[0028] S201. Obtain the first number of faulty links in the first aggregation group of the connected links.
[0029] In this context, a connection link refers to a transmission path in an ERPS ring network based on aggregated links, used to connect two ring network devices (such as Device1 and Device2). It consists of at least one aggregation group (such as the first and second aggregation groups between Device1 and Device2), serving as the physical transport channel for forwarding service traffic between ring network devices. The first aggregation group can be the aggregation group in the ERPS ring network that handles normal service traffic forwarding. It is the aggregation group corresponding to a non-RPL link and can be a static aggregation group (formed by manually binding multiple physical links) or a dynamic aggregation group (established through LACP protocol negotiation, automatically completing link aggregation and state synchronization). It is the main transmission carrier for service traffic. A faulty link refers to a physical link in the first aggregation group that experiences connectivity issues. Fault determination criteria may include, but are not limited to, a physical port being in a state of failure where it cannot receive or send data (such as port hardware failure or physical link breakage), or failure via CFM (Connection Fault). Link failures detected by the Management (Connection Fault Management) protocol (such as link signal loss, frame transmission error rate exceeding the standard) are considered links that cannot normally carry service data forwarding and need to be excluded from the available links of the aggregation group; the first quantity is the total number of physical links currently in a fault state in the first aggregation group, which is the core basic data for calculating the current available bandwidth of the aggregation group and determining whether to perform ERPS link switching.
[0030] For example, a data interaction channel can be established with the physical ports of the first aggregation group and the link detection protocol (such as CFM) to obtain link status information in real time; then, the port status (Up / Down, Up represents a normal state that can receive or send data normally, Down represents a failed state that cannot receive or send data normally) and link transmission parameters (such as signal strength, frame loss rate, bit error rate, etc.) of each physical link in the first aggregation group can be collected in real time. When any physical link changes from Up to Down (or the CFM protocol detects a link failure), the number of faulty links in the first aggregation group is updated, i.e., the first number.
[0031] Optionally, the first aggregation group can be composed of M physical links aggregated together (M is a positive integer greater than 1), and the bandwidth of each physical link is B. Under normal conditions, the overall bandwidth of the first aggregation group is M×B; the first quantity can be represented by N (N is a non-negative integer and N<M; if N = M, the first aggregation group is in a failure state as a whole). When the first aggregation group is started, all physical links in the first aggregation group can be scanned first to confirm the initial number of normal links (such as the initial number of normal links is M). At this time, the total number of physical links in a failure state is 0, that is, the first quantity N = 0; further, in the case of capturing a failure event, the identifier of the failed link (such as the port number) is located, and it is checked whether this physical link has been included in the list of failed links. If it has not been included, N is incremented by 1, and the "list of failed links" is updated; if it has been included, no duplicate counting is performed to avoid an inflated N value; Also, when a failure recovery event is captured, the identifier of the recovered link is located, and it is checked whether this link is in the list of failed links. If it is, N is decremented by 1, and this link is removed from the list; if it is not, the value of N is not adjusted to avoid an understated N value; further, the latest value of N, the identifier of the failed link, and the update timestamp can be stored in the local cache to provide data support for subsequent calculation of the bandwidth utilization rate.
[0032] Optionally, a combination of real-time polling + event triggering can be used for monitoring and collection. The polling period can be configured, such as the default is 100 ms / time, to ensure rapid capture of link status changes; at the same time, when the link detection protocol actively reports a link failure or a link recovery event, an immediate response can be made without waiting for the polling period; furthermore, to avoid misjudgment caused by instantaneous interference, a debounce time threshold can be set for link status changes, such as 100 ms. Only when the link status remains abnormal or has recovered for more than this threshold, is it confirmed that the link status failure or the link status recovery is valid.
[0033] S202. Determine the first bandwidth utilization rate corresponding to the first aggregation group based on the first quantity, the total number of links in the first aggregation group, the bandwidth occupied by traffic, and the first bandwidth of each physical link in the first aggregation group.
[0034] Among them, the total number of links can refer to the total number of physical links constituting the aggregation group, such as represented by M (M is a positive integer greater than 1); the first bandwidth utilization rate can refer to the ratio of the current available bandwidth of the first aggregation group to the bandwidth actually occupied by services, which can reflect the bandwidth carrying pressure of the aggregation group.
[0035] Optionally, the first bandwidth can refer to the fixed bandwidth of a single physical link in the first aggregation group, such as denoted by B (e.g., 1Gbps, 10Gbps, etc.). Its value is a fixed parameter when the physical link is manufactured or configured, and it does not change with the link status or traffic. The bandwidth occupied by the traffic can refer to the actual bandwidth occupied by the service traffic currently carried by the first aggregation group, such as denoted by B0. Regardless of whether the service traffic has been switched to the second aggregation group (RPL link), the bandwidth occupied by the traffic is always the bandwidth value actually required by the current service.
[0036] For example, we can first obtain the first quantity N (the number of faulty links updated in real time), the total number of links in the first aggregation group M (the total number of fixed links when the aggregation group is configured), the first bandwidth B, and the bandwidth occupied by traffic B0 (B is the fixed bandwidth of the physical link, and B0 is the bandwidth actually occupied by the current service); further, we can input the first quantity N, the total number of links in the first aggregation group M, the first bandwidth B, and the bandwidth occupied by traffic B0 into the bandwidth utilization model, and the bandwidth utilization model will calculate and analyze them to obtain the first bandwidth utilization T corresponding to the first aggregation group.
[0037] S203. If the first bandwidth utilization rate is greater than or equal to the preset switching threshold, update the status flag of the first aggregation group and switch the connection link from the first aggregation group to the second aggregation group.
[0038] The preset switching threshold refers to the bandwidth utilization threshold that triggers link switching. When the first bandwidth utilization is greater than or equal to the preset switching threshold, it means that the available bandwidth of the first aggregation group can no longer meet the service demand, and the link switching process needs to be initiated. The status flag includes a first flag and a second flag, which can be used to identify the parameters of the current operating status of the first aggregation group. By switching the status, it is clear whether the aggregation group is in a fault state that requires ERPS intervention (i.e., switching to the second aggregation group), so as to avoid repeated or missed notifications. The second aggregation group is a ring protection link, i.e., "RPL link", which is a preset backup protection link in the ERPS ring network. Under normal conditions, the physical links in the second aggregation group are in a blocking state and do not carry service traffic. When the first aggregation group triggers link switching, the links of the second aggregation group are opened to take over the service traffic switched from the first aggregation group.
[0039] One possible approach is to update the status flag of the first aggregation group from a first flag to a second flag when the first bandwidth utilization rate is greater than or equal to a preset switching threshold.
[0040] The first flag indicates the connection status; the second flag indicates the fault status.
[0041] Optionally, the link status of the first aggregation group is determined based on the status flag bit of the first aggregation group. The first flag can be one of the values of the status flag bit, which can indicate that the aggregation group is in the "Link state", that is, the current available bandwidth of the first aggregation group can meet the service requirements, the link is in a normal connection state, and no link switching operation is required; the second flag can be another value of the status flag bit, which can indicate that the aggregation group is in the "Failure state", that is, the current available bandwidth of the first aggregation group cannot meet the service requirements, the link is in a fault state, and a link switching operation needs to be performed. Furthermore, when switching the connection link from the first aggregation group to the second aggregation group, the first aggregation group is monitored and the first bandwidth utilization rate corresponding to the first aggregation group is updated; if the updated first bandwidth utilization rate is less than the preset switching threshold, the status flag of the first aggregation group is updated from the second flag to the first flag, and the connection link is switched from the second aggregation group to the first aggregation group.
[0042] For example, the first bandwidth utilization rate can be obtained in real time and compared with a preset switching threshold to determine whether the condition of first bandwidth utilization rate ≥ preset switching threshold is met. If not, the current status flag and connection link remain unchanged. If the condition is met, if the current status flag of the first aggregation group is the first flag (Link status), its status flag is updated to the second flag (Failure status), the status change timestamp is recorded, and the connection link is switched from the first aggregation group to the second aggregation group. If the current status flag of the first aggregation group is already the second flag (Failure status), the status update operation is not performed to avoid repeated modification. Furthermore, after the link switch is completed, the status of the second aggregation group can be updated synchronously. For example, when the ring network is normal and there are no link failures, every physical link in the Ethernet ring network is connected, and all nodes are connected in a ring. The loop protection protocol will block the links of the second aggregation group to prevent loops and broadcast storms in the network. Under normal circumstances, the status of the second aggregation group can be set to the IDLE state (i.e., the ready state). At this time, service traffic is forwarded through the normal links (the first aggregation group). However, when a physical link in the ring network is disconnected or a connectivity failure occurs, and a link switch is required (switching service data traffic to the links of the second aggregation group), the status of the second aggregation group is changed to the Protecting state (i.e., the working state). At this time, the previously blocked links of the second aggregation group will be released to carry service traffic, while the faulty links of the first aggregation group will be disconnected to prevent data from being transmitted from the faulty links. This ensures that service data traffic can be restored and forwarded in a short time, minimizing the impact on services.
[0043] The aforementioned link switching method provides computational data for determining the actual available bandwidth of the first aggregation group by obtaining the first number of faulty links in the first aggregation group. Furthermore, based on the first number, the total number of links in the first aggregation group, the bandwidth occupied by traffic, and the first bandwidth of each physical link in the first aggregation group, the first bandwidth utilization rate corresponding to the first aggregation group can be determined, providing a basis for judging the link status of the first aggregation group. Further, if the first bandwidth utilization rate is greater than or equal to a preset switching threshold, the status flag of the first aggregation group is updated, and the connecting link is switched from the first aggregation group to a ring-protected link, i.e., the second aggregation group, laying the foundation for link stability. This scheme introduces the first bandwidth utilization rate to provide a framework for evaluating the status of physical links in the first aggregation group; furthermore, by introducing a switching threshold, it provides a basis for determining the node for link switching, ultimately achieving link stability.
[0044] Based on the above embodiments, this application provides a detailed explanation of S202. Specifically, this application involves a process for determining the first bandwidth utilization rate corresponding to the first aggregation group, such as... Figure 3 As shown, the specific steps include: S301. Based on the first quantity, the total number of links in the first aggregation group, and the first bandwidth of each physical link in the first aggregation group, determine the third bandwidth corresponding to the first aggregation group.
[0045] The third bandwidth can refer to the total transmission capacity that all normal physical links within the aggregation group can provide, such as the current available bandwidth of the first aggregation group.
[0046] One possible approach is to determine the number of available links corresponding to the first aggregation group by the difference between the total number of links in the first aggregation group and the first quantity; and to determine the third bandwidth corresponding to the first aggregation group by the product of the number of available links and the first bandwidth of each physical link in the first aggregation group.
[0047] The number of available links refers to the number of physical links in the first aggregation group that can currently carry business traffic normally, which can directly determine the actual carrying capacity of the aggregation group. For example, the calculation is performed according to the formula "Number of available links = Total number of links in the first aggregation group M - First quantity N". If the calculated number of available links is 0 (i.e., N = M), there is no need to calculate the third bandwidth corresponding to the first aggregation group, and the link switching is performed directly. If the number of available links is ≥ 1, the third bandwidth is calculated. Furthermore, if the first bandwidth B of all physical links in the first aggregation group is consistent, the "Third bandwidth = Number of available links × B" is executed directly. For example, when the number of available links is 3 and B = 10Gbps, the third bandwidth is 3 × 10 = 30Gbps. Then, the calculated third bandwidth can be associated with the timestamp, the first aggregation group identifier (such as Trunk1), and the current N value, and stored in the local database.
[0048] It should be noted that if the third bandwidth calculation is completed and the data is valid, the third bandwidth value can be used as an intermediate result and fed back to the bandwidth utilization calculation stage in real time to calculate the first bandwidth utilization. If an anomaly occurs during the calculation process (such as data verification failure or calculation logic error), the subsequent bandwidth utilization calculation will be paused, an "abnormal third bandwidth calculation" alarm will be sent to the administrator, and an anomaly log (including the anomaly time, abnormal data, and error code) will be recorded to facilitate troubleshooting. When the third bandwidth changes (such as an update of the N value causing a change in the number of available links, which in turn causes a change in the third bandwidth), the locally stored data will be updated, and the first bandwidth utilization will be recalculated to ensure that subsequent operations are based on the latest third bandwidth data and to avoid misjudgments due to data lag.
[0049] S302. Based on the bandwidth occupied by traffic and the third bandwidth, determine the first bandwidth utilization rate corresponding to the first aggregation group.
[0050] Among them, the bandwidth occupied by traffic is equal to the bandwidth actually required by the current service, and does not change with the switching of the bearer link.
[0051] Optionally, the bandwidth usage can be obtained by directly reading the service traffic statistics interface data corresponding to the first aggregation group. If the service traffic has been switched to the second aggregation group (RPL link), the service traffic statistics data of the second aggregation group can also be read directly. The collection frequency is consistent with the aggregation group link status detection frequency (e.g., 100ms / time) to ensure the real-time performance of the bandwidth usage. At the same time, the collected data can also be verified. If the bandwidth usage is <0 or far exceeds the service design bandwidth (e.g., the design bandwidth is 50Gbps, and the collected value is 100Gbps), the data is judged to be abnormal. The average value of the first 3 collections is used as the temporary bandwidth usage, and an alarm of "bandwidth data collection abnormal" is sent to the administrator.
[0052] For example, the first bandwidth utilization rate can be calculated using the formula: "First bandwidth utilization rate = Bandwidth occupied by traffic / Third bandwidth × 100%". For instance, when the bandwidth occupied by traffic is 25Gbps and the third bandwidth is 30Gbps, the first bandwidth utilization rate is approximately (25 / 30) × 100% ≈ 83.3%. Two decimal places can be retained during the calculation to ensure the accuracy meets the threshold judgment requirements.
[0053] Furthermore, the calculated first bandwidth utilization rate and related data (calculation timestamp, current B0 value, third bandwidth value, N value) can be stored in a local cache (such as the device's in-memory database) and simultaneously written to a log file (log format includes "time-aggregation group identifier-bandwidth occupied by traffic-third bandwidth-first bandwidth utilization rate"), facilitating subsequent fault backtracking and data analysis. The first bandwidth utilization rate can also be synchronized to the network management platform's visualization interface, allowing administrators to view the bandwidth load pressure of the first aggregation group in real time. Additionally, when the bandwidth occupied by traffic changes (e.g., an increase / decrease in service traffic) or the third bandwidth changes (e.g., an increase / decrease in N causing a rise or fall in third bandwidth), the system can detect changes in bandwidth usage. Immediately recalculate and update the first bandwidth utilization rate to ensure that it reflects the bandwidth carrying capacity in real time. After each update, compare the result with the previous calculation. If the difference exceeds 5% (configurable adaptively), re-collect and verify the bandwidth occupied by traffic and the third bandwidth data to confirm whether the first bandwidth utilization rate has changed abruptly due to data fluctuations (such as a sudden increase in bandwidth occupied by traffic due to a peak in instantaneous traffic). If it is confirmed to be an instantaneous fluctuation, a "jitter mechanism" can be set (such as confirming the update of the first bandwidth utilization rate only if the difference exceeds 5% after 3 consecutive collections) to avoid misjudgment due to short-term fluctuations.
[0054] In this embodiment of the application, by determining the third bandwidth corresponding to the first aggregation group, a data basis is provided for assessing whether the first aggregation group can handle the current service; furthermore, by calculating the first bandwidth utilization rate, a direct judgment condition is provided for determining whether to perform link switching, laying the foundation for ensuring link stability.
[0055] Based on the above embodiments, this application provides a detailed explanation of the first bandwidth utilization rate, specifically including: An alarm message is generated when the first bandwidth utilization rate is greater than or equal to the alarm threshold and less than the preset switching threshold.
[0056] The alarm threshold can refer to the first bandwidth utilization threshold that triggers the generation of alarm information; the switching threshold can refer to the first bandwidth utilization threshold that triggers link switching. When the first bandwidth utilization is greater than or equal to the switching threshold, the available bandwidth of the aggregation group cannot meet the service demand, and link switching needs to be performed at the same time as generating an alarm. When the first bandwidth utilization meets the condition that the alarm threshold is less than or equal to the first bandwidth utilization and the switching threshold, it means that the available bandwidth of the aggregation group is under pressure but can still carry the current service. An alarm needs to be sent to the administrator to indicate the potential risk and avoid further bandwidth deterioration leading to service interruption. The alarm information can include, but is not limited to, the number of faulty links and bandwidth utilization, and is a risk warning message sent to the network administrator.
[0057] In this embodiment of the application, by introducing an alarm threshold, a standard is provided for determining the link congestion status; furthermore, by providing alarm information, a foundation is laid for timely notification of the link status to relevant technical personnel and for making corresponding link adjustments.
[0058] The above text combined Figures 1 to 3 The link switching method provided in the embodiments of this application has been described in detail. The apparatus and devices provided in the embodiments of this application will be described below with reference to the accompanying drawings.
[0059] like Figure 4 As shown in the figure, this is a schematic diagram of a link switching device provided in an embodiment of this application. The device 600 includes: a monitoring module 601, a first determination module 602, and a switching module 603, wherein: Monitoring module 601 is used to obtain the first number of faulty links in the first aggregation group of the connected links; The first determining module 602 is used to determine the first bandwidth utilization rate corresponding to the first aggregation group based on the first quantity, the total number of links in the first aggregation group, the bandwidth occupied by traffic, and the first bandwidth of each physical link in the first aggregation group. The switching module 603 is used to update the status flag of the first aggregation group and switch the connection link from the first aggregation group to the second aggregation group when the first bandwidth utilization rate is greater than or equal to a preset switching threshold; wherein the second aggregation group is a ring-protected link.
[0060] In one embodiment, the first determining module 602 is specifically used for: Based on the first quantity, the total number of links in the first aggregation group, and the first bandwidth of each physical link in the first aggregation group, the third bandwidth corresponding to the first aggregation group is determined; the third bandwidth is the total transmission capacity provided by all normal physical links in the first aggregation group; based on the bandwidth occupied by traffic and the third bandwidth, the first bandwidth utilization rate corresponding to the first aggregation group is determined.
[0061] In one embodiment, the first determining module 602 is specifically used for: The difference between the total number of links in the first aggregation group and the first quantity is determined as the number of available links corresponding to the first aggregation group; the product of the number of available links and the first bandwidth of each physical link in the first aggregation group is determined as the third bandwidth corresponding to the first aggregation group.
[0062] In one embodiment, the switching module 603 is specifically used for: If the first bandwidth utilization rate is greater than or equal to the preset switching threshold, the status flag of the first aggregation group will be updated from the first flag to the second flag; wherein the first flag indicates the connection status; and the second flag indicates the fault status.
[0063] In one embodiment, the link switching device 600 further includes: The update module is used to monitor the first aggregation group and update the first bandwidth utilization rate corresponding to the first aggregation group when the connection link is switched from the first aggregation group to the second aggregation group; if the first bandwidth utilization rate is less than the preset switching threshold after the update, the status flag of the first aggregation group is updated from the second flag to the first flag, and the connection link is switched from the second aggregation group to the first aggregation group.
[0064] In one embodiment, the link switching device 600 further includes: The alarm module is used to generate alarm information when the first bandwidth utilization rate is greater than or equal to the alarm threshold and less than the preset switching threshold; the alarm information includes the number of faulty links and the bandwidth utilization rate.
[0065] In one embodiment, the first aggregation group is a static aggregation group or a dynamic aggregation group established through a link aggregation control protocol; the link status of the first aggregation group is determined based on the status flag bits of the first aggregation group.
[0066] The link switching device 600 according to the embodiments of this application can correspondingly execute the method described in the embodiments of this application, and the other operations and / or functions of each module / unit of the link switching device 600 are respectively for implementing Figure 2 , Figure 3 For the sake of brevity, the corresponding processes of each method in the illustrated embodiments will not be described in detail here.
[0067] This application also provides a computing device. This computing device can be a local computing device or an application server.
[0068] like Figure 5 As shown in the figure, this is a schematic diagram of a computing device provided in an embodiment of this application. The computing device 700 includes a bus 701, a processor 702, a communication interface 703, and a memory 704. The processor 702, the memory 704, and the communication interface 703 communicate with each other via the bus 701.
[0069] The 701 bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0070] The processor 702 can be any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).
[0071] Communication interface 703 is used for external communication. For example, communication interface 703 can be used to communicate with terminal 102. Communication interface 703 is used to send alarm information to terminal 102 so that terminal 102 can display the alarm information.
[0072] Memory 704 may include volatile memory, such as random access memory (RAM). Memory 704 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0073] The memory 704 stores executable code, and the processor 702 executes the executable code to perform the aforementioned link switching method.
[0074] Specifically, in achieving Figure 4 In the case of the illustrated embodiment, and Figure 4 When the modules or units of the link switching device described in the embodiment are implemented in software, the following steps are performed: Figure 4 The software or program code required for the functions of each module / unit can be partially or wholly stored in memory 704. Processor 702 executes the program code corresponding to each unit stored in memory 704 to perform the aforementioned link switching method.
[0075] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to perform the aforementioned link switching method.
[0076] This application also provides a computer program product comprising one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in this application are generated.
[0077] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, or data center to another website, computer, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0078] When the computer program product is executed by a computer, the computer performs any of the aforementioned link switching methods. The computer program product can be a software installation package; when any of the aforementioned link switching methods needs to be used, the computer program product can be downloaded and executed on the computer.
[0079] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.
[0080] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the scope of protection of this application.
Claims
1. A link switching method, characterized in that, The method includes: Get the first number of faulty links in the first aggregation group of the connected links; Based on the first quantity, the total number of links in the first aggregation group, the bandwidth occupied by traffic, and the first bandwidth of each physical link in the first aggregation group, the first bandwidth utilization rate corresponding to the first aggregation group is determined. If the first bandwidth utilization rate is greater than or equal to a preset switching threshold, update the status flag of the first aggregation group and switch the connection link from the first aggregation group to the second aggregation group; wherein, the second aggregation group is a ring-protected link.
2. The method according to claim 1, characterized in that, The step of determining the first bandwidth utilization rate corresponding to the first aggregation group based on the first quantity, the total number of links in the first aggregation group, the bandwidth occupied by traffic, and the first bandwidth of each physical link in the first aggregation group includes: Based on the first quantity, the total number of links in the first aggregation group, and the first bandwidth of each physical link in the first aggregation group, the third bandwidth corresponding to the first aggregation group is determined; the third bandwidth is the total transmission capacity provided by all normal physical links in the first aggregation group. Based on the bandwidth occupied by traffic and the third bandwidth, the first bandwidth utilization rate corresponding to the first aggregation group is determined.
3. The method according to claim 2, characterized in that, The step of determining the third bandwidth corresponding to the first aggregation group based on the first quantity, the total number of links in the first aggregation group, and the first bandwidth of each physical link in the first aggregation group includes: The difference between the total number of links in the first aggregation group and the first quantity is determined as the number of available links corresponding to the first aggregation group; The product of the number of available links and the first bandwidth of each physical link in the first aggregation group is determined as the third bandwidth corresponding to the first aggregation group.
4. The method according to claim 1, characterized in that, The status flags include a first flag and a second flag. Updating the status flags of the first aggregation group when the first bandwidth utilization is greater than or equal to a preset switching threshold includes: If the first bandwidth utilization rate is greater than or equal to a preset switching threshold, the status flag of the first aggregation group is updated from the first flag to the second flag; wherein the first flag indicates the connection status; and the second flag indicates the fault status.
5. The method according to claim 1, characterized in that, The method further includes: When switching the connection link from the first aggregation group to the second aggregation group, the first aggregation group is monitored and the first bandwidth utilization corresponding to the first aggregation group is updated; If the first bandwidth utilization rate is less than the preset switching threshold after the update, the status flag of the first aggregation group is updated from the second flag to the first flag, and the connection link is switched from the second aggregation group to the first aggregation group.
6. The method according to claim 1, characterized in that, The method further includes: An alarm message is generated when the first bandwidth utilization rate is greater than or equal to the alarm threshold and less than the preset switching threshold; wherein the alarm message includes the number of faulty links and the bandwidth utilization rate.
7. The method according to claim 1, characterized in that, The first aggregation group is either a static aggregation group or a dynamic aggregation group established through a link aggregation control protocol; the link status of the first aggregation group is determined based on the status flag bits of the first aggregation group.
8. A link switching device, characterized in that, The device includes: The monitoring module is used to obtain the first number of faulty links in the first aggregation group of the connection links; The first determining module is used to determine the first bandwidth utilization rate corresponding to the first aggregation group based on the first quantity, the total number of links in the first aggregation group, the bandwidth occupied by traffic, and the first bandwidth of each physical link in the first aggregation group. The switching module is used to update the status flag of the first aggregation group and switch the connection link from the first aggregation group to the second aggregation group when the first bandwidth utilization rate is greater than or equal to a preset switching threshold; wherein the second aggregation group is a ring-protected link.
9. A computing device, characterized in that, Including memory and processor; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the computing device performs the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method as described in any one of claims 1 to 7.
Citation Information
Cited By
Link management method and device, access switch and storage medium
CN121547395A