INTRODUCTION
The protocols at the transport layer of the OSI reference model provides an end-to-end data delivery service for application processes to exchange messages over the Internet. Protocols operating in the Transport layer use the services of the Internet Protocol (IP) to deliver messages. Many protocols exist at his layer and one of the most important protocols at this layer is Transmission Control Protocol (TCP) for the delivery of data between the Application Layer and the Internet Layer. The shortcoming of IP to guarantee the delivery of datagrams is overcome by TCP by setting up a virtual circuit between the communicating parties. In this review, we examine the TCP protocol over IP and provide information on some important modern applications of the TCP/IP protocols.
1.1 TRANSMISSION CONTROL PROTOCOL (TCP)
The design of TCP was specifically to provide reliable end-to-end delivery of data over an unreliable medium. The unreliable medium of transport is the Internet Protocol (IP). TCP is a connection-oriented protocol with guaranteed delivery of transport layer segments and error detection mechanism. TCP was first defined in 1981 in Request for Comments, RFC 793 and after a number of intervening RFC releases, the latest is the RFC 4614. Although, IP does the major work in moving datagrams around the network as needed, TCP is important to make sure the data inside of the IP datagram is correct. Critical applications such as e-mail and Telnet require reliable and guaranteed delivery of data which is made possible by virtual circuit that TCP sets up whenever two applications need to communicate. Before communications begin using TCP, the two applications have to agree on some basic parameters before segments can be sent. This is done in a manner referred to as three-way handshake.
In the three-way handshake before the sender can start sending, rules for data transmission is negotiated. The first part of a three-way handshake begins with the sender transmitting a TCP segment with the Synchronization ("SYN") bit set. The TCP sequence number is the value being negotiated here. The recipient responds with a TCP segment with both the synchronization and acknowledgement bits set as "SYN/ACK". This is the second part of the three-way handshake. The sender then responds with an ACK, and the three-way handshake is complete. In tearing down the communication channel, TCP uses the FIN ("finish) bit to bring the channel down when the communication is closed.
TCP performs error detection and error recovery by using a sequence number and an acknowledgement number ("ACK") in the TCP header. The sender waits for a positive message from the recipient that the data was received and if that message isn't received, the data is retransmitted. This process is known as Positive Acknowledgement with Retransmission (PAR).
Before data transmission begins, the two parties must agree on the size of data to be transmitted by the sender before the receiver gives positive acknowledgement of the received data. This size of data is known as window size. The window size is defined by the volume of data that a sender is allowed to transmit without waiting for an “ACK”. The window size is decided by the recipient and not the sender, giving the recipient some control over how much data is sent, a feature that is referred to as flow control. During the cause of window transfer, a recipient can dynamically renegotiate the size of the window either to increase it, if it is processing the data much faster than the sender is sending or to reduce it if much data is yet to be processed while more data is still being sent. This adjustment of the window size is known as sliding window. The sliding window protocol uses timer for its functions. When a segment is sent by a sender, the sender starts a timer. The receiver is supposed to send an acknowledgement of the segment (depending on the window size). If the timer elapses before the acknowledgement is received, the segment is retransmitted by the sender, with the belief that the initial segment is lost in transit or has become corrupt and discarded by the receiver.
TCP Port Numbers
When there are multiple connections from a host computer to another remote computer, the MAC and IP addresses of the two communicating parties will still be the same. In order to differentiate the multiple connections, TCP uses Port numbers for each connection.
The combination of an IP address and port number is referred to as Socket. For example, the socket on 192.78.35.8 for port 25 is 192.78.35.8:25. The sender and receiver need to agree on what port is used for a given protocol, otherwise there will be misinterpretation of port numbers. That is why most protocols use some specified port numbers at all times. These frequently used port numbers are referred to as well-known port numbers. Some commonly used well-known port numbers and their applications are listed below
- Secure Shell (SSH): Uses TCP port 22
- Telnet uses TCP port 23
- Simple Mail Transfer Protocol (SMTP): uses TCP port 25
- Hyper-Text Transfer Protocol (HTTP): uses TCP port 80
- Post Office Protocol 3 (POP3): uses TCP port 110
- Secure Socket Layer (SSL): uses TCP port 443
1.2 TCP PROTOCOL DATA UNITS
The data unit of the TCP protocol at the transport layer is referred to as a Segment which comprises the TCP header and body that contains the data. Unlike some other core protocols, not all TCP segments carry data, since some of them are used only for control information about the TCP connection. The total sizes of segments vary according to the size of the data and any options that may be in use. Table 1 below shows the structure of a TCP header with each field explained subsequently.
- Source Port: A 16-bit field that identifies the local TCP user that is, port of sending host. It also identifies the application that generated the segment and the port number used by the application.
- Destination Port: A 16-bit field that identifies the remote machine's TCP user that is, port of End Point Destination. It identifies the application that the segment is meant for.
- Sequence Number: This is the number indicating the current block's position in the overall message being sent. Sequence number of bytes transmitted in a segment is used to verify that all bytes are received in the right order. Every byte of data sent across a virtual circuit is given a unique sequence number.
- Acknowledgment Number: This is the sequence number of the byte the local host is expecting next. It identifies the next byte of data that a system is expecting to receive from the remote system. As data is received, the recipient through acknowledgement number identifies the data it is ready to receive next.
- Offset Data / Header Length: Length of the TCP Segment. The number of 32-bit words in the TCP header. It indicates where the data begins.
- Reserved: Reserved for Future Use. Always set to zero.
- Flags: Specifies what content is in the segment.
- Window: A number indicating how many blocks of data the receiving machine can accept.
- Checksum: Verify that the Header is not corrupted during transmission.
- Urgent Pointer: This is used when urgent data is being sent and the ‘URG’ flag is set. This field thus indicates the portion of the data message that is urgent by specifying the offset from the sequence number in the header. The action on the urgent message is done by the application and TCP takes no specific action concerning urgent data.
- Options: The options field is used for specifying TCP options. Each option has an option number, the number of bytes in the option, and the option values. The following are the options currently defined for TCP include
‘0’ - End of option list
‘1’- No operation
‘2’ - Maximum segment size
‘3’ - Window scale
‘4’ - Sack-permitted
’5’ – Sack
’6’ - Timestamps.
- Padding: Filled to ensure that the header is a 32-bit multiple.
1.3 TCP SERVICES
TCP provides five important services to higher-layer application. These are virtual circuits, application I/O management, network I/O management, flow control and Reliability. These are explained below.
- Virtual Circuits
TCP establishes a virtual circuit for communication to commence between two applications for reliability and flow control. The inherent weakness of IP in providing unreliable datagram transfer is overcome by TCP by building a virtual circuit on top of IP datagram and then monitoring the datagram as it is sent through the TCP virtual circuit. Every TCP virtual circuit is established between a pair of endpoints. This implies that if an application needs to communicate with more than one endpoint at the same time, then it must establish separate virtual circuits for each pair of endpoints.
- Application I/O Management
Another service provided by TCP is that it allows applications to send and receive information as streams of data. TCP monitors the data stream by converting the data into individual segments and sends them over IP. TCP provides four distinct application I/O management services to applications:
- Internal Addressing: TCP assigns unique port numbers to every application using a TCP virtual circuit.
- Opening Circuits: TCP opens a connection to a remote application when a requesting application asks for connection.
- Data Transfer: Whenever an application needs to send data, it just hands it off to TCP for delivery to the destination system.
- Destroying Circuits: Once applications have finished exchanging data, TCP in informed to close the virtual circuit.
- Network I/O Management
There are a number of processes involved before an application sends data to another application over TCP for onward transmission to IP. An efficient segment size also plays a major role in the successful delivery of datagrams using TCP/IP. The following factors determine the most efficient segment size:
- Buffer Size: The sizes of both the send buffer on the local system and receive buffer on the destination system are major determinant of the segment size. If the segments are too large, there will be loss of segments and if too small it will amount to underutilization of network resources.
- MTU and MRU Sizes: Maximum amount of data that an IP datagram can handle is referred to as the Maximum Transfer Unit (MTU) size of the physical medium, while the Maximum Receive Unit (MRU) is the allowable data size of the destination system’s network connection. The MTU, MRU and the MTU/MRU sizes of all the intermediary networks in-between the two endpoint systems have to be taken into consideration. Generally, the MTU of a TCP segment is 1500 bytes. If the segment size is too large then fragmentation (division of the segments into allowable IP datagram) will occur, reducing performance and reliability of the communication.
- Header Size: In the creation of segments, TCP must leave room for IP and TCP headers in the segments so that their addition to the datagram will not result in too large segment sizes that will lead to fragmentation.
- Data Size and Timelines: If high volume of data is being generated by an application, then lots of TCP segments will need to be sent quickly. This may mean sending of small trickles of data in a timely manner and application may request that data be sent immediately, bypassing the queue entirely.
- Flow Control
This is the management of data transfer between two applications over TCP. This function of TCP is important in order to prevent the congestion of the network. This situation arises when the load offered to a network is more than it can handle. TCP uses a variety of flow control mechanisms, allowing the sending system to react to changes in the receiving systems in the course of data transfer and processing. When a receiver sends an ‘ACK’ back to the sender, it also tells the sender the number of bytes it can receive without causing an overflow in its internal buffers. This is then sent back to the sender in the ACK in the form of the highest sequence number it can conveniently receive. One of these mechanisms is windowing as mentioned earlier. TCP also uses a congestion window with a size equal to the number of bytes that the sender can send at any time. This congestion window is maintained alongside the flow control window. Each time a segment is to be sent, the protocol compares the two window sizes and uses the smaller of the two.
- Reliability
TCP’s reliability services include recovering from damaged, lost, duplicated, or delivered out-of-order data. The most basic form of reliability is the use of checksums to validate segments. Sequence number is another form of reliability used to provide delivery services to ensure that data arrives at destinations. The use of acknowledgement number to state that a receiver has all of the data within a segment and that it is ready for more data is another form of reliability service provided by TCP. Every data sent across a virtual circuit that is lost or corrupted will not be acknowledged. Therefore, TCP uses an acknowledgement timer to allow the sender to retransmit data that does not get acknowledged after a set time.
APPLICATIONS OF TCP/IP TO CONTROL SYSTEMS
The latest advances in technology are also not leaving modern control systems behind. In order to maximize the production process and plant availability, remote monitoring and maintenance is being employed. The architecture used for remotely monitoring plants and processes is also employed to remotely automate the processes of a system through commands sent from mobile devices. The automation of processes both domestic and industrial and their control from remote locations is fast gaining grounds. At the heart of this developmental stride is the system or process to be controlled by the remote application of instructions using a reliable communication channel. TCP/IP becomes a transport layer protocol of choice because of its reliability of delivery of datagrams. Remote monitoring and control of systems require a fail-safe delivery mechanism to ensure its success.
Modern control systems make use of different wireless controllers to connect to the system being controlled. These intelligent controllers are equipped with Simple Message Service (SMS) capability to send alert messages to mobile devices and can receive instructions through same. Figure 1 below shows the architecture of a mobile SMS control system for a PLS system. In this configuration, the control information for the system is remotely sent to the SMS server using TCP/IP as the transport layer protocol. The SMS server receives the data sent from the mobile phone of the user through the TCP/IP client program resident on the PC and sends it to the MySQL data server. Using the same communication channel, the user can receive needed information on his phone by querying the system remotely using pre-defined commands by SMS.
Figure 1: Architecture of an SMS Control System using TCP/IP protocol (Yoon et al., 2007)
In this system, TCP/IP ensures the delivery of the information that is exchanged between the user's mobile phone and the system. This is a mission-critical system and justifies the choice or rather the necessity of a secure data transmission protocol like the TCP/IP combination.
CONCLUSION
TCP as a connection-oriented protocol that uses a 3-way handshake to ensure reliable information delivery supplements the inadequacy of the Internet Protocol (IP). Combined, the TCP/IP protocols form a reliable means of data delivery using a virtual circuit between the two communicating ends. This has formed the backbone of most internet traffic and a lot of important applications depend on TCP/IP. One important application that was considered in this write-up is the application of TCP/IP to control systems. Owing to the fact that these systems are mission-critical, a reliable means of communication using TCP/IP is required to ensure the success of the operations. The future prospects of TCP/IP is a bright one owing to its importance to reliable data delivery.
REFERENCES
Forouzan, B. A., 2007. Data communications and networking. 4th ed. New York, NY: McGraw-Hill Companies, Inc.
Kirubashankar, R., Krishnamurthy, K. and Indra, J., 2009. Remote monitoring system for distributed control of industrial process, Journal of Scientific & Industrial Research, pp.858-860. Accessed [23rd March, 2014].
Stallings, W., 2009. Business data communications. 6th ed. New Jersey, NJ: Pearson Educational Inc.
Tanenbaum, A.S., and Wetherall, D.J., 2011. Computer networks. 5th ed. Boston, MA: Pearson Education, Inc.
Yoon, J.C., Choi, J., Park, B.R., Kang, H.S. and Lee, J.W., 2007. Developing of SMS mobile system for PLS control system. Proceedings of ICALEPCS07, 392 – 394. Accessed [22nd March, 2014].