NTP4(3)
β¨ NAME β¨
packet.application.ntp4 β the NTP module, bestie π it's the manual page for NTP4(3), living in the ntp4 1.0 era, and honestly? it just decodes time packets and looks good doing it.
πΈ DESCRIPTION πΈ
Okay so, this module decodes the NTP layer. That's the whole vibe. π°οΈβ¨
It's got you covered across every RFC era of Network Time Protocol:
- RFC 1059 Network Time Protocol (Version 1)
- RFC 1119 Network Time Protocol (Version 2)
- RFC 1305 Network Time Protocol (Version 3)
- RFC 5905 Network Time Protocol (Version 4)
No cap, all four versions in one little module. Periodt. π
π CLASSES π
class NTP1(NTP4)
It's an NTP4 object π¦ (yes the class is named NTP1, it inherits from NTP4, don't think about it too hard, just accept it, iykyk).
Usage:
from packet.application.ntp4 import NTP4
# Decode NTP4 layer
x = NTP4(pktt)
Object definition:
NTP4(
leap = int, # Leap Indicator
version = int, # NTP version
mode = int, # Leap Indicator
stratum = int, # Packet Stratum
poll = int, # Maximum interval between successive messages
precision = float, # Precision of system clock
delay = float, # Root delay
dispersion = float, # Root dispersion
refid = string, # Reference ID
tstamp = float, # Reference timestamp
org_tstamp = float, # Origin timestamp
rec_tstamp = float, # Receive timestamp
xmt_tstamp = float, # Transit timestamp
fields = list, # Extension fields
keyid = int, # Key identifier
digest = string, # Message digest
)
class NTP2(NTP4)
Also an NTP4 object β¨ same energy, same fields, same everything fr fr.
Usage:
from packet.application.ntp4 import NTP4
# Decode NTP4 layer
x = NTP4(pktt)
Object definition:
NTP4(
leap = int, # Leap Indicator
version = int, # NTP version
mode = int, # Leap Indicator
stratum = int, # Packet Stratum
poll = int, # Maximum interval between successive messages
precision = float, # Precision of system clock
delay = float, # Root delay
dispersion = float, # Root dispersion
refid = string, # Reference ID
tstamp = float, # Reference timestamp
org_tstamp = float, # Origin timestamp
rec_tstamp = float, # Receive timestamp
xmt_tstamp = float, # Transit timestamp
fields = list, # Extension fields
keyid = int, # Key identifier
digest = string, # Message digest
)
class NTP3(NTP4)
You guessed it π NTP4 object, main character energy, same glorious field list.
Usage:
from packet.application.ntp4 import NTP4
# Decode NTP4 layer
x = NTP4(pktt)
Object definition:
NTP4(
leap = int, # Leap Indicator
version = int, # NTP version
mode = int, # Leap Indicator
stratum = int, # Packet Stratum
poll = int, # Maximum interval between successive messages
precision = float, # Precision of system clock
delay = float, # Root delay
dispersion = float, # Root dispersion
refid = string, # Reference ID
tstamp = float, # Reference timestamp
org_tstamp = float, # Origin timestamp
rec_tstamp = float, # Receive timestamp
xmt_tstamp = float, # Transit timestamp
fields = list, # Extension fields
keyid = int, # Key identifier
digest = string, # Message digest
)
class NTP4(baseobj.BaseObj)
The moment you've all been waiting for π«Ά the actual NTP4 object, inheriting from baseobj.BaseObj like the icon it is π
Usage:
from packet.application.ntp4 import NTP4
# Decode NTP4 layer
x = NTP4(pktt)
Object definition:
NTP4(
leap = int, # Leap Indicator
version = int, # NTP version
mode = int, # Leap Indicator
stratum = int, # Packet Stratum
poll = int, # Maximum interval between successive messages
precision = float, # Precision of system clock
delay = float, # Root delay
dispersion = float, # Root dispersion
refid = string, # Reference ID
tstamp = float, # Reference timestamp
org_tstamp = float, # Origin timestamp
rec_tstamp = float, # Receive timestamp
xmt_tstamp = float, # Transit timestamp
fields = list, # Extension fields
keyid = int, # Key identifier
digest = string, # Message digest
)
Methods defined here:
__init__(self, pktt)
Constructor π« It initializes the object's private data, that's the whole job bestie.
pktt: Packet trace object (packet.pktt.Pktt) so this layer has access to the parent layers. π
class NTPExtField(baseobj.BaseObj)
NTP extension field π§ it's giving "extra data, extra cute."
Methods defined here:
__init__(self, unpack)
Constructor which takes the Unpack object as input π¦β¨
class NTP_TimeStamp(packet.utils.DateStr)
NTP timestamp π the moment, captured, slayed.
class ntp4_mode(packet.utils.Enum)
enum ntp4_mode π₯ the enum, the legend.
π« FUNCTIONS π«
NTP(pktt)β wrapper function to select the correct NTP object π― it's basically a matchmaker for NTP classes.ntp_timestamp(unpack)β get NTP timestamp β±οΈβ¨
π SEE ALSO π
Go read those too, they're part of the lore ππ
π BUGS π
No known bugs. ππ a flawless record, we love to see it, no cap.
π AUTHOR π
Jorge Mora (mora@netapp.com) β the one who made it happen π«Ά
and that's the whole page, bestie!! π this was NFStest 3.2, dated 21 March 2023, straight from the NTP4(3) manual, and it ate, honestly. go decode some timestamps, you've got this. πβ¨π¦
π¦ where this page comes from
- debian trixie: nfstest 3.2-3
- fedora 43: NFStest 3.2-14.fc43 Β· GPL-2.0-or-later
- fedora 44: NFStest 3.2-16.fc44 Β· GPL-2.0-or-later
- ubuntu noble: nfstest 3.2-2
- ubuntu questing: nfstest 3.2-3
- ubuntu resolute: nfstest 3.2-3build1
- ubuntu stonking: nfstest 3.2-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms