Network Time SecurityPhysikalisch-Technische
BundesanstaltBundesallee 100BraunschweigD-38116Germany+49-(0)531-592-8420+49-531-592-698420dieter.sibold@ptb.deGoogle Inc.stephen.roettger@googlemail.comPhysikalisch-Technische
BundesanstaltBundesallee 100BraunschweigD-38116Germany+49-(0)531-592-8421kristof.teichel@ptb.de
Internet Area
NTP Working GroupIntegrityAuthenticationNTPPTPSecurityTime synchronizationThis document describes Network Time Security (NTS), a collection of
measures that enable secure time synchronization with time servers using
protocols like the Network Time Protocol (NTP) or the Precision Time
Protocol (PTP). Its design considers the special requirements of precise
timekeeping which are described in Security Requirements of Time
Protocols in Packet Switched Networks .The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119.Time synchronization protocols are increasingly utilized to
synchronize clocks in networked infrastructures. Successful attacks
against the time synchronization protocol can seriously degrade the
reliable performance of such infrastructures. Therefore, time
synchronization protocols have to be secured if they are applied in
environments that are prone to malicious attacks. This can be
accomplished either by utilization of external security protocols, like
IPsec or TLS, or by intrinsic security measures of the time
synchronization protocol.The two most popular time synchronization protocols, the Network Time
Protocol (NTP) and the Precision Time Protocol
(PTP) , currently do not provide adequate
intrinsic security precautions. This document specifies generic security
measures which enable these and possibly other protocols to verify the
authenticity of the time server/master and the integrity of the time
synchronization protocol packets. The utilization of these measures for
a given specific time synchronization protocol has to be described in a
separate document. specifies that a security mechanism for
timekeeping must be designed in such a way that it does not degrade the
quality of the time transfer. This implies that for time keeping the
increase in bandwidth and message latency caused by the security
measures should be small. Also, NTP as well as PTP work via UDP and
connections are stateless on the server/master side. Therefore, all
security measures in this document are designed in such a way that they
add little demand for bandwidth, that the necessary calculations can be
executed in a fast manner, and that the measures do not require a
server/master to keep state of a connection.Man In The MiddleNetwork Time SecurityTimed Efficient Stream Loss-tolerant
AuthenticationMessage Authentication CodeThis document refers to different time synchronization protocols,
in particular to both the PTP and the NTP. Throughout the document the
term "server" applies to both a PTP master and an NTP server.
Accordingly, the term "client" applies to both a PTP slave and an NTP
client.The document "Security Requirements of Time Protocols in Packet
Switched Networks" contains a profound analysis
of security threats and requirements for time synchronization
protocols.The objectives of the NTS specification are as follows:Authenticity: NTS enables the client to authenticate its time
server(s).Integrity: NTS protects the integrity of time synchronization
protocol packets via a message authentication code (MAC).Confidentiality: NTS does not provide confidentiality protection
of the time synchronization packets.Authorization: NTS enables the client to verify its time server's
authorization. NTS optionally enables the server to verify the
client's authorization as well.Request-Response-Consistency: NTS enables a client to match an
incoming response to a request it has sent. NTS also enables the
client to deduce from the response whether its request to the server
has arrived without alteration.Applicability to Protocols: NTS can be used to secure different
time synchronization protocols, specifically at least NTP and
PTP.Integration with Protocols: A client or server running an
NTS-secured version of a time protocol does not negatively affect
other participants who are running unsecured versions of that
protocol.Server-Side Statelessness: All security measures of NTS work
without creating the necessity for a server to keep state of a
connection.Prevention of Amplification Attacks: All communication introduced
by NTS offers protection against abuse for amplification
denial-of-service attacks.NTS initially verifies the authenticity of the time server and
exchanges a symmetric key, the so-called cookie, as well as a key input
value (KIV). The KIV can be opaque for the client. After the cookie and
the KIV are exchanged, the client then uses them to protect the
authenticity and the integrity of subsequent unicast-type time
synchronization packets. In order to do this, a Message Authentication
Code (MAC) is attached to each time synchronization packet. The
calculation of the MAC includes the whole time synchronization packet
and the cookie which is shared between client and server.The cookie is calculated according to:cookie = MSB_<b> (MAC(server seed, KIV)),with the server seed as the key, where KIV is the client's key
input value, and where the application of the function MSB_<b>
returns only the b most significant bits. The server seed is a random
value of bit length b that the server possesses, which has to remain
secret. The cookie deterministically depends on KIV as long as the
server seed stays the same. The server seed has to be refreshed
periodically in order to provide key freshness as required in . See for
details on seed refreshing.Since the server does not keep a state of the client, it has to
recalculate the cookie each time it receives a unicast time
synchronization request from the client. To this end, the client has to
attach its KIV to each request (see ).The communication of the KIV and the cookie can
be performed between client and server directly, or via a third
party key distribution entity.For broadcast-type messages, authenticity and integrity of the time
synchronization packets are also ensured by a MAC, which is attached to
the time synchronization packet by the sender. Verification of the
broadcast-type packets' authenticity is based on the TESLA protocol, in
particular on its "not re-using keys" scheme, see Section 3.7.2 of . TESLA uses a one-way chain of keys, where each key
is the output of a one-way function applied to the previous key in the
chain. The server securely shares the last element of the chain with all
clients. The server splits time into intervals of uniform duration and
assigns each key to an interval in reverse order. At each time interval,
the server sends a broadcast packet appended by a MAC, calculated using
the corresponding key, and the key of the previous disclosure interval.
The client verifies the MAC by buffering the packet until disclosure of
the key in its associated disclosure interval occurs. In order to be
able to verify the timeliness of the packets, the client has to be
loosely time synchronized with the server. This has to be accomplished
before broadcast associations can be used. For checking timeliness of
packets, NTS uses another, more rigorous check in addition to just the
clock lookup used in the TESLA protocol. For a more detailed description
of how NTS employs and customizes TESLA, see .This section describes the types of messages needed for secure time
synchronization with NTS.For some guidance on how these message types can be realized in
practice, and integrated into the communication flow of existing time
synchronization protocols, see , a companion document for
NTS. Said document describes ASN.1 encodings for those message parts
that have to be added to a time synchronization protocol for security
reasons.In this message exchange, the usual time synchronization process is
executed, with the addition of integrity protection for all messages
that the server sends. This message exchange can be repeatedly
performed as often as the client desires and as long as the integrity
of the server's time responses is verified successfully.Before this message exchange is available, there are some
requirements that the client and server need to meet:They MUST negotiate the algorithm for the MAC used in the
time synchronization messages. Authenticity and integrity of the
communication MUST be ensured.The client MUST know a key input value KIV. Authenticity and
integrity of the communication MUST be ensured.Client and server MUST exchange the cookie (which depends on
the KIV as described in section ).
Authenticity, confidentiality and integrity of the communication
MUST be ensured.One way of realizing these requirements is to use the Association
and Cookie Message Exchanges described in .The unicast time synchronization exchange:exchanges time synchronization data as specified by the
appropriate time synchronization protocol,guarantees authenticity and integrity of the request to the
server,guarantees authenticity and integrity of the response to the
client,guarantees request-response-consistency to the client.This message is sent by the client when it requests a time
exchange. It containsthe NTS message ID "time_request",the negotiated version number,a nonce,the negotiated MAC algorithm,the client's key input value (for which the client knows the
associated cookie),optional: a MAC (generated with the cookie as key) for
verification of all of the above data.This message is sent by the server after it has received a
time_request message. Prior to this the server MUST recalculate the
client's cookie by using the received key input value and the
transmitted MAC algorithm. The message containsthe NTS message ID "time_response",the version number as transmitted in time_request,the server's time synchronization response data,the nonce transmitted in time_request,a MAC (generated with the cookie as key) for verification of
all of the above data.For a unicast time synchronization exchange, the following steps
are performed:The client sends a time_request message to the server. The
client MUST save the included nonce and the transmit_timestamp
(from the time synchronization data) as a correlated pair for
later verification steps. Optionally, the client protects the
request message with an appended MAC.Upon receipt of a time_request message, the server performs
the following steps:It re-calculates the cookie.If the request message contains a MAC the server
re-calculates the MAC and compares this value with the MAC
in the received data.If the re-calculated MAC does not match the MAC in
the received data the server MUST stop the processing of
the request.If the re-calculated MAC matches the MAC in the
received data the server continues to process the
request.The server computes the necessary time synchronization
data and constructs a time_response message as given in
.The client awaits a reply in the form of a time_response
message. Upon receipt, it checks: that the transmitted version number matches the one
negotiated previously,that the transmitted nonce belongs to a previous
time_request message,that the transmit_timestamp in that time_request message
matches the corresponding time stamp from the
synchronization data received in the time_response, andthat the appended MAC verifies the received
synchronization data, version number and nonce.If at least one of the first three checks fails (i.e.
if the version number does not match, if the client has never
used the nonce transmitted in the time_response message, or if
it has used the nonce with initial time synchronization data
different from that in the response), then the client MUST
ignore this time_response message. If the MAC is invalid, the
client MUST do one of the following: abort the run or send
another cookie request (because the cookie might have changed
due to a server seed refresh). If both checks are successful,
the client SHOULD continue time synchronization.Before this message exchange is available, there are some
requirements that the client and server need to meet:The client MUST receive all the information necessary to
process broadcast time synchronization messages from the server.
This includesthe one-way functions used for building the key
chain,the last key of the key chain,time interval duration,the disclosure delay (number of intervals between use and
disclosure of a key),the time at which the next time interval will start,
andthe next interval's associated index.The communication of the data listed above MUST guarantee
authenticity of the server, as well as integrity and freshness
of the broadcast parameters to the client.The broadcast time synchronization exchange:transmits (broadcast) time synchronization data from the
server to the client as specified by the appropriate time
synchronization protocol,guarantees to the client that the received synchronization
data has arrived in a timely manner as required by the TESLA
protocol and is trustworthy enough to be stored for later
checks,additionally guarantees authenticity of a certain broadcast
synchronization message in the client's storage.This message is sent by the server over the course of its
broadcast schedule. It is part of any broadcast association. It
containsthe NTS message ID "server_broad",the version number that the server is working under,time broadcast data,the index that belongs to the current interval (and therefore
identifies the current, yet undisclosed, key),the disclosed key of the previous disclosure interval
(current time interval minus disclosure delay),a MAC, calculated with the key for the current time interval,
verifying the message ID,the version number, andthe time data.A broadcast time synchronization message exchange consists of the
following steps:The server follows the TESLA protocol by regularly sending
server_broad messages as described in , adhering to its own disclosure
schedule.The client awaits time synchronization data in the form of a
server_broadcast message. Upon receipt, it performs the
following checks: Proof that the MAC is based on a key that is not yet
disclosed (packet timeliness). This is achieved via a
combination of checks. First, the disclosure schedule is
used, which requires loose time synchronization. If this is
successful, the client obtains a stronger guarantee via a
key check exchange (see below). If its timeliness is
verified, the packet will be buffered for later
authentication. Otherwise, the client MUST discard it. Note
that the time information included in the packet will not be
used for synchronization until its authenticity could also
be verified.The client checks that it does not already know the
disclosed key. Otherwise, the client SHOULD discard the
packet to avoid a buffer overrun. If this check is
successful, the client ensures that the disclosed key
belongs to the one-way key chain by applying the one-way
function until equality with a previous disclosed key is
shown. If it is falsified, the client MUST discard the
packet.If the disclosed key is legitimate, then the client
verifies the authenticity of any packet that it has received
during the corresponding time interval. If authenticity of a
packet is verified, then it is released from the buffer and
its time information can be utilized. If the verification
fails, then authenticity is not given. In this case, the
client MUST request authentic time from the server by means
other than broadcast messages. Also, the client MUST
re-initialize the broadcast sequence with a "client_bpar"
message if the one-way key chain expires, which it can check
via the disclosure schedule.See RFC 4082 for a detailed
description of the packet verification process.This message exchange is performed for an additional check of
packet timeliness in the course of the TESLA scheme, see .Before this message exchange is available, there are some
requirements that the client and server need to meet:They MUST negotiate the algorithm for the MAC used in the
time synchronization messages. Authenticity and integrity of the
communication MUST be ensured.The client MUST know a key input value KIV. Authenticity and
integrity of the communication MUST be ensured.Client and server MUST exchange the cookie (which depends on
the KIV as described in section ).
Authenticity, confidentiality and integrity of the communication
MUST be ensured.These requirements conform to those for the unicast time
synchronization exchange. Accordingly, they too can be realized via
the Association and Cookie Message Exchanges described in Appendix B.The keycheck exchange:guarantees to the client that the key belonging to the
respective TESLA interval communicated in the exchange had not
been disclosed before the client_keycheck message was sent.guarantees to the client the timeliness of any broadcast
packet secured with this key if it arrived before
client_keycheck was sent.A message of this type is sent by the client in order to initiate
an additional check of packet timeliness for the TESLA scheme. It
containsthe NTS message ID "client_keycheck",the NTS version number negotiated during association,a nonce,an interval number from the TESLA disclosure schedule,the MAC algorithm negotiated during association,the client's key input value KIV, andoptional: a MAC (generated with the cookie as key) for
verification of all of the above data.A message of this type is sent by the server upon receipt of a
client_keycheck message during the broadcast loop of the server.
Prior to this, the server MUST recalculate the client's cookie by
using the received key input value and the transmitted MAC
algorithm. It containsthe NTS message ID "server_keycheck"the version number as transmitted in "client_keycheck,the nonce transmitted in the client_keycheck message,the interval number transmitted in the client_keycheck
message, anda MAC (generated with the cookie as key) for verification of
all of the above data.A broadcast keycheck message exchange consists of the following
steps: The client sends a client_keycheck message. It MUST memorize
the nonce and the time interval number that it sends as a
correlated pair.Upon receipt of a client_keycheck message the server performs
as follows: If the client_keycheck message contains a MAC the
server re-calculates the MAC and compares this value with the
MAC in the received data.If the re-calculated MAC does not match the MAC in the
received data the server MUST stop the processing of the
request.If the re-calculated MAC matches the MAC in the received
data the server continues to process the request: It looks
up whether it has already disclosed the key associated with
the interval number transmitted in that message. If it has
not disclosed it, it constructs and sends the appropriate
server_keycheck message as described in . For more details, see also .The client awaits a reply in the form of a server_keycheck
message. On receipt, it performs the following checks:that the transmitted version number matches the one
negotiated previously,that the transmitted nonce belongs to a previous
client_keycheck message,that the TESLA interval number in that client_keycheck
message matches the corresponding interval number from the
server_keycheck, andthat the appended MAC verifies the received data.The server has to calculate a random seed which has to be kept
secret. The server MUST generate a seed for each supported MAC
algorithm, see .According to the requirements in , the
server MUST refresh each server seed periodically. Consequently, the
cookie memorized by the client becomes obsolete. In this case, the
client cannot verify the MAC attached to subsequent time response
messages and has to respond accordingly by re-initiating the protocol
with a cookie request ().MAC algorithms are used for calculation of the cookie and the
actual MAC. The client and the server negotiate a MAC algorithm during
the association phase at the beginning. The selected algorithm MUST be
used for all cookie and MAC creation processes in that run.Any MAC algorithm is prone to be compromised
in the future. A successful attack on a MAC algorithm would enable
any NTS client to derive the server seed from its own cookie.
Therefore, the server MUST have separate seed values for its
different supported MAC algorithms. This way, knowledge gained
from an attack on a MAC algorithm can at least only be used to
compromise such clients who use this algorithm as well.As mentioned, this document generically specifies security measures
whose utilization for any given specific time synchronization protocol
requires a separate document. Consequently, this document itself does
not have any IANA actions (TO BE REVIEWED).Aspects of security for time synchronization protocols are treated
throughout this document. For a comprehensive discussion of security
requirements in time synchronization contexts, refer to . See for a
tabular overview of how NTS deals with those requirements.Additional NTS specific discussion of security issues can be found in
the following subsections. Any separate document describing the utilization
of NTS to a specific time synchronization protocol may additionally
introduce discussion of its own specific security
considerations.The payload of time synchronization protocol packets of two-way
time transfer approaches like NTP and PTP consists basically of time
stamps, which are not considered secret .
Therefore, encryption of the time synchronization protocol packet's
payload is not considered in this document. However, an attacker can
exploit the exchange of time synchronization protocol packets for
topology detection and inference attacks as described in . To make such attacks more difficult, that draft
recommends the encryption of the packet payload. Yet, in the case of
time synchronization protocols the confidentiality protection of time
synchronization packet's payload is of secondary importance since the
packet's meta data (IP addresses, port numbers, possibly packet size
and regular sending intervals) carry more information than the
payload. To enhance the privacy of the time synchronization partners,
the usage of tunnel protocols such as IPsec and MACsec, where
applicable, is therefore more suited than confidentiality protection
of the payload.The client may wish to verify the validity of certificates during
the initial association phase. Since it generally has no reliable time
during this initial communication phase, it is impossible to verify
the period of validity of the certificates. To solve this
chicken-and-egg problem, the client has to rely on external means.According to , it is the
client's responsibility to initiate a new association with the server
after the server's certificate expires. To this end, the client reads
the expiration date of the certificate during the certificate message
exchange (). Furthermore, certificates
may also be revoked prior to the normal expiration date. To increase
security the client MAY periodically verify the state of the server's
certificate via Online Certificate Status Protocol (OCSP) Online Certificate Status Protocol (OCSP).TESLA authentication buffers packets for delayed authentication.
This makes the protocol vulnerable to flooding attacks, causing the
client to buffer excessive numbers of packets. To add stronger DoS
protection to the protocol, the client and the server use the "not
re-using keys" scheme of TESLA as pointed out in Section 3.7.2 of
RFC 4082. In this scheme the server
never uses a key for the MAC generation more than once. Therefore, the
client can discard any packet that contains a disclosed key it already
knows, thus preventing memory flooding attacks.Note that an alternative approach to
enhance TESLA's resistance against DoS attacks involves the
addition of a group MAC to each packet. This requires the exchange
of an additional shared key common to the whole group. This adds
additional complexity to the protocol and hence is currently not
considered in this document.In a packet delay attack, an adversary with the ability to act as a
MITM delays time synchronization packets between client and server
asymmetrically . This prevents the client from
accurately measuring the network delay, and hence its time offset to
the server . The delay attack does not modify
the content of the exchanged synchronization packets. Therefore,
cryptographic means do not provide a feasible way to mitigate this
attack. However, several non-cryptographic precautions can be taken in
order to detect this attack.Usage of multiple time servers: this enables the client to
detect the attack, provided that the adversary is unable to delay
the synchronization packets between the majority of servers. This
approach is commonly used in NTP to exclude incorrect time servers
.Multiple communication paths: The client and server utilize
different paths for packet exchange as described in the I-D . The client
can detect the attack, provided that the adversary is unable to
manipulate the majority of the available paths . Note that this approach is not yet available,
neither for NTP nor for PTP.Usage of an encrypted connection: the client exchanges all
packets with the time server over an encrypted connection (e.g.
IPsec). This measure does not mitigate the delay attack, but it
makes it more difficult for the adversary to identify the time
synchronization packets.For unicast-type messages: Introduction of a threshold value
for the delay time of the synchronization packets. The client can
discard a time server if the packet delay time of this time server
is larger than the threshold value.Additional provision against delay attacks has to be taken for
broadcast-type messages. This mode relies on the TESLA scheme which is
based on the requirement that a client and the broadcast server are
loosely time synchronized. Therefore, a broadcast client has to
establish time synchronization with its broadcast server before it
starts utilizing broadcast messages for time synchronization.One possible way to achieve this initial synchronization is to
establish a unicast association with its broadcast server until time
synchronization and calibration of the packet delay time is achieved.
After that, the client can establish a broadcast association with the
broadcast server and utilizes TESLA to verify integrity and
authenticity of any received broadcast packets.An adversary who is able to delay broadcast packets can cause a
time adjustment at the receiving broadcast clients. If the adversary
delays broadcast packets continuously, then the time adjustment will
accumulate until the loose time synchronization requirement is
violated, which breaks the TESLA scheme. To mitigate this
vulnerability the security condition in TESLA has to be supplemented
by an additional check in which the client, upon receipt of a
broadcast message, verifies the status of the corresponding key via a
unicast message exchange with the broadcast server (see for a detailed description of this
check). Note that a broadcast client should also apply the
above-mentioned precautions as far as possible.At various points of the protocol, the generation of random numbers
is required. The employed methods of generation need to be
cryptographically secure. See for guidelines
concerning this topic.The authors would like to thank Tal Mizrahi, Russ Housley, Steven
Bellovin, David Mills, Kurt Roeckx, Rainer Bermbach, Martin Langer and
Florian Weimer for discussions and comments on the design of NTS. Also,
thanks go to Harlan Stenn and Richard Welty for their technical review
and specific text contributions to this document.A game theoretic analysis of delay attacks against time
synchronization protocolsMulti-path Time ProtocolsIEEE standard for a precision clock synchronization protocol
for networked measurement and control systemsIEEE Instrumentation and Measurement Society. TC-9
Sensor TechnologyThe following table compares the NTS specifications against the
TICTOC security requirements .SectionRequirement from RFC 7384Requirement levelNTS5.1.1Authentication of ServersMUSTOK5.1.1Authorization of ServersMUSTOK5.1.2Recursive Authentication of Servers (Stratum 1)MUSTOK5.1.2Recursive Authorization of Servers (Stratum 1)MUSTOK5.1.3Authentication and Authorization of ClientsMAYOptional, Limited5.2Integrity protectionMUSTOK5.3Spoofing PreventionMUSTOK5.4Protection from DoS attacks against the time protocolSHOULDOK5.5Replay protectionMUSTOK5.6Key freshnessMUSTOKSecurity associationSHOULDOKUnicast and multicast associationsSHOULDOK5.7Performance: no degradation in quality of time transferMUSTOKPerformance: lightweight computationSHOULDOKPerformance: storageSHOULDOKPerformance: bandwidthSHOULDOK5.8Confidentiality protectionMAYNO5.9Protection against Packet Delay and Interception AttacksMUSTLimited*)5.10Secure modeMUSTOKHybrid modeSHOULD-*) See discussion in .This appendix presents a procedure that performs the association, the
cookie, and also the broadcast parameter message exchanges between a
client and a server. This procedure is one possible way to achieve the
preconditions listed in Sections , , and while taking into
account the objectives given in Section .This inherent association protocol applies X.509 certificates to
verify the authenticity of the time server and to exchange the cookie.
This is done in two separate message exchanges, described below. An
additional required exchange in advance serves to limit the
amplification potential of the association message exchange.A client needs a public/private key pair for encryption, with the
public key enclosed in a certificate. A server needs a public/private
key pair for signing, with the public key enclosed in a certificate.
If a participant intends to act as both a client and a server, it MUST
have two different key pairs for these purposes.If this protocol is employed, the hash value of the client's
certificate is used as the client's key input value, i.e. the cookie
is calculated according to:cookie = MSB_<b> (MAC(server seed, H(certificate of
client))),Where the hash function H is the one used in the MAC
algorithm. The client's certificate contains the client's public key
and enables the server to identify the client, if client authorization
is desired.This message exchange serves only to prevent the next (association)
exchange from being abusable for amplification denial-of-service
attacks.The access message exchange:transfers a secret value from the server to the client
(initiator),the secret value permits the client to initiate an
association message exchange.This message is sent by a client who intends to perform an
association exchange with the server in the future. It
contains:the NTS message ID "client_access".This message is sent by the server on receipt of a client_access
message. It contains:the NTS message ID "server_access",an access key.For an access exchange, the following steps are performed:The client sends a client_access message to the server.Upon receipt of a client_access, the server calculates the
access key. It then sends a reply in the form of a server_access
message. The server must either memorize the access key or
alternatively apply a means by which it can reconstruct the
access key. Note that in both cases the access key must be
correlated with the address of the requester. Note also that if
the server memorizes the access key for a requester, it has to
keep state for a certain amount of time.The client waits for a response in the form of a
server_access message. Upon receipt of one, it MUST memorize the
included access key.In this message exchange, the participants negotiate the MAC and
encryption algorithms that are used throughout the protocol. In
addition, the client receives the certification chain up to a trusted
anchor. With the established certification chain the client is able to
verify the server's signatures and, hence, the authenticity of future
NTS messages from the server is ensured.The association exchange:enables the client to verify any communication with the
server as authentic,lets the participants negotiate NTS version and
algorithms,guarantees authenticity and integrity of the negotiation
result to the client,guarantees to the client that the negotiation result is based
on the client's original, unaltered request.This message is sent by the client if it wants to perform
association with a server. It contains the NTS message ID "client_assoc",a nonce,the access key obtained earlier via an access message
exchange,the version number of NTS that the client wants to use (this
SHOULD be the highest version number that it supports),a selection of accepted MAC algorithms, anda selection of accepted encryption algorithms.This message is sent by the server upon receipt of client_assoc.
It contains the NTS message ID "server_assoc",the nonce transmitted in client_assoc,the client's proposal for the version number, selection of
accepted MAC algorithms and selection of accepted encryption
algorithms, as transmitted in client_assoc,the version number used for the rest of the protocol (which
SHOULD be determined as the minimum over the client's suggestion
in the client_assoc message and the highest supported by the
server),the server's choice of algorithm for encryption and for MAC
creation, all of which MUST be chosen from the client's
proposals,a signature, calculated over the data listed above, with the
server's private key and according to the signature algorithm
which is also used for the certificates that are included (see
below), anda chain of certificates, which starts at the server and goes
up to a trusted authority; each certificate MUST be certified by
the one directly following it.For an association exchange, the following steps are performed:
The client sends a client_assoc message to the server. It
MUST keep the transmitted values for the version number and
algorithms available for later checks.Upon receipt of a client_assoc message, the server checks the
validity of the included access key. If it is not valid, the
server MUST abort communication. If it is valid, the server
constructs and sends a reply in the form of a server_assoc
message as described in . Upon
unsuccessful negotiation for version number or algorithms the
server_assoc message MUST contain an error code.The client waits for a reply in the form of a server_assoc
message. After receipt of the message it performs the following
checks: The client checks that the message contains a conforming
version number.It checks that the nonce sent back by the server matches
the one transmitted in client_assoc,It also verifies that the server has chosen the
encryption and MAC algorithms from its proposal sent in the
client_assoc message and that this proposal was not
altered.Furthermore, it performs authenticity checks on the
certificate chain and the signature.If one of the checks fails, the client MUST abort the
run.During this message exchange, the server transmits a secret cookie
to the client securely. The cookie will later be used for integrity
protection during unicast time synchronization.The cookie exchange:enables the server to check the client's authorization via
its certificate (optional),supplies the client with the correct cookie and corresponding
KIV for its association to the server,guarantees to the client that the cookie originates from the
server and that it is based on the client's original, unaltered
request.guarantees that the received cookie is unknown to anyone but
the server and the client.This message is sent by the client upon successful authentication
of the server. In this message, the client requests a cookie from
the server. The message contains the NTS message ID "client_cook",a nonce,the negotiated version number,the negotiated signature algorithm,the negotiated encryption algorithm,the negotiated MAC algorithm,the client's certificate.This message is sent by the server upon receipt of a client_cook
message. The server generates the hash (the used hash function is
the one used for the MAC algorithm) of the client's certificate, as
conveyed during client_cook, in order to calculate the cookie
according to . This message contains the NTS message ID "server_cook"the version number as transmitted in client_cook,a concatenated datum which is encrypted with the client's
public key, according to the encryption algorithm transmitted in
the client_cook message. The concatenated datum contains the nonce transmitted in client_cook, andthe cookie.a signature, created with the server's private key,
calculated over all of the data listed above. This signature
MUST be calculated according to the transmitted signature
algorithm from the client_cook message.For a cookie exchange, the following steps are performed: The client sends a client_cook message to the server. The
client MUST save the included nonce until the reply has been
processed.Upon receipt of a client_cook message, the server checks
whether it supports the given cryptographic algorithms. It then
calculates the cookie according to the formula given in . The server MAY use the client's certificate
to check that the client is authorized to use the secure time
synchronization service. With this, it MUST construct a
server_cook message as described in .The client awaits a reply in the form of a server_cook
message; upon receipt it executes the following actions: It verifies that the received version number matches the
one negotiated beforehand.It verifies the signature using the server's public key.
The signature has to authenticate the encrypted data.It decrypts the encrypted data with its own private
key.It checks that the decrypted message is of the expected
format: the concatenation of a nonce and a cookie of the
expected bit lengths.It verifies that the received nonce matches the nonce
sent in the client_cook message.If one of those checks fails, the client MUST abort the
run.In this message exchange, the client receives the necessary
information to execute the TESLA protocol in a secured broadcast
association. The client can only initiate a secure broadcast
association after successful association and cookie exchanges and
only if it has made sure that its clock is roughly synchronized to
the server's.See Appendix for
more details on TESLA.The broadcast parameter exchangeprovides the client with all the information necessary to
process broadcast time synchronization messages from the
server, andguarantees authenticity, integrity and freshness of the
broadcast parameters to the client.This message is sent by the client in order to establish a
secured time broadcast association with the server. It
containsthe NTS message ID "client_bpar",the NTS version number negotiated during association,a nonce, andthe signature algorithm negotiated during association.This message is sent by the server upon receipt of a
client_bpar message during the broadcast loop of the server. It
containsthe NTS message ID "server_bpar",the version number as transmitted in the client_bpar
message,the nonce transmitted in client_bpar,the one-way functions used for building the key chain,
andthe disclosure schedule of the keys. This contains:the last key of the key chain,time interval duration,the disclosure delay (number of intervals between use
and disclosure of a key),the time at which the next time interval will start,
andthe next interval's associated index.The message also contains a signature signed by the server
with its private key, verifying all the data listed above.A broadcast parameter exchange consists of the following steps:
The client sends a client_bpar message to the server. It
MUST remember the transmitted values for the nonce, the
version number and the signature algorithm.Upon receipt of a client_bpar message, the server
constructs and sends a server_bpar message as described in
.The client waits for a reply in the form of a server_bpar
message, on which it performs the following checks: The message must contain all the necessary information
for the TESLA protocol, as listed in .The message must contain a nonce belonging to a
client_bpar message that the client has previously
sent.Verification of the message's signature.If any information is missing or if the server's
signature cannot be verified, the client MUST abort the
broadcast run. If all checks are successful, the client MUST
remember all the broadcast parameters received for later
checks.For broadcast-type messages, NTS adopts the TESLA protocol with some
customizations. This appendix provides details on the generation and
usage of the one-way key chain collected and assembled from . Note that NTS uses the "not re-using keys" scheme of
TESLA as described in Section 3.7.2. of .Server setup:The server determines a reasonable upper bound B on the network
delay between itself and an arbitrary client, measured in
milliseconds.It determines the number n+1 of keys in the one-way key chain.
This yields the number n of keys that are usable to authenticate
broadcast packets. This number n is therefore also the number of
time intervals during which the server can send authenticated
broadcast messages before it has to calculate a new key chain.It divides time into n uniform intervals I_1, I_2, ..., I_n.
Each of these time intervals has length L, measured in
milliseconds. In order to fulfill the requirement 3.7.2. of RFC
4082, the time interval L has to be shorter than the time interval
between the broadcast messages.The server generates a random key K_n.Using a one-way function F, the server generates a one-way
chain of n+1 keys K_0, K_1, ..., K_{n} according to K_i = F(K_{i+1}).Using another one-way function F', it generates a sequence of n
MAC keys K'_0, K'_1, ..., K'_{n-1} according toK'_i = F'(K_i).Each MAC key K'_i is assigned to the time interval I_i.The server determines the key disclosure delay d, which is the
number of intervals between using a key and disclosing it. Note
that although security is provided for all choices d>0, the
choice still makes a difference: If d is chosen too short, the client might discard packets
because it fails to verify that the key used for its MAC has
not yet been disclosed.If d is chosen too long, the received packets have to be
buffered for an unnecessarily long time before they can be
verified by the client and be subsequently utilized for time
synchronization.It is RECOMMENDED that the server calculate d according
tod = ceil( 2*B / L) + 1,where ceil yields the smallest integer greater than or
equal to its argument.A client needs the following information in order to participate in
a TESLA broadcast:One key K_i from the one-way key chain, which has to be
authenticated as belonging to the server. Typically, this will be
K_0.The disclosure schedule of the keys. This consists of:the length n of the one-way key chain,the length L of the time intervals I_1, I_2, ..., I_n,the starting time T_i of an interval I_i. Typically this is
the starting time T_1 of the first interval;the disclosure delay d.The one-way function F used to recursively derive the keys in
the one-way key chain,The second one-way function F' used to derive the MAC keys
K'_0, K'_1, ... , K'_n from the keys in the one-way chain.An upper bound D_t on how far its own clock is "behind" that of
the server.Note that if D_t is greater than (d - 1) * L, then some
authentic packets might be discarded. If D_t is greater than d * L,
then all authentic packets will be discarded. In the latter case, the
client SHOULD NOT participate in the broadcast, since there will be no
benefit in doing so.During each time interval I_i, the server sends at most one
authenticated broadcast packet P_i. Such a packet consists of: a message M_i,the index i (in case a packet arrives late),a MAC authenticating the message M_i, with K'_i used as
key,the key K_{i-d}, which is included for disclosure.When a client receives a packet P_i as described above, it first
checks that it has not already received a packet with the same
disclosed key. This is done to avoid replay/flooding attacks. A packet
that fails this test is discarded.Next, the client begins to check the packet's timeliness by
ensuring that according to the disclosure schedule and with respect to
the upper bound D_t determined above, the server cannot have disclosed
the key K_i yet. Specifically, it needs to check that the server's
clock cannot read a time that is in time interval I_{i+d} or later.
Since it works under the assumption that the server's clock is not
more than D_t "ahead" of the client's clock, the client can calculate
an upper bound t_i for the server's clock at the time when P_i
arrived. This upper bound t_i is calculated according to t_i = R + D_t,where R is the client's clock at the arrival of P_i. This implies
that at the time of arrival of P_i, the server could have been in
interval I_x at most, withx = floor((t_i - T_1) / L) + 1,where floor gives the greatest integer less than or equal to
its argument. The client now needs to verify that x < i+dis valid (see also Section 3.5 of ).
If it is falsified, it is discarded.If the check above is successful, the client performs another more
rigorous check: it sends a key check request to the server (in the
form of a client_keycheck message), asking explicitly if K_i has
already been disclosed. It remembers the time stamp t_check of the
sending time of that request as well as the nonce it used correlated
with the interval number i. If it receives an answer from the server
stating that K_i has not yet been disclosed and it is able to verify
the HMAC on that response, then it deduces that K_i was undisclosed at
t_check and therefore also at R. In this case, the client accepts P_i
as timely.Next the client verifies that a newly disclosed key K_{i-d} belongs
to the one-way key chain. To this end, it applies the one-way function
F to K_{i-d} until it can verify the identity with an earlier
disclosed key (see Clause 3.5 in RFC 4082, item 3).Next the client verifies that the transmitted time value s_i
belongs to the time interval I_i, by checking T_i =< s_i, ands_i < T_{i+1}.If it is falsified, the packet MUST be discarded and the
client MUST reinitialize its broadcast module by performing time
synchronization by other means than broadcast messages, and it MUST
perform a new broadcast parameter exchange (because a falsification of
this check yields that the packet was not generated according to
protocol, which suggests an attack).If a packet P_i passes all the tests listed above, it is stored for
later authentication. Also, if at this time there is a package with
index i-d already buffered, then the client uses the disclosed key
K_{i-d} to derive K'_{i-d} and uses that to check the MAC included in
package P_{i-d}. Upon success, it regards M_{i-d} as
authenticated.