WO2012070341A1 - 通信端末、該通信端末の制御方法、及びプログラム - Google Patents

通信端末、該通信端末の制御方法、及びプログラム Download PDF

Info

Publication number
WO2012070341A1
WO2012070341A1 PCT/JP2011/074068 JP2011074068W WO2012070341A1 WO 2012070341 A1 WO2012070341 A1 WO 2012070341A1 JP 2011074068 W JP2011074068 W JP 2011074068W WO 2012070341 A1 WO2012070341 A1 WO 2012070341A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
server
data
response packet
servers
Prior art date
Application number
PCT/JP2011/074068
Other languages
English (en)
French (fr)
Inventor
昌修 小野塚
哲也 岩本
Original Assignee
セイコープレシジョン株式会社
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 セイコープレシジョン株式会社 filed Critical セイコープレシジョン株式会社
Publication of WO2012070341A1 publication Critical patent/WO2012070341A1/ja

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/28Timers or timing mechanisms used in protocols

Definitions

  • the present invention relates to a communication terminal that performs time adjustment by network communication, a control method of the communication terminal, and a program.
  • NTP Network Time Protocol
  • the time server is usually hierarchized on the network, and the time server of the lower layer performs time adjustment of the internal clock by referring to the upper time server.
  • the time server of the second layer performs time adjustment with reference to the time server of the first layer.
  • the time server of the first layer performs time adjustment of the internal clock by referring to the global positioning system (hereinafter referred to as GPS).
  • GPS global positioning system
  • Patent Documents 1 and 2 disclose a method of selecting a time server from which time information is acquired.
  • Patent Document 1 the IP address and priority of a time server are registered in a communication terminal.
  • the communication terminal selects a time server from which time information is acquired according to the priority order.
  • Patent Document 1 does not disclose a specific method for setting the priority order of time servers.
  • a communication terminal makes a response request to a network by broadcast transmission, and selects a time server with a quick response as an acquisition destination of time information.
  • the first layer time server accurately adjusts the time by referring to GPS or the like.
  • a time lag occurs due to the passage of time after the time adjustment.
  • the time server of the second layer refers to the time server of the first layer and performs time adjustment, it takes over the error that has occurred in the time server of the first layer.
  • the time lag occurs due to the passage of time after the time adjustment.
  • the time server of each hierarchy has a time lag due to the passage of time, and this time lapse is taken over by the lower time server, so that the time accuracy of the lower time server may be lowered. .
  • Patent Document 1 requires time and effort for the user because the priority order and IP address of the time server must be registered in advance in the communication terminal.
  • the present invention has been made in view of the above circumstances, and an object of the present invention is to select a server with high time accuracy as a time information acquisition destination, and it does not require a user's effort for this selection.
  • a communication terminal, a control method for the communication terminal, and a program are provided.
  • a communication terminal provides: The network in which a plurality of servers are connected, a transmission unit for transmitting a request packet, A receiving unit that receives a response packet from the server that has received the request packet through the network; Each time the receiving unit receives the response packet, the storage unit acquires data from the response packet and stores the data; Using a data stored in the storage unit, a selection unit for selecting a candidate to obtain time information from the plurality of servers, The data acquired from the response packet includes a reference source identifier indicating a reference source of time adjustment of the server, The selection unit selects a candidate from which the time information is acquired based on the reference source identifier.
  • the transmission unit transmits the request packet to the network by broadcast transmission.
  • the selection unit sets a priority order of candidates from which the time information is acquired based on the reference source identifier.
  • the data acquired from the response packet includes a synchronization identifier indicating whether or not the server is performing time synchronization
  • the selection unit sets priorities of servers having different reference sources for time adjustment based on the reference source identifier, and sets priorities of servers having the same reference source for time adjustment based on the synchronization identifier. It is characterized by doing.
  • the plurality of servers are hierarchized on the network such that a lower layer server refers to an upper layer server for time adjustment
  • the data acquired from the response packet includes a layer value indicating a layer where the server is located
  • the selection unit selects a priority order of candidates for the time information acquisition source so as to select the upper layer server as a time information acquisition destination in preference to the lower layer server. It is characterized by setting.
  • a time from when the transmission unit transmits the request packet until the reception unit receives the response packet, and a time from when the server receives the request packet to transmission of the response packet When, further comprising a delay time calculation unit for calculating a delay time indicating the difference,
  • the selection unit is configured to set a priority order of candidates to be the time information acquisition destination so that the server having a short delay time is preferentially selected as the time information acquisition destination.
  • the server further includes an internal processing time calculation unit that calculates an internal processing time from when the server receives the request packet until the response packet is transmitted.
  • the selection unit is configured to set a priority order of candidates to be the time information acquisition destination so as to preferentially select a server having a short internal processing time as the time information acquisition destination.
  • a communication terminal control method includes: The network in which a plurality of servers are connected, a transmission step of transmitting a request packet, Receiving a response packet from the server that has received the request packet through the network; Each time the response packet is received in the receiving step, the storage step for obtaining data from the response packet and storing the data; Using the data stored in the storing step, selecting a candidate from which to obtain time information from the plurality of servers, The data acquired from the response packet includes a reference source identifier indicating a reference source of time adjustment of the server, In the selection step, a candidate as an acquisition destination of the time information is selected based on the reference source identifier.
  • the program according to the third aspect of the present invention is: Computer The network in which a plurality of servers are connected, transmitting means for transmitting a request packet, Receiving means for receiving a response packet from the server that has received the request packet through the network; Each time the receiving unit receives the response packet, the storage unit acquires data from the response packet and stores the data. Using the data stored in the storage means, function as a selection means for selecting a candidate to obtain time information from the plurality of servers, The data acquired from the response packet includes a reference source identifier indicating a reference source of time adjustment of the server, The selection unit selects a candidate from which the time information is acquired based on the reference source identifier.
  • a candidate from which time information is acquired is selected from a plurality of servers based on an identifier or the like indicating a reference source for server time adjustment. For this reason, it is possible to select a server with high time accuracy as the acquisition source of time information. By adjusting the time of the communication terminal based on time information acquired from a server with high time accuracy, the time measured by the communication terminal becomes accurate.
  • candidates for obtaining time information are selected using response packet data returned from the server. Therefore, since the time information acquisition source is selected, there is no need to input data into the communication terminal in advance. For this reason, a user's effort is not required.
  • FIG. 6 is a diagram (part 1) illustrating data used for selecting a time information acquisition destination;
  • FIG. 10 is a diagram (part 2) illustrating data used to select a time information acquisition destination;
  • FIG. 10 is a diagram (part 3) illustrating data used to select a time information acquisition source;
  • FIG. 11 is a diagram (part 4) illustrating data used to select a time information acquisition destination; It is a figure which shows the example of a response packet table.
  • FIG. 25 is a diagram illustrating a response packet table in which data illustrated in FIG. 24 is rearranged by a selection unit. It is a figure which shows the response packet table in which the data shown in FIG. 25 were rearranged by the selection part. It is a figure which shows the response packet table in which the data shown in FIG. 26 were rearranged by the selection part. It is a figure which shows the response packet table in which the data shown in FIG. 27 were rearranged by the selection part.
  • FIG. 1 is a block diagram showing a communication system 1 to which a communication terminal according to an embodiment of the present invention is applied.
  • the communication system 1 includes a communication terminal 100, a plurality of time servers 200 to 206, and a network 300.
  • the network 300 is, for example, a LAN (Local Area Network), and the communication terminal 100 and the time servers 200 to 206 can transmit and receive information through the network 300.
  • the information includes time information using a network time protocol (hereinafter referred to as NTP).
  • NTP network time protocol
  • the time servers 200 to 206 periodically refer to other devices and correct the current time measured by the internal clock (hereinafter, correcting the time of the internal clock is referred to as “time adjustment” as appropriate).
  • the time servers 200 to 206 are hierarchized on the network 300, and the lower time servers refer to the upper time servers for time adjustment.
  • Each of the time servers 200 to 202 is a first layer time server.
  • the time server 200 periodically refers to the atomic clock 400 calibrated in accordance with national standards and performs time adjustment (the atomic clock transmits a pulse signal (Pulse-Per-Second (PPS)) every second. In 1, the atomic clock is indicated by “PPS”.)
  • the time server 201 periodically refers to a global positioning system (hereinafter, referred to as GPS) 401 to perform time adjustment.
  • GPS global positioning system
  • the time server 202 performs time adjustment by periodically referring to a standard time supply system (hereinafter, telephone JJY) 402 using a telephone line.
  • telephone JJY standard time supply system
  • Each of the time servers 203 to 205 is a second layer time server.
  • the time servers 203 to 205 periodically request time information from any one of the time servers 200 to 202 in the first layer through the network 300, and based on the time information returned in response to the request, Align.
  • the time server 203 requests time information from the time server 200 and adjusts the time based on the time information returned from the time server 200.
  • the time server 206 is a third layer time server.
  • the time server 206 requests time information from the time server 203 of the second layer through the network 300, and performs time adjustment based on the time information returned in response to the request.
  • the time servers 200 to 206 as time elapses, the time measured by the internal clock is delayed or advanced.
  • the time lag occurring in the time servers 200 to 202 in the first layer is taken over by the time adjustment referring to the time servers 200 to 202 in the first layer. Later, a time lag will occur due to the passage of time.
  • the time lag generated in the time server 203 in the second layer is taken over by the time adjustment referring to the time server 203 in the second layer, and the time elapses after the time adjustment. This causes a time lag. From the above, among the time servers 200 to 206, the time accuracy is lower in the lower time servers.
  • the time accuracy is based on the time server 202 that refers to the telephone JJY 402, the time server 201 that refers to the GPS 401, and the atomic clock 400 based on the accuracy of the time of the time reference source. It becomes higher in order of the time server 200 to be referred to.
  • FIG. 2 is a block diagram illustrating a physical configuration example of the communication terminal 100.
  • the communication terminal 100 includes a control unit 110, a storage unit 120, an input unit 130, an output unit 140, a communication control unit 150, and a time measuring unit 160.
  • the storage unit 120 includes, for example, a ROM (Read Only Memory), a RAM (Random Access Memory), a hard disk, and the like.
  • the storage unit 120 stores an operation program of the control unit 110 such as an NTP daemon program that is time synchronization software.
  • the storage unit 120 functions as a work area for the control unit 110.
  • the input unit 130 includes, for example, a keyboard and a mouse.
  • the input unit 130 receives an operation by a user and supplies operation information to the control unit 110.
  • the output unit 140 is composed of, for example, a display device.
  • the output unit 140 provides output information to the user according to the control of the control unit 110.
  • the communication control unit 150 includes a LAN port, a communication circuit, and the like.
  • the communication control unit 150 is connected to the network 300 and transmits / receives data to / from other devices.
  • the timer 160 has a built-in crystal oscillator, generates a clock pulse synchronized with the oscillation frequency of the crystal oscillator, and counts and outputs the current time in synchronization with the clock pulse.
  • the control unit 110 includes a CPU (Central Processing Unit) and the like, and controls the operation of the entire communication terminal 100 according to a program stored in the storage unit 120.
  • the control unit 110 functions as a system clock that is a clock that operates as software in accordance with a program stored in the storage unit 120, and measures and outputs the current time. Further, the control unit 110 acquires time information from any of the time servers 200 to 206 according to the NTP daemon program, and corrects the current time measured by the time measuring unit 160 and the system clock.
  • a CPU Central Processing Unit
  • FIG. 3 is a block diagram illustrating a functional configuration example of the communication terminal 100.
  • the control unit 110 executes processing in accordance with a program, whereby a transmission unit 500, a reception unit 510, a delay time calculation unit 520, an internal processing time calculation unit 530, a storage unit 540, and a selection unit 550 is configured.
  • the transmission unit 500 transmits a request packet by broadcast transmission to the network 300 at the time of initial setting.
  • FIG. 4 is a diagram illustrating an example of a request packet.
  • the request packet is expressed in NTP and SNTP message formats. This message format is almost the same as the NTP message format described in RFC1305.
  • the numbers in parentheses indicate the number of bits of each code included in the request packet.
  • the number “2” of LI (2) indicates the number of bits of the synchronization identifier “LI (Leap Indicator)”.
  • the codes of LI (2) to accuracy (8) are the values shown in the column immediately below. In the code below the route delay (32), the value of each bit is “0” unless otherwise specified.
  • the destination of the request packet is set to the broadcast address for broadcast transmission.
  • the broadcast address is an address used for transmitting data to all devices connected to the network 300.
  • the private IP address of the network 300 is 172.16. XXX. XXX is set, and 172.31.2555255 is the broadcast address.
  • class C the private IP address of the network 300 is 192.168.48. XXX is set, and 192.168.48.255 is the broadcast address.
  • a class C broadcast address is used.
  • the port number of UDP User (Datagram Protocol) is set to 123.
  • the time servers 200 to 206 return a response packet to the communication terminal 100 through the network 300 in response to receiving the request packet.
  • the time servers 200 to 206 return response packets all at once.
  • the receiving unit 510 (FIG. 3) receives a response packet returned through the network 300 until a predetermined time elapses after the transmitting unit 500 transmits the request packet.
  • the response packet is expressed in the message format shown in FIG. 4 like the request packet.
  • the synchronization identifier “LI (LeapLeIndicator)” is an area used to indicate whether or not leap seconds are inserted or deleted in the last minute of the day.
  • LI LeapLeIndicator
  • 2-bit integers “01” and “10” are written in “LI”, respectively.
  • a 2-bit integer “00” is written in “LI”.
  • “LI” is also an area used to warn that time synchronization is not performed.
  • 2-bit integer “11” indicating that time synchronization is not performed is written in “LI”.
  • “LI” is set to a value of “00” as shown in FIG.
  • the time server performing time synchronization returns a response packet in which the value of “LI” remains “00”.
  • the time server that does not synchronize the time returns a response packet in which the value of “LI” is changed to “11”. Due to the change of the “LI” value, the communication terminal 100 is notified that the time server does not synchronize the time.
  • Mode is an area indicating the source of the packet.
  • the “mode” is set to a value of a 3-bit integer “011” indicating the client.
  • “mode” is changed to a value of a 3-bit integer “100” indicating the server.
  • “Hierarchy” is an area indicating the class level of the local clock.
  • an 8-bit integer corresponding to the layer on the network 300 where the time servers 200 to 206 are located is indicated in “layer”.
  • the response packet returned from the time servers 200 to 202 indicates an 8-bit integer corresponding to the first layer.
  • Reference identifier is an area in which a 32-bit integer corresponding to the time reference source of the time servers 200 to 206 is indicated.
  • the response packet returned from the time server 201 indicates a 32-bit integer corresponding to the GPS 401.
  • Start time stamp is an area in which the time T1 when the communication terminal 100 transmits the request packet is indicated.
  • “Reception time stamp” is an area indicating the time T2 when the time servers 200 to 206 receive the request packet.
  • Transmission time stamp is an area in which the time T3 when the time servers 200 to 206 transmit the response packet is indicated.
  • the times T1, T2, and T3 are expressed in a 64-bit time stamp format.
  • the time T1 is, for example, the time measured by the time measuring unit 160 of the communication terminal 100.
  • Times T2 and T3 are times measured by the internal clocks of the time servers 200 to 206.
  • FIG. 5A to 5D are diagrams showing data used for selecting a time information acquisition source.
  • FIG. 5A shows data acquired from the response packet of the time server 203.
  • FIG. 5B shows data acquired from the response packet of the time server 201.
  • FIG. 5C shows data acquired from the response packet of the time server 202.
  • FIG. 5D shows data acquired from the response packet of the time server 200.
  • data is acquired from the response packet in order to select a time information acquisition destination from the time servers 200 to 206.
  • This data includes the IP addresses of the time servers 200 to 206 and the value of the hierarchy where the time servers 200 to 206 are located (hereinafter referred to as a hierarchy value).
  • the data in FIG. 5A includes a hierarchy value “2”.
  • the layer value “2” indicates the second layer in which the time server 203 is located.
  • the data in FIGS. 5B, 5C, and 5D includes a hierarchical value “1”.
  • the layer value “1” indicates the first layer in which the time servers 201, 202, and 200 are located.
  • the layer value is obtained from an 8-bit integer indicated in the “layer” of the response packet.
  • the data acquired from the response packet also includes a reference source identifier indicating the time reference source of the time servers 200 to 206.
  • the data in FIG. 5A includes the IP address “192.168.48.110” of the time server 200 as a reference source identifier indicating the time reference source (time server 200) of the time server 203.
  • the data in FIG. 5B includes a reference source identifier “GPS” indicating the time reference source (GPS 401) of the time server 201.
  • the data in FIG. 5C includes a reference source identifier “TJJY” indicating the time reference source (telephone JJY 402) of the time server 202.
  • the data in FIG. 5D includes a reference source identifier “PPS” indicating the time reference source (atomic clock 400) of the time server 200.
  • These reference source identifiers are obtained from a 32-bit integer indicated in the “reference source identifier” of the response packet.
  • the data acquired from the response packet includes the time T1 when the communication terminal 100 transmits the request packet, the time T2 when the time servers 200 to 206 receive the request packet, and the time servers 200 to 206 transmit the response packet. Also includes time T3. Times T1, T2, and T3 are obtained from a 64-bit integer indicated by a start time stamp, a reception time stamp, and a transmission time stamp.
  • the delay time calculation unit 520 calculates the delay time d every time the reception unit 510 receives a response packet.
  • the delay time d is calculated by Equation 1 using times T1, T2, and T3 acquired from the response packet and time T4 when the response packet is received by the communication terminal 100.
  • the time T4 is acquired from the time measuring unit 160 of the communication terminal 100 when the response packet is received.
  • the delay time d is the time (T4-T1) from when the transmission unit 500 transmits the request packet until the reception unit 510 receives the response packet, and after the time servers 200 to 206 receive the request packet. , The time until the response packet is transmitted (T3-T2) and the time indicating the difference.
  • the internal processing time calculation unit 530 calculates the internal processing time P every time the receiving unit 510 receives a response packet.
  • the internal processing time P is calculated by Equation 2 using times T2 and T3 acquired from the response packet.
  • the internal processing time P is a time (T3-T2) from when the time servers 200 to 206 receive a request packet until a response packet is transmitted.
  • the storage unit 540 acquires an IP address, a hierarchical value, and a reference source identifier (FIG. 5) from the response packet, and adds a delay time d and an internal processing time P to these data.
  • the data are stored in the storage unit 120 in association with each other.
  • FIG. 6 is a diagram showing an example of a response packet table.
  • the response packet table is created by the storage unit 540 storing data each time the reception unit 510 receives a response packet.
  • data IP address / layer value / reference source identifier
  • each response packet is arranged in the order of reception, and each of these data is associated with a delay time d and an internal processing time P.
  • the selection unit 550 uses the response packet table to select candidates from which time information is acquired from the time servers 200 to 206, and sets the priorities of these candidates. This process is performed by the following first to fourth procedures.
  • the response packet table of FIG. 6 is created will be described as an example.
  • the response packet table data is rearranged.
  • the data is rearranged so that data with a small hierarchical value is higher.
  • FIG. 7 shows a response packet table in which the data shown in FIG. 6 is rearranged by the first procedure of the selection unit 550.
  • the data (B, C, D) of the time servers 201, 202, and 200 whose hierarchy value is “1” are arranged at the upper level, and the time servers 203 and 200 whose hierarchy value is “2” are below them.
  • Data 205, 204 (A, E, G) are arranged.
  • data (F) of the time server 206 whose layer value is “3” are arranged below.
  • data (B, C, D) having a hierarchical value “1” is rearranged based on the reference source identifier.
  • FIG. 8 shows a response packet table in which the data shown in FIG. 7 is rearranged by the second procedure of the selection unit 550.
  • the data are rearranged so that the data (C) having “TJJY” is located.
  • the data in the response packet table is rearranged based on the delay time d and the internal processing time P.
  • FIG. 9 shows a response packet table in which the data shown in FIG. 8 is rearranged by the third procedure of the selection unit 550.
  • the third procedure rearranges data having the same layer value and reference source identifier, and rearranges data so that data with a short delay time d is higher.
  • the order of the data E and G is reversed. This is because the data E and G are both subject to rearrangement because the hierarchical value is “2” and the reference source identifier is “192.168.48.5”. Since the delay time d of the data E is long, the order is reversed.
  • the data is rearranged so that the data having the shorter internal processing time P is higher if necessary.
  • This rearrangement is necessary when the internal processing time P needs to be more important than the delay time d in order to determine the order of data.
  • the internal processing time P needs to be more important than the delay time d in order to determine the order of data.
  • the hierarchical value and the reference source identifier are the same. Compared to other data, there is a case where there is data in which the internal processing time P is different by one digit or more in units of microseconds.
  • the priority order of data whose internal processing time P exceeds a predetermined threshold may be lowered. That is, not all the data rearranged by the delay time d is rearranged uniformly in the order of the small internal processing time P, but only data whose internal processing time P exceeds a preset threshold value, You may make it rearrange so that a priority may fall. This makes it possible to effectively lower the priority of data having an extremely long internal processing time P while placing importance on the delay time d, rather than focusing on only one of the delay time d and the internal processing time P. It becomes possible.
  • the data C whose delay time d is 1900 ⁇ sec is located above the data A whose delay time d is 1800 ⁇ sec.
  • the data C and A are arranged without changing the order from the table of FIG. This is because, unlike data C, there is no other data having a hierarchical value of “1” and a reference source identifier of “TJJY”, so that data C is subject to sorting in the third procedure. Because it was excluded from.
  • a selection table is created using the response packet table rearranged by the first to third procedures, and stored in the storage unit 120.
  • FIG. 10 is a diagram illustrating an example of the selection table.
  • IP addresses included in the top n data of the response packet table are described.
  • the IP addresses included in the top 6 data are described in the response packet table of FIG.
  • These IP addresses are arranged according to the order of the response packet table of FIG.
  • the selection table in FIG. 10 indicates that the time servers 200 to 205 can be selected as the time information acquisition destination.
  • the selection table indicates the priority order for selecting the time server by the order of arrangement of the IP addresses.
  • the table in FIG. 10 indicates that the priority order increases in the order of the time server 205, the time server 204, the time server 203, the time server 202, the time server 201, and the time server 200. This priority order is set as a result of data rearrangement according to the first to third procedures.
  • the priority order of the time server is set based on the reference source identifier by executing the second procedure.
  • the priority is set in the order of the time server 201 that is “GPS” and the time server 200 that has the reference source identifier “PPS”.
  • the priority order is set based on the hierarchy value so that the upper layer time server is selected in preference to the lower layer time server by executing the first procedure.
  • the priority is set in the order of the time servers 203 to 205 of the second layer and the time servers 200 to 202 of the first layer according to the first procedure.
  • the priority order is set so that a time server having a short delay time d and internal processing time P is preferentially selected by executing the third procedure.
  • the time server 204 having a delay time d of 4900 ⁇ sec (G in FIG. 9) is more than the time server 205 having a delay time d of 5000 ⁇ sec (E in FIG. 9) by the third procedure.
  • the priority is set higher.
  • the number of data items included in the selection table created by the selection unit 550 may be a preset number of cases, for example, rearranged like the number of data items whose hierarchical value is smaller than “2”. The determination may be made based on various information included in the data of the response packet table.
  • the NTP daemon is activated and the time of the time measuring unit 160 and the system clock is adjusted. Specifically, the time request packet is transmitted to the address indicated in the selection table of FIG. By this transmission, time information indicating the time of the internal clock is returned from the time servers 200 to 206, and the time of the time measuring unit 160 of the communication terminal 100 is corrected to the time indicated by the time information.
  • the selection table includes a plurality of IP addresses
  • a time request packet is transmitted to the IP address listed at the top in the selection table, and a response is made accordingly.
  • the time of the time measuring unit 160 and the like is corrected based on the time information.
  • a time request packet is transmitted to “192.168.48.110”
  • the time information is returned from the time server 200, and the time is corrected based on this time information.
  • the time request packet may be transmitted to all IP addresses in the selection table or to the top n IP addresses.
  • time information is returned from a plurality of time servers, and an average value of times indicated by these time information is calculated by a procedure according to NTP described in detail in RFC1305, and time is measured to the average value.
  • the time of the part 160 etc. is corrected.
  • time information is returned from the time servers 200 to 205, and the time is corrected to an average value obtained from these time information.
  • the average value of the time information calculated at this time is not limited to the simple average of a plurality of time servers, and the time information from the time server having a higher priority is more important.
  • a load average may be taken and calculated.
  • FIG. 11 is a flowchart showing an example of the operation of the communication terminal 100.
  • the process shown in FIG. 11 is started, for example, when the user operates the input unit 130 (FIG. 2).
  • the NTP daemon is being activated, the NTP daemon is temporarily stopped by the user operation.
  • the transmission unit 500 transmits a request packet by broadcast transmission to the network 300 (step S101).
  • the receiving unit 510 determines whether or not a response packet has been received from any of the time servers 200 to 206 (step S102).
  • step S102 If it is determined that a response packet has been received (step S102; YES), a response packet table storage process is executed (step S103).
  • FIG. 12 is a flowchart showing an example of the response packet table storage process.
  • the delay time calculation unit 520 calculates the delay time d using the times T1 to T4 according to the above equation 1 (step S201).
  • the internal processing time calculation unit 530 calculates the internal processing time P using the times T2 and T3 according to the above equation 2 (step S202).
  • the storage unit 540 associates the delay time d and the internal processing time P with the response packet data (IP address / hierarchy value / reference source identifier) (step S203) and stores it in the storage unit 120 (step S204). ).
  • step S103 after step S103 is executed or when it is determined in step S102 that a response packet has not been received (step S102; NO), the receiving unit 510 receives the request packet in step S101. It is determined whether a predetermined time has elapsed since the transmission (step S104).
  • step S104 If it is determined that the predetermined time has not elapsed (step S104; NO), the receiving unit 510 returns the process to step S102.
  • step S103 is executed.
  • the response packet data is stored in the storage unit 120 in the order of reception, whereby the response packet table shown in FIG. 6 is created.
  • step S104 If it is determined in step S104 that a predetermined time has elapsed (step S104; YES), a response packet table rearrangement process is executed (step S105).
  • FIG. 13 is a flowchart illustrating an example of a response packet table rearrangement process.
  • the first to third procedures by the selection unit 550 described above are executed (steps S301 to S303).
  • steps S301 to S303 the response packet table data is rearranged based on the layer value, the reference source identifier, the delay time d, and the internal processing time P.
  • step S106 selection table storage processing is executed (step S106).
  • FIG. 14 is a flowchart showing an example of the selection table storage process.
  • the fourth procedure by the selection unit 550 described above is executed.
  • IP addresses included in the top n pieces of data are acquired (step S401).
  • the IP address acquired in step S401 is stored in the storage unit 120 (step S402), and the selection table shown in FIG. 10 is created and stored.
  • step S107 the NTP daemon is restarted (step S107).
  • a time request packet is transmitted to the address indicated in the selection table (FIG. 10).
  • the time of the time measuring unit 160 is corrected based on the time information returned in response thereto.
  • a candidate for obtaining time information is selected from the time servers 200 to 206 based on an identifier indicating the time reference source of the time servers 200 to 206.
  • the communication terminal 100 can select a time server with high time accuracy that uses the atomic clock 400, the GPS 401, the telephone JJY 402, and the like as a reference source as a time information acquisition source, and these time servers transmit the time information.
  • the time of the communication terminal 100 is adjusted based on the time information. Therefore, the time measured by the communication terminal 100 is accurate.
  • candidates for obtaining time information are selected using response packet data returned from the time servers 200 to 206. Therefore, it is not necessary to input data for performing processing for selecting a time information acquisition source to the communication terminal 100 in advance. For this reason, a user's effort is not required.
  • the priority order for selecting the time information acquisition destination is set based on the reference source identifier and the like.
  • the time server 200 with high time accuracy is reliably referred to, and the time of the communication terminal 100 is adjusted. For this reason, the time measured by the communication terminal 100 becomes even more accurate.
  • Priority is set based on the hierarchy value so that the upper time server is selected with priority over the lower time server. Therefore, the time of the communication terminal 100 is adjusted by referring to an upper time server with high time accuracy.
  • Priority is set so that a time server with a short internal processing time P or delay time d is selected with priority.
  • a time server that responds quickly is selected as the time information acquisition destination, and therefore the time interval at which the communication terminal 100 refers to the time server to adjust the time is shortened. Therefore, the time measured by the time measuring unit 160 of the communication terminal 100 is such that the deviation due to the passage of time is suppressed to be small, which is advantageous in making the time of the time measuring unit 160 accurate at all times.
  • the communication terminal 100 may be configured to function as a time server that provides time information to other devices. That is, the communication terminal 100 may be configured to receive a request packet transmitted from another device via the network 300 and return a response packet to the other device that transmitted the request packet in response to the reception. good.
  • the request packet may be transmitted to the network 300 by broadcast transmission periodically at an appropriate time interval other than at the time of initial setting. In this case, each time a new response packet is received, the data in the selection table is updated.
  • the candidates for time information acquisition destination and the priority order for selecting the time information acquisition destination may be set based only on the reference source identifier.
  • the delay time d and the internal processing time P are not calculated, and the response packet table created by the storage unit 540 is as shown in FIG.
  • the selection unit 550 sorts the data in the response packet table based on the reference source identifier.
  • the data in the response packet table is as shown in FIG. 16, for example.
  • the data rank is data A, E, F, G with the reference source identifier “IP address”, data C with the reference source identifier “TJJY”, and data with the reference source identifier “GPS”.
  • B the data is rearranged so as to increase in the order of data D whose reference source identifier is “PPS”.
  • the selection unit 550 acquires the top n IP addresses in the response packet table.
  • a selection table shown in FIG. 17 is created.
  • the table of FIG. 17 is obtained by acquiring the top three IP addresses of the response packet table.
  • the time servers 200 to 202 having the atomic clock 400, the GPS 401, and the telephone JJY 402 as reference sources can be selected as the time information acquisition destination.
  • the priority order of the time servers 200 to 202 is set so that the time server 202, the time server 201, and the time server 200 increase in this order.
  • the data of the selection table can be transformed into the format shown in FIG.
  • data is written in the ntp.conf file format.
  • the ntp.conf file is a setting file for the NTP daemon, which describes the specification of the time server to be referred to, the polling interval, the setting of access control, and the like, and optional parameters such as minpoll, maxpoll, and preference are added.
  • FIG. 19 is a block diagram showing another communication system 2 to which the communication terminal of the present invention is applied.
  • the communication system 2 is different from the communication system 1 of FIG. 1 in that the time reference source of the time server 200 is different, and the time server 200 refers to the GPS 401 and performs time adjustment periodically like the time server 201.
  • the response packet table created by the storage unit 540 is as shown in FIG. .
  • a synchronization identifier is associated with the IP address / reference source identifier.
  • the synchronization identifier is obtained by acquiring a 2-bit integer of “LI” (FIG. 4) of the response packet, and indicates whether or not time synchronization is performed in the time servers 200 to 206.
  • the synchronization identifier “11” is indicated. This means that the time server 201 has not temporarily synchronized the time when transmitting the response packet.
  • the synchronization identifier “00” is indicated in the data of other time servers (data other than B). This means that other time servers are performing time synchronization when transmitting the response packet.
  • the selection unit 550 rearranges the data in the response packet table according to the following first and second procedures.
  • the data in the response packet table is rearranged based on the reference source identifier.
  • the response packet table is as shown in FIG. 21, for example.
  • the data ranks are data A, E, F, and G whose reference source identifier is “IP address”, data C whose reference source identifier is “TJJY”, and data whose reference source identifier is “GPS”. D and higher in the order of data B whose reference source identifier is “GPS”.
  • the priority order of time servers with different reference sources for time adjustment is set based on the sequence of the above data. That is, the time servers 203 to 206 use other time servers as time reference sources, and the time server 202 and the time servers 201 and 200 use the telephone JJY 402 and the GPS 401 and 400 as time reference sources, respectively.
  • the reference source of is different.
  • the time servers 203 to 206, the time server 202, and the time servers 200 and 201 are set in order of increasing priority.
  • the selection unit 550 rearranges the data based on the synchronization identifier. This rearrangement targets data B and D having the same reference source identifier, and data D having a synchronization identifier “00” is higher than data B having a synchronization identifier “11”. It is. As a result, the response packet table data is as shown in FIG.
  • the priority order of time servers having the same reference source for time adjustment is set based on the data sequence. That is, the priority order of the time servers 200 and 201 whose reference source for time adjustment is GPS 401 is set to be higher in the order of the time server 201 and the time server 200.
  • the selection unit 550 acquires the top n IP addresses in the response packet table.
  • a selection table shown in FIG. 23 is created.
  • the top three IP addresses of the response packet table are acquired.
  • the time servers 200 to 202 with the GPS 401 and the telephone JJY 402 as reference sources can be selected as the time information acquisition destination.
  • the priority order for selecting the time servers 200 to 202 is set so as to increase in the order of the time server 202, the time server 201, and the time server 200.
  • the priority order of the time servers having the same time synchronization reference source is set based on the synchronization identifier. For this reason, the time server performing time synchronization is selected with priority over the time server not performing time synchronization.
  • the priority order of time servers with the same time reference source and the priority order of time servers with different time reference sources are set together, so that the priority order of time servers with high time accuracy is set. , It can avoid being set low. That is, in the examples of FIGS. 20 to 22, the order of priority is higher in the order of data A, E, F, G, data C, data D, and data B as shown in FIG. It is set to become. In the second procedure, only the data B and D having the same reference source identifier are sorted and sorted based on the synchronization identifier. Therefore, as shown in FIG.
  • the data B and D whose reference source identifier is “GPS” are more than the data C, A, E, F, and G whose reference source identifier is “TJJY” and “IP address”. Don't be subordinate. As described above, it is possible to prevent the time server with high time accuracy from being excluded from the candidates for the time information acquisition destination because the time is not synchronized.
  • data rearrangement by synchronization identifier (data rearrangement shown in FIGS. 15 to 16), and data rearrangement by hierarchical value, reference source identifier, and delay time (data rearrangement shown in FIGS. 6 to 9). It is also possible to execute in combination.
  • the response packet table created by the storage unit 540 is, for example, as shown in FIG.
  • the IP address, the layer value, the synchronization identifier, the reference source identifier, the delay time d, and the internal processing time P are associated with each other.
  • the selection unit 550 rearranges the data in the response packet table based on the hierarchy value.
  • the response packet table is as shown in FIG. In FIG. 25, the data A, E, and G of the hierarchy value 2 are lower than the data B, C, and D of the hierarchy value 1, and the data F of the hierarchy value 3 is lower than the data A, E, and G of the hierarchy value 2.
  • the data is rearranged so that
  • the selection unit 550 rearranges the data whose layer value is “1” based on the reference source identifier.
  • the response packet table is in the state shown in FIG. In FIG. 26, the data C whose reference source identifier is “TJJY” is rearranged below the data D whose reference source identifier is “GPS”.
  • the selection unit 550 sorts data having the same hierarchical value and reference source identifier based on the synchronization identifier.
  • the response packet table is in the state shown in FIG. In FIG. 27, the data B with the synchronization identifier “11” is rearranged below the data D with the synchronization identifier “00”.
  • the selection unit 550 rearranges the data in the response packet table based on the delay time d.
  • the response packet table is in the state shown in FIG. In FIG. 28, the data E having the delay time d of “5000 ⁇ sec” is rearranged below the data G having the delay time d of “4900 ⁇ sec”.
  • the data is rearranged based on the internal processing time P. divide.
  • the means and method for performing various processes in the communication terminal 100 can be realized by either a dedicated hardware circuit or a programmed computer.
  • the program may be provided by a computer-readable recording medium such as a flexible disk or a CD-ROM, or may be provided online via a network such as the Internet.
  • the program recorded on the computer-readable recording medium is normally transmitted to and stored in a storage unit such as a hard disk.
  • the program may be provided as a single application software, or may be incorporated into the software of the device as one function of the device.

