RFC 5907

Definitions of Managed Objects for Network Time Protocol Version 4 (NTPv4)

๐Ÿ“… published June 2010, from ietf

RFC 5907: Definitions of Managed Objects for Network Time Protocol Version 4 (NTPv4) โœจ

Okay bestie, this is RFC 5907 ๐ŸŽ€, an IETF document from June 2010. It's on the Standards Track, so it's a real Internet standard and not just vibes ๐Ÿ’…. The main author is H. Gerstung from Meinberg, with C. Elliott, and B. Haberman (Ed.) from JHU APL as editor. Its ISSN is 2070-1721 ๐Ÿฆ‹. The header doesn't list any RFC that it obsoletes or updates, so it's standing on its own ๐Ÿ‘‘.

Abstract โœจ

NTP is the time-sync system used on every kind of network, from servers and workstations to all sorts of networked gear โฐ. As time sync becomes more mission-critical, operators need standard ways to monitor and manage it, so they can build a monitoring setup that doesn't depend on one platform or one vendor ๐Ÿซถ. This document gives a standard set of data objects for monitoring the NTP entity on a networked host, and it's part of the NTP version 4 standardisation effort ๐ŸŒˆ.

Status of This Memo

This is an Internet Standards Track document ๐Ÿ”ฅ.

It's a product of the IETF and reflects what the IETF community agreed on. It went through public review and got approved for publication by the IESG. More about Internet Standards is in Section 2 of RFC 5741 ๐Ÿ“š.

For the latest status, errata, and ways to send feedback, check http://www.rfc-editor.org/info/rfc5907 ๐Ÿ“.

Copyright (c) 2010 IETF Trust and the people listed as the document's authors. All rights reserved ๐Ÿ’œ.

This document is covered by BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents, at http://trustee.ietf.org/license-info, as they were on the publication date. Please actually read these, because they spell out your rights and restrictions ๐Ÿ™ˆ. Code extracted from this document has to include the Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions. It comes with no warranty, as the Simplified BSD License describes โœจ.

Table of Contents

1. Introduction ....................................................2
2. Conventions Used in This Document ...............................3
3. The Internet-Standard Management Framework ......................3
4. Technical Description ...........................................3
5. MIB Definition ..................................................4
6. IANA Considerations ............................................23
7. Security Considerations ........................................23
8. Acknowledgments ................................................24
9. References .....................................................24
   9.1. Normative References ......................................24
   9.2. Informative References ....................................2

1. Introduction ๐ŸŽ€

Okay so the NTPv4 MIB module lets SNMP monitor and manage local NTP [RFC5905] entities ๐Ÿฆ‹. It's a set of data objects you can query over SNMP, and they show what the NTP entity is doing right now. That covers general info about the entity (vendor, product, version) and how it connects to the upstream NTP servers it takes reference time from, plus hardware reference clocks like radio clocks ๐Ÿ“ก. The most important values are in there so you can spot failures before they mess with the time sync of the whole network ๐Ÿ˜ญ. There are also notification objects that tell you when the NTP entity's state changes, and objects that control those notifications too ๐Ÿ’….

2. Conventions Used in This Document

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be read as described in [RFC2119] ๐Ÿ“–โœจ.

3. The Internet-Standard Management Framework

If you want the full tour of the documents that make up the current Internet-Standard Management Framework, go to section 7 of RFC 3410 [RFC3410] ๐Ÿ—บ๏ธ.

Managed objects live in a virtual information store called the Management Information Base, or MIB ๐Ÿ—ƒ๏ธ. You usually reach MIB objects through the Simple Network Management Protocol (SNMP). The objects are defined with the Structure of Management Information (SMI). This memo's MIB module follows SMIv2, which is described in STD 58, RFC 2578 [RFC2578], STD 58, RFC 2579 [RFC2579] and STD 58, RFC 2580 [RFC2580] ๐Ÿ’–.

4. Technical Description ๐Ÿงš

The NTPv4 MIB module is split into sections ๐ŸŒธ. There's general server info, the current status of the NTP entity, the status of every mobilised association (like unicast upstream time servers, multicast or broadcast sources, time references, and hardware clocks), control objects for the NTP entity, NTP objects that only show up in notifications, and the SNMP notification definitions for core events ๐Ÿ’œ.

The general server info section is static, so you can use it to figure out which NTP implementation is running on a host. It includes the vendor and product name, the version info, the hardware and OS platform, and the time resolution of the underlying OS ๐ŸŽ€.

Section 2 (current NTP status) holds the data objects for the entity's current operational status ๐Ÿ”ฅ.

The third section has the data objects for the set of time references ("associations") the NTP entity is working with right now โญ.

The fourth section has the objects you use to control the NTP entity. Right now they set how often the heartbeat interval notification goes out and which notifications are turned on ๐ŸŽ›๏ธ.

The fifth section only holds objects used as varbinds in notifications. Right now there's just one: a message that adds a cleartext event message to a notification ๐Ÿ’ฌ.

