ZT: Time Protocol

xiaoxiao2021-03-06  41

Time Protocol IT.com.cn (IT World) 2004-14 13:12:00 / This protocol provides an independent site, machine readable date and time information. Time service returns to the number of seconds, which is the number of seconds from January 1, 1900, and the heavens are not small. An important purpose of designing this agreement is that many hosts on the Internet have no time concepts. On distributed systems, we can think about it, how is Beijing time and Tokyo time? The time of the host can often change, and because the error in the machine clock is inconsistent, it is necessary to use the time server to get the network time through the electoral mode, so that the server has an accurate time concept. Don't take a small time, this is a simple program that is running for time standard distribution. This protocol can work under TCP and UDP protocols. Below is a working process of time protocols working through TCP protocol: Here S represents servers, and C represents customers. S: Detection port 37 U: Connect to the port 37 S: Send time with 32-bit binary number U: Receive time u: Close connection S: Close connection This process is not difficult, if the server does not decide what time, the server will refuse Connect or do not send any data to close the connection directly. Let's take a look at the use of the UDP protocol: Here S represents servers, C represents customers. S: Detection Port 37 u: Send an empty data to the port 37 S: Receive this empty datagon S: Send a data report containing 32-bit binary (used to indicate time) U: Receive time dataset is not difficult, If the server can't decide what time is now, the server will abandon the received datagram without any response. Time is represented by 32 points, which is from January 1, 1900 to the current number of seconds. We can calculate it. This agreement can only be used in 2036, but we also know that the computer development speed is so Fast, there may be a better agreement instead of this agreement, or have an effective solution.

http://www.it.com.cn/f/edu/0410/14/35062.htm

转载请注明原文地址:https://www.9cbs.com/read-78341.html

New Post(0)