Data Transfer Objects
API Request/Response Models
MeasurementRequest
NtpMeasurementResponse
RipeMeasurementResponse
RipeMeasurementTriggerResponse
Core Data Models
RipeMeasurement
- class server.app.dtos.RipeMeasurement.RipeMeasurement(measurement_id, ntp_measurement, probe_data, time_to_result, ref_id)[source]
Bases:
object
Represents the complete set of information retrieved from a RipeMeasurement.
- measurement_id
ID of the measurement from RIPE Atlas
- Type:
int
- ntp_measurement
The NTP measurement data
- Type:
- time_to_result
The duration (seconds) it took to receive the result after the measurement was initiated
- Type:
int
- ref_id
The reference ID of the server
- Type:
str
NtpMeasurement
- class server.app.dtos.NtpMeasurement.NtpMeasurement(vantage_point_ip, server_info, timestamps, main_details, extra_details)[source]
Bases:
object
Represents the complete set of measurements for a given NTP server.
- vantage_point_ip
IP address of the vantage point where measurement is being triggered
- Type:
IPv4Address | IPv6Address | None
- server_info
Metadata about the NTP server
- Type:
- timestamps
NTP timestamps from the exchange
- Type:
- main_details
Key metrics
- Type:
- extra_details
Additional fields
- Type:
NtpServerInfo
- class server.app.dtos.NtpServerInfo.NtpServerInfo(ntp_version, ntp_server_ip, ntp_server_location, ntp_server_name, ntp_server_ref_parent_ip, ref_name)[source]
Bases:
object
Represents the relevant metadata of an NTP server.
- ntp_version
The version of NTP the user chose to use (backwards compatible)
- Type:
int
- ntp_server_ip
The IP of the server, either in IPv4 or IPv6 format
- Type:
IPv4Address | IPv6Address | None
- ntp_server_name
The name of the server
- Type:
str | None
- ntp_server_ref_parent_ip
The IP of the parent server (it is None if it is a root server)
- Type:
IPv4Address | IPv6Address | None
- ref_name
The name of the parent (reference) server or None if we can only get the IP
- Type:
str | None
NtpTimestamps
- class server.app.dtos.NtpTimestamps.NtpTimestamps(client_sent_time, server_recv_time, server_sent_time, client_recv_time)[source]
Bases:
object
The four key timestamps used in NTP (Network Time Protocol) exchange between a client and a server
- client_sent_time
Time when the request was sent by the client (t1)
- Type:
- server_recv_time
Time when the request was received by the server (t2)
- Type:
- server_sent_time
Time when the response was sent by the server (t3)
- Type:
- client_recv_time
Time when the response was received by the client (t4)
- Type:
NtpMainDetails
- class server.app.dtos.NtpMainDetails.NtpMainDetails(offset, rtt, stratum, precision, reachability)[source]
Bases:
object
Represents the main measurements reported by an NTP server.
- offset
Clock offset between the client and server, in seconds
- Type:
float
- rtt
Round-trip delay for NTP packet exchange, in seconds
- Type:
float
- stratum
Stratum level of the serve
- Type:
int
- precision
Precision of the system clock of the server
- Type:
float
- reachability
Reachability register
- Type:
str
NtpExtraDetails
- class server.app.dtos.NtpExtraDetails.NtpExtraDetails(root_delay, poll, root_dispersion, ntp_last_sync_time, leap)[source]
Bases:
object
Represents additional measurements for a given NTP server.
- root_delay
Total round-trip delay to the primary reference source
- Type:
- poll
The poll interval (seconds) used by the probe during the measurement
- Type:
int
- root_dispersion
An estimate (seconds) of the maximum error due to clock frequency stability
- Type:
- ntp_last_sync_time
Last time the server was synchronized
- Type:
- leap
2-bit leap indicator; A value of 3 (11 in binary) represents an unsynchronized clock
- Type:
int
PreciseTime
ProbeData
- class server.app.dtos.ProbeData.ProbeData(probe_id, probe_addr, probe_location)[source]
Bases:
object
Contains identifying and location information about a RIPE Atlas probe.
- probe_id
The unique identifier of the probe
- Type:
str
- probe_addr
The IPv4 and IPv6 addresses of the probe
- Type:
Tuple[IPv4Address | None, IPv6Address | None]
- probe_location
Geographic location of the probe
- Type:
ProbeLocation | None
- class server.app.dtos.ProbeData.ServerLocation(country_code, coordinates)[source]
Bases:
object
Represents the geographical location of a RIPE Atlas probe.
- country_code
Two-letter ISO 3166-1 alpha-2 country code (e.g., ‘US’, ‘DE’) indicating the country where the probe is located
- Type:
str
- coordinates
The latitude and longitude of the probe’s physical location
- Type:
Tuple[float, float]