Some important events can happen while the NTP entity is running. The notification section defines SNMP notifications for the most important ones (the "core events"). It also has a heartbeat notification and a test notification. The test notification lets management systems check that they're receiving NTP notifications, and the heartbeat lets monitoring systems confirm the NTP entity is still up and running ๐Ÿซถ.

Some values show up in both numeric and human-readable (string) form, which makes the status info easier to read ๐ŸŒˆ. If the two forms of a value don't match, the numeric one wins โœจ.

5. MIB Definition ๐Ÿ‘‘

-- *********************************************************************
--
--    The Network Time Protocol Version 4
--    Management Information Base (MIB)
--
--    Authors: Heiko Gerstung (heiko.gerstung@meinberg.de)
--             Chris Elliott (chelliot@pobox.com)
--
--    for the Internet Engineering Task Force (IETF)
--    NTP Working Group (ntpwg)
--
--
-- *********************************************************************
--   Rev 1.00
--         Published as RFC 5907
--
-- *********************************************************************

NTPv4-MIB DEFINITIONS ::= BEGIN

IMPORTS
    MODULE-IDENTITY, OBJECT-TYPE , mib-2, Integer32, NOTIFICATION-TYPE,
    Unsigned32, Counter32, TimeTicks
        FROM SNMPv2-SMI -- RFC 2578
    MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP
        FROM SNMPv2-CONF -- RFC 2580
    DisplayString, TEXTUAL-CONVENTION
        FROM SNMPv2-TC -- RFC 2579

    InetAddressType, InetAddress
        FROM INET-ADDRESS-MIB -- RFC 4001
    Utf8String
        FROM SYSAPPL-MIB; -- RFC 2287

ntpSnmpMIB MODULE-IDENTITY
    LAST-UPDATED "201005170000Z" -- May 17, 2010
    ORGANIZATION "The IETF NTP Working Group (ntpwg)"
    CONTACT-INFO
            "     WG Email: ntpwg@lists.ntp.isc.org
                  Subscribe:
                   https://lists.ntp.isc.org/mailman/listinfo/ntpwg

                  Heiko Gerstung
                  Meinberg Funkuhren Gmbh & Co. KG
                  Lange Wand 9
                  Bad Pyrmont  31812
                  Germany

                  Phone: +49 5281 9309 25
                  Email: heiko.gerstung@meinberg.de

                  Chris Elliott
                  1516 Kent St.
                  Durham, NC 27707
                  USA

                  Phone: +1-919-308-1216
                  Email: chelliot@pobox.com

                  Brian Haberman
                  11100 Johns Hopkins Road
                  Laurel, MD 20723
                  USA

                  Phone: +1-443-778-1319
                  Email: brian@innovationslab.net"
     DESCRIPTION
        "The Management Information Base for NTP time entities.

         Copyright (c) 2010 IETF Trust and the persons identified as
         authors of the code.  All rights reserved.

         Redistribution and use in source and binary forms, with or
         without modification, is permitted pursuant to, and subject
         to the license terms contained in, the Simplified BSD License
         set forth in Section 4.c of the IETF Trust's Legal Provisions
         Relating to IETF Documents
         (http://trustee.ietf.org/license-info)."

    REVISION     "201005170000Z"
    DESCRIPTION
        "This revision of the MIB module is published as RFC 5907."

    ::= { mib-2 197 }

ntpSnmpMIBObjects  OBJECT IDENTIFIER ::= { ntpSnmpMIB 1 }

-- MIB contains 6 groups

ntpEntInfo         OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 1 }
ntpEntStatus       OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 2 }
ntpAssociation     OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 3 }
ntpEntControl      OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 4 }
ntpEntNotifObjects OBJECT IDENTIFIER ::= { ntpSnmpMIBObjects 5 }

--
-- Textual Conventions
--

NtpStratum ::= TEXTUAL-CONVENTION
    DISPLAY-HINT "d"
    STATUS      current
    DESCRIPTION
        "The NTP stratum, with 16 representing no stratum."
    SYNTAX      Unsigned32 (1..16)

NtpDateTime ::= TEXTUAL-CONVENTION
    DISPLAY-HINT "4d:4d:4d.4d"
    STATUS      current
    DESCRIPTION
        "NTP date/time on the device, in 128-bit
         NTP date format.  If time is not syncronized, this
         field shall be a zero-length string.

         This trusted certificate (TC) is not to be used for objects
         that are used to set the time of the node querying this
         object.  NTP should be used for this -- or at least SNTP."
    REFERENCE "RFC 5905, section 6"
    SYNTAX      OCTET STRING (SIZE (0 | 16))

--
-- Section 1: General NTP Entity information objects
--            (relatively static information)
--
ntpEntSoftwareName OBJECT-TYPE
    SYNTAX      Utf8String
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The product name of the running NTP version, e.g., 'ntpd'."
    ::= { ntpEntInfo  1 }

Okay so the software version object is up next, and it's giving full receipts ๐Ÿงพโœจ

