TCP lies at the heart of two of the most widely used network architectures, the OSI [9] and the TCP/IP [27]reference models. It is located in the Transport layer in both models see figure 2.1 . The main aim of the transport layer is to give an end-to-end data transport service to the upper layers and also to act in a way so
Chapter 2 Transmission Control Protocol and TCP Congestion Control
Figure 2.1: TCP/IP and OSI Reference models. Source [2]
that the upper layers can function normally even if there are changes in lower layers like hardware upgrade for example [2].
Two types of services are provided by the transport layer. One is based on the simple idea of sending messages without any guarantee of whether it will arrive at the destination or not and without any ordering of the sent messages [2]. This type of service is useful if loosing some messages will not affect the validity of the transmission like the case of video and audio streaming where some packets will not affect the service, provided that the number of lost packets is in an acceptable range. Also in this type of service (i.e. video and audio), retransmission of missing data is not acceptable since it is a real time service where having most of the packets arrive on time is much more important than retransmitting some packets in the middle.
Chapter 2 Transmission Control Protocol and TCP Congestion Control
Protocol, widely known as UDP [28]. UDP does not provide guarantees in terms of message delivery and correctness and it does not provide ordering. Moreover, UDP is suitable for applications that provide their own sequencing and flow control mechanisms [2].
The second type of service provided by the transport layer is a guaranteed ser- vice. Here the correctness and the ordering of delivered data are guaranteed. The implementation of this service is done by TCP [2].
Transmission Control Protocol [4], widely known as TCP, is a transport layer protocol to transport data through the network in a reliable and error free mode. It delivers messages from one end to another and makes sure that all packets have been delivered uncorrupted and in order. TCP is a connection oriented protocol, so, before TCP starts transmitting data between two ends, it establishes an agreement of how the connection should be operated. This is done by exchanging control packets before the real data is transmitted [29] [2]. An analogy to this is when we use the analogue phone and we need to dial the number before we can start talking. Because of the nature of the IP routing used in the Internet, not all packets will follow the same path from source to destination. This fact may cause packets to be reordered so some packets may be received out of order. TCP should be prepared to accept out of order packets and to expect delays in some packets. Normally TCP will assume a time limit for each packet to reach a destination and the packet will be considered lost after this time limit [29].
Other important functions of TCP are flow control and congestion control. In flow control, TCP makes sure that there is a coordination between the sender and the receiver so the sender will not send more than the capacity of the receiver buffer. TCP should be able to coordinate the source and destination, so the source will not overflow the destination buffer. To achieve this the receiver tells the sender its
Chapter 2 Transmission Control Protocol and TCP Congestion Control
maximum buffer size during the connection establishment phase [29].
In congestion control, TCP detects congestion by using packet drops as a sign of congestion in the network and then it tries to resolve congestion by reducing the sender’s transmission rate to prevent creating permanent congestion. TCP should have some awareness of the link status in order to avoid injecting the link with more data than its capacity. Congestion control algorithms [10] [11] are used for this purpose [29].
Moreover, in order for TCP to operate in an environment like the Internet, TCP should be able to handle connections with variable round trip times (Round trip time, RTT, is the time from a packet is sent until an acknowledgment is re- ceived) [29]. Since, TCP is supposed to be able to connect any two hosts in the Internet, no matter how far apart they are, it should be able to accept different round trip times for different connections and even different round trip times for the same connection. So it should be able to adjust its timeout mechanism to adopt with the variation in round trip times [29]. Later in this chapter we will show how TCP is able to handle variations in RTT.
These are some issues about TCP functionality. Next we explore in more detail some important mechanisms in TCP.