Landscapes

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

Abstract

 通信端末(100)は、ネットワーク(300)を通じて、要求パケットを送信し、これに応じてタイムサーバ(200)~(206)から返信される応答パケットを受信する。そして、通信端末(100)は、応答パケットから取得されるデータを用いて、タイムサーバ(200)~(206)の中から、時刻情報の取得先となる候補を選択する。応答パケットから取得するデータは、サーバ(200)~(206)の時刻合わせの参照元を示す参照元識別子を含み、参照元識別子に基づき、時刻情報の取得先となる候補が選択される。

Description

通信端末、該通信端末の制御方法、及びプログラム
 本発明は、ネットワーク通信により時刻合わせを行う通信端末、該通信端末の制御方法、及びプログラムに関する。
 近年、NTP(Network Time Protocol)を用いたネットワーク通信により、タイムサーバから通信端末に時刻情報を提供して、通信端末の時刻合わせを行うシステムが知られてきている。
 このようなシステムでは、通常、タイムサーバはネットワーク上で階層化されて、下層のタイムサーバは、上層のタイムサーバを参照することで、内部時計の時刻合わせを行う。例えば、第2層のタイムサーバは、第1層のタイムサーバを参照して時刻合わせを行う。第1層のタイムサーバは、全地球測位システム(以下、GPS)等を参照することで、内部時計の時刻合わせを行う。
 通信端末は、上記階層化されたタイムサーバのいずれかから、時刻情報を取得して、時刻合わせを行う。特許文献1,2には、時刻情報の取得先となるタイムサーバを選択する方法が開示されている。
 特許文献1では、通信端末に、タイムサーバのIPアドレスや優先順位が登録される。通信端末は、優先順位に従って、時刻情報の取得先となるタイムサーバを選択する。なお、特許文献1では、タイムサーバの優先順位を設定する具体的な方法は開示されていない。
 特許文献2では、通信端末は、ネットワークに対して、ブロードキャスト送信で応答要求を行い、応答が早いタイムサーバを、時刻情報の取得先として選択する。