ntpEntSoftwareVersion OBJECT-TYPE
    SYNTAX      Utf8String
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The software version of the installed NTP implementation
         as a full version string, e.g., 'ntpd-4.2.0b@1.1433 ...'"
    ::= { ntpEntInfo  2 }

ntpEntSoftwareVendor OBJECT-TYPE
    SYNTAX      Utf8String
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The vendor/author of the installed NTP version."
    ::= { ntpEntInfo  3 }

ntpEntSystemType OBJECT-TYPE
    SYNTAX      Utf8String
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "General hardware/os platform information,
         e.g., 'Linux 2.6.12 / x86'."
    -- freely configurable, default is OS Version / Hardware platform
    ::= { ntpEntInfo  4 }

ntpEntTimeResolution OBJECT-TYPE
    SYNTAX      Unsigned32
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The time resolution in integer format, where the resolution
        is represented as divisions of a second, e.g., a value of 1000
        translates to 1.0 ms."
    ::= { ntpEntInfo  5 }

ntpEntTimePrecision OBJECT-TYPE
    SYNTAX      Integer32
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The entity's precision in integer format, shows the precision.
         A value of -5 would mean 2^-5 = 31.25 ms."
    ::= { ntpEntInfo  6 }

ntpEntTimeDistance OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The distance from this NTP entity to the root time reference
        (stratum 0) source including the unit, e.g., '13.243 ms'."
    ::= { ntpEntInfo  7 }

ntpEntTimeResolution is the one that's giving math ๐Ÿงฎ because a value of 1000 is 1.0 ms, and ntpEntTimePrecision is the power-of-two version where -5 means 2^-5 = 31.25 ms. Bestie, the way that these two work together is so clean ๐Ÿ˜ญ๐Ÿ’…


--
-- Section 2: Current NTP status (dynamic information)
--

ntpEntStatusCurrentMode OBJECT-TYPE
    SYNTAX      INTEGER {
                            notRunning(1),
                            notSynchronized(2),
                            noneConfigured(3),
                            syncToLocal(4),
                            syncToRefclock(5),
                            syncToRemoteServer(6),
                            unknown(99)
                        }
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The current mode of the NTP.  The definition of each possible
         value is:
            notRunning(1) - NTP is not running.
            notSynchronized(2) - NTP is not synchronized to any time
                                 source (stratum = 16).
            noneConfigured(3) - NTP is not synchronized and does not
                                have a reference configured
                                (stratum = 16).
            syncToLocal(4) - NTP is distributing time based on its
                             local clock (degraded accuracy and/or
                             reliability).
            syncToRefclock(5) - NTP is synchronized to a local
                                hardware refclock (e.g., GPS).

            syncToRemoteServer(6) - NTP is synchronized to a remote
                                    NTP server ('upstream' server).
            unknown(99) - The state of NTP is unknown."
    ::= { ntpEntStatus 1 }

ntpEntStatusStratum OBJECT-TYPE
    SYNTAX      NtpStratum
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The NTP entity's own stratum value.  Should be a stratum of
         syspeer + 1 (or 16 if no syspeer)."
    ::= { ntpEntStatus 2 }

ntpEntStatusActiveRefSourceId OBJECT-TYPE
    SYNTAX      Unsigned32 ( 0..99999 )
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The association ID of the current syspeer."
    ::= { ntpEntStatus 3 }

ntpEntStatusActiveRefSourceName OBJECT-TYPE
    SYNTAX      Utf8String
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The hostname/descriptive name of the current reference source
         selected as syspeer, e.g., 'ntp1.ptb.de' or 'GPS' or
         'DCFi', ..."
    ::= { ntpEntStatus 4 }

ntpEntStatusActiveOffset OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The time offset to the current selected reference time source
         as a string including unit, e.g., '0.032 ms' or '1.232 s'."
    ::= { ntpEntStatus 5 }

ntpEntStatusNumberOfRefSources OBJECT-TYPE
    SYNTAX      Unsigned32 (0..99)
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of reference sources configured for NTP."
    ::= { ntpEntStatus 6 }

ntpEntStatusDispersion OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The root dispersion of the running NTP entity, e.g., '6.927'."
    ::= { ntpEntStatus 7 }

ntpEntStatusEntityUptime OBJECT-TYPE
    SYNTAX      TimeTicks
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The uptime of the NTP entity, (i.e., the time since ntpd was
         (re-)initialized not sysUptime!).  The time is represented in
         hundreds of seconds since Jan 1, 1970 (00:00:00.000) UTC."
    ::= { ntpEntStatus 8 }

ntpEntStatusDateTime OBJECT-TYPE
    SYNTAX      NtpDateTime
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The current NTP date/time on the device, in 128-bit
         NTP date format.  If time is not syncronized, this
         field shall be a zero-length string.

         This object can be used to timestamp events on this
         node and allow a management station to correlate
         different time objects.  For example, a management
         station could query this object and sysUpTime in
         the same operation to be able to relate sysUpTime
         to NTP time.

         This object is not to be used to set the time of
         the node querying this object.  NTP should be used
         for this -- or at least SNTP."
    REFERENCE "RFC 5905, section 6"
    ::= { ntpEntStatus 9 }

