2.2. System Date and Time

2.2.1. Overview

Correctly setting the date and time is important for cOS Core to operate properly. Time scheduled policies, auto-update of the IDP and Anti-Virus databases, and other product features such as digital certificates require that the system clock is accurately set.

In addition, log messages are tagged with timestamps in order to indicate when a specific event occurred. Not only does this assume a working clock, but also that the clock is correctly synchronized with other equipment in the network.

The Local System Clock

To maintain current date and time, cOS Core makes use of the local hardware platform's real-time hardware clock. On Clavister hardware models, this clock is also equipped with a battery backup to guard against a temporary loss of power.

Methods of Setting the Time

cOS Core provides two methods of setting the time:

  • Setting Manually

    The date and time can be set manually by the administrator. This is described in Section 2.2.2, Setting Date and Time Manually.

  • Setting Automatically Using External Time Servers

    cOS Core supports the use of external time Servers using time synchronization protocols to automatically adjust the local system clock from the response to queries sent over the Internet to these servers. This is described further in Section 2.2.3, Using External Time Servers.

    There are two types of time server that cOS Core can use:

    1. Public Servers - These are servers that can be used by anyone.
    2. Clavister Servers - These are Clavister's own time servers and is the recommended method of setting the date and time.

2.2.2. Setting Date and Time Manually

Current Date and Time

The administrator can set the date and time manually and this is recommended when a new cOS Core installation is started for the first time.

Example 2.21. Setting the Current Date and Time

To adjust the current date and time, follow the steps outlined below:

Command-Line Interface

Device:/> time -set YYYY-mm-DD HH:MM:SS
Where YYYY-mm-DD HH:MM:SS is the new date and time. Note that the date order is year, then month and then day. For example, to set the date and time to 9:25 in the morning on April 27th, 2008 the command would be:
Device:/> time -set 2008-04-27 09:25:00

InControl

Follow similar steps to those used for the Web Interface below.

Web Interface

  1. Go to: System > Device > Date and Time
  2. Click Set Date and Time
  3. Set year, month, day and time via the dropdown controls
  4. Click OK
[Note] Note: A reconfigure is not required

A new date and time will be applied by cOS Core as soon as it is set. There is no need to reconfigure or restart the system.

Time Zones

The world is divided up into a number of time zones with Greenwich Mean Time (GMT) in London at zero longitude being taken as the base time zone. All other time zones going east and west from zero longitude are taken as being GMT plus or minus a given integer number of hours. All locations counted as being inside a given time zone will then have the same local time and this will have an integer hour offset from GMT.

Setting the Location and Enabling Daylight Saving Time (DST)

For cOS Core, the time zone is specified using the Location property of the Date and Time object. cOS Core has a database of all available time zones and the administrator just has to pick a place that matches the system's longitude position.

By default, the Location property is set to a value of ClavisterHQ (in other words, Stockholm time). The DST (daylight saving time) property is also enabled by default which means that the daylight saving rules for the given location will be automatically followed.

The Location property can be changed from the default at any time by the administrator. However, it can also be changed in one of the steps in the Startup Wizard which will run when cOS Core is started up for the first time.

Example 2.22. Setting the Time Zone Location

This example will modify the default cOS Core time zone to be Tokyo:

Command-Line Interface

Device:/> set DateTime Location=Asia/Tokyo

InControl

Follow similar steps to those used for the Web Interface below.

Web Interface

  1. Go to: System > Device > Date and Time
  2. In the Location drop-down list, select Asia/Tokyo
  3. Click OK

2.2.3. Using External Time Servers

cOS Core is able to adjust the system time automatically using information received from one or more external time servers. These servers provide a highly accurate time, usually using atomic clocks. Using time servers is recommended as it ensures cOS Core will have its date and time aligned with other network devices.

Time Synchronization Protocols

Time Synchronization Protocols are standardized methods for retrieving time information from external time servers. cOS Core supports the following such protocols:

  • SNTP

    Defined by RFC-2030, The Simple Network Time Protocol (SNTP) is a lightweight implementation of NTP (RFC-1305). SNTP is used by cOS Core to query time servers. Most public time servers are described as being NTP servers and are accessible using SNTP.

  • UDP/TIME

    The UDP/TIME protocol is an older method of providing time synchronization service over the Internet. The server sends back the time in seconds since midnight on January 1st, 1900.

Methods of Configuring Time Servers

cOS Core provides the ability to configure one of the following two types of time server:

  • The Clavister Time Server

    Clavister operates its own time server which can be used instead of publicly available servers.

  • Custom Time Servers

    Specific time servers can be specified. There are a number of publicly available time servers that can be configured.

Configuring these two types of server is described next.

Configuring the Clavister Time Server

A single property exists to switch on or off usage of the Clavister time server. This is the easiest way of configuring a time server since no other server details need to be specified. cOS Core will find the IP address of the time server by performing a DNS lookup of the time server's FQDN.

Note that at least one external DNS server must be configured in cOS Core so that the FQDN of the Clavister's time server can be resolved.