特開2000-50004号公報 特開2008-79008号公報
 時間の経過とともに、タイムサーバの内部時計が計時する時刻には、遅れや進みが生じる。上記タイムサーバが階層化されたシステムでは、第1層のタイムサーバは、GPS等を参照することで正確に時刻合わせを行う。第1層のタイムサーバでは、時刻合わせの後からの時間経過による時刻の狂いが生じる。第2層のタイムサーバは、第1層のタイムサーバを参照して時刻合わせを行うため、第1層のタイムサーバに生じた狂いを引き継ぐ。さらに第2層のタイムサーバでは、時刻合わせの後からの時間経過による時刻の狂いも生じる。以上のように、各階層のタイムサーバでは時間経過による時刻の狂いが生じ、この狂いが下層のタイムサーバに引き継がれていくことで、下層のタイムサーバほど、時刻精度が低くなる虞れがある。
 しかしながら特許文献1,2では、各階層のタイムサーバ間での時刻精度の差が考慮されることなく、時刻情報の取得先となるタイムサーバが選択される。このため、時刻精度の低いタイムサーバが参照されて、通信端末の時刻合わせが行われる虞れがある。
 また、特許文献1の方法は、タイムサーバの優先順位やIPアドレスが通信端末に予め登録される必要があるため、ユーザの手間を要する。
 本発明は、上記事情に鑑みてなされたものであり、その目的は、時刻情報の取得先として時刻精度の高いサーバを選択することができ、且つ、この選択のためにユーザの手間を要しない通信端末、該通信端末の制御方法、及びプログラムを提供することである。
 本発明の第1の観点に係る通信端末は、
 複数のサーバが接続されたネットワークに対して、要求パケットを送信する送信部と、
 前記要求パケットを受信した前記サーバから、前記ネットワークを通じて、応答パケットを受信する受信部と、
 前記受信部が前記応答パケットを受信するたびに、該応答パケットからデータを取得し、該データを格納する格納部と、
 前記格納部が格納したデータを用いて、前記複数のサーバの中から、時刻情報の取得先となる候補を選択する選択部と、を有し、
 前記応答パケットから取得するデータは、前記サーバの時刻合わせの参照元を示す参照元識別子を含み、
 前記選択部は、前記参照元識別子に基づき、前記時刻情報の取得先となる候補を選択することを特徴とする。
 好ましくは、前記送信部は、ブロードキャスト送信で、前記ネットワークに対して前記要求パケットを送信することを特徴とする。
 好ましくは、前記選択部は、前記参照元識別子に基づき、前記時刻情報の取得先となる候補の優先順位を設定することを特徴とする。
 好ましくは、前記応答パケットから取得するデータは、前記サーバが時刻同期を行っているか否かを示す同期識別子を含み、
 前記選択部は、前記参照元識別子に基づき、前記時刻合わせの参照元が異なるサーバの優先順位を設定し、前記同期識別子に基づき、前記時刻合わせの参照元が同一であるサーバの優先順位を設定することを特徴とする。
 好ましくは、前記複数のサーバは、下層のサーバが上層のサーバを参照して時刻合わせを行うように、前記ネットワーク上で階層化され、
 前記応答パケットから取得するデータは、前記サーバが位置する階層を示す階層値を含み、
 前記選択部は、前記階層値に基づき、前記時刻情報の取得先として前記上層のサーバを前記下層のサーバよりも優先して選択するように、前記時刻情報の取得先となる候補の優先順位を設定することを特徴とする。
 好ましくは、前記送信部が前記要求パケットを送信してから前記受信部が前記応答パケットを受信するまでの時間と、前記サーバが前記要求パケットを受信してから前記応答パケットを送信するまでの時間と、の差分を示す遅延時間を算出する遅延時間算出部をさらに有し、
 前記選択部は、前記時刻情報の取得先として前記遅延時間が短いサーバを優先して選択するように、前記時刻情報の取得先となる候補の優先順位を設定することを特徴とする。
 好ましくは、前記サーバが前記要求パケットを受信してから前記応答パケットを送信するまでの内部処理時間を算出する内部処理時間算出部をさらに有し、
 前記選択部は、前記時刻情報の取得先として前記内部処理時間が短いサーバを優先して選択するように、前記時刻情報の取得先となる候補の優先順位を設定することを特徴とする。
 本発明の第2の観点に係る通信端末の制御方法は、
 複数のサーバが接続されたネットワークに対して、要求パケットを送信する送信ステップと、
 前記要求パケットを受信した前記サーバから、前記ネットワークを通じて、応答パケットを受信する受信ステップと、
 前記受信ステップで前記応答パケットが受信されるたびに、該応答パケットからデータを取得し、該データを格納する格納ステップと、
 前記格納ステップで格納されたデータを用いて、前記複数のサーバの中から、時刻情報の取得先となる候補を選択する選択ステップと、を有し、
 前記応答パケットから取得するデータは、前記サーバの時刻合わせの参照元を示す参照元識別子を含み、
 前記選択ステップでは、前記参照元識別子に基づき、前記時刻情報の取得先となる候補を選択することを特徴とする。
 本発明の第3の観点に係るプログラムは、
 コンピュータを、
 複数のサーバが接続されたネットワークに対して、要求パケットを送信する送信手段、
 前記要求パケットを受信した前記サーバから、前記ネットワークを通じて、応答パケットを受信する受信手段、
 前記受信手段が前記応答パケットを受信するたびに、該応答パケットからデータを取得し、該データを格納する格納手段、
 前記格納手段が格納したデータを用いて、前記複数のサーバの中から、時刻情報の取得先となる候補を選択する選択手段として機能させ、
 前記応答パケットから取得するデータは、前記サーバの時刻合わせの参照元を示す参照元識別子を含み、
 前記選択手段は、前記参照元識別子に基づき、前記時刻情報の取得先となる候補を選択することを特徴とする。
 本発明によれば、時刻情報の取得先となる候補が、サーバの時刻合わせの参照元を示す識別子等に基づき、複数のサーバの中から選択される。このため、時刻情報の取得先として、時刻精度の高いサーバを選択することが可能である。時刻精度の高いサーバから取得される時刻情報に基づき通信端末の時刻合わせが行われることで、通信端末が計時する時刻は、正確になる。
 また、時刻情報の取得先となる候補は、サーバから返信される応答パケットのデータが用いられて選択される。よって、時刻情報の取得先を選択するため、通信端末に予めデータを入力する必要がない。このため、ユーザの手間を要しない。
