RFC 6349
Framework for TCP Throughput Testing
Framework for TCP Throughput Testing ๐
Okay bestie, let's get into RFC 6349 ๐ It's the IETF's Framework for TCP Throughput Testing, dated August 2011, and it's an Informational doc (ISSN 2070-1721) ๐ The four authors are B. Constantine (JDSU), G. Forget (Bell Canada, Ext. Consultant), R. Geib (Deutsche Telekom), and R. Schrage (Schrage Consulting). The header I was given doesn't list anything it obsoletes or updates, so there's no drama there ๐
Abstract โจ
So the vibe is this: the framework lays out a practical way to measure end-to-end TCP Throughput in a managed IP network ๐ฆ The whole point is to give a better read on what users actually experience. It also sets certain TCP and IP parameters so you can optimize TCP Throughput ๐
Status of This Memo ๐ธ
This document is not an Internet Standards Track spec. It's published just for informational purposes, so no standards vibes here ๐
It's a product of the IETF, it reflects what the IETF community agrees on, and it got public review and was approved for publication by the Internet Engineering Steering Group (IESG). Not every IESG-approved doc is a candidate for any level of Internet Standard, though. See Section 2 of RFC 5741 for that bit ๐ง
If you want the latest status, any errata, or a way to send feedback, check http://www.rfc-editor.org/info/rfc6349 โญ
Copyright Notice ๐ฅ
Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved ๐
This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stood on the publication date. Read them carefully, because they spell out your rights and restrictions for this document ๐ Any Code Components pulled out of this doc have to include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions. They come without warranty, same as that license says ๐ซถ
Table of Contents ๐
1. Introduction ....................................................3
1.1. Requirements Language ......................................4
1.2. Terminology ................................................5
1.3. TCP Equilibrium ............................................6
2. Scope and Goals .................................................7
3. Methodology .....................................................8
3.1. Path MTU ..................................................10
3.2. Round-Trip Time (RTT) and Bottleneck Bandwidth (BB) .......11
3.2.1. Measuring RTT ......................................11
3.2.2. Measuring BB .......................................12
3.3. Measuring TCP Throughput ..................................12
3.3.1. Minimum TCP RWND ...................................13
4. TCP Metrics ....................................................16
4.1. Transfer Time Ratio .......................................16
4.1.1. Maximum Achievable TCP Throughput Calculation ......17
4.1.2. TCP Transfer Time and Transfer Time Ratio
Calculation ........................................19
4.2. TCP Efficiency ............................................20
4.2.1. TCP Efficiency Percentage Calculation ..............20
4.3. Buffer Delay ..............................................20
4.3.1. Buffer Delay Percentage Calculation ................21
5. Conducting TCP Throughput Tests ................................21
5.1. Single versus Multiple TCP Connections ....................21
5.2. Results Interpretation ....................................22
6. Security Considerations ........................................25
6.1. Denial-of-Service Attacks .................................25
6.2. User Data Confidentiality .................................25
6.3. Interference with Metrics .................................25
7. Acknowledgments ................................................26
8. Normative References ...........................................26
1. Introduction ๐ฆ
Okay so in the network industry, the SLA (Service Level Agreement) that business-class customers get is usually built on Layer 2/3 stuff like bandwidth, latency, packet loss, and delay variation (jitter) ๐ Providers are finally realizing that Layer 2/3 testing alone isn't enough to keep end users happy ๐ญ So this framework adds a methodology for measuring TCP Throughput, so the results actually mean something for user experience โจ
Business-class customers also want to run repeatable TCP Throughput tests between their locations ๐งณ They depend on the provider's network, so a shared test method with predefined metrics would be a win for both sides ๐ค
Real talk, the main focus here is managed business-class IP networks, like Ethernet-terminated services where the organization gets an SLA from the provider ๐ผ Because of that SLA, the expectation is that TCP Throughput should hit the guaranteed bandwidth. "Best effort" users can use this methodology too, but the framework and its metrics are really meant for a predictable managed IP network ๐ And no end-to-end performance can be guaranteed when only the access part is provisioned to a specific bandwidth capacity ๐ โโ๏ธ
The whole goal of this doc is defining a methodology for testing sustained TCP layer performance ๐ Here, achievable TCP Throughput means the amount of data per unit of time that TCP moves while it's in the TCP Equilibrium state (check Section 1.3 for that definition). Throughout the doc, "maximum achievable throughput" means the theoretical achievable throughput when TCP is in the Equilibrium state ๐
TCP is connection oriented ๐ On the sending side it uses a congestion window (TCP CWND). On the receiving end it uses a receive window (TCP RWND), which tells the sender how many Bytes it can accept at any given time ๐ซถ
Here's the chain of logic: the Bandwidth-Delay Product (BDP), which comes from Round-Trip Time (RTT) and network Bottleneck Bandwidth (BB), decides the Send and Receive Socket buffer sizes you need to hit maximum TCP Throughput ๐ง Then, with help from the slow start and congestion avoidance algorithms, a TCP CWND gets calculated based on the IP network path loss rate ๐ Finally, the smaller of the calculated TCP CWND and the TCP RWND the other end advertises decides how many Bytes the sender can actually push out at a given time ๐ฅ
Both window sizes (RWND and CWND) can change during a TCP session. Up to the bandwidth limits, though, a bigger RWND and a bigger CWND get you higher throughput because more Bytes can be in flight at once ๐
Both ends of a TCP connection have default buffer sizes for each socket, plus kernel-enforced maximum buffer sizes. You can adjust these at both ends (sending and receiving) ๐ ๏ธ Some TCP/IP stack implementations use Receive Window Auto-Tuning, but if you want maximum throughput, it's critical to have big enough TCP Send and Receive Socket Buffer sizes ๐ In fact, they SHOULD be equal to or greater than BDP ๐
There are a lot of variables in TCP Throughput performance, but this methodology zeroes in on these:
- BB (Bottleneck Bandwidth)
- RTT (Round-Trip Time)
- Send and Receive Socket Buffers
- Minimum TCP RWND
- Path MTU (Maximum Transmission Unit)
Now, this methodology proposes TCP testing that SHOULD be run on top of the traditional Layer 2/3 tests ๐ Actually, Layer 2/3 tests are REQUIRED first, to verify the integrity of the network before you do any TCP tests ๐ง Examples include "iperf" (UDP mode) and manual packet-layer test techniques where packet throughput, loss, and delay get measured. When they're available, standardized testing similar to [RFC2544], but adapted for operational networks, MAY be used ๐ธ
Note: [RFC2544] was never meant to be used outside a lab environment. ๐งช
Sections 2 and 3 give the general overview of the methodology โจ Section 4 defines the metrics, and Section 5 explains how to run the tests and read the results ๐
1.1. Requirements Language ๐
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. Terminology ๐ง
Here are the definitions this methodology uses, bestie ๐
- TCP Throughput Test Device (TCP TTD) is a compliant TCP host that generates traffic and measures metrics as this methodology defines. Basically, it's a dedicated communications test instrument ๐ฌ
- Customer Provided Equipment (CPE) is customer-owned gear, like routers, switches, computers, and so on ๐ป
- Customer Edge (CE) is a provider-owned demarcation device ๐
- Provider Edge (PE) is a provider's distribution equipment ๐ข
- Bottleneck Bandwidth (BB) is the lowest bandwidth along the complete path. "Bottleneck Bandwidth" and "Bandwidth" mean the same thing in this doc. Most of the time, the Bottleneck Bandwidth is in the access part of the wide-area network (CE - PE) ๐ง
- Provider (P) is provider core network equipment ๐
- Network Under Test (NUT) is the tested IP network path ๐ฏ
- Round-Trip Time (RTT) is the elapsed time between clocking in the first bit of a TCP segment that gets sent and receiving the last bit of the corresponding TCP Acknowledgment โฑ๏ธ
- Bandwidth-Delay Product (BDP) is the product of a data link's capacity (in bits per second) and its end-to-end delay (in seconds) ๐งฎ
Here's the setup visualized ๐
+---+ +----+ +----+ +----+ +---+ +---+ +----+ +----+ +----+ +---+
|TCP|-| CPE|-| CE |--| PE |-| P |--| P |-| PE |--| CE |-| CPE|-|TCP|
|TTD| | | | |BB| | | | | | | |BB| | | | |TTD|
+---+ +----+ +----+ +----+ +---+ +---+ +----+ +----+ +----+ +---+
<------------------------ NUT ------------------------->
R >-----------------------------------------------------------|
T |
T <-----------------------------------------------------------|
Figure 1.2. Devices, Links, and Paths
Last thing, and it's important ๐ซถ The NUT can be built from a bunch of different devices, including but not limited to load balancers, proxy servers, or WAN acceleration appliances ๐งฉ The detailed topology of the NUT SHOULD be well-known when you run TCP Throughput tests, though this methodology makes no attempt to characterize specific network architectures ๐
1.3. TCP Equilibrium ๐ฆ
okay so TCP connections have three (3) fundamental congestion window phases, and they're shown in the figure below ๐
- The Slow Start phase ๐ฃ happens at the very beginning of a TCP transmission, or after a retransmission Time-Out.
- The Congestion Avoidance phase ๐ is where TCP ramps up to establish the maximum achievable throughput. It's important to note that retransmissions are a natural by-product of the TCP congestion avoidance algorithm, because it's always chasing that maximum throughput.
- The Loss Recovery phase ๐ฉน could include Fast Retransmit (Tahoe) or Fast Recovery (Reno and New Reno). When packet loss happens, Congestion Avoidance moves over to either Fast Retransmission or Fast Recovery, depending on the TCP implementation. If a Time-Out happens, TCP goes back to Slow Start.
/\ |
/\ |High ssthresh TCP CWND TCP
/\ |Loss Event * halving 3-Loss Recovery Equilibrium
T | * \ upon loss
h | * \ / \ Time-Out Adjusted
r | * \ / \ +--------+ * ssthresh
T o | * \/ \ / Multiple| *
C u | * 2-Congestion\ / Loss | *
P g | * Avoidance \/ Event | *
h | * Half | *
p | * TCP CWND | * 1-Slow Start
u | * 1-Slow Start Min TCP CWND after T-O
t +-----------------------------------------------------------
Time > > > > > > > > > > > > > > > > > > > > > > > > > >
Note: ssthresh = Slow Start threshold.
Figure 1.3. TCP CWND Phases
A well-tuned and well-managed IP network with appropriate TCP adjustments in the IP hosts and applications should perform very close to the BB when TCP is in the Equilibrium state. โจ
This TCP methodology gives you guidelines for measuring the maximum achievable TCP Throughput when TCP is in the Equilibrium state. All maximum achievable TCP Throughputs specified in Section 3.3 are with respect to this condition. ๐
It is important to clarify the interaction between the sender's Send Socket Buffer and the receiver's advertised TCP RWND size. TCP test programs such as "iperf", "ttcp", etc. let the sender control the quantity of TCP Bytes transmitted and unacknowledged (in-flight), which is commonly referred to as the Send Socket Buffer. This is done independently of the TCP RWND size advertised by the receiver. ๐
2. Scope and Goals ๐ฏ
Before we get into the goals, it is important to clearly define the areas that are out of scope. ๐
- This methodology is not intended to predict the TCP Throughput during the transient stages of a TCP connection, such as during the Slow Start phase.
- This methodology is not intended to definitively benchmark TCP implementations of one OS to another, although some users may find value in conducting qualitative experiments.
- This methodology is not intended to provide detailed diagnosis of problems within endpoints or within the network itself as related to non-optimal TCP performance, although results interpretation for each test step may provide insights to potential issues.
- This methodology does not propose to operate permanently with high measurement loads. TCP performance and optimization within operational networks MAY be captured and evaluated by using data from the "TCP Extended Statistics MIB" [RFC4898]. ๐ง
In contrast to the above exclusions, the primary goal is to define a method to conduct a practical end-to-end assessment of sustained TCP performance within a managed business-class IP network. Another key goal is to establish a set of "best practices" that a non-TCP expert SHOULD apply when validating the ability of a managed IP network to carry end-user TCP applications. ๐
Specific goals are to:
- Provide a practical test approach that specifies tunable parameters (such as MTU (Maximum Transmission Unit) and Socket Buffer sizes) and how these affect the outcome of TCP performance over an IP network.
- Provide specific test conditions such as link speed, RTT, MTU, Socket Buffer sizes, and achievable TCP Throughput when TCP is in the Equilibrium state. For guideline purposes, provide examples of test conditions and their maximum achievable TCP Throughput. Section 1.3 provides specific details concerning the definition of TCP Equilibrium within this methodology, while Section 3 provides specific test conditions with examples.
- Define three (3) basic metrics to compare the performance of TCP connections under various network conditions. See Section 4.
- Provide some areas within the end host or the network that SHOULD be considered for investigation in test situations where the recommended procedure does not yield the maximum achievable TCP Throughput. However, this methodology is not intended to provide detailed diagnosis on these issues. See Section 5.2. ๐
3. Methodology ๐
This methodology is intended for operational and managed IP networks. A multitude of network architectures and topologies can be tested. The diagram in Figure 1.2 is very general and is only provided to illustrate typical segmentation within end-user and network provider domains. ๐ธ
Also, as stated in Section 1, it is considered best practice to verify the integrity of the network by conducting Layer 2/3 tests such as [RFC2544] or other methods of network stress tests. Although it is important to mention here that [RFC2544] was never meant to be used outside a lab environment. ๐งช
It is not possible to make an accurate TCP Throughput measurement when the network is dysfunctional. In particular, if the network is exhibiting high packet loss and/or high jitter, then TCP Layer Throughput testing will not be meaningful. As a guideline, 5% packet loss and/or 150 ms of jitter may be considered too high for an accurate measurement. ๐ฌ
TCP Throughput testing may require cooperation between the end-user customer and the network provider. As an example, in an MPLS (Multiprotocol Label Switching) network architecture, the testing SHOULD be conducted either on the CPE or on the CE device and not on the PE (Provider Edge) router. ๐ค
The following represents the sequential order of steps for this testing methodology:
- Identify the Path MTU. Packetization Layer Path MTU Discovery (PLPMTUD) [RFC4821] SHOULD be conducted. It is important to identify the path MTU so that the TCP TTD is configured properly to avoid fragmentation. ๐
- Baseline Round-Trip Time and Bandwidth. This step establishes the inherent, non-congested Round-Trip Time (RTT) and the Bottleneck Bandwidth (BB) of the end-to-end network path. These measurements are used to provide estimates of the TCP RWND and Send Socket Buffer sizes that SHOULD be used during subsequent test steps. โฑ๏ธ
- TCP Connection Throughput Tests. With baseline measurements of Round-Trip Time and Bottleneck Bandwidth, single- and multiple-TCP-connection throughput tests SHOULD be conducted to baseline network performance. ๐
These three (3) steps are detailed in Sections 3.1 to 3.3.
Important to note are some of the key characteristics and considerations for the TCP test instrument. The test host MAY be a standard computer or a dedicated communications test instrument. In both cases, it MUST be capable of emulating both a client and a server. ๐ฅ๏ธ
The following criteria SHOULD be considered when selecting whether the TCP test host can be a standard computer or has to be a dedicated communications test instrument:
- TCP implementation used by the test host, OS version (e.g., LINUX OS kernel using TCP New Reno), TCP options supported, etc. will obviously be more important when using dedicated communications test instruments where the TCP implementation may be customized or tuned to run in higher-performance hardware. When a compliant TCP TTD is used, the TCP implementation SHOULD be identified in the test results. The compliant TCP TTD SHOULD be usable for complete end-to-end testing through network security elements and SHOULD also be usable for testing network sections.
- More importantly, the TCP test host MUST be capable of generating and receiving stateful TCP test traffic at the full BB of the NUT. Stateful TCP test traffic means that the test host MUST fully implement a TCP/IP stack; this is generally a comment aimed at dedicated communications test equipment that sometimes "blasts" packets with TCP headers. At the time of this publication, testing TCP Throughput at rates greater than 100 Mbps may require high-performance server hardware or dedicated hardware-based test tools. ๐ช
- A compliant TCP Throughput Test Device MUST allow adjusting both Send and Receive Socket Buffer sizes. The Socket Buffers MUST be large enough to fill the BDP. ๐ชฃ
- Measuring RTT and retransmissions per connection will generally require a dedicated communications test instrument. In the absence of dedicated hardware-based test tools, these measurements may need to be conducted with packet capture tools, i.e., conduct TCP Throughput tests and analyze RTT and retransmissions in packet captures. Another option MAY be to use the "TCP Extended Statistics MIB" [RFC4898]. ๐ต๏ธโโ๏ธ
- The [RFC4821] PLPMTUD test SHOULD be conducted with a dedicated tester that exposes the ability to run the PLPMTUD algorithm independently from the OS stack. ๐งฐ
3.1. Path MTU ๐ฆ
TCP implementations should use Path MTU Discovery techniques (PMTUD). PMTUD relies on ICMP 'need to frag' messages to learn the path MTU. When a device has a packet to send that has the Don't Fragment (DF) bit in the IP header set and the packet is larger than the MTU of the next hop, the packet is dropped, and the device sends an ICMP 'need to frag' message back to the host that originated the packet. The ICMP 'need to frag' message includes the next-hop MTU, which PMTUD uses to adjust itself. Unfortunately, because many network managers completely disable ICMP, this technique does not always prove reliable. ๐ญ
Packetization Layer Path MTU Discovery (PLPMTUD) [RFC4821] MUST then be conducted to verify the network path MTU. PLPMTUD can be used with or without ICMP. [RFC4821] specifies search_high and search_low parameters for the MTU, and we recommend using those parameters. The goal is to avoid fragmentation during all subsequent tests. ๐ซถ
3.2. Round-Trip Time (RTT) and Bottleneck Bandwidth (BB) โณ
Before stateful TCP testing can begin, it is important to determine the baseline RTT (i.e., non-congested inherent delay) and BB of the end-to-end network to be tested. These measurements are used to calculate the BDP and to provide estimates of the TCP RWND and Send Socket Buffer sizes that SHOULD be used in subsequent test steps. ๐ฆ
3.2.1. Measuring RTT
okay so bestie, let's get into it ๐ RTT is the elapsed time between the clocking in of the first bit of a TCP segment sent and the receipt of the last bit of the corresponding TCP Acknowledgment, like we said back in Section 1.2 ๐ฆ
the RTT SHOULD be baselined during off-peak hours ๐ to get a reliable read on the inherent network latency, because otherwise extra delay from network buffering can sneak in and mess with your numbers ๐ also, when you're sampling RTT values over a test interval, the minimum measured value SHOULD be used as the baseline RTT. that one is the closest estimate of the real inherent RTT, so it's giving accuracy ๐ฏ this baseline is also what gets used to work out the Buffer Delay Percentage metric from Section 4.3 โจ
this list isn't exhaustive, just the most common ways to get a Round-Trip Time, and it's ordered from most accurate to least accurate ๐ whether you can use ICMP pings or need a dedicated test instrument with precision timers depends on how precise you need to be (ms vs us) ๐ง
- Use test equipment on each end of the network, "looping" the far-end tester so that a packet stream can be measured back and forth from end to end. This RTT measurement may be compatible with delay measurement protocols specified in [RFC5357].
- Conduct packet captures of TCP test sessions using "iperf" or FTP, or other TCP test applications. By running multiple experiments, packet captures can then be analyzed to estimate RTT. It is important to note that results based upon the SYN -> SYN-ACK at the beginning of TCP sessions SHOULD be avoided, since Firewalls might slow down 3-way handshakes. Also, at the sender's side, Ostermann's LINUX TCPTRACE utility with
-l -rarguments can be used to extract the RTT results directly from the packet captures. - Obtain RTT statistics available from MIBs defined in [RFC4898].
- ICMP pings may also be adequate to provide Round-Trip Time estimates, provided that the packet size is factored into the estimates (i.e., pings with different packet sizes might be required). Some limitations with ICMP ping may include ms resolution and whether or not the network elements are responding to pings. Also, ICMP is often rate-limited or segregated into different buffer queues. ICMP might not work if QoS (Quality of Service) reclassification is done at any hop. ICMP is not as reliable and accurate as in-band measurements.
3.2.2. Measuring BB
before you run any TCP Throughput test, bandwidth measurement tests SHOULD be run with stateless IP streams (aka not stateful TCP) so you can figure out the BB of the NUT ๐ซถ these measurements SHOULD be conducted in both directions, especially on asymmetrical access networks (think Asymmetric Bit-Rate DSL (ADSL) access) ๐ and these tests SHOULD be performed at various intervals throughout a business day, or even across a whole week ๐
testing at different time intervals gives you a much better picture of TCP Throughput and way better diagnosis insight, especially when there are TCP performance issues ๐ฅ the bandwidth tests SHOULD produce logged outputs of the achieved bandwidths across the complete test duration ๐
there are loads of well-established techniques for estimating bandwidth over a network ๐ง it's a common practice for network providers to run Layer 2/3 bandwidth capacity tests using [RFC2544], although [RFC2544] was never meant to be used outside a lab environment, so be careful ๐ these bandwidth measurements SHOULD use network capacity techniques as defined in [RFC5136] ๐
3.3. Measuring TCP Throughput
this methodology is all about measuring TCP Throughput to verify the maximum achievable TCP performance in a managed business-class IP network ๐
once you've got your baseline RTT and BB from Section 3.2, a series of single- and/or multiple-TCP-connection throughput tests SHOULD be conducted ๐
the number of trials and whether you go with single or multiple TCP connections depends on what you're trying to find out ๐ธ a single-TCP-connection test might be enough to measure the achievable throughput of Metro Ethernet connectivity. BUT, and this is a big but, various traffic management techniques can be used in an IP network, and some of them can only be tested with multiple connections ๐ญ for example, multiple TCP sessions might be required to detect traffic shaping versus policing. multiple sessions might also be needed to measure Active Queue Management performance. however, traffic management testing is not within the scope of this test methodology, so don't go there with this one ๐ โโ๏ธ
in every circumstance, it is RECOMMENDED to run the tests in each direction independently first, and then run them in both directions simultaneously ๐ it is also RECOMMENDED to run the tests at different times of the day โญ
in each case, the TCP Transfer Time Ratio, the TCP Efficiency Percentage, and the Buffer Delay Percentage MUST be measured in each direction. these 3 metrics are defined in Section 4 ๐
3.3.1. Minimum TCP RWND ๐
okay bestie, this one's a big deal. The TCP TTD MUST allow the Send Socket Buffer and Receive Window sizes to be set higher than the BDP, or TCP performance is going to be limited ๐ญ. In business customer environments, the average user usually can't change these settings. They're hard-coded into the app or baked into the OS as part of a corporate image ๐ผ. So the user's host often ends up with Send Socket Buffer and Receive Window sizes that aren't optimal ๐.
This section works out BDPs under a bunch of network conditions. It also shows what TCP Throughput looks like with different TCP RWND sizes, so you can see what settings above the BDP can get you, compared to what you'd actually get in real-world conditions ๐ฆ.
The minimum required TCP RWND size comes from the Bandwidth-Delay Product (BDP), and the math goes like this:
BDP (bits) = RTT (sec) X BB (bps)
Note that RTT is being used as the "Delay" variable for the BDP ๐ง . Then divide the BDP by 8 and you get the minimum required TCP RWND size in Bytes โจ. For optimal results, the Send Socket Buffer MUST be adjusted to the same value at each end of the network ๐ .
Minimum required TCP RWND = BDP / 8
For example, on a T3 link with a 25-ms RTT, the BDP is ~1,105,000 bits, and the minimum required TCP RWND is ~138 KB ๐.
Separate calculations are REQUIRED on asymmetrical paths. Here's an asymmetrical example: a 90-ms RTT ADSL line with 5 Mbps downstream and 640 Kbps upstream. The downstream BDP is ~450,000 bits, but the upstream one is only ~57,600 bits ๐. Two directions, two totally different answers, periodt ๐.
The table below shows some representative link speeds, RTTs, BDPs, and their matching minimum required TCP RWND sizes ๐.
Link Minimum Required
Speed* RTT BDP TCP RWND
(Mbps) (ms) (bits) (KBytes)
--------------------------------------------------------------------
1.536 20.00 30,720 3.84
1.536 50.00 76,800 9.60
1.536 100.00 153,600 19.20
44.210 10.00 442,100 55.26
44.210 15.00 663,150 82.89
44.210 25.00 1,105,250 138.16
100.000 1.00 100,000 12.50
100.000 2.00 200,000 25.00
100.000 5.00 500,000 62.50
1,000.000 0.10 100,000 12.50
1,000.000 0.50 500,000 62.50
1,000.000 1.00 1,000,000 125.00
10,000.000 0.05 500,000 62.50
10,000.000 0.30 3,000,000 375.00
* Note that link speed is the BB for the NUT
Table 3.3.1. Link Speed, RTT, Calculated BDP, and Minimum TCP RWND
In the table above, these serial link speeds are used:
- T1 = 1.536 Mbps (for a B8ZS line encoding facility)
- T3 = 44.21 Mbps (for a C-Bit framing facility)
The table shows the minimum required TCP RWND. If you use a smaller TCP RWND size, TCP Throughput can't be optimal ๐ค. To work out TCP Throughput, use this formula:
TCP Throughput = TCP RWND X 8 / RTT
Here's an example: a 100-Mbps IP path with a 5-ms RTT and a TCP RWND of 16 KB โจ.
TCP Throughput = 16 KBytes X 8 bits / 5 ms
TCP Throughput = 128,000 bits / 0.005 sec
TCP Throughput = 25.6 Mbps
Another one, for a T3 using the same formula, is shown in Figure 3.3.1a ๐ง.
TCP Throughput = 16 KBytes X 8 bits / 10 ms
TCP Throughput = 128,000 bits / 0.01 sec
TCP Throughput = 12.8 Mbps*
When the TCP RWND size goes over the BDP (T3 link with a 64-KByte TCP RWND on a 10-ms RTT path), the maximum Frames Per Second (FPS) limit of 3664 gets hit ๐ฅ. From that point on, use this formula:
TCP Throughput = max FPS X (MTU - 40) X 8
TCP Throughput = 3664 FPS X 1460 Bytes X 8 bits
TCP Throughput = 42.8 Mbps**
The diagram below compares the TCP Throughputs you can get on a T3 with Send Socket Buffer and TCP RWND sizes of 16 KB versus 64 KB ๐.
45|
| _______**42.8
40| |64KB |
TCP | | |
Through- 35| | |
put | | | +-----+34.1
(Mbps) 30| | | |64KB |
| | | | |
25| | | | |
| | | | |
20| | | | | _______20.5
| | | | | |64KB |
15| | | | | | |
|*12.8+-----| | | | | |
10| |16KB | | | | | |
| | | |8.5 +-----| | | |
5| | | | |16KB | |5.1 +-----| |
|_____|_____|_____|____|_____|_____|____|16KB |_____|____
10 15 25
RTT (milliseconds)
Figure 3.3.1a. TCP Throughputs on a T3 at Different RTTs
This diagram shows the TCP Throughput you can get on a 25-ms T3 when the Send Socket Buffer and TCP RWND sizes go up ๐.
45|
|
40| +-----+40.9
TCP | | |
Through- 35| | |
put | | |
(Mbps) 30| | |
| | |
25| | |
| | |
20| +-----+20.5 | |
| | | | |
15| | | | |
| | | | |
10| +-----+10.2 | | | |
| | | | | | |
5| +-----+5.1 | | | | | |
|_____|_____|______|_____|______|_____|______|_____|_____
16 32 64 128*
TCP RWND Size (KBytes)
* Note that 128 KB requires the [RFC1323] TCP Window Scale option.
Figure 3.3.1b. TCP Throughputs on a T3 with Different TCP RWND
4. TCP Metrics โจ
This methodology is all about TCP Throughput, and it gives you 3 basic metrics to make the results easier to understand ๐ง. Honestly, TCP is complicated and unpredictable, with so many variables (RTT variations, loss conditions, TCP implementations, and so on) that it's really hard to build a complete set of metrics covering all of them ๐ตโ๐ซ. Still, these 3 metrics make TCP Throughput comparisons way easier across different network conditions and host buffer size/RWND settings ๐.
4.1. Transfer Time Ratio ๐ฆ
The first metric is the TCP Transfer Time Ratio. It's just the ratio of the Actual TCP Transfer Time to the Ideal TCP Transfer Time ๐ .
The Actual TCP Transfer Time is simply how long it takes to move a block of data across the TCP connection(s) ๐.
The Ideal TCP Transfer Time is the predicted time a block of data SHOULD take to transfer across the TCP connection(s), based on the BB of the NUT ๐ฏ.
Actual TCP Transfer Time
TCP Transfer Time Ratio = -------------------------
Ideal TCP Transfer Time
The Ideal TCP Transfer Time comes from the Maximum Achievable TCP Throughput. That's tied to the BB and to the Layer 1/2/3/4 overheads on the network path ๐งฉ. The sections below walk through the Maximum Achievable TCP Throughput derivations and show some example TCP Transfer Time Ratio calculations ๐ญ.
4.1.1. Maximum Achievable TCP Throughput Calculation ๐ธ
This section gives you formulas for the Maximum Achievable TCP Throughput, with examples for T3 (44.21 Mbps) and Ethernet ๐ง.
All calculations are based on IP version 4, with TCP/IP headers of 20 Bytes each (20 for TCP + 20 for IP) inside an MTU of 1500 Bytes ๐ซถ.
First up, the maximum achievable Layer 2 throughput of a T3 interface is capped by the maximum number of Frames Per Second (FPS) the actual physical layer (Layer 1) speed allows ๐ข.
The calculation is:
FPS = T3 Physical Speed / ((MTU + PPP + Flags + CRC16) X 8)
FPS = (44.21 Mbps /
((1500 Bytes + 4 Bytes + 2 Bytes + 2 Bytes) X 8 )))
FPS = (44.21 Mbps / (1508 Bytes X 8))
FPS = 44.21 Mbps / 12064 bits
FPS = 3664
Then, to get the Maximum Achievable TCP Throughput (Layer 4), just use:
(MTU - 40) in Bytes X 8 bits X max FPS
For a T3, the maximum TCP Throughput is:
1460 Bytes X 8 bits X 3664 FPS
Maximum TCP Throughput = 11680 bits X 3664 FPS
Maximum TCP Throughput = 42.8 Mbps
On Ethernet, the maximum achievable Layer 2 throughput is limited by the maximum Frames Per Second the IEEE802.3 standard allows ๐.
The maximum FPS for 100-Mbps Ethernet is 8127, and the formula is:
FPS = (100 Mbps / (1538 Bytes X 8 bits))
The maximum FPS for GigE is 81274, and the formula is:
FPS = (1 Gbps / (1538 Bytes X 8 bits))
The maximum FPS for 10GigE is 812743, and the formula is:
FPS = (10 Gbps / (1538 Bytes X 8 bits))
The 1538 Bytes breaks down like this:
MTU + Ethernet + CRC32 + IFG + Preamble + SFD
(IFG = Inter-Frame Gap and SFD = Start of Frame Delimiter)
where MTU is 1500 Bytes, Ethernet is 14 Bytes, CRC32 is 4 Bytes, IFG is 12 Bytes, Preamble is 7 Bytes, and SFD is 1 Byte ๐งฎ.
Then, to get the Maximum Achievable TCP Throughput (Layer 4), just use:
(MTU - 40) in Bytes X 8 bits X max FPS
For 100-Mbps Ethernet, the maximum TCP Throughput is:
1460 Bytes X 8 bits X 8127 FPS
Maximum TCP Throughput = 11680 bits X 8127 FPS
Maximum TCP Throughput = 94.9 Mbps
One more thing ๐: the original notes that better results could be seen with jumbo frames on Gigabit and 10-Gigabit Ethernet interfaces โจ.
4.1.2. TCP Transfer Time and Transfer Time Ratio Calculation ๐
Okay bestie, this table shows the Ideal TCP Transfer Time for one TCP connection when its TCP RWND and Send Socket Buffer sizes are equal to or bigger than the BDP. It's giving perfect-world numbers ๐
Link Maximum Ideal TCP
Speed BDP Achievable TCP Transfer Time
(Mbps) RTT (ms) (KBytes) Throughput(Mbps) (seconds)*
--------------------------------------------------------------------
1.536 50.00 9.6 1.4 571.0
44.210 25.00 138.2 42.8 18.0
100.000 2.00 25.0 94.9 9.0
1,000.000 1.00 125.0 949.2 1.0
10,000.000 0.05 62.5 9,492.0 0.1
* Transfer times are rounded for simplicity.
Table 4.1.2. Link Speed, RTT, BDP, TCP Throughput, and
Ideal TCP Transfer Time for a 100-MB File
For a 100-MB file (100 X 8 = 800 Mbits), the Ideal TCP Transfer Time is worked out like this ๐งฎโจ
800 Mbits
Ideal TCP Transfer Time = -----------------------------------
Maximum Achievable TCP Throughput
Now let's talk about the TCP Transfer Time Ratio ๐ Picture a bulk transfer of 100 MB over 5 simultaneous TCP connections, where each connection moves its own 100 MB. In this example, the Ethernet service gives you a Committed Access Rate (CAR) of 500 Mbps. Each connection can hit different throughputs during a test, and the overall throughput rate isn't always easy to pin down (especially as the number of connections goes up) ๐ญ
The Ideal TCP Transfer Time would be ~8 seconds, but in this example the Actual TCP Transfer Time was 12 seconds. So the TCP Transfer Time Ratio is 12/8 = 1.5, which means the transfer across all connections took 1.5 times longer than the ideal. Literally a plot twist ๐
4.2. TCP Efficiency ๐ฆ
The second metric is the percentage of Bytes that were not retransmitted. Iconic. ๐
Transmitted Bytes - Retransmitted Bytes
TCP Efficiency % = --------------------------------------- X 100
Transmitted Bytes
Transmitted Bytes are the total number of TCP Bytes sent, counting both the original Bytes and the retransmitted Bytes ๐งพ
4.2.1. TCP Efficiency Percentage Calculation ๐
Let's say 100,000 Bytes were sent and 2,000 of them had to be retransmitted. The TCP Efficiency Percentage works out to:
102,000 - 2,000
TCP Efficiency % = ----------------- X 100 = 98.03%
102,000
Heads up: the Retransmitted Bytes may have happened more than once. If that's the case, every extra retransmission gets added to both the Retransmitted Bytes count and the Transmitted Bytes count ๐
4.3. Buffer Delay ๐ธ
The third metric is the Buffer Delay Percentage. It shows how much the RTT goes up during a TCP Throughput test compared to the inherent or baseline RTT. The baseline RTT is the Round-Trip Time that's built into the network path when it isn't congested, as defined in Section 3.2.1. The average RTT is the total of all the RTTs measured during the actual test (one per second), divided by the test duration in seconds โฑ๏ธ
Total RTTs during transfer
Average RTT during transfer = -----------------------------
Transfer duration in seconds
Average RTT during transfer - Baseline RTT
Buffer Delay % = ------------------------------------------ X 100
Baseline RTT
4.3.1. Buffer Delay Percentage Calculation ๐ง
Here's an example. Imagine a network path with a baseline RTT of 25 ms. During a TCP transfer, the average RTT across the whole transfer climbs to 32 ms. The Buffer Delay Percentage comes out to:
32 - 25
Buffer Delay % = ------- X 100 = 28%
25
Real talk: the TCP Transfer Time Ratio, the TCP Efficiency Percentage, and the Buffer Delay Percentage MUST all be measured during each throughput test ๐ซถ A poor TCP Transfer Time Ratio (meaning the Actual TCP Transfer Time is greater than the Ideal TCP Transfer Time) can be diagnosed by looking at the TCP Efficiency Percentage and/or the Buffer Delay Percentage, since those metrics can be sub-optimal too ๐
5. Conducting TCP Throughput Tests โจ
Several TCP tools are used all over the network world, and one of the most common is "iperf" ๐งฐ With this tool, you install hosts at each end of the network path. One acts as a client and the other acts as a server. You can manually set the Send Socket Buffer and TCP RWND sizes of both the client and the server. Then you measure the achieved throughput, either uni-directionally or bi-directionally. For higher-BDP situations in lossy networks (Long Fat Networks (LFNs), satellite links, etc.), TCP options such as Selective Acknowledgment SHOULD become part of the window size/throughput characterization ๐ฐ๏ธ
Host hardware performance has to be well understood before running the tests in the following sections. A dedicated communications test instrument will generally be REQUIRED, especially for line rates of GigE and 10 GigE ๐ป A compliant TCP TTD SHOULD give a warning message when the expected test throughput will go over the subscribed customer SLA. If the throughput test is expected to go over the subscribed customer SLA, then the test SHOULD be coordinated with the network provider ๐
The TCP Throughput test SHOULD run long enough to properly exercise network buffers (i.e., greater than 30 seconds), and it SHOULD also characterize performance at different times of the day ๐โฐ
5.1. Single versus Multiple TCP Connections ๐
Deciding between single- or multiple-TCP-connection tests depends on how big the BDP is compared to the TCP RWND configured in the end-user environment. For example, if the BDP for a Long Fat Network (LFN) turns out to be 2 MB, then testing that network path with multiple connections is probably more realistic ๐ง Assuming typical host TCP RWND sizes of 64 KB (e.g., Windows XP), using 32 TCP connections would emulate a small-office scenario ๐ข
The following table shows the relationship between the TCP RWND and the number of TCP connections needed to fill the available capacity of a given BDP. For this example, the network bandwidth is 500 Mbps and the RTT is 5 ms, so the BDP works out to 312.5 KBytes ๐
Number of TCP Connections
TCP RWND to fill available bandwidth
--------------------------------------
16 KB 20
32 KB 10
64 KB 5
128 KB 3
Table 5.1. Number of TCP Connections versus TCP RWND
The TCP Transfer Time Ratio is super useful when you're running multiple-connection tests. Each connection SHOULD be configured to transfer payloads of the same size (e.g., 100 MB). Then the TCP Transfer Time Ratio gives you a simple metric to check the actual versus expected results ๐
Quick reminder: the TCP transfer time is the time each connection needs to finish moving its predetermined payload size. From the previous table, we're looking at the 64-KB window. Each of the 5 TCP connections would be configured to transfer 100 MB, and each one should get a maximum of 100 Mbps. So in this example, the 100-MB payload should be moved across the connections in approximately 8 seconds, which is the Ideal TCP Transfer Time under these conditions ๐ฏ
On top of that, the TCP Efficiency Percentage metric MUST be computed for each connection as defined in Section 4.2 ๐ซถโจ
5.2. Results Interpretation ๐
okay bestie, at the end the TCP Throughput Test Device (TCP TTD) SHOULD generate a report with the calculated BDP and a set of Window size experiments ๐ . Window size refers to the minimum of the Send Socket Buffer and TCP RWND ๐. The report SHOULD include TCP Throughput results for each TCP Window size tested ๐. The goal is to show achievable versus actual TCP Throughput with respect to the TCP Window size when no fragmentation occurs โจ. The report SHOULD also include the results for the 3 metrics defined in Section 4 ๐ฆ. The whole point is a clear relationship between these 3 metrics and user experience ๐ซถ. For example, for the same Transfer Time Ratio results, a better TCP Efficiency could be obtained at the cost of higher Buffer Delays ๐. That's a real trade-off, not a free lunch, so don't skip it ๐.
When your results aren't the ideal values, here are the usual suspects ๐ต๏ธโโ๏ธ:
- Network congestion causing packet loss, which may be inferred from a poor TCP Efficiency % (i.e., higher TCP Efficiency % = less packet loss) ๐ญ.
- Network congestion causing an increase in RTT, which may be inferred from the Buffer Delay Percentage (i.e., 0% = no increase in RTT over baseline) ๐.
- Intermediate network devices that actively regenerate the TCP connection and can alter TCP RWND size, MTU, etc. ๐ง
- Rate limiting by policing instead of shaping ๐ง.
- Maximum TCP Buffer Space ๐ง . All operating systems have a global mechanism to limit the quantity of system memory to be used by TCP connections. On some systems, each connection is subject to a memory limit that is applied to the total memory used for input data, output data, and controls. On other systems, there are separate limits for input and output buffer spaces per connection. Client/server IP hosts might be configured with Maximum TCP Buffer Space limits that are far too small for high-performance networks ๐.
- Socket Buffer sizes ๐งบ. Most operating systems support separate per-connection send and receive buffer limits that can be adjusted as long as they stay within the maximum memory limits. These socket buffers MUST be large enough to hold a full BDP of TCP Bytes plus some overhead. There are several methods to adjust Socket Buffer sizes, but TCP Auto-Tuning automatically adjusts these as needed to optimally balance TCP performance and memory usage ๐ช.
- It is important to note that Auto-Tuning is enabled by default in LINUX since kernel release 2.6.6 and in UNIX since FreeBSD 7.0. It is also enabled by default in Windows since Vista and in Mac since OS X version 10.5 (Leopard). Over-buffering can cause some applications to behave poorly, typically causing sluggish interactive response and introducing the risk of running the system out of memory. Large default socket buffers have to be considered carefully on multi-user systems ๐.
- TCP Window Scale option [RFC1323] ๐. This option enables TCP to support large BDP paths. It provides a scale factor that is required for TCP to support window sizes larger than 64 KB. Most systems automatically request WSCALE under some conditions, such as when the Receive Socket Buffer is larger than 64 KB or when the other end of the TCP connection requests it first. WSCALE can only be negotiated during the 3-way handshake. If either end fails to request WSCALE or requests an insufficient value, it cannot be renegotiated. Different systems use different algorithms to select WSCALE, but it is very important to have large enough buffer sizes. Note that under these constraints, a client application wishing to send data at high rates may need to set its own receive buffer to something larger than 64 KBytes before it opens the connection, to ensure that the server properly negotiates WSCALE. A system administrator might have to explicitly enable [RFC1323] extensions. Otherwise, the client/server IP host would not support TCP Window sizes (BDP) larger than 64 KB. Most of the time, performance gains will be obtained by enabling this option in LFNs ๐.
- TCP Timestamps option [RFC1323] โฑ๏ธ. This feature provides better measurements of the Round-Trip Time and protects TCP from data corruption that might occur if packets are delivered so late that the sequence numbers wrap before they are delivered. Wrapped sequence numbers do not pose a serious risk below 100 Mbps, but the risk increases at higher data rates. Most of the time, performance gains will be obtained by enabling this option in Gigabit-bandwidth networks ๐ซ.
- TCP Selective Acknowledgments (SACK) option [RFC2018] ๐ฏ. This allows a TCP receiver to inform the sender about exactly which data segment is missing and needs to be retransmitted. Without SACK, TCP has to estimate which data segment is missing, which works just fine if all losses are isolated (i.e., only one loss in any given round trip). Without SACK, TCP takes a very long time to recover after multiple and consecutive losses. SACK is now supported by most operating systems, but it may have to be explicitly enabled by the system administrator. In networks with unknown load and error patterns, TCP SACK will improve throughput performance. On the other hand, security appliance vendors might have implemented TCP randomization without considering TCP SACK, and under such circumstances, SACK might need to be disabled in the client/server IP hosts until the vendor corrects the issue. Also, poorly implemented SACK algorithms might cause extreme CPU loads and might need to be disabled ๐ฅด.
- Path MTU ๐ฃ๏ธ. The client/server IP host system SHOULD use the largest possible MTU for the path. This may require enabling Path MTU Discovery [RFC1191] and [RFC4821]. Since [RFC1191] is flawed, Path MTU Discovery is sometimes not enabled by default and may need to be explicitly enabled by the system administrator. [RFC4821] describes a new, more robust algorithm for MTU discovery and ICMP black hole recovery ๐ณ๏ธ.
- TOE (TCP Offload Engine) ๐ง. Some recent Network Interface Cards (NICs) are equipped with drivers that can do part or all of the TCP/IP protocol processing. TOE implementations require additional work (i.e., hardware-specific socket manipulation) to set up and tear down connections. Because TOE NIC configuration parameters are vendor-specific and not necessarily RFC-compliant, they are poorly integrated with UNIX and LINUX. Occasionally, TOE might need to be disabled in a server because its NIC does not have enough memory resources to buffer thousands of connections ๐ซ .
Note that both ends of a TCP connection MUST be properly tuned. Both sides of the call need to show up dressed for the occasion ๐ ๐.
6. Security Considerations ๐
Measuring TCP network performance raises security concerns. Metrics produced within this framework may create security issues ๐จ.
6.1. Denial-of-Service Attacks ๐งจ
TCP network performance metrics, as defined in this document, attempt to fill the NUT with a stateful connection. However, since the test MAY use stateless IP streams as specified in Section 3.2.2, it might appear to network operators to be a denial-of-service attack. Thus, as mentioned at the beginning of Section 3, TCP Throughput testing may require cooperation between the end-user customer and the network provider ๐ค.
6.2. User Data Confidentiality ๐
Metrics within this framework generate packets from a sample, rather than taking samples based on user data. Thus, our framework does not threaten user data confidentiality ๐.
6.3. Interference with Metrics ๐ก
The security considerations that apply to any active measurement of live networks are relevant here as well. See [RFC4656] and [RFC5357] ๐ง.
7. Acknowledgments ๐
Thanks to Lars Eggert, Al Morton, Matt Mathis, Matt Zekauskas, Yaakov Stein, and Loki Jorgenson for many good comments and for pointing us to great sources of information pertaining to past works in the TCP capacity area ๐ซถโจ.
8. Normative References ๐
- [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, November 1990.
- [RFC1323] Jacobson, V., Braden, R., and D. Borman, "TCP Extensions for High Performance", RFC 1323, May 1992.
- [RFC2018] Mathis, M., Mahdavi, J., Floyd, S., and A. Romanow, "TCP Selective Acknowledgment Options", RFC 2018, October 1996.
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
- [RFC2544] Bradner, S. and J. McQuaid, "Benchmarking Methodology for Network Interconnect Devices", RFC 2544, March 1999.
- [RFC4656] Shalunov, S., Teitelbaum, B., Karp, A., Boote, J., and M. Zekauskas, "A One-way Active Measurement Protocol (OWAMP)", RFC 4656, September 2006.
- [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU Discovery", RFC 4821, March 2007.
- [RFC4898] Mathis, M., Heffner, J., and R. Raghunarayan, "TCP Extended Statistics MIB", RFC 4898, May 2007.
- [RFC5136] Chimento, P. and J. Ishac, "Defining Network Capacity", RFC 5136, February 2008.
- [RFC5357] Hedayat, K., Krzanowski, R., Morton, A., Yum, K., and J. Babiarz, "A Two-Way Active Measurement Protocol (TWAMP)", RFC 5357, October 2008.
Authors' Addresses ๐
Here are the contact details for the authors, all lined up nice and neat for you ๐:
Barry Constantine
JDSU, Test and Measurement Division
One Milesone Center Court
Germantown, MD 20876-7100
USA
Phone: +1 240 404 2227
EMail: barry.constantine@jdsu.com
Gilles Forget
Independent Consultant to Bell Canada
308, rue de Monaco, St-Eustache
Qc. J7P-4T5 CANADA
Phone: (514) 895-8212
EMail: gilles.forget@sympatico.ca
Ruediger Geib
Heinrich-Hertz-Strasse 3-7
Darmstadt, 64295 Germany
Phone: +49 6151 5812747
EMail: Ruediger.Geib@telekom.de
Reinhard Schrage
Osterende 7
Seelze, 30926
Germany
Schrage Consulting
Phone: +49 (0) 5137 909540
EMail: reinhard@schrageconsult.com
๐ฆ where this page comes from
- ietf: rfc6349 2011-08
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms