CN113765711B - Network equipment keep-alive method and device - Google Patents

Network equipment keep-alive method and device Download PDF

Info

Publication number
CN113765711B
CN113765711B CN202110984685.8A CN202110984685A CN113765711B CN 113765711 B CN113765711 B CN 113765711B CN 202110984685 A CN202110984685 A CN 202110984685A CN 113765711 B CN113765711 B CN 113765711B
Authority
CN
China
Prior art keywords
keep
alive
target network
network equipment
time length
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
CN202110984685.8A
Other languages
Chinese (zh)
Other versions
CN113765711A (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.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data 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 New H3C Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN202110984685.8A priority Critical patent/CN113765711B/en
Publication of CN113765711A publication Critical patent/CN113765711A/en
Application granted granted Critical
Publication of CN113765711B publication Critical patent/CN113765711B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/0836Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability to enhance reliability, e.g. reduce downtime

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention relates to the field of network communications technologies, and in particular, to a method and an apparatus for keep-alive network devices. The method is applied to the SDN controller, and comprises the following steps: receiving keep-alive messages sent by target network equipment, and adding one to the number of the keep-alive messages to be processed corresponding to the target network equipment; obtaining the number of the to-be-processed keep-alive messages corresponding to the target network equipment in the keep-alive management data table and the time consumption for processing the last keep-alive message; and adjusting the keep-alive time length of the target network equipment based on the number of the keep-alive messages to be processed corresponding to the target network equipment and the time consumption of processing the last keep-alive message.

Description

Network equipment keep-alive method and device
Technical Field
The present invention relates to the field of network communications technologies, and in particular, to a method and an apparatus for keep-alive network devices.
Background
SDN (Software Defined Network ) is a novel network innovation architecture, is an implementation manner of network virtualization, and has the core technology that a control layer and a forwarding layer of network equipment such as a switch or a router are separated through unified southbound interface protocols (such as OpenFlow, NETCONF and the like), so that intelligent management and operation and maintenance of network resources and network services of the control layer are realized.
Currently, between an SDN controller and a network device, an Echo Request/Echo Reply message is sent to be kept alive at a client and a server by using UDP, or the keep alive mechanism of the OpenFlow connection or the TCP long connection is used for keeping alive.
However, when the networking architecture is large, after the number of network devices of the SDN controller nanotubes reaches a certain level, a processing bottleneck may occur in the SND controller, so that a problem that the device cannot normally process/receive the keep-alive message in the keep-alive time and causes keep-alive failure may occur.
Disclosure of Invention
The application provides a network equipment keep-alive method and device, which are used for solving the problem that in the prior art, a network architecture is large, so that an SDN controller cannot normally process keep-alive messages, and keep-alive failure is caused.
In a first aspect, the present application provides a network device keep-alive method applied to an SDN controller, where the method includes:
receiving keep-alive messages sent by target network equipment, and adding one to the number of the keep-alive messages to be processed corresponding to the target network equipment;
obtaining the number of the to-be-processed keep-alive messages corresponding to the target network equipment in the keep-alive management data table and the time consumption for processing the last keep-alive message;
and adjusting the keep-alive time length of the target network equipment based on the number of the keep-alive messages to be processed corresponding to the target network equipment and the time consumption of processing the last keep-alive message.
Optionally, the SDN controller is preconfigured with a keep-alive duration range and a keep-alive first packet transmission offset time range, and the method further includes:
when detecting that the target network equipment is accessed, configuring the keep-alive time length of the target network equipment based on the keep-alive time length range, and configuring the keep-alive first packet transmission offset time of the target network equipment based on the keep-alive first packet transmission offset time range;
and transmitting the keep-alive time length and the keep-alive first packet transmission offset time to the target network equipment, so that the target network equipment transmits a keep-alive message to the SDN controller based on the keep-alive time length and the keep-alive first packet transmission offset time, and stores the keep-alive time length and the keep-alive first packet transmission offset time into the keep-alive management data table.
Optionally, the step of adjusting the keep-alive time length of the target network device based on the number of to-be-processed keep-alive messages corresponding to the target network device and the processing time consumption of the last keep-alive message includes:
calculating the product of the number of the to-be-processed keep-alive messages corresponding to the target network equipment and the time consumption of the processing of the last keep-alive message;
if the product is smaller than a first threshold value, the keep-alive time length is reduced;
and if the product is greater than a second threshold, the keep-alive time duration is increased.
Optionally, the step of decreasing the keep-alive time duration if the first threshold is one-fourth of the keep-alive time duration includes:
the keep-alive time length of the target network equipment is adjusted to be one half of the original keep-alive time length;
the step of adjusting the keep-alive time length if the second threshold is one half of the keep-alive time length comprises the following steps:
and adjusting the keep-alive time length of the target network equipment to be twice of the original keep-alive time length.
Optionally, the adjusted keep-alive time length is greater than or equal to the minimum value of the keep-alive time length range and less than or equal to the maximum value of the keep-alive time length range, and the first threshold is less than the second threshold.
In a second aspect, the present application provides a network device keep-alive device, applied to an SDN controller, where the device includes:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving keep-alive messages sent by target network equipment and adding one to the number of the keep-alive messages to be processed corresponding to the target network equipment;
the acquisition unit is used for acquiring the number of the to-be-processed keep-alive messages corresponding to the target network equipment in the keep-alive management data table and the time consumption of processing the last keep-alive message;
the adjusting unit is used for adjusting the keep-alive time length of the target network equipment based on the number of the to-be-processed keep-alive messages corresponding to the target network equipment and the time consumption of the last keep-alive message.
Optionally, the SDN controller is preconfigured with a keep-alive duration range and a keep-alive first packet transmission offset time range, and the apparatus further includes:
the configuration unit is used for configuring the keep-alive time length of the target network equipment based on the keep-alive time length range and configuring the keep-alive first packet transmission offset time of the target network equipment based on the keep-alive first packet transmission offset time range when the access of the target network equipment is detected;
a sending unit, configured to send the keep-alive duration and the keep-alive first packet sending offset time to the target network device, so that the target network device sends a keep-alive packet to the SDN controller based on the keep-alive duration and the keep-alive first packet sending offset time, and saves the keep-alive duration and the keep-alive first packet sending offset time in the keep-alive management data table.
Optionally, when the keep-alive time length of the target network device is adjusted based on the number of keep-alive messages to be processed and the time consumption of processing the last keep-alive message corresponding to the target network device, the adjusting unit is specifically configured to:
calculating the product of the number of the to-be-processed keep-alive messages corresponding to the target network equipment and the time consumption of the processing of the last keep-alive message;
if the product is smaller than a first threshold value, the keep-alive time length is reduced;
and if the product is greater than a second threshold, the keep-alive time duration is increased.
Optionally, when the first threshold is one fourth of the keep-alive time period and the keep-alive time period is reduced, the adjusting unit is specifically configured to:
the keep-alive time length of the target network equipment is adjusted to be one half of the original keep-alive time length;
the second threshold is one half of the keep-alive time period, and when the keep-alive time period is adjusted to be greater, the adjusting unit is specifically configured to:
and adjusting the keep-alive time length of the target network equipment to be twice of the original keep-alive time length.
Optionally, the adjusted keep-alive time length is greater than or equal to the minimum value of the keep-alive time length range and less than or equal to the maximum value of the keep-alive time length range, and the first threshold is less than the second threshold.
In a third aspect, an embodiment of the present application provides a network device keep-alive apparatus, where the network device keep-alive apparatus includes:
a memory for storing program instructions;
a processor for invoking program instructions stored in said memory, performing the steps of the method according to any of the first aspects above in accordance with the obtained program instructions.
In a fourth aspect, embodiments of the present application also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the steps of the method according to any one of the first aspects.
As can be seen from the foregoing, the network device keep-alive method provided in the embodiment of the present application is applied to an SDN controller, and the method includes: receiving keep-alive messages sent by target network equipment, and adding one to the number of the keep-alive messages to be processed corresponding to the target network equipment; obtaining the number of the to-be-processed keep-alive messages corresponding to the target network equipment in the keep-alive management data table and the time consumption for processing the last keep-alive message; and adjusting the keep-alive time length of the target network equipment based on the number of the keep-alive messages to be processed corresponding to the target network equipment and the time consumption of processing the last keep-alive message.
By adopting the network equipment keep-alive method provided by the embodiment of the invention, whether the keep-alive time length of the network equipment needs to be adjusted or not can be comprehensively judged based on the number of the messages to be processed and the processing time consumption of the last keep-alive message corresponding to each network equipment, namely, the SDN controller can intelligently and dynamically adjust the keep-alive time length of each network equipment according to the congestion degree of the keep-alive message of each network equipment within the keep-alive time length range, thereby avoiding the SDN controller from setting the state of the normally keep-alive network equipment as the offline when the large-scale network equipment is kept alive and improving the service robustness of the SDN controller.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following description will briefly describe the drawings that are required to be used in the embodiments of the present application or the description in the prior art, and it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings may also be obtained according to these drawings of the embodiments of the present application for a person having ordinary skill in the art.
Fig. 1 is a detailed flowchart of a network device keep-alive method provided in an embodiment of the present application;
fig. 2 is a detailed flowchart of a method for providing a nano-tube network device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a keep-alive device of a network device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of another keep-alive device for network equipment according to an embodiment of the present application.
Detailed Description
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to any or all possible combinations including one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in embodiments of the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, a first message may also be referred to as a second message, and similarly, a second message may also be referred to as a first message, without departing from the scope of the present application. Depending on the context, furthermore, the word "if" used may be interpreted as "at … …" or "at … …" or "in response to a determination".
For example, referring to fig. 1, a detailed flowchart of a network device keep-alive method is provided in an embodiment of the present application, where the method is applied to an SDN controller, and the method includes the following steps:
step 100: and receiving keep-alive messages sent by target network equipment, and adding one to the number of the keep-alive messages to be processed corresponding to the target network equipment.
In the implementation of the application, a keep-alive time length range and a keep-alive first packet sending offset time range are preconfigured in the SDN controller, so when the SDN controller detects that the target network device is accessed, the keep-alive time length of the target network device is configured based on the keep-alive time length range, and the keep-alive first packet sending offset time of the target network device is configured based on the keep-alive first packet sending offset time range; and transmitting the keep-alive time length and the keep-alive first packet transmission offset time to the target network equipment, so that the target network equipment transmits a keep-alive message to the SDN controller based on the keep-alive time length and the keep-alive first packet transmission offset time, and stores the keep-alive time length and the keep-alive first packet transmission offset time into the keep-alive management data table.
That is, the SDN controller maintains a keep-alive management data table, where the keep-alive management data table includes a table entry corresponding to each accessed network device, that is, the keep-alive management data table maintains a table entry corresponding to the target network device, where the table entry includes the number of to-be-processed keep-alive messages corresponding to the target network device and the processing time consumption of the last keep-alive message, and may further include a keep-alive duration corresponding to the target network device and a keep-alive first packet sending offset time.
In practical application, the keep-alive duration range and the keep-alive first packet sending offset time range can be configured according to user requirements and/or specific application scenarios:
specifically, the flow of the visual configuration keep-alive first packet transmission offset time range is as follows:
1. acquiring a current keep-alive first packet sending offset time range from a database, and displaying a page;
2. the user page configures a new range;
3. determining whether to save or not, saving the new range into a database if saving, and not taking effect if not saving.
The flow of the visual configuration keep-alive duration range is as follows:
1. and acquiring the current keep-alive duration range from the database, and displaying the page.
2. The user page configures a new scope.
3. Determining whether to save or not, saving the new range into a database if saving, and not taking effect if not saving.
In this embodiment, when the SND controller is used to receive the network device, a preferred implementation manner is shown in fig. 2, which is a detailed flowchart of a method for receiving the network device provided in this embodiment, where the method includes the following steps:
step 200: the page add specifies the network device.
Step 210: the SDN controller establishes a NETCONF channel with the network device.
Step 220: and acquiring a keep-alive time length range from the database, and acquiring a default keep-alive time length, namely the minimum value of the keep-alive time length range, from the keep-alive time length range as the keep-alive time length of the network equipment.
Step 230: and acquiring a keep-alive first packet transmission offset time range from the database, and acquiring a random value from the range as the keep-alive first packet transmission offset time of the network equipment.
Step 240: the keep-alive time duration and keep-alive first packet transmission offset time selected in step 220 and step 230 are issued to the network device via the netcon f channel.
Step 250: after successful delivery, the keep-alive time length and the keep-alive first packet sending offset time of the network equipment are stored in the keep-alive management data.
Step 260: setting the network device to an up state. If the network device is in an on-line state, indicating that the network device is ready, processing of traffic may begin.
In this embodiment of the present application, after receiving a keep-alive duration and a keep-alive first packet transmission offset time issued by an SDN controller, a target network device sends a keep-alive packet to an SDN controller based on the keep-alive duration and the keep-alive first packet transmission offset time, for example, the SDN controller configures the keep-alive first packet transmission offset time of a network device a to be 20 seconds, and the keep-alive duration is 10 seconds, then the network device a sends the keep-alive first packet after 20 seconds of configuration is validated, and then sends the keep-alive packet at regular intervals of 10 seconds.
Then, when receiving a keep-alive message sent by the target network device, the SDN controller adds one to the number of keep-alive messages to be processed corresponding to the target network device.
Step 110: and obtaining the number of the to-be-processed keep-alive messages corresponding to the target network equipment in the keep-alive management data table and the time consumption for processing the last keep-alive message.
Specifically, after receiving the keep-alive messages sent by the target network device, the SDN controller acquires the number of to-be-processed keep-alive messages corresponding to the target network device and the time-consuming processing of the last keep-alive message from the keep-alive management data table.
By processing time-consuming is meant the time taken between receiving a keep-alive message sent by a network device and feeding back a response message to the network device.
Step 120: and adjusting the keep-alive time length of the target network equipment based on the number of the keep-alive messages to be processed corresponding to the target network equipment and the time consumption of processing the last keep-alive message.
In this embodiment of the present application, when the keep-alive duration of the target network device is adjusted based on the number of to-be-processed keep-alive messages corresponding to the target network device and the time consumption of processing the last keep-alive message, a preferred implementation manner is:
calculating the product of the number of the to-be-processed keep-alive messages corresponding to the target network equipment and the time consumption of the processing of the last keep-alive message; if the product is smaller than a first threshold value, the keep-alive time length is reduced; and if the product is greater than a second threshold, the keep-alive time duration is increased.
Specifically, if the first threshold is one-fourth of the keep-alive time period, when the keep-alive time period is reduced, a preferred implementation manner is as follows: and adjusting the keep-alive time length of the target network equipment to be one half of the original keep-alive time length.
If the second threshold is half of the keep-alive time period, when the keep-alive time period is increased, one preferable implementation mode is as follows: and adjusting the keep-alive time length of the target network equipment to be twice of the original keep-alive time length.
Of course, in this embodiment of the present application, because the keep-alive duration range is stored, the adjusted keep-alive duration may be limited to be greater than or equal to the minimum value of the keep-alive duration range and less than or equal to the maximum value of the keep-alive duration range, where the first threshold is less than the second threshold.
It should be noted that, the values of the first threshold and the second threshold may be configured in a self-defined manner according to different user requirements and/or different application scenarios, and only the first threshold is required to be smaller than the second threshold.
In summary, when more messages to be processed are corresponding to one network device, and the time for processing the last keep-alive message by the SDN controller is longer (i.e., the message processing performance of the SDN controller is lower), the keep-alive duration of the corresponding network device needs to be adjusted to be longer, otherwise, the keep-alive duration of the corresponding network device may be adjusted to be shorter.
The following describes the network device processing keep-alive configuration flow provided in the embodiment of the present application in detail in connection with a specific application scenario. Exemplary, a method for processing keep-alive configuration by a network device provided in an embodiment of the present application may include the following steps:
step 1: the SDN controller configures keep-alive time duration and keep-alive first packet sending offset time to the network equipment through the NETCONF channel.
Step 2: and after the network equipment is configured successfully, the keep-alive time length and the keep-alive first packet sending offset time are saved.
Step 3: judging whether a local keep-alive message sending timer exists or not, if so, stopping and deleting the timer, and then continuing the step 4; if not, continuing to execute the step 4.
Step 4: the dormancy keep-alive first packet sends an offset time.
And 5, starting a keep-alive message sending timer, wherein the starting interval time is the keep-alive time, and the timer sends the keep-alive message once every keep-alive time.
Step 6, after the timer is started, judging whether to start the keep-alive message sending timer for the first time, and according to the judging result, performing the following two processes:
if yes, the keep-alive message statistical data are cleared, then the keep-alive messages are sent, the number of the sent messages is increased by one, and the keep-alive message statistical data are updated.
If not, acquiring the keep-alive message statistical data, including the number of the received messages and the number of the sent messages, judging whether the number of the sent messages and the number of the received messages are equal, if so, sending the keep-alive messages, adding one to the number of the sent messages, and updating the keep-alive message statistical data.
Further, the keep-alive reply message receiving processing flow of the network device is as follows:
step 1: the network device waits for receiving the keep-alive reply message sent by the SDN controller.
Step 2: after the keep-alive reply message is received, the number of the received messages is increased by one, and the statistical data of the keep-alive message is updated.
And (5) circularly executing the step 1 and the step 2.
The intelligent keep-alive process of the SDN controller and the network equipment is as follows:
step 1: and the SDN controller receives the keep-alive message of the network equipment.
Step 2: and updating the current time as the keep-alive message receiving time of the network equipment into keep-alive management data.
Step 3: and obtaining the keep-alive management data of the network equipment, adding one to the number of the to-be-processed keep-alive messages, and updating the keep-alive messages into the keep-alive management data.
Step 4: judging whether the time consumption of the processing of the to-be-processed keep-alive message multiplied by the last keep-alive message is less than one fourth of the keep-alive time length, and according to the judging result, performing the following two processes:
a. if the number of keep-alive messages is multiplied by the number of the last keep-alive messages, and the processing time of the last keep-alive message is less than one fourth of the keep-alive time length, the new keep-alive time length of the network device is configured to be one half of the original keep-alive time length (if the new keep-alive time length is less than the minimum value of the keep-alive time length range, the minimum value is taken), and the step 7 is continued to be executed.
b. Otherwise, executing step 5.
Step 5: judging whether the processing time consumption of the to-be-processed keep-alive message multiplied by the last keep-alive message is more than or equal to one half of the keep-alive time length and less than the keep-alive time length, and according to the judging result, performing the following two processes:
a. if the number of the keep-alive messages to be processed multiplied by the processing time consumption of the last keep-alive message is more than or equal to one half of the keep-alive time length and less than the keep-alive time length, configuring the new keep-alive time length of the network device as one time of the original keep-alive time length (if the new keep-alive time length is more than the maximum value of the keep-alive time length range, taking the maximum value), and continuing to execute the step 7.
b. Otherwise, executing step 6.
Step 6: judging whether the processing time consumption of the to-be-processed keep-alive message multiplied by the last keep-alive message is more than or equal to the keep-alive time length and the original keep-alive time length is less than the maximum value of the keep-alive time length range, and performing the following two processes according to the judging result:
a. if the number of the keep-alive messages to be processed multiplied by the processing time consumption of the last keep-alive message is greater than or equal to the keep-alive time length and the original keep-alive time length is smaller than the maximum value of the keep-alive time length range, configuring the new keep-alive time length of the network equipment as the maximum value of the keep-alive time length range, and continuing to execute the step 7.
b. Otherwise, executing the step 7.
Step 7: and sending a keep-alive return packet to the network equipment.
Step 8: and subtracting one from the number of the keep-alive messages to be processed, calculating the processing time of the keep-alive messages, and updating the keep-alive management data.
Step 9: judging whether a new keep-alive time length needs to be configured, and performing the following two processes according to a judging result:
a. if the new keep-alive time length needs to be configured, the thread is started, the new keep-alive time length is configured into the corresponding network equipment through the NETCONF channel, and the processing is finished.
a. The process is ended.
The keep-alive monitoring flow is as follows:
step 1: the SDN controller starts a keep-alive monitoring timer, and the starting interval time is the minimum value of the keep-alive duration range. If the minimum value of the keep-alive time range changes, the old keep-alive monitoring timer is stopped being deleted, the keep-alive monitoring timer is newly built, and the starting interval time is the minimum value of the new keep-alive time range.
Step 2: and (3) circularly processing each online network device after starting a timer, wherein the processing flow is as follows:
step 21: and acquiring the keep-alive message receiving time and keep-alive time duration in keep-alive management data of the corresponding network equipment.
Step 22: if the difference between the current time and the time of receiving the keep-alive message in the keep-alive management data is more than 4 times of the keep-alive time length, the state of the network equipment is set to be off-line, and the service related to the network equipment is not processed.
Step 23: if the difference between the current time and the keep-alive message receiving time in the keep-alive management data is less than or equal to 4 times of the keep-alive time length, ending the processing of the network equipment.
For example, referring to fig. 3, a schematic structural diagram of a keep-alive device for network equipment provided in an embodiment of the present application is shown, where the device is applied to an SDN controller, and the device includes:
a receiving unit 30, configured to receive keep-alive messages sent by a target network device, and add one to the number of keep-alive messages to be processed corresponding to the target network device;
an obtaining unit 31, configured to obtain the number of keep-alive messages to be processed corresponding to the target network device in the keep-alive management data table and time consumption for processing a previous keep-alive message;
and the adjusting unit 32 is configured to adjust the keep-alive duration of the target network device based on the number of keep-alive messages to be processed corresponding to the target network device and the processing time consumption of the last keep-alive message.
Optionally, the SDN controller is preconfigured with a keep-alive duration range and a keep-alive first packet transmission offset time range, and the apparatus further includes:
the configuration unit is used for configuring the keep-alive time length of the target network equipment based on the keep-alive time length range and configuring the keep-alive first packet transmission offset time of the target network equipment based on the keep-alive first packet transmission offset time range when the access of the target network equipment is detected;
a sending unit, configured to send the keep-alive duration and the keep-alive first packet sending offset time to the target network device, so that the target network device sends a keep-alive packet to the SDN controller based on the keep-alive duration and the keep-alive first packet sending offset time, and saves the keep-alive duration and the keep-alive first packet sending offset time in the keep-alive management data table.
Optionally, when the keep-alive time length of the target network device is adjusted based on the number of keep-alive messages to be processed and the processing time consumption of the last keep-alive message corresponding to the target network device, the adjusting unit 32 is specifically configured to:
calculating the product of the number of the to-be-processed keep-alive messages corresponding to the target network equipment and the time consumption of the processing of the last keep-alive message;
if the product is smaller than a first threshold value, the keep-alive time length is reduced;
and if the product is greater than a second threshold, the keep-alive time duration is increased.
Optionally, when the first threshold is one fourth of the keep-alive time period and the keep-alive time period is reduced, the adjusting unit 32 is specifically configured to:
the keep-alive time length of the target network equipment is adjusted to be one half of the original keep-alive time length;
the second threshold is one half of the keep-alive time period, and when the keep-alive time period is adjusted to be greater, the adjusting unit is specifically configured to:
and adjusting the keep-alive time length of the target network equipment to be twice of the original keep-alive time length.
Optionally, the adjusted keep-alive time length is greater than or equal to the minimum value of the keep-alive time length range and less than or equal to the maximum value of the keep-alive time length range, and the first threshold is less than the second threshold.
The above units may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), or one or more microprocessors (digital singnal processor, abbreviated as DSP), or one or more field programmable gate arrays (Field Programmable Gate Array, abbreviated as FPGA), or the like. For another example, when a unit is implemented in the form of a processing element scheduler code, the processing element may be a general purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Further, in the network device keep-alive device provided in the embodiment of the present application, as for a hardware layer, a hardware architecture schematic diagram of the network device keep-alive device may be shown in fig. 4, and the network device keep-alive device may include: a memory 40 and a processor 41,
memory 40 is used to store program instructions; the processor 41 invokes the program instructions stored in the memory 40 to execute the above-described method embodiments in accordance with the obtained program instructions. The specific implementation manner and the technical effect are similar, and are not repeated here.
Optionally, the present application further provides an SDN controller comprising at least one processing element (or chip) for executing the above-described method embodiments.
Optionally, the present application also provides a program product, such as a computer readable storage medium, storing computer executable instructions for causing the computer to perform the above-described method embodiments.
Here, a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that may contain or store information, such as executable instructions, data, or the like. For example, a machine-readable storage medium may be: RAM (Radom Access Memory, random access memory), volatile memory, non-volatile memory, flash memory, a storage drive (e.g., hard drive), a solid state drive, any type of storage disk (e.g., optical disk, dvd, etc.), or a similar storage medium, or a combination thereof.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present application.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Moreover, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing description of the preferred embodiments of the present invention is not intended to limit the invention to the precise form disclosed, and any modifications, equivalents, improvements and alternatives falling within the spirit and principles of the present invention are intended to be included within the scope of the present invention.