本発明の実施の形態に係る通信端末が適用された通信システムを示すブロック図である。 通信端末の物理的構成を示すブロック図である。 通信端末の機能構成例を示すブロック図である。 要求パケットの例を示す図である。 時刻情報の取得先を選択するために用いられるデータを示す図(その1)である。 時刻情報の取得先を選択するために用いられるデータを示す図(その2)である。 時刻情報の取得先を選択するために用いられるデータを示す図(その3)である。 時刻情報の取得先を選択するために用いられるデータを示す図(その4)である。 応答パケットテーブルの例を示す図である。 選択部により、図6に示すデータが並び替えられた応答パケットテーブルを示す図である。 選択部により、図7に示すデータが並び替えられた応答パケットテーブルを示す図である。 選択部により、図8に示すデータが並び替えられた応答パケットテーブルを示す図である。 選択テーブルの例を示す図である。 通信端末の動作の一例を示すフローチャートである。 応答パケットテーブル格納処理の一例を示すフローチャートである。 応答パケットテーブル並び替え処理の一例を示すフローチャートである。 選択テーブル格納処理の一例を示すフローチャートである。 応答パケットテーブルの他の例を示す図である。 選択部により、データが並び替えられた応答パケットテーブルを示す図である。 選択テーブルの他の例を示す図である。 選択テーブルの他の例を示す図である。 本発明の通信端末が適用される他の通信システムを示すブロック図である。 応答パケットテーブルの他の例を示す図である。 選択部により、図20に示すデータが並び替えられた応答パケットテーブルを示す図である。 選択部により、図21に示すデータが並び替えられた応答パケットテーブルを示す図である。 選択テーブルの他の例を示す図である。 応答パケットテーブルの他の例を示す図である。 選択部により、図24に示すデータが並び替えられた応答パケットテーブルを示す図である。 選択部により、図25に示すデータが並び替えられた応答パケットテーブルを示す図である。 選択部により、図26に示すデータが並び替えられた応答パケットテーブルを示す図である。 選択部により、図27に示すデータが並び替えられた応答パケットテーブルを示す図である。
 以下、本発明を実施するための形態について図面を参照して詳細に説明する。なお、図中同一または相当する部分には同じ符号を付す。
 図1は、本発明の実施の形態に係る通信端末が適用された通信システム1を示すブロック図である。通信システム1は、通信端末100と、複数のタイムサーバ200~206と、ネットワーク300とを含む。
 ネットワーク300は、例えばLAN(Local Area Network)であり、通信端末100やタイムサーバ200~206は、ネットワーク300を通じて、情報の送受信を行うことができる。上記の情報は、ネットワークタイムプロトコル(以下、NTP)を用いた時刻情報を含む。
 タイムサーバ200~206は、他装置を定期的に参照して、内部時計が計時する現在時刻を補正する(以下、内部時計の時刻を補正することを、「時刻合わせ」と適宜記す)。タイムサーバ200~206は、ネットワーク300上で階層化されており、下層のタイムサーバは、上層のタイムサーバを参照して時刻合わせを行う。
 タイムサーバ200~202は、それぞれ、第1層のタイムサーバである。タイムサーバ200は、国家基準で校正された原子時計400を定期的に参照して時刻合わせを行う(原子時計は1秒ごとのパルス信号(Pulse-Per-Second(PPS))を発信する。図1では、原子時計を「PPS」で示す。)。タイムサーバ201は、全地球測位システム(Global Positioning System、以下、GPS)401を定期的に参照して時刻合わせを行う。タイムサーバ202は、電話回線による標準時供給システム(以下、テレホンJJY)402を定期的に参照して時刻合わせを行う。
 タイムサーバ203~205は、それぞれ、第2層のタイムサーバである。タイムサーバ203~205は、第1層のタイムサーバ200~202のいずれかに対して、ネットワーク300を通じて、定期的に時刻情報を要求し、この要求に応じて返信された時刻情報に基づき、時刻合わせを行う。例えば、タイムサーバ203は、タイムサーバ200に時刻情報を要求し、タイムサーバ200から返信された時刻情報に基づき時刻合わせを行う。
 タイムサーバ206は、第3層のタイムサーバである。タイムサーバ206は、ネットワーク300を通じて、第2層のタイムサーバ203に時刻情報を要求し、この要求に応じて返信された時刻情報に基づき時刻合わせを行う。
 タイムサーバ200~206では、時間の経過とともに、内部時計が計時する時刻に遅れや進みが生じる。第2層のタイムサーバ203~205では、第1層のタイムサーバ200~202を参照した時刻合わせにより、第1層のタイムサーバ200~202に生じた時刻の狂いが引き継がれ、さらに時刻合わせの後に、時間経過による時刻の狂いが生じる。また、第3層のタイムサーバ206では、第2層のタイムサーバ203を参照した時刻合わせにより、第2層のタイムサーバ203で生じた時刻の狂いが引き継がれ、さらに時刻合わせの後に、時間経過による時刻の狂いが生じる。以上のことから、タイムサーバ200~206のうち、下層のタイムサーバほど時刻精度が低い。
 また、第1層のタイムサーバ200~202の間では、時刻精度は、時刻参照元の時刻の正確さから、テレホンJJY402を参照するタイムサーバ202、GPS401を参照するタイムサーバ201、原子時計400を参照するタイムサーバ200、の順に高くなる。
 図2は、通信端末100の物理的構成例を示すブロック図である。通信端末100は、制御部110と、記憶部120と、入力部130と、出力部140と、通信制御部150と、計時部160とを備える。
 記憶部120は、例えば、ROM(Read Only Memory)やRAM(Random Access Memory)やハードディスク等から構成される。記憶部120には、時刻同期ソフトウェアであるNTPデーモンのプログラム等、制御部110の動作プログラムが記憶される。また、記憶部120は、制御部110のワークエリアとして機能する。
 入力部130は、例えば、キーボード、マウス等から構成される。入力部130は、ユーザによる操作を受け付け、操作情報を制御部110に供給する。
 出力部140は、例えば、表示装置等から構成される。出力部140は、制御部110の制御に従い、出力情報をユーザに提供する。
 通信制御部150は、LANポートや通信回路等から構成される。通信制御部150は、ネットワーク300に接続されて、他装置との間でデータの送受信を行う。
 計時部160は、水晶発振器を内蔵し、水晶発振器の発振周波数に同期したクロックパルスを生成し、クロックパルスに同期して、現在時刻を計時して出力する。
 制御部110は、CPU(Central Processing Unit)等から構成され、記憶部120に格納されたプログラムに従って、通信端末100全体の動作を制御する。例えば、制御部110は、記憶部120に格納されたプログラムに従って、ソフトウェア的に動作する時計であるシステムクロックとして機能し、現在時刻を計時して出力する。また、制御部110は、NTPデーモンのプログラムに従って、タイムサーバ200~206のいずれかから時刻情報を取得して、計時部160やシステムクロックが計時する現在時刻を補正する。
 図3は、通信端末100の機能構成例を示すブロック図である。通信端末100では、制御部110がプログラムに従って処理を実行することにより、送信部500と、受信部510と、遅延時間計算部520と、内部処理時間計算部530と、格納部540と、選択部550とが構成される。
 送信部500は、初期設定時に、ネットワーク300に対してブロードキャスト送信で要求パケットを送信する。
 図4は、要求パケットの例を示す図である。要求パケットは、NTP及びSNTPのメッセージフォーマットで表現される。このメッセージフォーマットは、RFC1305で記述されるNTPメッセージフォーマットと、ほぼ同一である。図4において、()内の数字は、要求パケットに含まれる各コードのビット数を示す。例えば、LI(2)の数字「2」は、同期識別子「LI(Leap Indicator)」のビット数を示す。LI(2)~精度(8)のコードは、直下の欄に示す値である。ルート遅延(32)以下のコードは、特に後述しない場合、各ビットの値が「0」である。
 要求パケットの宛先は、ブロードキャスト送信のため、ブロードキャストアドレスに設定される。ブロードキャストアドレスは、ネットワーク300に接続された全ての機器にデータを送信するために使われるアドレスである。例えば、クラスBでは、ネットワーク300のプライベートIPアドレスは、172.16.XXX.XXXと設定され、172.31.255.255がブロードキャストアドレスとなる。また、クラスCでは、ネットワーク300のプライベートIPアドレスは、192.168.48.XXXと設定され、192.168.48.255がブロードキャストアドレスとなる。本実施の形態では、クラスCのブロードキャストアドレスが用いられる。また、要求パケットでは、UDP(User Datagram Protocol)のポート番号が、123番に設定される。
 タイムサーバ200~206は、要求パケットを受信することに応じて、ネットワーク300を通じて、応答パケットを通信端末100に返信する。要求パケットがブロードキャスト送信されることで、タイムサーバ200~206は、応答パケットを一斉に返信する。受信部510(図3)は、送信部500が要求パケットを送信してから所定時間が経過するまでの間に、ネットワーク300を通じて返信された応答パケットを受信する。応答パケットは、要求パケットと同様、図4に示すメッセージフォーマットで表現される。
 図4に示すフォーマットにおいて、同期識別子「LI(Leap Indicator)」は、当日の最終分に、閏秒の挿入や削除があるか否かを示すために用いられる領域である。閏秒の挿入や削除がある場合、「LI」には、それぞれ、2ビット整数「01」、「10」が記される。閏秒の挿入や削除が無い通常の場合、「LI」には、2ビット整数「00」が記される。また、「LI」は、時刻の同期が行われていないことを警告するために使用される領域でもある。時刻の同期が行われていない場合、「LI」には、時刻の同期が行われていないことを示す2ビット整数「11」が記される。
 通信端末100から送信される要求パケットでは、図4に示すように、「LI」は、「00」の値に設定される。タイムサーバ200~206のうち、時刻の同期を行っているタイムサーバは、「LI」の値が「00」のままである応答パケットを返信する。
 一方、時刻の同期を行っていないタイムサーバは、「LI」の値を「11」に変更した応答パケットを返信する。この「LI」値の変更により、タイムサーバで時刻の同期が行われていないことが通信端末100に通知される。
 「モード」は、パケットの送信元を示す領域である。要求パケットでは、図4に示すように、「モード」は、クライアントを示す3ビット整数「011」の値に設定される。応答パケットでは、「モード」は、サーバを示す3ビット整数「100」の値に変更される。
 「階層」は、ローカル時計の階級レベルを示す領域である。タイムサーバ200~206から返信される応答パケットでは、タイムサーバ200~206が位置するネットワーク300上の階層に対応する8ビット整数が「階層」に示される。例えば、タイムサーバ200~202から返信される応答パケットでは、第1階層に対応する8ビット整数が示される。
 「参照元識別子(Reference Identifier)」は、タイムサーバ200~206の時刻参照元に対応する32ビット整数が示される領域である。例えば、タイムサーバ201から返信される応答パケットでは、GPS401に対応する32ビット整数が示される。
 「開始タイムスタンプ」は、通信端末100が要求パケットを送信した時刻T1が示される領域である。
 「受信タイムスタンプ」は、タイムサーバ200~206が要求パケットを受信した時刻T2が示される領域である。
 「送信タイムスタンプ」は、タイムサーバ200~206が応答パケットを送信した時刻T3が示される領域である。
 なお、「開始タイムスタンプ」、「受信タイムスタンプ」、及び「送信タイムスタンプ」では、時刻T1,T2,T3は、64ビットタイムスタンプ形式で表現される。時刻T1は、例えば通信端末100の計時部160が計時した時刻である。時刻T2,T3は、タイムサーバ200~206の内部時計が計時した時刻である。
 図5A~図5Dは、時刻情報の取得先を選択するために用いられるデータを示す図である。図5Aは、タイムサーバ203の応答パケットから取得されるデータを示す。図5Bは、タイムサーバ201の応答パケットから取得されるデータを示す。図5Cは、タイムサーバ202の応答パケットから取得されるデータを示す。図5Dは、タイムサーバ200の応答パケットから取得されるデータを示す。
 本実施の形態では、タイムサーバ200~206の中から時刻情報の取得先を選択するために、応答パケットからデータが取得される。このデータは、タイムサーバ200~206のIPアドレスや、タイムサーバ200~206が位置する階層の値(以下、階層値)を含む。
 図5Aのデータは、階層値「2」を含む。階層値「2」は、タイムサーバ203が位置する第2層を示す。図5B,図5C,図5Dのデータは、階層値「1」を含む。階層値「1」は、タイムサーバ201,202,200が位置する第1層を示す。階層値は、応答パケットの「階層」に示される8ビット整数から得られる。
 また、応答パケットから取得されるデータは、タイムサーバ200~206の時刻参照元を示す参照元識別子も含む。図5Aのデータは、タイムサーバ203の時刻参照元(タイムサーバ200)を示す参照元識別子として、タイムサーバ200のIPアドレス「192.168.48.110」を含む。図5Bのデータは、タイムサーバ201の時刻参照元(GPS401)を示す参照元識別子「GPS」を含む。図5Cのデータは、タイムサーバ202の時刻参照元(テレホンJJY402)を示す参照元識別子「TJJY」を含む。図5Dのデータは、タイムサーバ200の時刻参照元(原子時計400)を示す参照元識別子「PPS」を含む。これら参照元識別子は、応答パケットの「参照元識別子」に示される32ビット整数から得られる。
 また、応答パケットから取得されるデータは、通信端末100が要求パケットを送信した時刻T1や、タイムサーバ200~206が要求パケットを受信した時刻T2や、タイムサーバ200~206が応答パケットを送信した時刻T3も含む。時刻T1,T2,T3は、開始タイムスタンプ・受信タイムスタンプ・送信タイムスタンプに示される64ビット整数から得られる。
 遅延時間計算部520(図3)は、受信部510が応答パケットを受信するたびに、遅延時間dを算出する。遅延時間dは、応答パケットから取得される時刻T1,T2,T3と、通信端末100に応答パケットが受信された時刻T4とを用いて、式1により算出される。なお、時刻T4は、応答パケット受信の際に、通信端末100の計時部160から取得される。
 遅延時間dは、送信部500が要求パケットを送信してから、受信部510が応答パケットを受信するまでの時間(T4-T1)と、タイムサーバ200~206が、要求パケットを受信してから、応答パケットを送信するまでの時間(T3-T2)と、の差分を示す時間である。
