455
Table2.RMCDataFormat
_______________________________________________
NameExampleUnit Description
_______________________________________________
MessageID$GPRMCRMCprotocol
header
UTCTime 135415.000hhmmss.sss
StatusAA=datavalidor
V=datanotvalid
Latitude5115.6372ddmm.mmmm
N/SIndicator NN=northorS=south
Longitude 02107.9350dddmm.mmmm
E/WIndicatorEE=eastorW=west
SpeedOver 0.65knots
Ground
CourseOver 192.12 degreesTrue
Ground
Date231218ddmmyy
MagneticdegreesE=eastorW=west
Variation
East/WestE=east
Indicator
ModeAA=Autonomous,
D=DGPS,E=DR
Checksum *63
<CR><LF>Endofmessage
termination
_______________________________________________
An example of an Object Pascal function for
decodingaRMCsentenceisshownbelow:
function DecodeRMC(GPS: PNmeaGPS; A: TStringList):
Boolean;
begin
Result := True;
try
GPS^.fValid := (A[2] = 'A');
if not GPS^.fValid then
exit;
GPS^.fUTCTime := DateTimeNMEA(A[9], A[1]);
if Length(A[3]) = 11 then
begin
GPS^.fLatitude := Copy(A[3],1,2) + '° '
+ Copy(A[3],3,7) + ' ' + A[4];
end
else
GPS^.fLatitude := A[3] + ' ' + A[4];
if Length(A[5]) = 12 then
begin
GPS^.fLongitude := Copy(A[5],1,3) + '° '
+ Copy(A[5],4,7) + ' ' + A[6];
end
else
GPS^.fLongitude := A[5] + ' ' + A[6];
except
GPS^.fError := True;
Result := False;
end;
end;
Result := False;
end;
end;
3 NTPANDSNTPPROTOCOLS
WhendefiningtheNTPprotocolitwasassumedthat
itwouldbedesignedforprecisetimesynchronization
for a big amount of electronic devices working in a
network. Additionally, it was assumed that clock
frequency will be adjusted to reduce the time offset
gradually, without time
shifts or the necessity to
change the clock, and the whole procedure will not
overload the network and will be fully automated.
TheNTPprotocol also offers mechanisms protecting
fromanexternalinterferenceofcomputerclock’stime
change.Allthesehavecontributedtoabigpopularity
of the NTP protocol
among time synchronization
techniques. The protocol is not only used in typical
computer and network systems, but also in many
researchareasandcommunicationdevicesonboards
ofships,planesandevenspaceships.
The concept of time synchronization using NTP
protocol is based on the tree structure that includes
acertain
number of devices. Some of them are
referencetimesources,othersareresponsiblefortime
distribution,whileremainingareNTPclients(which
synchronizing their own clocks). Particular levels of
the NTP hierarchy are called Stratum. They indicate
on a distance between a given device and the
referenceclock.InStratum
0therearetimereferences,
i.e.: caesium atomic clocks, clocks with built‐in
rubidium generators or a GNSS systems. These
referenceclocksourcesareveryaccurateandreliable.
Devicesincluded in the next layer, calledStratum 1,
take time directly from reference clocks included in
Stratum 0 and are used for
time synchronization of
elementsinthelevelbelow.Similarly,elementsinthe
Stratum2playaroleofreferenceclockforcomputers
and local area net‐works in next layer, Stratum 3.
Therefore Stratum N components constitute the
reference clock for Stratum N+1 components. The
numberoflayersislimited
to16(Stratum0‐15),and
the number of devices in each layer is unlimited
(Rybaczyk2005).
Apart from the hierarchical structure, the NTP
protocolhasothercrucialattributes.Timestamps are
sentand received usingtheUser Datagram Protocol
(UDP)onportnumber123inpacketsofsize72bytes.
The
protocoliscapabletoadjustclock’stimeforeach
client, on the basis of calculating time differences in
relation to the reference clock. NTP is designed to
produce 3 results: clock offset, roundtrip delay and
dispersion.Clockoffsetrepresentsadifferenceoftime
value indicated by a local clock in
relation to the
reference clock. Roundtrip delay provides the
capability to launch a message to arrive at the
referenceclockataspecifiedtime.Dispersion,onthe
otherhand,representsamaximumerrorofthelocal
clock relative to the reference clock (Novick et al.
2018).TheNTPprotocolcanoperate
inafewmodes,
among others: symmetric active, symmetric passive,
client, server, broadcast. A detailed description of the
NTP protocol is included, among others, in book
(Mills2016)andspecification(Millsetal.2010).
A simplified version of the NTP protocol is the
SNTP (Simple Network Time Protocol)
protocol.
Adetailed specification of the SNTP protocol is
describedinthewidelyavailableRFC4330document
(Mills 2006). The principle of the SNTP protocol
operation is based on procedures found in the NTP
protocol (Jv & Gao 2008). SNTP operate in client‐
server model and uses the connectionless user
datagramprotocol(UDP)todistributereferenceclock
obtained from time servers to the SNTP clients. The
finalproductoftheSNTPprotocol,similarlyasinthe
caseofNTP,arethreevalues:clockoffset,roundtrip
delayanddispersion.ThearchitectureofSNTPisthe
same as in NTP, however, due to
a simplified
operation mode, there are differences between these
twoprotocols.AnexampleisanSNTPpacketheader,
whichdoesnothaveadditionalextensionfieldsused
formessageauthorization.Devicesthatdistributethe