The ntpEntStatusCurrentMode enum is basically the whole vibe check ๐Ÿ” from "not running" all the way to "syncToRemoteServer", and 99 is the "idk bestie" option ๐Ÿ’€. Also, ntpEntStatusDateTime is giving timestamp goals โฐ: it's for lining events up against sysUpTime, and it is NOT for setting the clock on the box you're querying. Use NTP for that, or at least SNTP ๐Ÿ™ˆ

ntpEntStatusLeapSecond OBJECT-TYPE
    SYNTAX      NtpDateTime
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "Date the next known leap second will occur.  If there is
         no leap second announced, then this object should be 0."
    ::= { ntpEntStatus 10 }

ntpEntStatusLeapSecDirection OBJECT-TYPE
    SYNTAX      Integer32 (-1..1)
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "Direction of next known leap second.  If there is no
         leap second announced, then this object should be 0."
    ::= { ntpEntStatus 11 }

ntpEntStatusInPkts OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "packets"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The total number of NTP messages delivered to the
         NTP entity from the transport service.
         Discountinuities in the value of this counter can occur
         upon cold start or reinitialization of the NTP entity, the
         management system and at other times as indicated by
         discontinuities in the value of sysUpTime."

    ::= { ntpEntStatus 12 }

ntpEntStatusOutPkts OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "packets"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The total number of NTP messages delivered to the
         transport service by this NTP entity.
         Discountinuities in the value of this counter can occur
         upon cold start or reinitialization of the NTP entity, the
         management system and at other times as indicated by
         discontinuities in the value of sysUpTime."
    ::= { ntpEntStatus 13 }

ntpEntStatusBadVersion OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "packets"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The total number of NTP messages that were delivered
         to this NTP entity and were for an unsupported NTP
         version.

         Discountinuities in the value of this counter can occur
         upon cold start or reinitialization of the NTP entity, the
         management system and at other times as indicated by
         discontinuities in the value of sysUpTime."
    ::= { ntpEntStatus 14 }

ntpEntStatusProtocolError OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "packets"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The total number of NTP messages that were delivered
         to this NTP entity and this entity was not able to
         process due to an NTP protocol error.
         Discountinuities in the value of this counter can occur
         upon cold start or reinitialization of the NTP entity, the
         management system and at other times as indicated by
         discontinuities in the value of sysUpTime."
    ::= { ntpEntStatus 15 }

ntpEntStatusNotifications OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "notifications"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The total number of SNMP notifications that this NTP
         entity has generated.
         Discountinuities in the value of this counter can occur
         upon cold start or reinitialization of the NTP entity, the
         management system and at other times as indicated by
         discontinuities in the value of sysUpTime."
    ::= { ntpEntStatus 16 }

The leap second objects are giving calendar drama ๐Ÿ“…: the date of the next known leap second, plus which direction it goes (-1 to 1). If nothing's announced, both get 0, which is honestly the most chill answer ever ๐Ÿซถ

Then there's the whole counter squad: ntpEntStatusInPkts, ntpEntStatusOutPkts, ntpEntStatusBadVersion, ntpEntStatusProtocolError, and ntpEntStatusNotifications ๐Ÿ“ฆ. They all reset on cold start or reinitialization, so keep sysUpTime nearby to read them right ๐Ÿฆ‹

ntpEntStatPktModeTable OBJECT-TYPE
    SYNTAX           SEQUENCE OF NtpEntStatPktModeEntry
    MAX-ACCESS       not-accessible
    STATUS           current
    DESCRIPTION
        "The number of packets sent and received by packet mode.
         One entry per packet mode."
    ::= { ntpEntStatus 17 }

ntpEntStatPktModeEntry OBJECT-TYPE
    SYNTAX      NtpEntStatPktModeEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A statistical record of the number of packets sent and
         received for each packet mode."
    INDEX       { ntpEntStatPktMode }
    ::= { ntpEntStatPktModeTable 1 }

NtpEntStatPktModeEntry   ::= SEQUENCE {
        ntpEntStatPktMode              INTEGER,
        ntpEntStatPktSent              Counter32,
        ntpEntStatPktReceived          Counter32
}

ntpEntStatPktMode OBJECT-TYPE
    SYNTAX      INTEGER {
                    symetricactive(1),
                    symetricpassive(2),
                    client(3),
                    server(4),
                    broadcastserver(5),
                    broadcastclient(6)
                }
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The NTP packet mode."
    ::= { ntpEntStatPktModeEntry 1 }

ntpEntStatPktSent OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "packets"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of NTP packets sent with this packet mode.
         Discountinuities in the value of this counter can occur
         upon cold start or reinitialization of the NTP entity, the
         management system and at other times as indicated by
         discontinuities in the value of sysUpTime."

    ::= { ntpEntStatPktModeEntry 2 }