Figure JPOXMLDOC01-appb-M000001
 内部処理時間計算部530は、受信部510が応答パケットを受信するたびに、内部処理時間Pを算出する。内部処理時間Pは、応答パケットから取得される時刻T2,T3を用いて、式2により算出される。内部処理時間Pは、タイムサーバ200~206が、要求パケットを受信してから、応答パケットを送信するまでの時間(T3-T2)である。
Figure JPOXMLDOC01-appb-M000002
 格納部540は、受信部510が応答パケットを受信するたびに、応答パケットからIPアドレス・階層値・参照元識別子(図5)を取得し、これらのデータに遅延時間dや内部処理時間Pを対応付けて、記憶部120に格納する。
 図6は、応答パケットテーブルの例を示す図である。応答パケットテーブルは、受信部510が応答パケットを受信するたびに、格納部540がデータを格納することで作成される。応答パケットテーブルでは、各応答パケットに含まれるデータ(IPアドレス・階層値・参照元識別子)が受信順に並べられて、これらデータの各々に、遅延時間dや内部処理時間Pが対応付けられる。
 選択部550は、応答パケットテーブルを用いて、タイムサーバ200~206の中から、時刻情報の取得先となる候補を選択して、これら候補の優先順位を設定する。この処理は、後述の第1~4の手順により行われる。以下、図6の応答パケットテーブルが作成された場合を例に説明する。
 第1~3の手順では、応答パケットテーブルのデータが並び替えられる。第1の手順では、階層値の小さいデータが上位となるように、データが並べ替えられる。
 図7は、選択部550の第1の手順により、図6に示すデータが並び替えられた応答パケットテーブルを示す。図7のテーブルでは、階層値が「1」であるタイムサーバ201,202,200のデータ(B,C,D)が上位に並び、その下位に階層値が「2」であるタイムサーバ203,205,204のデータ(A,E,G)が並んでいる。また、その下位に階層値が「3」であるタイムサーバ206のデータ(F)が並んでいる。
 ついで、第2の手順では、参照元識別子に基づき、階層値が「1」であるデータ(B,C,D)が並び替えられる。
 図8は、選択部550の第2の手順により、図7に示すデータが並び替えられた応答パケットテーブルを示す。第2の手順では、参照元識別子が「PPS」であるデータ(D)が最も上位となり、その下に参照元識別子が「GPS」であるデータ(B)が位置し、その下に参照元識別子が「TJJY」であるデータ(C)が位置するように、データが並び替えられる。
 ついで、第3の手順では、遅延時間dや内部処理時間Pに基づき、応答パケットテーブルのデータが並び替えられる。
 図9は、選択部550の第3の手順により、図8に示すデータが並び替えられた応答パケットテーブルを示す。第3の手順は、階層値及び参照元識別子が同一であるデータを並び替えるものであり、遅延時間dが小さいデータが上位になるように、データが並び替えられる。図9のテーブルを、図8のテーブルと比較すると、データE,Gの順位が逆転している。これは、データE,Gは、いずれも階層値が「2」であり、且つ参照元識別子が「192.168.48.5」であるため並び替えの対象とされ、また、データGに比してデータEの遅延時間dが長いため、順位が逆転されたものである。
 また、遅延時間dによるデータの並び替えが行われた後、必要に応じて、内部処理時間Pが小さいデータが上位になるように、データの並べ替えが行われる。この並べ替えを要する場合は、データの順位を定めるために、内部処理時間Pを遅延時間dよりも重視する必要が生じた場合である。具体的には、要求パケットを受信したタイムサーバの処理能力に関連して、応答パケットテーブルの中に、内部処理時間Pが極端に長いデータが存在する場合や、階層値及び参照元識別子が同一である他のデータに比べて、内部処理時間Pが、μ秒単位で一桁以上異なるデータが存在する場合が該当する。このような場合、上記の内部処理時間Pによるデータの並べ替えを行うことで、内部処理時間Pが極端に長いデータの優先順位を下げること等が可能になる。例えば、応答パケットテーブルが図9の状態のときに、内部処理時間Pが小さいデータが上位となるよう、データが並べ替えられると、応答パケットテーブルは、図8の状態に戻る。
 なお、遅延時間dによるデータの並び替えが行われた後、内部処理時間Pが所定の閾値を超えたデータの優先順位を下げるようにしてもよい。すなわち、遅延時間dによる並び替えが行われたデータのすべてが、内部処理時間Pが小さい順序で一律に並べ替えられるのではなく、内部処理時間Pが予め設定された閾値を超えたデータのみ、優先順位が下がるように並べ替えられるようにしてもよい。これにより、遅延時間dと内部処理時間Pとのいずれか一方のみを重視するのではなく、遅延時間dを重視しつつ、内部処理時間Pが極端に長いデータの優先順位を有効に下げることが可能になる。
 また、図8のテーブルでは、遅延時間dが1900μ秒であるデータCが、遅延時間dが1800μ秒であるデータAよりも上に位置している。そして、図9のテーブルでは、図8のテーブルから順序が変更されることなく、データC,Aが並んでいる。これは、データCのように、階層値が「1」であり、且つ参照元識別子が「TJJY」である他のデータが存在しなかったため、データCは、第3の手順で並び替えの対象から除外されたことによる。
 ついで、第4の手順では、第1~3の手順により並び替えが行われた応答パケットテーブルを用いて、選択テーブルが作成されて、記憶部120に記憶される。
 図10は、選択テーブルの例を示す図である。選択テーブルには、応答パケットテーブルの上位n件のデータに含まれるIPアドレスが記される。図10の例では、図9の応答パケットテーブルで上位6件のデータに含まれるIPアドレスが記される。また、これらIPアドレスは、図9の応答パケットテーブルの順序に従って並ぶ。図10の選択テーブルは、時刻情報の取得先として、タイムサーバ200~205が選択可能であることを示す。また、選択テーブルは、タイムサーバを選択する優先順位を、IPアドレスの並び順により示す。図10のテーブルは、タイムサーバ205、タイムサーバ204、タイムサーバ203、タイムサーバ202、タイムサーバ201、タイムサーバ200の順に、優先順位が高くなることを示す。この優先順位は、第1~3の手順によるデータの並び替えが行われた結果、設定されたものである。
 つまり、選択テーブルでは、第2の手順が実行されたことで、タイムサーバの優先順位が、参照元識別子に基づき設定されている。図10の例は、第2の手順により、参照元識別子が「IPアドレス」である第2層のタイムサーバ203~205、参照元識別子が「TJJY」であるタイムサーバ202、参照元識別子が「GPS」であるタイムサーバ201、参照元識別子が「PPS」であるタイムサーバ200の順に、優先順位が高くなるよう設定されている。
 また、選択テーブルでは、第1の手順が実行されたことで、上層のタイムサーバが下層のタイムサーバよりも優先して選択されるように、階層値に基づき優先順位が設定されている。図10の例は、第1の手順により、第2層のタイムサーバ203~205、第1層のタイムサーバ200~202の順に、優先順位が高くなるよう設定されている。
 また、選択テーブルでは、第3の手順が実行されたことで、遅延時間dや内部処理時間Pが短いタイムサーバが優先して選択されるように、優先順位が設定されている。図10の例は、第3の手順により、遅延時間dが4900μ秒(図9のG)であるタイムサーバ204が、遅延時間dが5000μ秒(図9のE)であるタイムサーバ205よりも、優先順位が高くなるよう設定されている。
 なお、選択部550が作成する選択テーブルに含まれるデータの件数は、予め設定された件数であってもよいし、例えば階層値が「2」より小さいデータの件数のように、並べ替えられた応答パケットテーブルのデータに含まれる種々の情報に基づいて決定されてもよい。
 選択部550による処理の後、NTPデーモンが起動して、計時部160やシステムクロックの時刻合わせが行われる。具体的には、図10の選択テーブルに示されるアドレス宛に、時刻要求パケットが送信される。この送信により、タイムサーバ200~206から内部時計の時刻を示す時刻情報が返信されて、該時刻情報が示す時刻に、通信端末100の計時部160等の時刻が修正される。
 なお、図10のように、選択テーブルに複数のIPアドレスが含まれる場合には、例えば、選択テーブルで最も上位に記されるIPアドレス宛に、時刻要求パケットが送信され、これに応じて返信される時刻情報に基づき、計時部160等の時刻が修正される。図10の例では、「192.168.48.110」宛に時刻要求パケットが送信されることで、タイムサーバ200から時刻情報が返信され、この時刻情報に基づき時刻が修正される。このようにすることで、最も時刻精度の高いタイムサーバ200から送信される時刻情報に基づき、通信端末100の時刻合わせが行われる。
 あるいは、選択テーブルの全てのIPアドレス宛、又は上位n件のIPアドレス宛に、時刻要求パケットが送信されてもよい。この場合、複数のタイムサーバから時刻情報が返信されることになり、これら時刻情報の示す時刻の平均値が、RFC1305に詳述されるNTPに則った手順で算出されて、該平均値に計時部160等の時刻が修正される。図10の例で、全てのIPアドレス宛に時刻要求パケットが送信された場合、タイムサーバ200~205から時刻情報が返信され、これら時刻情報から得られる平均値に、時刻が修正される。なお、このとき算出される時刻情報の平均値は、複数のタイムサーバについて単純平均がとられて算出されることに限らず、優先順位が高いタイムサーバからの時刻情報ほど重視されるように、荷重平均がとられて算出されてもよい。
 図11は、通信端末100の動作の一例を示すフローチャートである。図11に示す処理は、例えば、ユーザが入力部130(図2)を操作することで開始される。なお、NTPデーモンが起動中である際には、上記ユーザの操作により、NTPデーモンは一旦停止される。
 まず、送信部500は、ネットワーク300に対して、ブロードキャスト送信で、要求パケットを送信する(ステップS101)。
 ついで、受信部510は、タイムサーバ200~206のいずれかから応答パケットを受信したか否かを判断する(ステップS102)。
 応答パケットを受信したと判断された場合には(ステップS102;YES)、応答パケットテーブル格納処理が実行される(ステップS103)。
 図12は、応答パケットテーブル格納処理の一例を示すフローチャートである。
 この処理では、まず、遅延時間計算部520が、上記式1により、時刻T1~T4を用いて遅延時間dを算出する(ステップS201)。
 ついで、内部処理時間計算部530が、上記式2により、時刻T2,T3を用いて内部処理時間Pを算出する(ステップS202)。
 ついで、格納部540は、応答パケットのデータ(IPアドレス・階層値・参照元識別子)に、遅延時間dや内部処理時間Pを対応付けて(ステップS203)、記憶部120に記憶する(ステップS204)。
 図11に戻り、ステップS103が実行された後、或いは、ステップS102で応答パケットが受信されていないと判断された場合には(ステップS102;NO)、受信部510は、ステップS101で要求パケットが送信されてから、所定の時間が経過したか否かを判断する(ステップS104)。
 所定の時間が経過してないと判断された場合(ステップS104;NO)、受信部510は、処理をステップS102に戻す。
 この復帰により、タイムサーバ200~206のいずれかから応答パケットが受信されるたび、ステップS103が実行される。この結果、応答パケットのデータが受信順に記憶部120に記憶されることで、図6に示す応答パケットテーブルが作成される。
 ステップS104で、所定の時間が経過したと判断された場合には(ステップS104;YES)、応答パケットテーブルの並び替え処理が実行される(ステップS105)。
 図13は、応答パケットテーブルの並び替え処理の一例を示すフローチャートである。このテーブル並び替え処理では、上述した選択部550による第1~3の手順が実行される(ステップS301~S303)。ステップS301~S303により、応答パケットテーブルのデータが、階層値、参照元識別子、遅延時間d、及び内部処理時間Pに基づき並べ替えられる。
 図11に戻り、ステップS105の実行後では、選択テーブル格納処理が実行される(ステップS106)。
 図14は、選択テーブル格納処理の一例を示すフローチャートである。選択テーブル格納処理では、上述した選択部550による第4の手順が実行される。まず、第1~3の手順でデータの並び替えが行われた応答パケットテーブルにおいて、上位n件のデータに含まれるIPアドレスが取得される(ステップS401)。ついで、ステップS401で取得されたIPアドレスが記憶部120に記憶されることで(ステップS402)、図10に示す選択テーブルが作成・記憶される。
 図11に戻り、ステップS106の後では、NTPデーモンが再起動される(ステップS107)。このNTPデーモンの起動により、選択テーブル(図10)に示されるアドレス宛に、時刻要求パケットが送信される。ついで、これに応じて返信された時刻情報に基づき、計時部160の時刻が修正される。
 本実施の形態によれば、タイムサーバ200~206の中から、時刻情報の取得先となる候補が、タイムサーバ200~206の時刻参照元を示す識別子等に基づき選択される。このため、通信端末100は、時刻情報の取得先として、原子時計400、GPS401、及びテレホンJJY402等を参照元とする時刻精度の高いタイムサーバを選択することが可能であり、これらタイムサーバが送信する時刻情報に基づき通信端末100の時刻合わせを行う。従って、通信端末100が計時する時刻は、正確になる。
 また、時刻情報の取得先となる候補は、タイムサーバ200~206から返信される応答パケットのデータが用いられて選択される。よって、時刻情報の取得先を選択する処理を行うためのデータを、通信端末100に予め入力しておく必要がない。このため、ユーザの手間を要しない。
 要求パケットがブロードキャスト送信でネットワーク300に対して送信されることで、ネットワーク300に接続されたタイムサーバ200~206の全てが、応答パケットを通信端末100に送信する。よって、時刻精度の高いタイムサーバが、応答パケットの未送信(要求パケットの未受信)により、時刻情報の取得先の候補から除外されることを防止できる。
 また、時刻情報の取得先を選択するための優先順位が、参照元識別子等に基づき設定される。この優先順位に従い時刻情報の取得先が選択されることで、確実に時刻精度の高いタイムサーバ200が参照されて、通信端末100の時刻合わせが行われる。このため、通信端末100が計時する時刻は、より一層正確になる。
 また、上層のタイムサーバが下層のタイムサーバよりも優先して選択されるように、階層値に基づき優先順位が設定される。よって、時刻精度の高い上層のタイムサーバが参照されて、通信端末100の時刻合わせが行われる。
 また、内部処理時間Pや遅延時間dが短いタイムサーバが優先して選択されるように、優先順位が設定される。これにより、時刻情報の取得先として応答の早いタイムサーバが選択されるため、通信端末100がタイムサーバを参照して時刻合わせを行う時間間隔は短くなる。よって、通信端末100の計時部160が計時する時刻は、時間経過による狂いが小さく抑えられたものになり、計時部160の時刻を、常時、正確にする上で有利になる。
 本発明は、上述の実施の形態に限定されず、特許請求の範囲において種々改変することができる。
 例えば、通信端末100は、他の装置に時刻情報を提供するタイムサーバとして機能するように構成されてもよい。すなわち、通信端末100は、ネットワーク300を通じて、他の装置が送信した要求パケットを受信し、この受信に応じて、要求パケットを送信した他の装置に、応答パケットを返信するように構成されてもよい。
 また、要求パケットは、初期設定時以外にも適当な時間間隔で定期的に、ネットワーク300に対してブロードキャスト送信で送信されるようにしてもよい。この場合、新たな応答パケットが受信されるたびに、選択テーブルのデータが更新される。
 また、時刻情報の取得先となる候補や、時刻情報の取得先を選択するための優先順位は、参照元識別子のみに基づき設定されてもよい。この場合、遅延時間d及び内部処理時間Pは算出されず、格納部540により作成される応答パケットテーブルは、例えば図15に示すようになる。
 そして、選択部550が、応答パケットテーブルのデータを、参照元識別子に基づき並べ替える。この結果、応答パケットテーブルのデータは、例えば図16に示すようになる。図16では、データの順位が、参照元識別子が「IPアドレス」であるデータA,E,F,G、参照元識別子が「TJJY」であるデータC、参照元識別子が「GPS」であるデータB、参照元識別子が「PPS」であるデータDの順に高くなるよう、データが並べ替えられている。
 そして、選択部550が、応答パケットテーブルの上位n件のIPアドレスを取得する。この結果、例えば図17に示す選択テーブルが作成される。図17のテーブルは、応答パケットテーブルの上位3件のIPアドレスが取得されたものである。図17のテーブルによれば、原子時計400・GPS401・テレホンJJY402を参照元とするタイムサーバ200~202が、時刻情報の取得先として選択可能とされる。また、タイムサーバ200~202の優先順位が、タイムサーバ202、タイムサーバ201、タイムサーバ200の順に高くなるように設定される。
 また、選択テーブルのデータは、図18に示す形式に変形され得る。図18の例では、データがntp.confファイル形式で記されている。ntp.confファイルは、NTPデーモンの設定ファイルであり、参照するタイムサーバの指定やポーリング間隔、アクセス制御の設定などが記述され、minpoll,maxpoll,preferなどのオプションパラメータが付加される。
 また、図19は、本発明の通信端末が適用される他の通信システム2を示すブロック図である。通信システム2は、図1の通信システム1とは、タイムサーバ200の時刻参照元が異なり、タイムサーバ200は、タイムサーバ201と同様に、GPS401を参照して定期的に時刻合わせを行う。
 図19の通信システム2のように、時刻参照元が共通する複数のタイムサーバ200,201が存在する場合には、格納部540により作成される応答パケットテーブルは、例えば図20に示すようになる。
 図20のテーブルでは、タイムサーバ200,201のデータD,Bに、参照元識別子「GPS」が示される。
 また、IPアドレス・参照元識別子には、同期識別子が対応付けられている。同期識別子は、応答パケットの「LI」(図4)の2ビット整数が取得されたものであり、タイムサーバ200~206で、時刻の同期が行われているか否かを示す。
 タイムサーバ201のデータBでは、同期識別子「11」が示される。これは、タイムサーバ201が、応答パケットを送信する際に、一時的に時刻の同期を行っていなかったことを意味する。
 一方、他のタイムサーバのデータ(B以外のデータ)では、同期識別子「00」が示される。これは、他のタイムサーバが、応答パケットを送信する際に、時刻の同期を行っていたことを意味する。
 応答パケットテーブルが作成された後では、選択部550が、以下の第1,2の手順により、応答パケットテーブルのデータを並べ替える。
 まず、第1の手順では、応答パケットテーブルのデータが、参照元識別子に基づき並べ替えられる。この結果、応答パケットテーブルは、例えば、図21に示すようになる。図21では、データの順位が、参照元識別子が「IPアドレス」であるデータA,E,F,G、参照元識別子が「TJJY」であるデータC、参照元識別子が「GPS」であるデータD、参照元識別子が「GPS」であるデータBの順に高くなっている。
 図21のテーブルでは、上記データの並びにより、時刻合わせの参照元が異なるタイムサーバの優先順位が、設定されている。つまり、タイムサーバ203~206は、他のタイムサーバを時刻の参照元とし、タイムサーバ202とタイムサーバ201,200は、それぞれテレホンJJY402とGPS401,400を時刻の参照元にしているため、それぞれ時刻の参照元が異なる。図21のテーブルでは、タイムサーバ203~206、タイムサーバ202、タイムサーバ200,201の順に、優先順位が高くなるよう設定されている。
 なお、参照元識別子が「GPS」であるデータB,Dは、図20の上下の位置関係を継承し、図20と同様、データBが、データDよりも上位に並んでいる。
 ついで、第2の手順では、選択部550は、同期識別子に基づきデータを並べ替える。この並べ替えは、参照元識別子が同一であるデータB,Dを対象とするものであり、同期識別子が「00」であるデータDが、同期識別子が「11」であるデータBよりも上位とされる。この結果、応答パケットテーブルのデータは、図22に示すようになる。
 図22のテーブルは、データの並びにより、時刻合わせの参照元が同一であるタイムサーバの優先順位が設定されている。すなわち、時刻合わせの参照元がGPS401であるタイムサーバ200,201の優先順位が、タイムサーバ201、タイムサーバ200の順に高くなるよう設定されている。
 ついで、選択部550は、応答パケットテーブルの上位n件のIPアドレスを取得する。この結果、例えば図23に示す選択テーブルが作成される。図23のテーブルでは、応答パケットテーブルの上位3件のIPアドレスが取得されている。図23のテーブルによれば、GPS401やテレホンJJY402を参照元とするタイムサーバ200~202が、時刻情報の取得先として選択可能とされる。また、タイムサーバ200~202を選択する優先順位が、タイムサーバ202、タイムサーバ201、タイムサーバ200の順に、高くなるように設定される。
 以上の処理によれば、時刻合わせの参照元が同一であるタイムサーバの優先順位が、同期識別子に基づき設定される。このため、時刻同期を行っているタイムサーバが、時刻同期を行っていないタイムサーバよりも、優先して選択される。
 また、時刻合わせの参照元が同一であるタイムサーバの優先順位と、時刻合わせの参照元が異なるタイムサーバの優先順位とが合わせて設定されることで、時刻精度の高いタイムサーバの優先順位が、低く設定されることを回避できる。つまり図20~図22の例では、第1の手順の並べ替えにより、図21に示すように、データA,E,F,G、データC、データD、データBの順に、優先順位が高くなるよう設定される。そして、第2の手順では、参照元識別子が同一であるデータB,Dのみが並べ替えの対象とされて、同期識別子に基づき並べ替えられる。よって図22に示すように、参照元識別子が「GPS」であるデータB,Dは、参照元識別子が「TJJY」や「IPアドレス」であるデータC,A,E,F,Gよりも、下位にならない。以上により、時刻精度の高いタイムサーバが、時刻の同期を行っていないことで、時刻情報の取得先の候補から除外されることを防止できる。
 また、同期識別子によるデータの並び替え(図15~図16に示すデータの並び替え)と、階層値、参照元識別子、及び遅延時間によるデータの並び替え(図6~図9に示すデータの並び替え)とを組み合わせて実行することも可能である。この場合、格納部540により作成される応答パケットテーブルは、例えば、図24に示すようになる。図24の応答パケットテーブルでは、IPアドレス、階層値、同期識別子、参照元識別子、遅延時間d、及び内部処理時間Pが互いに対応付けられている。
 まず、選択部550は、応答パケットテーブルのデータを、階層値に基づき並び替える。この結果、応答パケットテーブルは、図25に示すようになる。図25では、階層値2のデータA,E,Gが階層値1のデータB,C,Dの下位になり、階層値3のデータFが階層値2のデータA,E,Gの下位になるよう、データが並び替えられている。
 ついで、選択部550は、階層値が「1」であるデータを、参照元識別子に基づき並び替える。この結果、応答パケットテーブルは、図26に示す状態になる。図26では、参照元識別子が「TJJY」であるデータCが、参照元識別子が「GPS」であるデータDの下位に並び替えられている。
 ついで、選択部550は、階層値及び参照元識別子が同一であるデータを、同期識別子に基づき並び替える。この結果、応答パケットテーブルは、図27に示す状態になる。図27では、同期識別子が「11」であるデータBが、同期識別子が「00」であるデータDの下位に並び替えられている。
 ついで、選択部550は、応答パケットテーブルのデータを、遅延時間dに基づき並び替える。この結果、応答パケットテーブルは、図28に示す状態になる。図28では、遅延時間dが「5000μ秒」であるデータEが、遅延時間dが「4900μ秒」であるデータGの下位に並び替えられている。
 この後、上述したように、データの順位を定めるために、内部処理時間Pを遅延時間dよりも重視する必要が生じている場合には、内部処理時間Pに基づき、データの並べ替えが行われる。
 また、本実施の形態の通信端末100における各種処理を行う手段および方法は、専用のハードウェア回路、またはプログラムされたコンピュータのいずれによっても実現することが可能である。上記プログラムは、たとえばフレキシブルディスクやCD-ROMなどのコンピュータ読み取り可能な記録媒体によって提供されてもよいし、インターネット等のネットワークを介してオンラインで提供されてもよい。この場合、コンピュータ読み取り可能な記録媒体に記録されたプログラムは、通常、ハードディスク等の記憶部に伝送されて記憶される。また、上記プログラムは、単独のアプリケーションソフトとして提供されてもよいし、装置の一機能としてその装置のソフトウェアに組み込まれてもよい。
 本出願は、2010年11月24日に出願された日本国特許出願2010-261795に基づく。本明細書中に、その明細書、特許請求の範囲、図面全体を参照して取り込むものとする。
 1,2 通信システム
 100 通信端末
 110 制御部
 120 記憶部
 130 入力部
 140 出力部
 150 通信制御部
 160 計時部
 200,201,202,203,204,205,206 タイムサーバ
 300 ネットワーク
 400 原子時計(PPS)
 401 GPS
 402 テレホンJJY
 500 送信部
 510 受信部
 520 遅延時間計算部
 530 内部処理時間計算部
 540 格納部
 550 選択部

