CN115002020B - OSPF-based data processing method and device - Google Patents

OSPF-based data processing method and device Download PDF

Info

Publication number
CN115002020B
CN115002020B CN202110205324.9A CN202110205324A CN115002020B CN 115002020 B CN115002020 B CN 115002020B CN 202110205324 A CN202110205324 A CN 202110205324A CN 115002020 B CN115002020 B CN 115002020B
Authority
CN
China
Prior art keywords
ospf
neighbor
state information
link state
receiving
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
CN202110205324.9A
Other languages
Chinese (zh)
Other versions
CN115002020A (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.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp 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 China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202110205324.9A priority Critical patent/CN115002020B/en
Publication of CN115002020A publication Critical patent/CN115002020A/en
Application granted granted Critical
Publication of CN115002020B publication Critical patent/CN115002020B/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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Hardware Redundancy (AREA)

Abstract

The disclosure relates to an OSPF-based data processing method and device and a computer storage medium, and relates to the technical field of communication. The OSPF-based data processing method comprises the following steps: in response to detecting that the CPU occupancy of a central processing unit of an OSPF process in an OSPF device is greater than a preset threshold, creating a plurality of first threads for a plurality of neighbor devices adjacent to the OSPF device; and switching the execution of the receiving processing operation in the synchronization process of the OSPF device and the link state information in the neighbor devices from the original receiving processing thread in the OSPF process to the execution of the first threads. According to the method and the device, the speed of synchronizing the link state information can be improved, the synchronous operation of the link state information can be completed in time, and the normal convergence of the route of the autonomous system is ensured.

Description

OSPF-based data processing method and device
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to an OSPF-based data processing method and apparatus, and a computer readable medium.
Background
In the related art, a single reception processing thread in an OSPF (Open Shortest Path First ) process is utilized to perform a reception processing operation in a synchronization process of link state information in an OSPF device and its neighbor devices. The receiving processing operation in the synchronization process is to receive and process the message related to the synchronization process sent by the neighbor device to the OSPF device.
Disclosure of Invention
In the related art, under the condition that an OSPF device is adjacent to a plurality of neighbor devices, a single receiving processing thread in the OSPF process needs to receive and process a large number of update messages including link state information and other messages related to synchronization from the neighbor devices when the link state information is changed, so that the synchronization speed of the link state information is slow, and the synchronization operation of the link state information cannot be completed in time, so that the normal convergence of the route of an autonomous system cannot be ensured.
Aiming at the technical problems, the present disclosure provides a solution, which can improve the speed of synchronizing link state information, complete the synchronization operation of the link state information in time, and ensure the normal convergence of the route of the autonomous system.
According to a first aspect of the present disclosure, there is provided a data processing method based on open shortest path first OSPF, including: in response to detecting that the CPU occupancy of a central processing unit of an OSPF process in an OSPF device is greater than a preset threshold, creating a plurality of first threads for a plurality of neighbor devices adjacent to the OSPF device; and switching the execution of the receiving processing operation in the synchronization process of the OSPF device and the link state information in the neighbor devices from the original receiving processing thread in the OSPF process to the execution of the first threads.
In some embodiments, the OSPF-based data processing method further comprises: in response to detecting that the CPU occupancy of an OSPF process in the OSPF device is greater than the preset threshold and the keep-alive time at the current time is less than the difference between the expiration time and an interval time, for at least one neighbor device that did not send a keep-alive message to the OSPF device at the current time or that did not send a keep-alive message to the OSPF device but did not process the keep-alive message, creating at least one second thread, wherein each neighbor device corresponds to one second thread, the expiration time is the longest time that the OSPF device breaks a link with a neighbor device due to not receiving or having received but not processed a keep-alive message from a neighbor device, the keep-alive time is the remaining time that the OSPF device is fully contiguous with a neighbor device, and the interval time is a preset time interval that the OSPF device receives and processes a keep-alive message from a neighbor device; the operation of receiving and processing keep-alive messages from the at least one neighbor device is switched from execution by the original receiving processing thread to execution by the at least one second thread.
In some embodiments, the OSPF-based data processing method further comprises: judging whether the receiving processing operation in the synchronization process of the link state information in the OSPF device and the neighbor devices is finished or not by utilizing a trigger; terminating the plurality of first threads and the at least one second thread if a reception processing operation in synchronization of link state information in the OSPF device and the plurality of neighbor devices ends; and calling the original receiving processing thread to execute the receiving processing operation and the operation of receiving and processing the keep-alive message from the at least one neighbor device in the synchronization process of the link state information in the OSPF device and the neighbor devices.
In some embodiments, determining, with a trigger, whether a receive processing operation in synchronization of the OSPF device with link state information in the plurality of neighbor devices is complete comprises: and judging whether the link state information update list of the OSPF device is empty or not by utilizing a trigger, wherein when the link state information update list of the OSPF device is empty, the receiving processing operation in the synchronization process of the link state information of the OSPF device and the neighbor devices is finished, and the link state information update list of the OSPF device comprises link state information which exists in each neighbor device but does not exist in the OSPF device.
In some embodiments, the plurality of first threads and the at least one second thread are created in the OSPF process.
In some embodiments, the OSPF-based data processing method further comprises: and under the condition that the CPU occupancy rate of the OSPF process in the OSPF device is detected to be larger than a preset threshold value, periodically detecting whether the keep-alive time is smaller than the difference value between the failure time and the interval time.
In some embodiments, each of the neighboring devices corresponds to a first thread, and switching the receiving processing operation in the synchronization process of the OSPF device and the link state information in the neighboring devices from the original receiving processing thread in the OSPF process to the first thread comprises calling the first thread corresponding to each of the neighboring devices to perform the following operations: receiving and processing a synchronization request queue from each neighbor device, the synchronization request queue of each neighbor device including a synchronization request for link state information that exists in the OSPF device but does not exist in the neighbor device; receiving and processing an acknowledgement message from each neighbor device, wherein the acknowledgement message characterizes that each neighbor device has received an update message of a synchronous request queue for each neighbor device; and receiving and processing an update message generated by each neighbor device for a synchronization request queue of the OSPF device, wherein the synchronization request queue of the OSPF device for each neighbor device comprises a synchronization request for link state information existing in each neighbor device but not in the OSPF device.
In some embodiments, the OSPF-based data processing method further comprises: periodically acquiring the CPU occupancy rate of an OSPF process in the OSPF device; and detecting whether the CPU occupancy rate of the OSPF process is larger than the preset threshold value.
In some embodiments, the OSPF-based data processing method is performed by the OSPF device.
According to a second aspect of the present disclosure, there is provided an open shortest path first, OSPF, based data processing apparatus, comprising: a creating module configured to create a plurality of first threads for a plurality of neighbor devices adjacent to an OSPF device in response to detecting that a central processor CPU occupancy of an OSPF process in the OSPF device is greater than a preset threshold; and the switching module is configured to switch the execution of the receiving processing operation in the synchronization process of the OSPF device and the link state information in the neighbor devices from the execution of the original receiving processing thread in the OSPF process to the execution of the first threads.
According to a third aspect of the present disclosure, there is provided an open shortest path first, OSPF, based data processing apparatus, comprising: a memory; and a processor coupled to the memory, the processor configured to perform the open shortest path first, OSPF, based data processing method of any of the embodiments described above based on instructions stored in the memory.
According to a fourth aspect of the present disclosure, there is provided a computer-readable medium having stored thereon computer program instructions which, when executed by a processor, implement the open shortest path first, OSPF, based data processing method of any of the embodiments described above.
In the embodiment, the speed of synchronizing the link state information can be improved, the synchronization operation of the link state information can be completed in time, and the normal convergence of the route of the autonomous system is ensured.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The disclosure may be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flow chart illustrating an OSPF-based data processing method according to some embodiments of the present disclosure;
FIG. 2A is a flow chart illustrating an OSPF-based data processing method according to further embodiments of the present disclosure;
fig. 2B is a flow chart illustrating an OSPF-based data processing method according to still further embodiments of the present disclosure.
FIG. 3 is a block diagram illustrating an OSPF-based data processing apparatus according to some embodiments of the present disclosure;
FIG. 4 is a block diagram illustrating an OSPF-based data processing apparatus according to further embodiments of the present disclosure;
FIG. 5 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless it is specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
Fig. 1 is a flow chart illustrating an OSPF-based data processing method according to some embodiments of the present disclosure. For example, the OSPF-based data processing method is performed by an OSPF device.
As shown in fig. 1, the OSPF-based data processing method includes steps S110 to S120.
In step S110, in response to detecting that the CPU (Central Processing Unit ) occupancy of an OSPF process in the OSPF device is greater than a preset threshold, a plurality of first threads are created for a plurality of neighbor devices that are adjacent to the OSPF device. For example, the preset threshold is 5%.
In some embodiments, a plurality of first threads are created in an OSPF process. For example, each neighbor device corresponds to a first thread. The plurality of first threads are multithreaded in receiving and processing synchronization request queues, update messages, and acknowledgement messages from the neighbor devices. For example, the synchronization request queue is LSR (Link State Request Packet ). The update message is an LSU (Link State Update Packet ). The acknowledgement message is a LSAck (Link State Acknowledgment Packet, link state acknowledgement packet).
In some embodiments, the OSPF-based data processing method further comprises: before step S110, the CPU occupancy of the OSPF process in the OSPF device is periodically acquired, and whether the CPU occupancy of the OSPF process is greater than a preset threshold is monitored.
In step S120, the receiving processing operation in the synchronization process of the OSPF device and the link state information in the plurality of neighbor devices is switched from the execution of the original receiving processing thread in the OSPF process to the execution of the first threads.
The receiving and processing operation in the synchronization process of the link state information in the OSPF device and the plurality of neighbor devices is to receive and process a synchronization request queue from each neighbor device, receive and process an acknowledgement message from each neighbor device, and receive and process an update message generated by each neighbor device for the synchronization request queue of the OSPF device. The synchronization request queue of each neighbor device includes synchronization requests for link state information that exists in the OSPF device but does not exist in the neighbor device. The acknowledgement message characterizes each neighbor device as having received an update message for the synchronization request queue of each neighbor device. The synchronization request queue for each neighbor device for the OSPF device includes synchronization requests for link state information that exists in each neighbor device but does not exist in the OSPF device. The process here is an analysis process.
The link state database in the OSPF device and the link state databases in the neighbor devices can be updated by using the first threads to execute the receiving processing operation in the synchronization process and combining the original sending threads in the OSPF process to execute the sending processing operation in the synchronization process, so as to keep the link state information in the link state databases in the OSPF device and the neighbor devices consistent.
The original receiving processing thread and the original sending thread in the OSPF process are single threads. The original reception processing thread has a function of receiving and processing not only an OSPF packet such as LSR, LSU, LSAck for synchronizing link state information but also an OSPF packet such as HELLO packet for keeping alive (maintaining an adjacency) and DD (Database Description Packet ) for establishing an adjacency. The original transmission thread has a function of transmitting not only an OSPF packet such as LSR, LSU, LSAck for synchronizing link state information but also an OSPF packet such as HELLO packet for keeping alive and DD for establishing an adjacency.
In some embodiments, in the case that each neighboring device corresponds to one first thread, the switching of the receiving processing operation in the synchronization process of the OSPF device and the link state information in the plurality of neighboring devices from the execution of the original receiving processing thread in the OSPF process to the execution of the plurality of first threads may be achieved in the following manner.
Invoking a first thread corresponding to each neighbor device to perform the following: and receiving and processing the synchronous request queue from the neighbor device, receiving and processing the confirmation message from the neighbor device, and receiving and processing the update message generated by the neighbor device for the synchronous request queue of the OSPF device.
In other embodiments, where the neighboring devices do not have a one-to-one correspondence with the first threads, switching the receive processing operation in the synchronization process of the OSPF device with the link state information in the plurality of neighboring devices from execution by the original receive processing thread in the OSPF process to execution by the plurality of first threads may be accomplished in the following manner.
According to the corresponding relation between the preset first threads and the neighbor equipment, each first thread is called to execute the following operations: receiving and processing a synchronization request queue from a neighbor device corresponding to the first thread, receiving and processing an acknowledgement message from the neighbor device corresponding to the first thread, and receiving and processing an update message generated by the neighbor device corresponding to the first thread for the synchronization request queue of the OSPF device. In the above embodiment, the synchronization request queue of each neighbor device includes synchronization requests for link state information that exists in the OSPF device but does not exist in the neighbor device. The acknowledgement message for each neighbor characterizes each neighbor as having received an update message for the synchronization request queue for each neighbor. The synchronization request queue for each neighbor device of the OSPF device includes synchronization requests for link state information that exists in the neighbor device but does not exist in the OSPF device.
For example, link state information A, B, C is included in the OSPF device and link state information A, E, F is included in a neighbor device. The synchronization request queue of the neighbor device includes two synchronization requests for link state information B and C. The synchronization request queue of the OSPF device includes two synchronization requests for link state information E and F. Here, only one example, in a real scenario, there may be a large number of synchronization requests.
In the above embodiment, when it is detected that the CPU occupancy rate of the OSPF process in the OSPF device is greater than the preset threshold, a large number of receiving processing operations in the synchronization process are performed by creating a plurality of first threads and using a plurality of threads instead of a single thread in the OSPF process, so that the speed of synchronizing link state information can be increased and the synchronization operation of the link state information can be completed in time under the condition that it is precisely detected that the OSPF device performs a large number of synchronization operations, thereby ensuring that the routing of the autonomous system is normally converged.
Fig. 2A is a flowchart illustrating an OSPF-based data processing method according to further embodiments of the present disclosure. Fig. 2A differs from fig. 1 in that fig. 2A illustrates steps S130-S140 of the OSPF-based data processing method of other embodiments. Only the differences between fig. 2A and fig. 1 will be described below, and the same points will not be described again. For example, the OSPF-based data processing method is performed by an OSPF device.
In step S130, in response to detecting that the CPU occupancy of the OSPF process in the OSPF device is greater than the preset threshold and the keep-alive time at the current time is less than the difference between the expiration time and the interval time, at least one second thread is created for at least one neighbor device that has not sent a keep-alive message to the OSPF device at the current time or that has sent a keep-alive message to the OSPF device but that has not processed the keep-alive message by the OSPF device. Each neighbor device corresponds to a second thread. Each second thread is configured to receive and process keep-alive messages from a neighboring device corresponding to the second thread. The second thread may also be referred to as a HELLO standby thread. For example, the at least one second thread is created in an OSPF process.
In some embodiments, the OSPF-based data processing method further comprises: before step S130, in a case where it is detected that the CPU occupancy of the OSPF process in the OSPF device is greater than a preset threshold, it is periodically detected whether the keep-alive time is smaller than the difference between the failure time and the interval time.
The expiration time is the longest time that an OSPF device breaks a link with a neighbor device due to either not receiving or having received but not processing keep-alive messages from the neighbor device. I.e., the expiration time is the maximum duration between the time that the OSPF device receives and processes a keep-alive message from a neighboring device at one time and the time that the OSPF device receives and processes a keep-alive message from a neighboring device at the next time. For example, a failure time of 40 seconds indicates that if the OSPF device has not received or received but has not processed keep-alive messages from a neighbor device for 40 seconds, the OSPF device breaks the link with the neighbor device. After the OSPF device breaks the link with the neighbor device, it will no longer have an adjacency with the neighbor device.
The keep-alive time at the current time is the remaining time that the OSPF device is fully adjacent to the neighbor device. For example, between a certain time when the OSPF device receives and processes the keep-alive message from the neighbor device to the current time when the OSPF device does not receive or has received but does not process the keep-alive message from the neighbor device, the keep-alive time at the current time is the dead time- (current time-previous time), and the current time is later than the certain time. For another example, at the current time, the OSPF device just received and processed the keep-alive message from the neighbor device, and the keep-alive time at the current time is the dead time. In some embodiments, a keep-alive timer may be used to record the keep-alive time. The initial value of the keep-alive timer is the same as the failure time, and is restored to the initial value immediately each time the OSPF device receives and processes a keep-alive message from a neighbor device.
Taking the example of a failure time of 40 seconds, the OSPF device receives and processes a keep-alive message from a neighboring device at a first time when the keep-alive time is 40 seconds. The current time is 11 seconds later than the first time, and the keep-alive time at the current time is 29 seconds. The keep-alive time is 29 seconds to indicate that the OSPF device should receive and process keep-alive messages from the neighbor devices within the remaining 29 seconds. If the OSPF device still does not receive or has received but does not process keep-alive messages from the neighbor device for the remaining 29 seconds, the OSPF device breaks the link with the neighbor device and the OSPF device is no longer fully contiguous with the neighbor device.
The interval time is a preset time interval for the OSPF device to receive and process keep-alive messages from the neighbor devices. The interval time is the time interval of the HELLO packet or HELLO message. For example, the interval is 10 seconds.
Taking the keep-alive time at the current moment as 29 seconds, the failure time as 40 seconds and the interval time as 10 seconds as an example, the difference between the failure time and the interval time is 30 seconds. The keep-alive time is smaller than the chance that the difference value characterizes that the OSPF device has missed one time to receive and process the keep-alive message from the neighbor device, i.e. the original receiving processing thread of the OSPF device is processing other OSPF packets and cannot timely receive and process the keep-alive message from the neighbor device.
In step S140, the operation of receiving and processing keep-alive messages from at least one neighbor device is switched from being performed by the original receiving processing thread to being performed by at least one second thread. In some embodiments, each second thread is invoked to receive and process keep-alive messages from its corresponding neighbor device. For example, the keep-alive message is a HELLO packet. HELLO packets are also called HELLO messages.
In the above embodiment, the steps S130 to S140 may be performed independently of the steps S110 to S120, or may be performed together with the steps S110 to S120. In addition, the steps S130 to S140 may be performed before the step S110 or after the step S120.
In the above embodiment, when it is detected that the CPU occupancy of the OSPF process in the OSPF device is greater than the preset threshold, the OSPF device performs a large number of synchronization operations, and by creating a second thread for each neighboring device that has sent a keep-alive message to the OSPF device or has sent a keep-alive message to the OSPF device but has not processed the keep-alive message, and performing the operation of receiving and processing the keep-alive message by using the newly created second thread instead of a single thread in the OSPF process, the stability of the adjacency between the OSPF device and the neighboring device can be improved, so that the normal convergence of the route of the autonomous system is further ensured, and the route oscillation is avoided.
Fig. 2B is a flow chart illustrating an OSPF-based data processing method according to still further embodiments of the present disclosure. Fig. 2B differs from fig. 2A in that fig. 2B illustrates steps S150-S170 of the OSPF-based data processing method of other embodiments. Only the differences between fig. 2B and fig. 2A will be described below, and the same points will not be described again. For example, the OSPF-based data processing method is performed by an OSPF device.
In step S150, it is determined whether the reception processing operation in the synchronization process of the link state information in the OSPF device and the plurality of neighbor devices is ended by using the trigger.
In some embodiments, it may be determined whether the receive processing operation during synchronization of the OSPF device with the link state information in the plurality of neighbor devices is complete by determining whether the link state information update list of the OSPF device is empty using a trigger. In the case where the link-state information update list of the OSPF device is empty, the reception processing operation in the synchronization process of the OSPF device with the link-state information in the plurality of neighbor devices ends. The link-state information update list of the OSPF device includes link-state information for each neighbor device that is present but not present in the OSPF device. For example, the link state information is summary information of the link state. The link state information update list is a LSA (Link State Advertisement ) list.
In step S160, in the case where the reception processing operation in the synchronization process of the OSPF device and the link state information in the plurality of neighbor devices ends, the plurality of first threads and at least one second thread are terminated. Since the receiving processing operation is more than the transmitting operation in the synchronization of the link state information, the synchronization speed is mainly affected by the receiving processing operation and becomes slow. Therefore, here, only in the case where the reception processing operation ends, the first thread and the second thread are terminated.
In step S170, the original receiving processing thread is invoked to perform a receiving processing operation in the synchronization process of the link state information in the OSPF device and the plurality of neighbor devices, and an operation of receiving and processing keep-alive messages from the at least one neighbor device.
In the above embodiment, by dynamically monitoring and terminating the plurality of first threads and at least one second thread in time when judging that the receiving processing operation in the synchronization process of the link state information in the OSPF device and the plurality of neighbor devices is finished, unnecessary CPU resource occupation can be avoided, and the utilization rate of the CPU resource is improved.
Fig. 3 is a block diagram illustrating an OSPF-based data processing apparatus according to some embodiments of the present disclosure.
As shown in fig. 3, the OSPF-based data processing apparatus 3 includes a creation module 31 and a switching module 32. For example, the OSPF-based data processing apparatus 3 is an OSPF device. For example, the creation module 31 includes a first creation unit 311. The switching module 32 includes a first switching unit 321.
The first creating unit 311 is configured to create a plurality of first threads for a plurality of neighbor devices adjacent to the OSPF device, for example, to perform step S110 shown in fig. 1, in response to detecting that the CPU occupancy of the OSPF process in the OSPF device is greater than a preset threshold.
The first switching unit 321 is configured to switch the reception processing operation in the synchronization process of the OSPF device and the link state information in the plurality of neighbor devices from the execution of the original reception processing thread in the OSPF process to the execution of the plurality of first threads, for example, to execute step S120 shown in fig. 1.
In the above embodiment, when it is detected that the CPU occupancy rate of the OSPF process in the OSPF device is greater than the preset threshold, a large number of receiving processing operations in the synchronization process are performed by creating a plurality of first threads and using a plurality of threads instead of a single thread in the OSPF process, so that the speed of synchronizing link state information can be increased and the synchronization operation of the link state information can be completed in time under the condition that it is precisely detected that the OSPF device performs a large number of synchronization operations, thereby ensuring that the routing of the autonomous system is normally converged.
In some embodiments, the creation module 31 further includes a second creation unit 312. The switching module 32 further comprises a second switching unit 322.
The second creating unit 312 is configured to create at least one second thread for at least one neighboring device that has not sent a keep-alive message to the OSPF device at the current time instant or has sent a keep-alive message to the OSPF device but the OSPF device did not process the keep-alive message, e.g. to perform step S130 as shown in fig. 2A, in response to detecting that the CPU occupancy of the OSPF process in the OSPF device is greater than the preset threshold and the keep-alive time at the current time instant is less than the difference between the expiration time and the interval time. The keep-alive time, the failure time and the interval time are the same as those defined in the foregoing embodiments, and will not be described in detail herein.
The second switching unit 322 is configured to switch the operation of receiving and processing keep-alive messages from the at least one neighboring device from being performed by the original receiving processing thread to being performed by at least one second thread, for example, performing step S140 as shown in fig. 2A.
In the above embodiment, when it is detected that the CPU occupancy of the OSPF process in the OSPF device is greater than the preset threshold, the OSPF device performs a large number of synchronization operations, and by creating a second thread for each neighboring device that has sent a keep-alive message to the OSPF device or has sent a keep-alive message to the OSPF device but has not processed the keep-alive message, and performing the operation of receiving and processing the keep-alive message by using the newly created second thread instead of a single thread in the OSPF process, the stability of the adjacency between the OSPF device and the neighboring device can be improved, so that the normal convergence of the route of the autonomous system is further ensured, and the route oscillation is avoided.
FIG. 4 is a block diagram illustrating an OSPF-based data processing apparatus according to further embodiments of the present disclosure.
As shown in fig. 4, the OSPF-based data processing apparatus 4 includes a memory 41; and a processor 42 coupled to the memory 41. The memory 41 is used for storing instructions for executing corresponding embodiments of the data processing method. Processor 42 is configured to perform OSPF-based data processing methods in any of the embodiments of the present disclosure based on instructions stored in memory 41. For example, the OSPF-based data processing apparatus 4 is an OSPF device.
FIG. 5 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.
As shown in FIG. 5, computer system 50 may be in the form of a general purpose computing device. Computer system 50 includes a memory 510, a processor 520, and a bus 500 that connects the various system components.
Memory 510 may include, for example, system memory, non-volatile storage media, and the like. The system memory stores, for example, an operating system, application programs, boot Loader (Boot Loader), and other programs. The system memory may include volatile storage media, such as Random Access Memory (RAM) and/or cache memory. The non-volatile storage medium stores, for example, instructions for performing a corresponding embodiment of at least one of the OSPF-based data processing methods. Non-volatile storage media include, but are not limited to, disk storage, optical storage, flash memory, and the like.
Processor 520 may be implemented as discrete hardware components such as a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gates or transistors, and the like. Accordingly, each of the modules, such as the judgment module and the determination module, may be implemented by a Central Processing Unit (CPU) executing instructions of the corresponding steps in the memory, or may be implemented by a dedicated circuit that performs the corresponding steps.
Bus 500 may employ any of a variety of bus architectures. For example, bus structures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.
Computer system 50 may also include input-output interface 530, network interface 540, storage interface 550, and the like. These interfaces 530, 540, 550, and memory 510 and processor 520 may be connected by bus 500. The input output interface 530 may provide a connection interface for input output devices such as a display, mouse, keyboard, etc. Network interface 540 provides a connection interface for various networking devices. The storage interface 550 provides a connection interface for external storage devices such as floppy disks, usb disks, SD cards, and the like.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable apparatus to produce a machine, such that the instructions, which execute via the processor, create means for implementing the functions specified in the flowchart and/or block diagram block or blocks.
These computer readable program instructions may also be stored in a computer readable memory that can direct a computer to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart and/or block diagram block or blocks.
The present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
Through the OSPF-based data processing method and device and the computer storage medium in the embodiments, the speed of synchronizing link state information can be improved, the synchronization operation of the link state information can be completed in time, and the normal convergence of the route of the autonomous system is ensured.
So far, the OSPF-based data processing method and apparatus, computer-readable storage medium according to the present disclosure have been described in detail. In order to avoid obscuring the concepts of the present disclosure, some details known in the art are not described. How to implement the solutions disclosed herein will be fully apparent to those skilled in the art from the above description.

Claims (12)

1. A data processing method based on Open Shortest Path First (OSPF) includes:
in response to detecting that the CPU occupancy of a central processing unit of an OSPF process in an OSPF device is greater than a preset threshold, creating a plurality of first threads for a plurality of neighbor devices adjacent to the OSPF device;
switching the receiving processing operation in the synchronization process of the link state information of the OSPF device and the neighbor devices from the original receiving processing thread in the OSPF process to the first threads, including:
receiving and processing a synchronization request queue from a neighbor device corresponding to each of the plurality of first threads;
receiving and processing acknowledgement messages from neighbor devices corresponding to each of the plurality of first threads;
and receiving and processing an update message generated by a neighbor device corresponding to each of the plurality of first threads for a synchronization request queue of the OSPF device.
2. The OSPF-based data processing method of claim 1, further comprising:
in response to detecting that the CPU occupancy of an OSPF process in the OSPF device is greater than the preset threshold and the keep-alive time at the current time is less than the difference between the expiration time and an interval time, for at least one neighbor device that did not send a keep-alive message to the OSPF device at the current time or that did not send a keep-alive message to the OSPF device but did not process the keep-alive message, creating at least one second thread, wherein each neighbor device corresponds to one second thread, the expiration time is the longest time that the OSPF device breaks a link with a neighbor device due to not receiving or having received but not processed a keep-alive message from a neighbor device, the keep-alive time is the remaining time that the OSPF device is fully contiguous with a neighbor device, and the interval time is a preset time interval that the OSPF device receives and processes a keep-alive message from a neighbor device;
the operation of receiving and processing keep-alive messages from the at least one neighbor device is switched from execution by the original receiving processing thread to execution by the at least one second thread.
3. The OSPF-based data processing method of claim 2, further comprising:
judging whether the receiving processing operation in the synchronization process of the link state information in the OSPF device and the neighbor devices is finished or not by utilizing a trigger;
terminating the plurality of first threads and the at least one second thread if a reception processing operation in synchronization of link state information in the OSPF device and the plurality of neighbor devices ends;
and calling the original receiving processing thread to execute the receiving processing operation and the operation of receiving and processing the keep-alive message from the at least one neighbor device in the synchronization process of the link state information in the OSPF device and the neighbor devices.
4. The OSPF-based data processing method of claim 3, wherein determining, with a trigger, whether a receive processing operation in synchronization of link state information in the OSPF device and the plurality of neighbor devices is finished comprises:
and judging whether a link state information update list of the OSPF device is empty or not by utilizing a trigger, wherein when the link state information update list of the OSPF device is empty, a receiving processing operation in a synchronization process of the link state information of the OSPF device and the neighbor devices is finished, and the link state information update list of the OSPF device comprises link state information which exists in each neighbor device but does not exist in the OSPF device.
5. The OSPF-based data processing method of claim 2, wherein said plurality of first threads and said at least one second thread are created in said OSPF process.
6. The OSPF-based data processing method of claim 2, further comprising:
and under the condition that the CPU occupancy rate of the OSPF process in the OSPF device is detected to be larger than a preset threshold value, periodically detecting whether the keep-alive time is smaller than the difference value between the failure time and the interval time.
7. The OSPF-based data processing method of claim 1, wherein each neighboring device corresponds to a first thread, and switching the reception processing operation in the synchronization process of the OSPF device and the link state information in the neighboring devices from the execution of the original reception processing thread in the OSPF process to the execution of the first threads comprises calling the first thread corresponding to each neighboring device to perform the following operations:
receiving and processing a synchronization request queue from each neighbor device, the synchronization request queue of each neighbor device including a synchronization request for link state information that exists in the OSPF device but does not exist in the neighbor device;
receiving and processing an acknowledgement message from each neighbor device, wherein the acknowledgement message characterizes that each neighbor device has received an update message of a synchronous request queue for each neighbor device;
and receiving and processing an update message generated by each neighbor device for a synchronization request queue of the OSPF device, wherein the synchronization request queue of the OSPF device for each neighbor device comprises a synchronization request for link state information existing in each neighbor device but not in the OSPF device.
8. The OSPF-based data processing method of claim 1, further comprising:
periodically acquiring the CPU occupancy rate of an OSPF process in the OSPF device;
and detecting whether the CPU occupancy rate of the OSPF process is larger than the preset threshold value.
9. The OSPF-based data processing method of claim 1, wherein said OSPF-based data processing method is performed by said OSPF device.
10. A data processing apparatus based on open shortest path first, OSPF, comprising:
a creating module configured to create a plurality of first threads for a plurality of neighbor devices adjacent to an OSPF device in response to detecting that a central processor CPU occupancy of an OSPF process in the OSPF device is greater than a preset threshold;
a switching module configured to switch execution of a receive processing operation in a synchronization process of the OSPF device and link state information in the plurality of neighbor devices by an original receive processing thread in the OSPF process to execution by the plurality of first threads, comprising:
receiving and processing a synchronization request queue from a neighbor device corresponding to each of the plurality of first threads;
receiving and processing acknowledgement messages from neighbor devices corresponding to each of the plurality of first threads;
and receiving and processing an update message generated by a neighbor device corresponding to each of the plurality of first threads for a synchronization request queue of the OSPF device.
11. A data processing apparatus based on open shortest path first, OSPF, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the open shortest path first, OSPF, based data processing method of any of claims 1 to 9 based on instructions stored in the memory.
12. A computer storage medium having stored thereon computer program instructions which, when executed by a processor, implement the open shortest path first, OSPF, based data processing method as claimed in any of claims 1 to 9.
CN202110205324.9A 2021-02-24 2021-02-24 OSPF-based data processing method and device Active CN115002020B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110205324.9A CN115002020B (en) 2021-02-24 2021-02-24 OSPF-based data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110205324.9A CN115002020B (en) 2021-02-24 2021-02-24 OSPF-based data processing method and device

Publications (2)

Publication Number Publication Date
CN115002020A CN115002020A (en) 2022-09-02
CN115002020B true CN115002020B (en) 2023-07-14

Family

ID=83018348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110205324.9A Active CN115002020B (en) 2021-02-24 2021-02-24 OSPF-based data processing method and device

Country Status (1)

Country Link
CN (1) CN115002020B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447587A (en) * 2012-02-02 2012-05-09 杭州华三通信技术有限公司 Graceful restart method based on OSPF (Open Shortest Path First Interior Gateway Protocol) protocol and router thereof
CN102932116A (en) * 2012-10-26 2013-02-13 迈普通信技术股份有限公司 Link state advertisement information confirmation method and equipment
EP2571212A2 (en) * 2011-09-16 2013-03-20 Telefonaktiebolaget L M Ericsson (PUBL) OSPF non-stop routing with reliable flooding
EP2571211A2 (en) * 2011-09-16 2013-03-20 Telefonaktiebolaget L M Ericsson (PUBL) OSPF NSR with delayed neighbor synchronization
WO2014052878A1 (en) * 2012-09-28 2014-04-03 Cornell University System and methods for improved network routing
CN104539623A (en) * 2015-01-07 2015-04-22 烽火通信科技股份有限公司 Achieving system and method for IGP multi-process CSPE in hybrid network
US10075534B1 (en) * 2016-07-25 2018-09-11 Juniper Networks, Inc. Method, system, and apparatus for reducing control traffic in connection with neighbor reachability confirmations

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2571212A2 (en) * 2011-09-16 2013-03-20 Telefonaktiebolaget L M Ericsson (PUBL) OSPF non-stop routing with reliable flooding
EP2571211A2 (en) * 2011-09-16 2013-03-20 Telefonaktiebolaget L M Ericsson (PUBL) OSPF NSR with delayed neighbor synchronization
CN102447587A (en) * 2012-02-02 2012-05-09 杭州华三通信技术有限公司 Graceful restart method based on OSPF (Open Shortest Path First Interior Gateway Protocol) protocol and router thereof
WO2014052878A1 (en) * 2012-09-28 2014-04-03 Cornell University System and methods for improved network routing
CN102932116A (en) * 2012-10-26 2013-02-13 迈普通信技术股份有限公司 Link state advertisement information confirmation method and equipment
CN104539623A (en) * 2015-01-07 2015-04-22 烽火通信科技股份有限公司 Achieving system and method for IGP multi-process CSPE in hybrid network
US10075534B1 (en) * 2016-07-25 2018-09-11 Juniper Networks, Inc. Method, system, and apparatus for reducing control traffic in connection with neighbor reachability confirmations

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
广域网整合中Stateful NAT、OSPF双进程相结合的设计与应用;李健俊;俞先永;刘鹏;姜学峰;;计算机系统应用(第03期);全文 *

Also Published As

Publication number Publication date
CN115002020A (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN108123851B (en) Survival detection method and device for master-slave node synchronous link in distributed system
US20180115474A1 (en) Flow entry aging method, switch, and controller
US10530869B2 (en) Bidirectional forwarding detection accelerator
JP2020080059A (en) Evaluation device, evaluation method and evaluation program
CN110213176B (en) Message processing method, device, equipment and medium of switch
CN115002020B (en) OSPF-based data processing method and device
US11063859B2 (en) Packet processing method and network device
US20230198648A1 (en) Time synchronization method, device and apparatus, and storage medium
JP2016201795A (en) Sink node status monitoring method, device and system
WO2017054405A1 (en) Bluetooth paging method and device
US10129147B2 (en) Network-on-chip flit transmission method and apparatus
CN108337181B (en) Method and device for managing congestion of switching network
CN111800337B (en) Data center-based method and device, electronic equipment and storage medium
CN114070799B (en) Processing method and processing device of priority pause frame and target network equipment
US9509780B2 (en) Information processing system and control method of information processing system
CN112866133A (en) Method and device for acquiring MSS (maximum segment size) in common
JP2018137637A (en) Communication network and communication terminal
CN108616461B (en) Policy switching method and device
CN114040007B (en) Method and device for data transmission between multiple nodes
CN105991424B (en) Network data forwarding method and device
CN111464442B (en) Method and device for routing data packet
US9948480B2 (en) Media access control filtering apparatus for high speed switching and operating method thereof
CN111107006B (en) Routing management method and device
CN115174447B (en) Network communication method, device, system, equipment and storage medium
CN113783769B (en) Method and device for transmitting message in automatic driving and relay equipment

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