ntpEntStatPktReceived OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "packets"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of NTP packets received with this packet mode.

         Discountinuities in the value of this counter can occur
         upon cold start or reinitialization of the NTP entity, the
         management system and at other times as indicated by
         discontinuities in the value of sysUpTime."

    ::= { ntpEntStatPktModeEntry 3 }

The packet mode table is a whole spreadsheet ๐Ÿ“Š with one row per mode, and each row tracks how many packets were sent and how many were received. It's giving organized, and I'm obsessed ๐Ÿ˜ญ๐ŸŒธ


--
-- Section 3: The status of all currently mobilized associations
--

ntpAssociationTable OBJECT-TYPE
    SYNTAX           SEQUENCE OF NtpAssociationEntry
    MAX-ACCESS       not-accessible
    STATUS           current
    DESCRIPTION
        "The table of currently mobilized associations."
    ::= { ntpAssociation 1 }

Okay bestie, we're officially in Section 3 now, where the associations get their own spotlight ๐ŸŽ€โœจ Stay tuned because it's about to get so iconic ๐Ÿ‘‘

okay so this is the part where each association gets its own row in the table, and the row has all the juicy info ๐Ÿ’– let's go ๐Ÿฆ‹

ntpAssociationEntry OBJECT-TYPE
    SYNTAX      NtpAssociationEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The table entry of currently mobilized associations."
    INDEX       { ntpAssocId }
    ::= { ntpAssociationTable 1 }

NtpAssociationEntry   ::= SEQUENCE {
        ntpAssocId                  Unsigned32,
        ntpAssocName                Utf8String,
        ntpAssocRefId               DisplayString,
        ntpAssocAddressType         InetAddressType,
        ntpAssocAddress             InetAddress,
        ntpAssocOffset              DisplayString,
        ntpAssocStratum             NtpStratum,
        ntpAssocStatusJitter        DisplayString,
        ntpAssocStatusDelay         DisplayString,
        ntpAssocStatusDispersion    DisplayString
}

ntpAssocId      OBJECT-TYPE
    SYNTAX      Unsigned32 ( 1..99999 )
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The association ID.  This is an internal, unique ID."
    ::= { ntpAssociationEntry 1 }

ntpAssocName    OBJECT-TYPE
    SYNTAX      Utf8String
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The hostname or other descriptive name for the association."
    ::= { ntpAssociationEntry 2 }

ntpAssocRefId   OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The refclock driver ID, if available."
    -- a refclock driver ID like "127.127.1.0" for non
    -- uni/multi/broadcast associations
    ::= { ntpAssociationEntry 3 }

ntpAssocAddressType OBJECT-TYPE
    SYNTAX      InetAddressType { ipv4(1), ipv6(2), ipv4z(3), ipv6z(4) }
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The type of address of the association.  Can be either IPv4 or
         IPv6 (both with or without zone index) and contains the type of
         address for unicast, multicast, and broadcast associations."
    ::= { ntpAssociationEntry 4 }

ntpAssocAddress OBJECT-TYPE
    SYNTAX      InetAddress (SIZE (4|8|16|20))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The IP address (IPv4 or IPv6, with or without zone index) of
         the association.  The type and size depends on the
         ntpAssocAddressType object.  Represents the IP address of a
         uni/multi/broadcast association."
    ::= { ntpAssociationEntry 5 }

ntpAssocOffset  OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The time offset to the association as a string."
    -- including unit, e.g., "0.032 ms" or "1.232 s"
    ::= { ntpAssociationEntry 6 }

ntpAssocStratum OBJECT-TYPE
    SYNTAX      NtpStratum
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The association stratum value."
    ::= { ntpAssociationEntry 7 }

ntpAssocStatusJitter OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The jitter in milliseconds as a string."
    ::= { ntpAssociationEntry 8 }

ntpAssocStatusDelay OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The network delay in milliseconds as a string."
    ::= { ntpAssociationEntry 9 }

ntpAssocStatusDispersion OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The root dispersion of the association."
    -- e.g., "6.927"
    ::= { ntpAssociationEntry 10 }

ntpAssociationStatisticsTable OBJECT-TYPE
    SYNTAX           SEQUENCE OF NtpAssociationStatisticsEntry
    MAX-ACCESS       not-accessible
    STATUS           current
    DESCRIPTION
        "The table of statistics for current associations."
    ::= { ntpAssociation 2 }

ntpAssociationStatisticsEntry OBJECT-TYPE
    SYNTAX      NtpAssociationStatisticsEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The table entry of statistics for current associations."
    INDEX       { ntpAssocId }
    ::= { ntpAssociationStatisticsTable 1 }

NtpAssociationStatisticsEntry   ::= SEQUENCE {
        ntpAssocStatInPkts          Counter32,
        ntpAssocStatOutPkts         Counter32,
        ntpAssocStatProtocolError   Counter32
}