Claims (9)

  1.  複数のサーバが接続されたネットワークに対して、要求パケットを送信する送信部と、
     前記要求パケットを受信した前記サーバから、前記ネットワークを通じて、応答パケットを受信する受信部と、
     前記受信部が前記応答パケットを受信するたびに、該応答パケットからデータを取得し、該データを格納する格納部と、
     前記格納部が格納したデータを用いて、前記複数のサーバの中から、時刻情報の取得先となる候補を選択する選択部と、を有し、
     前記応答パケットから取得するデータは、前記サーバの時刻合わせの参照元を示す参照元識別子を含み、
     前記選択部は、前記参照元識別子に基づき、前記時刻情報の取得先となる候補を選択することを特徴とする通信端末。
  2.  前記送信部は、ブロードキャスト送信で、前記ネットワークに対して前記要求パケットを送信することを特徴とする請求項1に記載の通信端末。
  3.  前記選択部は、前記参照元識別子に基づき、前記時刻情報の取得先となる候補の優先順位を設定することを特徴とする請求項1又は2に記載の通信端末。
  4.  前記応答パケットから取得するデータは、前記サーバが時刻同期を行っているか否かを示す同期識別子を含み、
     前記選択部は、前記参照元識別子に基づき、前記時刻合わせの参照元が異なるサーバの優先順位を設定し、前記同期識別子に基づき、前記時刻合わせの参照元が同一であるサーバの優先順位を設定することを特徴とする請求項3に記載の通信端末。
  5.  前記複数のサーバは、下層のサーバが上層のサーバを参照して時刻合わせを行うように、前記ネットワーク上で階層化され、
     前記応答パケットから取得するデータは、前記サーバが位置する階層を示す階層値を含み、
     前記選択部は、前記階層値に基づき、前記時刻情報の取得先として前記上層のサーバを前記下層のサーバよりも優先して選択するように、前記時刻情報の取得先となる候補の優先順位を設定することを特徴とする請求項1乃至4のいずれか1項に記載の通信端末。
  6.  前記送信部が前記要求パケットを送信してから前記受信部が前記応答パケットを受信するまでの時間と、前記サーバが前記要求パケットを受信してから前記応答パケットを送信するまでの時間と、の差分を示す遅延時間を算出する遅延時間算出部をさらに有し、
     前記選択部は、前記時刻情報の取得先として前記遅延時間が短いサーバを優先して選択するように、前記時刻情報の取得先となる候補の優先順位を設定することを特徴とする請求項1乃至5のいずれか1項に記載の通信端末。
  7.  前記サーバが前記要求パケットを受信してから前記応答パケットを送信するまでの内部処理時間を算出する内部処理時間算出部をさらに有し、
     前記選択部は、前記時刻情報の取得先として前記内部処理時間が短いサーバを優先して選択するように、前記時刻情報の取得先となる候補の優先順位を設定することを特徴とする請求項1乃至6のいずれか1項に記載の通信端末。
  8.  複数のサーバが接続されたネットワークに対して、要求パケットを送信する送信ステップと、
     前記要求パケットを受信した前記サーバから、前記ネットワークを通じて、応答パケットを受信する受信ステップと、
     前記受信ステップで前記応答パケットが受信されるたびに、該応答パケットからデータを取得し、該データを格納する格納ステップと、
     前記格納ステップで格納されたデータを用いて、前記複数のサーバの中から、時刻情報の取得先となる候補を選択する選択ステップと、を有し、
     前記応答パケットから取得するデータは、前記サーバの時刻合わせの参照元を示す参照元識別子を含み、
     前記選択ステップでは、前記参照元識別子に基づき、前記時刻情報の取得先となる候補を選択することを特徴とする通信端末の制御方法。
  9.  コンピュータを、
     複数のサーバが接続されたネットワークに対して、要求パケットを送信する送信手段、
     前記要求パケットを受信した前記サーバから、前記ネットワークを通じて、応答パケットを受信する受信手段、
     前記受信手段が前記応答パケットを受信するたびに、該応答パケットからデータを取得し、該データを格納する格納手段、
     前記格納手段が格納したデータを用いて、前記複数のサーバの中から、時刻情報の取得先となる候補を選択する選択手段として機能させ、
     前記応答パケットから取得するデータは、前記サーバの時刻合わせの参照元を示す参照元識別子を含み、
     前記選択手段は、前記参照元識別子に基づき、前記時刻情報の取得先となる候補を選択することを特徴とするプログラム。
