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:

NtpMeasurement

probe_data

Data related to the probe

Type:

ProbeData

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:

NtpServerInfo

timestamps

NTP timestamps from the exchange

Type:

NtpTimestamps

main_details

Key metrics

Type:

NtpMainDetails

extra_details

Additional fields

Type:

NtpExtraDetails

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:

PreciseTime

server_recv_time

Time when the request was received by the server (t2)

Type:

PreciseTime

server_sent_time

Time when the response was sent by the server (t3)

Type:

PreciseTime

client_recv_time

Time when the response was received by the client (t4)

Type:

PreciseTime

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:

PreciseTime

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:

PreciseTime

ntp_last_sync_time

Last time the server was synchronized

Type:

PreciseTime

leap

2-bit leap indicator; A value of 3 (11 in binary) represents an unsynchronized clock

Type:

int

PreciseTime

class server.app.dtos.PreciseTime.PreciseTime(seconds, fraction)[source]

Bases: object

Represents a single NTP timestamp.

seconds

The integer part of the timestamp (the first 32 bits).

Type:

int

fraction

The fractional part of the timestamp (the last 32 bits).

Type:

int

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]