ntpAssocStatInPkts OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "packets"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The total number of NTP messages delivered to the
         NTP entity from this association.
         Discountinuities in the value of this counter can occur
         upon cold start or reinitialization of the NTP entity, the
         management system and at other times as indicated by
         discontinuities in the value of sysUpTime."

    ::= { ntpAssociationStatisticsEntry 1 }

ntpAssocStatOutPkts OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "packets"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The total number of NTP messages delivered to the
         transport service by this NTP entity for this
         association.
         Discountinuities in the value of this counter can occur
         upon cold start or reinitialization of the NTP entity, the
         management system and at other times as indicated by
         discontinuities in the value of sysUpTime."

    ::= { ntpAssociationStatisticsEntry 2 }

ntpAssocStatProtocolError OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "packets"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The total number of NTP messages that were delivered
         to this NTP entity from this association and this entity
         was not able to process due to an NTP protocol error.

         Discountinuities in the value of this counter can occur
         upon cold start or reinitialization of the NTP entity, the
         management system and at other times as indicated by
         discontinuities in the value of sysUpTime."

    ::= { ntpAssociationStatisticsEntry 3 }

4. Control objects โœจ

this section is where you get to control the NTP entity, like setting how often the heartbeat goes off and which notifications are switched on ๐ŸŽ€ the settings are stored persistently, so they survive a cold start or restart ๐Ÿงš

--
-- Section 4: Control objects
--

ntpEntHeartbeatInterval OBJECT-TYPE
    SYNTAX      Unsigned32
    UNITS       "seconds"
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "The interval at which the ntpEntNotifHeartbeat notification
         should be sent, in seconds.  If set to 0 and the
         entNotifHeartbeat bit in ntpEntNotifBits is 1, then
         ntpEntNotifHeartbeat is sent once.
         This value is stored persistently and will be restored to its
         last set value upon cold start or restart."
    DEFVAL { 60 }
    ::= { ntpEntControl 1 }

ntpEntNotifBits OBJECT-TYPE
    SYNTAX       BITS {
                     notUsed(0), -- Used to sync up bit and notification
                                 -- indices
                     entNotifModeChange(1),
                     entNotifStratumChange(2),
                     entNotifSyspeerChanged(3),
                     entNotifAddAssociation(4),
                     entNotifRemoveAssociation(5),
                     entNotifConfigChanged(6),
                     entNotifLeapSecondAnnounced(7),
                     entNotifHeartbeat(8)
    }
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "A bit for each notification.  A 1 for a particular bit enables
         that particular notification, a 0 disables it.
         This value is stored persistently and will be restored to its
         last set value upon cold start or restart."
    ::= { ntpEntControl 2 }

5. Notification objects โœจ

okay now the notifications get their own payload object ๐Ÿ“ฃ this is the cleartext message that rides along with every single one of them ๐Ÿ’Œ

--
-- Section 5: Notification objects
--

ntpEntNotifMessage OBJECT-TYPE
    SYNTAX      Utf8String
    MAX-ACCESS  accessible-for-notify
    STATUS      current
    DESCRIPTION
        "Used as a payload object for all notifications.  Holds a
         cleartext event message."
    DEFVAL { "no event" }
    ::= { ntpEntNotifObjects 1 }

SNMP notification definitions ๐Ÿฆ‹

--
-- SNMP notification definitions
--

ntpEntNotifications OBJECT IDENTIFIER ::= { ntpSnmpMIB 0 }

ntpEntNotifModeChange NOTIFICATION-TYPE
    OBJECTS     { ntpEntStatusCurrentMode }
    STATUS      current
    DESCRIPTION
        "The notification to be sent when the NTP entity changes mode,
         including starting and stopping (if possible)."
    ::= { ntpEntNotifications 1 }

ntpEntNotifStratumChange NOTIFICATION-TYPE
    OBJECTS     { ntpEntStatusDateTime, ntpEntStatusStratum,
                  ntpEntNotifMessage }
    STATUS      current
    DESCRIPTION
        "The notification to be sent when stratum level of NTP changes."
    ::= { ntpEntNotifications 2 }

ntpEntNotifSyspeerChanged NOTIFICATION-TYPE
    OBJECTS     { ntpEntStatusDateTime, ntpEntStatusActiveRefSourceId,
                  ntpEntNotifMessage }
    STATUS      current
    DESCRIPTION
        "The notification to be sent when a (new) syspeer has been
         selected."
    ::= { ntpEntNotifications 3 }

ntpEntNotifAddAssociation NOTIFICATION-TYPE
    OBJECTS  { ntpEntStatusDateTime, ntpAssocName, ntpEntNotifMessage }
    STATUS      current
    DESCRIPTION
        "The notification to be sent when a new association is
         mobilized."
    ::= { ntpEntNotifications 4 }

ntpEntNotifRemoveAssociation NOTIFICATION-TYPE
    OBJECTS  { ntpEntStatusDateTime, ntpAssocName,  ntpEntNotifMessage }
    STATUS      current
    DESCRIPTION
        "The notification to be sent when an association is
         demobilized."
    ::= { ntpEntNotifications 5 }

