GPS time meter, beidou timer, NTP network timer-jingzhun electronic technology

GPS time meter, beidou timer, NTP network timer-jingzhun electronic technology

GPS time meter, beidou timer, NTP network timer-jingzhun electronic technology

Beijing quasi-electronic technology website-ahjzsz.com

With the rapid development of the network and the increasing number of devices, many network applications and network security have put forward urgent needs for the problem of time synchronization. Therefore, the time synchronization solution based on NTP has become a reasonable choice to solve these problems. This article introduces the principle, working mode and system structure of NTP protocol in time synchronization technology, and discusses the application of NTP in campus network in combination with the actual network structure of campus network.

Keywords: time synchronization, network time protocol

1 Introduction:

With the popularity of the network, many units have built their own campus networks, and the network devices and servers used are increasing. These devices have their own clocks and are adjustable. However, there is no guarantee that the time of all devices and hosts on the network are synchronized, because these clocks will produce errors of seconds or even minutes every day. After a long period of operation, the time difference will become larger and larger. This kind of deviation has little effect on a single machine, but it may cause unexpected problems in the application under the network environment. For example, in a distributed computing environment, due to the inconsistency of the time of each host, the recording time of the same operation on different hosts will be inconsistent, and the service will not be able to proceed normally. With the continuous development of various network applications, the requirements for time are getting higher and higher, otherwise it will cause many problems.

2. Overview of time synchronization

The time information (year, month, day, hour, minute, and second) of various devices or hosts in the network environment is limited to a sufficiently small range (such as 100ms) based on UTC (Universal Time Coordinated) time. This synchronization process is called time synchronization ].

At present, there are two important time synchronization technologies, namely Network Time Protocol (NTP) protocol and direct connection time transmission technology. The direct connection time transmission technology requires all clients to be directly connected to the standard time source. NTP is suitable for network environment and can provide accurate and robust time service in a disordered network environment. Here we only discuss the time synchronization technology and application based on NTP principle.

3. Working principle and application of NTP

3.1 Overview of NTP protocol

NTP was first designed and implemented by a professor at the University of Delaware in the United States. It was developed from time protocols, ICMP timestamp messages, and IP timestamp options [2]. NTP is used to synchronize the time of a computer client or server to another server or reference clock source. It uses UTC as the time standard, is an application layer protocol based on the connectionless IP protocol and UDP protocol, and uses a hierarchical time distribution model. The accuracy that can be obtained depends on the accuracy of the local clock hardware and the delay to the device and process. strict control. During configuration, NTP can utilize redundant servers and multiple network paths to obtain high accuracy and reliability of time. In practical applications, there is also a simple network time protocol (SNTP) that ensures second-level accuracy.

Figure 1 is the NTP information in a UDP packet. Among them, LI is the insertion or deletion indication of run seconds; VN is the version number of the NTP protocol; Mode, Stratum and Precision represent the working mode, clock level and local clock accuracy, respectively. Poll is the expected value of the current interval for sending NTP messages. Root Delay represents the total delay of the main reference source. Root Dispersion represents a normal error relative to the main reference source. Synchronizing Distance and Synchronizing Dispersion are the current round-trip delay and the error range relative to PRS. Reference Timestamp represents the type of current clock reference source and the time of the last update, and is established for management purposes. The last three fields represent three timestamps: the time when the sender of the Oriental Timestamp last touched the packet, the time when the receiver received the Timestamp, and the time when the receiver last transmitted the echo reply when the Transmit Timestamp sent the echo reply. Authenticator is the key indicator and encrypted check box.

 

Figure 1: NTP information in UDP packets [4]

3.2. Working principle of NTP

The most critical reason that affects the accuracy of the NTP protocol is the inaccurate calculation of the clock delay caused by the randomness of the network delay. Due to inaccurate delays, it is impossible to rely on unilateral transmission from the time server to the client to deliver accurate time information. To solve this problem, the concept of two-way information exchange and timestamp between the time server and the client is used in the NTP protocol. Figure 2 shows the basic principle for determining delay and offset in this way.
————————————————

3.3. Working mode of NTP

There are three working modes of NTP:

Client / server mode: The client periodically requests time information from the server. The server is used to synchronize the client but cannot be synchronized by the client. The client first sends an NTP packet to the server, which contains the timestamp when the packet left the client. When the server receives the packet, it fills in the timestamp when the packet arrives, the source and destination addresses of the exchanged packet, Fill in the timestamp when the packet left, and then immediately return the packet to the client. When receiving the response packet, the client fills in the timestamp when the packet is returned. The client can use these time parameters to calculate two key parameters: the round-trip delay of packet switching and the clock skew between the client and the server. The client uses the clock offset to adjust the local clock so that its time is consistent with the server time [2].