Claims (6)

1. A network device keep-alive method, applied to an SDN controller, the method comprising:
receiving keep-alive messages sent by target network equipment, and adding one to the number of the keep-alive messages to be processed corresponding to the target network equipment;
obtaining the number of the to-be-processed keep-alive messages corresponding to the target network equipment in the keep-alive management data table and the time consumption for processing the last keep-alive message;
based on the number of the keep-alive messages to be processed and the time consumption of the last keep-alive message corresponding to the target network equipment, adjusting the keep-alive time length of the target network equipment;
based on the number of keep-alive messages to be processed and the time consumption of the last keep-alive message corresponding to the target network device, the step of adjusting the keep-alive time of the target network device comprises the following steps:
calculating the product of the number of the to-be-processed keep-alive messages corresponding to the target network equipment and the time consumption of the processing of the last keep-alive message;
if the product is smaller than a first threshold value, the keep-alive time length is reduced;
if the product is greater than a second threshold, the keep-alive time length is increased;
the adjusted keep-alive time length is larger than or equal to the minimum value of the keep-alive time length range and smaller than or equal to the maximum value of the keep-alive time length range, and the first threshold value is smaller than the second threshold value.
2. The method of claim 1, wherein the SDN controller is preconfigured with a keep-alive duration range and a keep-alive header packet transmission offset time range, the method further comprising:
when detecting that the target network equipment is accessed, configuring the keep-alive time length of the target network equipment based on the keep-alive time length range, and configuring the keep-alive first packet transmission offset time of the target network equipment based on the keep-alive first packet transmission offset time range;
and transmitting the keep-alive time length and the keep-alive first packet transmission offset time to the target network equipment, so that the target network equipment transmits a keep-alive message to the SDN controller based on the keep-alive time length and the keep-alive first packet transmission offset time, and stores the keep-alive time length and the keep-alive first packet transmission offset time into the keep-alive management data table.
3. The method of claim 1, wherein the first threshold is one-fourth of a keep-alive time period, and the step of decreasing the keep-alive time period comprises:
the keep-alive time length of the target network equipment is adjusted to be one half of the original keep-alive time length;
the step of adjusting the keep-alive time length if the second threshold is one half of the keep-alive time length comprises the following steps:
and adjusting the keep-alive time length of the target network equipment to be twice of the original keep-alive time length.
4. A network device keep-alive apparatus for application to an SDN controller, the apparatus comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving keep-alive messages sent by target network equipment and adding one to the number of the keep-alive messages to be processed corresponding to the target network equipment;
the acquisition unit is used for acquiring the number of the to-be-processed keep-alive messages corresponding to the target network equipment in the keep-alive management data table and the time consumption of processing the last keep-alive message;
the adjusting unit is used for adjusting the keep-alive time length of the target network equipment based on the number of the to-be-processed keep-alive messages corresponding to the target network equipment and the time consumption of the last keep-alive message;
based on the number of keep-alive messages to be processed and the time consumption of the last keep-alive message corresponding to the target network device, when the keep-alive time of the target network device is adjusted, the adjusting unit is specifically configured to:
calculating the product of the number of the to-be-processed keep-alive messages corresponding to the target network equipment and the time consumption of the processing of the last keep-alive message;
if the product is smaller than a first threshold value, the keep-alive time length is reduced;
if the product is greater than a second threshold, the keep-alive time length is increased;
the adjusted keep-alive time length is larger than or equal to the minimum value of the keep-alive time length range and smaller than or equal to the maximum value of the keep-alive time length range, and the first threshold value is smaller than the second threshold value.
5. The apparatus of claim 4, wherein a keep-alive duration range and a keep-alive header packet transmission offset time range are preconfigured in the SDN controller, the apparatus further comprising:
the configuration unit is used for configuring the keep-alive time length of the target network equipment based on the keep-alive time length range and configuring the keep-alive first packet transmission offset time of the target network equipment based on the keep-alive first packet transmission offset time range when the access of the target network equipment is detected;
a sending unit, configured to send the keep-alive duration and the keep-alive first packet sending offset time to the target network device, so that the target network device sends a keep-alive packet to the SDN controller based on the keep-alive duration and the keep-alive first packet sending offset time, and saves the keep-alive duration and the keep-alive first packet sending offset time in the keep-alive management data table.
6. The apparatus of claim 4, wherein the first threshold is one-fourth of a keep-alive time period, and the adjusting unit is specifically configured to:
the keep-alive time length of the target network equipment is adjusted to be one half of the original keep-alive time length;
the second threshold is one half of the keep-alive time period, and when the keep-alive time period is adjusted to be greater, the adjusting unit is specifically configured to:
and adjusting the keep-alive time length of the target network equipment to be twice of the original keep-alive time length.
CN202110984685.8A 2021-08-25 2021-08-25 Network equipment keep-alive method and device Active CN113765711B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110984685.8A CN113765711B (en) 2021-08-25 2021-08-25 Network equipment keep-alive method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110984685.8A CN113765711B (en) 2021-08-25 2021-08-25 Network equipment keep-alive method and device

