The Transmission Control Protocol (TCP) is responsible for reliable end to end delivery of segments of information. Segments is the term that is used to describe the data that is transmitted and received at the Transport level of the OSI model where TCP resides. TCP also redirects the data to the appropriate which port (upper level service) that is required.
The reliable end to end delivery of data is accomplished by:
The redirection of data to the upper level service is accomplished by using Source and Destination Port numbers. Multiple connections to the same service is allowed. For example, you may have many users (clients) connected to a single web server (http is normally port 80). Each client will have a unique Port number assigned (typically above 8000) but the web server will only use Port 80.
i. TCP Header
The Source Port is a 16 bit number that Indicates the upper level service that the source is transmitting. For example:
Here is a complete listing of Well Known Ports. TCP allows port numbers to be in the range from 0 to 65,535. Clients will have a unique port number assigned to them by the server. Typically the number will be above 8,000.
The Destination Port is a 16 bit number that Indicates the upper level service that the source wishes to communicate with at the destination.
The Sequence Number is a 32 bit number that indicates the first octet of information in the data field. This is used to number each TCP segment transmitted in order to keep track of segments for sequencing of segments and error checking of lost segments. The source numbers the sequence of transmitted segments.
The Acknowledgement Number is a 32 bit number that is used to acknowledge the receipt of segments by the destination. The acknowledgement is the next sequence number expected. If the sender does not receive an acknowledgement for a segment transmitted, the sender will time-out and retransmit.
Offset (4 bits)
The Offset field consists of the first 4 bits (xxxx0000) of the first byte. The last 4 bits are reserved for future use and are set to 0. The Offset measures the number of 32 bit (4 byte) words in the TCP header to where the Data field starts. This is necessary because the TCP header has a variable length. The minimum length of the TCP header is 20 bytes which gives an Offset value of 5.
Flags (last 6 bits)
The Flags Field consist of the last 6 bits (00xxxxxx) of the second byte with the first 2 bits reserved for future use and they are set to 0. The Flags field consists of the following flag bits:
Windows (16 bits)
This contains the number of unacknowledged segments that are allowed on the network at any one time. This is negogiated by the Source and Destination TCP layers.
The Checksum field is 16 bits long and calculates a checksum based on the complete TCP Header and what is called the TCP Pseudo header. The TCP Pseudo header consists of the Source IP Address, Destination IP Address, Zero, IP Protocol field and TCP Length. The IP Protocol field value is 6 for TCP
This field communicates the current value of the urgent pointer as a positive offset from the sequence number in this segment. The urgent pointer points to the sequence number of the octet following the urgent data. This field is only be interpreted in segments with the URG control bit set.
Options may occupy space at the end of the TCP header and are a multiple of 8 bits in length. The allowed options are:
The TCP header padding is used to ensure that the TCP header ends and data begins on a 32 bit boundary. The padding is composed of zeros.
DataFinally here's the data that is being transmitted.
If this page has helped you, please consider donating $1.00 to support the cost of hosting this site, thanks.