|
|
Transmission Control Protocol (TCP) is the transmission layer of the protocol and serves to ensure a reliable, verifiable data exchange between hosts on a network. TCP breaks data into pieces, first wrapping it with the information needed to route it to its destination and then reassembling the pieces at the receiving end of the communications link. The wrapped and bundled pieces are called datagrams . TCP puts a header on the datagram that provides the information needed to get the data to its destination. The most important information in the header includes the source and destination port numbers, a sequence number for the datagram, and a checksum.
The source port number and the destination port number ensure that the data is sent back and forth to the correct process running on each computer. The sequence number allows the datagrams to be rebuilt in the correct order in the receiving computer, and the checksum allows the protocol to check whether the data sent is the same as the data received. It does this by first totaling the contents of a datagram and inserting that number in the header. This is when IP enters the picture. Once the header is in the datagram, TCP passes the datagram to IP to be routed to its destination. The receiving computer then performs the same calculation, and if the two calculations do not match, an error has occurred somewhere along the line, and the datagram is re-sent.
Figure 3.2 shows the layout of the datagram with the TCP header in place.
Figure 3.2: A datagram with its TCP header
In addition to the source and destination port numbers, the sequence number, and the checksum, a TCP header contains the following information:
Acknowledgment Number Indicates that the data was received successfully. If the datagram is damaged in transit, the receiver throws the data away and does not send an acknowledgment back to the sender. After a predefined time-out expires, the sender retransmits the data for which no acknowledgment was received.
Offset Specifies the length of the header.
Reserved Variables set aside for future use.
Flags Indicates that this packet is the end of the data or that the data is urgent.
Window Provides a way to increase packet size, which improves efficiency in data transfers.
Urgent Pointer Gives the location of urgent data.
Options A set of variables reserved for future use or for special options as defined by the user of the protocol.
Padding Ensures that the header ends on a 32-bit boundary.
The data in the packet immediately follows this header information.
The following list summarizes the TCP process:
Flow control allows two systems to cooperate in datagram transmission to prevent overflows and lost packets.
Acknowledgment lets the sender know that the recipient has received the information.
Sequencing ensures that packets arrive in the proper order.
Checksums allow easy detection of lost or corrupted packets.
Retransmission of lost or corrupted packets is managed in a timely way.
|
|