Publications (2)

Publication Number Publication Date
CN113765711A CN113765711A (en) 2021-12-07
CN113765711B true CN113765711B (en) 2023-12-26

Family

ID=78791298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110984685.8A Active CN113765711B (en) 2021-08-25 2021-08-25 Network equipment keep-alive method and device

Country Status (1)

Country Link
CN (1) CN113765711B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018090602A1 (en) * 2016-11-18 2018-05-24 上海斐讯数据通信技术有限公司 Keep-alive packet control method and system for long connection server
CN108616903A (en) * 2016-12-19 2018-10-02 南宁富桂精密工业有限公司 Link keep-alive method between AC and AP and system
CN111355764A (en) * 2018-12-24 2020-06-30 迈普通信技术股份有限公司 Keep-alive message sending method and device, electronic equipment and readable storage medium
CN111641702A (en) * 2020-05-26 2020-09-08 南京领行科技股份有限公司 Heartbeat message management method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8375134B2 (en) * 2009-06-08 2013-02-12 Microsoft Corporation Determining an efficient keep-alive interval for a network connection
US8862774B2 (en) * 2011-09-12 2014-10-14 Cisco Technology, Inc. Dynamic keepalive parameters for reverse path validation in computer networks
US9271325B2 (en) * 2013-04-30 2016-02-23 Seven Networks, Llc Detection and reporting of keepalive messages for optimization of keepalive traffic in a mobile network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018090602A1 (en) * 2016-11-18 2018-05-24 上海斐讯数据通信技术有限公司 Keep-alive packet control method and system for long connection server
CN108616903A (en) * 2016-12-19 2018-10-02 南宁富桂精密工业有限公司 Link keep-alive method between AC and AP and system
CN111355764A (en) * 2018-12-24 2020-06-30 迈普通信技术股份有限公司 Keep-alive message sending method and device, electronic equipment and readable storage medium
CN111641702A (en) * 2020-05-26 2020-09-08 南京领行科技股份有限公司 Heartbeat message management method and device