PCT/JP2011/074068 2010-11-24 2011-10-19 通信端末、該通信端末の制御方法、及びプログラム WO2012070341A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2010261795A JP2012113504A (ja) 2010-11-24 2010-11-24 通信端末、該通信端末の制御方法、及びプログラム
JP2010-261795 2010-11-24

Publications (1)

Publication Number Publication Date
WO2012070341A1 true WO2012070341A1 (ja) 2012-05-31

Family

ID=46145698

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/074068 WO2012070341A1 (ja) 2010-11-24 2011-10-19 通信端末、該通信端末の制御方法、及びプログラム

Country Status (2)

Country Link
JP (1) JP2012113504A (ja)
WO (1) WO2012070341A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10177979B2 (en) 2015-10-23 2019-01-08 International Business Machines Corporation Non-disruptively splitting a coordinated timing network
US10447532B2 (en) 2015-10-23 2019-10-15 International Business Machines Corporation Non-disruptively merging coordinated timing networks

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6079442B2 (ja) * 2013-05-31 2017-02-15 三菱電機株式会社 時刻同期装置、時刻同期システム及び時刻同期方法
JP7135903B2 (ja) * 2019-02-01 2022-09-13 株式会社デンソー 車両用装置、車両用装置の時刻同期方法

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007101183A (ja) * 2005-09-30 2007-04-19 Seiko Epson Corp 通信システム及び時刻同期方法
JP2008079008A (ja) * 2006-09-21 2008-04-03 Murata Mach Ltd ネットワーク端末

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008080653A (ja) * 2006-09-27 2008-04-10 Oki Data Corp 画像処理装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007101183A (ja) * 2005-09-30 2007-04-19 Seiko Epson Corp 通信システム及び時刻同期方法
JP2008079008A (ja) * 2006-09-21 2008-04-03 Murata Mach Ltd ネットワーク端末

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ASH MULTIMEDIA LAB.: "3 Kizon Network o Kenro ni! Service-betsu Shukutai Kankyo Kochiku Hoho/Un'yo Hoho", SOFTWAREDESIGN, 18 October 2005 (2005-10-18), pages 140 - 151 *
JUN'ICHI TOMARU: "Kumikomi Kiki no Jikoku Doki nimo Tsukaeru AVR Microcomputer to Denpa Tokei o Tsukatta SNTP Server no Seisaku", TRANSISTOR GIJUTSU, vol. 46, no. 1, 1 January 2009 (2009-01-01), pages 255 - 260 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10177979B2 (en) 2015-10-23 2019-01-08 International Business Machines Corporation Non-disruptively splitting a coordinated timing network
US10447532B2 (en) 2015-10-23 2019-10-15 International Business Machines Corporation Non-disruptively merging coordinated timing networks
US10680890B2 (en) 2015-10-23 2020-06-09 International Business Machines Corporation Non-disruptively splitting a coordinated timing network
US11323322B2 (en) 2015-10-23 2022-05-03 International Business Machines Corporation Non-disruptively merging coordinated timing networks