Example 2.23. Using the Clavister Time Server

To enable the use of the Clavister time server:

Command-Line Interface

Device:/> set DateTime TimeSynchronization=Clavister

InControl

Follow similar steps to those used for the Web Interface below.

Web Interface

  1. Go to: System > Device > Date and Time
  2. Select Clavister (preconfigured timesync server)
  3. Click OK

Configuring Custom Time Servers

cOS Core can be configured to query multiple external time servers. By using more than a single server, situations where an unreachable server causes the time synchronization process to fail can be prevented. cOS Core always queries all configured time servers and then computes an average time based on all responses. Internet search engines can be used to find publicly available time servers.

When specifying the IP address of custom time servers, there are only two ways this can be done:

  • Specify an IPv4 or IPv6 address directly.

  • Specify an FQDN Address object which contains a reference to the server's URL. At least one external DNS server must also be configured in cOS Core to resolve such address objects. This is discussed further in Section 3.1.7, FQDN Address Objects.

Example 2.24. Configuring Custom Time Servers

In this example, time synchronization is set up to use the SNTP protocol to communicate with the time servers at the Swedish National Laboratory for Time and Frequency. The time server URLs are ntp1.sp.se and ntp2.sp.se.

It is assumed that the following FQDN Address objects have already been defined for the URLs:

  • ntp1_fqdn - ntp1.sp.se
  • ntp2_fqdn - ntp2.sp.se

Command-Line Interface

Device:/> set DateTime TimeSynchronization=custom
			TimeSyncServer1=ntp1_fqdn
			TimeSyncServer2=ntp2_fqdn
			TimeSyncInterval=86400

InControl

Follow similar steps to those used for the Web Interface below.

Web Interface

  1. Go to: System > Device > Date and Time
  2. Enable Custom under Time synchronization
  3. Now enter:
    • Time Server Type: SNTP
    • Primary Time Server: ntp1_fqdn
    • Secondary Time Server: ntp2_fqdn
  4. Click OK

Note that the time server URLs must be specified as an FQDN Address object.

Example 2.25. Manually Triggering a Time Synchronization

Time synchronization can be manually triggered from the CLI. The output below shows a typical response.

Command-Line Interface

Device:/> time -sync
Attempting to synchronize system time...

Server time: 2008-02-27 12:21:52 (UTC+00:00)
Local time:  2008-02-27 12:24:30 (UTC+00:00) (diff: 158)

Local time successfully changed to server time.

Maximum Time Adjustment

To avoid situations where a faulty time server causes the clock to be updated with an extremely inaccurate time, a Maximum Adjustment value (in seconds) can be set. If the difference between the current cOS Core time and the time received from a time server is greater than this maximum adjustment value, then the time server response will be discarded.

For example, assume that the maximum adjustment value is set to 60 seconds and the current cOS Core time is 16:42:35. If a time server responds with a time of 16:43:38 then the difference is 63 seconds. This is greater than the maximum adjustment value so no update occurs for this response.

Example 2.26. Modifying the Maximum Adjustment Value

In this example, The maximum adjustment value will be set to 40,000 seconds. This is the maximum time difference that an external server is allowed to adjust for. There may be a valid reason why there is a significant difference such as an incorrect cOS Core configuration.

Command-Line Interface

Device:/> set DateTime TimeSyncMaxAdjust=40000

InControl

Follow similar steps to those used for the Web Interface below.

Web Interface

  1. Go to: System > Device > Date and Time
  2. Set Max drift to 40000
  3. Click OK

Sometimes it might be necessary to override the maximum adjustment. For example, if time synchronization has just been enabled and the initial time difference is greater than the maximum adjustment value. It is then possible to manually force a synchronization and disregard the maximum adjustment parameter.

Example 2.27. Forcing Time Synchronization

This example demonstrates how to force time synchronization, overriding the maximum adjustment setting.

Command-Line Interface

Device:/> time -sync -force

Synchronization Intervals

The interval between each synchronization attempt can be adjusted if needed. By default, this value is 86,400 seconds (1 day), meaning that the time synchronization process is executed once in a 24 hour period.

2.2.4. Settings Summary for Date and Time

Below is a summary of the key properties for date and time:

Time Zone Location

Time zone offset in minutes.

Default: ClavisterHQ (Stockholm)

DST

Enable daylight saving time (DST) for the selected time zone.

Default: Enabled

Time Sync Server Type

Type of server for time synchronization, UDPTime or SNTP (Simple Network Time Protocol).

Default: SNTP

Primary Time Server

DNS hostname or IP Address of Timeserver 1.

Default: None

Secondary Time Server

DNS hostname or IP Address of Timeserver 2.

Default: None

tertiary Time Server

DNS hostname or IP Address of Timeserver 3.

Default: None

Interval between synchronization

Seconds between each resynchronization.

Default: 86400

Max time drift

Maximum time drift in seconds that a server is allowed to adjust.

Default: 600

Group interval

Interval according to which server responses will be grouped.

Default: 10