Also Published As

Publication number Publication date
CN113765711A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
US7929436B2 (en) Network communication control methods and systems
CN107872396B (en) Communication method with timeout control, processing device, terminal device and server
CN108123851B (en) Survival detection method and device for master-slave node synchronous link in distributed system
CN112398945B (en) Service processing method and device based on backpressure
KR101139836B1 (en) Method and system for two-phase mechanism for discovering web services based management service
CN114285795B (en) State control method, device, equipment and storage medium of virtual equipment
CN109150659B (en) Processor and BFD message transmission method
US11218371B2 (en) Method and apparatus for performing communication in internet of things
CN102055644A (en) Method, device and system for load management in distributed directory service system
CN113535344A (en) Network data processing method and device, server and storage medium
CN110213213B (en) Timing task processing method and system for application
CN112838980B (en) Message processing method, system, device, electronic equipment and storage medium
CN111835797A (en) Data processing method, device and equipment
CN113765711B (en) Network equipment keep-alive method and device
US10951732B2 (en) Service processing method and device
CN116647476A (en) Network management method, apparatus, computer device, storage medium, and program product
CN112860427A (en) Container cluster and load balancing method and device thereof
CN111200578A (en) Communication method, client device and server device
CN112751895B (en) Communication connection keep-alive method and system thereof
US20140211604A1 (en) Method and Apparatus for the Fast Detection of Connectivity Loss Between Devices in a Network
CN107707480B (en) Message forwarding method and device
CN114327817A (en) Task fragmentation method and device and electronic equipment
CN108574622B (en) Instant message processing method and device based on XMPP
CN111159236A (en) Data processing method and device, electronic equipment and storage medium
US10673726B2 (en) Heartbeat packet timer identification method, and device

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