CN109274546B - Timer scheduling method and device - Google Patents

Timer scheduling method and device Download PDF

Info

Publication number
CN109274546B
CN109274546B CN201810892114.XA CN201810892114A CN109274546B CN 109274546 B CN109274546 B CN 109274546B CN 201810892114 A CN201810892114 A CN 201810892114A CN 109274546 B CN109274546 B CN 109274546B
Authority
CN
China
Prior art keywords
timer
bfd session
timing node
timing
scheduled
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810892114.XA
Other languages
Chinese (zh)
Other versions
CN109274546A (en
Inventor
杨逸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201810892114.XA priority Critical patent/CN109274546B/en
Publication of CN109274546A publication Critical patent/CN109274546A/en
Application granted granted Critical
Publication of CN109274546B publication Critical patent/CN109274546B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/22Alternate routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a timer scheduling method and device. The method is applied to network equipment, the network equipment represents a set timed interrupt instruction through a virtual linked list structure, each timing node forming a virtual linked list bears at least one timer, each timer is in one-to-one correspondence with BFD session established by the network equipment, and the method comprises the following steps: determining a first timing node borne by a timer corresponding to each BFD session in a virtual linked list according to the established overtime duration agreed by each BFD session and the duration for generating a timed interrupt instruction; if the number of the loaded timers exceeds the scheduling threshold, determining the timers to be scheduled which meet the preset scheduling strategy from the timers loaded by the first timing node; and selecting a second timing node with the minimum load capacity for bearing the timer in a timing node interval containing the first timing node, and scheduling the timer to be scheduled to the second timing node. Therefore, the reliability and the stability of the network equipment can be improved.

Description

Timer scheduling method and device
Technical Field
The present application relates to the field of scheduling technologies, and in particular, to a timer scheduling method and apparatus.
Background
In order to reduce the influence of the network device failure on the service of the communication system, the network device needs to be able to detect the communication failure with the adjacent network device as soon as possible, so that the communication system can take service switching measures in time to ensure the service to continue. The Bidirectional Forwarding Path Detection (BFD) technology provides a general and standardized media independent and Protocol independent fast failure Detection mechanism, and can uniformly and fast detect Bidirectional Forwarding paths between two network devices for various upper layer protocols, such as Open Shortest Path First (OSPF) Protocol, Border Gateway Protocol (BGP) Protocol, and the like.
As the scale of communication systems continues to increase, the number of other network devices adjacent to a network device, particularly a router device, becomes very large. Thus, the network device needs to establish a large number of BFD sessions with other adjacent network devices, set a corresponding timer for each established BFD session to perform timing, and trigger BFD session state detection when the timing is up. After detecting that the BFD session state is a failure state according to the timer, the network device needs to notify an upper layer protocol linked with the BFD to perform corresponding bidirectional forwarding path switching processing, so as to implement a fast switching function.
However, in the BFD session state detection method, because the number of BFD sessions established by the network device is very large, the timers corresponding to different BFD sessions are independent of each other. Therefore, it is possible that a large number of timers are timed at the same time, so as to trigger a large number of BFD session state detections, so that resource usage of network equipment forms burst usage, which causes network equipment oscillation, and causes increased processing delay of BFD session state detection, even network equipment congestion, thereby affecting reliability and stability of network equipment.
Disclosure of Invention
In view of this, embodiments of the present application provide a timer scheduling method and apparatus, which solve the technical problem that a large number of timers trigger BFD session state detection at the same time, resulting in burst resource usage, which results in lower reliability and stability of network devices.
In a first aspect, an embodiment of the present application provides a timer scheduling method, where the method is applied to a network device, where the network device represents a set timer interrupt instruction through a virtual linked list structure, each timing node forming the virtual linked list carries at least one timer, each timer is in one-to-one correspondence with a BFD session established by the network device, and a time step between adjacent timing nodes is a time length for generating the timer interrupt instruction, where the method includes:
determining a first timing node borne by a timer corresponding to each BFD session in the virtual linked list according to the established overtime length agreed by each BFD session and the time length for generating the timed interrupt instruction;
if the number of the timers borne by the first timing node exceeds a preset scheduling threshold, determining the timers to be scheduled which meet a preset scheduling strategy from the timers borne by the first timing node;
and selecting a second timing node with the minimum load of a bearer timer in a timing node interval containing the first timing node, and scheduling the timer to be scheduled to the second timing node.
With reference to the first aspect, in a first possible implementation manner,
before determining, in the virtual chain table, a first timing node carried by a timer corresponding to each BFD session according to the established timeout duration agreed by each BFD session and the duration for generating the timer interrupt instruction, the method further includes:
when the network equipment generates a timed interrupt instruction, determining a third timed node currently indicated by the timed interrupt instruction in the virtual linked list;
determining a BFD session corresponding to at least one timer loaded on the third timing node;
acquiring a received message upgrading identifier corresponding to each BFD session from a stored BFD session table item; if the corresponding BFD session is determined to be in a normal state through the received message upgrading identifier, the timer corresponding to the BFD session is loaded to a fourth timing node in the virtual linked list again according to the timeout duration agreed by the BFD session and the duration for generating the timing interrupt instruction;
and if the corresponding BFD session is determined to be in an abnormal state through the received message upgrading identifier, deleting the BFD session from the stored BFD session table item, and deleting the timer corresponding to the BFD session on the third timing node from the virtual linked list.
With reference to the first aspect or the second possible implementation manner of the first aspect, in a second possible implementation manner, if the number of timers that are carried by the first timing node exceeds a preset scheduling threshold, determining a timer to be scheduled that meets a preset scheduling policy from among the timers that are already carried by the first timing node includes:
if the number of the timers borne by the first timing node exceeds the scheduling threshold, acquiring the timeout duration of the BFD session corresponding to each timer borne by the first timing node and the attenuation count representing the scheduling probability of each BFD session;
and determining the timer to be scheduled according to the timeout duration of the BFD session corresponding to each timer and the attenuation count representing the scheduling probability of each BFD session.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, the calculating, according to the timeout duration of the BFD session corresponding to each timer and the attenuation count representing the scheduling probability of each BFD session, includes:
selecting a timer corresponding to the BFD session with the largest timeout duration from the BFD sessions with the smallest attenuation count as the timer to be scheduled;
or the like, or, alternatively,
selecting a timer corresponding to the BFD session with the minimum attenuation count from the BFD session with the maximum timeout duration as the timer to be scheduled;
after the scheduling the timer to be scheduled to the second timing node, the method further includes:
updating the attenuation count of the BFD session corresponding to the timer to be scheduled to an initial value, and timing;
and when the time-out duration of the BFD session is timed, subtracting 1 from the attenuation count of the BFD session, and timing again until the attenuation count of the BFD session is 0.
With reference to the first aspect or the first possible implementation manner of the first aspect, in a fourth possible implementation manner, the selecting, within a timing node interval including the first timing node, a second timing node that bears a minimum load of a timer includes:
if the timer to be scheduled is a receiving timer, determining a first interval from the interval of the timing nodes, wherein the first interval takes the previous timing node adjacent to the first timing node and the lower limit of the interval of the timing nodes as the boundary;
taking the timing node with the minimum load capacity of the bearing timer as the second timing node from the first interval;
or the like, or, alternatively,
if the timer to be scheduled is a sending timer, determining a second interval from the interval of the timing nodes, wherein the second interval takes the upper limit of the interval of the timing node and the next timing node adjacent to the first timing node as a boundary;
and taking the timing node with the minimum load of the bearing timer as the second timing node from the second interval.
In a second aspect, an embodiment of the present application provides a timer scheduling apparatus, where a virtual chain table structure represents a set timer interrupt instruction, each timing node forming the virtual chain table carries at least one timer, each timer corresponds to a BFD session established by a network device one to one, and a time step between adjacent timing nodes is a time length for generating the timer interrupt instruction, where the apparatus includes:
a carrier node determining module, configured to determine, in the virtual linked list, a first timing node carried by a timer corresponding to each BFD session according to an established timeout duration agreed by each BFD session and a duration for generating the timed interrupt instruction;
a to-be-scheduled timer determining module, configured to determine a to-be-scheduled timer that meets a preset scheduling policy from the timers already carried by the first timing node if the number of timers carried by the first timing node exceeds a preset scheduling threshold;
and the scheduling module is used for selecting a second timing node with the minimum load capacity for bearing a timer in a timing node interval containing the first timing node and scheduling the timer to be scheduled to the second timing node.
With reference to the second aspect, in a first possible implementation manner, the apparatus further includes:
a BFD session state detection module, configured to determine, in the virtual linked list, a third timing node currently indicated by the timer interrupt instruction when the timer interrupt instruction is generated;
determining a BFD session corresponding to at least one timer loaded on the third timing node;
acquiring a received message upgrading identifier corresponding to each BFD session from a stored BFD session table item; if the corresponding BFD session is determined to be in a normal state through the received message upgrading identifier, the timer corresponding to the BFD session is loaded to a fourth timing node in the virtual linked list again according to the timeout duration agreed by the BFD session and the duration for generating the timing interrupt instruction;
and if the corresponding BFD session is determined to be in an abnormal state through the received message upgrading identifier, deleting the BFD session from the stored BFD session table item, and deleting the timer corresponding to the BFD session on the third timing node from the virtual linked list.
With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner, the to-be-scheduled timer determining module is specifically configured to:
if the number of the timers borne by the first timing node exceeds the scheduling threshold, acquiring the timeout duration of the BFD session corresponding to each timer borne by the first timing node and the attenuation count representing the scheduling probability of each BFD session;
according to the timeout of BFD session corresponding to each timer
With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner, the performing, according to the timeout duration of the BFD session corresponding to each timer and the attenuation count representing the scheduling probability of each BFD session, includes:
selecting a timer corresponding to the BFD session with the largest timeout duration from the BFD sessions with the smallest attenuation count as the timer to be scheduled;
or the like, or, alternatively,
selecting a timer corresponding to the BFD session with the minimum attenuation count from the BFD session with the maximum timeout duration as the timer to be scheduled;
after the timer to be scheduled is scheduled to the second timing node, the scheduling module is further specifically configured to:
updating the attenuation count of the BFD session corresponding to the timer to be scheduled to an initial value, and timing;
and when the time-out duration of the BFD session is timed, subtracting 1 from the attenuation count of the BFD session, and timing again until the attenuation count of the BFD session is 0.
With reference to the second aspect or the first possible implementation manner of the second aspect, in a fourth possible implementation manner, the scheduling module is specifically configured to:
if the timer to be scheduled is a receiving timer, determining a first interval from the interval of the timing nodes, wherein the first interval takes the previous timing node adjacent to the first timing node and the lower limit of the interval of the timing nodes as the boundary;
taking the timing node with the minimum load capacity of the bearing timer as the second timing node from the first interval;
or the like, or, alternatively,
if the timer to be scheduled is a sending timer, determining a second interval from the interval of the timing nodes, wherein the second interval takes the upper limit of the interval of the timing node and the next timing node adjacent to the first timing node as a boundary;
and taking the timing node with the minimum load of the bearing timer as the second timing node from the second interval.
In a third aspect, the present application provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, performs the steps of the above-mentioned method.
Compared with the prior art, the method has the following beneficial effects:
according to the timer scheduling method and device, network equipment determines a first timing node borne by a timer corresponding to each BFD session in a virtual chain table according to the established overtime duration agreed by each BFD session and the duration for generating a timed interrupt instruction; and if the number of the timers borne by the first timing node exceeds a preset scheduling threshold value, determining the timer to be scheduled which meets a preset scheduling strategy, and scheduling the timer to be scheduled to a second timing node with the minimum load of the borne timer.
Therefore, the timer which is borne by the first timing node in the virtual chain table and exceeds the scheduling threshold value is scheduled to other nodes, the number of the timers borne by the first timing node can be effectively reduced, so that the detection processing time delay of each BFD session state is ensured, the resource burst use required by the simultaneous triggering of each timer borne by the first timing node can be reduced, and the stability and the reliability of network equipment are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flowchart of a timer scheduling method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of sub-steps before step 101 shown in FIG. 1;
FIG. 3 is a flow diagram illustrating a sub-step of step 101 shown in FIG. 1;
FIG. 4 is a schematic flow chart illustrating sub-steps of step 102 shown in FIG. 1;
fig. 5 is a schematic structural diagram of a timer scheduling apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present application, it is further noted that, unless expressly stated or limited otherwise, the terms "disposed," "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
Example one
Fig. 1 is a flowchart illustrating a timer scheduling method according to an embodiment of the present application. The method is applied to network equipment, and the network equipment can be specifically a router, a switch and other equipment. The network device represents the set timed interrupt instruction through a virtual linked list structure, each timing node forming the virtual linked list carries at least one timer, each timer corresponds to a BFD session established by the network device one to one, and the time step between adjacent timing nodes is the time length for generating the timed interrupt instruction, as shown in fig. 1, the process includes:
step 101, determining a first timing node carried by a timer corresponding to each BFD session in the virtual linked list according to the established timeout duration agreed by each BFD session and the duration for generating the timed interrupt instruction;
in the embodiment of the present application, as an optional embodiment, the network device maintains the timers corresponding to the BFD sessions in a unified manner based on the shared virtual linked list, which can reduce resource overhead caused by maintaining the timers separately. The timer is used for triggering the network equipment to detect the BFD session state corresponding to the timer when the timeout duration is up.
102, if the number of timers borne by the first timing node exceeds a preset scheduling threshold, determining a timer to be scheduled which meets a preset scheduling strategy from the timers borne by the first timing node;
in the embodiment of the application, in order to avoid that the same timing node in the virtual chain table carries a large number of timers, so that at the same time, the large number of timers simultaneously trigger the BFD session state detection, thereby causing the situation that the network device vibrates due to the fact that the resource usage of the network device forms a sudden use, the number of the timers carried by the same timing node in the virtual chain table is limited.
In the embodiment of the application, after a first timing node borne by a timer corresponding to each BFD session is determined in the virtual linked list according to the timeout duration agreed by each established BFD session and the duration for generating the timer interrupt instruction, if the number of timers borne by the first timing node exceeds a scheduling threshold, one or more timers borne by the first timing node need to be scheduled to other nodes in the virtual linked list according to a preset scheduling policy, so as to reduce the load of the first timing node. And if the number of the timers borne by the first timing node does not exceed the scheduling threshold, waiting for the next BFD session to be detected.
Step 103, selecting a second timing node with the smallest load of the bearer timer in the timing node interval including the first timing node, and scheduling the timer to be scheduled to the second timing node. In the embodiment of the application, after the network device determines a first timing node borne by a timer corresponding to each BFD session in a virtual chain table, if the number of timers borne by the first timing node exceeds a preset scheduling threshold, a node to be scheduled meeting a preset scheduling policy is extracted, and the node to be scheduled is scheduled to a second timing node with the minimum load carrying capacity of the timer in a timing node interval containing the first timing node in the virtual chain table.
For example, the interval of the timing nodes including the first timing node is [ t-x, t + x ], where t represents that the first timing node is on the t-th timing node in the virtual chain table, and x represents the number of timing nodes in the virtual chain table from the first timing node.
Thus, through dynamic adjustment of a small range of the timer carried by the first timing node, a plurality of timers carried on the same first timing node are hashed to adjacent idle timing nodes. Therefore, the plurality of timers overtime at the same moment are gradually dispersed to different moments for processing, the number of the timers borne by the first timing node can be effectively reduced, the resource usage required by the simultaneous triggering of the timers borne by the first timing node is reduced, the sudden pressure on network equipment resources is reduced, the network equipment is prevented from vibrating, the probability of sudden use of the network equipment resources is reduced, and the stability of the network equipment is improved.
Meanwhile, the timer number borne by the first timing node is controlled, so that the detection processing time delay of each BFD session state can be guaranteed, the network equipment is prevented from being blocked, and the reliability of the network equipment is improved. And moreover, the plurality of timers borne by the same timing node are uniformly scheduled, the overtime duration fixed by the timers is changed into the active variable duration, and therefore the plurality of timers are relatively uniformly distributed on the time axis of the virtual linked list.
Example two
Fig. 2 is a schematic flow chart of sub-steps before step 101 shown in fig. 1. As shown in fig. 2, the process includes:
step 201, when the network device generates a timer interrupt instruction, determining a third timer node currently indicated by the timer interrupt instruction in the virtual linked list;
in the embodiment of the present application, as an optional embodiment, the timing interrupt instruction is generated by using a shared timer for each BFD session, which is set based on hardware, and the shared timer performs count timing based on the CPU master frequency or the bus frequency.
For example, if the shared timer is a clock timer with a CPU master frequency or a bus frequency of 1M, and a clock cycle corresponding to the clock timer is 1us, the shared timer increments a count value by 1 every 1 us. If the preconfigured count threshold is 1000, the duration (the product of the clock period and the count threshold) for generating the timer interrupt instruction is 1ms, that is, every 1ms, and the shared timer generates and outputs a timer interrupt instruction.
In the embodiment of the application, the period of the timer interrupt instruction generated by the shared timer is the same as the time step of the adjacent timing node in the virtual linked list. And uniformly controlling all timers borne by all timing nodes in the virtual linked list through a timing interrupt instruction.
In this embodiment, as an optional embodiment, when receiving a timer interrupt instruction, the network device determines, in the virtual linked list, a third timer node currently indicated by the timer interrupt instruction.
Step 202, determining a BFD session corresponding to at least one timer carried on the third timing node;
in the embodiment of the application, each timer corresponds to a BFD session.
Step 203, obtaining the received message upgrading identifier corresponding to each BFD session from the stored BFD session table entry; if the corresponding BFD session is determined to be in a normal state through the received message upgrading identifier, the timer corresponding to the BFD session is loaded to a fourth timing node in the virtual linked list again according to the timeout duration agreed by the BFD session and the duration for generating the timing interrupt instruction;
in the embodiment of the application, when the network device detects the BFD session state, a BFD session entry is set for each BFD session, and the BFD session entry is used to store the information such as the timeout duration agreed by the BFD session and the received message upgrade identifier.
In this embodiment, as an optional embodiment, the timeout duration includes: a receive timeout duration and a transmit timeout duration. The receiving timeout duration is used for determining the maximum detection time for the BFD session state from the opposite terminal network equipment to the network equipment to be abnormal. The sending timeout duration is used for determining a time interval for sending the BFD message to the opposite terminal network equipment.
In the embodiment of the present application, the timer includes, corresponding to the reception timeout duration and the transmission timeout duration: a receive timer and a transmit timer. The receiving timer corresponds to a receiving timeout duration, and the sending timer corresponds to a sending timeout duration.
In the embodiment of the application, if a BFD message sent by the opposite-end network device aiming at the BFD session is received within the receiving timeout duration, the network device updates the received message upgrading identifier stored in the BFD session table entry so as to represent that the BFD message sent by the opposite-end network device is received.
In the embodiment of the application, if the received message upgrading identifier corresponding to the obtained BFD session is in the updated state, the BFD session state indicated by the BFD session identifier is determined to be in the normal state. And after the BFD session state detection is determined to be normal, according to the timeout duration agreed by the BFD session and the duration for generating the timed interrupt instruction, the timer corresponding to the BFD session is loaded to the fourth timing node in the virtual linked list again. Namely, it is determined which timing node in the virtual linked list the timer corresponding to the BFD session is loaded on within the next timeout duration.
In this embodiment, as an optional embodiment, updating the received message upgrade flag may be implemented by setting the received message upgrade flag. For example, the upgrade flag of the received message is set to 1 from 0. As another alternative embodiment, if a plurality of BFD messages are received within the reception timeout period, the setting of the received message upgrade flag is maintained unchanged.
In this embodiment, as an optional embodiment, for the receiving timer, the update identifier of the received packet stored in the BFD session table entry in the local session table may be checked. If the upgrade identification of the received message is set and the message is in an update state, the message indicates that the BFD message is received and the BFD session receiving state is normal. And for the sending timer, if the BFD message is sent out, the sending state of the BFD session is normal.
In this embodiment, as an optional embodiment, after determining that the corresponding BFD session is in a normal state through the received packet upgrade identifier, the method further includes:
and resetting the message upgrading identification received by the BFD session table entry indicated by the BFD session identification.
Step 204, if the corresponding BFD session is determined to be in an abnormal state by the received message upgrade flag, deleting the BFD session from the stored BFD session entry, and deleting the timer corresponding to the BFD session on the third timing node from the virtual linked list.
In the embodiment of the application, if the received message upgrade identifier is in a non-update state, or the sending of the BFD message fails, the BFD session state is determined to be a failure state, the network device deletes the BFD session from the BFD session entry corresponding to the BFD session identifier, and deletes the timer (including the receiving timer and the sending timer) corresponding to the BFD session on the third timing node from the virtual chain table.
Fig. 3 is a schematic flow chart of the sub-steps of step 101 shown in fig. 1. Take the example that the network device has established a BFD session based on the BFD session. As shown in fig. 3, the process includes:
step 301, the network device calculates a ratio of the timeout duration to the time step to obtain a step number;
in the embodiment of the present application, as an optional embodiment, the timeout period takes a preset interrupt period as a unit step length, and the preset interrupt period is the same as a time step length in the virtual linked list. For example, for a BFD session of 10ms x 3, it is indicated that the timeout period is 10 and the duplicate detection threshold is 3. And the sending timeout duration is equal to the timeout duration, the receiving timeout duration is 3 times of timeout duration, namely that the BFD message is not received in the continuous 3 times of timeout duration, and the BFD session state is determined to be abnormal. If the preset interrupt period of the hardware (shared timer) is 1ms, the number of steps obtained by calculation is 10.
Step 302, the network device obtains the starting time of the current timing node in the virtual chain table, and judges whether the starting time is the same as the time of BFD session establishment;
in the embodiment of the application, the time when the BFD session is established is assumed to be time t, and the starting time of the current timing node in the virtual chain table is also time t, which indicates that the starting time is the same as the time when the BFD session is established. Assuming that the BFD session establishment time is time t, the starting time of the current timing node in the virtual linked list is time t + t0 or t-t0(t0 is greater than 0 and less than a preset interrupt period), which indicates that the starting time is different from the BFD session establishment time.
In the embodiment of the present application, as an optional embodiment, the start time of the virtual chain table is the same as the start time of the start counting timing of the shared timer.
Step 303, if the starting time is the same as the time of BFD session establishment, the network device moves the current timing node backward by the plurality of nodes of step length to obtain a first timing node bearing a timer corresponding to the BFD session, and sets a repeated detection threshold for a receiving timer in the borne timer;
in the embodiment of the application, if a timer interrupt instruction is received, a first timing node carried by a timer corresponding to a BFD session needs to be determined, the current timing node is directly moved backwards by the plurality of nodes with the step length, the first timing node carrying the timer corresponding to the BFD session can be obtained, and a repeated detection threshold is set for a receiving timer in the carried timer.
In this embodiment, as an optional embodiment, the virtual chain table includes: the first and second one-way linked lists are identical. Taking the first one-way linked list as an example, the time step of the adjacent timing node in the first one-way linked list is a preset interrupt period (the time length for generating the timed interrupt instruction), and the number of the timing nodes included in the first one-way linked list is determined by the maximum timeout time length and the time length for generating the timed interrupt instruction. For example, if the maximum timeout duration of the BFD session is 1000ms and the preset interrupt period of the hardware is 1ms, the first and second unidirectional links are unidirectional links containing 1000 timing nodes, respectively. Therefore, the resources for maintaining the virtual linked list can be effectively saved.
In the embodiment of the application, the virtual linked list can be connected end to end by a plurality of one-way linked lists, so that the plurality of one-way linked lists can be recycled. For example, as an optional embodiment, the step of moving back the current timing node by the plurality of nodes to obtain the first timing node bearing the timer corresponding to the BFD session includes:
a11, acquiring the number of timing nodes between the current timing node and the tail timing node in the first one-way linked list;
a12, judging whether the number of the timing nodes is larger than the number of the steps;
a13, if the number of the timing nodes is larger than or equal to the number of the steps, moving the current timing node backwards by the plurality of the steps to obtain a first timing node bearing a timer corresponding to the BFD session;
and A14, if the number of the timing nodes is less than the number of the steps, calculating the difference between the number of the steps and the number of the timing nodes, moving the current timing node back to the head timing node of the second one-way linked list, and moving the head timing node back to the different timing nodes to obtain a first timing node bearing a timer corresponding to the BFD session.
In the embodiment of the application, the timer moves to the tail timing node of the first one-way linked list. And if the next overtime exceeds the tail timing node of the first one-way linked list, bearing the corresponding timer on the second one-way linked list.
For example, in the 1 st ms, a timer with timeout duration of 10ms × 2 is loaded in the virtual linked list, the repeated detection threshold of the receiving timer in the timer is set to an initial value 1, the time step of the virtual linked list is 1ms, and the interrupt period is 1 ms. And when the first timeout duration is up, sending a BFD message, bearing the timer at the 11 th timing node of the first one-way linked list, and updating the repeated detection threshold setting of the receiving timer in the timer, which is borne by the 11 th timing node, to 0.
And when the second overtime length is up, sending a BFD message, bearing the timer to the 21 st timing node of the first one-way linked list under the condition that the upgrade identifier of the received message of the BFD session is determined to be in an updated state because the repeated detection threshold is 0, and updating the repeated detection threshold setting of the receiving timer in the timer, which is borne by the 21 st timing node, to be an initial value 1.… the flow of the air in the air conditioner,
when the 99 th timeout duration is up, sending a BFD message, bearing the timer at the 991 st timing node of the first one-way linked list, and updating the repeated detection threshold setting of the receiving timer in the timer, which is borne by the 991 st timing node, to 0.
When the 100 th overtime length is up, sending a BFD message, hanging a timer on the 1 st timing node of the second one-way linked list under the condition that the upgrade identifier of the received message of the BFD session is determined to be in an update state, and updating the repeated detection threshold setting of the receiving timer in the timer, which is borne by the 1 st timing node of the second one-way linked list, to be an initial value 1. And the process is circulated.
Step 304, if the starting time is different from the time of BFD session establishment, the network device calculates a sum of the step number plus 1, moves the current timing node back by the sum of the timing nodes to obtain a first timing node carrying a timer corresponding to the BFD session, and sets a repeated detection threshold for a receiving timer in the carried timer.
In the embodiment of the application, if the starting time is different from the BFD session establishing time, the next timing node of the current timing node is shifted backwards by a plurality of timing nodes with step length to obtain the first timing node.
In the embodiment of the application, because each BFD session shares the virtual linked list, timers corresponding to different BFD sessions may be carried by the same timing node in the virtual linked list. As an alternative embodiment, a BFD session identification is set for each BFD session, such that the BFD session, the timer, and the BFD session identification form a mapping relationship. And enabling a timing node in the virtual chain table to have a plurality of BFD session identifications so as to distinguish different BFD sessions represented by the same timing node in the virtual chain table.
In the embodiment of the application, under the condition that the starting time is different from the time of BFD session establishment, the delay error of receiving and sending BFD messages does not exceed a preset interrupt period at most. For example, if the preset interrupt period is 1ms, the delay error of the BFD message transmission and reception does not exceed 1 ms. If the preset interrupt period is set to 500us, the delay error of the BFD message receiving and sending is reduced to be not more than 500 us. By setting the preset interrupt period of the hardware, interrupts with different precisions can be realized, and the timing precision of each timer can be ensured.
For example, if the network device establishes a BFD session of 10ms × 1 in 1.2ms, the time of the BFD session establishment is between the starting time (1.0ms) of the current timing node and the starting time (2.0ms) of the next timing node, i.e., the aforementioned starting time is different from the time of the BFD session establishment. Then in making the timer determination, the preset interrupt period (time step) is 1ms, and the timer is carried on the 10 th timing node shifted backward with reference to the next timing node. The first timeout duration starts timing from the starting time (2.0ms) of the next timing node according to the next received timing interrupt instruction. Wherein, the first time timeout duration is actually 10.8ms (2+10-1.2), but not the set timeout duration is 10 ms. Namely, the phase delay error of the first BFD message receiving or sending is 0.8 ms. And after the first timeout duration, receiving or sending the BFD message according to the subsequent timeout duration, wherein the phase delay error is 0.
Example four
Fig. 4 is a flow chart illustrating a sub-step of step 102 shown in fig. 1. As shown in fig. 4, the process includes:
step 401, if the number of timers borne by the first timing node exceeds the scheduling threshold, acquiring the timeout duration of the BFD session corresponding to each timer borne by the first timing node and the attenuation count representing the scheduling probability of each BFD session;
in the embodiment of the application, an initial attenuation count is set for each BFD session, which is used to characterize the probability that the BFD session can participate in scheduling within the initial attenuation count timeout duration. As an optional embodiment, after the location of the BFD session in the virtual linked list is scheduled once, the location of the BFD session in the virtual linked list is not scheduled any more within the subsequent initial attenuation count timeout duration, and the stable state is maintained. Except that the decay count is decremented by 1 each time a timeout period elapses. In this way, scheduling of consecutive multiple timeout periods, resulting in accumulated error exceeding the timeout threshold, can be avoided.
Step 402, determining the timer to be scheduled according to the timeout duration of the BFD session corresponding to each timer and the attenuation count representing the scheduling probability of each BFD session.
In this embodiment, as an optional embodiment, the following is included, according to the timeout duration of the BFD session corresponding to each timer and the attenuation count representing the scheduling probability of each BFD session:
selecting a timer corresponding to the BFD session with the largest timeout duration from the BFD sessions with the smallest attenuation count as the timer to be scheduled;
or the like, or, alternatively,
selecting a timer corresponding to the BFD session with the minimum attenuation count from the BFD session with the maximum timeout duration as the node to be scheduled;
after the scheduling the timer to be scheduled to the second timing node, the method further includes:
updating the attenuation count of the BFD session corresponding to the timer to be scheduled to an initial value, and timing;
and when the time-out duration of the BFD session is timed, subtracting 1 from the attenuation count of the BFD session, and timing again until the attenuation count of the BFD session is 0.
In this embodiment of the present application, if there are a plurality of BFD sessions with the largest timeout duration, a timer corresponding to the BFD session with the smallest attenuation count may be selected from the plurality of BFD sessions as the node to be scheduled. If a plurality of timers corresponding to the BFD session with the minimum attenuation count are selected again, one of the timers can be selected as the node to be scheduled.
In the embodiment of the application, for each BFD session in a node which is not to be scheduled and is included in a first timing node, a repeated detection threshold of the BFD session is read, and if the repeated detection threshold is 0, a message receiving upgrade identifier of the BFD session is read again.
If the received message upgrading identifier is in an updating state and indicates that the BFD message sent by the opposite-end network equipment is received, determining the position (first timing node) of the BFD session in the virtual linked list again according to the timeout duration in the virtual linked list, subtracting 1 from the attenuation count of the BFD session, and sending the BFD message. After bearing the timer corresponding to the BFD session, initializing the repeated detection threshold of the BFD session and receiving the message upgrading identification.
If the received message upgrading identifier is in a non-updating state, indicating that the BFD messages sent by the opposite terminal network equipment are not received within the receiving overtime, determining that the BFD session state is a fault state, and informing an upper layer protocol. And deleting the BFD table entry corresponding to the BFD session, and deleting the timer corresponding to the BFD session in the virtual chain table.
EXAMPLE five
In this embodiment, as an optional embodiment, the selecting a second timing node with a minimum load carrying capacity of a timer in a timing node interval including the first timing node includes:
if the timer to be scheduled is a receiving timer, determining a first interval from the interval of the timing nodes, wherein the first interval takes the previous timing node adjacent to the first timing node and the lower limit of the interval of the timing nodes as the boundary;
taking the timing node with the minimum load capacity of the bearing timer as the second timing node from the first interval;
or the like, or, alternatively,
if the timer to be scheduled is a sending timer, determining a second interval from the interval of the timing nodes, wherein the second interval takes the upper limit of the interval of the timing node and the next timing node adjacent to the first timing node as a boundary;
and taking the timing node with the minimum load of the bearing timer as the second timing node from the second interval.
It can be understood that, when selecting the second timing node for the timer to be scheduled, if the timer to be scheduled is a sending timer and a receiving timer for the same BFD session, the second timing node needs to be selected for the sending timer and the receiving timer at the same time to ensure accurate detection of the BFD session.
In this embodiment, as an optional embodiment, the first interval is [ t-x, t-1], that is, an upper limit boundary of the first interval is the same as an upper limit boundary of the timing node interval, and a lower limit boundary is a previous timing node adjacent to the first timing node. The second interval is [ t +1, t + x ], that is, the upper limit boundary of the second interval is the next timing node adjacent to the first timing node, and the lower limit boundary is the same as the lower limit boundary of the timing node interval.
In this embodiment, as an optional embodiment, after the scheduling the timer to be scheduled to the second timing node, the method further includes:
and updating the attenuation count of the BFD session corresponding to the timer to be scheduled to an initial value.
EXAMPLE six
In this embodiment of the present application, if a certain BFD session a is present, a first timing node bearing a timer corresponding to the BFD session a is determined to be a timing node of the tth interrupt period in the virtual linked list according to the next timeout duration of the BFD session a. And the timing node already carries K timers. And K is a scheduling threshold value for triggering scheduling.
The network device loads the timer corresponding to the BFD session A on the tth timing node, and then carries out smooth scheduling processing aiming at all timers loaded on the tth timing node.
As an alternative embodiment, the network device selects the BFD session with the largest timeout duration and a decay count of 0. And if the selected BFD session is the BFD session B, abstracting a timer corresponding to the BFD session B from the tth timing node. If the timer corresponding to the BFD session B is the receiving timer, selecting the timing node with the least number of the bearing timers from the virtual linked list within the range of [ t +1, t + x ], marking as the timing node C, and bearing the timer corresponding to the BFD session B on the timing node C. Wherein x is a preset node number threshold value. If the timer corresponding to the BFD session B is the sending timer, selecting the timing node with the least number of the bearing timers from the virtual linked list within the range of [ t-x, t-1], marking the timing node as a timing node D, and bearing the timer corresponding to the BFD session B on the timing node D.
After a timer corresponding to the BFD session B is loaded to the timing node C or the timing node D, the attenuation count of the BFD session B is updated to an initial value, the attenuation count is reduced by 1 after a timeout duration passes, until the attenuation count is 0, and the attenuation count is maintained to be 0 before being scheduled. Updating the attenuation count of the BFD session corresponding to the timer to be scheduled to an initial value, and timing; and when the time-out duration of the BFD session is counted, subtracting 1 from the attenuation count of the BFD session, and counting again until the attenuation count of the BFD session is 0.
EXAMPLE seven
Fig. 5 is a schematic structural diagram of a timer scheduling apparatus according to an embodiment of the present application. As shown in fig. 5, a set timed interrupt instruction is represented by a virtual chain table structure, each timed node forming the virtual chain table carries at least one timer, each timer corresponds to a BFD session established by the network device one to one, and a time step between adjacent timed nodes is a time length for generating the timed interrupt instruction, the apparatus includes:
a bearer node determining module 501, configured to determine, according to the timeout duration agreed by each established BFD session and the duration for generating the timed interrupt instruction, a first timing node borne by a timer corresponding to each BFD session in the virtual linked list;
in the embodiment of the application, the network device maintains the timers corresponding to the BFD sessions in a unified manner based on the shared virtual linked list, so that the resource overhead caused by the maintenance of the timers respectively can be reduced. The timer is used for triggering detection of the BFD session state when the timeout duration is up.
A to-be-scheduled timer determining module 502, configured to determine, if the number of timers loaded by the first timing node exceeds a preset scheduling threshold, a to-be-scheduled timer that meets a preset scheduling policy from among the timers already loaded by the first timing node;
a scheduling module 503, configured to select a second timing node with a minimum load of a bearer timer in a timing node interval including the first timing node, and schedule the timer to be scheduled to the second timing node.
In this embodiment, as an optional embodiment, the apparatus further includes:
a BFD session state detection module (not shown in the figure) configured to, when a timer interrupt instruction is generated, determine, in the virtual linked list, a third timer node currently indicated by the timer interrupt instruction;
determining a BFD session corresponding to at least one timer loaded on the third timing node;
acquiring a received message upgrading identifier corresponding to each BFD session from a stored BFD session table item; if the corresponding BFD session is determined to be in a normal state through the received message upgrading identifier, the timer corresponding to the BFD session is loaded to a fourth timing node in the virtual linked list again according to the timeout duration agreed by the BFD session and the duration for generating the timing interrupt instruction;
and if the corresponding BFD session is determined to be in an abnormal state through the received message upgrading identifier, deleting the BFD session from the stored BFD session table item, and deleting the timer corresponding to the BFD session on the third timing node from the virtual linked list.
In the embodiment of the present application, as an optional embodiment, the timing interrupt instruction is generated by using a shared timer for each BFD session, which is set based on hardware, and the shared timer performs count timing based on the CPU master frequency or the bus frequency.
In the embodiment of the application, the period of the timer interrupt instruction generated by the shared timer is the same as the time step of the adjacent node in the virtual chain table.
In this embodiment, as another optional embodiment, the to-be-scheduled timer determining module 502 is specifically configured to:
if the number of the timers borne by the first timing node exceeds the scheduling threshold, acquiring the timeout duration of the BFD session corresponding to each timer borne by the first timing node and the attenuation count representing the scheduling probability of each BFD session;
and determining the timer to be scheduled according to the timeout duration of the BFD session corresponding to each timer and the attenuation count representing the scheduling probability of each BFD session.
In this embodiment, as an optional embodiment, the determining, in the virtual chain table, a first timing node carried by a timer corresponding to each BFD session according to the established timeout duration agreed by each BFD session and the duration for generating the timed interrupt instruction includes:
the network equipment calculates the ratio of the timeout duration to the time step length to obtain the step length number;
the network equipment acquires the starting time of the current timing node in the virtual linked list and judges whether the starting time is the same as the time of BFD session establishment;
if the starting time is the same as the time of BFD session establishment, the network equipment moves the current timing node backwards by the step length nodes to obtain a first timing node bearing a timer corresponding to the BFD session, and sets a repeated detection threshold for a receiving timer in the borne timer;
if the starting time is different from the time of BFD session establishment, the network equipment calculates the sum of the step number plus 1, moves the current timing node back by the sum nodes to obtain a first timing node bearing a timer corresponding to the BFD session, and sets a repeated detection threshold for a receiving timer in the borne timer.
In this embodiment, as an optional embodiment, the virtual chain table includes: the first and second one-way linked lists are identical. Taking the first one-way linked list as an example, the time step length of the adjacent timing nodes in the first one-way linked list is a preset interrupt period, and the number of the timing nodes contained in the first one-way linked list is determined by the maximum timeout duration.
In this embodiment, as an optional embodiment, the following is included, according to the timeout duration of the BFD session corresponding to each timer and the attenuation count representing the scheduling probability of each BFD session:
selecting a timer corresponding to the BFD session with the largest timeout duration from the BFD sessions with the smallest attenuation count as the timer to be scheduled;
or the like, or, alternatively,
selecting a timer corresponding to the BFD session with the minimum attenuation count from the BFD session with the maximum timeout duration as the timer to be scheduled;
after the scheduling the timer to be scheduled to the second timing node, the method further includes:
updating the attenuation count of the BFD session corresponding to the timer to be scheduled to an initial value, and timing;
and when the time-out duration of the BFD session is timed, subtracting 1 from the attenuation count of the BFD session, and timing again until the attenuation count of the BFD session is 0.
In this embodiment, as another optional embodiment, the scheduling module 503 is specifically configured to:
if the timer to be scheduled is a receiving timer, determining a first interval from the interval of the timing nodes, wherein the first interval takes the previous timing node adjacent to the first timing node and the lower limit of the interval of the timing nodes as the boundary;
taking the timing node with the minimum load capacity of the bearing timer as the second timing node from the first interval;
or the like, or, alternatively,
if the timer to be scheduled is a sending timer, determining a second interval from the interval of the timing nodes, wherein the second interval takes the upper limit of the interval of the timing node and the next timing node adjacent to the first timing node as a boundary;
and taking the timing node with the minimum load of the bearing timer as the second timing node from the second interval.
Example eight
Fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 6, an embodiment of the present application provides a computer device for executing the timer scheduling method in fig. 1 to 4. The apparatus comprises a memory 1000, a processor 2000 and a computer program stored on the memory 1000 and executable on the processor 2000. The processor 2000 implements the steps of the timer scheduling method when executing the computer program.
Specifically, the memory 1000 and the processor 2000 can be general-purpose memories and processors, and are not particularly limited thereto. When the processor 2000 runs the computer program stored in the memory 2000, the timer scheduling method can be executed, so that the problem that reliability and stability of the network device are low due to detection of a large number of BFD session states triggered by a large number of timers at the same time in the prior art is solved, according to the established timeout duration agreed by each BFD session and the duration for generating a timed interrupt instruction, the network device in the embodiment of the present application determines a first timing node carried by the timer corresponding to each BFD session in a virtual chain table; if the number of timers borne by the first timing node exceeds a preset scheduling threshold value, the timer to be scheduled meeting a preset scheduling strategy is determined, the timer to be scheduled is scheduled to the second timing node with the minimum load capacity of the bearing timer, the number of the timers borne by the first timing node in the virtual chain table can be effectively reduced, so that the detection processing time delay of each BFD session state is ensured, the burst use of resources required by the simultaneous triggering of the timers borne by the first timing node can be reduced, and the stability and reliability of network equipment are improved.
Corresponding to the timer scheduling method in fig. 1 to 4, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program performs the steps of the timer scheduling method.
Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, and the like, and when a computer program on the storage medium is run, the timer scheduling method can be executed, so that the problem that reliability and stability of network equipment are low due to detection of a large number of BFD session states triggered by a large number of timers at the same time in the prior art is solved; if the number of timers borne by the first timing node exceeds a preset scheduling threshold value, the timer to be scheduled meeting a preset scheduling strategy is determined, the timer to be scheduled is scheduled to the second timing node with the minimum load capacity of the bearing timer, the number of the timers borne by the first timing node in the virtual chain table can be effectively reduced, so that the detection processing time delay of each BFD session state is ensured, the burst use of resources required by the simultaneous triggering of the timers borne by the first timing node can be reduced, and the stability and reliability of network equipment are improved.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A timer scheduling method is applied to network equipment, the network equipment represents a set timed interrupt instruction through a virtual chain table structure, each timing node forming the virtual chain table bears at least one timer, each timer is in one-to-one correspondence with a BFD session established by the network equipment, and the time step between adjacent timing nodes is the time length for generating the timed interrupt instruction, the method comprises the following steps:
determining a first timing node borne by a timer corresponding to each BFD session in the virtual linked list according to the established overtime length agreed by each BFD session and the time length for generating the timed interrupt instruction;
if the number of the timers borne by the first timing node exceeds a preset scheduling threshold, determining the timers to be scheduled which meet a preset scheduling strategy from the timers borne by the first timing node;
and selecting a second timing node with the minimum load of a bearer timer in a timing node interval containing the first timing node, and scheduling the timer to be scheduled to the second timing node.
2. The method according to claim 1, wherein before determining, in the virtual linked list, a first timing node carried by a timer corresponding to each BFD session according to the established timeout duration agreed by each BFD session and the duration of generating the timer interrupt instruction, the method further comprises:
when the network equipment generates a timed interrupt instruction, determining a third timed node currently indicated by the timed interrupt instruction in the virtual linked list;
determining a BFD session corresponding to at least one timer loaded on the third timing node;
acquiring a received message upgrading identifier corresponding to each BFD session from a stored BFD session table item; if the corresponding BFD session is determined to be in a normal state through the received message upgrading identifier, the timer corresponding to the BFD session is loaded to a fourth timing node in the virtual linked list again according to the timeout duration agreed by the BFD session and the duration for generating the timing interrupt instruction;
and if the corresponding BFD session is determined to be in an abnormal state through the received message upgrading identifier, deleting the BFD session from the stored BFD session table item, and deleting the timer corresponding to the BFD session on the third timing node from the virtual linked list.
3. The method according to claim 1 or 2, wherein if the number of timers carried by the first timing node exceeds a preset scheduling threshold, determining a timer to be scheduled that meets a preset scheduling policy from among the timers carried by the first timing node comprises:
if the number of the timers borne by the first timing node exceeds the scheduling threshold, acquiring the timeout duration of the BFD session corresponding to each timer borne by the first timing node and the attenuation count representing the scheduling probability of each BFD session;
and determining the timer to be scheduled according to the timeout duration of the BFD session corresponding to each timer and the attenuation count representing the scheduling probability of each BFD session.
4. The method according to claim 3, wherein the step of determining the timeout duration of the BFD session corresponding to each timer and the decay count characterizing the scheduling probability of each BFD session comprises:
selecting a timer corresponding to the BFD session with the largest timeout duration from the BFD sessions with the smallest attenuation count as the timer to be scheduled;
or the like, or, alternatively,
selecting a timer corresponding to the BFD session with the minimum attenuation count from the BFD session with the maximum timeout duration as the timer to be scheduled;
after the scheduling the timer to be scheduled to the second timing node, the method further includes:
updating the attenuation count of the BFD session corresponding to the timer to be scheduled to an initial value, and timing;
and when the time-out duration of the BFD session is timed, subtracting 1 from the attenuation count of the BFD session, and timing again until the attenuation count of the BFD session is 0.
5. The method according to claim 1 or 2, wherein said selecting a second timing node with a smallest load carrying a timer in a timing node interval including the first timing node comprises:
if the timer to be scheduled is a receiving timer, determining a first interval from the interval of the timing nodes, wherein the first interval takes the previous timing node adjacent to the first timing node and the lower limit of the interval of the timing nodes as the boundary;
taking the timing node with the minimum load capacity of the bearing timer as the second timing node from the first interval;
or the like, or, alternatively,
if the timer to be scheduled is a sending timer, determining a second interval from the interval of the timing nodes, wherein the second interval takes the upper limit of the interval of the timing node and the next timing node adjacent to the first timing node as a boundary;
and taking the timing node with the minimum load of the bearing timer as the second timing node from the second interval.
6. A timer scheduling device is characterized in that a set timed interrupt instruction is represented through a virtual chain table structure, each timing node forming the virtual chain table bears at least one timer, each timer is in one-to-one correspondence with BFD sessions established by network equipment maintaining the timers corresponding to the BFD sessions based on the virtual chain table, and the time step length between adjacent timing nodes is the time length for generating the timed interrupt instruction, and the device comprises:
a carrier node determining module, configured to determine, in the virtual linked list, a first timing node carried by a timer corresponding to each BFD session according to an established timeout duration agreed by each BFD session and a duration for generating the timed interrupt instruction;
a to-be-scheduled timer determining module, configured to determine a to-be-scheduled timer that meets a preset scheduling policy from the timers already carried by the first timing node if the number of timers carried by the first timing node exceeds a preset scheduling threshold;
and the scheduling module is used for selecting a second timing node with the minimum load capacity for bearing a timer in a timing node interval containing the first timing node and scheduling the timer to be scheduled to the second timing node.
7. The apparatus of claim 6, further comprising:
a BFD session state detection module, configured to determine, in the virtual linked list, a third timing node currently indicated by the timer interrupt instruction when the timer interrupt instruction is generated;
determining a BFD session corresponding to at least one timer loaded on the third timing node;
acquiring a received message upgrading identifier corresponding to each BFD session from a stored BFD session table item;
if the corresponding BFD session is determined to be in a normal state through the received message upgrading identifier, the timer corresponding to the BFD session is loaded to a fourth timing node in the virtual linked list again according to the timeout duration agreed by the BFD session and the duration for generating the timing interrupt instruction;
and if the corresponding BFD session is determined to be in an abnormal state through the received message upgrading identifier, deleting the BFD session from the stored BFD session table item, and deleting the timer corresponding to the BFD session on the third timing node from the virtual linked list.
8. The apparatus according to claim 6 or 7, wherein the to-be-scheduled timer determining module is specifically configured to:
if the number of the timers borne by the first timing node exceeds the scheduling threshold, acquiring the timeout duration of the BFD session corresponding to each timer borne by the first timing node and the attenuation count representing the scheduling probability of each BFD session;
and determining the timer to be scheduled according to the timeout duration of the BFD session corresponding to each timer and the attenuation count representing the scheduling probability of each BFD session.
9. The apparatus of claim 8, wherein the determining, according to the timeout duration of the BFD session corresponding to each timer and the decay count characterizing the scheduling probability of each BFD session, comprises:
selecting a timer corresponding to the BFD session with the largest timeout duration from the BFD sessions with the smallest attenuation count as the timer to be scheduled;
or the like, or, alternatively,
selecting a timer corresponding to the BFD session with the minimum attenuation count from the BFD session with the maximum timeout duration as the timer to be scheduled;
after the timer to be scheduled is scheduled to the second timing node, the scheduling module is further specifically configured to:
updating the attenuation count of the BFD session corresponding to the timer to be scheduled to an initial value, and timing;
and when the time-out duration of the BFD session is timed, subtracting 1 from the attenuation count of the BFD session, and timing again until the attenuation count of the BFD session is 0.
10. The apparatus according to claim 6 or 7, wherein the scheduling module is specifically configured to:
if the timer to be scheduled is a receiving timer, determining a first interval from the interval of the timing nodes, wherein the first interval takes the previous timing node adjacent to the first timing node and the lower limit of the interval of the timing nodes as the boundary;
taking the timing node with the minimum load capacity of the bearing timer as the second timing node from the first interval;
or the like, or, alternatively,
if the timer to be scheduled is a sending timer, determining a second interval from the interval of the timing nodes, wherein the second interval takes the upper limit of the interval of the timing node and the next timing node adjacent to the first timing node as a boundary;
and taking the timing node with the minimum load of the bearing timer as the second timing node from the second interval.
CN201810892114.XA 2018-08-07 2018-08-07 Timer scheduling method and device Active CN109274546B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810892114.XA CN109274546B (en) 2018-08-07 2018-08-07 Timer scheduling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810892114.XA CN109274546B (en) 2018-08-07 2018-08-07 Timer scheduling method and device

Publications (2)

Publication Number Publication Date
CN109274546A CN109274546A (en) 2019-01-25
CN109274546B true CN109274546B (en) 2020-08-14

Family

ID=65153460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810892114.XA Active CN109274546B (en) 2018-08-07 2018-08-07 Timer scheduling method and device

Country Status (1)

Country Link
CN (1) CN109274546B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111565132B (en) * 2020-04-24 2021-11-30 烽火通信科技股份有限公司 Overtime detection method and system for bidirectional forwarding detection message
CN115934000B (en) * 2023-03-07 2023-06-09 苏州浪潮智能科技有限公司 Timing method and related device of storage system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101170450B (en) * 2007-11-30 2010-07-07 华为技术有限公司 Virtual private network failure processing method and network provider boundary routing device
CN101237452B (en) * 2008-02-20 2012-04-18 杭州华三通信技术有限公司 Transmission method, system and device for bidirectional forward detection report

Also Published As

Publication number Publication date
CN109274546A (en) 2019-01-25

Similar Documents

Publication Publication Date Title
CN109039746B (en) Method for detecting bidirectional forwarding path and detecting session state and processor
JP7171940B2 (en) Method of clock drift handling, network function network element, network device and computer program
US11706149B2 (en) Packet sending method, network node, and system
US9270527B2 (en) Methods, systems, and computer readable media for enabling real-time guarantees in publish-subscribe middleware using dynamically reconfigurable networks
US10623313B2 (en) Path computation method, message responding method, and related device
US7953845B2 (en) Network-specific estimation in network node discovery
CN109274546B (en) Timer scheduling method and device
CN107547442B (en) Data transmission buffer queue distribution method and device
Tardioli et al. Real time communications over 802.11: RT-WMP
CN102055644A (en) Method, device and system for load management in distributed directory service system
CN105516658B (en) A kind of monitoring device control method and device
CN113179172B (en) Method, device and system for training fault detection model
CN116320011A (en) Request processing method and device
CN109379283B (en) Ad hoc network communication method and device based on heterogeneous equipment of Internet of things and ad hoc network
EP3094054B1 (en) Method and controller for notifying bandwidth of cluster system
CN114945006B (en) Determining rate differential weighted fair output queue scheduling for network devices
CN110336728B (en) Message processing method, node equipment, electronic equipment and readable storage medium
CN109936502B (en) Data receiving method and data transmission equipment
US20240214325A1 (en) Dynamic resource reservation protocol resource handling and deadlock avoidance
Goudar et al. A modified balls-into-bins model for expected buffer occupancy in mobile opportunistic networks
CN114221896B (en) BGP route oscillation suppression method and device
WO2024060601A1 (en) Message sending method and apparatus, and storage medium and electronic apparatus
CN115296839A (en) Mimic routing method, device and storage medium based on BGP-LS arbitration
CN114363956A (en) Downlink message congestion control method, system, device and storage medium
Yang An approach to modeling performance evaluation on the ethernet with QoS parameters

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant