### Event Messages and Status Words

from Alice's Adventures in Wonderland, Lewis Carroll

Caterpillar knows all the error codes, which is more than most of us do.

Last update: July 5, 2008

#### Related Links

#### Table of Contents

- Introduction
- System Status Word
- Peer Status Word
- Clock Status Word
- Flash Status Word
- Kiss Codes
- Crypto Messages

#### Introduction

This page lists the status and event messages and error codes used for status reporting and monitoring. Status words are used to display the current status of the running program. There is one system status word and a peer status word for each association. There is a clock status word for each association that supports a reference clock driver. There is a flash code for each association which shows errors found in the last packet received (pkt) and during protocol processing (peer). These are commonly viewed using the `ntpq` program.

Significant changes in program state are reported as events. There is one set of system events and a set of peer events for each association. In adition, there is a set of clock events for each association that supports a reference clock driver. Events are normally reported to the `protostats` file and optionally to the system log. In addition, if the trap facility is configured, traps can be reported to a remote program that can page an administrator.

This page also includes a description of the error messages produced by the Autokey protocol. These messages are normally sent to the `cryptostats` file.

In the following tables the Code Field is the status or event code assigned and the Message Field a short string used for display and event reporting. The Description field contains a longer explanation of the status or event. Some messages include additional information useful for error diagnosis and performance assessment.

#### System Status Word

The system status word consists of four fields LI (0-1), Source (2-7), Count (8-11) and Code (12-15). It is reported in the first line of the `ntpd rv` display.

Leap | Source | Count | Code

The Leap Field displays the system leap indicator bits coded as follows:

Code | Message | Description
`0` | `leap_none` | normal synchronized state
`1` | `leap_add_sec` | insert second after 23:59:59 of the current day
`2` | `leap_del_sec` | delete second 23:59:59 of the current day
`3` | `leap_alarm` | never synchronized

The Source Field displays the current synchronization source coded as follows:.

Code | Message | Description
`0` | `sync_unspec` | not yet synchronized
`1` | `sync_pps` | pulse-per-second signal (Cs, Ru, GPS, etc.)
`2` | `sync_lf_radio` | VLF/LF radio (WWVB, DCF77, etc.)
`3` | `sync_hf_radio` | MF/HF radio (WWV, etc.)
`4` | `sync_uhf_radio` | VHF/UHF radio/satellite (GPS, Galileo, etc.)
`5` | `sync_local` | local timecode (IRIG, LOCAL driver, etc.)
`6` | `sync_ntp` | NTP
`7` | `sync_other` | other (IEEE 1588, openntp, crony, etc.)
`8` | `sync_wristwatch` | eyeball and wristwatch
`9` | `sync_telephone` | telephone modem (ACTS, PTB, etc.)

The Count Field displays the number of events since the last `rv` command while the Event Field displays the most recent event message coded as follows:

Code | Message | Description
`0` | `unspecified` | unspecified
`1` | `freq_not_set` | frequency file not available
`2` | `freq_set` | frequency set from frequency file
`3` | `spike_detect` | spike detected
`4` | `freq_mode` | initial frequency training mode
`5` | `clock_sync` | clock synchronized
`6` | `restart` | program restart
`7` | `panic_stop` | clock error more than 600 s
`8` | `no_system_peer` | no system peer
`9` | `leap_armed` | leap second armed from file or Autokey
`10` | `leap_disarmed` | leap second disarmed
`11` | `leap_event` | leap event
`12` | `clock_step` | clock stepped
`13` | `kern` | kernel information message

#### Peer Status Word

