3. TCP Extensions: A Case Study
This section examines the effects of using our proposed methodology to implement changes to TCP. We will begin by analyzing the backward compatible extensions defined in RFC's 1072 and 1185, and proposing a set of much simpler evolutionary modifications. We also analyze several more problematical extensions to TCP, such as Transactional TCP. Finally, we point our some areas of TCP which may require changes in the future.
The evolutionary modification to TCP that we propose includes all of the functionality described in RFC's 1072 and 1185, but does not preserve the header format. At the risk of being misunderstood as believing backward compatibility is a good idea, we also show how our proposed changes to TCP can be folded into a backward compatible implementation of TCP. We do this as a courtesy for those readers that cannot accept the possibility of multiple versions of TCP.
3.1. RFC's 1072 and 1185
3.1.1. Round Trip Timing
In RFC 1072, a new ECHO option is proposed that allows each TCP packet to carry a timestamp in its header. This timestamp is used to keep a more accurate estimate of the RTT (round trip time) used to decide when to re-transmit segments. In the original TCP algorithm, the sender manually times a small number of sends. The resulting algorithm was quite complex and does not produce an accurate enough RTT for high capacity networks. The inclusion of a timestamp in every header both simplifies the code needed to calculate the RTT and improves the accuracy and robustness of the algorithm.
The new algorithm as proposed in RFC 1072 does not appear to have any serious problems. However, the authors of RFC 1072 go to great lengths in an attempt to keep this modification backward compatible with the previous version of TCP. They place an ECHO option in the SYN segment and state, "It is likely that most implementations will properly ignore any options in the SYN segment that they do not understand, so new initial options should not cause problems" [4]. This statement does not exactly inspire confidence, and we consider the addition of an optional field to any protocol to be a de-facto, if not a de-jure, example of an evolutionary change. Optional fields simply attempt to hide the basic incompatibility inside the protocol, it does not eliminate it. Therefore, since we are making an evolutionary change anyway, the only modification to the proposed algorithm is to move the fields into the header proper. Thus, each header will contain 32-bit echo and echo reply fields. Two fields are needed to handle bi-directional data streams.
3.1.2. Window Size and Sequence Number Space
Long Fat Networks (LFN's), networks which contain very high capacity lines with very high latency, introduce the possibility that the number of bits in transit (the bandwidth-delay product) could exceed the TCP window size, thus making TCP the limiting factor in network performance. Worse yet, the time it takes the sequence numbers to wrap around could be reduced to a point below the MSL (maximum segment lifetime), introducing the possibility of old packets being mistakenly accepted as new.
RFC 1072 extends the window size through the use of an implicit constant scaling factor. The window size in the TCP header is multiplied by this factor to get the true window size. This algorithm has three problems. First, one must prove that at all times the implicit scaling factor used by the sender is the same as the receiver. The proposed algorithm appears to do so, but the complexity of the algorithm creates the opportunity for poor implementations to affect the correctness of TCP. Second, the use of a scaling factor complicates the TCP implementation in general, and can have serious effects on other parts of the protocol.
A final problem is what we characterize as the "quantum window sizing" problem. Assuming that the scaling factors will be powers of two, the algorithm right shifts the receiver's window before sending it. This effectively rounds the window size down to the nearest multiple of the scaling factor. For large scaling factors, say 64k, this implies that window values are all multiples of 64k and the minimum window size is 64k; advertising a smaller window is impossible. While this is not necessarily a problem (and it seems to be an extreme solution to the silly window syndrome) what effect this will have on the performance of high-speed network links is anyone's guess. We can imagine this extension leading to future papers entitled "A Quantum Mechanical Approach to Network Performance".
RFC 1185 is an attempt to get around the problem of the window wrapping too quickly without explicitly increasing the sequence number space. Instead, the RFC proposes to use the timestamp used in the ECHO option to weed out old duplicate messages. The algorithm presented in RFC 1185 is complex and has been shown to be seriously flawed at a recent End-to-End Research Group meeting. Attempts are currently underway to fix the algorithm presented in the RFC. We believe that this is a serious mistake.
We see two problems with this approach on a very fundamental level. First, we believe that making TCP depend on accurate clocks for correctness to be a mistake. The Internet community has NO experience with transport protocols that depend on clocks for correctness. Second, the proposal uses two distinct schemes to deal with old duplicate packets: the sliding window algorithm takes care of "new" old packets (packets from the current sequence number epoch) and the timestamp algorithm deals with "old" old packets (packets from previous sequence number epochs). It is hard enough getting one of these schemes to work much less to get two to work and ensure that they do not interfere with one another.
In RFC 1185, the statement is made that "An obvious fix for the problem of cycling the sequence number space is to increase the size of the TCP sequence number field." Using protocol evolution, the obvious fix is also the correct one. The window size can be increased to 32 bits by simply changing a short to a long in the definition of the TCP header. At the same time, the sequence number and acknowledgment fields can be increased to 64 bits. This change is the minimum complexity modification to get the job done and requires little or no analysis to be shown to work correctly.
On machines that do not support 64-bit integers, increasing the sequence number size is not as trivial as increasing the window size. However, it is identical in cost to the modification proposed in RFC 1185; the high order bits can be thought of as an optimal clock that ticks only when it has to. Also, because we are not dealing with real time, the problems with unreliable system clocks is avoided. On machines that support 64-bit integers, the original TCP code may be reused. Since only very high performance machines can hope to drive a communications network at the rates this modification is designed to support, and the new generation of RISC microprocessors (e.g., MIPS R4000 and PA-RISC) do support 64-bit integers, the assumption of 64-bit arithmetic may be more of an advantage than a liability.
3.1.3. Selective Retransmission
Another problem with TCP's support for LFN's is that the sliding window algorithm used by TCP does not support any form of selective acknowledgment. Thus, if a segment is lost, the total amount of data that must be re-transmitted is some constant times the bandwidth-delay product, despite the fact that most of the segments have in fact arrived at the receiver. RFC 1072 proposes to extend TCP to allow the receiver to return partial acknowledgments to the sender in the hope that the sender will use that information to avoid unnecessary re-transmissions.
It has been our experience on predictable local area networks that the performance of partial re-transmission strategies is highly non-obvious, and it generally requires more than one iteration to find a decent algorithm. It is therefore not surprising that the algorithm proposed in RFC 1072 has some problems. The proposed TCP extension allows the receiver to include a short list of received fragments with every ACK. The idea being that when the receiver sends back a normal ACK, it checks its queue of segments that have been received out of order and sends the relative sequence numbers of contiguous blocks of segments back to the sender. The sender then uses this information to re-transmit the segments transmitted but not listed in the ACK.
As specified, this algorithm has two related problems: (1) it ignores the relative frequencies of delivered and dropped packets, and (2) the list provided in the option field is probably too short to do much good on networks with large bandwidth-delay products. In every model of high bandwidth networks that we have seen, the packet loss rate is very low, and thus, the ratio of dropped packets to delivered packets is very low. An algorithm that returns ACKs as proposed is simply going to have to send more information than one in which the receiver returns NAKs.
This problem is compounded by the short size of the TCP option field (44 bytes). In theory, since we are only worried about high bandwidth networks, returning ACKs instead of NAKs is not really a problem; the bandwidth is available to send any information that's needed. The problem comes when trying to compress the ACK information into the 44 bytes allowed. The proposed extensions effectively compresses the ACK information by allowing the receiver to ACK byte ranges rather than segments, and scaling the relative sequence numbers of the re-transmitted segments. This makes it much more difficult for the sender to tell which segments should be re-transmitted, and complicates the re-transmission code. More importantly, one should never compress small amounts of data being sent over a high bandwidth network; it trades a scarce resource for an abundant resource. On low bandwidth networks, selective retransmission is not needed and the SACK option should be disabled.
We propose two solutions to this problem. First, the receiver can examine its list of out-of-order packets and guess which segments have been dropped, and NAK those segments back to the sender. The number of NAKs should be low enough that one per TCP packet should be sufficient. Note that the receiver has just as much information as the sender about what packets should be retransmitted, and in any case, the NAKs are simply suggestions which have no effect on correctness.
Our second proposed modification is to increase the offset field in the TCP header from 4 bits to 16 bits. This allows 64k-bytes of TCP header, which allows us to radically simplify the selective re-transmission algorithm proposed in RFC 1072. The receiver can now simply send a list of 64-bit sequence numbers for the out-of-order segments to the sender. The sender can then use this information to do a partial retransmission without needing an ouji board to translate ACKs into segments. With the new header size, it may be faster for the receiver to send a large list than to attempt to aggregate segments into larger blocks.
3.1.4. Header Modifications
The modifications proposed above drastically change the size and structure of the TCP header. This makes it a good time to re-think the structure of the proposed TCP header. The primary goal of the current TCP header is to save bits in the output stream. When TCP was developed, a high bandwidth network was 56kbps, and the key use for TCP was terminal I/O. In both situations, minimal header size was important. Unfortunately, while the network has drastically increased in performance and the usage pattern of the network is now vastly different, most protocol designers still consider saving a few bits in the header to be worth almost any price. Our basic goal is different: to improve performance by eliminating the need to extract information packed into odd length bit fields in the header. Below is our first cut at such a modification.
The protocol id field is there to make further evolutionary modifications to TCP easier. This field basically subsumes the protocol number field contained in the IP header with a version number. Each distinct TCP version has a different protocol id and this field ensures that the right code is looking at the right header. The offset field has been increased to 16 bits to support the larger header size required, and to simplify header processing. The code field has been extended to 16 bits to support more options.
The source port and destination port are unchanged. The size of both the sequence number and ACK fields have been increased to 64 bits. The open window field has been increased to 32 bits. The checksum and urgent data pointer fields are unchanged. The echo and echo reply fields are added. The option field remains but can be much larger than in the old TCP. All headers are padded out to 32 bit boundaries. Note that these changes increase the minimum header size from 24 bytes (actually 36 bytes if the ECHO and ECHO reply options defined in RFC 1072 are included on every packet) to 48 bytes. The maximum header size has been increased to the maximum segment size. We do not believe that the the increased header size will have a measurable effect on protocol performance.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Protocol ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Offset | Code |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source | Dest |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Seq |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Ack |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Window |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | Urgent |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Echo |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Echo Reply |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Pad |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3.1.5. Backward Compatibility
The most likely objection to the proposed TCP extension is that it is not backward compatible with the current version of TCP, and most importantly, TCP's header. In this section we will present three versions of the proposed extension with increasing degrees of backward compatibility. The final version will combine the same degree of backward compatibility found in the protocol described in RFC's 1072/1185, with the much simpler semantics described in this RFC.
We believe that the best way to preserve backward compatibility is to leave all of TCP alone and support the transparent use of a new protocol when and where it is needed. The basic scheme is the one described in section 2.4. Those machines and operating systems that need to support high speed connections should implement some general protocol infrastructure that allows them to rapidly evolve protocols. Machines that do not require such service simply keep using the existing version of TCP. A virtual protocol is used to manage the use of multiple TCP versions.
This approach has several advantages. First, it guarantees backward compatibility with ALL existing TCP versions because such implementations will never see strange packets with new options. Second, it supports further modification of TCP with little additional costs. Finally, since our version of TCP will more closely resemble the existing TCP protocol than that proposed in RFC's 1072/1185, the cost of maintaining two simple protocols will probably be lower than maintaining one complex protocol. (Note that with high probability you still have to maintain two versions of TCP in any case.) The only additional cost is the memory required for keeping around two copies of TCP.
For those that insist that the only efficient way to implement TCP modifications is in a single monolithic protocol, or those that believe that the space requirements of two protocols would be too great, we simply migrate the virtual protocol into TCP. TCP is modified so that when opening a connection, the sender uses the TCP VERSION option attached to the SYN packet to request using the new version. The receiver responds with a TCP VERSION ACK in the SYN ACK packet, after which point, the new header format described in Section 3.1.4 is used. Thus, there is only one version of TCP, but that version supports multiple header formats. The complexity of such a protocol would be no worse than the protocol described in RFC 1072/1185. It does, however, make it more difficult to make additional changes to TCP.
Finally, for those that believe that the preservation of the TCP's header format has any intrinsic value (e.g., for those that don't want to re-program their ethernet monitors), a header compatible version of our proposal is possible. One simply takes all of the additional information contained in the header given in Section 3.1.4 and places it into a single optional field. Thus, one could define a new TCP option which consists of the top 32 bits of the sequence and ack fields, the echo and echo_reply fields, and the top 16 bits of the window field. This modification makes it more difficult to take advantage of machines with 64-bit address spaces, but at a minimum will be just as easy to process as the protocol described in RFC 1072/1185. The only restriction is that the size of the header option field is still limited to 44 bytes, and thus, selective retransmission using NAKs rather than ACKs will probably be required.
The key observation is that one should make a protocol extension correct and simple before trying to make it backward compatible. As far as we can tell, the only advantages possessed by the protocol described in RFC 1072/1185 is that its typical header, size including options, is 8 to 10 bytes shorter. The price for this "advantage" is a protocol of such complexity that it may prove impossible for normal humans to implement. Trying to maintain backward compatibility at every stage of the protocol design process is a serious mistake.
3.2. TCP Over Extension
Another potential problem with TCP that has been discussed recently, but has not yet resulted in the generation of an RFC, is the potential for TCP to grab and hold all 2**16 port numbers on a given machine. This problem is caused by short port numbers, long MSLs, and the misuse of TCP as a request-reply protocol. TCP must hold onto each port after a close until all possible messages to that port have died, about 240 seconds. Even worse, this time is not decreasing with increase network performance. With new fast hardware, it is possible for an application to open a TCP connection, send data, get a reply, and close the connection at a rate fast enough to use up all the ports in less than 240 seconds. This usage pattern is generated by people using TCP for something it was never intended to do---guaranteeing at-most-once semantics for remote procedure calls.
The proposed solution is to embed an RPC protocol into TCP while preserving backward compatibility. This is done by piggybacking the request message on the SYN packet and the reply message on the SYN-ACK packet. This approach suffers from one key problem: it reduces the probability of a correct TCP implementation to near 0. The basic problem has nothing to do with TCP, rather it is the lack of an Internet request-reply protocol that guarantees at-most-once semantics.
We propose to solve this problem by the creation of a new protocol. This has already been attempted with VMTP, but the size and complexity of VMTP, coupled with the process currently required to standardize a new protocol doomed it from the start. Instead of solving the general problem, we propose to use Sprite RPC [7], a much simpler protocol, as a means of off-loading inappropriate users from TCP.
The basic design would attempt to preserve as much of the TCP interface as possible in order that current TCP (mis)users could be switched to Sprite RPC without requiring code modification on their part. A virtual protocol could be used to select the correct protocol TCP or Sprite RPC if it exists on the other machine. A backward compatible modification to TCP could be made which would simply prevent it from grabbing all of the ports by refusing connections. This would encourage TCP abusers to use the new protocol.
Sprite RPC, which is designed for a local area network, has two problems when extended into the Internet. First, it does not have a usefully flow control algorithm. Second, it lacks the necessary semantics to reliably tear down connections. The lack of a tear down mechanism needs to be solved, but the flow control problem could be dealt with in later iterations of the protocol as Internet blast protocols are not yet well understood; for now, we could simple limit the size of each message to 16k or 32k bytes. This might also be a good place to use a decomposed version of Sprite RPC [2], which exposes each of these features as separate protocols. This would permit the quick change of algorithms, and once the protocol had stabilized, a monolithic version could be constructed and distributed to replace the decomposed version.
In other words, the basic strategy is to introduce as simple of RPC protocol as possible today, and later evolve this protocol to address the known limitations.
3.3. Future Modifications
The header prediction algorithm should be generalized so as to be less sensitive to changes in the protocols header and algorithm. There almost seems to be as much effort to make all modifications to TCP backward compatible with header prediction as there is to make them backward compatible with TCP. The question that needs to be answered is: are there any changes we can made to TCP to make header prediction easier, including the addition of information into the header. In [6], the authors showed how one might generalize optimistic blast from VMTP to almost any protocol that performs fragmentation and reassembly. Generalizing header prediction so that it scales with TCP modification would be step in the right direction.
It is clear that an evolutionary change to increase the size of the source and destination ports in the TCP header will eventually be necessary. We also believe that TCP could be made significantly simpler and more flexible through the elimination of the pseudo-header. The solution to this problem is to simply add a length field and the IP address of the destination to the TCP header. It has also been mentioned that better and simpler TCP connection establishment algorithms would be useful. Some form of reliable record stream protocol should be developed. Performing sliding window and flow control over records rather than bytes would provide numerous opportunities for optimizations and allow TCP to return to its original purpose as a byte-stream protocol. Finally, it has become clear to us that the current Internet congestion control strategy is to use TCP for everything since it is the only protocol that supports congestion control. One of the primary reasons many "new protocols" are proposed as TCP options is that it is the only way to get at TCP's congestion control. At some point, a TCP-independent congestion control scheme must be implemented and one might then be able to remove the existing congestion control from TCP and radically simplify the protocol.