CN115174374A - System, method, device and medium for configuring network time synchronization tool - Google Patents

System, method, device and medium for configuring network time synchronization tool Download PDF

Info

Publication number
CN115174374A
CN115174374A CN202210763586.1A CN202210763586A CN115174374A CN 115174374 A CN115174374 A CN 115174374A CN 202210763586 A CN202210763586 A CN 202210763586A CN 115174374 A CN115174374 A CN 115174374A
Authority
CN
China
Prior art keywords
source
information table
information
address
time synchronization
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.)
Granted
Application number
CN202210763586.1A
Other languages
Chinese (zh)
Other versions
CN115174374B (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210763586.1A priority Critical patent/CN115174374B/en
Publication of CN115174374A publication Critical patent/CN115174374A/en
Application granted granted Critical
Publication of CN115174374B publication Critical patent/CN115174374B/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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • 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/0813Configuration setting characterised by the conditions triggering a change of settings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/58Association of routers
    • H04L45/586Association of routers of virtual routers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • H04L49/3009Header conversion, routing tables or routing tags

Landscapes

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

Abstract

The invention discloses a system, a method, equipment and a medium for configuring a network time synchronization tool, wherein the system comprises a configuration issuing module, a configuration management module, an execution module and a monitoring module; the configuration issuing module writes information of a network time synchronization tool into a first information table; the configuration management module monitors the first information table, generates a configuration file when the first information table changes and creates a second information table; the execution module monitors the second information table, acquires the source interface equipment name or the source IP address and the virtual route forwarding information from the first information table when the second information table changes, and correspondingly starts the network time synchronization service according to the virtual route forwarding information; the monitoring module monitors the configured source interface or source IP address and the real-time state forwarded by the virtual router so as to update the database in real time. The scheme of the invention can automatically update the configuration of the network time synchronization tool according to the change of virtual route forwarding, and ensure the validity of the configuration of the network time synchronization tool in real time.

Description

System, method, device and medium for configuring network time synchronization tool
Technical Field
The present invention relates to the field of switch technologies, and in particular, to a system, a method, a device, and a medium for configuring a network time synchronization tool.
Background
The white box switch is widely applied to a large-scale data center, so that the operation and maintenance cost of an internet enterprise is greatly reduced. Generally, to ensure Time consistency, each device in the Network is Time-synchronized with a remote clock source through an ntp (Network Time Protocol). In the prior art, in order to avoid a situation that a plurality of interfaces of a switch all send received ntp messages for processing, the ntp service is generally started by configuring vrf (Virtual Routing Forwarding), but in the prior art, when an ntp is configured by using a command, vrf needs to be manually configured, and after vrf is changed, the ntp service cannot be reset according to the actual configuration of the interfaces.
Disclosure of Invention
In view of this, the present invention provides a system, a method, a device and a medium for configuring a network time synchronization tool, which implement configuration of an ntp source IP address or a source interface in a data center switch by configuring an issuing module, a configuration management module, an execution module and a monitoring module. All the modules are deployed on the switch, after configuration is completed, the switch only sends/receives ntp message interaction through the configured source IP address or the source interface, redundant ntp messages can be effectively filtered, ntp configuration can be automatically updated according to the change of the configured source IP address or the source interface vrf, and the ntp configuration effectiveness is guaranteed in real time.
Based on the above object, an aspect of the embodiments of the present invention provides a system for configuring a network time synchronization tool based on a switch, where the system specifically includes:
the system comprises a configuration issuing module, a configuration management module, an execution module and a monitoring module;
the configuration issuing module is configured to create a first information table in a database and write information related to configuring a network time synchronization tool into the first information table, wherein the information comprises a source interface device name or a source IP address of an access switch and virtual routing forwarding information;
the configuration management module is configured to monitor the first information table, and respond to the change of the first information table to acquire a source interface device name or a source IP address in the first information table;
the configuration management module is also configured to generate a configuration file required by the network time synchronization tool according to the source interface device name or the source IP address and a preset template, and create a second information table in the database after the configuration file is generated;
the execution module is configured to monitor the second information table, and in response to a change of the second information table, obtain the source interface device name or the source IP address and the virtual routing forwarding information from the first information table;
the execution module is further configured to determine whether the virtual routing forwarding information is empty based on the source interface device name or the source IP address, and accordingly start a network time synchronization service based on the configuration file based on a determination result;
the monitoring module is configured to monitor a source interface or a source IP address configured by the network time synchronization tool in the database and a real-time status forwarded by a virtual router so as to update the database in real time.
In some embodiments, initiating a network time synchronization service based on the profile based on the determination result accordingly comprises:
in response to the virtual route forwarding information not being empty, creating a corresponding cgroup device based on the virtual route forwarding information, and binding a network time synchronization service to the cgroup device to start the network time synchronization service at the cgroup device based on the configuration file;
and responding to the virtual route forwarding information is empty, and starting network time synchronization service based on the configuration file.
In some embodiments, obtaining the source interface device name and the virtual routing and forwarding information from the first information table, and determining whether the virtual routing and forwarding information is null based on the source interface device name includes:
in response to the first information table containing the source interface device name, searching whether a corresponding interface information table exists in the database based on the source interface device name;
responding to the existence of the corresponding interface information table, and checking whether the corresponding interface information table has an IP address or not;
and responding to the IP address of the corresponding interface information table, acquiring corresponding virtual route forwarding information from the first information table, and judging whether the corresponding virtual route forwarding information is empty or not.
In some embodiments, obtaining the source IP address and the virtual routing forwarding information from the first information table, and determining whether the virtual routing forwarding information is null based on the source IP address comprises:
responding to the first information table containing the source IP address, acquiring the source IP address from the first information table, and searching whether a corresponding interface information table exists in the database based on the source IP address;
and responding to the existence of the corresponding interface information table, acquiring corresponding virtual route forwarding information from the first information table based on the source interface equipment name in the corresponding interface information table, and judging whether the corresponding virtual route forwarding information is empty or not.
In some embodiments, monitoring a real-time status of a source interface or a source IP address configured by the network time synchronization tool and virtual route forwarding in the database to update the database in real-time comprises:
monitoring a virtual route forwarding information table and a three-layer interface information table in the database;
responding to the change of the virtual routing forwarding information table and/or the three-layer interface information table, acquiring a corresponding interface device name and a corresponding operation from the three-layer interface information table, correspondingly modifying the source interface device name or the source IP address and the virtual routing forwarding information in the first information, and resetting network time synchronization service, wherein the operation comprises any one of adding the interface device into a corresponding virtual network route, removing the interface device from the corresponding virtual network route, and deleting the virtual network route.
In some embodiments, writing information related to configuring a network time synchronization tool to the first information table comprises:
writing said information related to configuring the network time synchronization tool to said first information table by command.
In some embodiments, the configuration issuing module is further configured to save the database to an operation configuration file of a network operating system of a server, and save the operation configuration file to a start configuration file of the network operating system.
In another aspect of the embodiments of the present invention, a method for configuring a network time synchronization tool based on a switch is further provided, where the method includes:
the method comprises the steps that a configuration issuing module creates a first information table in a database and writes information related to a configuration network time synchronization tool into the first information table, wherein the information comprises a source interface equipment name or a source IP address of an access switch and virtual route forwarding information;
a configuration management module monitors the first information table and responds to the change of the first information table to acquire a source interface device name or a source IP address in the first information table;
the configuration management module generates a configuration file required by the network time synchronization tool according to the source interface device name or the source IP address and a preset template, and creates a second information table in the database after the configuration file is generated;
the execution module monitors the second information table, responds to the change of the second information table, and acquires the source interface equipment name or the source IP address and the virtual routing forwarding information from the first information table;
the execution module judges whether the virtual routing forwarding information is empty or not based on the source interface equipment name or the source IP address, and correspondingly starts network time synchronization service based on the configuration file based on the judgment result;
and the monitoring module monitors a source interface or a source IP address configured by the network time synchronization tool in the database and the real-time state forwarded by the virtual router so as to update the database in real time.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing a computer program executable on the processor, the computer program when executed by the processor implementing the steps of the method as above.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has at least the following beneficial technical effects: the configuration of the switch ntp is realized through a configuration issuing module, a configuration management module, an execution module and a monitoring module which are deployed on the switch. After the configuration is completed, the exchanger sends/receives the ntp message interaction through the configured source IP address or the source interface, redundant ntp messages can be effectively filtered, ntp configuration can be automatically updated according to the change of the configured source IP address or the vrf where the source interface is located, and the validity of ntp configuration is guaranteed in real time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic diagram of an embodiment of a system for configuring a network time synchronization facility based on a switch according to the present invention;
FIG. 2 is a flow chart illustrating interaction of internal modules of an embodiment of a system for configuring a network time synchronization tool based on a switch according to the present invention;
FIG. 3 is a block diagram of one embodiment of a method for configuring a network time synchronization facility based on a switch;
FIG. 4 is a schematic structural diagram of an embodiment of a computer device provided in the present invention;
fig. 5 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In view of the above objects, a first aspect of the embodiments of the present invention provides an embodiment of a system for configuring a network time synchronization tool based on a switch.
As shown in fig. 1, the system includes a configuration issuing module 10, a configuration management module 20, an execution module 30, and a monitoring module 40. The execution logic of each module is as follows:
the configuration issuing module 10 creates a first information table in a database, and writes information related to a configuration network time synchronization tool into the first information table, wherein the information includes a source interface device name or a source IP address of an access switch and virtual routing forwarding information;
the configuration management module 20 monitors the first information table, and obtains a source interface device name or a source IP address in the first information table in response to a change of the first information table;
the configuration management module 20 generates a configuration file required by the network time synchronization tool according to the source interface device name or the source IP address and a preset template, and creates a second information table in the database after the configuration file is generated;
the execution module 30 is configured to monitor the second information table, and in response to a change in the second information table, obtain a source interface device name or a source IP address and virtual routing forwarding information from the first information table;
the execution module 30 determines whether the virtual routing forwarding information is empty based on the source interface device name or the source IP address, and starts a network time synchronization service based on the configuration file correspondingly based on the determination result;
the monitoring module 40 monitors the source interface or the source IP address configured by the network time synchronization tool in the database and the real-time status forwarded by the virtual router to update the database in real time.
More specifically, a configuration issuing module, a configuration management module, an execution module and a monitoring module are deployed on a switch, and the switch is a white box switch. As shown in fig. 2, an interaction flow diagram of internal modules of a system for configuring a network time synchronization tool based on a switch is provided, where the working and interaction flows of each module are specifically as follows:
the configuration issuing module writes information required by NTP configuration into a first information table of the database, assuming that the first information table is defined as NTP _ SOURCE, the information specifically includes a SOURCE interface device name or a SOURCE IP address and vrf (virtual routing forwarding) information, and the SOURCE interface device name and the SOURCE IP address are configured in an overlay manner, that is, the old configuration is newly configured to overlay.
The configuration issuing module is responsible for creating the NTP _ SOURCE table. When a user configures an interface or an IP address, an NTP _ SOURCE table is created and the active state defaults to in-active. The module checks whether the IP address of the interface is available, if the IP address can be normally used, the interface state is enable, otherwise, the interface state is disable.
After the source interface or the source IP address is configured, the subsequent ntp service can automatically query vrf where the source interface or the source IP address is located according to the source interface device name or the source IP address in the database, and bind the ntp service to the vrf for operation.
After the initialization (namely after the startup) is completed, the configuration management module monitors an NTP _ SOURCE table in the database, automatically acquires SOURCE interface information or SOURCE IP address information in the NTP _ SOURCE table when the table is found to be changed, and regenerates an NTP required configuration file ntp.conf according to the SOURCE interface information or the SOURCE IP address information in the table and a preset template. After the configuration file is generated, a second information table is created in the database, and it is assumed that the second information table is defined as NTP _ CONF _ DONE, where the NTP _ CONF _ DONE table may be empty.
After the execution module is started, monitoring an NTP _ CONF _ DONE table, reading the NTP _ SOURCE table after monitoring that the table is changed, namely the NTP _ CONF _ DONE table is deleted and/or created, acquiring SOURCE interface or SOURCE IP address information, and acquiring vrf information according to the SOURCE interface or SOURCE IP address information. If no vrf information exists, directly starting the ntp service; if vrf information exists, a corresponding cgroup device is created based on a cgroup mechanism provided by kernel, and the ntp service is bound to the device for execution.
When the system is started, the monitoring module is started in a service mode, monitors vrf table entries and three-layer interface table entries in the database after the system is started, and compares the monitored vrf information and/or three-layer interface information with the SOURCE interface information or the SOURCE IP address information in the NTP-SOURCE and completes the modification of the NTP-SOURCE table in the database and the reconfiguration of the NTP service when the monitored table entries are changed.
The interaction of the ntp message is carried out through three layers of interfaces, each three layer of interface carries out message forwarding in vrf, so that when the ntp message is monitored on one three layer of interface, vrf domain to which the interface belongs needs to be considered, and the ntp message can be normally forwarded in vrf. vrf as the master device of the interface needs to be configured according to the actual application situation, which results in that vrf where the interface is located may change with the change of the application or the network, so that it needs to monitor this situation through the monitoring module, and when the monitored interface and/or vrf changes, the ntp service is reset.
The configuration of the switch ntp is realized through a configuration issuing module, a configuration management module, an execution module and a monitoring module which are deployed on the switch. After the configuration is completed, the exchanger sends/receives the ntp message interaction through the configured source IP address or the source interface, redundant ntp messages can be effectively filtered, ntp configuration can be automatically updated according to the change of the configured source IP address or the vrf where the source interface is located, and the validity of ntp configuration is guaranteed in real time.
In some embodiments, initiating a network time synchronization service based on the profile based on the determination result accordingly comprises:
in response to the virtual route forwarding information not being empty, creating a corresponding cgroup device based on the virtual route forwarding information, and binding a network time synchronization service to the cgroup device to start the network time synchronization service at the cgroup device based on the configuration file;
and responding to the virtual route forwarding information is empty, and starting network time synchronization service based on the configuration file.
In one embodiment, the configuration management module is responsible for generating the configuration file ntp. And the configuration management module monitors the NTP-SOURCE table, and if the table is found not to exist in the database, the management interface is used as a SOURCE interface, and ntp.conf is generated according to a preset template, wherein the template is a default template. If the table is found to exist in the database or the table is changed, the information in the table is taken out. If the acquired information is the interface name (namely the name of the SOURCE interface device written in the NTP _ SOURCE table before), the acquired interface is used as the SOURCE interface, ntp.conf is generated according to a preset template, the state of the SOURCE interface is marked as active, and after the ntp.conf is generated, the NTP _ CONF _ DONE table is created in the database. And if the acquired information is the IP address, the acquired IP address is used as a source IP address, ntp.conf is generated according to a preset template, the state of the source IP address is marked as active, and after the ntp.conf is generated, an NTP _ CONF _ DONE table is created in the database.
The execution module is responsible for starting the ntp service according to the configuration. The execution module monitors the NTP _ CONF _ DONE table created by the configuration management module. Reading the NTP _ SOURCE table after monitoring that the NTP _ CONF _ DONE table is changed, acquiring SOURCE interface or SOURCE IP address information, acquiring vrf information according to the SOURCE interface or SOURCE IP address information, and directly starting an NTP service if the acquired vrf information is null; and if the obtained vrf information is not null, creating corresponding cgroup equipment based on a cgroup mechanism provided by kernel, and binding the ntp service to the cgroup equipment for starting.
In some embodiments, obtaining the source interface device name and the virtual routing and forwarding information from the first information table, and determining whether the virtual routing and forwarding information is null based on the source interface device name includes:
in response to the first information table containing the source interface device name, searching whether a corresponding interface information table exists in the database based on the source interface device name;
in response to the existence of the corresponding interface information table, checking whether the corresponding interface information table has an IP address;
and responding to the IP address of the corresponding interface information table, acquiring corresponding virtual route forwarding information from the first information table, and judging whether the corresponding virtual route forwarding information is empty or not.
In some embodiments, obtaining the source IP address and the virtual routing forwarding information from the first information table, and determining whether the virtual routing forwarding information is null based on the source IP address comprises:
responding to the first information table containing the source IP address, acquiring the source IP address from the first information table, and searching whether a corresponding interface information table exists in the database based on the source IP address;
and responding to the existence of the corresponding interface information table, acquiring corresponding virtual route forwarding information from the first information table based on the source interface equipment name in the corresponding interface information table, and judging whether the corresponding virtual route forwarding information is empty or not.
In one embodiment, the execution module is responsible for initiating the ntp service according to the configuration. The module preconfigures NTP services and starts the services by monitoring the NTP _ CONF _ DONE table created by the configuration management module. The specific execution operation is as follows:
1) And after the initialization of the execution module is completed, monitoring the NTP _ CONF _ DONE table.
2) If the NTP _ CONF _ DONE table does not exist, the NTP service is directly started.
3) If the NTP _ CONF _ DONE table exists, data in the NTP _ SOURCE table is acquired.
4) And if the data acquired from the NTP-SOURCE table is the name of the SOURCE INTERFACE equipment, inquiring whether a corresponding INTERFACE table exists in a database according to the name of the SOURCE INTERFACE equipment. Taking the name of the source INTERFACE device as Loopback0 as an example, inquiring whether an INTERFACE | Loopback0 table exists or not, and if not, returning an error; if yes, checking whether the Loopback0 has an IP address, and if not, returning an error; if yes, whether vrf related configuration exists in the table is inquired, and if not, ntp service is directly started; if Vrf is configured, taking Vrf1 as an example, creating a cgroup device corresponding to Vrf1, performing initialization setting, binding the ntp service to the device after the setting is completed, and starting, at this time, the ntp service will use the first IP address of the interface as the source IP address to communicate with the ntp server.
5) And if the data acquired from the NTP-SOURCE table is an IP address (namely a SOURCE IP address), inquiring whether a corresponding INTERFACE table exists in the database according to the SOURCE IP address. Taking the source IP address as 1.1.1.1 as an example, inquiring whether an INTERFACE |1.1.1.1 table exists or not, if not, returning an error; if yes, taking INTERFACE | Loopback0|1.1.1.1 as an example, inquiring whether vrf related configuration exists in INTERFACE | Loopback0 corresponding to the table, and if not, directly starting ntp service; if Vrf is configured, taking Vrf1 as an example, creating a cgroup device corresponding to Vrf1, performing initialization setting, and binding ntp service to the device to start after the setting is completed.
In some embodiments, monitoring a real-time status of a source interface or a source IP address configured by the network time synchronization tool and virtual route forwarding in the database to update the database in real-time comprises:
monitoring a virtual route forwarding information table and a three-layer interface information table in the database;
responding to the change of the virtual routing forwarding information table and/or the three-layer interface information table, acquiring a corresponding interface device name and a corresponding operation from the three-layer interface information table, correspondingly modifying the source interface device name or the source IP address and the virtual routing forwarding information in the first information, and resetting network time synchronization service, wherein the operation comprises any one of adding the interface device into a corresponding virtual network route, removing the interface device from the corresponding virtual network route, and deleting the virtual network route.
In one embodiment, the monitor module is responsible for monitoring the ntp configured interface and the real-time status of vrf, and completing the update of the database. Take the configured source interface Loopback0, IP address 1.1.1.1 as an example. This module triggers a reset operation by listening to the VRF TABLE and INTF _ TABLE TABLEs in the database.
When the monitoring module receives a message which comprises the name of the interface device operated in the INTF _ TABLE TABLE and the corresponding operation SET when the Loopback0 is added into the Vrf1, the monitoring module modifies the Vrf information in the NTP _ SOURCR into { "Vrf _ name": vrf1"} and resets the NTP service.
When the Loopback0 is moved out of the Vrf1, the monitoring module receives a message, the message includes the interface device name operated in the INTF _ TABLE TABLE and the corresponding operation SET, modifies the Vrf information in the NTP _ SOURCR to { "Vrf _ name": global "}, and resets the NTP service.
When Vrf1 is deleted, the monitoring module receives a message of a VRF table, the message comprises the Vrf name operated in the VRF table and the corresponding operation DEL, the Vrf where the current NTP is located is checked, if the current NTP is deleted Vrf, vrf information in NTP _ SOURCR is modified into { "Vrf _ name": global "}, and NTP service is reset.
In some embodiments, writing information related to configuring a network time synchronization tool to the first information table comprises:
writing said information related to configuring the network time synchronization tool to said first information table by command.
In a specific embodiment, a configuration issuing module deployed on a switch writes a SOURCE interface name or a SOURCE IP address of an NTP to be configured and vrf into a database NTP _ SOURCE table through a command or a corresponding configuration file, where the SOURCE interface and the SOURCE IP address can only be set to one type, and the interface supports any one or more of a management interface, a service interface, a portchannel interface, a vlan interface, and a loopback interface.
In some embodiments, the configuration issuing module is further configured to save the database to an operation configuration file of a network operating system of a server, and save the operation configuration file to a start configuration file of the network operating system.
In a specific embodiment, the configuration of ntp is maintained in running-config (running configuration file) of the network operating system through the configuration issuing module, and then running-config is saved in startup-config (starting configuration file) through a related command for executing configuration saving. Therefore, the system is ensured to be reinstalled, and after the system is restarted, the subsequent modules can automatically configure the ntp service according to the ntp part in the startup-config configuration.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 3, an embodiment of the present invention further provides a method for configuring a network time synchronization tool based on a switch, including:
s10, a configuration issuing module creates a first information table in a database and writes information related to a configuration network time synchronization tool into the first information table, wherein the information comprises a source interface device name or a source IP address of an access switch and virtual route forwarding information;
s20, the configuration management module monitors the first information table, responds to the change of the first information table, and acquires a source interface device name or a source IP address in the first information table;
s30, the configuration management module generates a configuration file required by the network time synchronization tool according to the source interface device name or the source IP address and a preset template, and creates a second information table in the database after the configuration file is generated;
s40, the execution module monitors the second information table, responds to the change of the second information table, and acquires the source interface equipment name or the source IP address and the virtual routing forwarding information from the first information table;
s50, the execution module judges whether the virtual routing forwarding information is empty or not based on the source interface device name or the source IP address, and correspondingly starts a network time synchronization service based on the configuration file based on a judgment result;
s60, the monitoring module monitors a source interface or a source IP address configured by the network time synchronization tool in the database and the real-time state forwarded by the virtual router so as to update the database in real time.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 4, the embodiment of the present invention further provides a computer device 30, in which the computer device 30 comprises a processor 310 and a memory 320, the memory 320 stores a computer program 321 that can run on the processor, and the processor 310 executes the program to perform the steps of the above method.
The memory, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for configuring a network time synchronization tool based on a switch in the embodiments of the present application. The processor executes various functional applications and data processing of the device by running nonvolatile software programs, instructions and modules stored in the memory, namely, the method for configuring the network time synchronization tool based on the switch of the above method embodiment is realized.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the device, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and such remote memory may be coupled to the local module via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 5, an embodiment of the present invention further provides a computer-readable storage medium 40, where the computer-readable storage medium 40 stores a computer program 410, which when executed by a processor, performs the above method.
Finally, it should be noted that, as will be understood by those skilled in the art, all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a read-only memory (ROM), or a Random Access Memory (RAM). The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. Furthermore, although elements of the embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A system for configuring a network time synchronization facility based on a switch, comprising:
the system comprises a configuration issuing module, a configuration management module, an execution module and a monitoring module;
the configuration issuing module is configured to create a first information table in a database and write information related to configuring a network time synchronization tool into the first information table, wherein the information comprises a source interface device name or a source IP address of an access switch and virtual route forwarding information;
the configuration management module is configured to monitor the first information table, and respond to the change of the first information table to acquire a source interface device name or a source IP address in the first information table;
the configuration management module is also configured to generate a configuration file required by the network time synchronization tool according to the source interface device name or the source IP address and a preset template, and create a second information table in the database after the configuration file is generated;
the execution module is configured to monitor the second information table, and in response to a change of the second information table, obtain the source interface device name or the source IP address and the virtual routing forwarding information from the first information table;
the execution module is further configured to determine whether the virtual routing forwarding information is empty based on the source interface device name or the source IP address, and accordingly start a network time synchronization service based on the configuration file based on a determination result;
the monitoring module is configured to monitor a source interface or a source IP address configured by the network time synchronization tool in the database and a real-time status forwarded by a virtual router so as to update the database in real time.
2. The system of claim 1, wherein initiating a network time synchronization service based on the profile based on the determination comprises:
in response to the virtual route forwarding information not being empty, creating a corresponding cgroup device based on the virtual route forwarding information, and binding a network time synchronization service to the cgroup device to start the network time synchronization service at the cgroup device based on the configuration file;
and responding to the condition that the virtual route forwarding information is empty, and starting network time synchronization service based on the configuration file.
3. The system of claim 1, wherein obtaining the source interface device name and the virtual routing forwarding information from the first information table, and determining whether the virtual routing forwarding information is null based on the source interface device name comprises:
in response to the first information table containing the source interface device name, searching whether a corresponding interface information table exists in the database based on the source interface device name;
in response to the existence of the corresponding interface information table, checking whether the corresponding interface information table has an IP address;
and responding to the IP address of the corresponding interface information table, acquiring corresponding virtual route forwarding information from the first information table, and judging whether the corresponding virtual route forwarding information is empty or not.
4. The system of claim 1, wherein obtaining the source IP address and the virtual routing forwarding information from the first information table, and determining whether the virtual routing forwarding information is empty based on the source IP address comprises:
responding to the first information table containing the source IP address, acquiring the source IP address from the first information table, and searching whether a corresponding interface information table exists in the database based on the source IP address;
and responding to the existence of the corresponding interface information table, acquiring corresponding virtual route forwarding information from the first information table based on the source interface equipment name in the corresponding interface information table, and judging whether the corresponding virtual route forwarding information is empty or not.
5. The system of claim 1, wherein monitoring the real-time status of the source interface or source IP address and virtual route forwarding configured by the network time synchronization tool in the database to update the database in real-time comprises:
monitoring a virtual route forwarding information table and a three-layer interface information table in the database;
responding to the change of the virtual routing forwarding information table and/or the three-layer interface information table, acquiring a corresponding interface device name and a corresponding operation from the three-layer interface information table, correspondingly modifying the source interface device name or the source IP address and the virtual routing forwarding information in the first information, and resetting network time synchronization service, wherein the operation comprises any one of adding the interface device into a corresponding virtual network route, removing the interface device from the corresponding virtual network route, and deleting the virtual network route.
6. The system of claim 1, wherein writing information related to configuring a network time synchronization tool to the first information table comprises:
writing said information related to configuring the network time synchronization tool to said first information table by command.
7. The system of claim 1, wherein the configuration issuing module is further configured to save the database to a running configuration file of a network operating system of a server and save the running configuration file to a starting configuration file of the network operating system.
8. A method for configuring a network time synchronization facility based on a switch, comprising:
the method comprises the steps that a configuration issuing module creates a first information table in a database and writes information related to a configuration network time synchronization tool into the first information table, wherein the information comprises a source interface equipment name or a source IP address of an access switch and virtual route forwarding information;
a configuration management module monitors the first information table and responds to the change of the first information table to acquire a source interface device name or a source IP address in the first information table;
the configuration management module generates a configuration file required by the network time synchronization tool according to the source interface device name or the source IP address and a preset template, and creates a second information table in the database after the configuration file is generated;
the execution module monitors the second information table, responds to the change of the second information table, and acquires the source interface equipment name or the source IP address and the virtual routing forwarding information from the first information table;
the execution module judges whether the virtual routing forwarding information is empty or not based on the source interface equipment name or the source IP address, and correspondingly starts network time synchronization service based on the configuration file based on the judgment result;
and the monitoring module monitors a source interface or a source IP address configured by the network time synchronization tool in the database and the real-time state forwarded by the virtual router so as to update the database in real time.
9. A computer device, comprising:
at least one processor; and
memory storing a computer program operable on the processor, wherein the processor executes the program to perform the steps of the method according to claim 8.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method as claimed in claim 8.
CN202210763586.1A 2022-06-30 2022-06-30 System, method, equipment and medium for configuring network time synchronization tool Active CN115174374B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210763586.1A CN115174374B (en) 2022-06-30 2022-06-30 System, method, equipment and medium for configuring network time synchronization tool

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210763586.1A CN115174374B (en) 2022-06-30 2022-06-30 System, method, equipment and medium for configuring network time synchronization tool

Publications (2)

Publication Number Publication Date
CN115174374A true CN115174374A (en) 2022-10-11
CN115174374B CN115174374B (en) 2023-08-22

Family

ID=83488421

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210763586.1A Active CN115174374B (en) 2022-06-30 2022-06-30 System, method, equipment and medium for configuring network time synchronization tool

Country Status (1)

Country Link
CN (1) CN115174374B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110995496A (en) * 2019-12-15 2020-04-10 苏州浪潮智能科技有限公司 Method and device for synchronizing time of white box switch in batches
CN114172799A (en) * 2021-12-08 2022-03-11 武汉大塔技术有限公司 Method, system and medium for realizing NTP client rapid configuration deployment based on DHCP

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110995496A (en) * 2019-12-15 2020-04-10 苏州浪潮智能科技有限公司 Method and device for synchronizing time of white box switch in batches
CN114172799A (en) * 2021-12-08 2022-03-11 武汉大塔技术有限公司 Method, system and medium for realizing NTP client rapid configuration deployment based on DHCP

Also Published As

Publication number Publication date
CN115174374B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
WO2023098645A1 (en) Container network configuration method and apparatus, computing node, master node, and storage medium
CN109032755B (en) Container service hosting system and method for providing container service
WO2022127420A1 (en) Service choreography and deployment method and system, network device, and storage medium
CN109981493B (en) Method and device for configuring virtual machine network
CN109462511B (en) Network establishing method and device
CN112367211A (en) Method, device and storage medium for generating configuration template by device command line
CN107645402A (en) A kind of route management method and device
CN109218462B (en) IP distribution method of physical host of cloud data center
US10693731B2 (en) Flow entry management method and device
CN115174374A (en) System, method, device and medium for configuring network time synchronization tool
CN111654559A (en) Container data transmission method and device
CN111769992B (en) Network data management method, cloud platform and storage medium
US11979307B2 (en) Network switching method and apparatus, electronic device, and storage medium
CN111988446B (en) Message processing method and device, electronic equipment and storage medium
CN102291313A (en) Method, device and equipment for finding virtual router redundancy protocol (VRRP) network topology
CN110311803B (en) Method and device for realizing software defined network, computer equipment and storage medium
JP5782393B2 (en) Network resource distributed management method and program
CN112379845B (en) Cluster capacity expansion method and device, computing equipment and storage medium
CN114422280B (en) Network deployment method, device, node and storage medium
CN113810230B (en) Method, device and system for carrying out network configuration on containers in container cluster
CN113328871B (en) Configuration method and device for signaling acquisition and storage medium
CN116366370B (en) Asymmetric communication method, system, storage medium and communication equipment
CN114095370B (en) Policy configuration method, device, equipment and storage medium
JP4412078B2 (en) Network management device, relay device, network management system, and network management program
CN113542192B (en) Illegal network equipment access detection method and device, computing equipment and storage medium

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