Also Published As

Publication number Publication date
JP2012113504A (ja) 2012-06-14

Similar Documents

Publication Publication Date Title
US10158444B1 (en) Event-driven precision time transfer
Mills et al. Network time protocol version 4: Protocol and algorithms specification
US7191354B2 (en) Method for synchronizing a first clock to a second clock, processing unit and synchronization system
US9372863B2 (en) Method, apparatus and system for updating metadata file
US20200127752A1 (en) Time synchronization device and time synchronization method
US8160835B2 (en) Method for measuring unidirectional transmission characteristics such as packet propagation time, fluctuations in propagation time and results derivable therefrom, in a telecommunications network
JP6343395B2 (ja) Ieee 1588クロックのネットワークにおける動的精度情報の配信
Mills Simple network time protocol (SNTP)
JP2010078529A (ja) 端末装置及びその時刻調整方法
US20100034212A1 (en) Methods and apparatus for providing modified timestamps in a communication system
WO2012070341A1 (ja) 通信端末、該通信端末の制御方法、及びプログラム
JP2006081192A (ja) 複数のデバイスの動作を同期させるためのシステム及び方法
JP2010527193A (ja) ネットワークコンポーネントのクロックを別のネットワークコンポーネントのクロックに同期させる方法及びネットワークコンポーネント
JP4472994B2 (ja) インターネット、イントラネットまたは類似物などの通信ネットワークを介して協調する少なくとも2つの測定コンピュータの時間同期化のための方法
US20150207877A1 (en) Time synchronization client, a system and a non-transitory computer readable medium
CN110932814B (zh) 软件定义的网络授时安全防护方法、装置及系统
JP2012530411A5 (ja)
JP6605863B2 (ja) 電子装置、方法、プログラム、及び保護システム
US11336510B2 (en) Information processing system, information processing method, and non-transitory recording medium
JP6010802B2 (ja) 時刻同期システム、時刻同期方法、スレーブノード及びコンピュータプログラム
JP2015188159A (ja) スレーブノード、時刻同期方法及びコンピュータプログラム
JP2009140150A (ja) 負荷分散装置
US11263112B2 (en) Method and apparatus for evaluating quality of software running environment of device
WO2013082812A1 (zh) 确定主时钟设备的方法、设备、其他方法、设备与系统
JP2008079008A (ja) ネットワーク端末

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11843606

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 1304213

Country of ref document: GB

Kind code of ref document: A

Free format text: PCT FILING DATE = 20110907

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11843606

Country of ref document: EP

Kind code of ref document: A1