ntpEntNotifConfigChanged NOTIFICATION-TYPE
    OBJECTS     { ntpEntStatusDateTime, ntpEntNotifMessage }
    STATUS      current
    DESCRIPTION
        "The notification to be sent when the NTP configuration has
         changed, e.g., when the system connected to the Internet and
         was assigned a new IP address by the ISPs DHCP server."
    ::= { ntpEntNotifications 6 }

ntpEntNotifLeapSecondAnnounced NOTIFICATION-TYPE
    OBJECTS     { ntpEntStatusDateTime, ntpEntNotifMessage }
    STATUS      current
    DESCRIPTION
        "The notification to be sent when a leap second has been
         announced."
    ::= { ntpEntNotifications 7 }

ntpEntNotifHeartbeat NOTIFICATION-TYPE
    OBJECTS     { ntpEntStatusDateTime, ntpEntStatusCurrentMode,
                  ntpEntHeartbeatInterval, ntpEntNotifMessage }
    STATUS      current
    DESCRIPTION
        "The notification to be sent periodically (as defined by
         ntpEntHeartbeatInterval) to indicate that the NTP entity is
         still alive."
    ::= { ntpEntNotifications 8 }

Conformance/Compliance statements ๐ŸŒˆ

--
-- Conformance/Compliance statements
--

ntpEntConformance OBJECT IDENTIFIER ::= { ntpSnmpMIB 2 }

ntpEntCompliances OBJECT IDENTIFIER ::= { ntpEntConformance 1 }
ntpEntGroups      OBJECT IDENTIFIER ::= { ntpEntConformance 2 }
ntpEntNTPCompliance MODULE-COMPLIANCE
    STATUS      current
    DESCRIPTION
        "The compliance statement for SNMP entities that use NTP and
         implement the NTP MIB."
    MODULE  -- this module
        MANDATORY-GROUPS {
                           ntpEntObjectsGroup1
        }
        ::= { ntpEntCompliances 1 }

ntpEntSNTPCompliance MODULE-COMPLIANCE
    STATUS      current
    DESCRIPTION
        "The compliance statement for SNMP entities that use SNTP and
         implement the NTP MIB."
    MODULE  -- this module
        MANDATORY-GROUPS {
                           ntpEntObjectsGroup1
        }
        GROUP ntpEntObjectsGroup2
        DESCRIPTION
                "Optional object group."
        GROUP ntpEntNotifGroup
        DESCRIPTION
                "Optional notifications for this MIB."
        ::= { ntpEntCompliances 2 }
ntpEntObjectsGroup1 OBJECT-GROUP
    OBJECTS {
              ntpEntSoftwareName,
              ntpEntSoftwareVersion,
              ntpEntSoftwareVendor,
              ntpEntSystemType,
              ntpEntStatusEntityUptime,
              ntpEntStatusDateTime,
              ntpAssocName,
              ntpAssocRefId,
              ntpAssocAddressType,
              ntpAssocAddress
    }
    STATUS      current
    DESCRIPTION
        "A collection of objects for the NTP MIB."
    ::= { ntpEntGroups 1 }

ntpEntObjectsGroup2 OBJECT-GROUP
    OBJECTS {

              ntpEntTimeResolution,
              ntpEntTimePrecision,
              ntpEntTimeDistance,
              ntpEntStatusCurrentMode,
              ntpEntStatusStratum,
              ntpEntStatusActiveRefSourceId,
              ntpEntStatusActiveRefSourceName,
              ntpEntStatusActiveOffset,
              ntpEntStatusNumberOfRefSources,
              ntpEntStatusDispersion,
              ntpEntStatusLeapSecond,
              ntpEntStatusLeapSecDirection,
              ntpEntStatusInPkts,
              ntpEntStatusOutPkts,
              ntpEntStatusBadVersion,
              ntpEntStatusProtocolError,
              ntpEntStatusNotifications,
              ntpEntStatPktSent,
              ntpEntStatPktReceived,
              ntpAssocOffset,
              ntpAssocStratum,
              ntpAssocStatusJitter,
              ntpAssocStatusDelay,
              ntpAssocStatusDispersion,
              ntpAssocStatInPkts,
              ntpAssocStatOutPkts,
              ntpAssocStatProtocolError,
              ntpEntHeartbeatInterval,
              ntpEntNotifBits,
              ntpEntNotifMessage
    }
    STATUS      current
    DESCRIPTION
        "A collection of objects for the NTP MIB."
    ::= { ntpEntGroups 2 }

ntpEntNotifGroup NOTIFICATION-GROUP
    NOTIFICATIONS {
                    ntpEntNotifModeChange,
                    ntpEntNotifStratumChange,
                    ntpEntNotifSyspeerChanged,
                    ntpEntNotifAddAssociation,
                    ntpEntNotifRemoveAssociation,
                    ntpEntNotifConfigChanged,
                    ntpEntNotifLeapSecondAnnounced,
                    ntpEntNotifHeartbeat
    }
    STATUS      current
    DESCRIPTION
        "A collection of notifications for the NTP MIB"
    ::= { ntpEntGroups 3 }