Active / passive symmetric mode: basically the same as client / server mode. The only difference is that both parties can synchronize or be synchronized by the other party.

Broadcast mode: There is no initiator for synchronization. In each synchronization cycle, the server broadcasts and broadcasts message packets with its own timestamp, and all target nodes passively receive these messages to adjust their time. Generally used in places where the network delay is very small or the time accuracy is not required. As in a local area network, using the broadcast mode can save bandwidth.

3.4. NTP system architecture

NTP uses a hierarchical time distribution model. The network architecture mainly includes the transmission path between the master time server, slave time server, client and each node. The main time server synchronizes with the high-precision time source to provide time services for other nodes. Each client obtains time synchronization from the time server via the main server. Under normal circumstances, nodes (including time servers and clients) only use the most reliable and accurate server and transmission path for synchronization, so the usual synchronization path is a hierarchical structure. Among them, the master time server is located at the root node, and other slave time servers are located on the layer close to the leaf node as the synchronization accuracy increases, and the master and school servers are located at the leaf node. NTP divides the transmission path into an active synchronization path and a backup synchronization path, both of which simultaneously transmit time information packets, but nodes only use the active synchronization path data for synchronization processing [2].

 

Figure 3: An implementation model of the client / server model [3]

In this model, the local clock process: processing the offsets obtained by the correction module and adjusting the phase and frequency of the local clock with a special algorithm in NTP Transmission process: triggered by different timers corresponding to each remote entity to collect information from the database and send NTP messages to the remote entity. Each message includes the local timestamp when it was sent, the last timestamp received, and information used to determine the synchronization network hierarchy and manage the connection. Receiving process: Receive NTP messages and calculate the offset between the remote clock and the local clock. Correction module: deal with the offset between each remote entity and use an algorithm in NTP to select the best one. Local clock process: process the offsets obtained by the correction module and adjust the local clock with a special algorithm in NTP.

4. Application of NTP in campus network

In the campus network of our school, there are a large number of network equipment, servers and hosts, which carry the functions of billing, maintenance, management, etc. in the campus network. The accuracy of time is relatively high, and the information transmitted between the networks can Maintain a high degree of consistency in time.

The application of time synchronization in the campus network mainly focuses on the following aspects:

1. Log audit of the network management system: When malicious attack behavior or network failure occurs in the network, the network administrator needs to analyze and judge based on the logs generated in the relevant network equipment in order to find the source of the attack and the harm caused to the network And the causes. However, if the time cannot be synchronized in the network, the logs generated by the same behavior on different devices cannot be serialized. It is impossible to analyze and solve these problems. In addition, when the network management center adopts multi-point log recording, if the time of each node of the network is not synchronized, it will also cause confusion of log recording. If you need this information for fast and accurate fault location, accurate time is essential [1].

2. Application authentication process: Some application systems in the campus network and the one-card system to be built in the future require time synchronization in the network when performing user authentication. Because the digital time stamping service in authentication requires the client to use the local time as a parameter to exchange authentication information packets with the authentication server. If the time synchronization in the network cannot be achieved, the system will encounter problems, and there may be replay attacks during the authentication process.

3. Time-related application system: The network application system that strictly records the time of data submission must ensure the accuracy and immutability of the submission time. In addition, application systems that perform time-limited operations on clients also require time synchronization.

4. Campus network backup system: Incremental backup between the backup server and the client requires time synchronization between the two systems.

5. Ensure that remote system calls between systems can be made normally: because in order to ensure that a system call will not be repeated, the system call is only valid for a time interval. If the clocks between the systems are not synchronized. The system call may not be performed because of a timeout before it has occurred

6. Billing system: The digital time stamping service is also used in the network billing system, so precise time synchronization is also required.

Various application systems, security systems, and network management systems in the campus network have driven the demand for time synchronization of network equipment and servers. If accurate time synchronization is not possible, we have to spend a lot of time to solve various possible problems.

All in all, time synchronization technology is very important for network management and network applications. In order to ensure the time synchronization between various devices and systems on the campus network, we need to solve three problems: one is to try to select a very accurate time source; the other is to transfer the precise time to the network device or host that needs time service, Ensure that the error is as small as possible during the transmission process. Third, synchronize the time device with absolute time, make full use of the device's respective time calibration mechanism to automatically achieve time synchronization, and try to eliminate manual factors.
————————————————

Guess you like

Origin www.cnblogs.com/yfcs999/p/137881IIEIKJK.html