TICTOC Tal Mizrahi Internet Draft Marvell Intended status: Standards Track Expires: January 2012 July 4, 2011 UDP Checksum Trailer in Timing Protocols draft-mizrahi-tictoc-checksum-trailer-00.txt Abstract Various time synchronization and delay measurement protocols are transported over UDP, e.g., PTP, NTP, and OWAMP/TWAMP. These protocols use timestamped packets that often have to be modified by intermediate nodes in the network. In such cases the UDP checksum field must be updated to reflect these modifications. The IEEE 1588 standard suggests to append 2 octets to every protocol message, allowing intermediate nodes to reflect the checksum modification in the last 2 octets rather than in the UDP checksum field. This document generalizes this concept, and defines a UDP Checksum Trailer for NTP and for OWAMP/TWAMP. Status of this Memo This Internet-Draft is submitted to IETF in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on January 4, 2012. Mizrahi, T. Expires January 4, 2012 [Page 1] Internet-Draft UDP Checksum Trailer July 2011 Copyright Notice Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction................................................2 2. Conventions used in this document............................4 3. Abbreviations...............................................4 4. UDP Checksum Trailer.........................................4 4.1. Overview...............................................4 4.2. NTP....................................................5 4.2.1. Transmission of NTP with Checksum Trailer...........6 4.2.2. Intermediate Updates of NTP with Checksum Trailer...6 4.2.3. Reception of NTP with Checksum Trailer.............6 4.3. OWAMP / TWAMP..........................................6 4.3.1. Transmission of OWAMP with Checksum Trailer.........7 4.3.2. Intermediate Updates of OWAMP with Checksum Trailer.8 4.3.3. Reception of OWAMP with Checksum Trailer...........8 4.4. PTP....................................................8 4.4.1. PTP over IPv6......................................8 4.4.2. PTP over IPv4......................................8 4.5. Interoperability with Existing Implementations...........8 5. Security Considerations......................................9 6. IANA Considerations.........................................9 7. Acknowledgments.............................................9 8. References..................................................9 8.1. Normative References....................................9 8.2. Informative References.................................10 1. Introduction Various timing protocols are used for time synchronization and delay measurement. Some of these protocols are transported over the User Datagram Protocol ([UDP]). Mizrahi, T. Expires January 4, 2012 [Page 2] Internet-Draft UDP Checksum Trailer July 2011 Specifically, this document discusses the following timing protocols: o The Network Time Protocol (NTP), as defined in [NTPv4] and in previous versions of this protocol. o The One-Way Active Measurement Protocol ([OWAMP]) and the Two-Way Active Measurement Protocol ([TWAMP]). o The Precision Time Protocol (PTP), as defined in [IEEE 1588]. Timing protocols sometimes require an intermediate node to assign or to change a timestamp in the packet payload. An intermediate node in the context of this document is one of two possible entities: o Transparent Clocks (TC) in PTP are intermediate nodes in the network that update a "Correction Field" in the PTP packet by adding the latency caused by the current TC. There is no equivalent entity in NTP and OWAMP/TWAMP. o A transmitting node in a timing protocol may consist of several modules or blocks. For example, it may consist of a CPU and an ASIC, where protocol packets are typically generated by the CPU, and timestamps are added by the ASIC. In such cases, the ASIC is referred to as an intermediate node in the context of this document. When the UDP payload is changed by an intermediate node, the UDP Checksum field must be updated to maintain its correctness. When using UDP over IPv4 ([UDP]), an intermediate node that cannot update the value of the UDP checksum can assign a value of zero to the checksum field, causing the receiver to ignore the checksum field. UDP over IPv6, as defined in [IPv6], does not allow a zero checksum, and requires the UDP checksum field to contain a correct checksum of the UDP payload. Since an intermediate node only modifies a specific field in the packet, i.e. the timestamp field, the UDP checksum update can be performed incrementally, using the concepts presented in [Checksum]. Annex E of [IEEE 1588] defines that in PTP over IPv6 packets two octets are appended to the end of the PTP payload for UDP checksum updates. The value of these two octets can be updated by an intermediate node, causing the value of the UDP checksum field to remain correct. Mizrahi, T. Expires January 4, 2012 [Page 3] Internet-Draft UDP Checksum Trailer July 2011 The term Checksum Trailer is used throughout this document and refers to the 2 octets at the end of the UDP payload, used for updating the UDP checksum by intermediate nodes. The usage of the Checksum Trailer may in some cases simplify the implementation, since if the packet data is processed in a serial order, it is simpler to first update the timestamp field, and then update the Checksum Trailer rather than to update the timestamp and then update the UDP checksum, residing at the UDP header. This document generalizes the concept presented in Annex E of [IEEE 1588] defines the Checksum Trailer for NTP and for OWAMP / TWAMP. 2. Conventions used in this document 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 [KEYWORDS]. 3. Abbreviations NTP Network Time Protocol OWAMP One-Way Active Measurement Protocol PTP Precision Time Protocol TWAMP Two-Way Active Measurement Protocol UDP User Datagram Protocol 4. UDP Checksum Trailer 4.1. Overview The UDP Checksum Trailer is a two-octet trailer that is appended to the end of the UDP payload. The Length field in the UDP header counts the number of octets in the UDP header and payload, including the Checksum Trailer. Mizrahi, T. Expires January 4, 2012 [Page 4] Internet-Draft UDP Checksum Trailer July 2011 +--------------------------------+ | IPv4 / IPv6 Header | .................+--------------------------------+ ^ | UDP Header | | .........+--------------------------------+ | ^ | | UDP | | NTP / PTP / OWAMP / TWAMP | Length UDP | packet | | Payload +--------------------------------+ | | |UDP Checksum Trailer (2 octets) | v v +--------------------------------+ Figure 1 Checksum Trailer in Timing Protocol Packets 4.2. NTP NTP is transported over UDP, either over IPv4 or over IPv6. This section applies to both NTP over IPv4, and NTP over IPv6. NTP packets may include one or more extension fields, as defined in [NTPv4]. The Checksum Trailer in NTP packets resides in a dedicated NTP extension field, as shown in Figure 2. If the NTP packet includes more than one extension field, the Checksum Trailer extension is always the last extension field. Thus, when NTP authentication is disabled, the Checksum Trailer is the last 2 octets in the UDP payload, and thus the trailer is located at UDP Length - 2 octets after the beginning of the UDP header. When NTP authentication is enabled, the Checksum Trailer is the last 2 octets before the Key Identifier. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Field Type | Length = 16 octets | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Padding | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Checksum Trailer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 2 NTP Checksum Trailer Extension Field Mizrahi, T. Expires January 4, 2012 [Page 5] Internet-Draft UDP Checksum Trailer July 2011 Field Type A dedicated Field Type value is used to identify the Checksum Trailer extension. See Section 6 for further details. Length The Checksum Trailer extension field length is the minimal extension field length defined in [NTPv4], which is 16 octets. Padding The extension field includes 6 octets of padding. This field SHOULD be set to 0, and SHOULD be ignored by the recipient. Checksum Trailer Includes the UDP Checksum Trailer field. 4.2.1. Transmission of NTP with Checksum Trailer The transmitter of an NTP packet MAY include a Checksum Trailer extension field. 4.2.2. Intermediate Updates of NTP with Checksum Trailer An intermediate node that receives and alters an NTP packet containing a Checksum Trailer extension MAY alter the Checksum Trailer in order to maintain a correct UDP checksum value. 4.2.3. Reception of NTP with Checksum Trailer This document does not impose new requirements on the receiving end of an NTP packet. The UDP layer at the receiving end verifies the UDP Checksum of received NTP packets, and the NTP layer SHOULD ignore the Checksum Trailer extension field. 4.3. OWAMP / TWAMP The One-Way Active Measurement Protocol ([OWAMP]), and the Two-Way Active Measurement Protocol ([TWAMP]) both make use of timestamped test packets. The test packet format is defined in [OWAMP]. This document refers to OWAMP and TWAMP alike, but the rest of this section refers only to OWAMP for short. Mizrahi, T. Expires January 4, 2012 [Page 6] Internet-Draft UDP Checksum Trailer July 2011 OWAMP is transported over UDP, either over IPv4 or over IPv6. This section applies to both OWAMP over IPv4, and OWAMP over IPv6. OWAMP test packets contain a Packet Padding field. The Checksum Trailer in OWAMP packets resides in the last 2 octets of the Packet Padding field. Therefore, the Checksum Trailer is always the last 2 octets in the UDP payload, and thus the trailer is located at UDP Length - 2 octets after the beginning of the UDP header. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Timestamp | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Error Estimate | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | . Packet Padding . . . | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Checksum Trailer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Figure 3 Checksum Trailer in OWAMP Test Packets In OWAMP, the length of the Packet Padding field is announced during the session initiation through the "Padding Length" field in the Request-Session message. When a Checksum Trailer is included, the "Padding Length" is the length of the padding including the Checksum Trailer. 4.3.1. Transmission of OWAMP with Checksum Trailer The transmitter of an OWAMP test packet MAY include a Checksum Trailer field, incorporated in the last 2 octets of the Packet Padding. A transmitter that includes a Checksum Trailer in its outgoing OWAMP test packets MUST include a Packet Padding in OWAMP test packets, whose length is at least 2 octets. Mizrahi, T. Expires January 4, 2012 [Page 7] Internet-Draft UDP Checksum Trailer July 2011 4.3.2. Intermediate Updates of OWAMP with Checksum Trailer An intermediate node that receives and alters an OWAMP test packet MAY alter the Checksum Trailer in order to maintain a correct UDP checksum value. 4.3.3. Reception of OWAMP with Checksum Trailer This document does not impose new requirements on the receiving end of an OWAMP packet. The UDP layer at the receiving end verifies the UDP Checksum of received OWAMP packets, and the OWAMP layer SHOULD treat the Checksum Trailer as part of the Packet Padding. 4.4. PTP The behavior of PTP over UDP is defined in [IEEE 1588], and is described here as an informational section, for the sake of completeness. 4.4.1. PTP over IPv6 Annex E of [IEEE 1588] defines the transport of PTP messages over UDP-over-IPv6. The transmitter of PTP over IPv6 extends the payload of the PTP messages by two octets. These two octets can be used by intermediate nodes as a Checksum Trailer. The Checksum Trailer is always the last 2 octets in the UDP payload, and thus the trailer is located at UDP Length - 2 octets after the beginning of the UDP header. 4.4.2. PTP over IPv4 When PTP is transported over UDP-over-IPv4, intermediate nodes that alter the packet can either update the UDP checksum or clear its value to 0, causing subsequent nodes to ignore the checksum field. A Checksum Trailer is currently not defined for PTP over IPv4. 4.5. Interoperability with Existing Implementations The behavior defined in Sections 4.2 and 4.3 for NTP and OWAMP does not impose new requirements on receiving nodes. Thus, transmitters and intermediate nodes that support the Checksum Trailer can transparently interoperate with existing implementations. Mizrahi, T. Expires January 4, 2012 [Page 8] Internet-Draft UDP Checksum Trailer July 2011 5. Security Considerations This document discusses timing protocol packets that are altered by intermediate nodes in the network. When message Authentication is used, intermediate nodes that alter the packet must also re-compute the MAC accordingly. If the protocol packets are encrypted, intermediate nodes must decrypt, modify, and then re-encrypt the packets. Otherwise, the concepts in this document are applicable to secure timing packets. 6. IANA Considerations IANA is requested to allocate an NTP extension Field Type value for the Checksum Trailer extension. 7. Acknowledgments This document was prepared using 2-Word-v2.0.template.dot. 8. References 8.1. Normative References [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [IPv6] Deering, S., Hinden, R., "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998. [Checksum] Rijsinghani, A., "Computation of the Internet Checksum via Incremental Update", RFC 1624, May 1994. [UDP] Postel, J., "User Datagram Protocol", RFC 768, August 1980. [NTPv4] Mills, D., Delaware, U., Martin, J., Burbank, J., Kasch, W., "Network Time Protocol Version 4: Protocol and Algorithms Specification", RFC 5905, June 2010. [OWAMP] Shalunov, S., Teitelbaum, B., Karp, A., Boote, J., and Zekauskas, M., "A One-way Active Measurement Protocol (OWAMP)", RFC 4656, September 2006. Mizrahi, T. Expires January 4, 2012 [Page 9] Internet-Draft UDP Checksum Trailer July 2011 [TWAMP] Hedayat, K., Krzanowski, R., Morton, A., Yum, K., and Babiarz, J., "A Two-Way Active Measurement Protocol (TWAMP)", RFC 5357, October 2008. 8.2. Informative References [IEEE 1588] IEEE TC 9 Test and Measurement Society 2000, "1588 IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems Version 2", IEEE Standard, 2008. Authors' Addresses Tal Mizrahi Marvell 6 Hamada St. Yokneam, 20692 Israel Email: talmi@marvell.com Mizrahi, T. Expires January 4, 2012 [Page 10]