END

6. IANA Considerations ๐ŸŒธ

The MIB module in this document uses the following IANA-assigned OBJECT IDENTIFIER values recorded in the SMI Numbers registry:

         Descriptor        OBJECT IDENTIFIER value
         ----------        -----------------------

         ntpSnmp           { mib-2 197 }

7. Security Considerations ๐Ÿ’€

Okay bestie, this part is SERIOUS ๐Ÿ˜ญ There are currently two management objects defined in this MIB module with a MAX-ACCESS clause of read-write and/or read-create. Those objects may be considered sensitive or vulnerable in some network environments. SET operations in a non-secure environment without proper protection can have a negative effect on network operations. Here are the objects and why they're sensitive:

ntpEntHeartbeatInterval controls the interval of heartbeat notifications. If you set it to 1, the NTP entity sends one notification each second, which is the maximum automatic rate (1/s). If you set it to 0, you get one single heartbeat notification and no further automatically generated ones. This trick can be used to create notifications at a higher rate, as high as the object can be written. ๐Ÿšจ

ntpEntNotifBits enables and disables notifications. It could be used to switch them off in order to delay or eliminate notifications for critical and important events. ๐Ÿ™ˆ

Some of the readable objects in this MIB module (objects with a MAX-ACCESS other than not-accessible) may be considered sensitive or vulnerable in some network environments. So it's important to control even GET and/or NOTIFY access to these objects, and possibly even encrypt their values when sending them over the network via SNMP. Here are the tables and objects and why they matter:

ntpEntSoftwareName, ntpEntSoftwareVersion, ntpEntSoftwareVendor, and ntpEntSystemType can all be used to identify software and its version, as well as the operating system and hardware platform. This might help a potential attacker find security problems, and therefore can be used in the preparation of an attack. ๐Ÿ‘€

SNMP versions prior to SNMPv3 did not include adequate security. Even if the network itself is secure (for example by using IPsec), there is still no control over who on that secure network is allowed to access and GET/SET (read/change/create/delete) the objects in this MIB module. It is RECOMMENDED that implementers consider the security features provided by the SNMPv3 framework (see RFC 3410 [RFC3410], section 8), including full support for the SNMPv3 cryptographic mechanisms (for authentication and privacy). Further, deployment of SNMP versions prior to SNMPv3 is NOT RECOMMENDED. Instead, it is RECOMMENDED to deploy SNMPv3 and to enable cryptographic security. It is then a customer/operator responsibility to ensure that the SNMP entity giving access to an instance of this MIB module is properly configured to give access to the objects only to those principals (users) that have legitimate rights to indeed GET or SET (change/create/delete) them. ๐Ÿ”

8. Acknowledgments ๐Ÿซถ

Bert Wijnen provided valuable feedback as the MIB Doctor for this document. Thank you, Bert! ๐Ÿ’–

9. References ๐Ÿ“š

9.1. Normative References

  • [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
  • [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, "Network Time Protocol Version 4: Protocol and Algorithms Specification", RFC 5905, June 2010.
  • [RFC2287] Krupczak, C. and J. Saperia, "Definitions of System-Level Managed Objects for Applications", RFC 2287, February 1998.
  • [RFC2578] McCloghrie, K., Ed., Perkins, D., Ed., and J. Schoenwaelder, Ed., "Structure of Management Information Version 2 (SMIv2)", STD 58, RFC 2578, April 1999.
  • [RFC2579] McCloghrie, K., Ed., Perkins, D., Ed., and J. Schoenwaelder, Ed., "Textual Conventions for SMIv2", STD 58, RFC 2579, April 1999.
  • [RFC2580] McCloghrie, K., Perkins, D., and J. Schoenwaelder, "Conformance Statements for SMIv2", STD 58, RFC 2580, April 1999.
  • [RFC4001] Daniele, M., Haberman, B., Routhier, S., and J. Schoenwaelder, "Textual Conventions for Internet Network Addresses", RFC 4001, February 2005.

9.2. Informative References

  • [RFC3410] Case, J., Mundy, R., Partain, D., and B. Stewart, "Introduction and Applicability Statements for Internet-Standard Management Framework", RFC 3410, December 2002.

Authors' Addresses ๐ŸŽ€

Heiko Gerstung
Meinberg Funkuhren Gmbh & Co. KG
Lange Wand 9
Bad Pyrmont  31812
Germany

Phone: +49 5281 9309 25
EMail: heiko.gerstung@meinberg.de
Chris Elliott
1516 Kent St.
Durham, NC  27707
USA

Phone: +1-919-308-1216
EMail: chelliot@pobox.com
Brian Haberman (editor)
Johns Hopkins University Applied Physics Lab
11100 Johns Hopkins Road
Laurel, MD  20723-6099
US

Phone: +1 443 778 1319
EMail: brian@innovationslab.net
๐Ÿ“ฆ where this page comes from