INTERNET-DRAFT N. Elkins Inside Products R. Hamilton Chemical Abstracts Service M. Ackermann Intended Status: Proposed Standard BCBS Michigan Expires:March 27,August 10, 2017 February 6, 2017September 23, 2016IPv6 Performance and Diagnostic Metrics (PDM) Destination Optiondraft-ietf-ippm-6man-pdm-option-06draft-ietf-ippm-6man-pdm-option-07 Abstract To assess performance problems, measurements based on optional sequence numbers and timing may be embedded in each packet. Such measurements may be interpreted in real-time or after the fact. An implementation of the existing IPv6 Destination Options extension header, the Performance and Diagnostic Metrics (PDM) Destination Options extension header as well as the field limits, calculations, and usage of the PDM in measurement are included in this document. 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/1id-abstracts.html The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html Copyright and License Notice Copyright (c)20162017 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: 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 Background . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2 End User Quality of Service (QoS) . . . . . . . . . . . . . 4 1.3 Need for a Packet Sequence Number . . . . . . . . . . . . . 5 1.4 Rationale for defined solution . . . . . . . . . . . . . . . 5 1.5 PDM Works in Collaboration with Other Headers . . . . . . . 6 1.6 IPv6 Transition Technologies . . . . . . . . . . . . . . . . 6 2 Measurement Information Derived from PDM . . . . . . . . . . . . 6 2.1 Round-Trip Delay . . . . . . . . . . . . . . . . . . . . . . 7 2.2 Server Delay . . . . . . . . . . . . . . . . . . . . . . . . 7 3 Performance and Diagnostic Metrics Destination Option Layout . . 7 3.1 Destination Options Header . . . . . . . . . . . . . . . . . 7 3.2 Performance and Diagnostic Metrics Destination Option . . . 73.3 Header Placement3.2.1 PDM Layout . . . . . . . . . . . . . . . . . . . . . .10 3.4 Header Placement Using IPSec ESP Mode. 7 3.2.2 Base Unit for Time Measurement . . . . . . . . . .11 3.5 Implementation Considerations. . . 10 3.2.3 Considerations of this time-differential representation . . . . . . . . . . . .12 3.6 Dynamic Configuration Options. . . . . . . . . 10 3.2.3.1 Limitations with this encoding method . . . . . .12 3.6 5-tuple Aging. 11 3.2.3.2 Loss of precision induced by timer value truncation . . . . . . . . . . . . . . . . . . . . . 11 3.3 Header Placement .12 4 Considerations of Timing Representation. . . . . . . . . . . .12 4.1 Encoding the Delta-Time Values. . . . . . . . . 12 3.4 Header Placement Using IPSec ESP Mode . . . . . . .12 4.2 Timer registers are different on different hardware. . . . 134.3 Timer Units on Other Systems3.4.1 Using ESP Transport Mode . . . . . . . . . . . . . . . . 134.4 Time Base3.4.2 Using ESP Tunnel Mode . . . . . . . . . . . . . . . . . 14 3.5 Implementation Considerations . . . . . . . . . . . . . . . 144.5 Timer-value scaling3.6 Dynamic Configuration Options . . . . . . . . . . . . . . . 15 3.6 5-tuple Aging . . . . .14 4.6 Limitations with this encoding method. . . . . . . . . . .15 4.7 Lack of precision induced by timer value truncation. . . .16 5. . . 15 4 PDM Flow - Simple Client Server . . . . . . . . . . . . . . . .17 5.115 4.1 Step 1 . . . . . . . . . . . . . . . . . . . . . . . . . . .17 5.216 4.2 Step 2 . . . . . . . . . . . . . . . . . . . . . . . . . . .19 5.317 4.3 Step 3 . . . . . . . . . . . . . . . . . . . . . . . . . . .19 5.417 4.4 Step 4 . . . . . . . . . . . . . . . . . . . . . . . . . . .21 5.518 4.5 Step 5 . . . . . . . . . . . . . . . . . . . . . . . . . . .22 619 5 Other Flows . . . . . . . . . . . . . . . . . . . . . . . . . .22 6.120 5.1 PDM Flow - One Way Traffic . . . . . . . . . . . . . . . . .22 6.220 5.2 PDM Flow - Multiple Send Traffic . . . . . . . . . . . . . .23 6.321 5.3 PDM Flow - Multiple Send with Errors . . . . . . . . . . . .24 722 6 Potential Overhead Considerations . . . . . . . . . . . . . . .26 823 7 Security Considerations . . . . . . . . . . . . . . . . . . . .27 8.1.24 7.1. SYN Flood and Resource Consumption Attacks . . . . . . . .27 8.224 7.2 Pervasive monitoring . . . . . . . . . . . . . . . . . . .27 8.325 7.3 PDM as a Covert Channel . . . . . . . . . . . . . . . . . .28 925 7.4 Timing Attacks . . . . . . . . . . . . . . . . . . . . . . . 26 8 IANA Considerations . . . . . . . . . . . . . . . . . . . . . .28 1026 9 References . . . . . . . . . . . . . . . . . . . . . . . . . .29 10.1. 27 9.1 Normative References . . . . . . . . . . . . . . . . . . .29 10.2. 27 9.2 Informative References . . . . . . . . . . . . . . . . . .29 11 Acknowledgments. 27 Appendix A : Timing Considerations . . . . . . . . . . . . . . . . 28 A.1 Time Differential Calculations . . . . . . .29 Authors' Addresses. . . . . . . . 28 Acknowledgments . . . . . . . . . . . . . . . .30 1 Background To assess performance problems, measurements based on optional sequence numbers and timing may be embedded in each. . . . . . . . . 29 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 29 1 Background To assess performance problems, measurements based on optional sequence numbers and timing may be embedded in each packet. Such measurements may be interpreted in real-time or after the fact. As defined in RFC2460 [RFC2460], destination options are carried by the IPv6 Destination Options extension header. Destination options include optional information that need be examined only by the IPv6 node given as the destination address in the IPv6 header, not by routers or other "middle boxes". This document specifies a new destination option, the Performance and Diagnostic Metrics (PDM) destination option. This document specifies the layout, field limits, calculations, and usage of the PDM in measurement. 1.1 Terminology 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 [RFC2119]. 1.2 End User Quality of Service (QoS) The timing values in the PDM embedded in the packet will be used to estimate QoS as experienced by an end user device. For many applications, the key user performance indicator is response time. When the end user is an individual, he is generally indifferent to what is happening along the network; what he really cares about is how long it takes to get a response back. But this is not just a matter of individuals' personal convenience. In many cases, rapid response is critical to the business being conducted. When the end user is a device (e.g. with the Internet of Things), what matters is the speed with which requested data can be transferred -- specifically, whether the requested data can be transferred in time to accomplish the desired actions. This can be important when the relevant external conditions are subject to rapid change. Low, reliable and acceptableresponsesresponse times are not just "nice to have". On many networks, the impact can be financial hardship or can endanger human life. In some cities, the emergency police contact system operates overIP,IP; lawenforcement uses TCP/IP networks,enforcement, at all levels, use IP networks; transactions on our stock exchanges are settled using IP networks. The critical nature of such activities to our daily lives and financial well-being demand a simple solution to support response time measurements. 1.3 Need for a Packet Sequence Number While performing network diagnostics of an end-to-end connection, it often becomes necessary to isolate the factors along the network path responsible for problems. Diagnostic data may be collected at multiple places along the path (if possible), or at the source and destination. Then, in post-collection processing, the diagnostic data corresponding to each packet at different observation points must be matched for proper measurements. A sequence number in each packet provides sufficient basis for the matching process. If need be, the timing fields may be used along with the sequence number to ensure uniqueness. This method of data collection along the path is of special use to determine where packet loss or packet corruption is happening. The packet sequence number needs to be unique in the context of the session (5-tuple). See section 2 for a definition of 5-tuple. 1.4 Rationale for defined solution The current IPv6 specification does not provide timing nor a similar field in the IPv6 main header or in any extension header. So, we define the IPv6 Performance and Diagnostic Metrics destination option (PDM). Advantages include: 1. Real measure of actual transactions. 2. Independence from transport layer protocols. 3. Ability to span organizational boundaries with consistent instrumentation 4. No time synchronization needed between session partners 5. Ability to handle all transport protocols (TCP, UDP, SCTP, etc) in a uniform way The PDM provides the ability toquicklydetermine quickly if the (latency) problem is in the network or in the server (application). More intermediate measurements may be needed if the host or network discrimination is not sufficient. At the client, TCP/IP stack time vs.applicationsapplication time may still need to be broken out by client software. 1.5 PDM Works in Collaboration with Other Headers The purpose of the PDM is not to supplant all the variables present in all other headers but to provide data which is not available or very difficult to get. The way PDM would be used is by a technician (or tool) looking at a packet capture. Within the packet capture, they would have available to them the layer 2 header, IP header (v6 or v4), TCP, UCP, ICMP, SCTP or other headers. All information would be looked at together to make sense of the packet flow. The technician or processing tool could analyze, report or ignore the data from PDM, as necessary. For an example of how PDM can help with TCP retransmit problems, please look at section 8. 1.6 IPv6 Transition Technologies In the path to full implementation of IPv6, transition technologies such as translation or tunneling may be employed. The PDM header is not expected to work in such scenarios. It is likely that an IPv6 packet containing PDM will be dropped if using IPv6 transition technologies. 2 Measurement Information Derived from PDM Each packet contains information about the sender and receiver. In IP protocol, the identifying information is called a "5-tuple". The 5-tuple consists of: SADDR : IP address of the sender SPORT : Port for sender DADDR : IP address of the destination DPORT : Port for destination PROTC : Protocol for upper layer (ex. TCP, UDP, ICMP, etc.) The PDM contains the following base fields: PSNTP : Packet Sequence Number This Packet PSNLR : Packet Sequence Number Last Received DELTATLR : Delta Time Last Received DELTATLS : Delta Time Last Sent Other fields forscaling andstoring timebasescaling factors are also in the PDM and will be described in section 3. This information, combined with the 5-tuple, allows the measurement of the following metrics: 1. Round-trip delay 2. Server delay 2.1 Round-Trip Delay Round-trip *Network* delay is the delay for packet transfer from a source host to a destination host and then back to the source host. This measurement has been defined, and the advantages and disadvantages discussed in "A Round-trip Delay Metric for IPPM" [RFC2681]. 2.2 Server Delay Server delay is the interval between when a packet is received by a device and the first corresponding packet is sent back in response. This may be "Server Processing Time". It may also be a delay caused by acknowledgements. Server processing time includes the time taken by the combination of the stack and application to return the response. The stack delay may be related to network performance. If this aggregate time is seen as a problem, and there is a need to make a clear distinction between application processing time and stack delay, including that caused by the network, then more client based measurements are needed. 3 Performance and Diagnostic Metrics Destination Option Layout 3.1 Destination Options Header The IPv6 Destination Options Header is used to carry optional information that needs to be examined only by a packet's destination node(s). The Destination Options Header is identified by a Next Header value of 60 in the immediately preceding header and is defined in RFC2460 [RFC2460]. The IPv6 Performance and Diagnostic Metrics Destination Option (PDM) is an implementation of the Destination Options Header. The PDM does not require time synchronization. 3.2 Performance and Diagnostic Metrics Destination Option 3.2.1 PDM Layout The IPv6 Performance and Diagnostic Metrics Destination Option (PDM) contains the following fields:TIMEBASE : Base timer unitSCALEDTLR: Scale for Delta Time Last Received SCALEDTLS: Scale for Delta Time Last Sent PSNTP : Packet Sequence Number This Packet PSNLR : Packet Sequence Number Last Received DELTATLR : Delta Time Last Received DELTATLS : Delta Time Last Sent The PDM destination option is encoded in type-length-value (TLV) format as follows: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length|TB |ScaleDTLR| ScaleDTLR | ScaleDTLS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | PSN This Packet | PSN Last Received | |-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Delta Time Last Received | Delta Time Last Sent | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type TBD = 0xXX (TBD) [To be assigned by IANA] [RFC2780] Option Length 8-bit unsigned integer. Length of the option, in octets, excluding the Option Type and Option Length fields. This field MUST be set to 16.Time Base 2-bit binary value. It will indicate the lowest granularity possible for this device. That is, for a value of 00 in the Time Base field, a value of 1 in the DELTA fields indicates 1 millisecond. This field is being included so that a device may choose the granularity which most suits its timer ticks. That is, so that it does not have to do more work than needed to convert values required for the PDM. The possible values of Time Base are as follows: 00 - milliseconds 01 - microseconds 10 - nanoseconds 11 - picosecondsScale Delta Time Last Received (SCALEDTLR)7-bit signed8-bit unsigned integer. This is the scaling value for the Delta Time Last Received (DELTATLR) field. The possible values are from-128 to +127.0-255. See Section 4 for further discussion on Timing Considerations and formatting of the scaling values. Scale Delta Time Last Sent (SCALEDTLS)7-bit8-bit signed integer. This is the scaling value for the Delta Time Last Sent (DELTATLS) field. The possible values are from-1280 to+127.255. Packet Sequence Number This Packet (PSNTP) 16-bit unsigned integer. This field will wrap. It is intended for use while analyzing packet traces. Initialized at a random number and incremented monotonically for each packet of the session flow of the 5-tuple. The 5-tuple consists of the source and destination IP addresses, the source and destination ports, and the upper layer protocol (ex. TCP, ICMP, etc). The random number initialization is intended to make it harder to spoof and insert such packets. Operating systems MUST implement a separate packet sequence number counter per 5-tuple. Operating systems MUST NOT implement a single counter for all connections. Packet Sequence Number Last Received (PSNLR) 16-bit unsigned integer. This is the PSNTP of the packet last received on the 5-tuple. Delta Time Last Received (DELTATLR) A 16-bit unsigned integer field. The value is set according to the scale in SCALEDTLR. Delta Time Last Received = (Send time packet 2 - Receive time packet 1) Delta Time Last Sent (DELTATLS) A 16-bit unsigned integer field. The value is set according to the scale in SCALEDTLS. Delta Time Last Sent = (Receive time packet 2 - Send time packet 1) Option Type The two highest-order bits of the Option Type field are encoded to indicate specific processing of the option; for the PDM destination option, these two bits MUST be set to 00. This indicates the following processing requirements: 00 - skip over this option and continue processing the header. RFC2460 [RFC2460] defines other values for the Option Type field. These MUST NOT be used in the PDM. In keeping with RFC2460 [RFC2460], the third-highest-order bit of the Option Type specifies whether or not the Option Data of that option can change en-route to the packet's final destination. In the PDM, the value of the third-highest-order bit MUST be 0. The possible values are as follows: 0 - Option Data does not change en-route 1 - Option Data may change en-route The three high-order bits described above are to be treated as part of the Option Type, not independent of the Option Type. That is, a particular option is identified by a full 8-bit Option Type, not just the low-order 5 bits of an Option Type.3.3 Header Placement The PDM destination option MUST be placed as follows: - Before3.2.2 Base Unit for Time Measurement A time differential is always a whole number in a CPU; it is theupper-layer header orunit specification -- hours, seconds, nanoseconds -- that determine what theESP header.numeric value means. For PDM, we establish the base time unit as 1 attosecond (asec). Thisfollowsallows for a common unit and scaling of theorder defined in RFC2460 [RFC2460] IPv6 header Hop-by-Hop Options header Destination Options header <-------- Routing header Fragment header Authentication header Encapsulating Security Payload header Destination Options header <------------ upper-layer headertime differential among all IP stacks and hardware implementations. Note thatthere iswe are trying to provide the ability to measure both time differentials that are extremely small, and time differentials in achoice ofDTN-type environment whereto placetheDestination Options header. If using ESP mode, please see section 3.4 ofdelays may be very great. To store a time differential in just 16 bits that must range in thisdocument for placementway will require some scaling of thePDM Destination Options header. For each IPv6 packet header, the PDM MUST NOT appear more than once. However, an encapsulated packet MAY contain a separate PDM associated with each encapsulated IPv6 header. 3.4 Header Placement Using IPSec ESP Mode IP Encapsulating Security Payload (ESP)time differential value. One issue isdefinedthe conversion from the native time base in[RFC4303] and is widely used. Section 3.1.1 of [RFC4303] discusses placementthe CPU hardware ofDestination Options Headers. Belowwhatever device isthe diagram from [RFC4303] discussing placement. PDM MUSTin use to some number of attoseconds. It might seem this will beplaced beforean astronomical number, but theESP header in orderconversion is straightforward. It involves multiplication by an appropriate power of 10 towork. If placed beforechange theESP header,value into a number of attoseconds. Then, to scale thePDM header will flow invalue so that it fits into DELTATLR or DELTATLS, theclear overvalue is shifted by of a number of bits, retaining thenetwork thus allowing gathering16 high-order or most significant bits. The number ofperformance and diagnostic data without sacrificing security. BEFORE APPLYING ESP --------------------------------------- IPv6 | | ext hdrs | | | | orig IP hdr |if present| TCP | Data | --------------------------------------- AFTER APPLYING ESP --------------------------------------------------------- IPv6 | orig |hop-by-hop,dest*,| |dest| | | ESP | ESP| |IP hdr|routing,fragment.|ESP|opt*|TCP|Data|Trailer| ICV| --------------------------------------------------------- |<--- encryption ---->| |<------ integrity ------>| * = if present, could be before ESP, after ESP,bits shifted becomes the scaling factor, stored as SCALEDTLR orboth 3.5 ImplementationSCALEDTLS, respectively. For a full description of this process, including examples, please see Appendix A. 3.2.3 ConsiderationsThe PDM destination options extension header SHOULD be turned on by each stack onof this time-differential representation There are ahost node. It MAY alsofew considerations to beturned on only in casetaken into account with this representation ofdiagnostics needed for problem resolution. 3.6 Dynamic Configuration Options If implemented, each operating system MUST haveadefault configuration parameter, e.g. diag_header_sys_default_value=yes/no.time differential. Theoperating system MAY also have a dynamic configuration option to change the configuration setting as needed. If the PDM destination options extension headerfirst isused, then it MAY be turnedwhether there are any limitations onfor all packets flowing throughthehost, applied to an upper-layer protocol (TCP, UDP, SCTP, etc), a local port,maximum orIP address only. These are at the discretionminimum time differential that can be expressed using method of a delta value and a scaling factor. The second is theimplementation. Asamount of imprecision introduced by this method. 3.2.3.1 Limitations withall other destination options extension headers, the PDM is for destination nodes only. As specified above, intermediate devices MUST neither set nor modifythisfield. 3.6 5-tuple Aging Within the operating system, metrics must be kept on a 5-tuple basis.encoding method The5-tuple is: SADDR : IP addressDELTATLS and DELTATLR fields store only the 16 most-significant bits of thesender SPORT : Port for sender DADDR : IP address oftime differential value. Thus thedestination DPORT : Port for destination PROTC : Protocol for upper layer (ex. TCP, UDP, ICMP) The question comes of whenrange, excluding the scaling factor, is from 0 tostop keeping data65535, orrestarting the numbering fora5-tuple. For example,maximum of 2**16-1. This method is further described inthe case[TRAM-TCPM]. The actual magnitude ofTCP, at some point,theconnection will terminate. Keeping data in control blocks forever, will have unfortunate consequences fortime differential is determined by theoperating system. So,scaling factor. SCALEDTLR and SCALEDTLS are 8-bit unsigned integers, so therecommendation is to use a known aging parameter such as Max Segment Lifetime (MSL) as defined in Transmission Control Protocol [RFC0793]scaling factor ranges from 0 toreuse or drop the control block.255. Thechoicesmallest number that can be represented would have a value ofaging parameter is left up to1 in theimplementation. 4 Considerationsdelta field and a value ofTiming Representation 4.1 Encoding0 in theDelta-Time Valuesassociated scale field. Thissection makes reference to and expands onis thedocument "Encoding of Time Intervalsrepresentation for 1 attosecond. Clearly this allows PDM to measure extremely small time differentials. On theTCP Timestamp Option" [TRAM-TCPM]. 4.2 Timer registers are different on different hardware Oneother end of theproblems with timestamp recordingscale, the maximum delta value is 65535, or FFFF in hexadecimal. If thevarietymaximum scale value ofhardware that generates255 is used, the timevaluedifferential represented is 65535*2**255, which is over 3*10**55 years, essentially, forever. So there appears to beused. Different CPUs trackno real limitation to the timein registersdifferential that can be represented. 3.2.3.2 Loss ofdifferent sizes,precision induced by timer value truncation As PDM specifies the DELTATLR and DELTATLS values as 16-bit unsigned integers, any time themost- frequently-iterated bit couldprecision is greater than those 16 bits, there will be truncation of thefirst on the left or the first ontrailing bits, with an accompanying loss of precision in theright. In order to generate some examples here it is necessary to indicatevalue. Any time differential value smaller than 65536 asec can be stored exactly in DELTATLR or DELTATLS, because thetyperepresentation oftimer register being used. As describedthis value requires at most 16 bits. Since the time differential values in PDM are measured in attoseconds, the"IBM z/Architecture Principlesrange ofOperation" [IBM-POPS],values that would be truncated to theTime-Of-Day clock in a zSeries CPUsame encoded value is 2**(Scale)-1 asec. For example, the smallest time differential that would be truncated to fit into a104-bit register, where bit 51delta field isincremented approximately every microsecond: 1 0 1 2 3 4 5 6 0 +--------+---------+---------+---------+---------+---------+--+...+ | | | | | |* | | +--------+---------+---------+---------+---------+---------+--+...+ ^ ^ ^ 0 51 =1usec 103 To represent these values concisely a hexadecimal representation will be used, where each digit represents 4 binary bits. Thus: 00000000 00000001 = 1 timer unit (2**-12 usec, or about 244 psec) 00000000 00001000=1 microsecond 0000 0000 003E65536 asec This value would be encoded as a delta value of 8000= 1 millisecond 0000 0000 F424 0000 =(hexadecimal) with a scaling factor of 1. The value 1second 0000 0039 38700000= 1 minute00000D69 3A400000= 1 hour000141DD 7600 0000=1 day Note that only the first 64 bits of the register are commonly represented,65537 asec would also be encoded asthat representsacountdelta value oftimer units on this hardware. Commonly the first 52 bits are all that are displayed, as that represents8000 with acountscaling factor ofmicroseconds. 4.3 Timer Units on Other Systems1. Thisencoding method worksactually is the largest value that would be truncated to that samewith other hardware clock formats. The method uses a microsecond asencoded value. When thebasicscale valueand allows for large time differentials. 4.4 Time Base This specification allows foris 1, thefact that different CPU TOD clocks use different binary points. For some clocks, avalueof 1 could indicaterange is calculated as 2**1 - 1, or 1microsecond, whereas other clocks could useasec, which you can see is thevalue 1difference between these minimum and maximum values. The scaling factor is defined as the number of low-order bits truncated toindicate 1 millisecond. Inreduce theformer case,size of thebinary digitsresulting value so it fits into a 16-bit delta field. If, for example, you had to truncate 12 bits, therightloss ofthat binary point measure 2**(-n) microseconds, and inprecision would depend on thelatter case, 2**(-n) milliseconds.bits you truncated. TheTime Base allows usrange of these values would be 0000 0000 0000 = 0 asec toensure we have a common reference, at1111 1111 1111 = 4095 asec So thevery least, common knowledgeminimum loss ofwhatprecision would be 0 asec, where thebinary point is fordelta value exactly represents thetransmitted values. We define a base unit fortime differential, and thetime. This is a 2-bit binary value indicatingmaximum loss of precision would be 4095 asec. As stated above, thelowest granularity possible for this device. That is, for a valuescaling factor of00 in12 means theTime Base field, a valuemaximum loss of1 inprecision is 2**12-1 asec, or 4095 asec. Compare this loss of precision to theDELTA fields indicates 1 millisecond.actual time differential. Thepossiblerange of actual time differential values that would incur this loss ofTime Base are as follows: 00 - milliseconds 01 - microseconds 10 - nanoseconds 11 - picoseconds Time baseprecision isnot necessarily equivalentfrom 1000 0000 0000 0000 0000 0000 0000 = 2**27 asec or 134217728 asec tolength of one timer tick. That is, on many, if not all, systems,1111 1111 1111 1111 1111 1111 1111 = 2**28-1 asec or 268435455 asec Granted, these are small values, but thetimer tickpoint is, any value between these two values willnot be in complete units of nanoseconds, milliseconds, etc. For example, on an IBM zSeries machine, one timer tick (or clock unit) is 2 to the -12th microseconds. Therefore, some amount of conversion may be needed to approximate Time Base units. 4.5 Timer-value scaling As discussed in [TRAM-TCPM] we define storing not an entire time- interval value, but just the most significant bits of that value, along withhave ascaling factor to indicate the magnitude of the time- interval value. In our case, we will use the high-order 16 bits. The scaling value will be the numbermaximum loss ofbits in the timer register to the rightprecision ofthe 16th significant bit. That is, if the timer register contains this binary value: 1110100011010100101001010001000000000000 <-16 bits -><-24 bits -> then, the values stored would be 1110 1000 1101 0100 in binary (E8D4 hexadecimal)4095 asec, or about 0.00305% for thetime valuefirst value, as encoded, and24at most 0.001526% for the second. These maximum-loss percentages are consistent for all scalingvalue.values. 3.3 Header Placement The PDM destination option follows the order defined in RFC2460 [RFC2460]. IPv6 header Hop-by-Hop Options header Destination Options header <-------- Routing header Fragment header Authentication header Encapsulating Security Payload header Destination Options header <------------ upper-layer header Note thatthe displayed valuethere isthe binary equivalent of 1 second expressed in picoseconds. The below table represents a device which hasaTimeBasechoice ofpicoseconds (or 11). The smallest and simplest valuewhere torepresent is 1 picosecond;place thetime value stored is 1, andDestination Options header. If using ESP mode, please see section 3.4 of this document for placement of thescaling value is 0. Using values fromPDM Destination Options header. For each IPv6 packet header, thetable below, we have: Time value in Encoded Scaling Delta time picoseconds value decimal -------------------------------------------------------- 1 picosecond 1 1 0 1 nanosecond 3E8 3E8 0 1 microsecond F4240 F424 4 1 millisecond 3B9ACA00 3B9A 16 1 second E8D4A51000 E8D4 24 1 minute 3691D6AFC000 3691 32 1 hour cca2e51310000 CCA2 36 1 day 132f4579c980000 132F 44 365 days 1b5a660ea44b80000 1B5A 52 Sample binary values (high order 16 bits taken) 1 psec 1 0001 1 nsec 3E8 0011 1110 1000 1 usec F4240 1111 0100 0010 0100 0000 1 msec 3B9ACA00 0011 1011 1001 1010 1100 1010 0000 0000 1 sec E8D4A51000 1110 1000 1101 0100 1010 0101 0001 0000 0000 0000 4.6 LimitationsPDM MUST NOT appear more than once. However, an encapsulated packet MAY contain a separate PDM associated with each encapsulated IPv6 header. 3.4 Header Placement Using IPSec ESP Mode IPSec Encapsulating Security Payload (ESP) is defined in [RFC4303] and is widely used. Section 3.1.1 of [RFC4303] discusses placement of Destination Options Headers. The placement of PDM is different depending on if ESP is used in tunnel or transport mode. 3.4.1 Using ESP Transport Mode Below is the diagram from [RFC4303] discussing placement of headers. Note that Destination Options MAY be placed before or after ESP or both. If using PDM in ESP transport mode, PDM MUST be placed after the ESP header so as not to leak information. BEFORE APPLYING ESP --------------------------------------- IPv6 | | ext hdrs | | | | orig IP hdr |if present| TCP | Data | --------------------------------------- AFTER APPLYING ESP --------------------------------------------------------- IPv6 | orig |hop-by-hop,dest*,| |dest| | | ESP | ESP| |IP hdr|routing,fragment.|ESP|opt*|TCP|Data|Trailer| ICV| --------------------------------------------------------- |<--- encryption ---->| |<------ integrity ------>| * = if present, could be before ESP, after ESP, or both 3.4.2 Using ESP Tunnel Mode Below is the diagram from [RFC4303] discussing placement of headers. Note that Destination Options MAY be placed before or after ESP or both in both the outer set of IP headers and the inner set of IP headers. In ESP tunnel mode, PDM MAY be placed before or after the ESP header or both. BEFORE APPLYING ESP --------------------------------------- IPv6 | | ext hdrs | | | | orig IP hdr |if present| TCP | Data | --------------------------------------- AFTER APPLYING ESP ------------------------------------------------------------ IPv6 | new* |new ext | | orig*|orig ext | | | ESP | ESP| |IP hdr| hdrs* |ESP|IP hdr| hdrs * |TCP|Data|Trailer| ICV| ------------------------------------------------------------ |<--------- encryption ---------->| |<------------ integrity ------------>| * = if present, construction of outer IP hdr/extensions and modification of inner IP hdr/extensions is discussed in the Security Architecture document. As a completely new IP packet will be made, it means that PDM information for that packet does not contain any information from the inner packet, i.e. the PDM information will NOT be based on the transport layer (TCP, UDP, etc) ports etc in the inner header, but will be specific to the ESP flow. If PDM information for the inner packet is desired, the original host sending the inner packet needs to put PDM header in the tunneled packet, and then the PDM information will be specific for that stream. 3.5 Implementation Considerations The PDM destination options extension header MUST be explicitly turned on by each stack on a host node by administrative action. The default value of PDM is off. PDM MUST NOT be turned on merely if a packet is received with a PDM header. The received packet could be spoofed by another device. 3.6 Dynamic Configuration Options If implemented, each operating system MUST have a default configuration parameter, e.g. diag_header_sys_default_value=yes/no. The operating system MAY also have a dynamic configuration option to change the configuration setting as needed. If the PDM destination options extension header is used, then it MAY be turned on for all packets flowing through the host, applied to an upper-layer protocol (TCP, UDP, SCTP, etc), a local port, or IP address only. These are at the discretion of the implementation. As with all other destination options extension headers, the PDM is for destination nodes only. As specified above, intermediate devices MUST neither set nor modify thisencoding method Accordingfield. 3.6 5-tuple Aging Within the operating system, metrics must be kept on a 5-tuple basis. The 5-tuple is: SADDR : IP address of the sender SPORT : Port for sender DADDR : IP address of the destination DPORT : Port for destination PROTC : Protocol for upper layer (ex. TCP, UDP, ICMP) The question comes of when to stop keeping data or restarting the numbering for a 5-tuple. For example, in the case of TCP, at some point, the connection will terminate. Keeping data in control blocks forever, will have unfortunate consequences for the operating system. So, the recommendation is to use a known aging parameter such as Max Segment Lifetime (MSL) as defined in Transmission Control Protocol [RFC0793] to reuse or drop the control block. The choice of aging parameter is left up to the implementation. 4 PDM Flow - Simple Client Server Following is a sample simple flow for the PDM with one packet sent from Host A and one packet received by Host B. The PDM does not require time synchronization between Host A and Host B. The calculations to derive meaningful metrics for network diagnostics are shown below each packet sent or received. Each packet, in addition to thespecification in [TRAM-TCPM]PDM contains information on thesize of one such time-interval field is limited to this 11-bit valuesender and5-bit unsigned scale so that they fit intoreceiver. As discussed before, a16 bit space. With5-tuple consists of: SADDR : IP address of the sender SPORT : Port for sender DADDR : IP address of the destination DPORT : Port for destination PROTC : Protocol for upper layer (ex. TCP, UDP, ICMP) It should be understood thatlimitation,themaximum valuepacket identification information is in each packet. We will not repeat thatcould be storedin16 bits is: 11-bit value Scale ============= ====== 1111 1111 111 1 1111 or an encoded value of 3FF and a scale valueeach of31. This value, in microseconds, correspondsthe following steps. 4.1 Step 1 Packet 1 is sent from Host A toanyHost B. The timedifferential between: |<Count of zeroesfor Host A is set initially to 10:00AM. The time and packet sequence number are saved by the sender internally. The packet sequence number and delta times are sent in the packet. Packet 1 +----------+ +----------+ | | | | | Host | ----------> | Host | | A | | B | | | | | +----------+ +----------+ PDM Contents: PSNTP : Packet Sequence Number This Packet: 25 PSNLR : Packet Sequence Number Last Received: - DELTATLR : Delta Time Last Received: - SCALEDTLR: Scalevalue>| 11 1111 1111 1000 0000 0000 0000 0000 0000 0000 0000 (binary) 3 F F 8 0 0 0 0 0of Delta Time Last Received: 0 DELTATLS : Delta Time Last Sent: - SCALEDTLS: Scale of Delta Time Last Sent: 0(hexadecimal) and 11 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 (binary) 3 F F F F F F F F F F (hexadecimal) The latter time value, 3FFFFFFFFFF, converts to 50 days, 21 hours 40 minutes and 46.511103 seconds. A time differential 1 microsecond longer won't fit into 16 bits using this encoding scheme. Thus, PDM separatesInternally, within thescaling value fromsender, Host A, it must keep: Packet Sequence Number of theinterval value, giving a full 16 bits forlast packet sent: 25 Time theinterval (DELTA) values and introducing a signed scaling value that can range from -128 to +127. 4.7 Lack of precision induced by timer value truncation As PDM specifieslast packet was sent: 10:00:00 Note, theDELTA values as 16-bit unsigned values, anyinitial PSNTP from Host A starts at a random number. In this case, 25. The timethe precisionin these examples isgreater than those 16 bits, there will be truncation of the trailing bits, with an obvious loss precisionshown in seconds for thevalue. Using microseconds as the Time Base, the rangesake ofvalues that would be truncated to the same encoded valuesimplicity. 4.2 Step 2 Packet 1 is2**(Scale)-1 microseconds. The smallestreceived at Host B. Its timedifferential that would be truncatedis1 0000 0000 0000 0000 = 65536 usec The value 1 0000 0000 0000 0001 = 65537 usec would be truncatedset to one hour later than Host A. In this case, 11:00AM Internally, within thesame encoded value, whichreceiver, Host B, it must note: Packet Sequence Number of the last packet received: 25 Time the last packet was received : 11:00:03 Note, this timestamp is8000inhexHost B time. It has nothing whatsoever to do witha Scale valueHost A time. The Packet Sequence Number of1. When the Scale value is 1,thevalue range is calculated as 2**1 - 1, or 1 microsecond,last packet received will become PSNLR whichyou can see is the difference between these minimum and maximum values. With thatwill be sent out inmind, let's look at that table of DELTA time values again, where the Precision istherange frompacket sent by Host B in thesmallest value corresponding to this encoded valuenext step. The time last received will be used to calculate thelargest: TimeDELTALR value to be sent out inEncoded Delta time microseconds value Scale Precision 1 microsecond 1 1 0 0:00.000000 1 millisecond 38E 38E 0 0:00.000000 1 second F4240 F424 4 0:00.000015 1 minute 3938700 3938 12 0:00.004095 1 hour D693A400 D693 16 0:00.065535 1 day 141DD76000 141D 24 0:16.777215 Maximum value 3FFFFFFFFFF FFFF 36 19:05:19.476735 This maximum DELTA value is nearly 52,125 days. Atthegreatest value, you can be assured of accuracy within about 19 hours. More simply, response timespacket sent by Host B in therange of a few seconds can be encoded withnext step. 4.3 Step 3 Packet 2 is sent by Host B to Host A. Note, the initial packet sequence number (PSNTP) from Host B starts at aloss of precision no greater thanrandom number. In this case, 12. Before sending the packet, Host B does atenthcalculation ofa millisecond. Most importantly, response times shorter than 65.5 millisecondsdeltas. Since Host B knows when it is sending the packet, and it knows when it received the previous packet, it canbe encoded with no loss of precision. 5 PDM Flowdo the following calculation: Sending time : packet 2 -Simple Client Server Following is a sample simple flow forreceive time : packet 1 We will call thePDM with oneresult of this calculation: Delta Time Last Received (DELTATLR) That is: Delta Time Last Received = (Sending time: packetsent from Host A and one2 - receive time: packetreceived by Host B. The PDM does not require1) Note, both sending timesynchronization between Host Aand receive time are saved internally in Host B.The calculations to derive meaningful metrics for network diagnostics are shown below each packet sent or received. Each packet,They do not travel inaddition tothePDM contains information onpacket. Only thesender and receiver. As discussed before, a 5-tuple consists of: SADDR : IP address ofDelta is in thesender SPORT : Port for sender DADDR : IP addresspacket. Assume that within Host B is the following: Packet Sequence Number of thedestination DPORT : Port for destination PROTC : Protocol for upper layer (ex. TCP, UDP, ICMP) It should be understood thatlast packet received: 25 Time the last packet was received: 11:00:03 Packet Sequence Number of this packet: 12 Time this packetidentification informationisin each packet.being sent: 11:00:07 Wewill not repeat thatcan now calculate a delta value to be sent out ineach ofthefollowing steps. 5.1 Step 1 Packet 1packet. DELTATLR becomes: 4 seconds = 11:00:07 - 11:00:03 = 3782DACE9D900000 asec This issent from Host A to Host B.the derived metric: Server Delay. The timefor Host A is set initially to 10:00AM. Theand scaling factor must be converted; in this case, the time differential is DE0B, andpacket sequence number are saved bythesender internally. Thescaling factor is 2E, or 46 in decimal. Then, these values, along with the packet sequencenumber and delta times arenumbers will be sentin the packet.to Host A as follows: Packet12 +----------+ +----------+ | | | | | Host |----------><---------- | Host | | A | | B | | | | | +----------+ +----------+ PDM Contents: PSNTP : Packet Sequence Number This Packet:2512 PSNLR : Packet Sequence Number Last Received:-25 DELTATLR : Delta Time Last Received:-DE0B (4 seconds) SCALEDTLR: Scale of Delta Time Last Received:02E (46 decimal) DELTATLS : Delta Time Last Sent: - SCALEDTLS: Scale of Delta Time Last Sent: 0TIMEBASE : Granularity of Time: 00 (Milliseconds) Internally, withinThe metric left to be calculated is thesender,Round-Trip Delay. This will be calculated by HostA,A when it receives Packet 2. 4.4 Step 4 Packet 2 is received at Host A. Remember, its time is set to one hour earlier than Host B. Internally, it mustkeep:note: Packet Sequence Number of the last packetsent: 25received: 12 Time the last packet wassent: 10:00:00received : 10:00:12 Note,the initial PSNTP fromthis timestamp is in Host Astartstime. It has nothing whatsoever to do with Host B time. So, now, Host A can calculate total end-to-end time. That is: End-to-End Time = Time Last Received - Time Last Sent For example, packet 25 was sent by Host A at 10:00:00. Packet 12 was received by Host A at 10:00:12 so: End-to-End time = 10:00:12 - 10:00:00 or 12 (Server and Network RT delay combined). This time may also be called total Overall Round- trip time (which includes Network RTT and Host Response Time). This derived metric we will call Delta Time Last Sent (DELTATLS) We can now also calculate round trip delay. The formula is: Round trip delay = (Delta Time Last Sent - Delta Time Last Received) Or: Round trip delay = 12 - 4 or 8 Now, the only problem is that at this point all metrics are in Host A only and not exposed in arandom number. Inpacket. To do that, we need a third packet. Note: thiscase, 25. The time in these examplessimple example assumes one send and one receive. That isshown in secondsdone only forthe sakepurposes ofsimplicity. 5.2 Step 2 Packet 1 is received at Host B. Its time is set to one hour later than Host A. In this case, 11:00AM Internally, withinexplaining thereceiver, Host B, it must note: Packet Sequence Numberfunction of thelast packet received: 25 TimePDM. In cases where there are multiple packets returned, one would take thelast packet was received : 11:00:03 Note, this timestamp istime inHost B time. It has nothing whatsoever to do with Host A time. The Packet Sequence Number ofthe last packetreceived will become PSNLR which will be sent out in the packet sent by Host Bin thenext step.sequence. Thetime last received will be used to calculate the DELTALR value to be sent out incalculations of such timings and intelligent processing is thepacket sent by Host B infunction of post-processing of thenext step. 5.3data. 4.5 Step35 Packet23 is sentby Host B to Host A. Note, the initial packet sequence number (PSNTP)from HostB starts at a random number. In this case, 12. Before sending the packet,A to HostB does a calculation of deltas. SinceB. +----------+ +----------+ | | | | | HostB knows when it is sending the packet, and it knows when it received the previous packet, it can do the following calculation: Sending time| ----------> | Host | | A | | B | | | | | +----------+ +----------+ PDM Contents: PSNTP :packet 2 - receive timePacket Sequence Number This Packet: 26 PSNLR :packet 1 We will call the resultPacket Sequence Number Last Received: 12 DELTATLR : Delta Time Last Received: 0 SCALEDTLS: Scale ofthis calculation:Delta Time Last Received(DELTATLR) That is:0 DELTATLS : Delta Time LastReceived = (Sending time:Sent: A688 (scaled value) SCALEDTLR: Scale of Delta Time Last Received: 30 (48 decimal) To calculate Two-Way Delay, any packet2 - receive time:capture device may look at these packets and do what is necessary. 5 Other Flows What we have discussed so far is a simple flow with one packet1) Note, both sending timesent andreceiveone returned. Let's look at how PDM may be useful in other types of flows. 5.1 PDM Flow - One Way Traffic The flow on a particular session may not be a send-receive paradigm. Let us consider some other situations. In the case of a one-way flow, one might see the following: Note: The timeare saved internallyis expressed inHost B. Theygeneric units for simplicity. That is, these values do nottravel in the packet. Onlyrepresent a number of attoseconds, microseconds or any other real units of time. Packet Sender PSN PSN Delta Time Delta Time This Packet Last Recvd Last Recvd Last Sent ===================================================================== 1 Server 1 0 0 0 2 Server 2 0 0 5 3 Server 3 0 0 12 4 Server 4 0 0 20 What does this mean and how is it useful? In a one-way flow, only the Delta Time Last Sent will be seen as used. Recall, Delta Time Last Sent isinthepacket. Assume that within Host B isdifference between thefollowing: Packet Sequence Numbersend ofthe lastone packetreceived: 25 Timefrom a device and thelast packet was received: 11:00:03 Packet Sequence Number of this packet: 12 Time this packetnext. This isbeing sent: 11:00:07 We can now calculateadelta value to be sent out inmeasure of throughput for thepacket. DELTATLR becomes: 4 seconds = 11:00:07sender -11:00:03 Thisaccording to the sender's point of view. That is, it is a measure of how fast is thederived metric: Server Delay. Theapplication itself (with stack timeand scaling factor must be calculated. Then,included) able to send packets. How might thisvalue, along withbe useful? If one is having a performance issue at the client and sees that packetsequence numbers will be2, for example, is sent after 5 time units from the server but takes 10 times that long toHost A as follows: Packet 2 +----------+ +----------+ | | | | | Host | <---------- | Host | | A | | B | | | | | +----------+ +----------+ PDM Contents: PSNTP : Packet Sequence Number This Packet: 12 PSNLR : Packet Sequence Number Last Received: 25 DELTATLR : Delta Time Last Received: FA0 (4 seconds) SCALEDTLR: Scale of Delta Time Last Received: 00 DELTATLS : Delta Time Last Sent: - SCALEDTLS: Scale of Delta Time Last Sent: 0 TIMEBASE : Granularity of Time: 00 (Milliseconds) The metric left to be calculated isarrive at the destination, then one may safely conclude that there are delays in theRound-Trip Delay. This willpath other than at the server which may becalculatedcausing the delivery issue of that packet. Such delays may include the network links, middle-boxes, etc. Now, true one-way traffic is quite rare. What people often mean byHost A when it receives Packet 2. 5.4 Step 4 Packet 2"one-way" traffic isreceived at Host A. Remember, its timean application such as FTP where a group of packets (for example, a TCP window size worth) isset to one hour earlier than Host B. Internally, it must note: Packet Sequence Numbersent, then the sender waits for acknowledgment. This type of flow would actually fall into thelast packet received: 12 Time"multiple-send" traffic model. 5.2 PDM Flow - Multiple Send Traffic Assume that two packets are sent for each ACK from thelast packet was received : 10:00:12 Note, this timestamp is in Host A time. It has nothing whatsoever toserver. For example, a TCP flow will dowith Host B time. So, now, Host A can calculate total end-to-end time. That is: End-to-Endthis, per RFC1122 [RFC1122] Section- 4.2.3. Packet Sender PSN PSN Delta Time=Delta Time This Packet LastReceived - TimeRecvd Last Recvd Last SentFor example, packet 25 was sent by Host A at 10:00:00. Packet 12 was received by Host A at 10:00:12 so: End-to-End time = 10:00:12 - 10:00:00 or 12 (Server and Network RT delay combined). This time may also===================================================================== 1 Server 1 0 0 0 2 Server 2 0 0 5 3 Client 1 2 20 0 4 Server 3 1 10 15 How might this becalled total Overall Round- trip time (which includes Network RTT and Host Response Time). This derived metric we will callused? Notice that in packet 3, the client has a value of Delta Time LastSent (DELTATLS) We can now also calculate round trip delay. The formula is: Round trip delay = (Deltareceived of 20. Recall that Delta Time LastSentReceived is the Send time of packet 3 - receive time of packet 2. So, what does one know now? In this case, Delta Time LastReceived) Or: Round trip delay = 12 - 4 or 8 Now,Received is theonly problemprocessing time for the Client to send the next packet. How to interpret this depends on what isthat atactually being sent. Remember, PDM is not being used in isolation, but to supplement the fields found in other headers. Let's take some examples: 1. Client is sending a standalone TCP ACK. One would find thispoint all metrics areby looking at the payload length inHost A onlythe IPv6 header andnot exposedthe TCP Acknowledgement field in the TCP header. So, ina packet. To do that, we need a third packet. Note:thissimple example assumes onecase, the client is taking 20 units to sendand one receive. Thatback the ACK. This may or may not be interesting. 2. Client isdone only for purposes of explainingsending data with the packet. Again, one would find this by looking at the payload length in the IPv6 header and the TCP Acknowledgement field in thefunction ofTCP header. So, in this case, thePDM. In cases whereclient is taking 20 units to send back data. This may represent "User Think Time". Again, this may or may not be interesting, in isolation. But, if thereare multiple packets returned, one would takeis a performance problem receiving data at thetimeserver, then taken inthe lastconjunction with RTT or other packetintiming information, this information may be quite interesting. Of course, one also needs to look at thesequence. The calculationsPSN Last Received field to make sure ofsuch timings and intelligent processing isthefunction of post-processinginterpretation ofthethis data.5.5 Step 5 Packet 3 is sent from Host AThat is, toHost B. +----------+ +----------+ | | | | | Host | ----------> | Host | | A | | B | | | | | +----------+ +----------+ PDM Contents: PSNTP : Packet Sequence Number This Packet: 26 PSNLR : Packet Sequence Number Last Received: 12 DELTATLR : Delta Time Last Received: 0 SCALEDTLS: Scale ofmake sure that the DeltaTimeLast Received0 DELTATLS : Delta Time Last Sent: 2EE0 (12 seconds) SCALEDTLR: Scalecorresponds to the packet ofDelta Time Last Received: 00 TIMEBASE : Granularityinterest. The benefits ofTime: 00 (Milliseconds) To calculate Two-Way Delay, any packet capture device may look at these packets and do what is necessary. 6 Other Flows WhatPDM are that we havediscussed so far issuch information available in asimple flowuniform manner for all applications and all protocols without extensive changes required to applications. 5.3 PDM Flow - Multiple Send withone packet sent and one returned. Let'sErrors Let us now look at a case of how PDM may beusefulable to help inother types of flows. 6.1 PDM Flow - One Way Traffic The flow on a particular session may not beasend-receive paradigm. Let us consider some other situations. In thecase ofa one-way flow, one might seeTCP retransmission and add to thefollowing: Packetinformation that is sent in the TCP header. Assume that three packets are sent with each send from the server. From the server, this is what is seen. Pkt Sender PSN PSN Delta Time Delta Time TCP Data ThisPacket Last Recvd Last Recvd Last SentPkt LastRecvd LastRecvd LastSent SEQ Bytes ===================================================================== 1 Server 1 0 0 0 123 100 2 Server 2 0 0 5 223 100 3 Server 3 0 012 4 Server 4 0 0 20 What5 333 100 The client, however, doesthis mean and how is it useful? In a one-way flow, only the Delta Time Last Sent will be seen as used. Recall, Delta Time Last Sent is the difference between the send of one packet from a device and the next. This is a measure of throughput for the sender - according to the sender's point of view. That is, it is a measure of how fast isnot receive all theapplication itself (with stack time included) able to sendpackets.How mightFrom the client, thisbe useful? If oneishaving a performance issue at the client and sees that packet 2, for example,what is seen for the packets sentafter 5 microsecondsfrom theserver but takesserver. Pkt Sender PSN PSN Delta Time Delta Time TCP Data This Pkt LastRecvd LastRecvd LastSent SEQ Bytes ===================================================================== 1 Server 1 0 0 0 123 100 2 Server 3minutes to arrive at the destination, then one may safely conclude0 0 5 333 100 Let's assume thatthere are delays in the path other than atthe serverwhich may be causingnow retransmits thedelivery issue of thatpacket.Such delays may include the network links, middle-boxes, etc. Now, true one-way traffic is quite rare. What people often mean by "one-way" traffic is an application such as FTP where(Obviously, agroup ofduplicate acknowledgment sequence for fast retransmit or a retransmit timeout would occur. To illustrate the point, these packets(for example,are being left out.) So, then if a TCPwindow size worth)retransmission issent,done, then from thesender waitsclient, this is what is seen foracknowledgment. This type of flow would actually fall intothe"multiple-send" traffic model. 6.2 PDM Flow - Multiple Send Traffic Assume that twopacketsaresentfor each ACKfrom the server.For example, aPkt Sender PSN PSN Delta Time Delta Time TCPflow will do this, per RFC1122 [RFC1122] Section- 4.2.3.Data This Pkt LastRecvd LastRecvd LastSent SEQ Bytes ===================================================================== 1 Server 4 0 0 30 223 100 The server has resent the old packet 2 with TCP sequence number of 223. The retransmitted packet now has a PSN This Packet value of 4. The Delta Last Sent is 30 - the time between sending the packet with PSN of 3 and this current packet. Let's say that packet 4 is lost again. Then, after some amount of time (RTO) then the packet with TCP sequence number of 223 is resent. From the client, this is what is seen for the packets sent from the server. Pkt Sender PSN PSN Delta Time Delta Time TCP Data ThisPacket Last Recvd Last Recvd Last SentPkt LastRecvd LastRecvd LastSent SEQ Bytes ===================================================================== 1 Server1 0 0 0 2 Server 2 0 053 Client 1 2 2004 Server 3 1 10 15 How might0 60 223 100 If now, thisbe used? Notice that inpacket3,arrives at theclientdestination, one has avalue of Delta Time Last received of 20. Recallvery good idea thatDelta Time Last Receivedpackets exist which are being sent from the server as retransmissions and not arriving at the client. This is because theSend time of packet 3 - receive timePSN of the resent packet2. So, what does one know now? Infrom the server is 5 rather than 4. If we had used TCP sequence number alone, we would never have seen thiscase, Delta Time Last Receivedsituation. The TCP sequence number in all situations is 223. This situation would be experienced by theprocessing time for the Client to senduser of thenext packet. How to interpret this depends on what is actually being sent. Remember, PDM is notapplication (the human beingused in isolation, butactually sitting somewhere) as a "hangs" or long delay between packets. On large networks, tosupplementdiagnose problems such as these where packets are lost somewhere on thefields found in other headers. Let'snetwork, one has to takesome examples: 1. Client is sending a standalone TCP ACK. One wouldmultiple traces to findthis by lookingout exactly where. The first thing is to start with doing a trace at thepayload length in the IPv6 headerclient and theTCP Acknowledgement field in the TCP header.server. So,in this case,we can see if the server sent a particular packet and the clientis taking 20 units to send backreceived it. If theACK. This may or mayclient did notbe interesting. 2. Client is sending data with the packet. Again, one would find this by lookingreceive it, then we start tracking back to trace points at thepayload length inrouter right after theIPv6 headerserver and theTCP Acknowledgement field inrouter right before theTCP header. So, in this case,client. Did they get these packets which theclient is taking 20 units to send back data.server has sent? Thismay represent "User Think Time". Again, this may or may not be interesting, in isolation. But, if thereis aperformance problem receiving data attime consuming activity. With PDM, we can speed up theserver, then taken in conjunction with RTT or other packet timing information, this informationdiagnostic time because we may bequite interesting. Of course, one also needsable tolook atuse only thePSN Last Received field to make sure oftrace taken at theinterpretation of this data. That is,client tomake sure thatsee what theDelta Last Received correspondsserver is sending. 6 Potential Overhead Considerations Questions have been posed as to thepacket of interest. The benefitspotential overhead of PDM. First, PDMare that we have such information available inis entirely optional. That is, auniform manner for all applications and all protocols without extensive changes requiredsite may choose toapplications. 6.3implement PDMFlow - Multiple Sendor not as they wish. If they are happy withErrors Let us now look at a casethe costs ofhowPDMmayvs. the benefits, then the choice should beable to help intheirs. Below is acase of TCP retransmission and add totable outlining theinformation that is sentpotential overhead in terms of additional time to deliver theTCP header. Assume that three packets are sent with each send from the server. Fromresponse to theserver, this is what is seen. Pkt Sender PSN PSN Delta Time Delta Time TCP Data This Pkt LastRecvd LastRecvd LastSent SEQend user for various assumed RTTs. Bytes RTT Bytes Bytes New Overhead in Packet Per Milli in PDM RTT ===================================================================== 1000 1000 milli 1Server 1 0 0 0 123 100 2 Server 2 0 0 5 22316 1016.000 16.000 milli 1000 1003 Server 3 0 0 5 333milli 10 16 101.600 1.600 milli 1000 10 milli 100 16 10.160 .160 milli 1000 1 milli 1000 16 1.016 .016 milli Below are some examples of actual RTTs for packets traversing large enterprise networks. Theclient, however, does not receive all the packets. From the client, this is whatfirst example isseenforthepacketssent from the server. Pkt Sender PSN PSN Delta Time Delta Time TCP Data This Pkt LastRecvd LastRecvd LastSent SEQgoing to multiple business partners. Bytes===================================================================== 1 Server 1 0 0 0 123 100 2 Server 3 0 0 5 333 100 Let's assumeRTT Bytes Bytes New Overhead in Packet Per Milli in PDM RTT ===================================================================== 1000 17 milli 58 16 17.360 .360 milli The second example is for packets at a large enterprise customer within a data center. Notice that theserverscale is nowretransmitsin microseconds rather than milliseconds. Bytes RTT Bytes Bytes New Overhead in Packet Per Micro in PDM RTT ===================================================================== 1000 20 micro 50 16 20.320 .320 micro 7 Security Considerations PDM may introduce some new security weaknesses. 7.1. SYN Flood and Resource Consumption Attacks PDM needs to calculate thepacket. (Obviously, a duplicate acknowledgment sequencedeltas forfast retransmit or a retransmit timeout would occur. To illustratetime and keep track of thepoint, these packets are being left out.) So, then ifsequence numbers. This means that control blocks must be kept at the end hosts per 5-tuple. Any time aTCP retransmissioncontrol block isdone, then fromkept, an attacker can try to mis-use theclient, thiscontrol blocks such that there iswhata compromise of the end host. PDM isseen forused only at thepackets sent fromend hosts and theserver. Pkt Sender PSN PSN Delta Time Delta Time TCP Data This Pkt LastRecvd LastRecvd LastSent SEQ Bytes ===================================================================== 1 Server 4 0 0 30 223 100 The server has resentcontrol blocks are only kept at theold packet 2 with TCP sequence numberend host and not at routers or middle boxes. Remember, PDM is an implementation of223. The retransmitted packet now has a PSN This Packet valuethe Destination Option extension header. A "SYN flood" type of4. The Delta Last Sentattack succeeds because a TCP SYN packet is30 -small but it causes thetime between sendingend host to start creating a place holder for thepacket with PSNsession such that quite a bit of3control block andthis current packet. Let's say that packet 4other storage islost again. Then, after someused. This is an asynchronous type of attack in that a small amount oftime (RTO) thenwork by thepacket with TCP sequence numberattacker creates a large amount of223work by the resource attacked. For PDM, the amount of data to be kept isresent. Fromquite small. That is, theclient, thiscontrol block iswhatquite lightweight. Concerns about SYN Flood and other type of resource consumption attacks (memory, processing power, etc) can be alleviated by having a limit on the number of control block entries. We recommend that implementation of PDM SHOULD have a limit on the number of control block entries. 7.2 Pervasive monitoring Since PDM passes in the clear, a concern arises as to whether the data can be used to fingerprint the system or somehow obtain information about the contents of the payload. Let us discuss fingerprinting of the end host first. It isseen forpossible that seeing thepackets sent frompattern of deltas or theserver. Pkt Sender PSN PSN Delta Time Delta Time TCP Data This Pkt LastRecvd LastRecvd LastSent SEQ Bytes ===================================================================== 1 Server 5 0 0 60 223 100 If now, this packet arrives atabsolute values could give some information as to thedestination, one hasspeed of the end host - that is, if it is a verygood idea that packets exist which are being sent fromfast system or an older, slow device. This may be useful to theserver as retransmissions and not arriving atattacker. However, if theclient. This is becauseattacker has access to PDM, thePSN ofattacker also has access to theresententire packetfromand could make such a deduction based merely on theservertime frames elapsed between packets WITHOUT PDM. As far as deducing the content of the payload, it appears to us that PDM is5 rather than 4. If we had used TCP sequence number alone, we would never have seenquite unhelpful in thissituation. The TCP sequence numberregard. 7.3 PDM as a Covert Channel PDM provides a set of fields inall situationsthe packet which could be used to leak data. But, there is223. This situationno real reason to suspect that PDM would beexperienced by the userchosen rather than another part of theapplication (the human being actually sitting somewhere) as a "hangs"payload orlong delay between packets. On large networks, to diagnose problems such as these where packets are lost somewhere onanother Extension Header. A firewall or another device could sanity check thenetwork, one has to take multiple tracesfields within the PDM but randomly assigned sequence numbers and delta times might be expected tofind out exactly where.vary widely. Thefirst thingbiggest problem though is how an attacker would get access tostart with doing a trace at the client andPDM in theserver. So, we can see iffirst place to leak data. The attacker would have to either compromise theserver sent a particular packet andend host or have Man in theclient received it. IfMiddle (MitM). It is possible that either one could change theclient did not receive it,fields. But, thenwe start tracking back to trace points attherouter right afterother end host would get sequence numbers and deltas that don't make any sense. Presumably, one is using PDM and doing packet tracing for diagnostic purposes, so theserverchanges would be obvious. It is conceivable that someone could compromise an end host and make it start sending packets with PDM without therouter right beforeknowledge of theclient. Did they get these packets whichhost. But, again, theserver has sent? Thisbigger problem isa time consuming activity. With PDM, we can speed upthediagnostic time because we may be able to use onlycompromise of thetrace taken atend host. Once that is done, theclientattacker probably has better ways tosee whatleak data. Having said that, an implementation SHOULD stop using PDM if it gets some number of "nonsensical" sequence numbers. 7.4 Timing Attacks The fact that PDM can help in theserver is sending. 7 Potential Overhead Considerations Questions have been posed asseparation of node processing time from network latency brings value tothe potential overheadperformance monitoring. Yet, it is this very characteristic ofPDM. First,PDMis entirely optional. That is, a sitewhich maychoosebe misused toimplement PDM or not as they wish. If they are happy withmake certain new type of timing attacks against protocols and implementations possible. Depending on the nature of the cryptographic protocol used, it may be possible to leak thecostslong term credentials of the device. For example, if an attacker is able to create an attack which causes the enterprise to turn on PDMvs.to diagnose thebenefits,attack, then thechoice should be theirs. Below is a table outlining the potential overhead in terms of additionalattacker might use PDM during that debugging time todeliverlaunch a timing attack against theresponse tolong term keying material used by theend user for various assumed RTTs. Bytes RTT Bytes Bytes New Overhead in Packet Per Milli incryptographic protocol. An implementation may want to be sure that PDMRTT ===================================================================== 1000 1000 milli 1 16 1016.000 16.000 milli 1000 100 milli 10 16 101.600 1.600 milli 1000 10 milli 100 16 10.160 .160 milli 1000 1 milli 1000 16 1.016 .016 milli Below areis enabled only for certain ip addresses, or only for someexamplesports. Additionally, we recommend that the implementation SHOULD require an explicit restart ofactual RTTs for packets traversing large enterprise networks. The firstmonitoring after a certain timeperiod (for exampleisforpackets going1 hour), tomultiple business partners. Bytes RTT Bytes Bytes New Overhead in Packet Per Milli in PDM RTT ===================================================================== 1000 17 milli 58 16 17.360 .360 milli The second example is for packets at a large enterprise customer within a data center. Noticemake sure thatthe scale is now in microseconds rather than milliseconds. Bytes RTT Bytes Bytes New Overhead in Packet Per Micro in PDM RTT ===================================================================== 1000 20 micro 50 16 20.320 .320 micro 8 Security ConsiderationsPDMdoesis notintroduce any new security weakness. 8.1. SYN Flood and Resource Consumption Attacks PDM needs to calculateaccidently left on after debugging has been done etc. Even so, if using PDM, we introduce thedeltas for time and keep trackconcept ofthe sequence numbers. This means that control blocks mustuser "Consent to bekept at the end hosts per 5-tuple. Any timeMeasured" as acontrol blockpre-requisite for using PDM. Consent iskept, an attacker can try to mis-use the control blocks suchcommon in enterprises and with some subscription services. So, if with PDM, we recommend thatthere is a compromise oftheend host. PDM is used only atuser SHOULD consent to its use. 8 IANA Considerations This draft requests an Option Type assignment in theend hostsDestination Options and Hop-by-Hop Options sub-registry of Internet Protocol Version 6 (IPv6) Parameters [ref to RFCs and URL below]. http://www.iana.org/assignments/ipv6-parameters/ipv6- parameters.xhtml#ipv6-parameters-2 Hex Value Binary Value Description Reference act chg rest ------------------------------------------------------------------- TBD TBD Performance and [This draft] Diagnostic Metrics (PDM) 9 References 9.1 Normative References [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, September 1981. [RFC1122] Braden, R., "Requirements for Internet Hosts -- Communication Layers", RFC 1122, October 1989. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998. [RFC2681] Almes, G., Kalidindi, S., and M. Zekauskas, "A Round-trip Delay Metric for IPPM", RFC 2681, September 1999. [RFC2780] Bradner, S. and V. Paxson, "IANA Allocation Guidelines For Values In thecontrol blocks are only kept at the end hostInternet Protocol andnot at routers or middle boxes. Remember, PDM is an implementationRelated Headers", BCP 37, RFC 2780, March 2000. [RFC4303] Kent, S, "IP Encapsulating Security Payload (ESP)", RFC 4303, December 2005. 9.2 Informative References [TRAM-TCPM] Trammel, B., "Encoding of Time Intervals for theDestination Option extension header.TCP Timestamp Option-01", Internet Draft, July 2013. [Work in Progress] Appendix A"SYN flood" type of attack succeeds because: Timing Considerations A.1 Time Differential Calculations The time counter in aTCP SYN packetCPU issmall but it causes the end host to start creating a place holder for the session such that quiteabit of control block and other storage is used. This is an asynchronous type of attack in thatbinary whole number, representing asmall amountnumber ofwork by the attacker creates a large amountmilliseconds (msec), microseconds (usec) or even picoseconds (psec). Representing one ofworkthese values as attoseconds (asec) means multiplying bythe resource attacked. For PDM, the amount of data10 raised tobe kept is quite small. That is, the control block is quite lightweight. Concerns about SYN Flood and other typesome exponent. Refer to this table ofresource consumption attacks (memory, processing power, etc) can be alleviated by having a limit on the numberequalities: Base value = # ofcontrol block entries. We recommend that implementationsec = # ofPDM SHOULDasec 1000s of asec --------------- ------------- ------------- ------------- 1 second 1 sec 10**18 asec 1000**6 asec 1 millisecond 10**-3 sec 10**15 asec 1000**5 asec 1 microsecond 10**-6 sec 10**12 asec 1000**4 asec 1 nanosecond 10**-9 sec 10**9 asec 1000**3 asec 1 picosecond 10**-12 sec 10**6 asec 1000**2 asec 1 femtosecond 10**-15 sec 10**3 asec 1000**1 asec For example, if you have alimit on the number of control block entries. 8.2 Pervasive monitoring Since PDM passestime differential expressed in microseconds, since each microsecond is 10**12 asec, you would multiply your time value by 10**12 to obtain theclear, a concern arises as to whether the data can be used to fingerprint the system or somehow obtain information about the contents of the payload. Let us discuss fingerprinting of the end host first. It is possible that seeing the patternnumber ofdeltas or the absolute values could give some information asattoseconds. If you time differential is expressed in nanoseconds, you would multiply by 10**9 to get thespeednumber ofthe end host - that is, if itattoseconds. The result is avery fast system or an older, slow device. This may be useful to the attacker. However, if the attacker has access to PDM, the attacker also has accessbinary value that will need tothe entire packet and could make suchbe shortened by adeduction based merely on the time frames elapsed between packets WITHOUT PDM. As far as deducing the contentnumber ofthe payload,bits so itappears to us thatwill fit into the 16-bit PDM DELTA field. The next step isquite unhelpfulto divide by 2 until the value is contained inthis regard. 8.3 PDM as a Covert Channel PDM provides a setjust 16 significant bits. The exponent offieldsthe value in thepacket which could be used to leak data. But, there is no real reason to suspect that PDM would be chosen rather than another partlast column of of thepayload or another Extension Header. A firewall or another device could sanity check the fields withintable is useful here; thePDM but randomly assigned sequence numbers and delta times might be expected to vary widely. The biggest problem thoughinitial scaling factor ishow an attacker would get accessthat exponent multiplied by 10. This is the minimum number of low-order bits toPDM inbe shifted-out or discarded. It represents dividing thefirst placetime value by 1024 raised toleak data.that exponent. Theattacker would haveresulting value may still be too large toeither compromisefit into 16 bits, but can be normalized by shifting out more bits (dividing by 2) until theend host or have Man invalue fits into theMiddle (MitM). It16-bit DELTA field. The number of extra bits shifted out ispossible that either one could change the fields. But,then added to theother end host would get sequence numbers and deltas that don't make any sense. Presumably, one is using PDM and doing packet tracing for diagnostic purposes, soscaling factor. The scaling factor, thechanges would be obvious. Ittotal number of low-order bits dropped, isconceivable that someone could compromisethe SCALEDTL value. For example: say anend host and make itapplication has these startsending packets with PDM withoutand finish timer values (hexadecimal values, in microseconds): Finish: 27C849234 usec (02:57:58.997556) -Start: 27C83F696 usec (02:57:58.957718) ========== ========= =============== Difference 9B9E usec 00.039838 sec or 39838 usec To convert this differential value to binary attoseconds, multiply theknowledgenumber of microseconds by 10**12. Divide by 1024**4, or simply discard 40 bits from thehost. But, again,right. The result is 36232, or 8D88 in hex, with a scaling factor or SCALEDTL value of 40. For another example, presume thebigger problemtime differential is larger, say 32.311072 seconds, which is 32311072 usec. Each microsecond is 10**12 asec, so multiply by 10**12, giving thecompromisehexadecimal value 1C067FCCAE8120000. Using the initial scaling factor of 40, drop theend host. Oncelast 10 characters (40 bits) from that string, giving 1C067FC. This will not fit into a DELTA field, as it isdone,25 bits long. Shifting theattacker probably has better waysvalue toleak data. Having said that, an implementation SHOULD stop using PDM if it gets some number of "nonsensical" sequence numbers.the right another 9IANA Considerations This draft requests an Option Type assignmentbits results in a DELTA value of E033, with a resulting scaling factor of 49. When the time differential value is a small number, regardless of the time unit, the exponent trick given above is not useful in determining theDestination Options and Hop-by-Hop Options sub-registry of Internet Protocol Version 6 (IPv6) Parameters [ref to RFCs and URL below]. http://www.iana.org/assignments/ipv6-parameters/ipv6- parameters.xhtml#ipv6-parameters-2 Hex Value Binary Value Description Reference act chg rest ------------------------------------------------------------------- TBD TBD Performanceproper scaling value. For example, if the time differential is 3 seconds and[This draft] Diagnostic Metrics (PDM) 10 References 10.1 Normative References [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, September 1981. [RFC1122] Braden, R., "Requirements for Internet Hosts -- Communication Layers", RFC 1122, October 1989. [RFC2119] Bradner, S., "Key words for use in RFCsyou want toIndicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998. [RFC2681] Almes, G., Kalidindi, S., and M. Zekauskas, "A Round-trip Delay Metric for IPPM", RFC 2681, September 1999. [RFC2780] Bradner, S. and V. Paxson, "IANA Allocation Guidelines For Values Inconvert that directly, you would follow this path: 3 seconds = 3*10**18 asec (decimal) = 29A2241AF62C0000 asec (hexadecimal) If you just truncate theInternet Protocollast 60 bits, you end up with a delta value of 2 andRelated Headers", BCP 37, RFC 2780, March 2000. [RFC4303] Kent, S, "IP Encapsulating Security Payload (ESP)", RFC 4303, December 2005. 10.2 Informative References [TRAM-TCPM] Trammel, B., "Encodinga scaling factor ofTime Intervals for the TCP Timestamp Option-01", Internet Draft, July 2013. [Work60, when what you really wanted was a delta value with more significant digits. The most precision with which you can store this value inProgress] [IBM-POPS] IBM Corporation, "IBM z/Architecture Principles of Operation", SA22-7832, 1990-2012 1116 bits is A688, with a scaling factor of 46. Acknowledgments The authors would like to thank Keven Haining, Al Morton, Brian Trammel, David Boyes, Bill Jouris, Richard Scheffenegger, and Rick Troth for their comments and assistance. We would also like to thank Tero Kivinen for his detailed and perceptive review. Authors' Addresses Nalini Elkins Inside Products, Inc. 36A Upper Circle Carmel Valley, CA 93924 United States Phone: +1 831 659 8360 Email: nalini.elkins@insidethestack.com http://www.insidethestack.com Robert M. Hamilton Chemical Abstracts Service A Division of the American Chemical Society 2540 Olentangy River Road Columbus, Ohio 43202 United States Phone: +1 614 447 3600 x2517 Email: rhamilton@cas.org http://www.cas.org Michael S. Ackermann Blue Cross Blue Shield of Michigan P.O. Box 2888 Detroit, Michigan 48231 United States Phone: +1 310 460 4080 Email: mackermann@bcbsm.com http://www.bcbsm.com