The peer status word consists of four fields: Status (0-4, Select (5-7), Count (8-11) and Code (12-15). It is reported in the first line of the `ntpd rv associd` display.

Status | Select | Count | Code

The Status Field displays the peer status code bits in hexadecimal as follows:

Code | Message | Description
`08` | `bcst` | broadcast association
`10` | `reach` | host reachable
`20` | `authenb` | authentication enabled
`40` | `auth` | authentication ok
`80` | `config` | persistent association

The Select Field displays the current selection. status The T Field displays the tally codes beginning the `ntpq peers` display. The values are coded as follows:

Code | Message | T | Description
`0` | `sel_reject` |  | discarded as not valid (TEST10-TEST13)
`1` | `sel_falsetick` | `x` | discarded by intersection algorithm
`2` | `sel_excess` | `.` | discarded by table overflow (not used)
`3` | `sel_outlyer` | `-` | discarded by the cluster algorithm
`4` | `sel_candidate` | `+` | included by the combine algorithm
`5` | `sel_backup` | `#` | backup (more than `tinker maxclock` sources)
`6` | `sel_sys.peer` | `*` | system peer
`7` | `sel_pps.peer` | `o` | PPS peer (when the prefer peer is valid)

The Count Field displays the number of events since the last `rv` command, while the Event Field displays the most recent event message coded as follows:

Code | Message | Description
`1` | `mobilize` | association mobilized
`2` | `demobilize` | association demobilized
`3` | `unreachable` | server unreachable
`4` | `reachable` | server reachable
`5` | `restart` | association restart
`6` | `no_reply` | no server found (`ntpdate` mode)
`7` | `rate_exceeded` | rate exceeded (kiss code `RATE`)
`8` | `access_denied` | access denied (kiss code `DENY`)
`9` | `leap_armed` | leap armed from server LI code
`10` | `sys_peer` | new system peer
`11` | `clock` | reference clock message (see clock status word)

#### Clock Status Word

The clock status word consists of four fields: Unused (0-7), Count (8-11) and Code (12-15). It is reported in the first line of the `ntpd clockvar associd` display.

Unused | Count | Code

The Count Field displays the number of events since the last `clockvar` command, while the Event Field displays the most recent event message coded as follows:

Code | Message | Description
`0` | `clk_unspe` | nominal
`1` | `clk_noreply` | no reply to poll
`2` | `clk_badformat` | bad timecode format
`3` | `clk_fault` | hardware or software fault
`4` | `clk_bad_signal` | signal loss
`5` | `clk_bad_date` | bad date format
`6` | `clk_bad_time` | bad time format

When the clock driver sets the code to a new value, a `clock_alarm` (11) peer event is reported.

#### Flash Status Word

The flash status word is displayed by the `ntpq` program `rv` command. It consists of a number of bits coded in hexadecimal as follows:

Code | Tag | Message | Description
`0001` | TEST1 | `pkt_dup` | duplicate packet
`0002` | TEST2 | `pkt_bogus` | bogus packet
`0004` | TEST3 | `pkt_unsync` | protocol unsynchronized
`0008` | TEST4 | `pkt_denied` | access denied
`0010` | TEST5 | `pkt_auth` | bad authentication
`0020` | TEST6 | `pkt_stratum` | bad synch or stratum
`0040` | TEST7 | `pkt_header` | bad header
`0080` | TEST8 | `pkt_autokey` | bad autokey
`0100` | TEST9 | `pkt_crypto` | bad crypto
`0200` | TEST10 | `peer_stratum` | peer bad synch or stratum
`0400` | TEST11 | `peer_dist` | peer distance exceeded
`0800` | TEST12 | `peer_loop` | peer synchronization loop
`1000` | TEST13 | `peer_unreach` | peer unreachable

#### Kiss Codes

Kiss codes are used in kiss-o'-death (koD) packets, billboard displays and log messages. They consist of a string of four zero-padded ASCII charactes. In practice they are informal and tend to change with time and implementation. Some of these codes can appear in the reference identifier field in `ntpq` billboards. Following is the current list:

Code | Description
`ACST` | manycast server
`AUTH` | authentication error
`AUTO` | Autokey sequence error
`BCST` | broadcast server
`CRYPT` | Autokey protocol error
`DENY` | access denied by server
`INIT` | association initialized
`MCST` | multicast server
`RATE` | rate exceeded
`TIME` | association timeout
`STEP` | step time change

#### Crypto Messages

These messages are sent to the `cryptostats` file when an error is detected in the Autokey protocol.

Code | Message | Description
`1` | `bad_format` | bad extension field format or length
`2` | `bad_timestamp` | bad timestamp
`3` | `bad_filestamp` | bad filestamp
`4` | `bad_public_key` | bad or missing public key
`5` | `bad_digest` | unsupported digest type
`6` | `bad_identity` | unsupported identity type
`7` | `bad_siglength` | bad signature length
`8` | `bad signature` | extension field signature not verified
`9` | `cert_not_verified` | certificate signature not verified
`10` | `cert_expired` | host certificate expired
`11` | `bad_cookie` | bad or missing cookie
`12` | `bad_leapseconds` | bad or misssing leapseconds values
`13` | `cert_missing` | bad or missing certificate
`14` | `bad_group_key` | bad or missing group key
`15` | `proto_error` | protocol error